@plattar/plattar-ar-adapter 1.167.3 → 1.167.4

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.
@@ -1265,7 +1265,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
1265
1265
  }
1266
1266
  removeRenderer() {
1267
1267
  if (this._element) {
1268
- this.removeChild(this._element);
1268
+ this._element.remove();
1269
1269
  this._element = null;
1270
1270
  return true;
1271
1271
  }
@@ -1533,16 +1533,6 @@ class PlattarController {
1533
1533
  const shadow = this.parent.shadowRoot || this.parent.attachShadow({ mode: 'open' });
1534
1534
  shadow.append(element);
1535
1535
  }
1536
- /**
1537
- *
1538
- * @param element
1539
- */
1540
- removeChild(element) {
1541
- const shadow = this.parent.shadowRoot;
1542
- if (shadow) {
1543
- shadow.removeChild(element);
1544
- }
1545
- }
1546
1536
  }
1547
1537
  exports.PlattarController = PlattarController;
1548
1538
 
@@ -1768,7 +1758,7 @@ class ProductController extends plattar_controller_1.PlattarController {
1768
1758
  }
1769
1759
  removeRenderer() {
1770
1760
  if (this._element) {
1771
- this.removeChild(this._element);
1761
+ this._element.remove();
1772
1762
  this._element = null;
1773
1763
  return true;
1774
1764
  }
@@ -2016,7 +2006,7 @@ class VTOController extends plattar_controller_1.PlattarController {
2016
2006
  }
2017
2007
  removeRenderer() {
2018
2008
  if (this._element) {
2019
- this.removeChild(this._element);
2009
+ this._element.remove();
2020
2010
  this._element = null;
2021
2011
  return true;
2022
2012
  }
@@ -2066,7 +2056,6 @@ class PlattarEmbed extends HTMLElement {
2066
2056
  this._observerState = ObserverState.Unlocked;
2067
2057
  this._controller = null;
2068
2058
  this._currentSceneID = null;
2069
- this._currentServer = null;
2070
2059
  this._observer = null;
2071
2060
  }
2072
2061
  get viewer() {
@@ -2082,6 +2071,9 @@ class PlattarEmbed extends HTMLElement {
2082
2071
  * creates a brand new instance of this embed
2083
2072
  */
2084
2073
  create() {
2074
+ // server cannot be changed once its set - defaults to production
2075
+ const server = this.hasAttribute("server") ? this.getAttribute("server") : "production";
2076
+ plattar_api_1.Server.create(plattar_api_1.Server.match(server || "production"));
2085
2077
  if (!this._observer) {
2086
2078
  this._observer = new MutationObserver((mutations) => {
2087
2079
  if (this._observerState === ObserverState.Unlocked) {
@@ -2138,9 +2130,6 @@ class PlattarEmbed extends HTMLElement {
2138
2130
  * embedding products with variations (without a scene-id)
2139
2131
  */
2140
2132
  _CreateLegacyEmbed() {
2141
- // server cannot be changed once its set - defaults to production
2142
- const server = this.hasAttribute("server") ? this.getAttribute("server") : "production";
2143
- plattar_api_1.Server.create(plattar_api_1.Server.match(server || "production"));
2144
2133
  this._controller = new product_controller_1.ProductController(this);
2145
2134
  const init = this.hasAttribute("init") ? this.getAttribute("init") : null;
2146
2135
  switch (init) {
@@ -2157,17 +2146,6 @@ class PlattarEmbed extends HTMLElement {
2157
2146
  * this can also be called when attributes/state changes so embeds can be re-loaded
2158
2147
  */
2159
2148
  _CreateEmbed(attributeName) {
2160
- // check if controller needs to be destroyed due to server change
2161
- const serverAttribute = this.hasAttribute("server") ? this.getAttribute("server") : "production";
2162
- if (this._currentServer !== serverAttribute) {
2163
- this._currentSceneID = serverAttribute || "production";
2164
- // reset the controller if any
2165
- if (this._controller) {
2166
- this._controller.removeRenderer();
2167
- this._controller = null;
2168
- }
2169
- }
2170
- plattar_api_1.Server.create(plattar_api_1.Server.match(this._currentServer || "production"));
2171
2149
  const embedType = this.hasAttribute("embed-type") ? this.getAttribute("embed-type") : "configurator";
2172
2150
  const currentEmbed = this._currentType;
2173
2151
  if (embedType) {
@@ -2841,7 +2819,7 @@ exports.Util = Util;
2841
2819
  },{}],16:[function(require,module,exports){
2842
2820
  "use strict";
2843
2821
  Object.defineProperty(exports, "__esModule", { value: true });
2844
- exports.default = "1.167.3";
2822
+ exports.default = "1.167.4";
2845
2823
 
2846
2824
  },{}],17:[function(require,module,exports){
2847
2825
  "use strict";
@@ -6792,21 +6770,11 @@ class BaseElement extends HTMLElement {
6792
6770
 
6793
6771
  if (shortenURL && shortenURL.toLowerCase() === "true") {
6794
6772
  this._ShortenURL(url).then((newURL) => {
6795
- // make sure by time promise is resolved that the original url hasn't been updated
6796
- const updatedURL = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
6797
-
6798
- if (updatedURL === url) {
6799
- this._GenerateQRCode(newURL, width, height);
6800
- }
6773
+ this._GenerateQRCode(newURL, width, height);
6801
6774
  }).catch((_err) => {
6802
6775
  console.warn(_err);
6803
6776
  // ignore error and just generate normal QR Code
6804
- // make sure by time promise is resolved that the original url hasn't been updated
6805
- const updatedURL = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
6806
-
6807
- if (updatedURL === url) {
6808
- this._GenerateQRCode(url, width, height);
6809
- }
6777
+ this._GenerateQRCode(url, width, height);
6810
6778
  });
6811
6779
  }
6812
6780
  else {
@@ -6956,7 +6924,7 @@ module.exports = {
6956
6924
  version: Version
6957
6925
  };
6958
6926
  },{"./elements/qrcode-element.js":109,"./version":111}],111:[function(require,module,exports){
6959
- module.exports = "1.165.1";
6927
+ module.exports = "1.160.1";
6960
6928
 
6961
6929
  },{}],112:[function(require,module,exports){
6962
6930
  "use strict";
@@ -8054,8 +8022,9 @@ class Util {
8054
8022
 
8055
8023
  module.exports = Util;
8056
8024
  },{}],131:[function(require,module,exports){
8057
- arguments[4][111][0].apply(exports,arguments)
8058
- },{"dup":111}],132:[function(require,module,exports){
8025
+ module.exports = "1.165.1";
8026
+
8027
+ },{}],132:[function(require,module,exports){
8059
8028
  (function (global){(function (){
8060
8029
  "use strict";
8061
8030