@vtj/designer 0.12.19 → 0.12.21

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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { f as e, A as E, H as r, p as t, o as i, O as n, Q as S, E as _, j as o, F as I, z as p, k as T, n as l, K as O, M as V, a as R, x as g, N as d, e as A, T as M, P as D, l as P, R as L, g as N, B as u, a4 as b, J as c, D as B, S as W, i as m, a6 as Y, I as w, h as x, a3 as y, t as C, m as G, V as K, v as U, b as f, d as k, c as F, y as H, q as v, u as X, W as Z, a5 as z, a7 as J, X as h, Y as j, $ as q, U as Q, a9 as $, L as aa, Z as sa, a1 as ea, C as Ea, ac as ra, ad as ta, aa as ia, ae as na, a8 as Sa, ab as _a, r as oa, a2 as Ia, s as pa, G as Ta, a0 as la, w as Oa } from "./index-CjCbyQpe.js";
1
+ import { f as e, A as E, H as r, p as t, o as i, O as n, Q as S, E as _, j as o, F as I, z as p, k as T, n as l, K as O, M as V, a as R, x as g, N as d, e as A, T as M, P as D, l as P, R as L, g as N, B as u, a4 as b, J as c, D as B, S as W, i as m, a6 as Y, I as w, h as x, a3 as y, t as C, m as G, V as K, v as U, b as f, d as k, c as F, y as H, q as v, u as X, W as Z, a5 as z, a7 as J, X as h, Y as j, $ as q, U as Q, a9 as $, L as aa, Z as sa, a1 as ea, C as Ea, ac as ra, ad as ta, aa as ia, ae as na, a8 as Sa, ab as _a, r as oa, a2 as Ia, s as pa, G as Ta, a0 as la, w as Oa } from "./index-BwxXEIL4.js";
2
2
  export {
3
3
  e as ACCESS,
4
4
  E as API_METHOD_TYPES,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/designer",
3
3
  "private": false,
4
- "version": "0.12.19",
4
+ "version": "0.12.21",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "低代码引擎",
@@ -26,12 +26,12 @@
26
26
  "marked": "~15.0.8",
27
27
  "mockjs": "~1.1.0",
28
28
  "monaco-editor": "~0.52.0",
29
- "@vtj/renderer": "~0.12.19",
30
- "@vtj/icons": "~0.12.19",
31
- "@vtj/core": "~0.12.19",
32
- "@vtj/ui": "~0.12.19",
33
- "@vtj/uni": "~0.12.19",
34
- "@vtj/utils": "~0.12.19"
29
+ "@vtj/core": "~0.12.21",
30
+ "@vtj/renderer": "~0.12.21",
31
+ "@vtj/icons": "~0.12.21",
32
+ "@vtj/uni": "~0.12.21",
33
+ "@vtj/utils": "~0.12.21",
34
+ "@vtj/ui": "~0.12.21"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/mockjs": "~1.0.10",
@@ -1,5 +1,5 @@
1
1
  import { ShallowReactive, InjectionKey, MaybeRef, App, Ref } from 'vue';
2
- import { Base, ProjectModel, BlockModel, HistoryModel, Service, Emitter, ProjectSchema, ProjectModelEvent, BlockSchema } from '@vtj/core';
2
+ import { Base, ProjectModel, BlockModel, HistoryModel, Service, Emitter, ProjectSchema, ProjectModelEvent, BlockSchema, EnhanceConfig } from '@vtj/core';
3
3
  import { Context, Provider, Access, ProvideAdapter } from '@vtj/renderer';
4
4
  import { SkeletonWrapperInstance } from '../wrappers';
5
5
  import { Simulator } from './simulator';
@@ -7,6 +7,9 @@ import { Assets } from './assets';
7
7
  import { Report } from './report';
8
8
  import { OpenApi } from './openapi';
9
9
  export declare const engineKey: InjectionKey<ShallowReactive<Engine>>;
10
+ /**
11
+ * 设计器引擎配置选项
12
+ */
10
13
  export interface EngineOptions {
11
14
  /**
12
15
  * 设计器渲染容器
@@ -72,8 +75,16 @@ export interface EngineOptions {
72
75
  * 适配远程接口
73
76
  */
74
77
  openApi?: OpenApi;
78
+ /**
79
+ * 开启应用整强
80
+ */
81
+ enhance?: boolean | EnhanceConfig;
75
82
  }
76
83
  export declare const SAVE_BLOCK_FILE_FINISH = "SAVE_BLOCK_FILE_FINISH";
84
+ /**
85
+ * 设计器引擎核心类,负责管理设计器的整体生命周期和状态
86
+ * 包括项目管理、文件操作、历史记录、渲染等核心功能
87
+ */
77
88
  export declare class Engine extends Base {
78
89
  options: EngineOptions;
79
90
  app?: App;
@@ -100,26 +111,104 @@ export declare class Engine extends Base {
100
111
  checkVersion: boolean;
101
112
  openApi?: OpenApi;
102
113
  constructor(options: EngineOptions);
114
+ /**
115
+ * 初始化引擎
116
+ * @param project 项目Schema
117
+ */
103
118
  private init;
119
+ /**
120
+ * 获取增强配置
121
+ * @param enhance 增强配置或布尔值
122
+ * @returns 增强配置对象
123
+ */
124
+ private getEnhanceConfig;
125
+ /**
126
+ * 检查项目是否被锁定
127
+ * @param slient 是否静默检查
128
+ * @returns 是否被锁定
129
+ */
130
+ private checkLocked;
131
+ /**
132
+ * 渲染设计器界面
133
+ */
104
134
  private render;
135
+ /**
136
+ * 绑定所有事件监听器
137
+ */
105
138
  private bindEvents;
139
+ /**
140
+ * 激活文件处理
141
+ * @param e 项目模型事件
142
+ */
106
143
  private activeFile;
144
+ /**
145
+ * 处理文件变更
146
+ * @param e 区块模型
147
+ */
107
148
  private changeFile;
108
149
  private changeCurrentFile;
109
150
  private updateCurrent;
151
+ /**
152
+ * 保存项目
153
+ * @param e 项目模型事件
154
+ */
110
155
  private saveProject;
156
+ /**
157
+ * 保存区块文件
158
+ * @param e 项目模型事件
159
+ */
111
160
  private saveBlockFile;
112
161
  onSaveBlockFileFinish(callback: (e: ProjectModelEvent) => void): void;
162
+ /**
163
+ * 保存物料资源
164
+ */
113
165
  private saveMaterials;
114
166
  private saveCurrentFile;
167
+ /**
168
+ * 初始化历史记录
169
+ * @param block 区块模型
170
+ */
115
171
  private initHistory;
172
+ /**
173
+ * 保存历史记录
174
+ * @param e 历史模型事件
175
+ */
116
176
  private saveHistory;
177
+ /**
178
+ * 加载历史记录
179
+ * @param e 历史模型事件
180
+ */
117
181
  private loadHistory;
182
+ /**
183
+ * 发布项目
184
+ */
118
185
  private publish;
186
+ /**
187
+ * 生成源代码
188
+ * @returns 生成的源代码
189
+ */
119
190
  genSource(): Promise<string | undefined>;
191
+ /**
192
+ * 应用AI生成的DSL
193
+ * @param dsl 区块Schema
194
+ */
120
195
  applyAI(dsl: BlockSchema): Promise<void>;
196
+ /**
197
+ * 发布当前文件
198
+ */
121
199
  private publishCurrent;
200
+ /**
201
+ * 销毁引擎,清理资源
202
+ */
122
203
  dispose(): void;
204
+ /**
205
+ * 打开指定文件
206
+ * @param fileId 文件ID
207
+ */
123
208
  openFile(fileId?: string): Promise<void>;
124
209
  }
210
+ /**
211
+ * 在Vue组件中使用引擎的hook
212
+ * @returns 引擎实例
213
+ */
125
214
  export declare function useEngine(): ShallowReactive<Engine>;
@@ -21,7 +21,7 @@ export declare class Renderer {
21
21
  private install;
22
22
  createUniApp(platform: PlatformType, file: PageFile | BlockFile, renderer: any): App<any>;
23
23
  createApp(platform: PlatformType, file: PageFile | BlockFile, renderer: any): App<any>;
24
- render(block: BlockModel, file?: PageFile | BlockFile | null): void;
24
+ render(block: BlockModel, file?: PageFile | BlockFile | null): App<any> | null | undefined;
25
25
  dispose(): void;
26
26
  updateChild(node: NodeSchema, parent: BlockSchema | NodeSchema): void;
27
27
  private __onNodeChange;
@@ -1,5 +1,6 @@
1
- import { Ref, ShallowRef } from 'vue';
2
- import { Dependencie, Material, ApiSchema, MetaSchema, ProjectConfig, UniConfig, Base } from '@vtj/core';
1
+ import { Ref, ShallowRef, App } from 'vue';
2
+ import { Dependencie, Material, ApiSchema, MetaSchema, ProjectConfig, UniConfig, EnhanceConfig, Base } from '@vtj/core';
3
+ import { Provider } from '@vtj/renderer';
3
4
  import { Renderer } from './renderer';
4
5
  import { Designer } from './designer';
5
6
  import { Engine } from './engine';
@@ -24,10 +25,12 @@ export interface SimulatorEnv {
24
25
  globals: Record<string, any>;
25
26
  libraryLocaleMap: Record<string, any>;
26
27
  locales: Record<string, any>;
28
+ enhance?: (app: App, provider: Provider) => void;
27
29
  }
28
30
  export interface SimulatorOptions {
29
31
  engine: Engine;
30
32
  materialPath: string;
33
+ enhance?: EnhanceConfig;
31
34
  }
32
35
  export declare class Simulator extends Base {
33
36
  contentWindow: Window | null;
@@ -37,6 +40,7 @@ export declare class Simulator extends Base {
37
40
  materialPath: string;
38
41
  rendered: Ref<symbol>;
39
42
  devtools: DevTools;
43
+ enhance?: EnhanceConfig;
40
44
  constructor(options: SimulatorOptions);
41
45
  init(iframe: Ref<HTMLIFrameElement | undefined>, deps: Ref<Dependencie[]>, apis: Ref<ApiSchema[]>, meta: Ref<MetaSchema[]>, config: Ref<ProjectConfig>, uniConfig: Ref<UniConfig>): void;
42
46
  private createGlobalCss;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2025, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/designer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.12.18
5
+ * @version 0.12.20
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.12.18";
8
+ export declare const version = "0.12.20";
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./index-CjCbyQpe.js";
2
- export {
3
- f as default
4
- };