@thefittingroom/shop-ui 0.0.12 → 0.0.13

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.
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * thefittingroom v0.0.12 (2023-07-26T23:25:57.440Z)
2
+ * thefittingroom v0.0.13 (2023-07-31T17:36:04.376Z)
3
3
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
4
4
  */
5
5
  /*!
@@ -36199,11 +36199,17 @@ var AvatarState;
36199
36199
  })(AvatarState || (AvatarState = {}));
36200
36200
 
36201
36201
  class FittingRoom {
36202
- constructor(shopId, modalDivId, hooks = {}) {
36202
+ constructor(shopId, modalDivId, hooks = {}, _env) {
36203
36203
  this.shopId = shopId;
36204
36204
  this.hooks = hooks;
36205
+ // prettier-ignore
36206
+ const env = _env
36207
+ ? _env
36208
+ : typeof process !== 'undefined'
36209
+ ? process.env.NODE_ENV
36210
+ : 'dev';
36205
36211
  this.nav = new FittingRoomNav(modalDivId, this.signIn.bind(this), this.forgotPassword.bind(this), this.submitTel.bind(this));
36206
- this.tfrShop = initShop(Number(this.shopId), process.env.NODE_ENV);
36212
+ this.tfrShop = initShop(Number(this.shopId), env);
36207
36213
  }
36208
36214
  get sku() {
36209
36215
  return this.nav.sku;
@@ -36321,8 +36327,8 @@ class FittingRoom {
36321
36327
  }
36322
36328
  }
36323
36329
 
36324
- const initFittingRoom = async (shopId, modalDivId, hooks) => {
36325
- const tfr = new FittingRoom(shopId, modalDivId, hooks);
36330
+ const initFittingRoom = async (shopId, modalDivId, hooks, env = 'dev') => {
36331
+ const tfr = new FittingRoom(shopId, modalDivId, hooks, env);
36326
36332
  await tfr.onInit();
36327
36333
  return tfr;
36328
36334
  };