zakeke-configurator-react 0.1.232 → 0.1.233

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.
@@ -376,6 +376,7 @@ export declare class SceneViewer implements IDisposable {
376
376
  getSceneRootUrl(): Promise<Nullable<string>>;
377
377
  isTryOnMeshVisibleEnabledToShow(): boolean;
378
378
  getTryOnMeshVisible(): BABYLON.Mesh | null;
379
+ getTryOnFineTuningMeshVisible(): BABYLON.Mesh | null;
379
380
  refreshInfoPoints(): void;
380
381
  private getInfoPointsManagerStyle;
381
382
  private updateInfoPointsManagerStyle;
@@ -103,6 +103,7 @@ export interface TryOnFineTuningBanubaSettings extends TryOnFineTuningSettings {
103
103
  };
104
104
  }
105
105
  export type TryOnGenericFineTuningSettings = TryOnFineTuningSettings | TryOnFineTuningMazingSettings;
106
+ export declare const DefaultMazingFineTuningSettings: TryOnFineTuningMazingSettings;
106
107
  export declare const DefaultBanubaFineTuningSettings: TryOnFineTuningBanubaSettings;
107
108
  export declare class Product {
108
109
  id: number;
package/dist/index.js CHANGED
@@ -58607,7 +58607,7 @@ var SceneViewer = /*#__PURE__*/function () {
58607
58607
  i = 0;
58608
58608
  meshes = newScene.meshes.filter(function (m) {
58609
58609
  return m.isVisible;
58610
- }); // Caricamento finto mesh
58610
+ }); // Caricamento finto mesh
58611
58611
  _i = 0;
58612
58612
  case 25:
