@crystaldesign/real-time-viewer 25.4.0-beta.1 → 25.4.0-beta.10

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.
@@ -1805,7 +1805,7 @@ var UIStore = /*#__PURE__*/function () {
1805
1805
  var _this$_diffuseTexture, _this$_runRenderLoopF;
1806
1806
  if (!overlayImage || !_this._scene || ((_this$_diffuseTexture = _this._diffuseTexture) === null || _this$_diffuseTexture === void 0 ? void 0 : _this$_diffuseTexture.url) == overlayImage.base64) return;
1807
1807
  var utilStore = useUtilStoreContext();
1808
- if (!utilStore.updateCam) return;
1808
+ if (!utilStore || !utilStore.updateCam) return;
1809
1809
  _this._isStaticBg = overlayImage.isStaticBg;
1810
1810
 
1811
1811
  // no highlightlayer on static room bg
@@ -1813,11 +1813,7 @@ var UIStore = /*#__PURE__*/function () {
1813
1813
  _this.deactivateHighlightLayer();
1814
1814
  }
1815
1815
  _this._enableSSAO(false);
1816
- var tex = new Texture(overlayImage.base64, _this._scene, undefined, true, Texture.TRILINEAR_SAMPLINGMODE, function () {
1817
- _this._plane.material.diffuseTexture = tex;
1818
- _this._diffuseTexture.dispose();
1819
- _this._diffuseTexture = tex;
1820
- });
1816
+ _this._diffuseTexture.updateURL(overlayImage.base64);
1821
1817
  _this.fadeInOverlayImage(_this._plane.visibility == 1);
1822
1818
  (_this$_runRenderLoopF = _this._runRenderLoopForTime) === null || _this$_runRenderLoopF === void 0 || _this$_runRenderLoopF.call(_this, 2000);
1823
1819
  });
@@ -2001,8 +1997,9 @@ var UIStore = /*#__PURE__*/function () {
2001
1997
  }
2002
1998
  }, {
2003
1999
  key: "createPosNr",
2004
- value: function createPosNr(elementInfo, element, isBoxPlanner) {
2005
- var _this5 = this;
2000
+ value: function createPosNr(elementInfo, element, isBoxPlanner, elementLength) {
2001
+ var _this5 = this,
2002
+ _this$_elementsInfo;
2006
2003
  var guiElem = {
2007
2004
  elementId: elementInfo.elementId,
2008
2005
  elements: []
@@ -2057,12 +2054,16 @@ var UIStore = /*#__PURE__*/function () {
2057
2054
  m.material.disableColorWrite = false;
2058
2055
  }
2059
2056
  });
2060
- if (!elementInfo.active) {
2057
+ var everyElementIsSelected = (_this$_elementsInfo = this._elementsInfo) === null || _this$_elementsInfo === void 0 ? void 0 : _this$_elementsInfo.every(function (ei) {
2058
+ return ei.active;
2059
+ });
2060
+ if (!elementInfo.active && !everyElementIsSelected) {
2061
2061
  childMeshes.forEach(function (m) {
2062
2062
  if (_this5._plane.visibility == 1) m.visibility = 0;
2063
2063
  if (!m.actionManager) m.actionManager = new ActionManager(_this5._scene);
2064
2064
  m.actionManager.registerAction(new ExecuteCodeAction(ActionManager.OnPointerOverTrigger, function (ev) {
2065
2065
  var _this5$_runRenderLoop;
2066
+ if (everyElementIsSelected) return;
2066
2067
  (_this5$_runRenderLoop = _this5._runRenderLoopForTime) === null || _this5$_runRenderLoop === void 0 || _this5$_runRenderLoop.call(_this5, 1000);
2067
2068
  _this5._selectedHl.removeAllMeshes();
2068
2069
  if (_this5._plane.visibility == 1) _this5._selectedMeshes.forEach(function (_m) {
@@ -2075,6 +2076,7 @@ var UIStore = /*#__PURE__*/function () {
2075
2076
  }));
2076
2077
  m.actionManager.registerAction(new ExecuteCodeAction(ActionManager.OnPointerOutTrigger, function (ev) {
2077
2078
  var _this5$_runRenderLoop2;
2079
+ if (everyElementIsSelected) return;
2078
2080
  (_this5$_runRenderLoop2 = _this5._runRenderLoopForTime) === null || _this5$_runRenderLoop2 === void 0 || _this5$_runRenderLoop2.call(_this5, 1000);
2079
2081
  _this5._selectedHl.removeAllMeshes();
2080
2082
  if (_this5._plane.visibility == 1) element.getChildMeshes().forEach(function (_m) {
@@ -2089,7 +2091,7 @@ var UIStore = /*#__PURE__*/function () {
2089
2091
  } else {
2090
2092
  var _guiElemRightBack;
2091
2093
  this._selectedMeshes = childMeshes;
2092
- this._selectedMeshes.forEach(function (_m) {
2094
+ if (elementLength > 1 && !everyElementIsSelected) this._selectedMeshes.forEach(function (_m) {
2093
2095
  _m.visibility = 1;
2094
2096
  _this5._selectedHl.addMesh(_m, Color3.Black());
2095
2097
  });
@@ -2217,7 +2219,7 @@ var UIStore = /*#__PURE__*/function () {
2217
2219
  if (!emnt) return;
2218
2220
  var element = _this7._scene.getTransformNodeByName(emnt.bbn.name);
2219
2221
  if (!element) return;
2220
- if (elementInfo.type == 'PosNr') _this7.createPosNr(elementInfo, element, isBoxPlanner);else _this7.createBoxCopyButtons(elementInfo, element);
2222
+ if (elementInfo.type == 'PosNr') _this7.createPosNr(elementInfo, element, isBoxPlanner, elements.length);else _this7.createBoxCopyButtons(elementInfo, element);
2221
2223
  });
2222
2224
  }
2223
2225
  }, {
@@ -3717,12 +3719,12 @@ function useRealTimeRenderData (_ref) {
3717
3719
  LOG.debug('callbacks.setGlb is undefined');
3718
3720
  }
3719
3721
  if (!sceneStore.hasRendered) {
3720
- sceneStore.runRenderLoopIndefinitely();
3721
3722
  sceneStore.hasRendered = true;
3722
3723
  }
3724
+ sceneStore.runRenderLoopIndefinitely();
3723
3725
  sceneStore.scene.onAfterRenderObservable.add(onFirstFrame);
3724
3726
  LOG.successTransaction('BUILD_SCENE');
3725
- case 32:
3727
+ case 33:
3726
3728
  case "end":
3727
3729
  return _context2.stop();
3728
3730
  }
@@ -3805,7 +3807,7 @@ function useRealTimeRenderData (_ref) {
3805
3807
  scene.getEngine().resize(true);
3806
3808
  if (uiStore) uiStore.resize(scene);
3807
3809
  };
3808
- if (window) {
3810
+ if (window && gameCanvas.current) {
3809
3811
  window.addEventListener('resize', resize);
3810
3812
  new ResizeObserver(resize).observe(gameCanvas.current);
3811
3813
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UIStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/UIStore.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;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ACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,kBAAkB,GACnB,EAAE,KAAK;;EA0LP"}
1
+ {"version":3,"file":"useRealTimeRenderData.d.ts","sourceRoot":"","sources":["../../../../src/useRealTimeRenderData.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAM1B,OAAO,8BAA8B,CAAC;AAOtC,MAAM,CAAC,OAAO,WAAW,EACvB,GAAG,EACH,OAAO,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,kBAAkB,GACnB,EAAE,KAAK;;EA0LP"}