@primestyleai/tryon 3.11.0 → 3.12.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.
|
@@ -207,6 +207,7 @@ const en = {
|
|
|
207
207
|
"Looking for size chart data for this product": "Looking for size chart data for this product",
|
|
208
208
|
"How would you like to find your size?": "How would you like to find your size?",
|
|
209
209
|
"Size guide is not available for this product — sizing will use standard measurements": "Size guide is not available for this product — sizing will use standard measurements",
|
|
210
|
+
"This product doesn't have a size guide — you can still see how it looks on you!": "This product doesn't have a size guide — you can still see how it looks on you!",
|
|
210
211
|
"Size guide found for this product": "Size guide found for this product",
|
|
211
212
|
"Enter my measurements": "Enter my measurements",
|
|
212
213
|
"Chest, waist, hips, shoes & more": "Chest, waist, hips, shoes & more",
|
package/dist/primestyle-tryon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-
|
|
2
|
-
import { P, b, T, d, r } from "./index-
|
|
1
|
+
import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-25Bm_pob.js";
|
|
2
|
+
import { P, b, T, d, r } from "./index-25Bm_pob.js";
|
|
3
3
|
function detectProductImage() {
|
|
4
4
|
const ogImage = document.querySelector(
|
|
5
5
|
'meta[property="og:image"]'
|
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect, useMemo, useRef, useCallback } from "react";
|
|
4
|
-
import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage, P as PrimeStyleError, L as LOCALE_LABELS, b as SUPPORTED_LOCALES } from "../index-
|
|
4
|
+
import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage, P as PrimeStyleError, L as LOCALE_LABELS, b as SUPPORTED_LOCALES } from "../index-25Bm_pob.js";
|
|
5
5
|
const HEADER_ALIASES = {
|
|
6
6
|
// ── Size label columns (skipped during field derivation) ──
|
|
7
7
|
size: "__size__",
|
|
@@ -406,20 +406,6 @@ const FALLBACK_FIELDS_MALE = [
|
|
|
406
406
|
{ key: "inseam", label: "Inseam", required: false, unit: "cm", placeholder: "e.g. 81", category: "body" },
|
|
407
407
|
{ key: "footLengthCm", label: "Foot length", required: false, unit: "cm", placeholder: "e.g. 27", category: "shoe" }
|
|
408
408
|
];
|
|
409
|
-
const SIZING_COUNTRIES = [
|
|
410
|
-
{ code: "US", label: "United States" },
|
|
411
|
-
{ code: "UK", label: "United Kingdom" },
|
|
412
|
-
{ code: "EU", label: "Europe (EU)" },
|
|
413
|
-
{ code: "FR", label: "France" },
|
|
414
|
-
{ code: "IT", label: "Italy" },
|
|
415
|
-
{ code: "DE", label: "Germany" },
|
|
416
|
-
{ code: "ES", label: "Spain" },
|
|
417
|
-
{ code: "JP", label: "Japan" },
|
|
418
|
-
{ code: "CN", label: "China" },
|
|
419
|
-
{ code: "KR", label: "South Korea" },
|
|
420
|
-
{ code: "AU", label: "Australia" },
|
|
421
|
-
{ code: "BR", label: "Brazil" }
|
|
422
|
-
];
|
|
423
409
|
const STEP_LABELS = ["", "Welcome", "Size", "Your Fit", "Try On"];
|
|
424
410
|
const TOTAL_STEPS = 4;
|
|
425
411
|
function detectLocale() {
|
|
@@ -1268,11 +1254,16 @@ function PrimeStyleTryonInner({
|
|
|
1268
1254
|
}
|
|
1269
1255
|
return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sizing-choice", children: [
|
|
1270
1256
|
/* @__PURE__ */ jsx("h3", { className: "ps-tryon-section-title", children: t("How would you like to find your size?") }),
|
|
1271
|
-
sgChecked && !sgAvailable && /* @__PURE__ */
|
|
1272
|
-
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
-
|
|
1275
|
-
|
|
1257
|
+
sgChecked && !sgAvailable && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sg-notice", children: [
|
|
1258
|
+
t("This product doesn't have a size guide — you can still see how it looks on you!"),
|
|
1259
|
+
/* @__PURE__ */ jsxs("button", { className: "ps-tryon-sg-notice-cta", onClick: () => {
|
|
1260
|
+
setSizingMethod(null);
|
|
1261
|
+
setView("upload");
|
|
1262
|
+
}, children: [
|
|
1263
|
+
t("Try It On"),
|
|
1264
|
+
" ",
|
|
1265
|
+
/* @__PURE__ */ jsx(ArrowRightIcon, {})
|
|
1266
|
+
] })
|
|
1276
1267
|
] }),
|
|
1277
1268
|
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-choice-cards", children: [
|
|
1278
1269
|
/* @__PURE__ */ jsxs("button", { className: "ps-tryon-choice-card", onClick: () => {
|
|
@@ -1331,28 +1322,24 @@ function PrimeStyleTryonInner({
|
|
|
1331
1322
|
")"
|
|
1332
1323
|
] }, p.id))
|
|
1333
1324
|
] }) }),
|
|
1334
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
/* @__PURE__ */ jsx("
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1325
|
+
sizingMethod === "exact" && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-unit-switch", children: [
|
|
1326
|
+
/* @__PURE__ */ jsxs("button", { className: `ps-tryon-unit-switch-btn${isCm ? " ps-active" : ""}`, onClick: () => {
|
|
1327
|
+
setSizingUnit("cm");
|
|
1328
|
+
setHeightUnit("cm");
|
|
1329
|
+
setWeightUnit("kg");
|
|
1330
|
+
}, children: [
|
|
1331
|
+
/* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-label", children: t("cm") }),
|
|
1332
|
+
/* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-sub", children: "cm / kg" })
|
|
1333
|
+
] }),
|
|
1334
|
+
/* @__PURE__ */ jsxs("button", { className: `ps-tryon-unit-switch-btn${!isCm ? " ps-active" : ""}`, onClick: () => {
|
|
1335
|
+
setSizingUnit("in");
|
|
1336
|
+
setHeightUnit("ft");
|
|
1337
|
+
setWeightUnit("lbs");
|
|
1338
|
+
}, children: [
|
|
1339
|
+
/* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-label", children: t("in") }),
|
|
1340
|
+
/* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-sub", children: "in / lbs" })
|
|
1345
1341
|
] })
|
|
1346
1342
|
] }),
|
|
1347
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
1348
|
-
/* @__PURE__ */ jsx("label", { children: t("Sizing region") }),
|
|
1349
|
-
/* @__PURE__ */ jsx("select", { className: "ps-tryon-country-select", value: sizingCountry, onChange: (e) => setSizingCountry(e.target.value), children: SIZING_COUNTRIES.map((c) => /* @__PURE__ */ jsx("option", { value: c.code, children: t(c.label) }, c.code)) })
|
|
1350
|
-
] }),
|
|
1351
|
-
sizingMethod === "exact" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UnitToggle, { options: [{ label: t("cm"), value: "cm" }, { label: t("in"), value: "in" }], value: sizingUnit, onChange: (v) => {
|
|
1352
|
-
setSizingUnit(v);
|
|
1353
|
-
setHeightUnit(v === "cm" ? "cm" : "ft");
|
|
1354
|
-
setWeightUnit(v === "cm" ? "kg" : "lbs");
|
|
1355
|
-
} }) }),
|
|
1356
1343
|
sizingMethod === "exact" ? /* @__PURE__ */ jsx(Fragment, { children: (() => {
|
|
1357
1344
|
const reqFields = dynamicFields.filter((f) => f.required);
|
|
1358
1345
|
const optFields = dynamicFields.filter((f) => !f.required);
|
|
@@ -2044,13 +2031,19 @@ const STYLES = `
|
|
|
2044
2031
|
background: rgba(187,148,92,0.12); color: #bb945c; font-size: clamp(8px, 0.52vw, 10px); font-weight: 600;
|
|
2045
2032
|
}
|
|
2046
2033
|
.ps-tryon-sg-notice {
|
|
2047
|
-
font-size: clamp(
|
|
2048
|
-
margin-bottom: clamp(
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
display: flex; align-items: center;
|
|
2053
|
-
|
|
2034
|
+
font-size: clamp(10px, 0.68vw, 13px); color: #999; text-align: center; padding: clamp(10px, 0.73vw, 14px) clamp(12px, 0.83vw, 16px);
|
|
2035
|
+
margin-bottom: clamp(10px, 0.73vw, 14px); border: 1px solid #333; border-radius: clamp(8px, 0.63vw, 12px); background: #1a1b1a;
|
|
2036
|
+
display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 0.57vw, 12px);
|
|
2037
|
+
}
|
|
2038
|
+
.ps-tryon-sg-notice-cta {
|
|
2039
|
+
display: inline-flex; align-items: center; gap: clamp(4px, 0.31vw, 6px);
|
|
2040
|
+
padding: clamp(6px, 0.42vw, 8px) clamp(14px, 1vw, 18px);
|
|
2041
|
+
background: #bb945c; color: #111; border: none; border-radius: clamp(6px, 0.42vw, 8px);
|
|
2042
|
+
font-size: clamp(10px, 0.68vw, 13px); font-weight: 700; cursor: pointer;
|
|
2043
|
+
transition: all 0.2s; font-family: inherit;
|
|
2044
|
+
}
|
|
2045
|
+
.ps-tryon-sg-notice-cta:hover { background: #a07d4e; }
|
|
2046
|
+
.ps-tryon-sg-notice-cta svg { stroke: #111; }
|
|
2054
2047
|
.ps-tryon-sg-found svg { stroke: #4ade80; }
|
|
2055
2048
|
.ps-tryon-sg-checking { display: flex; flex-direction: column; align-items: center; padding: clamp(24px, 2.08vw, 40px) clamp(12px, 1.04vw, 20px); text-align: center; }
|
|
2056
2049
|
.ps-tryon-sg-checking-icon { color: #bb945c; margin-bottom: clamp(10px, 0.83vw, 16px); animation: ps-pulse-ruler 1.5s ease-in-out infinite; }
|
|
@@ -2099,6 +2092,29 @@ const STYLES = `
|
|
|
2099
2092
|
font-size: clamp(9px, 0.63vw, 12px); font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit;
|
|
2100
2093
|
}
|
|
2101
2094
|
.ps-tryon-unit-btn.ps-active { background: #bb945c; color: #111; }
|
|
2095
|
+
|
|
2096
|
+
/* Prominent unit switch (cm/in) */
|
|
2097
|
+
.ps-tryon-unit-switch {
|
|
2098
|
+
display: flex; gap: clamp(6px, 0.42vw, 8px); margin-bottom: clamp(10px, 0.83vw, 16px);
|
|
2099
|
+
}
|
|
2100
|
+
.ps-tryon-unit-switch-btn {
|
|
2101
|
+
flex: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(2px, 0.16vw, 3px);
|
|
2102
|
+
padding: clamp(10px, 0.73vw, 14px) clamp(8px, 0.57vw, 12px);
|
|
2103
|
+
border: 2px solid #333; border-radius: clamp(10px, 0.73vw, 14px);
|
|
2104
|
+
background: transparent; color: #666; cursor: pointer;
|
|
2105
|
+
transition: all 0.25s ease; font-family: inherit;
|
|
2106
|
+
}
|
|
2107
|
+
.ps-tryon-unit-switch-btn:hover { border-color: #555; color: #999; }
|
|
2108
|
+
.ps-tryon-unit-switch-btn.ps-active {
|
|
2109
|
+
border-color: #bb945c; background: rgba(187,148,92,0.08); color: #bb945c;
|
|
2110
|
+
box-shadow: 0 0 0 clamp(3px, 0.21vw, 4px) rgba(187,148,92,0.08);
|
|
2111
|
+
}
|
|
2112
|
+
.ps-tryon-unit-switch-label {
|
|
2113
|
+
font-size: clamp(16px, 1.04vw, 20px); font-weight: 700; letter-spacing: 0.02em;
|
|
2114
|
+
}
|
|
2115
|
+
.ps-tryon-unit-switch-sub {
|
|
2116
|
+
font-size: clamp(9px, 0.52vw, 11px); font-weight: 500; opacity: 0.6;
|
|
2117
|
+
}
|
|
2102
2118
|
.ps-tryon-section-label { font-size: clamp(8px, 0.57vw, 11px); font-weight: 700; color: #bb945c; text-transform: uppercase; letter-spacing: 0.08em; margin: clamp(2px, 0.21vw, 4px) 0 clamp(1px, 0.1vw, 2px); }
|
|
2103
2119
|
.ps-tryon-optional-section { border-top: 1px solid #333; padding-top: clamp(6px, 0.52vw, 10px); margin-top: clamp(4px, 0.31vw, 6px); }
|
|
2104
2120
|
.ps-tryon-optional-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 1px solid #333; border-radius: clamp(6px, 0.52vw, 10px); padding: clamp(6px, 0.52vw, 10px) clamp(8px, 0.73vw, 14px); color: #999; font-size: clamp(10px, 0.68vw, 13px); font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s; }
|