@perceptimagery/dita-configurator-staging 0.2.1205 → 0.2.1304

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 (2) hide show
  1. package/dist/index.js +22 -16
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -18,7 +18,6 @@ var __publicField = (obj, key, value) => {
18
18
  return value;
19
19
  };
20
20
  (function() {
21
- var _a, _b;
22
21
  "use strict";
23
22
  class FetcherServiceFactory {
24
23
  constructor(config2) {
@@ -112,7 +111,7 @@ var __publicField = (obj, key, value) => {
112
111
  host: "https://api.sprie.io"
113
112
  };
114
113
  const config$1 = Object.freeze(Config$2);
115
- const version$1 = "0.2.1205";
114
+ const version$1 = "0.2.1304";
116
115
  function modifyLensArr$1(arr, element) {
117
116
  const index = arr.findIndex((e) => e["sku"] === element["sku"]);
118
117
  if (index !== -1) {
@@ -222,7 +221,14 @@ var __publicField = (obj, key, value) => {
222
221
  const cart = await this.shopifyAPI.Get();
223
222
  document.querySelector("#shopify-section-mini-cart").outerHTML = responseData.sections["mini-cart"];
224
223
  document.querySelector(".header__cart-count").textContent = cart.item_count;
225
- document.querySelector(".drawer.drawer--full").removeAttribute("open");
224
+ const desktopContainer = document.querySelector(".drawer.drawer--full");
225
+ if (desktopContainer && desktopContainer.hasAttribute("open")) {
226
+ desktopContainer.removeAttribute("open");
227
+ }
228
+ const mobileContainer = document.querySelector(".popover.hidden-lap-and-up.popover-full");
229
+ if (mobileContainer && mobileContainer.hasAttribute("open")) {
230
+ mobileContainer.removeAttribute("open");
231
+ }
226
232
  document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open", "");
227
233
  }
228
234
  }
@@ -42911,18 +42917,18 @@ bool bvhIntersectFirstHit(
42911
42917
  this.isInitialised = true;
42912
42918
  }
42913
42919
  resizeRenderer() {
42914
- var _a2;
42920
+ var _a;
42915
42921
  const pixelRatio = Math.min(window.devicePixelRatio, 2);
42916
42922
  const resoWidth = Math.floor(this.canvas.clientWidth * pixelRatio);
42917
42923
  const resoHeight = Math.floor(this.canvas.clientHeight * pixelRatio);
42918
42924
  const needResize = this.canvas.width !== resoWidth || this.canvas.height !== resoHeight;
42919
42925
  if (needResize) {
42920
- (_a2 = this.renderer) == null ? void 0 : _a2.setSize(resoWidth, resoHeight, false);
42926
+ (_a = this.renderer) == null ? void 0 : _a.setSize(resoWidth, resoHeight, false);
42921
42927
  }
42922
42928
  return needResize;
42923
42929
  }
42924
42930
  initGemstoneDependencies() {
42925
- var _a2;
42931
+ var _a;
42926
42932
  rgbeLoader.load(
42927
42933
  "https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_gemstones.hdr",
42928
42934
  (reflectionMap) => {
@@ -42937,7 +42943,7 @@ bool bvhIntersectFirstHit(
42937
42943
  gemstoneMaterial.uniforms.resolution.value = this.canvasSize;
42938
42944
  const temp5 = {};
42939
42945
  const isCubeMap = isCubeTexture(envMap);
42940
- const w2 = (isCubeMap ? (_a2 = envMap == null ? void 0 : envMap.image[0]) == null ? void 0 : _a2.width : envMap == null ? void 0 : envMap.image.width) ?? 1024;
42946
+ const w2 = (isCubeMap ? (_a = envMap == null ? void 0 : envMap.image[0]) == null ? void 0 : _a.width : envMap == null ? void 0 : envMap.image.width) ?? 1024;
42941
42947
  const cubeSize = w2 / 4;
42942
42948
  const _lodMax = Math.floor(Math.log2(cubeSize));
42943
42949
  const _cubeSize = Math.pow(2, _lodMax);
@@ -43248,8 +43254,9 @@ bool bvhIntersectFirstHit(
43248
43254
  -0.13425621157020154,
43249
43255
  -0.2564218846390263
43250
43256
  );
43251
- const rendererSize = this.renderer.getSize(new Vector2());
43252
- if (rendererSize.x > rendererSize.y) {
43257
+ this.renderer.getSize(new Vector2());
43258
+ const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
43259
+ if (!isMobile) {
43253
43260
  this.camera.position.set(
43254
43261
  2.2,
43255
43262
  2.2,
@@ -43377,11 +43384,11 @@ bool bvhIntersectFirstHit(
43377
43384
  composer.addPass(renderPass);
43378
43385
  composer.addPass(outputPass);
43379
43386
  const animate = () => {
43380
- var _a2;
43387
+ var _a;
43381
43388
  controls.update();
43382
43389
  if (this.resizeRenderer()) {
43383
43390
  this.camera.aspect = this.canvas.clientWidth / this.canvas.clientHeight;
43384
- (_a2 = this.camera) == null ? void 0 : _a2.updateProjectionMatrix();
43391
+ (_a = this.camera) == null ? void 0 : _a.updateProjectionMatrix();
43385
43392
  }
43386
43393
  const initialBackground = this.scene.background;
43387
43394
  this.scene.background = null;
@@ -43428,7 +43435,6 @@ bool bvhIntersectFirstHit(
43428
43435
  }
43429
43436
  async Init() {
43430
43437
  if (!this.customRenderer.isInitialised) {
43431
- console.log("Intializing custom rendereer");
43432
43438
  await this.customRenderer.intialize();
43433
43439
  this.customRenderer.setupAndRenderScene();
43434
43440
  }
@@ -43553,9 +43559,9 @@ bool bvhIntersectFirstHit(
43553
43559
  const orgName = (settings == null ? void 0 : settings.orgName) || "";
43554
43560
  reactExports.useEffect(() => {
43555
43561
  (async () => {
43556
- var _a2;
43562
+ var _a;
43557
43563
  configurator.current = new ThreeDConfigurator();
43558
- await ((_a2 = configurator.current) == null ? void 0 : _a2.Init(apiService2.apiKey));
43564
+ await ((_a = configurator.current) == null ? void 0 : _a.Init(apiService2.apiKey));
43559
43565
  const apiRes = await apiService2.FetchAssetBySKUOrBarcode({
43560
43566
  sku,
43561
43567
  barcode: null
@@ -51251,8 +51257,8 @@ bool bvhIntersectFirstHit(
51251
51257
  });
51252
51258
  let CustomEventEmitter = _CustomEventEmitter2;
51253
51259
  const ShopifyConfig = {
51254
- getCartUrl: ((_a = window.Shopify) == null ? void 0 : _a.routes.root) + "/cart.js",
51255
- addToCartUrl: ((_b = window.Shopify) == null ? void 0 : _b.routes.root) + "/cart/add.js"
51260
+ getCartUrl: window.Shopify.routes.root + "/cart.js",
51261
+ addToCartUrl: window.Shopify.routes.root + "/cart/add.js"
51256
51262
  };
51257
51263
  const configShopify = Object.freeze(ShopifyConfig);
51258
51264
  class ShopifyServiceFactory {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perceptimagery/dita-configurator-staging",
3
- "version": "0.2.1205",
3
+ "version": "0.2.1304",
4
4
  "author": "Rohan Satpute <rohan@perceptimagery.com>",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "preview": "vite preview"
16
16
  },
17
17
  "dependencies": {
18
- "@perceptimagery/3d-configurator": "^1.2.0",
18
+ "@perceptimagery/3d-configurator": "^1.2.1",
19
19
  "@perceptimagery/sprie-asset-auth": "^1.2.1016",
20
20
  "dat.gui": "^0.7.9",
21
21
  "events": "^3.3.0",