@plattar/plattar-ar-adapter 1.131.1 → 1.132.1
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 +27 -16
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +15 -9
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/embed/controllers/configurator-controller.js +2 -1
- package/dist/embed/controllers/plattar-controller.d.ts +1 -1
- package/dist/embed/controllers/plattar-controller.js +6 -4
- package/dist/embed/controllers/product-controller.js +2 -1
- package/dist/embed/controllers/viewer-controller.js +2 -1
- package/dist/embed/controllers/vto-controller.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
|
@@ -699,7 +699,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
|
|
|
699
699
|
this.removeRenderer();
|
|
700
700
|
const sceneID = this.getAttribute("scene-id");
|
|
701
701
|
if (sceneID) {
|
|
702
|
-
const opt = options ||
|
|
702
|
+
const opt = options || this._GetDefaultQROptions();
|
|
703
703
|
const viewer = document.createElement("plattar-qrcode");
|
|
704
704
|
// required attributes with defaults for plattar-viewer node
|
|
705
705
|
const width = this.getAttribute("width") || "500px";
|
|
@@ -715,6 +715,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
|
|
|
715
715
|
if (opt.qrType) {
|
|
716
716
|
viewer.setAttribute("qr-type", opt.qrType);
|
|
717
717
|
}
|
|
718
|
+
viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
|
|
718
719
|
let dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID;
|
|
719
720
|
// optional attributes
|
|
720
721
|
const configState = this.getAttribute("config-state");
|
|
@@ -922,10 +923,11 @@ class PlattarController {
|
|
|
922
923
|
/**
|
|
923
924
|
* Default QR Code rendering options
|
|
924
925
|
*/
|
|
925
|
-
|
|
926
|
+
_GetDefaultQROptions() {
|
|
926
927
|
return {
|
|
927
|
-
color: "#101721",
|
|
928
|
-
qrType: "default",
|
|
928
|
+
color: this.getAttribute("qr-color") || "#101721",
|
|
929
|
+
qrType: this.getAttribute("qr-style") || "default",
|
|
930
|
+
shorten: this.getAttribute("qr-shorten") || false,
|
|
929
931
|
margin: 0
|
|
930
932
|
};
|
|
931
933
|
}
|
|
@@ -965,7 +967,7 @@ class PlattarController {
|
|
|
965
967
|
return new Promise((accept, reject) => {
|
|
966
968
|
// remove the old renderer instance if any
|
|
967
969
|
this.removeRenderer();
|
|
968
|
-
const opt = options ||
|
|
970
|
+
const opt = options || this._GetDefaultQROptions();
|
|
969
971
|
const viewer = document.createElement("plattar-qrcode");
|
|
970
972
|
// required attributes with defaults for plattar-viewer node
|
|
971
973
|
const width = this.getAttribute("width") || "500px";
|
|
@@ -981,6 +983,7 @@ class PlattarController {
|
|
|
981
983
|
if (opt.qrType) {
|
|
982
984
|
viewer.setAttribute("qr-type", opt.qrType);
|
|
983
985
|
}
|
|
986
|
+
viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
|
|
984
987
|
const qrOptions = btoa(JSON.stringify(opt));
|
|
985
988
|
let dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
|
|
986
989
|
const sceneID = this.getAttribute("scene-id");
|
|
@@ -1090,7 +1093,7 @@ class ProductController extends plattar_controller_1.PlattarController {
|
|
|
1090
1093
|
this.removeRenderer();
|
|
1091
1094
|
const productID = this.getAttribute("product-id");
|
|
1092
1095
|
if (productID) {
|
|
1093
|
-
const opt = options ||
|
|
1096
|
+
const opt = options || this._GetDefaultQROptions();
|
|
1094
1097
|
const viewer = document.createElement("plattar-qrcode");
|
|
1095
1098
|
// required attributes with defaults for plattar-viewer node
|
|
1096
1099
|
const width = this.getAttribute("width") || "500px";
|
|
@@ -1106,6 +1109,7 @@ class ProductController extends plattar_controller_1.PlattarController {
|
|
|
1106
1109
|
if (opt.qrType) {
|
|
1107
1110
|
viewer.setAttribute("qr-type", opt.qrType);
|
|
1108
1111
|
}
|
|
1112
|
+
viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
|
|
1109
1113
|
// optional attributes
|
|
1110
1114
|
const variationID = this.getAttribute("variation-id");
|
|
1111
1115
|
const variationSKU = this.getAttribute("variation-sku");
|
|
@@ -1245,7 +1249,7 @@ class ViewerController extends plattar_controller_1.PlattarController {
|
|
|
1245
1249
|
this.removeRenderer();
|
|
1246
1250
|
const sceneID = this.getAttribute("scene-id");
|
|
1247
1251
|
if (sceneID) {
|
|
1248
|
-
const opt = options ||
|
|
1252
|
+
const opt = options || this._GetDefaultQROptions();
|
|
1249
1253
|
const viewer = document.createElement("plattar-qrcode");
|
|
1250
1254
|
// required attributes with defaults for plattar-viewer node
|
|
1251
1255
|
const width = this.getAttribute("width") || "500px";
|
|
@@ -1261,6 +1265,7 @@ class ViewerController extends plattar_controller_1.PlattarController {
|
|
|
1261
1265
|
if (opt.qrType) {
|
|
1262
1266
|
viewer.setAttribute("qr-type", opt.qrType);
|
|
1263
1267
|
}
|
|
1268
|
+
viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
|
|
1264
1269
|
let dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + sceneID;
|
|
1265
1270
|
// optional attributes
|
|
1266
1271
|
const productID = (this.getAttribute("product-id") || this.getAttribute("scene-product-id"));
|
|
@@ -1426,7 +1431,7 @@ class VTOController extends plattar_controller_1.PlattarController {
|
|
|
1426
1431
|
this.removeRenderer();
|
|
1427
1432
|
const sceneID = this.getAttribute("scene-id");
|
|
1428
1433
|
if (sceneID) {
|
|
1429
|
-
const opt = options ||
|
|
1434
|
+
const opt = options || this._GetDefaultQROptions();
|
|
1430
1435
|
const viewer = document.createElement("plattar-qrcode");
|
|
1431
1436
|
// required attributes with defaults for plattar-viewer node
|
|
1432
1437
|
const width = this.getAttribute("width") || "500px";
|
|
@@ -1442,6 +1447,7 @@ class VTOController extends plattar_controller_1.PlattarController {
|
|
|
1442
1447
|
if (opt.qrType) {
|
|
1443
1448
|
viewer.setAttribute("qr-type", opt.qrType);
|
|
1444
1449
|
}
|
|
1450
|
+
viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
|
|
1445
1451
|
let dst = plattar_api_1.Server.location().base + "renderer/facear.html?scene_id=" + sceneID;
|
|
1446
1452
|
// optional attributes
|
|
1447
1453
|
const configState = this.getAttribute("config-state");
|
|
@@ -2142,7 +2148,7 @@ exports.Util = Util;
|
|
|
2142
2148
|
},{}],16:[function(require,module,exports){
|
|
2143
2149
|
"use strict";
|
|
2144
2150
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2145
|
-
exports.default = "1.
|
|
2151
|
+
exports.default = "1.132.1";
|
|
2146
2152
|
|
|
2147
2153
|
},{}],17:[function(require,module,exports){
|
|
2148
2154
|
"use strict";
|