@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.
- package/build/es2015/plattar-ar-adapter.js +36 -25
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +14 -3
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/embed/controllers/configurator-controller.js +1 -1
- package/dist/embed/controllers/plattar-controller.js +11 -0
- package/dist/embed/controllers/vto-controller.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -173,6 +173,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
|
|
|
173
173
|
}
|
|
174
174
|
// optional attributes
|
|
175
175
|
let configState = null;
|
|
176
|
+
this._state = plattar_controller_1.ControllerState.Renderer;
|
|
176
177
|
try {
|
|
177
178
|
const dState = await this.getConfiguratorState();
|
|
178
179
|
// if this is declared, we have a furniture scene that we need to re-create the embed
|
|
@@ -217,7 +218,6 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
|
|
|
217
218
|
if (showUI) {
|
|
218
219
|
viewer.setAttribute("show-ui", showUI);
|
|
219
220
|
}
|
|
220
|
-
this._state = plattar_controller_1.ControllerState.Renderer;
|
|
221
221
|
return new Promise((accept, reject) => {
|
|
222
222
|
this.append(viewer);
|
|
223
223
|
if (configState) {
|
|
@@ -266,7 +266,18 @@ class PlattarController {
|
|
|
266
266
|
* @param element - The element to append
|
|
267
267
|
*/
|
|
268
268
|
append(element) {
|
|
269
|
+
if (this._element !== element) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
// ensure append only allows a single element in the shadow DOM
|
|
269
273
|
const shadow = this.parent.shadowRoot || this.parent.attachShadow({ mode: 'open' });
|
|
274
|
+
if (shadow) {
|
|
275
|
+
let child = shadow.lastElementChild;
|
|
276
|
+
while (child) {
|
|
277
|
+
shadow.removeChild(child);
|
|
278
|
+
child = shadow.lastElementChild;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
270
281
|
shadow.append(element);
|
|
271
282
|
}
|
|
272
283
|
/**
|
|
@@ -136,6 +136,7 @@ class VTOController extends plattar_controller_1.PlattarController {
|
|
|
136
136
|
if (!sceneID) {
|
|
137
137
|
throw new Error("VTOController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
|
|
138
138
|
}
|
|
139
|
+
this._state = plattar_controller_1.ControllerState.Renderer;
|
|
139
140
|
// required attributes with defaults for plattar-facear node
|
|
140
141
|
const width = this.getAttribute("width") || "500px";
|
|
141
142
|
const height = this.getAttribute("height") || "500px";
|
|
@@ -174,7 +175,6 @@ class VTOController extends plattar_controller_1.PlattarController {
|
|
|
174
175
|
if (variationID) {
|
|
175
176
|
viewer.setAttribute("variation-id", variationID);
|
|
176
177
|
}
|
|
177
|
-
this._state = plattar_controller_1.ControllerState.Renderer;
|
|
178
178
|
return new Promise((accept, reject) => {
|
|
179
179
|
this.append(viewer);
|
|
180
180
|
if (configState) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.167.
|
|
1
|
+
declare const _default: "1.167.12";
|
|
2
2
|
export default _default;
|
package/dist/version.js
CHANGED