@thefittingroom/shop-ui 5.0.34 → 5.0.36

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 +81 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19423,6 +19423,17 @@ void instance.use(initReactI18next).init({
19423
19423
  fr: {
19424
19424
  translation: fr
19425
19425
  }
19426
+ },
19427
+ interpolation: {
19428
+ // React already escapes children as text at render time — leaving
19429
+ // i18next's default HTML-entity escaping on double-encodes any
19430
+ // interpolated value that happens to contain '<', '>', '/', '&',
19431
+ // '"' or "'". Manifested as e.g. "Recommended Size: S&#x2F;32" for
19432
+ // container parent-size labels like "S/32". Turning i18next's
19433
+ // escape off is safe because every consumer (LinkT, TextT,
19434
+ // ButtonT) drops the translated string into a React children
19435
+ // slot, not innerHTML.
19436
+ escapeValue: false
19426
19437
  }
19427
19438
  });
19428
19439
  var jsx2 = function jsx3(type, props) {
@@ -41683,6 +41694,10 @@ function buildVtoWireItems(loaded, parentCsaId, untucked) {
41683
41694
  }
41684
41695
  const childCsaIds = resolveContainerExpansion(loaded, parentCsaId);
41685
41696
  if (!childCsaIds) {
41697
+ logger$c.logWarn("buildVtoWireItems: container expansion failed, skipping request", {
41698
+ externalId: loaded.externalId,
41699
+ parentCsaId
41700
+ });
41686
41701
  return null;
41687
41702
  }
41688
41703
  return childCsaIds.map((csaId) => ({
@@ -41696,26 +41711,52 @@ function resolveContainerExpansion(loaded, parentCsaId) {
41696
41711
  }
41697
41712
  for (const sz of loaded.sizeFitRecommendation.available_sizes) {
41698
41713
  const csa = sz.colorway_size_assets.find((c) => c.id === parentCsaId);
41699
- if (!csa || !csa.colorway_name) {
41714
+ if (!csa) {
41715
+ continue;
41716
+ }
41717
+ if (!csa.colorway_name) {
41718
+ logger$c.logWarn("resolveContainerExpansion: parent CSA has no colorway_name", {
41719
+ externalId: loaded.externalId,
41720
+ parentCsaId,
41721
+ parentSizeId: sz.id
41722
+ });
41700
41723
  continue;
41701
41724
  }
41702
- return resolveContainerChildCSAs(loaded.container, sz.id, csa.colorway_name);
41725
+ return resolveContainerChildCSAs(loaded.container, sz.id, csa.colorway_name, loaded.externalId);
41703
41726
  }
41727
+ logger$c.logWarn("resolveContainerExpansion: parent CSA not found in any available_size", {
41728
+ externalId: loaded.externalId,
41729
+ parentCsaId,
41730
+ availableSizeIds: loaded.sizeFitRecommendation.available_sizes.map((s) => s.id),
41731
+ csaIdsBySize: loaded.sizeFitRecommendation.available_sizes.map((s) => ({
41732
+ sizeId: s.id,
41733
+ csaIds: s.colorway_size_assets.map((c) => c.id)
41734
+ }))
41735
+ });
41704
41736
  return null;
41705
41737
  }
41706
- function resolveContainerChildCSAs(container, parentSizeId, parentColorwayName) {
41738
+ function resolveContainerChildCSAs(container, parentSizeId, parentColorwayName, externalId) {
41707
41739
  const relevantMappings = container.setSizeMappings.filter((m) => m.parent_size_id === parentSizeId);
41708
41740
  if (relevantMappings.length === 0) {
41741
+ logger$c.logWarn("resolveContainerChildCSAs: no set_size_mappings for parent size", {
41742
+ externalId,
41743
+ parentSizeId,
41744
+ parentColorwayName,
41745
+ mappingParentSizeIds: container.setSizeMappings.map((m) => m.parent_size_id)
41746
+ });
41709
41747
  return null;
41710
41748
  }
41711
41749
  const csaIds = [];
41712
41750
  for (const mapping of relevantMappings) {
41713
41751
  let matchedCsaId = null;
41714
- for (const child of container.children) {
41752
+ let ownerChildIdx = null;
41753
+ for (let i = 0; i < container.children.length; i++) {
41754
+ const child = container.children[i];
41715
41755
  const size = (child.sizes ?? []).find((s) => s.id === mapping.child_size_id);
41716
41756
  if (!size) {
41717
41757
  continue;
41718
41758
  }
41759
+ ownerChildIdx = i;
41719
41760
  const csa = (child.colorway_size_assets ?? []).find((a) => a.size_id === size.id && a.colorway_name === parentColorwayName);
41720
41761
  if (csa) {
41721
41762
  matchedCsaId = csa.id;
@@ -41723,6 +41764,17 @@ function resolveContainerChildCSAs(container, parentSizeId, parentColorwayName)
41723
41764
  break;
41724
41765
  }
41725
41766
  if (matchedCsaId == null) {
41767
+ const owner = ownerChildIdx != null ? container.children[ownerChildIdx] : null;
41768
+ logger$c.logWarn("resolveContainerChildCSAs: no matching child CSA", {
41769
+ externalId,
41770
+ parentSizeId,
41771
+ parentColorwayName,
41772
+ childSizeId: mapping.child_size_id,
41773
+ ownerChildIdx,
41774
+ ownerChildFound: owner != null,
41775
+ ownerColorwayNames: owner ? (owner.colorway_size_assets ?? []).map((a) => a.colorway_name) : [],
41776
+ ownerChildSizeIds: owner ? (owner.sizes ?? []).map((s) => s.id) : []
41777
+ });
41726
41778
  return null;
41727
41779
  }
41728
41780
  csaIds.push(matchedCsaId);
@@ -46022,18 +46074,31 @@ function QuickViewOverlay() {
46022
46074
  }
46023
46075
  return entry;
46024
46076
  }, [storeProductData]);
46025
- const containerHasTuckableChild = reactExports.useMemo(() => {
46077
+ const [containerHasTuckableChild, setContainerHasTuckableChild] = reactExports.useState(false);
46078
+ reactExports.useEffect(() => {
46026
46079
  if (!loadedProduct?.container) {
46027
- return false;
46028
- }
46029
- const index = peekStyleCategoryIndex();
46030
- if (!index) {
46031
- return false;
46080
+ setContainerHasTuckableChild(false);
46081
+ return;
46032
46082
  }
46033
- return loadedProduct.container.children.some((c) => {
46034
- const cat = index.byName(String(c.style_category_name));
46035
- return !!cat?.tuckable;
46083
+ const container = loadedProduct.container;
46084
+ let cancelled = false;
46085
+ loadStyleCategoryIndex().then((index) => {
46086
+ if (cancelled) {
46087
+ return;
46088
+ }
46089
+ const hasTuckable = container.children.some((c) => {
46090
+ const cat = index.byName(String(c.style_category_name));
46091
+ return !!cat?.tuckable;
46092
+ });
46093
+ setContainerHasTuckableChild(hasTuckable);
46094
+ }).catch((error) => {
46095
+ logger$5.logError("failed to load style category index for container tuck check", {
46096
+ error
46097
+ });
46036
46098
  });
46099
+ return () => {
46100
+ cancelled = true;
46101
+ };
46037
46102
  }, [loadedProduct]);
46038
46103
  const handleToggleContainerUntucked = reactExports.useCallback(() => {
46039
46104
  setContainerUntucked((prev2) => !prev2);
@@ -48021,9 +48086,9 @@ const SHARED_CONFIG = {
48021
48086
  appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
48022
48087
  },
48023
48088
  build: {
48024
- version: `${"5.0.34"}`,
48025
- commitHash: `${"5b52e20"}`,
48026
- date: `${"2026-07-13T13:49:10.971Z"}`
48089
+ version: `${"5.0.36"}`,
48090
+ commitHash: `${"5502059"}`,
48091
+ date: `${"2026-07-18T08:10:10.789Z"}`
48027
48092
  }
48028
48093
  };
48029
48094
  const CONFIGS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thefittingroom/shop-ui",
3
- "version": "5.0.34",
3
+ "version": "5.0.36",
4
4
  "description": "the fitting room UI library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",