vis-core 0.21.60 → 0.21.61

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.
@@ -89,7 +89,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
89
89
  ).toString(CryptoJS.enc.Utf8), Jt = JSON.parse(Tt), $t = Date.now();
90
90
  return !Jt.s || Jt.s > $t ? (this.token = void 0, "") : Jt.e && Jt.e < $t ? (this.token = void 0, "") : (Jt.isValid = Yt, Jt);
91
91
  }
92
- }, version = "0.21.60";
92
+ }, version = "0.21.61";
93
93
  /**
94
94
  * @license
95
95
  * Copyright 2010-2024 Three.js Authors
@@ -49112,15 +49112,27 @@ class SetGeometry extends Command {
49112
49112
  this.newGeometry = e.newGeometry;
49113
49113
  }
49114
49114
  toJSON() {
49115
- var s;
49116
49115
  const e = super.toJSON(this);
49117
- return e.objectUuid = this.editor.uuidByObject(this.object), e.oldGeometry = (s = this.oldGeometry) == null ? void 0 : s.toJSON(), e.newGeometry = this.newGeometry.toJSON(), e;
49116
+ return e.objectUuid = this.editor.uuidByObject(this.object), e.oldGeometry = this.geometryToJSON(this.oldGeometry), e.newGeometry = this.geometryToJSON(this.newGeometry), e;
49118
49117
  }
49119
- fromJSON(e) {
49120
- super.fromJSON(e), this.object = this.editor.objectByUuid(e.objectUuid), e.oldGeometry && (this.oldGeometry = s(e.oldGeometry)), this.newGeometry = s(e.newGeometry);
49121
- function s(r) {
49122
- return new ObjectLoader().parseGeometries([r])[r.uuid];
49118
+ geometryToJSON(e) {
49119
+ return e ? e.type === "MeshLine" ? {
49120
+ type: "MeshLine",
49121
+ points: e.points,
49122
+ variableWidth: !!e.widthCallback
49123
+ } : e.toJSON() : void 0;
49124
+ }
49125
+ parseGeometry(e) {
49126
+ if (!e)
49127
+ return;
49128
+ if (e.type === "MeshLine") {
49129
+ const f = new he();
49130
+ return f.setPoints(e.points, e.variableWidth ? (st) => st : void 0), f;
49123
49131
  }
49132
+ return new ObjectLoader().parseGeometries([e])[e.uuid];
49133
+ }
49134
+ fromJSON(e) {
49135
+ super.fromJSON(e), this.object = this.editor.objectByUuid(e.objectUuid), this.oldGeometry = this.parseGeometry(e.oldGeometry), this.newGeometry = this.parseGeometry(e.newGeometry);
49124
49136
  }
49125
49137
  }
49126
49138
  const Commands = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.21.60";
1
+ declare const _default: "0.21.61";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.21.60",
3
+ "version": "0.21.61",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",