@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.
@@ -1194,7 +1194,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1194
1194
  var sceneID = _this12.getAttribute("scene-id");
1195
1195
 
1196
1196
  if (sceneID) {
1197
- var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
1197
+ var opt = options || _this12._GetDefaultQROptions();
1198
+
1198
1199
  var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
1199
1200
 
1200
1201
  var width = _this12.getAttribute("width") || "500px";
@@ -1214,6 +1215,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1214
1215
  viewer.setAttribute("qr-type", opt.qrType);
1215
1216
  }
1216
1217
 
1218
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
1217
1219
  var dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID; // optional attributes
1218
1220
 
1219
1221
  var configState = _this12.getAttribute("config-state");
@@ -1511,6 +1513,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1511
1513
 
1512
1514
 
1513
1515
  _createClass(PlattarController, [{
1516
+ key: "_GetDefaultQROptions",
1517
+ value: function _GetDefaultQROptions() {
1518
+ return {
1519
+ color: this.getAttribute("qr-color") || "#101721",
1520
+ qrType: this.getAttribute("qr-style") || "default",
1521
+ shorten: this.getAttribute("qr-shorten") || false,
1522
+ margin: 0
1523
+ };
1524
+ }
1525
+ }, {
1514
1526
  key: "startAR",
1515
1527
  value:
1516
1528
  /**
@@ -1561,7 +1573,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1561
1573
  // remove the old renderer instance if any
1562
1574
  _this16.removeRenderer();
1563
1575
 
1564
- var opt = options || PlattarController.DEFAULT_QR_OPTIONS;
1576
+ var opt = options || _this16._GetDefaultQROptions();
1577
+
1565
1578
  var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
1566
1579
 
1567
1580
  var width = _this16.getAttribute("width") || "500px";
@@ -1581,6 +1594,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1581
1594
  viewer.setAttribute("qr-type", opt.qrType);
1582
1595
  }
1583
1596
 
1597
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
1584
1598
  var qrOptions = btoa(JSON.stringify(opt));
1585
1599
  var dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
1586
1600
 
@@ -1678,15 +1692,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1678
1692
  });
1679
1693
  shadow.append(element);
1680
1694
  }
1681
- }], [{
1682
- key: "DEFAULT_QR_OPTIONS",
1683
- get: function get() {
1684
- return {
1685
- color: "#101721",
1686
- qrType: "default",
1687
- margin: 0
1688
- };
1689
- }
1690
1695
  }]);
1691
1696
 
1692
1697
  return PlattarController;
@@ -1764,7 +1769,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1764
1769
  var productID = _this17.getAttribute("product-id");
1765
1770
 
1766
1771
  if (productID) {
1767
- var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
1772
+ var opt = options || _this17._GetDefaultQROptions();
1773
+
1768
1774
  var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
1769
1775
 
1770
1776
  var width = _this17.getAttribute("width") || "500px";
@@ -1782,8 +1788,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
1782
1788
 
1783
1789
  if (opt.qrType) {
1784
1790
  viewer.setAttribute("qr-type", opt.qrType);
1785
- } // optional attributes
1791
+ }
1786
1792
 
1793
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false"); // optional attributes
1787
1794
 
1788
1795
  var variationID = _this17.getAttribute("variation-id");
1789
1796
 
@@ -2004,7 +2011,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2004
2011
  var sceneID = _this20.getAttribute("scene-id");
2005
2012
 
2006
2013
  if (sceneID) {
2007
- var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
2014
+ var opt = options || _this20._GetDefaultQROptions();
2015
+
2008
2016
  var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
2009
2017
 
2010
2018
  var width = _this20.getAttribute("width") || "500px";
@@ -2024,6 +2032,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2024
2032
  viewer.setAttribute("qr-type", opt.qrType);
2025
2033
  }
2026
2034
 
2035
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
2027
2036
  var dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + sceneID; // optional attributes
2028
2037
 
2029
2038
  var productID = _this20.getAttribute("product-id") || _this20.getAttribute("scene-product-id");
@@ -2283,7 +2292,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2283
2292
  var sceneID = _this23.getAttribute("scene-id");
2284
2293
 
2285
2294
  if (sceneID) {
2286
- var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
2295
+ var opt = options || _this23._GetDefaultQROptions();
2296
+
2287
2297
  var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
2288
2298
 
2289
2299
  var width = _this23.getAttribute("width") || "500px";
@@ -2303,6 +2313,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2303
2313
  viewer.setAttribute("qr-type", opt.qrType);
2304
2314
  }
2305
2315
 
2316
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
2306
2317
  var dst = plattar_api_1.Server.location().base + "renderer/facear.html?scene_id=" + sceneID; // optional attributes
2307
2318
 
2308
2319
  var configState = _this23.getAttribute("config-state");
@@ -3340,7 +3351,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3340
3351
  Object.defineProperty(exports, "__esModule", {
3341
3352
  value: true
3342
3353
  });
3343
- exports["default"] = "1.131.1";
3354
+ exports["default"] = "1.132.1";
3344
3355
  }, {}],
3345
3356
  17: [function (require, module, exports) {
3346
3357
  "use strict";