@perceptimagery/dita-configurator-staging 0.1.4003 → 0.1.5001

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.
Files changed (3) hide show
  1. package/README.md +3 -5
  2. package/dist/index.js +14 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,14 +1,12 @@
1
- # Dita-configurator -preview
1
+ # Dita-configurator
2
2
 
3
- | An embeddable package for `Previewing | and changing.` SKUs
3
+ | An embeddable package for Dita's 3D configurator
4
4
 
5
- ## Documentation
6
-
7
- <https://docs.sprie.io/docs/?/>
8
5
 
9
6
  ## Usage
10
7
 
11
8
  Prod: `https://cdn.jsdelivr.net/npm/@perceptimagery/dita-configurator@latest`
9
+
12
10
  Dev : `https://cdn.jsdelivr.net/npm/@perceptimagery/dita-configurator-staging@latest`
13
11
 
14
12
  ```HTML
package/dist/index.js CHANGED
@@ -111,7 +111,7 @@ var __publicField = (obj, key, value) => {
111
111
  host: "https://api.sprie.io"
112
112
  };
113
113
  const config = Object.freeze(Config$1);
114
- const version = "0.1.4003";
114
+ const version = "0.1.5001";
115
115
  class APIServiceFactory {
116
116
  constructor(fetcher) {
117
117
  __publicField(this, "isAuthenticated");
@@ -127,7 +127,6 @@ var __publicField = (obj, key, value) => {
127
127
  */
128
128
  async Authenticate(apiKey) {
129
129
  this.fetcher.LoadConfig();
130
- console.log(this.fetcher.LoadConfig());
131
130
  if (this.fetcher.IsTokenExpired() || this.fetcher.IsConfigExpired()) {
132
131
  await this.AuthServiceApi(apiKey);
133
132
  }
@@ -39395,7 +39394,6 @@ var __publicField = (obj, key, value) => {
39395
39394
 
39396
39395
  `
39397
39396
  );
39398
- console.log("MinXis ", shader.uniforms.minX, "\n", "maxXis ", shader.uniforms.maxX, "\n", "MinYis ", shader.uniforms.minY, "\n", "MaxYis", shader.uniforms.maxY);
39399
39397
  };
39400
39398
  node.matrixAutoUpdate = true;
39401
39399
  lensMaterial.matrixAutoUpdate = true;
@@ -40266,7 +40264,6 @@ var __publicField = (obj, key, value) => {
40266
40264
  * @returns {boolean} true if success, false if error
40267
40265
  */
40268
40266
  async Init() {
40269
- this.loadMesage();
40270
40267
  try {
40271
40268
  this.scanApiKeyFromCurrentScriptTag();
40272
40269
  await this.authenticate();
@@ -40277,7 +40274,6 @@ var __publicField = (obj, key, value) => {
40277
40274
  await this.mountElement();
40278
40275
  this.status = ESDKStatus.Done;
40279
40276
  this.isLoaded = true;
40280
- this.log(`SprieEmbed Loaded ${this.loadCount} embeds on this page`);
40281
40277
  if (this.isLoaded) {
40282
40278
  setTimeout(() => {
40283
40279
  this.hideLoader();
@@ -40793,7 +40789,7 @@ var __publicField = (obj, key, value) => {
40793
40789
  ) }),
40794
40790
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "lens-details", children: [
40795
40791
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "lensName", children: selectedLens && selectedLens.name }),
40796
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "lensColor", children: selectedLens && selectedLens.sku })
40792
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "lensColor", children: selectedLens && selectedLens.metadata[0].value })
40797
40793
  ] })
40798
40794
  ] }),
40799
40795
  !isMobileView && /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -40949,15 +40945,24 @@ var __publicField = (obj, key, value) => {
40949
40945
  id: "Checkout-button",
40950
40946
  onClick: () => {
40951
40947
  if (selectedFrame && selectedLens) {
40948
+ const frameVariantId = selectedFrame.metadata.find((item) => item.key == "variantId");
40949
+ const lensVariantId = selectedLens.metadata.find((item) => item.key == "variantId");
40950
+ const frameId = frameVariantId ? frameVariantId.value : null;
40951
+ const lensId = lensVariantId ? lensVariantId.value : null;
40952
40952
  const eventData = {
40953
- frameSku: selectedFrame.sku,
40954
- lensSku: selectedLens.sku
40953
+ frameIdentifier: frameId,
40954
+ lensIdentifier: lensId
40955
40955
  };
40956
40956
  customEvent.emitEvent("onAddToCart", eventData);
40957
+ if (frameId && lensId) {
40958
+ window.open("https://dita.com/cart/" + frameId + ":1," + lensId + ":1", "_blank");
40959
+ } else {
40960
+ console.log("Either the selected frame or the lens has an invalid identifier.");
40961
+ }
40957
40962
  }
40958
40963
  },
40959
40964
  type: "button",
40960
- children: "Finalise & Add to cart"
40965
+ children: "Add to cart"
40961
40966
  }
40962
40967
  )
40963
40968
  ] })
@@ -48696,8 +48701,6 @@ var __publicField = (obj, key, value) => {
48696
48701
  };
48697
48702
  this.sdkService = new SDKServiceFactory(sdkProps);
48698
48703
  this.sdkService.Init();
48699
- console.log("SDK succesfully intialized:");
48700
- console.log("Hi from https://sprie.io/");
48701
48704
  }
48702
48705
  load(sku) {
48703
48706
  this.uiService.loadBySKU(sku);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perceptimagery/dita-configurator-staging",
3
- "version": "0.1.4003",
3
+ "version": "0.1.5001",
4
4
  "author": "Abhishek Deb <abhishek@perceptimagery.com>",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",