vis-core 0.28.1 → 0.28.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.
@@ -88,7 +88,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
88
88
  ).toString(CryptoJS.enc.Utf8), ke = JSON.parse(Ae), He = Date.now();
89
89
  return !ke.s || ke.s > He ? (this.token = void 0, "") : ke.e && ke.e < He ? (this.token = void 0, "") : (ke.isValid = Pe, ke);
90
90
  }
91
- }, version = "0.28.1";
91
+ }, version = "0.28.2";
92
92
  /**
93
93
  * @license
94
94
  * Copyright 2010-2025 Three.js Authors
@@ -55798,7 +55798,7 @@ class ci extends hi {
55798
55798
  break;
55799
55799
  }
55800
55800
  const C = (m = t.parent) == null ? void 0 : m.key, w = this.setBaseObjectKey(t, r, C);
55801
- return v && this.objects.delete(v), this.pencil.event.emit("updateKey", t, w, v), w;
55801
+ return v && this.objects.delete(v), this.pencil.event.emit("lead.updateKey", { baseObject: t, key: w, oldKey: v }), w;
55802
55802
  }
55803
55803
  addBaseObject(t, r, m) {
55804
55804
  return se(this, null, function* () {
@@ -55806,7 +55806,7 @@ class ci extends hi {
55806
55806
  const v = t.object3d;
55807
55807
  v.material && Array.isArray(v.material) && (v.material = v.material.slice()), this.pencil.options.mList && (this.mList.proxyBaseObject(t), this.mList.addBaseObjectMap(t)), m && t.setTop(m), r !== null && (r.add(t.object3d), this.objMap.set(t.object3d, t));
55808
55808
  }
55809
- t.render(), this.pencil.event.emit("draw", t);
55809
+ t.render(), this.pencil.event.emit("lead.draw", { baseObject: t });
55810
55810
  });
55811
55811
  }
55812
55812
  erase(...t) {
@@ -55826,7 +55826,7 @@ class ci extends hi {
55826
55826
  v.forEach((C) => {
55827
55827
  C.disposeMaterialIfNotUsed = t, C.dispose();
55828
55828
  });
55829
- }), this.pencil.event.emit("erase", ...r);
55829
+ }), this.pencil.event.emit("lead.erase");
55830
55830
  }
55831
55831
  update(t, r) {
55832
55832
  this.objects.forEach((m) => {
@@ -55902,7 +55902,11 @@ class mi {
55902
55902
  }
55903
55903
  )
55904
55904
  };
55905
- this.fixBaseObjects.set(t, m);
55905
+ this.fixBaseObjects.set(t, m), this.pencil.event.emit("mList.add", {
55906
+ key: t,
55907
+ material: r,
55908
+ baseObject: m
55909
+ });
55906
55910
  }
55907
55911
  get(t) {
55908
55912
  const r = this.materials.get(t);
@@ -55969,7 +55973,7 @@ class mi {
55969
55973
  }
55970
55974
  remove(t) {
55971
55975
  const r = this.materials.get(t);
55972
- r && this.disposeMaterial(r), this.materials.delete(t), this.fixBaseObjects.delete(t);
55976
+ r && this.disposeMaterial(r), this.materials.delete(t), this.fixBaseObjects.delete(t), this.pencil.event.emit("mList.remove", { key: t, material: r });
55973
55977
  }
55974
55978
  removeByMaterial(t) {
55975
55979
  [...this.materials.entries()].some(([r, m]) => m === t ? (this.remove(r), !0) : !1);
@@ -58546,12 +58550,12 @@ class SetMaterialValue extends Command {
58546
58550
  }
58547
58551
  execute() {
58548
58552
  this.material !== void 0 && (this.material[this.attributeName] = this.newValue, needsUpdateAttributeName.includes(this.attributeName) && (this.material.needsUpdate = !0), this.editor.emit("materialChanged", this.material), setTimeout(() => {
58549
- this.attributeName === "name" && this.editor.emit("baseObjectListChange");
58553
+ this.attributeName === "name" && this.editor.emit("mListChange");
58550
58554
  }));
58551
58555
  }
58552
58556
  undo() {
58553
58557
  this.material[this.attributeName] = this.oldValue, needsUpdateAttributeName.includes(this.attributeName) && (this.material.needsUpdate = !0), this.editor.emit("materialChanged", this.material), setTimeout(() => {
58554
- this.attributeName === "name" && this.editor.emit("baseObjectListChange");
58558
+ this.attributeName === "name" && this.editor.emit("mListChange");
58555
58559
  });
58556
58560
  }
58557
58561
  update(t) {
@@ -59259,14 +59263,20 @@ class Viewport {
59259
59263
  this.editor.changeSelectOption(), this.editor.emit("visShow", !0);
59260
59264
  }), yield this.vis.init();
59261
59265
  const { pencil: C } = this.vis;
59262
- C.userData.EditorEnv = !this.editor.playing, this.editor.pencil = C, this.editor.changeSelectOption(), this.editor.playing || (this.initEvent(), this.editor.emit("visChanged", this.vis)), this.editor.on("baseObjectListChange", () => {
59266
+ C.userData.EditorEnv = !this.editor.playing, this.editor.pencil = C, this.editor.changeSelectOption(), this.editor.changeMListOptions(), this.editor.playing || (this.initEvent(), this.editor.emit("visChanged", this.vis)), this.editor.on("baseObjectListChange", () => {
59263
59267
  this.editor.changeSelectOption();
59264
- }), C.event.on("updateKey", () => {
59268
+ }), this.editor.on("mListChange", () => {
59269
+ this.editor.changeMListOptions();
59270
+ }), C.event.on("lead.updateKey", () => {
59265
59271
  this.editor.emit("baseObjectListChange");
59266
- }), C.event.on("draw", () => {
59272
+ }), C.event.on("lead.draw", () => {
59267
59273
  this.editor.emit("baseObjectListChange");
59268
- }), C.event.on("erase", () => {
59274
+ }), C.event.on("lead.erase", () => {
59269
59275
  this.editor.emit("baseObjectListChange");
59276
+ }), C.event.on("mList.add", () => {
59277
+ this.editor.emit("mListChange");
59278
+ }), C.event.on("mList.remove", () => {
59279
+ this.editor.emit("mListChange");
59270
59280
  });
59271
59281
  });
59272
59282
  }
@@ -59756,6 +59766,7 @@ class Editor {
59756
59766
  C0(this, "emit", this.events.emit.bind(this.events));
59757
59767
  C0(this, "options");
59758
59768
  C0(this, "selectOption", []);
59769
+ C0(this, "mListOptions", []);
59759
59770
  C0(this, "_dispose", !1);
59760
59771
  this.options = bi({
59761
59772
  assetsPrefix: "",
@@ -59790,7 +59801,7 @@ class Editor {
59790
59801
  }
59791
59802
  setObjectMaterial(t, r, m) {
59792
59803
  let v = t.material;
59793
- Array.isArray(t.material) && r !== void 0 ? (v = t.material[r], t.material[r] = m) : t.material = m, v != null && v.onBeforeCompile && !m.onBeforeCompile && (m.onBeforeCompile = v.onBeforeCompile), v != null && v.name && !m.name && (m.name = v.name);
59804
+ Array.isArray(t.material) && r !== void 0 ? (v = t.material[r], t.material[r] = m) : t.material = m, v != null && v.onBeforeCompile && (m.onBeforeCompile = v.onBeforeCompile), v != null && v.name && !m.name && (m.name = v.name);
59794
59805
  }
59795
59806
  uuidByObject(t) {
59796
59807
  var r;
@@ -59876,6 +59887,20 @@ class Editor {
59876
59887
  }).filter((v) => v !== null);
59877
59888
  this.selectOption = r([t.lead.scene]), this.emit("sceneGraphChanged");
59878
59889
  }
59890
+ changeMListOptions() {
59891
+ if (!this.pencil)
59892
+ return [];
59893
+ this.mListOptions = Array.from(this.pencil.mList.fixBaseObjects.keys()).map(
59894
+ (t) => {
59895
+ var m;
59896
+ const r = t.replace(t[0], t[0].toLowerCase());
59897
+ return {
59898
+ key: r,
59899
+ name: ((m = this.pencil.mList.get(r)) == null ? void 0 : m.name) || r
59900
+ };
59901
+ }
59902
+ ), this.emit("mListGraphChanged");
59903
+ }
59879
59904
  execute(t, r) {
59880
59905
  return B0(this, null, function* () {
59881
59906
  yield this.history.execute(t, r);
@@ -59923,6 +59948,8 @@ class Editor {
59923
59948
  }
59924
59949
  select(...t) {
59925
59950
  }
59951
+ mListSelect(...t) {
59952
+ }
59926
59953
  setViewportVis(...t) {
59927
59954
  }
59928
59955
  getDataURL() {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.28.1";
1
+ declare const _default: "0.28.2";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.28.1",
3
+ "version": "0.28.2",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && bundler",
@@ -69,7 +69,7 @@
69
69
  "esus-lite": "^0.2.8",
70
70
  "events": "^3.3.0",
71
71
  "geojson-cn": "^0.2.5",
72
- "gl-draw": "0.15.1",
72
+ "gl-draw": "0.15.3",
73
73
  "jsrsasign": "^11.1.0",
74
74
  "lodash-es": "^4.17.21"
75
75
  },