@plattar/plattar-ar-adapter 1.123.7 → 1.123.8
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 +16 -4
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +13 -5
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/embed/controllers/viewer-controller.js +11 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1056,6 +1056,7 @@ exports.ViewerController = void 0;
|
|
|
1056
1056
|
const plattar_api_1 = require("@plattar/plattar-api");
|
|
1057
1057
|
const product_ar_1 = require("../../ar/product-ar");
|
|
1058
1058
|
const scene_product_ar_1 = require("../../ar/scene-product-ar");
|
|
1059
|
+
const configurator_state_1 = require("../../util/configurator-state");
|
|
1059
1060
|
const util_1 = require("../../util/util");
|
|
1060
1061
|
const plattar_controller_1 = require("./plattar-controller");
|
|
1061
1062
|
/**
|
|
@@ -1188,11 +1189,18 @@ class ViewerController extends plattar_controller_1.PlattarController {
|
|
|
1188
1189
|
return product.init().then(accept).catch(reject);
|
|
1189
1190
|
}
|
|
1190
1191
|
const sceneID = this.getAttribute("scene-id");
|
|
1191
|
-
//
|
|
1192
|
+
// use the first default product-variation id if available
|
|
1192
1193
|
if (sceneID) {
|
|
1193
|
-
return
|
|
1194
|
+
return configurator_state_1.ConfiguratorState.decodeScene(sceneID).then((state) => {
|
|
1195
|
+
const first = state.first();
|
|
1196
|
+
if (first) {
|
|
1197
|
+
const sceneProductAR = new scene_product_ar_1.SceneProductAR(first.scene_product_id, first.product_variation_id);
|
|
1198
|
+
return sceneProductAR.init().then(accept).catch(reject);
|
|
1199
|
+
}
|
|
1200
|
+
return reject(new Error("ViewerController.initAR() - your scene does not contain any valid products"));
|
|
1201
|
+
}).catch(reject);
|
|
1194
1202
|
}
|
|
1195
|
-
return reject(new Error("ViewerController.initAR() - minimum required attributes not set, use
|
|
1203
|
+
return reject(new Error("ViewerController.initAR() - minimum required attributes not set, use scene-id as a minimum"));
|
|
1196
1204
|
});
|
|
1197
1205
|
}
|
|
1198
1206
|
removeRenderer() {
|
|
@@ -1209,7 +1217,7 @@ class ViewerController extends plattar_controller_1.PlattarController {
|
|
|
1209
1217
|
}
|
|
1210
1218
|
exports.ViewerController = ViewerController;
|
|
1211
1219
|
|
|
1212
|
-
},{"../../ar/product-ar":3,"../../ar/scene-product-ar":6,"../../util/util":15,"./plattar-controller":8,"@plattar/plattar-api":42}],11:[function(require,module,exports){
|
|
1220
|
+
},{"../../ar/product-ar":3,"../../ar/scene-product-ar":6,"../../util/configurator-state":14,"../../util/util":15,"./plattar-controller":8,"@plattar/plattar-api":42}],11:[function(require,module,exports){
|
|
1213
1221
|
"use strict";
|
|
1214
1222
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1215
1223
|
exports.VTOController = void 0;
|
|
@@ -1953,7 +1961,7 @@ exports.Util = Util;
|
|
|
1953
1961
|
},{}],16:[function(require,module,exports){
|
|
1954
1962
|
"use strict";
|
|
1955
1963
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1956
|
-
exports.default = "1.123.
|
|
1964
|
+
exports.default = "1.123.8";
|
|
1957
1965
|
|
|
1958
1966
|
},{}],17:[function(require,module,exports){
|
|
1959
1967
|
"use strict";
|