@plattar/plattar-ar-adapter 1.167.3 → 1.167.5

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.
@@ -20,6 +20,5 @@ export declare class ConfiguratorController extends PlattarController {
20
20
  * Private Function - This launches the Dynamic/Generated AR Mode
21
21
  */
22
22
  private _InitARGenerated;
23
- removeRenderer(): boolean;
24
23
  get element(): HTMLElement | null;
25
24
  }
@@ -293,15 +293,6 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
293
293
  const configAR = new configurator_ar_1.ConfiguratorAR({ state: await this.getConfiguratorState(), useARBanner: this.getBooleanAttribute("show-ar-banner") });
294
294
  return configAR.init();
295
295
  }
296
- removeRenderer() {
297
- if (this._element) {
298
- this.removeChild(this._element);
299
- this._element = null;
300
- return true;
301
- }
302
- this.removeMessengerObservers();
303
- return false;
304
- }
305
296
  get element() {
306
297
  return this._element;
307
298
  }
@@ -75,7 +75,7 @@ export declare abstract class PlattarController {
75
75
  /**
76
76
  * Removes the currently active renderer view from the DOM
77
77
  */
78
- abstract removeRenderer(): boolean;
78
+ removeRenderer(): boolean;
79
79
  /**
80
80
  * Get the underlying renderer component (if any)
81
81
  */
@@ -201,6 +201,23 @@ class PlattarController {
201
201
  };
202
202
  });
203
203
  }
204
+ /**
205
+ * Removes the currently active renderer view from the DOM
206
+ */
207
+ removeRenderer() {
208
+ // remove all other children
209
+ const shadow = this.parent.shadowRoot;
210
+ if (shadow) {
211
+ let child = shadow.lastElementChild;
212
+ while (child) {
213
+ shadow.removeChild(child);
214
+ child = shadow.lastElementChild;
215
+ }
216
+ }
217
+ this._element = null;
218
+ this.removeMessengerObservers();
219
+ return true;
220
+ }
204
221
  /**
205
222
  * Returns the Parent Instance
206
223
  */
@@ -19,6 +19,5 @@ export declare class ProductController extends PlattarController {
19
19
  startARQRCode(options: any): Promise<HTMLElement>;
20
20
  startRenderer(): Promise<HTMLElement>;
21
21
  initAR(): Promise<LauncherAR>;
22
- removeRenderer(): boolean;
23
22
  get element(): HTMLElement | null;
24
23
  }
@@ -217,14 +217,6 @@ class ProductController extends plattar_controller_1.PlattarController {
217
217
  return reject(new Error("ProductController.initAR() - minimum required attributes not set, use product-id as a minimum"));
218
218
  });
219
219
  }
220
- removeRenderer() {
221
- if (this._element) {
222
- this.removeChild(this._element);
223
- this._element = null;
224
- return true;
225
- }
226
- return false;
227
- }
228
220
  get element() {
229
221
  return this._element;
230
222
  }
@@ -19,6 +19,5 @@ export declare class VTOController extends PlattarController {
19
19
  * Private Function - This launches the Dynamic/Generated AR Mode
20
20
  */
21
21
  private _InitARGenerated;
22
- removeRenderer(): boolean;
23
22
  get element(): HTMLElement | null;
24
23
  }
@@ -231,15 +231,6 @@ class VTOController extends plattar_controller_1.PlattarController {
231
231
  const configAR = new configurator_ar_1.ConfiguratorAR({ state: await this.getConfiguratorState(), useARBanner: this.getBooleanAttribute("show-ar-banner") });
232
232
  return configAR.init();
233
233
  }
234
- removeRenderer() {
235
- if (this._element) {
236
- this.removeChild(this._element);
237
- this._element = null;
238
- return true;
239
- }
240
- this.removeMessengerObservers();
241
- return false;
242
- }
243
234
  get element() {
244
235
  return this._element;
245
236
  }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.167.3";
1
+ declare const _default: "1.167.5";
2
2
  export default _default;
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = "1.167.3";
3
+ exports.default = "1.167.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plattar/plattar-ar-adapter",
3
- "version": "1.167.3",
3
+ "version": "1.167.5",
4
4
  "description": "Plattar AR Adapter for interfacing with Google & Apple WebAR",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",