@huanban/rulego-editor-core 1.3.1 → 1.3.2

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.
@@ -183,6 +183,8 @@ export interface HuanbanRulegoEditorOptions {
183
183
  json: string;
184
184
  imageDataUrl?: string;
185
185
  }) => void;
186
+ /** 劫持导入行为; 不设则使用内置 loadData 导入当前规则链 */
187
+ onImportDSL?: (data: RuleChainData) => void;
186
188
  /** 是否在画布右上工具条显示「运行」按钮, 默认 true */
187
189
  showRunButton?: boolean;
188
190
  /** 劫持运行行为; 不设则使用内置运行 Drawer */
@@ -203,10 +205,10 @@ export interface HuanbanRulegoEditorOptions {
203
205
  onLocaleChange?: (locale: string) => void;
204
206
  /** 是否在节点 Drawer 中显示调试日志 Tab, 默认 true (有 apiBase 时) */
205
207
  showDebugTab?: boolean;
206
- /** 是否在工具栏显示「部署/下架/重载」按钮, 默认 true */
208
+ /** 是否在工具栏显示「部署/下线/重载」按钮, 默认 true */
207
209
  showDeployButton?: boolean;
208
- /** 劫持部署行为; 不设则使用内置 API 调用 */
209
- onDeploy?: (chainId: string, action: 'deploy' | 'undeploy' | 'reload') => void | boolean | {
210
+ /** 劫持部署/下线行为;action 使用后端 operate 协议:start=部署/启动,stop=下线 */
211
+ onDeploy?: (chainId: string, action: 'start' | 'stop' | 'reload') => void | boolean | {
210
212
  success?: boolean;
211
213
  msg?: string;
212
214
  message?: string;
@@ -461,6 +463,12 @@ export declare class HuanbanRulegoEditor {
461
463
  toggleSidebar(): void;
462
464
  /** 适应画布 */
463
465
  fitView(): void;
466
+ /**
467
+ * 显示导入 DSL 弹窗
468
+ * 实现已提取到 editor-dialogs.ts
469
+ */
470
+ /** @internal 子模块(editor-toolbar)使用 */
471
+ _showImportDialog(): void;
464
472
  /**
465
473
  * 显示导出 DSL 弹窗
466
474
  * 实现已提取到 editor-dialogs.ts
@@ -29,6 +29,11 @@ export interface AuthFetchOptions {
29
29
  timeoutMs?: number;
30
30
  allowedOrigins?: string[];
31
31
  sensitiveHeaderNames?: string[];
32
+ /**
33
+ * Keep enabled by default for RuleGo backend APIs. Set to false for
34
+ * user-configured third-party endpoints that must not receive host auth.
35
+ */
36
+ includeAuthHeaders?: boolean;
32
37
  }
33
38
  /**
34
39
  * 带认证的 fetch 封装
@@ -73,8 +73,13 @@ export declare function showRuleChainSelector(ctx: EditorContext): void;
73
73
  */
74
74
  export declare function showSettingsDialog(ctx: EditorContext, initialTab?: SettingsDialogTab, options?: SettingsDialogOptions): void;
75
75
  /**
76
- * 显示导出 DSL 弹窗
77
- * 支持 下载 JSON 数据 + 下载画布 PNG 截图
76
+ * 显示导入 DSL 弹窗。
77
+ * 支持文件选择、拖拽、粘贴 JSON,并复用与导出编辑一致的校验和 loadData 路径。
78
+ */
79
+ export declare function showImportDialog(ctx: EditorContext): void;
80
+ /**
81
+ * 显示导出 DSL 弹窗。
82
+ * 支持下载 JSON、下载画布 PNG 截图、复制 JSON,以及编辑当前规则链 JSON 后应用到画布。
78
83
  * slot: onExportDSL 可劫持, 传入 { json, imageDataUrl }
79
84
  * @param ctx - 编辑器上下文
80
85
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanban/rulego-editor-core",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "RuleGo 规则链编辑器核心库 - 框架无关的 Headless 编辑器引擎 + API 抽象层 (WorkflowFetcher)",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",