@thefittingroom/shop-ui 0.0.16 → 0.1.0

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.16 (2023-09-05T16:47:56.281Z)
2
+ * thefittingroom v0.0.16 (2023-11-20T17:29:10.547Z)
3
3
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
4
4
  */
5
5
  /*!
@@ -36221,9 +36221,10 @@ var AvatarState;
36221
36221
  })(AvatarState || (AvatarState = {}));
36222
36222
 
36223
36223
  class FittingRoom {
36224
- constructor(shopId, modalDivId, hooks = {}, _env) {
36224
+ constructor(shopId, modalDivId, hooks = {}, tryOnEnabled = false, _env) {
36225
36225
  this.shopId = shopId;
36226
36226
  this.hooks = hooks;
36227
+ this.tryOnEnabled = tryOnEnabled;
36227
36228
  // prettier-ignore
36228
36229
  const env = _env
36229
36230
  ? _env
@@ -36286,7 +36287,8 @@ class FittingRoom {
36286
36287
  break;
36287
36288
  case AvatarState.CREATED:
36288
36289
  console.debug('avatar_state: created');
36289
- this.tryOn();
36290
+ if (this.tryOnEnabled)
36291
+ this.tryOn();
36290
36292
  break;
36291
36293
  default:
36292
36294
  this.nav.onError(L.SomethingWentWrong);
@@ -36326,9 +36328,14 @@ class FittingRoom {
36326
36328
  const trySizes = availableSizeLabels.length > 1 ? `${tryFirstSizes} ${L.OrSize} ${lastSize}` : tryFirstSizes;
36327
36329
  return `${trySizes}. ${L.WeRecommendSize} ${recommendedSizeLabel}.`;
36328
36330
  }
36331
+ onSignInClick() {
36332
+ this.nav.toScan();
36333
+ }
36329
36334
  async tryOn() {
36330
36335
  if (!this.shop.isLoggedIn)
36331
36336
  return this.nav.toScan();
36337
+ if (!this.tryOnEnabled)
36338
+ return;
36332
36339
  try {
36333
36340
  if (this.hooks.onLoading)
36334
36341
  this.hooks.onLoading();