@primestyleai/tryon 5.8.57 → 5.8.58
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/react/index.js
CHANGED
|
@@ -13049,13 +13049,26 @@ function buildFieldsFromSizeGuide$2(sizeGuide) {
|
|
|
13049
13049
|
const req = sizeGuide?.requiredFields;
|
|
13050
13050
|
if (!req || req.length === 0) return FALLBACK_FOOT_FIELDS;
|
|
13051
13051
|
const SIZE_CODE_KEYS = /* @__PURE__ */ new Set(["size", "country", "eu", "__skip__", "shoeEU", "shoeUS", "shoeUK", "shoeJP"]);
|
|
13052
|
-
const
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
}
|
|
13052
|
+
const defaultPlaceholderFor = (key, label) => {
|
|
13053
|
+
const exact = FALLBACK_FOOT_FIELDS.find((f) => f.key === key);
|
|
13054
|
+
if (exact) return exact.placeholder;
|
|
13055
|
+
const looksLikeFoot = /foot|length/i.test(key) || /foot|length/i.test(label);
|
|
13056
|
+
if (looksLikeFoot) return FALLBACK_FOOT_FIELDS[0].placeholder;
|
|
13057
|
+
return { cm: "", in: "" };
|
|
13058
|
+
};
|
|
13059
|
+
const out = req.filter((f) => !SIZE_CODE_KEYS.has(f.key) && f.unit !== "size").map((f) => {
|
|
13060
|
+
const fallback = defaultPlaceholderFor(f.key, f.label || "");
|
|
13061
|
+
return {
|
|
13062
|
+
key: f.key,
|
|
13063
|
+
label: f.label || f.key,
|
|
13064
|
+
placeholder: {
|
|
13065
|
+
cm: f.placeholder || fallback.cm,
|
|
13066
|
+
in: f.placeholder || fallback.in
|
|
13067
|
+
},
|
|
13068
|
+
min: 0,
|
|
13069
|
+
step: 0.5
|
|
13070
|
+
};
|
|
13071
|
+
});
|
|
13059
13072
|
return out.length > 0 ? out : FALLBACK_FOOT_FIELDS;
|
|
13060
13073
|
}
|
|
13061
13074
|
function FootSizeView(props) {
|
|
@@ -22473,13 +22473,26 @@ function buildFieldsFromSizeGuide$2(sizeGuide) {
|
|
|
22473
22473
|
const req = sizeGuide?.requiredFields;
|
|
22474
22474
|
if (!req || req.length === 0) return FALLBACK_FOOT_FIELDS;
|
|
22475
22475
|
const SIZE_CODE_KEYS = /* @__PURE__ */ new Set(["size", "country", "eu", "__skip__", "shoeEU", "shoeUS", "shoeUK", "shoeJP"]);
|
|
22476
|
-
const
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
}
|
|
22476
|
+
const defaultPlaceholderFor = (key, label) => {
|
|
22477
|
+
const exact = FALLBACK_FOOT_FIELDS.find((f2) => f2.key === key);
|
|
22478
|
+
if (exact) return exact.placeholder;
|
|
22479
|
+
const looksLikeFoot = /foot|length/i.test(key) || /foot|length/i.test(label);
|
|
22480
|
+
if (looksLikeFoot) return FALLBACK_FOOT_FIELDS[0].placeholder;
|
|
22481
|
+
return { cm: "", in: "" };
|
|
22482
|
+
};
|
|
22483
|
+
const out = req.filter((f2) => !SIZE_CODE_KEYS.has(f2.key) && f2.unit !== "size").map((f2) => {
|
|
22484
|
+
const fallback = defaultPlaceholderFor(f2.key, f2.label || "");
|
|
22485
|
+
return {
|
|
22486
|
+
key: f2.key,
|
|
22487
|
+
label: f2.label || f2.key,
|
|
22488
|
+
placeholder: {
|
|
22489
|
+
cm: f2.placeholder || fallback.cm,
|
|
22490
|
+
in: f2.placeholder || fallback.in
|
|
22491
|
+
},
|
|
22492
|
+
min: 0,
|
|
22493
|
+
step: 0.5
|
|
22494
|
+
};
|
|
22495
|
+
});
|
|
22483
22496
|
return out.length > 0 ? out : FALLBACK_FOOT_FIELDS;
|
|
22484
22497
|
}
|
|
22485
22498
|
function FootSizeView(props) {
|