@plattar/plattar-ar-adapter 1.158.1 → 1.158.3

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.
@@ -1428,34 +1428,35 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1428
1428
  // with new attributes
1429
1429
  product = dState.state.firstOfType("product");
1430
1430
  if (!product) {
1431
- _context6.next = 14;
1431
+ _context6.next = 15;
1432
1432
  break;
1433
1433
  }
1434
1434
  this.parent.lockObserver();
1435
1435
  this.parent.destroy();
1436
1436
  this.setAttribute("product-id", product.scene_product_id);
1437
+ this.removeAttribute("scene-id");
1437
1438
  this.parent.unlockObserver();
1438
1439
  controller = this.parent.create();
1439
1440
  if (!controller) {
1440
- _context6.next = 13;
1441
+ _context6.next = 14;
1441
1442
  break;
1442
1443
  }
1443
1444
  return _context6.abrupt("return", controller.startARQRCode(options));
1444
- case 13:
1445
- return _context6.abrupt("return", Promise.reject(new Error("ConfiguratorController.startARQRCode() - legacy product transition failed")));
1446
1445
  case 14:
1447
- _context6.next = 18;
1446
+ return _context6.abrupt("return", Promise.reject(new Error("ConfiguratorController.startARQRCode() - legacy product transition failed")));
1447
+ case 15:
1448
+ _context6.next = 19;
1448
1449
  break;
1449
- case 16:
1450
- _context6.prev = 16;
1450
+ case 17:
1451
+ _context6.prev = 17;
1451
1452
  _context6.t0 = _context6["catch"](0);
1452
- case 18:
1453
- return _context6.abrupt("return", _get(_getPrototypeOf(ConfiguratorController.prototype), "startARQRCode", this).call(this, options));
1454
1453
  case 19:
1454
+ return _context6.abrupt("return", _get(_getPrototypeOf(ConfiguratorController.prototype), "startARQRCode", this).call(this, options));
1455
+ case 20:
1455
1456
  case "end":
1456
1457
  return _context6.stop();
1457
1458
  }
1458
- }, _callee6, this, [[0, 16]]);
1459
+ }, _callee6, this, [[0, 17]]);
1459
1460
  }))).apply(this, arguments);
1460
1461
  }
1461
1462
  }, {
@@ -1487,31 +1488,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1487
1488
  // with new attributes
1488
1489
  product = dState.state.firstOfType("product");
1489
1490
  if (!product) {
1490
- _context7.next = 19;
1491
+ _context7.next = 20;
1491
1492
  break;
1492
1493
  }
1493
1494
  this.parent.lockObserver();
1494
1495
  this.parent.destroy();
1495
1496
  this.setAttribute("product-id", product.scene_product_id);
1497
+ this.removeAttribute("scene-id");
1496
1498
  this.parent.unlockObserver();
1497
1499
  controller = this.parent.create();
1498
1500
  if (!controller) {
1499
- _context7.next = 18;
1501
+ _context7.next = 19;
1500
1502
  break;
1501
1503
  }
1502
1504
  return _context7.abrupt("return", controller.startViewerQRCode(options));
1503
- case 18:
1504
- return _context7.abrupt("return", Promise.reject(new Error("ConfiguratorController.startViewerQRCode() - legacy product transition failed")));
1505
1505
  case 19:
1506
+ return _context7.abrupt("return", Promise.reject(new Error("ConfiguratorController.startViewerQRCode() - legacy product transition failed")));
1507
+ case 20:
1506
1508
  configState = dState.state.encode();
1507
- _context7.next = 25;
1509
+ _context7.next = 26;
1508
1510
  break;
1509
- case 22:
1510
- _context7.prev = 22;
1511
+ case 23:
1512
+ _context7.prev = 23;
1511
1513
  _context7.t0 = _context7["catch"](5);
1512
1514
  // config state is not available
1513
1515
  configState = null;
1514
- case 25:
1516
+ case 26:
1515
1517
  opt = options || this._GetDefaultQROptions();
1516
1518
  viewer = document.createElement("plattar-qrcode");
1517
1519
  this._element = viewer;
@@ -1551,11 +1553,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1551
1553
  };
1552
1554
  _this15.append(viewer);
1553
1555
  }));
1554
- case 46:
1556
+ case 47:
1555
1557
  case "end":
1556
1558
  return _context7.stop();
1557
1559
  }
1558
- }, _callee7, this, [[5, 22]]);
1560
+ }, _callee7, this, [[5, 23]]);
1559
1561
  }))).apply(this, arguments);
1560
1562
  }
