zakeke-configurator-react 0.0.151 → 0.0.152
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.js +82 -64
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31280,6 +31280,8 @@ var SceneDesignManager = /*#__PURE__*/function () {
|
|
|
31280
31280
|
_defineProperty(this, "_designNotifyMessageListeners", []);
|
|
31281
31281
|
_defineProperty(this, "_designRemoveMessageListeners", []);
|
|
31282
31282
|
_defineProperty(this, "_designEventMessages", []);
|
|
31283
|
+
// private _debouncedMeshRefresh: Map<string, boolean> = new Map();
|
|
31284
|
+
_defineProperty(this, "_meshesToBeRefreshed", new Set());
|
|
31283
31285
|
this._scene = scene;
|
|
31284
31286
|
this._zkScene = zkScene;
|
|
31285
31287
|
this._zkModel = zkModel;
|
|
@@ -31348,17 +31350,17 @@ var SceneDesignManager = /*#__PURE__*/function () {
|
|
|
31348
31350
|
key: "refreshAsync",
|
|
31349
31351
|
value: function () {
|
|
31350
31352
|
var _refreshAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
31351
|
-
var scene, meshDesignManager, mesh, meshSide,
|
|
31353
|
+
var scene, meshDesignManager, mesh, meshSide, i, found, k, meshVisible, meshID, _meshID, j, _meshID2, submeshIdx;
|
|
31352
31354
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
31353
31355
|
while (1) switch (_context.prev = _context.next) {
|
|
31354
31356
|
case 0:
|
|
31355
31357
|
if (!(this._scene && this._zkModel && this._zkDesign)) {
|
|
31356
|
-
_context.next =
|
|
31358
|
+
_context.next = 37;
|
|
31357
31359
|
break;
|
|
31358
31360
|
}
|
|
31359
31361
|
scene = this.getDefaultModelScene();
|
|
31360
31362
|
if (!scene) {
|
|
31361
|
-
_context.next =
|
|
31363
|
+
_context.next = 37;
|
|
31362
31364
|
break;
|
|
31363
31365
|
}
|
|
31364
31366
|
meshDesignManager = null;
|
|
@@ -31366,70 +31368,74 @@ var SceneDesignManager = /*#__PURE__*/function () {
|
|
|
31366
31368
|
meshSide = null; // Removed sceneID check otherwise it will not work when creating the scene in the customizer
|
|
31367
31369
|
// backoffice
|
|
31368
31370
|
//let sceneID = scene.get("sceneID");
|
|
31369
|
-
//
|
|
31370
|
-
|
|
31371
|
+
// Elimino tutti i gestori non più necessari
|
|
31372
|
+
i = 0;
|
|
31371
31373
|
case 7:
|
|
31372
|
-
if (!(
|
|
31373
|
-
_context.next =
|
|
31374
|
-
break;
|
|
31375
|
-
}
|
|
31376
|
-
meshSide = scene.get("meshSides").at(j);
|
|
31377
|
-
meshID = meshSide.get("meshID");
|
|
31378
|
-
submeshIdx = meshSide.get("subMeshID");
|
|
31379
|
-
if (!meshID) {
|
|
31380
|
-
_context.next = 14;
|
|
31381
|
-
break;
|
|
31382
|
-
}
|
|
31383
|
-
_context.next = 14;
|
|
31384
|
-
return this.refreshMeshDesignAsync(meshID, submeshIdx);
|
|
31385
|
-
case 14:
|
|
31386
|
-
j++;
|
|
31387
|
-
_context.next = 7;
|
|
31388
|
-
break;
|
|
31389
|
-
case 17:
|
|
31390
|
-
_j2 = 0;
|
|
31391
|
-
case 18:
|
|
31392
|
-
if (!(_j2 < this._meshDesignManagers.length)) {
|
|
31393
|
-
_context.next = 36;
|
|
31374
|
+
if (!(i < this._meshDesignManagers.length)) {
|
|
31375
|
+
_context.next = 25;
|
|
31394
31376
|
break;
|
|
31395
31377
|
}
|
|
31396
|
-
meshDesignManager = this._meshDesignManagers[
|
|
31378
|
+
meshDesignManager = this._meshDesignManagers[i];
|
|
31397
31379
|
found = false;
|
|
31398
31380
|
k = 0;
|
|
31399
|
-
case
|
|
31381
|
+
case 11:
|
|
31400
31382
|
if (!(k < scene.get("meshSides").length)) {
|
|
31401
|
-
_context.next =
|
|
31383
|
+
_context.next = 19;
|
|
31402
31384
|
break;
|
|
31403
31385
|
}
|
|
31404
31386
|
meshSide = scene.get("meshSides").at(k);
|
|
31405
31387
|
if (!(meshSide.get("meshID") == meshDesignManager.getMeshID() && meshSide.get("subMeshID") == meshDesignManager.getSubMeshIdx())) {
|
|
31406
|
-
_context.next =
|
|
31388
|
+
_context.next = 16;
|
|
31407
31389
|
break;
|
|
31408
31390
|
}
|
|
31409
31391
|
found = true;
|
|
31410
|
-
return _context.abrupt("break",
|
|
31411
|
-
case
|
|
31392
|
+
return _context.abrupt("break", 19);
|
|
31393
|
+
case 16:
|
|
31412
31394
|
k++;
|
|
31413
|
-
_context.next =
|
|
31395
|
+
_context.next = 11;
|
|
31414
31396
|
break;
|
|
31415
|
-
case
|
|
31397
|
+
case 19:
|
|
31416
31398
|
meshVisible = true;
|
|
31417
31399
|
if (found) {
|
|
31418
|
-
|
|
31419
|
-
if (
|
|
31420
|
-
mesh = this._scene.getMeshByID(
|
|
31400
|
+
meshID = meshDesignManager.getMeshID();
|
|
31401
|
+
if (meshID) {
|
|
31402
|
+
mesh = this._scene.getMeshByID(meshID);
|
|
31421
31403
|
if (mesh) meshVisible = mesh.isVisible;
|
|
31422
31404
|
}
|
|
31423
31405
|
}
|
|
31424
31406
|
if (!found || !meshVisible) {
|
|
31407
|
+
console.log("qui rimuove effettivamente la texture");
|
|
31425
31408
|
meshDesignManager.dispose();
|
|
31426
|
-
|
|
31409
|
+
_meshID = meshDesignManager.getMeshID(); // if (meshID)
|
|
31410
|
+
// this._debouncedMeshRefresh.delete(meshID);
|
|
31411
|
+
this._meshDesignManagers.splice(i--, 1);
|
|
31427
31412
|
}
|
|
31428
|
-
case
|
|
31429
|
-
|
|
31430
|
-
_context.next =
|
|
31413
|
+
case 22:
|
|
31414
|
+
i++;
|
|
31415
|
+
_context.next = 7;
|
|
31431
31416
|
break;
|
|
31432
|
-
case
|
|
31417
|
+
case 25:
|
|
31418
|
+
j = 0;
|
|
31419
|
+
case 26:
|
|
31420
|
+
if (!(j < scene.get("meshSides").length)) {
|
|
31421
|
+
_context.next = 37;
|
|
31422
|
+
break;
|
|
31423
|
+
}
|
|
31424
|
+
meshSide = scene.get("meshSides").at(j);
|
|
31425
|
+
console.log(meshSide);
|
|
31426
|
+
_meshID2 = meshSide.get("meshID");
|
|
31427
|
+
submeshIdx = meshSide.get("subMeshID");
|
|
31428
|
+
if (!_meshID2) {
|
|
31429
|
+
_context.next = 34;
|
|
31430
|
+
break;
|
|
31431
|
+
}
|
|
31432
|
+
_context.next = 34;
|
|
31433
|
+
return this.refreshMeshDesignAsync(_meshID2, submeshIdx);
|
|
31434
|
+
case 34:
|
|
31435
|
+
j++;
|
|
31436
|
+
_context.next = 26;
|
|
31437
|
+
break;
|
|
31438
|
+
case 37:
|
|
31433
31439
|
case "end":
|
|
31434
31440
|
return _context.stop();
|
|
31435
31441
|
}
|
|
@@ -31475,11 +31481,19 @@ var SceneDesignManager = /*#__PURE__*/function () {
|
|
|
31475
31481
|
case 0:
|
|
31476
31482
|
submeshID = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 0;
|
|
31477
31483
|
effect = _args2.length > 2 ? _args2[2] : undefined;
|
|
31484
|
+
if (!this._meshesToBeRefreshed.has(meshID)) {
|
|
31485
|
+
_context2.next = 4;
|
|
31486
|
+
break;
|
|
31487
|
+
}
|
|
31488
|
+
return _context2.abrupt("return");
|
|
31489
|
+
case 4:
|
|
31490
|
+
this._meshesToBeRefreshed.add(meshID);
|
|
31491
|
+
console.log(this._meshesToBeRefreshed);
|
|
31478
31492
|
validEffect = effect;
|
|
31479
31493
|
if (effect && !this.isValidEffectForMesh(meshID, submeshID, effect)) validEffect = undefined;
|
|
31480
31494
|
mesh = this._scene.getMeshByID(meshID);
|
|
31481
31495
|
if (!(mesh && mesh.isVisible)) {
|
|
31482
|
-
_context2.next =
|
|
31496
|
+
_context2.next = 25;
|
|
31483
31497
|
break;
|
|
31484
31498
|
}
|
|
31485
31499
|
subMesh = null;
|
|
@@ -31488,12 +31502,12 @@ var SceneDesignManager = /*#__PURE__*/function () {
|
|
|
31488
31502
|
}
|
|
31489
31503
|
meshDesignManager = this.getMeshDesignMananger(mesh, subMesh);
|
|
31490
31504
|
if (meshDesignManager) {
|
|
31491
|
-
_context2.next =
|
|
31505
|
+
_context2.next = 25;
|
|
31492
31506
|
break;
|
|
31493
31507
|
}
|
|
31494
|
-
_context2.next =
|
|
31508
|
+
_context2.next = 16;
|
|
31495
31509
|
return _MeshDesignManager__WEBPACK_IMPORTED_MODULE_0__.MeshDesignManager.createMeshDesignManagerAsync(this._scene, this._zkScene, mesh, subMesh, this._zkModel, this._zkDesign, this._showDesign, validEffect, this._designTextureResolution);
|
|
31496
|
-
case
|
|
31510
|
+
case 16:
|
|
31497
31511
|
meshDesignManager = _context2.sent;
|
|
31498
31512
|
meshDesignManager.addRenderingNeededListener(function () {
|
|
31499
31513
|
return _this.fireRenderingNeededEvent();
|
|
@@ -31523,12 +31537,8 @@ var SceneDesignManager = /*#__PURE__*/function () {
|
|
|
31523
31537
|
_iterator2.f();
|
|
31524
31538
|
}
|
|
31525
31539
|
this._meshDesignManagers.push(meshDesignManager);
|
|
31526
|
-
|
|
31527
|
-
|
|
31528
|
-
case 23:
|
|
31529
|
-
meshDesignManager.showDesign = this._showDesign;
|
|
31530
|
-
_context2.next = 26;
|
|
31531
|
-
return meshDesignManager.refreshAsync(validEffect);
|
|
31540
|
+
case 25:
|
|
31541
|
+
this._meshesToBeRefreshed["delete"](meshID);
|
|
31532
31542
|
case 26:
|
|
31533
31543
|
case "end":
|
|
31534
31544
|
return _context2.stop();
|
|
@@ -58245,20 +58255,21 @@ var SceneViewer = /*#__PURE__*/function () {
|
|
|
58245
58255
|
case 0:
|
|
58246
58256
|
showDesign = _args21.length > 1 && _args21[1] !== undefined ? _args21[1] : true;
|
|
58247
58257
|
if (!(this._scene && this._zkScene && this._zkModel && zkDesign)) {
|
|
58248
|
-
_context21.next =
|
|
58258
|
+
_context21.next = 22;
|
|
58249
58259
|
break;
|
|
58250
58260
|
}
|
|
58251
58261
|
if (!(this._sceneDesignManager && this._sceneDesignManager.isForModels(this._scene, this._zkModel, zkDesign))) {
|
|
58252
|
-
_context21.next =
|
|
58262
|
+
_context21.next = 9;
|
|
58253
58263
|
break;
|
|
58254
58264
|
}
|
|
58265
|
+
console.log("sceneViewer", showDesign);
|
|
58255
58266
|
this._sceneDesignManager.showDesign = showDesign;
|
|
58256
|
-
_context21.next =
|
|
58267
|
+
_context21.next = 7;
|
|
58257
58268
|
return this._sceneDesignManager.refreshAsync();
|
|
58258
|
-
case
|
|
58259
|
-
_context21.next =
|
|
58269
|
+
case 7:
|
|
58270
|
+
_context21.next = 21;
|
|
58260
58271
|
break;
|
|
58261
|
-
case
|
|
58272
|
+
case 9:
|
|
58262
58273
|
this.emptyArFileCache();
|
|
58263
58274
|
if (this._sceneDesignManager) {
|
|
58264
58275
|
this._sceneDesignManager.dispose();
|
|
@@ -58293,11 +58304,11 @@ var SceneViewer = /*#__PURE__*/function () {
|
|
|
58293
58304
|
} finally {
|
|
58294
58305
|
_iterator2.f();
|
|
58295
58306
|
}
|
|
58296
|
-
_context21.next =
|
|
58307
|
+
_context21.next = 21;
|
|
58297
58308
|
return this._sceneDesignManager.refreshAsync();
|
|
58298
|
-
case 20:
|
|
58299
|
-
this.setLongRenderingNeeded();
|
|
58300
58309
|
case 21:
|
|
58310
|
+
this.setLongRenderingNeeded();
|
|
58311
|
+
case 22:
|
|
58301
58312
|
case "end":
|
|
58302
58313
|
return _context21.stop();
|
|
58303
58314
|
}
|
|
@@ -61429,7 +61440,14 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
61429
61440
|
_this.viewer.highlightSize = settings.size;
|
|
61430
61441
|
}
|
|
61431
61442
|
});
|
|
61432
|
-
|
|
61443
|
+
// public renderDesign = _.throttle(async () => {
|
|
61444
|
+
// console.log('renderDesign environment');
|
|
61445
|
+
// if (this.viewer && this.zkCurrentTemplate) {
|
|
61446
|
+
// await this.viewer.renderDesignAsync(this.zkCurrentTemplate);
|
|
61447
|
+
// this.fireItemsChange();
|
|
61448
|
+
// }
|
|
61449
|
+
// }, 300);
|
|
61450
|
+
_defineProperty(this, "renderDesign", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
61433
61451
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
61434
61452
|
while (1) switch (_context15.prev = _context15.next) {
|
|
61435
61453
|
case 0:
|
|
@@ -61446,7 +61464,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
61446
61464
|
return _context15.stop();
|
|
61447
61465
|
}
|
|
61448
61466
|
}, _callee15);
|
|
61449
|
-
}))
|
|
61467
|
+
})));
|
|
61450
61468
|
_defineProperty(this, "resize", function () {
|
|
61451
61469
|
if (!_this.viewer) return;
|
|
61452
61470
|
|