@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.
@@ -30,7 +30,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
30
30
  this.removeRenderer();
31
31
  const sceneID = this.getAttribute("scene-id");
32
32
  if (sceneID) {
33
- const opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
33
+ const opt = options || this._GetDefaultQROptions();
34
34
  const viewer = document.createElement("plattar-qrcode");
35
35
  // required attributes with defaults for plattar-viewer node
36
36
  const width = this.getAttribute("width") || "500px";
@@ -46,6 +46,7 @@ class ConfiguratorController extends plattar_controller_1.PlattarController {
46
46
  if (opt.qrType) {
47
47
  viewer.setAttribute("qr-type", opt.qrType);
48
48
  }
49
+ viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
49
50
  let dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID;
50
51
  // optional attributes
51
52
  const configState = this.getAttribute("config-state");
@@ -11,7 +11,7 @@ export declare abstract class PlattarController {
11
11
  /**
12
12
  * Default QR Code rendering options
13
13
  */
14
- static get DEFAULT_QR_OPTIONS(): any;
14
+ protected _GetDefaultQROptions(): any;
15
15
  private readonly _parent;
16
16
  protected _state: ControllerState;
17
17
  protected _element: HTMLElement | null;
@@ -21,10 +21,11 @@ class PlattarController {
21
21
  /**
22
22
  * Default QR Code rendering options
23
23
  */
24
- static get DEFAULT_QR_OPTIONS() {
24
+ _GetDefaultQROptions() {
25
25
  return {
26
- color: "#101721",
27
- qrType: "default",
26
+ color: this.getAttribute("qr-color") || "#101721",
27
+ qrType: this.getAttribute("qr-style") || "default",
28
+ shorten: this.getAttribute("qr-shorten") || false,
28
29
  margin: 0
29
30
  };
30
31
  }
@@ -64,7 +65,7 @@ class PlattarController {
64
65
  return new Promise((accept, reject) => {
65
66
  // remove the old renderer instance if any
66
67
  this.removeRenderer();
67
- const opt = options || PlattarController.DEFAULT_QR_OPTIONS;
68
+ const opt = options || this._GetDefaultQROptions();
68
69
  const viewer = document.createElement("plattar-qrcode");
69
70
  // required attributes with defaults for plattar-viewer node
70
71
  const width = this.getAttribute("width") || "500px";
@@ -80,6 +81,7 @@ class PlattarController {
80
81
  if (opt.qrType) {
81
82
  viewer.setAttribute("qr-type", opt.qrType);
82
83
  }
84
+ viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
83
85
  const qrOptions = btoa(JSON.stringify(opt));
84
86
  let dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
85
87
  const sceneID = this.getAttribute("scene-id");
@@ -37,7 +37,7 @@ class ProductController extends plattar_controller_1.PlattarController {
37
37
  this.removeRenderer();
38
38
  const productID = this.getAttribute("product-id");
39
39
  if (productID) {
40
- const opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
40
+ const opt = options || this._GetDefaultQROptions();
41
41
  const viewer = document.createElement("plattar-qrcode");
42
42
  // required attributes with defaults for plattar-viewer node
43
43
  const width = this.getAttribute("width") || "500px";
@@ -53,6 +53,7 @@ class ProductController extends plattar_controller_1.PlattarController {
53
53
  if (opt.qrType) {
54
54
  viewer.setAttribute("qr-type", opt.qrType);
55
55
  }
56
+ viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
56
57
  // optional attributes
57
58
  const variationID = this.getAttribute("variation-id");
58
59
  const variationSKU = this.getAttribute("variation-sku");
@@ -41,7 +41,7 @@ class ViewerController extends plattar_controller_1.PlattarController {
41
41
  this.removeRenderer();
42
42
  const sceneID = this.getAttribute("scene-id");
43
43
  if (sceneID) {
44
- const opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
44
+ const opt = options || this._GetDefaultQROptions();
45
45
  const viewer = document.createElement("plattar-qrcode");
46
46
  // required attributes with defaults for plattar-viewer node
47
47
  const width = this.getAttribute("width") || "500px";
@@ -57,6 +57,7 @@ class ViewerController extends plattar_controller_1.PlattarController {
57
57
  if (opt.qrType) {
58
58
  viewer.setAttribute("qr-type", opt.qrType);
59
59
  }
60
+ viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
60
61
  let dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + sceneID;
61
62
  // optional attributes
62
63
  const productID = (this.getAttribute("product-id") || this.getAttribute("scene-product-id"));
@@ -28,7 +28,7 @@ class VTOController extends plattar_controller_1.PlattarController {
28
28
  this.removeRenderer();
29
29
  const sceneID = this.getAttribute("scene-id");
30
30
  if (sceneID) {
31
- const opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
31
+ const opt = options || this._GetDefaultQROptions();
32
32
  const viewer = document.createElement("plattar-qrcode");
33
33
  // required attributes with defaults for plattar-viewer node
34
34
  const width = this.getAttribute("width") || "500px";
@@ -44,6 +44,7 @@ class VTOController extends plattar_controller_1.PlattarController {
44
44
  if (opt.qrType) {
45
45
  viewer.setAttribute("qr-type", opt.qrType);
46
46
  }
47
+ viewer.setAttribute("shorten", (opt.shorten && (opt.shorten === true || opt.shorten === "true")) ? "true" : "false");
47
48
  let dst = plattar_api_1.Server.location().base + "renderer/facear.html?scene_id=" + sceneID;
48
49
  // optional attributes
49
50
  const configState = this.getAttribute("config-state");
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.131.1";
1
+ declare const _default: "1.132.1";
2
2
  export default _default;
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = "1.131.1";
3
+ exports.default = "1.132.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plattar/plattar-ar-adapter",
3
- "version": "1.131.1",
3
+ "version": "1.132.1",
4
4
  "description": "Plattar AR Adapter for interfacing with Google & Apple WebAR",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -45,11 +45,11 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@babel/cli": "^7.17.10",
48
- "@babel/core": "^7.18.2",
48
+ "@babel/core": "^7.18.5",
49
49
  "@babel/preset-env": "^7.18.2",
50
50
  "browserify": "^17.0.0",
51
- "typescript": "^4.6.4",
52
- "uglify-js": "^3.15.5"
51
+ "typescript": "^4.7.3",
52
+ "uglify-js": "^3.16.0"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"