1561
1563
  }, {
@@ -1587,31 +1589,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1587
1589
  // with new attributes
1588
1590
  product = dState.state.firstOfType("product");
1589
1591
  if (!product) {
1590
- _context8.next = 19;
1592
+ _context8.next = 20;
1591
1593
  break;
1592
1594
  }
1593
1595
  this.parent.lockObserver();
1594
1596
  this.parent.destroy();
1595
1597
  this.setAttribute("product-id", product.scene_product_id);
1598
+ this.removeAttribute("scene-id");
1596
1599
  this.parent.unlockObserver();
1597
1600
  controller = this.parent.create();
1598
1601
  if (!controller) {
1599
- _context8.next = 18;
1602
+ _context8.next = 19;
1600
1603
  break;
1601
1604
  }
1602
1605
  return _context8.abrupt("return", controller.startRenderer());
1603
- case 18:
1604
- return _context8.abrupt("return", Promise.reject(new Error("ConfiguratorController.startRenderer() - legacy product transition failed")));
1605
1606
  case 19:
1607
+ return _context8.abrupt("return", Promise.reject(new Error("ConfiguratorController.startRenderer() - legacy product transition failed")));
1608
+ case 20:
1606
1609
  configState = dState;
1607
- _context8.next = 25;
1610
+ _context8.next = 26;
1608
1611
  break;
1609
- case 22:
1610
- _context8.prev = 22;
1612
+ case 23:
1613
+ _context8.prev = 23;
1611
1614
  _context8.t0 = _context8["catch"](5);
1612
1615
  // config state is not available
1613
1616
  configState = null;
1614
- case 25:
1617
+ case 26:
1615
1618
  // required attributes with defaults for plattar-configurator node
1616
1619
  width = this.getAttribute("width") || "500px";
1617
1620
  height = this.getAttribute("height") || "500px";
@@ -1641,11 +1644,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1641
1644
  }
1642
1645
  return accept(viewer);
1643
1646
  }));
1644
- case 41:
1647
+ case 42:
1645
1648
  case "end":
1646
1649
  return _context8.stop();
1647
1650
  }
1648
- }, _callee8, this, [[5, 22]]);
1651
+ }, _callee8, this, [[5, 23]]);
1649
1652
  }))).apply(this, arguments);
1650
1653
  }
1651
1654
  }, {
@@ -1671,41 +1674,42 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1671
1674
  // with new attributes
1672
1675
  product = dState.state.firstOfType("product");
1673
1676
  if (!product) {
1674
- _context9.next = 16;
1677
+ _context9.next = 17;
1675
1678
  break;
1676
1679
  }
1677
1680
  this.parent.lockObserver();
1678
1681
  this.parent.destroy();
1679
1682
  this.setAttribute("product-id", product.scene_product_id);
1683
+ this.removeAttribute("scene-id");
1680
1684
  this.parent.unlockObserver();
1681
1685
  controller = this.parent.create();
1682
1686
  if (!controller) {
1683
- _context9.next = 15;
1687
+ _context9.next = 16;
1684
1688
  break;
1685
1689
  }
1686
1690
  return _context9.abrupt("return", controller.initAR());
1687
- case 15:
1688
- return _context9.abrupt("return", Promise.reject(new Error("ConfiguratorController.initAR() - legacy product transition failed")));
1689
1691
  case 16:
1690
- _context9.next = 20;
1692
+ return _context9.abrupt("return", Promise.reject(new Error("ConfiguratorController.initAR() - legacy product transition failed")));
1693
+ case 17:
1694
+ _context9.next = 21;
1691
1695
  break;
1692
- case 18:
1693
- _context9.prev = 18;
1696
+ case 19:
1697
+ _context9.prev = 19;
1694
1698
  _context9.t0 = _context9["catch"](2);
1695
- case 20:
1699
+ case 21:
1696
1700
  arMode = this.getAttribute("ar-mode") || "generated";
1697
1701
  _context9.t1 = arMode.toLowerCase();
1698
- _context9.next = _context9.t1 === "inherited" ? 24 : _context9.t1 === "generated" ? 25 : 25;
1702
+ _context9.next = _context9.t1 === "inherited" ? 25 : _context9.t1 === "generated" ? 26 : 26;
1699
1703
  break;
1700
- case 24:
1701
- return _context9.abrupt("return", this._InitARInherited());
1702
1704
  case 25:
1703
- return _context9.abrupt("return", this._InitARGenerated());
1705
+ return _context9.abrupt("return", this._InitARInherited());
1704
1706
  case 26:
1707
+ return _context9.abrupt("return", this._InitARGenerated());
1708
+ case 27:
1705
1709
  case "end":
1706
1710
  return _context9.stop();
1707
1711
  }
1708
- }, _callee9, this, [[2, 18]]);
1712
+ }, _callee9, this, [[2, 19]]);
1709
1713
  }))).apply(this, arguments);
1710
1714
  }
1711
1715
  /**
@@ -2124,6 +2128,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2124
2128
  this.parent.setAttribute(attribute, value);
2125
2129
  }
2126
2130
  }
2131
+ /**
2132
+ * Removes a particular attribute from HTML DOM
2133
+ *
2134
+ * @param attribute - The name of the attribute
2135
+ */
2136
+ }, {
2137
+ key: "removeAttribute",
2138
+ value: function removeAttribute(attribute) {
2139
+ if (this.parent) {
2140
+ this.parent.removeAttribute(attribute);
2141
+ }
2142
+ }
2127
2143
  /**
2128
2144
  * Appends the provided element into the shadow-root of the parent element
2129
2145
  * @param element - The element to append
@@ -3940,7 +3956,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3940
3956
  Object.defineProperty(exports, "__esModule", {
3941
3957
  value: true
3942
3958
  });
3943
- exports["default"] = "1.158.1";
3959
+ exports["default"] = "1.158.3";
3944
3960
  }, {}],
3945
3961
  17: [function (require, module, exports) {
3946
3962
  "use strict";