@thefittingroom/shop-ui 5.0.9 → 5.0.11
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/index.js +133 -66
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19034,7 +19034,7 @@ const en$1 = {
|
|
|
19034
19034
|
"get-app": { "create_avatar": "Create your avatar" },
|
|
19035
19035
|
"sign-in": { "email": "Email", "password": "Password", "forgot_password": "Forgot password?", "sign_in": "Sign in", "no_account": "Don’t have an account?", "download_app": "Download the app.", "invalid_email": "Please enter a valid email address.", "missing_password": "Please enter your password.", "login_failed": "Incorrect email or password." },
|
|
19036
19036
|
"forgot-password": { "title": "Forgot password", "description": "We’ll send you an email with a link to reset your password.", "send_link": "Send link", "link_sent": "Link sent! Please check your email.", "need_help": "Need help?", "contact_us": "Contact us." },
|
|
19037
|
-
"vto-single": { "avatar_loading": "Finding your perfect fit...", "slide_to_rotate": "Slide to rotate", "sign_out": "Sign out", "color_label": "Color:", "add_to_cart": "Add to cart", "view_product_details": "View product details", "hide_product_details": "Hide product details" },
|
|
19037
|
+
"vto-single": { "avatar_loading": "Finding your perfect fit...", "slide_to_rotate": "Slide to rotate", "sign_out": "Sign out", "color_label": "Color:", "add_to_cart": "Add to cart", "view_product_details": "View product details", "hide_product_details": "Hide product details", "no_recommendation": "There are currently no well fitting sizes available for this item." },
|
|
19038
19038
|
"size-rec": { "recommended_size": "Recommended Size: {{size}}", "item_fit": "This item is {{fit}}", "select_size": "Select a size to see how it fits", "fitClassification": { "form_fitting": "Form Fitting", "slim_fit": "Slim Fit", "regular_fit": "Regular Fit", "relaxed_fit": "Relaxed Fit", "oversized_fit": "Oversized Fit" }, "measurementLocation": { "neck_base": "Neck", "across_shoulder": "Shoulders", "cb_neck_to_wrist": "Neck to Wrist", "sleeve_length_from_shoulder_point": "Sleeve", "bust": "Bust", "waist": "Waist", "low_waist": "Low Waist", "high_hip": "High Hip", "low_hip": "Low Hip", "thigh": "Thigh", "inseam": "Inseam", "hsp_to_low_hip": "HSP to Low Hip", "hsp_to_crotch": "HSP to Crotch", "low_hip_bottoms": "Low Hip (Bottoms)", "high_hip_bottoms": "High Hip (Bottoms)" }, "fit": { "too_tight": "Too Tight", "tight": "Tight", "slightly_tight": "Slightly Tight", "perfect_fit": "Perfect Fit", "slightly_loose": "Slightly Loose", "loose": "Loose", "oversized": "Oversized", "too_short": "Too Short", "short": "Short", "slightly_short": "Slightly Short", "slightly_long": "Slightly Long", "long": "Long", "too_long": "Too Long" } },
|
|
19039
19039
|
"fit-chart": { "fit_scale": "Fit Scale", "fit": { "poor_fit": "Poor Fit", "acceptable_fit": "Acceptable Fit", "too_tight": "Too Tight", "tight": "Tight or More Fitted", "slightly_tight": "Slightly Tight or Fitted", "perfect_fit": "Perfect Fit", "slightly_loose": "Slightly Loose or Less Fitted", "loose": "Loose or Not Fitted", "oversized": "Oversized" }, "measurement_points": "Measurement Points", "point": { "bust": "Chest/Bust", "waist": "Natural Waist", "pant_waist": "Pant Waist", "high_hip": "High Hip", "low_hip": "Low Hip", "thigh": "Thigh" } }
|
|
19040
19040
|
};
|
|
@@ -19050,7 +19050,7 @@ const fr = {
|
|
|
19050
19050
|
"get-app": { "create_avatar": "Créez votre avatar" },
|
|
19051
19051
|
"sign-in": { "email": "Email", "password": "Mot de passe", "forgot_password": "Mot de passe oublié ?", "sign_in": "Se connecter", "no_account": "Vous n'avez pas de compte ?", "download_app": "Téléchargez l'application.", "invalid_email": "Veuillez entrer une adresse e-mail valide.", "missing_password": "Veuillez entrer votre mot de passe.", "login_failed": "Email ou mot de passe incorrect." },
|
|
19052
19052
|
"forgot-password": { "title": "Mot de passe oublié", "description": "Nous vous enverrons un e-mail avec un lien pour réinitialiser votre mot de passe.", "send_link": "Envoyer le lien", "link_sent": "Lien envoyé ! Veuillez vérifier votre e-mail.", "need_help": "Besoin d'aide ?", "contact_us": "Contactez-nous." },
|
|
19053
|
-
"vto-single": { "avatar_loading": "Trouver votre ajustement parfait...", "slide_to_rotate": "Faites glisser pour faire pivoter", "sign_out": "Se déconnecter", "color_label": "Couleur :", "add_to_cart": "Ajouter au panier", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit" },
|
|
19053
|
+
"vto-single": { "avatar_loading": "Trouver votre ajustement parfait...", "slide_to_rotate": "Faites glisser pour faire pivoter", "sign_out": "Se déconnecter", "color_label": "Couleur :", "add_to_cart": "Ajouter au panier", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit", "no_recommendation": "Il n'y a actuellement pas de tailles bien ajustées disponibles pour cet article." },
|
|
19054
19054
|
"size-rec": { "recommended_size": "Taille recommandée : {{size}}", "item_fit": "Cet article est {{fit}}", "select_size": "Sélectionnez une taille pour voir comment elle s'adapte", "fitClassification": { "form_fitting": "Ajusté", "slim_fit": "Coupe slim", "regular_fit": "Coupe régulière", "relaxed_fit": "Coupe décontractée", "oversized_fit": "Coupe oversize" }, "measurementLocation": { "neck_base": "Cou", "across_shoulder": "Épaules", "cb_neck_to_wrist": "Cou jusqu'au poignet", "sleeve_length_from_shoulder_point": "Manche", "bust": "Buste", "waist": "Taille", "low_waist": "Bas de la taille", "high_hip": "Haut des hanches", "low_hip": "Bas des hanches", "thigh": "Cuisse", "inseam": "Entrejambe", "hsp_to_low_hip": "HSP au bas des hanches", "hsp_to_crotch": "HSP à l'entrejambe", "low_hip_bottoms": "Bas des hanches (bas)", "high_hip_bottoms": "Haut des hanches (bas)" }, "fit": { "too_tight": "Trop serré", "tight": "Serré", "slightly_tight": "Légèrement serré", "perfect_fit": "Parfait", "slightly_loose": "Légèrement ample", "loose": "Ample", "oversized": "Oversize", "too_short": "Trop court", "short": "Court", "slightly_short": "Légèrement court", "slightly_long": "Légèrement long", "long": "Long", "too_long": "Trop long" } },
|
|
19055
19055
|
"fit-chart": { "fit_scale": "Échelle d'ajustement", "fit": { "poor_fit": "Mauvais ajustement", "acceptable_fit": "Ajustement acceptable", "too_tight": "Trop serré", "tight": "Serré ou plus ajusté", "slightly_tight": "Légèrement serré ou ajusté", "perfect_fit": "Parfait", "slightly_loose": "Légèrement ample ou moins ajusté", "loose": "Ample ou non ajusté", "oversized": "Oversize" }, "measurement_points": "Points de mesure", "point": { "bust": "Poitrine/Buste", "waist": "Taille naturelle", "pant_waist": "Taille du pantalon", "high_hip": "Haut des hanches", "low_hip": "Bas des hanches", "thigh": "Cuisse" } }
|
|
19056
19056
|
};
|
|
@@ -41951,8 +41951,7 @@ function VtoSingleOverlay() {
|
|
|
41951
41951
|
logger$2.timerStart("fetchInitialData_2_getStyleData");
|
|
41952
41952
|
const styleRec = await getStyleByExternalId(brandId, currentProduct.externalId);
|
|
41953
41953
|
if (!styleRec) {
|
|
41954
|
-
|
|
41955
|
-
return;
|
|
41954
|
+
throw new Error(`Style not found for externalId: ${currentProduct.externalId}`);
|
|
41956
41955
|
}
|
|
41957
41956
|
const styleGarmentCategoryRec = await getStyleGarmentCategoryById(styleRec.style_garment_category_id);
|
|
41958
41957
|
const styleCategoryLabel = styleGarmentCategoryRec?.style_category_label ?? null;
|
|
@@ -41961,66 +41960,88 @@ function VtoSingleOverlay() {
|
|
|
41961
41960
|
const sizeRecommendationRecord = await getSizeRecommendation(styleRec.id);
|
|
41962
41961
|
logger$2.timerEnd("fetchInitialData_3_getSizeRecommendation");
|
|
41963
41962
|
logger$2.timerStart("fetchInitialData_4_assembleLoadedData");
|
|
41964
|
-
let productData;
|
|
41965
|
-
const recommendedSizeLabel = getSizeLabelFromSize(sizeRecommendationRecord.recommended_size) ?? "(unknown)";
|
|
41966
41963
|
{
|
|
41967
|
-
const
|
|
41968
|
-
const
|
|
41969
|
-
|
|
41970
|
-
|
|
41971
|
-
|
|
41972
|
-
|
|
41973
|
-
|
|
41974
|
-
const
|
|
41975
|
-
|
|
41976
|
-
|
|
41977
|
-
|
|
41978
|
-
|
|
41979
|
-
|
|
41980
|
-
|
|
41981
|
-
|
|
41982
|
-
const
|
|
41983
|
-
|
|
41964
|
+
const recommendedSizeId = sizeRecommendationRecord.recommended_size.id || null;
|
|
41965
|
+
const recommendedSizeLabel = getSizeLabelFromSize(sizeRecommendationRecord.recommended_size);
|
|
41966
|
+
if (recommendedSizeId == null || recommendedSizeLabel == null) {
|
|
41967
|
+
throw new Error(`No recommended size found for externalId: ${currentProduct.externalId}`);
|
|
41968
|
+
}
|
|
41969
|
+
let productData;
|
|
41970
|
+
{
|
|
41971
|
+
const fitClassification = sizeRecommendationRecord.fit_classification;
|
|
41972
|
+
const sizes = [];
|
|
41973
|
+
for (const sizeRec of sizeRecommendationRecord.available_sizes) {
|
|
41974
|
+
const sizeId = sizeRec.id;
|
|
41975
|
+
const sizeLabel = getSizeLabelFromSize(sizeRec) || null;
|
|
41976
|
+
if (!sizeLabel) {
|
|
41977
|
+
continue;
|
|
41978
|
+
}
|
|
41979
|
+
const isRecommended = sizeRec.id === recommendedSizeId;
|
|
41980
|
+
const fit = sizeRecommendationRecord.fits.find((f) => f.size_id === sizeRec.id);
|
|
41981
|
+
if (!fit) {
|
|
41984
41982
|
continue;
|
|
41985
41983
|
}
|
|
41986
|
-
const
|
|
41987
|
-
const
|
|
41988
|
-
|
|
41989
|
-
|
|
41990
|
-
|
|
41991
|
-
|
|
41992
|
-
|
|
41984
|
+
const colors = [];
|
|
41985
|
+
for (const csaRec of sizeRec.colorway_size_assets) {
|
|
41986
|
+
const colorwaySizeAssetId = csaRec.id;
|
|
41987
|
+
const sku = csaRec.sku;
|
|
41988
|
+
const variant = variants.find((v) => v.sku === sku);
|
|
41989
|
+
if (!variant) {
|
|
41990
|
+
logger$2.logWarn(`Variant not found for externalId: ${currentProduct.externalId} sizeId: ${sizeId} sku: ${sku}`);
|
|
41991
|
+
continue;
|
|
41992
|
+
}
|
|
41993
|
+
const colorLabel = variant.color || null;
|
|
41994
|
+
const priceFormatted = variant.priceFormatted;
|
|
41995
|
+
colors.push({
|
|
41996
|
+
colorwaySizeAssetId,
|
|
41997
|
+
colorLabel,
|
|
41998
|
+
sku,
|
|
41999
|
+
priceFormatted
|
|
42000
|
+
});
|
|
42001
|
+
}
|
|
42002
|
+
if (!colors.length) {
|
|
42003
|
+
logger$2.logWarn(`No valid colorways found for externalId: ${currentProduct.externalId} sizeId: ${sizeId}`);
|
|
42004
|
+
continue;
|
|
42005
|
+
}
|
|
42006
|
+
sizes.push({
|
|
42007
|
+
sizeId,
|
|
42008
|
+
sizeLabel,
|
|
42009
|
+
isRecommended,
|
|
42010
|
+
fit,
|
|
42011
|
+
colors
|
|
41993
42012
|
});
|
|
41994
42013
|
}
|
|
41995
|
-
sizes.
|
|
41996
|
-
|
|
41997
|
-
|
|
41998
|
-
|
|
41999
|
-
|
|
42000
|
-
|
|
42001
|
-
|
|
42014
|
+
if (!sizes.length) {
|
|
42015
|
+
throw new Error(`No valid sizes found for externalId: ${currentProduct.externalId}`);
|
|
42016
|
+
}
|
|
42017
|
+
productData = {
|
|
42018
|
+
productName,
|
|
42019
|
+
productDescriptionHtml,
|
|
42020
|
+
fitClassification,
|
|
42021
|
+
recommendedSizeId,
|
|
42022
|
+
recommendedSizeLabel,
|
|
42023
|
+
sizes,
|
|
42024
|
+
styleCategoryLabel
|
|
42025
|
+
};
|
|
42002
42026
|
}
|
|
42003
|
-
|
|
42004
|
-
|
|
42005
|
-
|
|
42006
|
-
|
|
42007
|
-
|
|
42008
|
-
|
|
42009
|
-
|
|
42010
|
-
|
|
42011
|
-
|
|
42027
|
+
let recommendedColorLabel = null;
|
|
42028
|
+
{
|
|
42029
|
+
const recommendedSizeRecord = productData.sizes.find((s) => s.isRecommended);
|
|
42030
|
+
if (!recommendedSizeRecord) {
|
|
42031
|
+
throw new Error("Recommended size record not found");
|
|
42032
|
+
}
|
|
42033
|
+
if (!recommendedSizeRecord.colors.length) {
|
|
42034
|
+
throw new Error("No colorways found for recommended size record");
|
|
42035
|
+
}
|
|
42036
|
+
const recommendedSizeColorRecord = recommendedSizeRecord.colors.find((c) => {
|
|
42037
|
+
return c.colorLabel === selectedColor;
|
|
42038
|
+
}) || recommendedSizeRecord.colors[0];
|
|
42039
|
+
recommendedColorLabel = recommendedSizeColorRecord?.colorLabel ?? null;
|
|
42040
|
+
}
|
|
42041
|
+
setLoadedProductData(productData);
|
|
42042
|
+
setSelectedSizeLabel(recommendedSizeLabel);
|
|
42043
|
+
setSelectedColorLabel(recommendedColorLabel);
|
|
42012
42044
|
}
|
|
42013
|
-
let recommendedColorLabel;
|
|
42014
|
-
{
|
|
42015
|
-
const recommendedSizeRecord = productData.sizes.find((s) => s.isRecommended);
|
|
42016
|
-
const recommendedSizeColorRecord = recommendedSizeRecord.colors.find((c) => {
|
|
42017
|
-
return c.colorLabel === selectedColor;
|
|
42018
|
-
}) || recommendedSizeRecord.colors[0];
|
|
42019
|
-
recommendedColorLabel = recommendedSizeColorRecord.colorLabel;
|
|
42020
|
-
}
|
|
42021
|
-
setLoadedProductData(productData);
|
|
42022
|
-
setSelectedSizeLabel(recommendedSizeLabel);
|
|
42023
|
-
setSelectedColorLabel(recommendedColorLabel);
|
|
42024
42045
|
for (const sku in userProfile?.vto?.[brandId] ?? {}) {
|
|
42025
42046
|
fetchedVtoSkus.current.add(sku);
|
|
42026
42047
|
readyVtoSkus.current.add(sku);
|
|
@@ -42032,12 +42053,15 @@ function VtoSingleOverlay() {
|
|
|
42032
42053
|
logger$2.logError("Error fetching initial data:", {
|
|
42033
42054
|
error
|
|
42034
42055
|
});
|
|
42056
|
+
setLoadedProductData(false);
|
|
42057
|
+
setSelectedSizeLabel(null);
|
|
42058
|
+
setSelectedColorLabel(null);
|
|
42035
42059
|
}
|
|
42036
42060
|
}
|
|
42037
|
-
if (userIsLoggedIn && userHasAvatar &&
|
|
42061
|
+
if (userIsLoggedIn && userHasAvatar && userProfile && loadedProductData == null) {
|
|
42038
42062
|
fetchInitialData();
|
|
42039
42063
|
}
|
|
42040
|
-
}, [userIsLoggedIn, userHasAvatar,
|
|
42064
|
+
}, [userIsLoggedIn, userHasAvatar, userProfile, loadedProductData]);
|
|
42041
42065
|
const {
|
|
42042
42066
|
sizeColorRecord: selectedColorSizeRecord,
|
|
42043
42067
|
availableColorLabels
|
|
@@ -42049,14 +42073,14 @@ function VtoSingleOverlay() {
|
|
|
42049
42073
|
};
|
|
42050
42074
|
}
|
|
42051
42075
|
const sizeRecord = loadedProductData.sizes.find((s) => s.sizeLabel === selectedSizeLabel);
|
|
42052
|
-
if (!sizeRecord) {
|
|
42076
|
+
if (!sizeRecord || !sizeRecord.colors.length) {
|
|
42053
42077
|
return {
|
|
42054
42078
|
sizeColorRecord: null,
|
|
42055
42079
|
availableColorLabels: []
|
|
42056
42080
|
};
|
|
42057
42081
|
}
|
|
42058
42082
|
const sizeColorRecord = sizeRecord.colors.find((c) => c.colorLabel === selectedColorLabel) ?? sizeRecord.colors[0];
|
|
42059
|
-
const availableColorLabels2 = sizeRecord.colors.map((c) => c.colorLabel);
|
|
42083
|
+
const availableColorLabels2 = sizeRecord.colors.map((c) => c.colorLabel).filter((label) => !!label);
|
|
42060
42084
|
return {
|
|
42061
42085
|
sizeColorRecord,
|
|
42062
42086
|
availableColorLabels: availableColorLabels2
|
|
@@ -42089,7 +42113,9 @@ function VtoSingleOverlay() {
|
|
|
42089
42113
|
}
|
|
42090
42114
|
for (const sizeRecord of loadedProductData.sizes) {
|
|
42091
42115
|
const sizeColorRecord = sizeRecord.colors.find((c) => c.colorLabel === selectedColorLabel) ?? sizeRecord.colors[0];
|
|
42092
|
-
|
|
42116
|
+
if (sizeColorRecord) {
|
|
42117
|
+
requestVto(sizeColorRecord);
|
|
42118
|
+
}
|
|
42093
42119
|
}
|
|
42094
42120
|
}, [requestVto, loadedProductData, selectedColorLabel]);
|
|
42095
42121
|
const vtoData = reactExports.useMemo(() => {
|
|
@@ -42150,7 +42176,10 @@ function VtoSingleOverlay() {
|
|
|
42150
42176
|
});
|
|
42151
42177
|
}
|
|
42152
42178
|
}, [selectedColorLabel, selectedSizeLabel]);
|
|
42153
|
-
if (
|
|
42179
|
+
if (loadedProductData === false) {
|
|
42180
|
+
return /* @__PURE__ */ jsx$1(SidecarModalFrame, { onRequestClose: closeOverlay, children: /* @__PURE__ */ jsx$1(NoFitLayout, { onClose: closeOverlay, onSignOut: handleSignOutClick }) });
|
|
42181
|
+
}
|
|
42182
|
+
if (!userIsLoggedIn || !userHasAvatar || loadedProductData == null || !selectedColorSizeRecord) {
|
|
42154
42183
|
return /* @__PURE__ */ jsx$1(SidecarModalFrame, { onRequestClose: closeOverlay, children: /* @__PURE__ */ jsx$1(Loading, {}) });
|
|
42155
42184
|
}
|
|
42156
42185
|
let Layout;
|
|
@@ -42161,6 +42190,44 @@ function VtoSingleOverlay() {
|
|
|
42161
42190
|
}
|
|
42162
42191
|
return /* @__PURE__ */ jsx$1(SidecarModalFrame, { onRequestClose: closeOverlay, contentStyle: modalStyle, children: /* @__PURE__ */ jsx$1(Layout, { loadedProductData, selectedColorSizeRecord, availableColorLabels, selectedColorLabel, selectedSizeLabel, frameUrls, setModalStyle, onClose: closeOverlay, onChangeColor: setSelectedColorLabel, onChangeSize: setSelectedSizeLabel, onAddToCart: handleAddToCartClick, onSignOut: handleSignOutClick }) });
|
|
42163
42192
|
}
|
|
42193
|
+
function NoFitLayout({
|
|
42194
|
+
onClose,
|
|
42195
|
+
onSignOut
|
|
42196
|
+
}) {
|
|
42197
|
+
const {
|
|
42198
|
+
t
|
|
42199
|
+
} = useTranslation();
|
|
42200
|
+
const css2 = useCss((_theme) => ({
|
|
42201
|
+
mainContainer: {
|
|
42202
|
+
width: "100%",
|
|
42203
|
+
height: "100%",
|
|
42204
|
+
padding: "16px"
|
|
42205
|
+
},
|
|
42206
|
+
titlebarContainer: {},
|
|
42207
|
+
contentContainer: {
|
|
42208
|
+
height: "100%",
|
|
42209
|
+
display: "flex",
|
|
42210
|
+
flexDirection: "column",
|
|
42211
|
+
alignItems: "center",
|
|
42212
|
+
justifyContent: "center"
|
|
42213
|
+
},
|
|
42214
|
+
messageContainer: {
|
|
42215
|
+
marginTop: "32px",
|
|
42216
|
+
textAlign: "center"
|
|
42217
|
+
},
|
|
42218
|
+
footerContainer: {
|
|
42219
|
+
marginTop: "32px"
|
|
42220
|
+
}
|
|
42221
|
+
}));
|
|
42222
|
+
return /* @__PURE__ */ jsxs("div", { css: css2.mainContainer, children: [
|
|
42223
|
+
/* @__PURE__ */ jsx$1("div", { css: css2.titlebarContainer, children: /* @__PURE__ */ jsx$1(ModalTitlebar, { title: t("try_it_on"), onCloseClick: onClose }) }),
|
|
42224
|
+
/* @__PURE__ */ jsxs("div", { css: css2.contentContainer, children: [
|
|
42225
|
+
/* @__PURE__ */ jsx$1("div", { children: " " }),
|
|
42226
|
+
/* @__PURE__ */ jsx$1("div", { css: css2.messageContainer, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", t: "vto-single.no_recommendation" }) }),
|
|
42227
|
+
/* @__PURE__ */ jsx$1("div", { css: css2.footerContainer, children: /* @__PURE__ */ jsx$1(Footer, { onSignOutClick: onSignOut }) })
|
|
42228
|
+
] })
|
|
42229
|
+
] });
|
|
42230
|
+
}
|
|
42164
42231
|
function MobileLayout({
|
|
42165
42232
|
loadedProductData,
|
|
42166
42233
|
selectedColorSizeRecord,
|
|
@@ -43379,9 +43446,9 @@ const SHARED_CONFIG = {
|
|
|
43379
43446
|
appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
|
|
43380
43447
|
},
|
|
43381
43448
|
build: {
|
|
43382
|
-
version: `${"5.0.
|
|
43383
|
-
commitHash: `${"
|
|
43384
|
-
date: `${"2026-02-
|
|
43449
|
+
version: `${"5.0.11"}`,
|
|
43450
|
+
commitHash: `${"77ac921"}`,
|
|
43451
|
+
date: `${"2026-02-02T01:20:02.888Z"}`
|
|
43385
43452
|
}
|
|
43386
43453
|
};
|
|
43387
43454
|
const CONFIGS = {
|