@plattar/plattar-ar-adapter 1.167.11 → 1.167.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.
@@ -1143,6 +1143,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
1143
1143
  }
1144
1144
  // optional attributes
1145
1145
  let configState = null;
1146
+ this._state = plattar_controller_1.ControllerState.Renderer;
1146
1147
  try {
1147
1148
  const dState = await this.getConfiguratorState();
1148
1149
  // if this is declared, we have a furniture scene that we need to re-create the embed
@@ -1187,7 +1188,6 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
1187
1188
  if (showUI) {
1188
1189
  viewer.setAttribute("show-ui", showUI);
1189
1190
  }
1190
- this._state = plattar_controller_1.ControllerState.Renderer;
1191
1191
  return new Promise((accept, reject) => {
1192
1192
  this.append(viewer);
1193
1193
  if (configState) {
@@ -1538,7 +1538,18 @@ class PlattarController {
1538
1538
  * @param element - The element to append
1539
1539
  */
1540
1540
  append(element) {
1541
+ if (this._element !== element) {
1542
+ return;
1543
+ }
1544
+ // ensure append only allows a single element in the shadow DOM
1541
1545
  const shadow = this.parent.shadowRoot || this.parent.attachShadow({ mode: 'open' });
1546
+ if (shadow) {
1547
+ let child = shadow.lastElementChild;
1548
+ while (child) {
1549
+ shadow.removeChild(child);
1550
+ child = shadow.lastElementChild;
1551
+ }
1552
+ }
1542
1553
  shadow.append(element);
1543
1554
  }
1544
1555
  /**
@@ -1919,6 +1930,7 @@ class VTOController extends plattar_controller_1.PlattarController {
1919
1930
  if (!sceneID) {
1920
1931
  throw new Error("VTOController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
1921
1932
  }
1933
+ this._state = plattar_controller_1.ControllerState.Renderer;
1922
1934
  // required attributes with defaults for plattar-facear node
1923
1935
  const width = this.getAttribute("width") || "500px";
1924
1936
  const height = this.getAttribute("height") || "500px";
@@ -1957,7 +1969,6 @@ class VTOController extends plattar_controller_1.PlattarController {
1957
1969
  if (variationID) {
1958
1970
  viewer.setAttribute("variation-id", variationID);
1959
1971
  }
1960
- this._state = plattar_controller_1.ControllerState.Renderer;
1961
1972
  return new Promise((accept, reject) => {
1962
1973
  this.append(viewer);
1963
1974
  if (configState) {
@@ -2866,7 +2877,7 @@ exports.Util = Util;
2866
2877
  },{}],16:[function(require,module,exports){
2867
2878
  "use strict";
2868
2879
  Object.defineProperty(exports, "__esModule", { value: true });
2869
- exports.default = "1.167.11";
2880
+ exports.default = "1.167.12";
2870
2881
 
2871
2882
  },{}],17:[function(require,module,exports){
2872
2883
  "use strict";