@vtj/designer 0.8.11 → 0.8.13

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
@@ -12,10 +12,10 @@ import ms from "mockjs";
12
12
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
13
13
  * @name @vtj/designer
14
14
  * @author CHC chenhuachun1549@dingtalk.com
15
- * @version 0.8.11
15
+ * @version 0.8.13
16
16
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
17
17
  */
18
- const vs = "0.8.11", Rt = {
18
+ const vs = "0.8.13", Rt = {
19
19
  width: 390,
20
20
  height: 844
21
21
  }, Tt = {
@@ -8816,25 +8816,8 @@ class Gi {
8816
8816
  }
8817
8817
  const En = Symbol("VtjEngine");
8818
8818
  class Bu extends sn {
8819
- app;
8820
- skeleton;
8821
- container;
8822
- service;
8823
- assets;
8824
- simulator;
8825
- emitter = te;
8826
- project = k(null);
8827
- current = k(null);
8828
- context = k(null);
8829
- isEmptyCurrent = k(!1);
8830
- history = k(null);
8831
- provider;
8832
- /**
8833
- * 当current变化时,更新该值,用于通知组件更新
8834
- */
8835
- changed = k(Symbol());
8836
8819
  constructor(e) {
8837
- super();
8820
+ super(), this.options = e;
8838
8821
  const {
8839
8822
  container: n,
8840
8823
  service: l,
@@ -8843,7 +8826,7 @@ class Bu extends sn {
8843
8826
  dependencies: r,
8844
8827
  materials: o,
8845
8828
  materialPath: i = "./"
8846
- } = e;
8829
+ } = this.options;
8847
8830
  this.container = n, this.service = l, this.provider = new El({
8848
8831
  mode: on.Design,
8849
8832
  globals: s,
@@ -8857,6 +8840,23 @@ class Bu extends sn {
8857
8840
  materialPath: i
8858
8841
  }), this.bindEvents(), this.init(a), Mt(this.render.bind(this)), Lt(this.dispose.bind(this));
8859
8842
  }
8843
+ app;
8844
+ skeleton;
8845
+ container;
8846
+ service;
8847
+ assets;
8848
+ simulator;
8849
+ emitter = te;
8850
+ project = k(null);
8851
+ current = k(null);
8852
+ context = k(null);
8853
+ isEmptyCurrent = k(!1);
8854
+ history = k(null);
8855
+ provider;
8856
+ /**
8857
+ * 当current变化时,更新该值,用于通知组件更新
8858
+ */
8859
+ changed = k(Symbol());
8860
8860
  async init(e) {
8861
8861
  const n = await this.service.init(e).catch((l) => (Se.warn("VTJEngine service init fail.", l), null));
8862
8862
  n && (n.dependencies = Wi.merge(n.dependencies || []), this.project.value = new dl(n), this.saveMaterials(), this.triggerReady());
@@ -8865,7 +8865,7 @@ class Bu extends sn {
8865
8865
  const e = t(this.container);
8866
8866
  if (e) {
8867
8867
  const n = Ut(Xi);
8868
- n.provide(En, Rn(this)), n.mount(e), this.app = n;
8868
+ this.options.install && n.use(this.options.install, this), n.provide(En, Rn(this)), n.mount(e), this.app = n;
8869
8869
  } else
8870
8870
  Se.warn("VTJEngine constructor param [ container ] is undefined");
8871
8871
  }
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@vtj/designer",
3
3
  "private": false,
4
- "version": "0.8.11",
4
+ "version": "0.8.13",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "mockjs": "~1.1.0",
8
8
  "monaco-editor": "~0.48.0",
9
- "@vtj/core": "~0.8.11",
10
- "@vtj/ui": "~0.8.11",
11
- "@vtj/icons": "~0.8.11",
12
- "@vtj/utils": "~0.8.11",
13
- "@vtj/renderer": "~0.8.11"
9
+ "@vtj/core": "~0.8.13",
10
+ "@vtj/icons": "~0.8.13",
11
+ "@vtj/renderer": "~0.8.13",
12
+ "@vtj/utils": "~0.8.13",
13
+ "@vtj/ui": "~0.8.13"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/mockjs": "~1.0.10",
17
17
  "vue": "~3.4.15",
18
18
  "vue-router": "~4.3.0",
19
- "@vtj/cli": "~0.8.3"
19
+ "@vtj/cli": "~0.8.4"
20
20
  },
21
21
  "files": [
22
22
  "dist",
@@ -15,8 +15,10 @@ export interface EngineOptions {
15
15
  materialPath?: string;
16
16
  globals?: Record<string, any>;
17
17
  adapter?: ProvideAdapter;
18
+ install?: (app: App, engine?: Engine) => void;
18
19
  }
19
20
  export declare class Engine extends Base {
21
+ private options;
20
22
  app?: App;
21
23
  skeleton?: SkeletonWrapperInstance | null;
22
24
  container: MaybeRef<HTMLElement | undefined>;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/designer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.10
5
+ * @version 0.8.12
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.10";
8
+ export declare const version = "0.8.12";