@plattar/plattar-ar-adapter 1.121.1 → 1.122.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.
@@ -470,6 +470,12 @@ class PlattarEmbed extends HTMLElement {
470
470
  viewer.setAttribute("height", this._height);
471
471
  viewer.setAttribute("server", this._server);
472
472
  viewer.setAttribute("scene-id", this._sceneID);
473
+ if (this._productID) {
474
+ viewer.setAttribute("product-id", this._productID);
475
+ }
476
+ if (this._variationID) {
477
+ viewer.setAttribute("variation-id", this._variationID);
478
+ }
473
479
  viewer.onload = () => {
474
480
  return accept(viewer);
475
481
  };
@@ -527,7 +533,13 @@ class PlattarEmbed extends HTMLElement {
527
533
  if (opt.qrType) {
528
534
  viewer.setAttribute("qr-type", opt.qrType);
529
535
  }
530
- const dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + this._sceneID;
536
+ let dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + this._sceneID;
537
+ if (this._productID) {
538
+ dst += "&productId=" + this._productID;
539
+ }
540
+ if (this._variationID) {
541
+ dst += "&variationId=" + this._variationID;
542
+ }
531
543
  viewer.setAttribute("url", dst);
532
544
  viewer.onload = () => {
533
545
  return accept(viewer);
@@ -708,7 +720,7 @@ exports.Util = Util;
708
720
  },{}],9:[function(require,module,exports){
709
721
  "use strict";
710
722
  Object.defineProperty(exports, "__esModule", { value: true });
711
- exports.default = "1.121.1";
723
+ exports.default = "1.122.1";
712
724
 
713
725
  },{}],10:[function(require,module,exports){
714
726
  "use strict";
@@ -4617,7 +4629,7 @@ class BaseElement extends HTMLElement {
4617
4629
  let first = true;
4618
4630
 
4619
4631
  for (const [key, value] of attr.entries()) {
4620
- queryStr = first ? ("?" + key + "=" + value) : ("&" + key + "=" + value);
4632
+ queryStr += (first ? ("?" + key + "=" + value) : ("&" + key + "=" + value));
4621
4633
 
4622
4634
  first = false;
4623
4635
  }
@@ -5007,6 +5019,16 @@ class ViewerElement extends BaseElement {
5007
5019
  get elementType() {
5008
5020
  return "viewer";
5009
5021
  }
5022
+
5023
+ get optionalAttributes() {
5024
+ return [{
5025
+ key: "variation-id",
5026
+ map: "variationId"
5027
+ }, {
5028
+ key: "product-id",
5029
+ map: "productId"
5030
+ }];
5031
+ }
5010
5032
  }
5011
5033
 
5012
5034
  module.exports = ViewerElement;
@@ -5152,7 +5174,7 @@ class Util {
5152
5174
 
5153
5175
  module.exports = Util;
5154
5176
  },{}],116:[function(require,module,exports){
5155
- module.exports = "1.121.2";
5177
+ module.exports = "1.122.2";
5156
5178
 
5157
5179
  },{}],117:[function(require,module,exports){
5158
5180
  (function (global){(function (){