vis-core 0.24.5 → 0.24.6

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.
@@ -90,7 +90,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
90
90
  ).toString(CryptoJS.enc.Utf8), qe = JSON.parse($e), rt = Date.now();
91
91
  return !qe.s || qe.s > rt ? (this.token = void 0, "") : qe.e && qe.e < rt ? (this.token = void 0, "") : (qe.isValid = Qe, qe);
92
92
  }
93
- }, version = "0.24.5";
93
+ }, version = "0.24.6";
94
94
  /**
95
95
  * @license
96
96
  * Copyright 2010-2025 Three.js Authors
@@ -49495,7 +49495,7 @@ class Viewport {
49495
49495
  }
49496
49496
  setVis(r) {
49497
49497
  return q0(this, arguments, function* (e, s = {}) {
49498
- var Je;
49498
+ var Xe;
49499
49499
  if (!this.options.visFactories && (this.editor.setViewportVis(e), !this.options.visFactories)) {
49500
49500
  console.error("visFactories is not defined");
49501
49501
  return;
@@ -49503,20 +49503,18 @@ class Viewport {
49503
49503
  if (this.vis = this.options.visFactories, this.vis.visName !== e)
49504
49504
  throw new Error(`visName is not match, import {${e}}`);
49505
49505
  const T = this.editor.hooks.events.beforeSetVisOptions.length ? this.editor.hooks.dispatch("beforeSetVisOptions", s) : s;
49506
- this.vis.setOptions(ai(ai({}, T), this.extendsOptions)), this.vis.cameraState = ai({}, this.cameraState);
49507
- const de = this.editor.dev;
49508
- de && (this.vis.publicDir = de.publicDir), this.delLoadObj && (this.vis.delLoadArr = this.delLoadObj), this.vis.playing = this.editor.playing, this.vis._baseObjectByUuid = this.editor.baseObjectByUuid.bind(this.editor), this.vis._objectByUuid = this.editor.objectByUuid.bind(this.editor), this.vis.on("loaderProgress", (Ke, Qe) => {
49506
+ this.vis.setOptions(ai(ai({}, T), this.extendsOptions)), this.vis.cameraState = ai({}, this.cameraState), this.delLoadObj && (this.vis.delLoadArr = this.delLoadObj), this.vis.playing = this.editor.playing, this.vis._baseObjectByUuid = this.editor.baseObjectByUuid.bind(this.editor), this.vis._objectByUuid = this.editor.objectByUuid.bind(this.editor), this.vis.on("loaderProgress", (Je, Ke) => {
49509
49507
  this.editor.emit("progress", {
49510
49508
  type: "下载资源",
49511
- value: Ke / Qe * 100 | 0
49509
+ value: Je / Ke * 100 | 0
49512
49510
  });
49513
49511
  }), this.vis.on("settingsChanged", () => {
49514
49512
  this.editor.emit("settingsChanged");
49515
49513
  }), this.vis.on("show", () => {
49516
49514
  this.editor.emit("visShow");
49517
49515
  }), yield this.vis.init();
49518
- const { pencil: Xe } = this.vis;
49519
- Xe.userData.EditorEnv = !this.editor.playing, this.editor.pencil = Xe, this.editor.changeSelectOption(), this.editor.playing || (this.initEvent(), this.editor.emit("visChanged", this.vis)), (Je = this.vis) == null || Je.pencil.event.on("object3dListChange", () => {
49516
+ const { pencil: de } = this.vis;
49517
+ de.userData.EditorEnv = !this.editor.playing, this.editor.pencil = de, this.editor.changeSelectOption(), this.editor.playing || (this.initEvent(), this.editor.emit("visChanged", this.vis)), (Xe = this.vis) == null || Xe.pencil.event.on("object3dListChange", () => {
49520
49518
  this.editor.changeSelectOption();
49521
49519
  });
49522
49520
  });
@@ -49723,9 +49721,10 @@ class Hooks {
49723
49721
  });
49724
49722
  }
49725
49723
  addEvents(e) {
49726
- for (const s in e) {
49727
- const r = s;
49728
- this.events[r] && this.events[r].push(e[r].bind(e));
49724
+ var s;
49725
+ for (const r in e) {
49726
+ const T = r;
49727
+ this.events[T] && this.events[T].push(e[T].bind(e)), T === "afterShow" && ((s = this.editor.viewport.vis) == null ? void 0 : s.showState) === !0 && e[T](this.editor.viewport.vis);
49729
49728
  }
49730
49729
  }
49731
49730
  addStaticEvents(e) {
@@ -49734,16 +49733,16 @@ class Hooks {
49734
49733
  this.source !== s && (this.source = s, this.editor.emit("scriptsChanged"));
49735
49734
  }
49736
49735
  fromJSON(e) {
49737
- if (!e) {
49736
+ if (!e)
49738
49737
  this.source = "";
49739
- return;
49740
- }
49741
- try {
49742
- const s = new Function(`return ${e}()`)();
49743
- this.addEvents(s), this.source = e;
49744
- } catch (s) {
49745
- console.error(s);
49746
- }
49738
+ else
49739
+ try {
49740
+ const s = new Function(`return ${e}()`)();
49741
+ this.addEvents(s), this.source = e;
49742
+ } catch (s) {
49743
+ console.error(s);
49744
+ }
49745
+ this.editor.emit("scriptsChanged");
49747
49746
  }
49748
49747
  toJSON() {
49749
49748
  return this.source;
@@ -50743,7 +50742,7 @@ class Base extends Event {
50743
50742
  dbName: this.visName,
50744
50743
  cacheVersion: version
50745
50744
  }), this.delLoadArr && (this.loader.delLoadArr = this.delLoadArr), this.loader.on("progress", (...s) => {
50746
- this.emit("loaderProgress", ...s);
50745
+ this.showState !== !0 && this.emit("loaderProgress", ...s);
50747
50746
  });
50748
50747
  }
50749
50748
  addCSS3DRenderer() {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.24.5";
1
+ declare const _default: "0.24.6";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.24.5",
3
+ "version": "0.24.6",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && bundler",