@colijnit/configurator 12.0.5 → 12.0.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.
package/app/builder.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare class Builder {
12
12
  decosReceived: BehaviorSubject<DecoNode[]>;
13
13
  answersReceived: BehaviorSubject<Answer[]>;
14
14
  modelLoaded: BehaviorSubject<THREE.Object3D>;
15
+ debug: Function;
15
16
  private _scene;
16
17
  private _instanceId;
17
18
  private _sku;
@@ -62,4 +63,5 @@ export declare class Builder {
62
63
  private _getAdjustables;
63
64
  private _updatePivot;
64
65
  private _reset;
66
+ private _log;
65
67
  }
@@ -2343,10 +2343,9 @@
2343
2343
  _a.label = 1;
2344
2344
  case 1:
2345
2345
  _a.trys.push([1, 6, , 7]);
2346
- // console.log(new Date(), 'start build');
2346
+ this._log('start build');
2347
2347
  return [4 /*yield*/, this._downloadAsset(assetUrl, cdnUrl, schema)];
2348
2348
  case 2:
2349
- // console.log(new Date(), 'start build');
2350
2349
  _a.sent();
2351
2350
  if (!(selections && selections.length > 1 && decos && decos.length > 0 && this._source)) return [3 /*break*/, 4];
2352
2351
  this._selections = selections;
@@ -2357,7 +2356,7 @@
2357
2356
  case 3:
2358
2357
  build = _a.sent();
2359
2358
  this._cleanUp();
2360
- // console.log(new Date(), 'finish build');
2359
+ this._log('finish build');
2361
2360
  return [2 /*return*/, build];
2362
2361
  case 4: throw 'Unsufficient data provided!';
2363
2362
  case 5: return [3 /*break*/, 7];
@@ -2565,7 +2564,7 @@
2565
2564
  obj.visible = false; // no need to render visualy
2566
2565
  this._scene.add(obj);
2567
2566
  connected = false;
2568
- // console.log(new Date(), 'build main model');
2567
+ this._log('build main model');
2569
2568
  for (i = 0, len = adjustables.length; i < len; i++) {
2570
2569
  adjustable = this._createAdjustable(obj, adjustables[i]);
2571
2570
  if (adjustable) {
@@ -2583,20 +2582,19 @@
2583
2582
  console.warn('No connection found for: ', adjustable.name);
2584
2583
  }
2585
2584
  }
2586
- // console.log(new Date(), 'place addables');
2585
+ this._log('place addables');
2587
2586
  this._placeAddables(obj);
2588
- // console.log(new Date(), 'update pivot');
2587
+ this._log('update pivot');
2589
2588
  this._updatePivot(obj);
2590
- // console.log(new Date(), 'load variations');
2589
+ this._log('load variations');
2591
2590
  return [4 /*yield*/, this._loadVariations(obj)];
2592
2591
  case 1:
2593
- // console.log(new Date(), 'load variations');
2594
2592
  _a.sent();
2595
2593
  // this._variationHelper.clearCache();
2596
- // console.log(new Date(), 'remove from scene');
2594
+ this._log('remove from scene');
2597
2595
  this._scene.remove(obj);
2598
2596
  ObjectUtils.DisposeObject(this._source);
2599
- // console.log(new Date(), 'ready!');
2597
+ this._log('ready!');
2600
2598
  return [2 /*return*/, obj];
2601
2599
  case 2: throw 'No adjustables found!';
2602
2600
  }
@@ -2896,24 +2894,22 @@
2896
2894
  return __awaiter(this, void 0, void 0, function () {
2897
2895
  return __generator(this, function (_a) {
2898
2896
  switch (_a.label) {
2899
- case 0:
2900
- // console.log(new Date(), 'load variation for parts');
2901
- return [4 /*yield*/, this._variationHelper.loadPart(obj, this._adjustables, true)];
2897
+ case 0:
2898
+ this._log('load variation for parts');
2899
+ return [4 /*yield*/, this._variationHelper.loadPart(obj, this._adjustables, true)];
2902
2900
  case 1:
2903
- // console.log(new Date(), 'load variation for parts');
2904
2901
  _a.sent();
2905
- // console.log(new Date(), 'load variation for adjustables');
2902
+ this._log('load variation for adjustables');
2906
2903
  return [4 /*yield*/, this._variationHelper.loadVariation(obj, this._adjustables, true)];
2907
2904
  case 2:
2908
- // console.log(new Date(), 'load variation for adjustables');
2909
2905
  _a.sent();
2910
- // console.log(new Date(), 'load variation for addables');
2906
+ this._log('load variation for addables');
2911
2907
  return [4 /*yield*/, this._variationHelper.loadVariation(obj, this._addables, true)];
2912
2908
  case 3:
2913
- // console.log(new Date(), 'load variation for addables');
2914
2909
  _a.sent();
2915
- // console.log(new Date(), 'load variation clear cache');
2910
+ this._log('load variation clear cache');
2916
2911
  this._variationHelper.clearCache();
2912
+ this._log('load variations done');
2917
2913
  return [2 /*return*/];
2918
2914
  }
2919
2915
  });
@@ -2942,6 +2938,12 @@
2942
2938
  this._addables.length = 0;
2943
2939
  this._prepareTheSelections();
2944
2940
  };
2941
+ Builder.prototype._log = function (message) {
2942
+ if (this.debug) {
2943
+ this.debug(message);
2944
+ console.log(new Date(), message);
2945
+ }
2946
+ };
2945
2947
  return Builder;
2946
2948
  }());
2947
2949
  Builder.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function Builder_Factory() { return new Builder(); }, token: Builder, providedIn: "root" });