@plattar/plattar-ar-adapter 1.169.4 → 1.177.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.
@@ -19,6 +19,7 @@ export declare abstract class PlattarController {
19
19
  protected _element: HTMLElement | null;
20
20
  protected _prevQROpt: any;
21
21
  private _selectVariationObserver;
22
+ private _selectVariationIDObserver;
22
23
  private _selectVariationSKUObserver;
23
24
  constructor(parent: PlattarEmbed);
24
25
  /**
@@ -30,6 +30,7 @@ class PlattarController {
30
30
  this._element = null;
31
31
  this._prevQROpt = null;
32
32
  this._selectVariationObserver = null;
33
+ this._selectVariationIDObserver = null;
33
34
  this._selectVariationSKUObserver = null;
34
35
  this._parent = parent;
35
36
  }
@@ -75,6 +76,15 @@ class PlattarController {
75
76
  });
76
77
  }
77
78
  });
79
+ this._selectVariationIDObserver = viewer.messengerInstance.observer.subscribe("selectVariationID", (cd) => {
80
+ if (cd.type === "call") {
81
+ const args = cd.data[0];
82
+ const variations = args ? (Array.isArray(args) ? args : [args]) : [];
83
+ variations.forEach((variationID) => {
84
+ configState.state.setVariationID(variationID);
85
+ });
86
+ }
87
+ });
78
88
  this._selectVariationSKUObserver = viewer.messengerInstance.observer.subscribe("selectVariationSKU", (cd) => {
79
89
  if (cd.type === "call") {
80
90
  const args = cd.data[0];
@@ -93,6 +103,10 @@ class PlattarController {
93
103
  this._selectVariationObserver();
94
104
  this._selectVariationObserver = null;
95
105
  }
106
+ if (this._selectVariationIDObserver) {
107
+ this._selectVariationIDObserver();
108
+ this._selectVariationIDObserver = null;
109
+ }
96
110
  if (this._selectVariationSKUObserver) {
97
111
  this._selectVariationSKUObserver();
98
112
  this._selectVariationSKUObserver = null;
@@ -15,7 +15,9 @@ var EmbedType;
15
15
  EmbedType[EmbedType["Legacy"] = 1] = "Legacy";
16
16
  EmbedType[EmbedType["VTO"] = 2] = "VTO";
17
17
  EmbedType[EmbedType["WebXR"] = 3] = "WebXR";
18
- EmbedType[EmbedType["None"] = 4] = "None";
18
+ EmbedType[EmbedType["Gallery"] = 4] = "Gallery";
19
+ EmbedType[EmbedType["Launcher"] = 5] = "Launcher";
20
+ EmbedType[EmbedType["None"] = 6] = "None";
19
21
  })(EmbedType || (EmbedType = {}));
20
22
  /**
21
23
  * Controls the state of the observer
@@ -158,6 +160,12 @@ class PlattarEmbed extends HTMLElement {
158
160
  case "webxr":
159
161
  this._currentType = EmbedType.WebXR;
160
162
  break;
163
+ case "gallery":
164
+ this._currentType = EmbedType.Gallery;
165
+ break;
166
+ case "launcher":
167
+ this._currentType = EmbedType.Launcher;
168
+ break;
161
169
  case "viewer":
162
170
  case "configurator":
163
171
  default:
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="@plattar/plattar-web" />
2
- /// <reference types="@plattar/plattar-qrcode" />
3
1
  export * as PlattarWeb from "@plattar/plattar-web";
4
2
  export * as PlattarQRCode from "@plattar/plattar-qrcode";
5
3
  export * as version from "./version";
package/dist/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.169.4";
1
+ declare const _default: "1.177.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.169.4";
3
+ exports.default = "1.177.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plattar/plattar-ar-adapter",
3
- "version": "1.169.4",
3
+ "version": "1.177.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",
@@ -38,18 +38,18 @@
38
38
  "homepage": "https://www.plattar.com",
39
39
  "dependencies": {
40
40
  "@plattar/plattar-analytics": "^1.152.2",
41
- "@plattar/plattar-api": "^1.159.1",
41
+ "@plattar/plattar-api": "^1.177.1",
42
42
  "@plattar/plattar-qrcode": "1.165.1",
43
43
  "@plattar/plattar-services": "^1.157.1",
44
- "@plattar/plattar-web": "^1.169.1"
44
+ "@plattar/plattar-web": "^1.178.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/cli": "^7.24.1",
48
- "@babel/core": "^7.24.3",
49
- "@babel/preset-env": "^7.24.3",
50
- "browserify": "^17.0.0",
51
- "typescript": "^5.4.3",
52
- "uglify-js": "^3.17.4"
47
+ "@babel/cli": "^7.25.9",
48
+ "@babel/core": "^7.26.0",
49
+ "@babel/preset-env": "^7.26.0",
50
+ "browserify": "^17.0.1",
51
+ "typescript": "^5.6.3",
52
+ "uglify-js": "^3.19.3"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"