@plattar/plattar-ar-adapter 1.169.3 → 1.172.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;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.169.3";
1
+ declare const _default: "1.172.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.3";
3
+ exports.default = "1.172.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plattar/plattar-ar-adapter",
3
- "version": "1.169.3",
3
+ "version": "1.172.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",
@@ -44,11 +44,11 @@
44
44
  "@plattar/plattar-web": "^1.169.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",
47
+ "@babel/cli": "^7.24.6",
48
+ "@babel/core": "^7.24.6",
49
+ "@babel/preset-env": "^7.24.6",
50
50
  "browserify": "^17.0.0",
51
- "typescript": "^5.4.3",
51
+ "typescript": "^5.4.5",
52
52
  "uglify-js": "^3.17.4"
53
53
  },
54
54
  "publishConfig": {