58613
58613
  if (!(_i < meshes.length)) {
@@ -61057,7 +61057,7 @@ var SceneViewer = /*#__PURE__*/function () {
61057
61057
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
61058
61058
  var mesh = _step4.value;
61059
61059
  var children = mesh.getChildren();
61060
- if (children.length > 0) {
61060
+ if (children.length > 0 && !mesh.parent) {
61061
61061
  var element = children.find(function (child) {
61062
61062
  var _this21$_sceneHelper;
61063
61063
  return (_this21$_sceneHelper = _this21._sceneHelper) === null || _this21$_sceneHelper === void 0 ? void 0 : _this21$_sceneHelper.isTryOnEnabledForMesh(child);
@@ -61074,10 +61074,39 @@ var SceneViewer = /*#__PURE__*/function () {
61074
61074
  }
61075
61075
  return null;
61076
61076
  }
61077
+ }, {
61078
+ key: "getTryOnFineTuningMeshVisible",
61079
+ value: function getTryOnFineTuningMeshVisible() {
61080
+ var _this22 = this;
61081
+ var meshes = this.getVisibleMeshes();
61082
+ var _iterator5 = _createForOfIteratorHelper(meshes),
61083
+ _step5;
61084
+ try {
61085
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
61086
+ var mesh = _step5.value;
61087
+ var children = mesh.getChildren();
61088
+ if (children.length > 0) {
61089
+ var _mesh$metadata;
61090
+ var element = children.find(function (child) {
61091
+ var _this22$_sceneHelper;
61092
+ return (_this22$_sceneHelper = _this22._sceneHelper) === null || _this22$_sceneHelper === void 0 ? void 0 : _this22$_sceneHelper.isTryOnEnabledForMesh(child);
61093
+ });
61094
+ if (!!element && mesh !== null && mesh !== void 0 && (_mesh$metadata = mesh.metadata) !== null && _mesh$metadata !== void 0 && _mesh$metadata.tryOnFineTuningSettings) {
61095
+ return mesh;
61096
+ }
61097
+ }
61098
+ }
61099
+ } catch (err) {
61100
+ _iterator5.e(err);
61101
+ } finally {
61102
+ _iterator5.f();
61103
+ }
61104
+ return null;
61105
+ }
61077
61106
  }, {
61078
61107
  key: "refreshInfoPoints",
61079
61108
  value: function refreshInfoPoints() {
61080
- var _this22 = this;
61109
+ var _this23 = this;
61081
61110
  var enabled = this._zkScene && this._zkScene.getInfoPointsEnabled() && this.canShowInfoPoints;
61082
61111
  if (!enabled) {
61083
61112
  this.disposeInfoPointsManager();
@@ -61093,18 +61122,18 @@ var SceneViewer = /*#__PURE__*/function () {
61093
61122
  if (this._infoPointContentShownListeners && this._infoPointContentShownListeners.length > 0) this._infoPointsManager.addInfoPointContentShownListenerRange(this._infoPointContentShownListeners);
61094
61123
  if (this._infoPointContentHiddenListeners && this._infoPointContentHiddenListeners.length > 0) this._infoPointsManager.addInfoPointContentHiddenListenerRange(this._infoPointContentHiddenListeners);
61095
61124
  this._infoPointsManager.onBeforeShowImages = function () {
61096
- if (antialias === null) antialias = _this22.antialias;
61097
- _this22.antialias = false;
61098
- _this22.disableAntialiasing();
61125
+ if (antialias === null) antialias = _this23.antialias;
61126
+ _this23.antialias = false;
61127
+ _this23.disableAntialiasing();
61099
61128
  };
61100
61129
  this._infoPointsManager.onAfterShowImages = function () {
61101
- _this22.antialias = antialias;
61130
+ _this23.antialias = antialias;
61102
61131
  antialias = null;
61103
- _this22.enableAntialiasing();
61104
- _this22.setLongRenderingNeeded();
61132
+ _this23.enableAntialiasing();
61133
+ _this23.setLongRenderingNeeded();
61105
61134
  };
61106
61135
  this._infoPointsManager.addRenderingNeededListener(function () {
61107
- return _this22.setRenderingNeeded();
61136
+ return _this23.setRenderingNeeded();
61108
61137
  });
61109
61138
  }
61110
61139
  }
@@ -61338,12 +61367,12 @@ var SceneViewer = /*#__PURE__*/function () {
61338
61367
  }, {
61339
61368
  key: "attachBroadcastChannelEventHandlers",
61340
61369
  value: function attachBroadcastChannelEventHandlers() {
61341
- var _this23 = this;
61370
+ var _this24 = this;
61342
61371
  if (this._isHologram && !this._isHologramSource) {
61343
61372
  var bc = this.getOrCreateBroadcastChannel();
61344
61373
  if (!bc) return;
61345
61374
  bc.onmessage = function (event) {
61346
- return _this23.onBroadcastMessageReceived(event);
61375
+ return _this24.onBroadcastMessageReceived(event);
61347
61376
  };
61348
61377
  }
61349
61378
  }
@@ -61458,7 +61487,7 @@ var SceneViewer = /*#__PURE__*/function () {
61458
61487
  key: "showResizableCanvasPerCurrentSide",
61459
61488
  value: function () {
61460
61489
  var _showResizableCanvasPerCurrentSide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(args) {
61461
- var _this24 = this;
61490
+ var _this25 = this;
61462
61491
  var meshID, result, meshSides, resizableMeshSides, mesh, meshSide;
61463
61492
  return _regeneratorRuntime().wrap(function _callee54$(_context54) {
61464
61493
  while (1) switch (_context54.prev = _context54.next) {
@@ -61513,7 +61542,7 @@ var SceneViewer = /*#__PURE__*/function () {
61513
61542
  });
61514
61543
  meshSides.push(meshSide);
61515
61544
  setTimeout(function () {
61516
- return _this24.adjustCamera(false);
61545
+ return _this25.adjustCamera(false);
61517
61546
  }, 100);
61518
61547
  case 20:
61519
61548
  case "end":
@@ -61530,8 +61559,8 @@ var SceneViewer = /*#__PURE__*/function () {
61530
61559
  key: "showResizableCanvasPerVariant",
61531
61560
  value: function () {
61532
61561
  var _showResizableCanvasPerVariant = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(args) {
61533
- var _this25 = this;
61534
- var meshID, result, index, doubleSided, sides, meshSides, resizableMeshSides, _iterator5, _step5, mesh, sideId, meshSide;
61562
+ var _this26 = this;
61563
+ var meshID, result, index, doubleSided, sides, meshSides, resizableMeshSides, _iterator6, _step6, mesh, sideId, meshSide;
61535
61564
  return _regeneratorRuntime().wrap(function _callee55$(_context55) {
61536
61565
  while (1) switch (_context55.prev = _context55.next) {
61537
61566
  case 0:
@@ -61586,10 +61615,10 @@ var SceneViewer = /*#__PURE__*/function () {
61586
61615
  });
61587
61616
 
61588
61617
  // Meshes contains this list of merged meshes: [borders, front, back]
61589
- _iterator5 = _createForOfIteratorHelper(result.meshes);
61618
+ _iterator6 = _createForOfIteratorHelper(result.meshes);
61590
61619
  try {
61591
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
61592
- mesh = _step5.value;
61620
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
61621
+ mesh = _step6.value;
61593
61622
  if (mesh) {
61594
61623
  if (sides.includes(mesh.name)) {
61595
61624
  sideId = !doubleSided || mesh.name === 'front' ? args.sidesIds[0] : args.sidesIds[1];
@@ -61609,12 +61638,12 @@ var SceneViewer = /*#__PURE__*/function () {
61609
61638
  }
61610
61639
  }
61611
61640
  } catch (err) {
61612
- _iterator5.e(err);
61641
+ _iterator6.e(err);
61613
61642
  } finally {
61614
- _iterator5.f();
61643
+ _iterator6.f();
61615
61644
  }
61616
61645
  setTimeout(function () {
61617
- return _this25.adjustCamera(false);
61646
+ return _this26.adjustCamera(false);
61618
61647
  }, 100);
61619
61648
  case 22:
61620
61649
  case "end":
@@ -61637,13 +61666,13 @@ var SceneViewer = /*#__PURE__*/function () {
61637
61666
  key: "switchMode",
61638
61667
  value: function switchMode(mode) {
61639
61668
  var _this$_sceneHelper2,
61640
- _this26 = this;
61669
+ _this27 = this;
61641
61670
  if (mode === 'upload') {
61642
61671
  this._lastResizableMeshID = '';
61643
61672
  }
61644
61673
  (_this$_sceneHelper2 = this._sceneHelper) === null || _this$_sceneHelper2 === void 0 ? void 0 : _this$_sceneHelper2.switchMode(mode);
61645
61674
  setTimeout(function () {
61646
- return _this26.adjustCamera(false);
61675
+ return _this27.adjustCamera(false);
61647
61676
  }, 100);
61648
61677
  }
61649
61678
  }, {
@@ -63206,7 +63235,7 @@ var TryOnView = function TryOnView(props) {
63206
63235
  className: props.className,
63207
63236
  product: props.product,
63208
63237
  customer: props.customer,
63209
- fineTuningSettings: props.settings ? props.settings : undefined,
63238
+ fineTuningSettings: props.settings ? props.settings : _models__WEBPACK_IMPORTED_MODULE_2__.DefaultMazingFineTuningSettings,
63210
63239
  onReady: props.onReady,
63211
63240
  onLoaded: props.onLoaded,
63212
63241
  onClose: props.onClose,
@@ -67364,7 +67393,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
67364
67393
  }());
67365
67394
  /**
67366
67395
  * Ottiene le restrizioni sul printing method (che nel caso di un prodotto configuratore 3D c'è sempre ed è 1 solo).
67367
- * @remarks
67396
+ * @remarks
67368
67397
  * Se non ci sono restrizioni, ritorna quelle di default
67369
67398
  * @returns
67370
67399
  * Le restrizioni sul printing method o quelle di default
@@ -67826,7 +67855,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
67826
67855
  get: function get() {
67827
67856
  if (this.isTryOnMeshVisible) {
67828
67857
  var _tryOnMesh$metadata;
67829
- var tryOnMesh = this.viewer.getTryOnMeshVisible();
67858
+ var tryOnMesh = this.viewer.getTryOnFineTuningMeshVisible();
67830
67859
  if (tryOnMesh !== null && tryOnMesh !== void 0 && (_tryOnMesh$metadata = tryOnMesh.metadata) !== null && _tryOnMesh$metadata !== void 0 && _tryOnMesh$metadata.tryOnFineTuningSettings) {
67831
67860
  return tryOnMesh.metadata.tryOnFineTuningSettings;
67832
67861
  }
@@ -68845,6 +68874,7 @@ __webpack_require__.r(__webpack_exports__);
68845
68874
  /* harmony export */ "Composition": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.Composition),
68846
68875
  /* harmony export */ "CompositionItem": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.CompositionItem),
68847
68876
  /* harmony export */ "DefaultBanubaFineTuningSettings": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.DefaultBanubaFineTuningSettings),
68877
+ /* harmony export */ "DefaultMazingFineTuningSettings": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.DefaultMazingFineTuningSettings),
68848
68878
  /* harmony export */ "EventMessage": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.EventMessage),
68849
68879
  /* harmony export */ "EventMessageType": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.EventMessageType),
68850
68880
  /* harmony export */ "ExtensionFieldDataType": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_7__.ExtensionFieldDataType),
@@ -69191,6 +69221,7 @@ __webpack_require__.r(__webpack_exports__);
69191
69221
  /* harmony export */ "Composition": () => (/* binding */ Composition),
69192
69222
  /* harmony export */ "CompositionItem": () => (/* binding */ CompositionItem),
69193
69223
  /* harmony export */ "DefaultBanubaFineTuningSettings": () => (/* binding */ DefaultBanubaFineTuningSettings),
69224
+ /* harmony export */ "DefaultMazingFineTuningSettings": () => (/* binding */ DefaultMazingFineTuningSettings),
69194
69225
  /* harmony export */ "EventMessage": () => (/* binding */ EventMessage),
69195
69226
  /* harmony export */ "EventMessageType": () => (/* binding */ EventMessageType),
69196
69227
  /* harmony export */ "ExtensionFieldDataType": () => (/* binding */ ExtensionFieldDataType),
@@ -69295,6 +69326,16 @@ var TryOnFineTuningMazingEnvironment = /*#__PURE__*/function (TryOnFineTuningMaz
69295
69326
  TryOnFineTuningMazingEnvironment["Court"] = "court.hdr";
69296
69327
  return TryOnFineTuningMazingEnvironment;
69297
69328
  }({});
69329
+ var DefaultMazingFineTuningSettings = {
69330
+ temple: false,
69331
+ environment: TryOnFineTuningMazingEnvironment.Neutral,
69332
+ position: {
69333
+ x: 0,
69334
+ y: 0,
69335
+ z: 0
69336
+ },
69337
+ scale: 1
69338
+ };
69298
69339
  var DefaultBanubaFineTuningSettings = {
69299
69340
  rotation: {
69300
69341
  x: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zakeke-configurator-react",
3
- "version": "0.1.232",
3
+ "version": "0.1.233",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/declarations/composer/Module/src/index.d.ts",