vis-core 0.27.10 → 0.27.12
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/editor/command/SetMaterialMap.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.module.js +36 -30
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.module.js
CHANGED
|
@@ -88,7 +88,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
|
|
|
88
88
|
).toString(CryptoJS.enc.Utf8), Fe = JSON.parse(Ne), at = Date.now();
|
|
89
89
|
return !Fe.s || Fe.s > at ? (this.token = void 0, "") : Fe.e && Fe.e < at ? (this.token = void 0, "") : (Fe.isValid = Le, Fe);
|
|
90
90
|
}
|
|
91
|
-
}, version = "0.27.
|
|
91
|
+
}, version = "0.27.12";
|
|
92
92
|
/**
|
|
93
93
|
* @license
|
|
94
94
|
* Copyright 2010-2025 Three.js Authors
|
|
@@ -36442,7 +36442,7 @@ var At$1 = Object.defineProperty, jt = Object.defineProperties, St$1 = Object.ge
|
|
|
36442
36442
|
});
|
|
36443
36443
|
class O {
|
|
36444
36444
|
constructor() {
|
|
36445
|
-
this.resources = /* @__PURE__ */ new Set(), this.disposeWithMaterial = !0, this.materialList = {}, this.disposeTrack = !0;
|
|
36445
|
+
this.resources = /* @__PURE__ */ new Set(), this.disposeWithMaterial = !0, this.disposeVideo = !0, this.materialList = {}, this.disposeTrack = !0;
|
|
36446
36446
|
}
|
|
36447
36447
|
track(t) {
|
|
36448
36448
|
if (!t || this.disposeTrack === !1)
|
|
@@ -36467,13 +36467,13 @@ class O {
|
|
|
36467
36467
|
(v instanceof Texture || Array.isArray(v)) && this.track(v);
|
|
36468
36468
|
}
|
|
36469
36469
|
}
|
|
36470
|
-
} else t instanceof VideoTexture && t.source.data && this.resources.add(t.source.data);
|
|
36470
|
+
} else this.disposeVideo && t instanceof VideoTexture && t.source.data && this.resources.add(t.source.data);
|
|
36471
36471
|
return t;
|
|
36472
36472
|
}
|
|
36473
36473
|
dispose() {
|
|
36474
36474
|
const t = [];
|
|
36475
36475
|
for (const r of this.resources)
|
|
36476
|
-
r instanceof Object3D ? t.push(r) : r instanceof HTMLVideoElement &&
|
|
36476
|
+
r instanceof Object3D ? t.push(r) : r instanceof HTMLVideoElement && r.pause(), Reflect.has(r, "dispose") && r.dispose();
|
|
36477
36477
|
t.forEach((r) => {
|
|
36478
36478
|
r.removeFromParent();
|
|
36479
36479
|
}), t.length = 0, this.resources.clear();
|
|
@@ -58136,11 +58136,7 @@ class SetMaterial extends Command {
|
|
|
58136
58136
|
super(t), this.type = "SetMaterial", this.name = "New Material", this.object = r, this.materialSlot = v, this.oldMaterial = this.editor.getObjectMaterial(r, v), this.newMaterial = d, (C = this.oldMaterial) != null && C.name && (this.newMaterial.name = this.oldMaterial.name);
|
|
58137
58137
|
}
|
|
58138
58138
|
execute() {
|
|
58139
|
-
|
|
58140
|
-
this.oldMaterial = this.editor.getObjectMaterial(
|
|
58141
|
-
this.object,
|
|
58142
|
-
this.materialSlot
|
|
58143
|
-
), (t = this.oldMaterial) != null && t.onBeforeCompile && (this.newMaterial.onBeforeCompile = this.oldMaterial.onBeforeCompile), this.editor.setObjectMaterial(
|
|
58139
|
+
this.editor.setObjectMaterial(
|
|
58144
58140
|
this.object,
|
|
58145
58141
|
this.materialSlot,
|
|
58146
58142
|
this.newMaterial
|
|
@@ -58155,11 +58151,18 @@ class SetMaterial extends Command {
|
|
|
58155
58151
|
}
|
|
58156
58152
|
toJSON() {
|
|
58157
58153
|
const t = super.toJSON(this);
|
|
58158
|
-
return t.objectUuid = this.editor.uuidByObject(this.object), t.materialSlot = this.materialSlot, t.
|
|
58154
|
+
return t.objectUuid = this.editor.uuidByObject(this.object), t.materialSlot = this.materialSlot, t.newMaterial = this.newMaterial.toJSON(), t;
|
|
58159
58155
|
}
|
|
58160
58156
|
fromJSON(t) {
|
|
58161
58157
|
var r;
|
|
58162
|
-
super.fromJSON(t), this.object = this.editor.objectByUuid(t.objectUuid), this.materialSlot = t.materialSlot, this.
|
|
58158
|
+
super.fromJSON(t), this.object = this.editor.objectByUuid(t.objectUuid), this.materialSlot = t.materialSlot, this.materialSlot = t.materialSlot, this.oldMaterial = this.editor.getObjectMaterial(
|
|
58159
|
+
this.object,
|
|
58160
|
+
this.materialSlot
|
|
58161
|
+
), this.newMaterial = parseMaterial(t.newMaterial), ((r = this.newMaterial.envMap) == null ? void 0 : r.name) === "PMREM.cubeUv" && (this.newMaterial.envMap = this.editor.viewport.vis.getRoomEnvMap());
|
|
58162
|
+
}
|
|
58163
|
+
fixJSON() {
|
|
58164
|
+
const t = this.json;
|
|
58165
|
+
t && t.oldMaterial && delete t.oldMaterial;
|
|
58163
58166
|
}
|
|
58164
58167
|
}
|
|
58165
58168
|
function parseMaterial(g) {
|
|
@@ -58192,32 +58195,33 @@ class SetMaterialMap extends Command {
|
|
|
58192
58195
|
}
|
|
58193
58196
|
execute() {
|
|
58194
58197
|
if (this.oldMap) {
|
|
58195
|
-
|
|
58196
|
-
|
|
58197
|
-
t.track(this.oldMap), t.dispose();
|
|
58198
|
-
} else if (this.oldMap.dispose(), this.oldMap instanceof VideoTexture) {
|
|
58199
|
-
const t = this.oldMap.source.data;
|
|
58200
|
-
t && t.pause();
|
|
58201
|
-
}
|
|
58198
|
+
const t = new O();
|
|
58199
|
+
t.track(this.oldMap), t.dispose();
|
|
58202
58200
|
}
|
|
58203
|
-
this.newMap && (this.newMap.anisotropy = this.editor.viewport.vis.tier0 ? 1 : this.editor.pencil.maxAnisotropy), this.material[this.mapName] = this.newMap, this.material instanceof Ie$2 && (this.material.useMap = !!this.newMap, this.newMap && this.newMap.wrapS !== RepeatWrapping && (this.newMap.wrapS = RepeatWrapping, this.newMap.wrapT = RepeatWrapping, this.newMap.needsUpdate = !0)), (!this.oldMap && this.newMap || this.oldMap && !this.newMap) && (this.material.needsUpdate = !0), this.editor.emit("materialChanged", this.material);
|
|
58201
|
+
this.newMap && (this.newMap.anisotropy = this.editor.viewport.vis.tier0 ? 1 : this.editor.pencil.maxAnisotropy), this.material[this.mapName] = this.newMap, this.playVideo(this.newMap), this.material instanceof Ie$2 && (this.material.useMap = !!this.newMap, this.newMap && this.newMap.wrapS !== RepeatWrapping && (this.newMap.wrapS = RepeatWrapping, this.newMap.wrapT = RepeatWrapping, this.newMap.needsUpdate = !0)), (!this.oldMap && this.newMap || this.oldMap && !this.newMap) && (this.material.needsUpdate = !0), this.editor.emit("materialChanged", this.material);
|
|
58204
58202
|
}
|
|
58205
58203
|
undo() {
|
|
58206
|
-
|
|
58207
|
-
|
|
58208
|
-
|
|
58204
|
+
this.material[this.mapName] = this.oldMap, this.playVideo(this.oldMap), this.material instanceof Ie$2 && (this.material.useMap = !!this.newMap), (!this.oldMap && this.newMap || this.oldMap && !this.newMap) && (this.material.needsUpdate = !0), this.editor.emit("materialChanged", this.material);
|
|
58205
|
+
}
|
|
58206
|
+
playVideo(t) {
|
|
58207
|
+
if (t && t instanceof VideoTexture) {
|
|
58208
|
+
const r = t.source.data;
|
|
58209
|
+
r && r.play();
|
|
58209
58210
|
}
|
|
58210
|
-
this.material[this.mapName] = this.oldMap, this.material instanceof Ie$2 && (this.material.useMap = !!this.newMap), (!this.oldMap && this.newMap || this.oldMap && !this.newMap) && (this.material.needsUpdate = !0), this.editor.emit("materialChanged", this.material);
|
|
58211
58211
|
}
|
|
58212
58212
|
toJSON() {
|
|
58213
58213
|
const t = super.toJSON(this);
|
|
58214
|
-
return t.objectUuid = this.editor.uuidByObject(this.object), t.materialSlot = this.materialSlot, t.mapName = this.mapName, t.newMap = serializeMap(this.newMap), t
|
|
58214
|
+
return t.objectUuid = this.editor.uuidByObject(this.object), t.materialSlot = this.materialSlot, t.mapName = this.mapName, t.newMap = serializeMap(this.newMap), t;
|
|
58215
58215
|
}
|
|
58216
58216
|
fromJSON(t) {
|
|
58217
58217
|
super.fromJSON(t), this.object = this.editor.objectByUuid(t.objectUuid), this.materialSlot = t.materialSlot, this.material = this.editor.getObjectMaterial(
|
|
58218
58218
|
this.object,
|
|
58219
58219
|
this.materialSlot
|
|
58220
|
-
), this.mapName = t.mapName, this.oldMap =
|
|
58220
|
+
), this.mapName = t.mapName, this.oldMap = this.object && this.material ? this.material[this.mapName] : void 0, this.newMap = parseTexture(t.newMap);
|
|
58221
|
+
}
|
|
58222
|
+
fixJSON() {
|
|
58223
|
+
const t = this.json;
|
|
58224
|
+
t && t.oldMap && delete t.oldMap;
|
|
58221
58225
|
}
|
|
58222
58226
|
}
|
|
58223
58227
|
function parseTexture(g) {
|
|
@@ -58226,7 +58230,7 @@ function parseTexture(g) {
|
|
|
58226
58230
|
const r = new ObjectLoader();
|
|
58227
58231
|
if (g.isVideoTexture) {
|
|
58228
58232
|
const d = document.createElement("video");
|
|
58229
|
-
d.src = g.images[0].url, d.muted = !0, d.
|
|
58233
|
+
d.src = g.images[0].url, d.muted = !0, d.loop = !0, d.preload = "auto";
|
|
58230
58234
|
const v = {
|
|
58231
58235
|
[g.images[0].uuid]: new VideoTexture(d)
|
|
58232
58236
|
};
|
|
@@ -58689,7 +58693,7 @@ class SetSceenMap extends SetMaterialMap {
|
|
|
58689
58693
|
super(t), this.type = "SetSceenMap", this.name = "Set Sceen.background", this.object = r, this.materialSlot = C, this.material = r !== void 0 ? r[C] : void 0, this.oldMap = r !== void 0 ? this.material[d] : void 0, this.newMap = v, this.oldMap && this.newMap && (this.newMap.wrapS = this.oldMap.wrapS, this.newMap.wrapT = this.oldMap.wrapT), this.mapName = d;
|
|
58690
58694
|
}
|
|
58691
58695
|
fromJSON(t) {
|
|
58692
|
-
super.fromJSON(t), this.material = this.object[this.materialSlot];
|
|
58696
|
+
super.fromJSON(t), this.oldMap = this.object[this.materialSlot][this.mapName], this.material = this.object[this.materialSlot];
|
|
58693
58697
|
}
|
|
58694
58698
|
}
|
|
58695
58699
|
class SetGeometry extends Command {
|
|
@@ -58707,7 +58711,7 @@ class SetGeometry extends Command {
|
|
|
58707
58711
|
}
|
|
58708
58712
|
toJSON() {
|
|
58709
58713
|
const t = super.toJSON(this);
|
|
58710
|
-
return t.objectUuid = this.editor.uuidByObject(this.object), t.
|
|
58714
|
+
return t.objectUuid = this.editor.uuidByObject(this.object), t.newGeometry = this.geometryToJSON(this.newGeometry), t;
|
|
58711
58715
|
}
|
|
58712
58716
|
geometryToJSON(t) {
|
|
58713
58717
|
return t ? t.type === "MeshLine" ? {
|
|
@@ -58726,7 +58730,8 @@ class SetGeometry extends Command {
|
|
|
58726
58730
|
return new ObjectLoader().parseGeometries([t])[t.uuid];
|
|
58727
58731
|
}
|
|
58728
58732
|
fromJSON(t) {
|
|
58729
|
-
|
|
58733
|
+
var r;
|
|
58734
|
+
super.fromJSON(t), this.object = this.editor.objectByUuid(t.objectUuid), this.oldGeometry = ((r = this.object) == null ? void 0 : r.geometry) || null, this.newGeometry = this.parseGeometry(t.newGeometry);
|
|
58730
58735
|
}
|
|
58731
58736
|
}
|
|
58732
58737
|
const Commands = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -58771,7 +58776,7 @@ class History {
|
|
|
58771
58776
|
} catch (w) {
|
|
58772
58777
|
console.error(w, t);
|
|
58773
58778
|
}
|
|
58774
|
-
|
|
58779
|
+
t.json = t.toJSON(), this.lastCmdTime = Date.now(), this.redos = [], this.editor.emit("historyChanged", t);
|
|
58775
58780
|
});
|
|
58776
58781
|
}
|
|
58777
58782
|
undo() {
|
|
@@ -59422,6 +59427,7 @@ class Editor {
|
|
|
59422
59427
|
const v = this.viewport.vis;
|
|
59423
59428
|
let C = t.material;
|
|
59424
59429
|
if (Array.isArray(t.material) && r !== void 0 ? (C = t.material[r], t.material[r] = d) : t.material = d, C) {
|
|
59430
|
+
C.onBeforeCompile && (d.onBeforeCompile = C.onBeforeCompile);
|
|
59425
59431
|
const w = new O();
|
|
59426
59432
|
if (w.track(C), w.dispose(), t.userData.fixBufferGeometry) {
|
|
59427
59433
|
const E = v.pencil.lead, ye = (Le) => {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.27.
|
|
1
|
+
declare const _default: "0.27.12";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vis-core",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.12",
|
|
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.14.
|
|
72
|
+
"gl-draw": "0.14.39",
|
|
73
73
|
"jsrsasign": "^11.1.0",
|
|
74
74
|
"lodash-es": "^4.17.21"
|
|
75
75
|
},
|