@primestyleai/tryon 3.2.1 → 3.3.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/react/index.js +26 -11
- package/package.json +57 -57
package/dist/react/index.js
CHANGED
|
@@ -467,7 +467,13 @@ function PrimeStyleTryonInner({
|
|
|
467
467
|
const data = await res.json();
|
|
468
468
|
setSizingResult(data);
|
|
469
469
|
} else {
|
|
470
|
-
|
|
470
|
+
const errBody = await res.text().catch(() => "");
|
|
471
|
+
console.error("[PrimeStyle] Sizing API error:", res.status, errBody);
|
|
472
|
+
try {
|
|
473
|
+
const parsed = JSON.parse(errBody);
|
|
474
|
+
if (parsed.issues) console.error("[PrimeStyle] Validation issues:", JSON.stringify(parsed.issues, null, 2));
|
|
475
|
+
} catch {
|
|
476
|
+
}
|
|
471
477
|
}
|
|
472
478
|
} catch (err) {
|
|
473
479
|
console.warn("[PrimeStyle] Sizing request failed:", err);
|
|
@@ -800,7 +806,8 @@ function PrimeStyleTryonInner({
|
|
|
800
806
|
const sgChecked = !sizeGuideFetching && sizeGuide !== null;
|
|
801
807
|
if (sizeGuideFetching) {
|
|
802
808
|
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-sizing-choice", children: /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sg-checking", children: [
|
|
803
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-sg-checking-
|
|
809
|
+
/* @__PURE__ */ jsx("div", { className: "ps-tryon-sg-checking-icon", children: /* @__PURE__ */ jsx(RulerIcon, { size: 32 }) }),
|
|
810
|
+
/* @__PURE__ */ jsx("div", { className: "ps-tryon-sg-checking-bar-wrap", children: /* @__PURE__ */ jsx("div", { className: "ps-tryon-sg-checking-bar" }) }),
|
|
804
811
|
/* @__PURE__ */ jsx("h3", { className: "ps-tryon-section-title", children: "Checking size guide..." }),
|
|
805
812
|
/* @__PURE__ */ jsx("p", { className: "ps-tryon-sg-checking-sub", children: "Looking for size chart data for this product" })
|
|
806
813
|
] }) });
|
|
@@ -851,7 +858,11 @@ function PrimeStyleTryonInner({
|
|
|
851
858
|
const isFemale = formGender === "female";
|
|
852
859
|
const isCm = sizingUnit === "cm";
|
|
853
860
|
return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sizing-form", children: [
|
|
854
|
-
|
|
861
|
+
/* @__PURE__ */ jsxs("button", { className: "ps-tryon-back", onClick: () => setView("sizing-choice"), children: [
|
|
862
|
+
/* @__PURE__ */ jsx(ArrowLeftIcon, {}),
|
|
863
|
+
" Back"
|
|
864
|
+
] }),
|
|
865
|
+
sizingMethod === "exact" && profiles.length > 0 && /* @__PURE__ */ jsx("div", { className: "ps-tryon-profile-bar", children: /* @__PURE__ */ jsxs("select", { className: "ps-tryon-profile-select", value: activeProfileId || "", onChange: (e) => {
|
|
855
866
|
if (e.target.value) applyProfile(e.target.value);
|
|
856
867
|
}, children: [
|
|
857
868
|
/* @__PURE__ */ jsx("option", { value: "", children: "Auto-fill from saved profile..." }),
|
|
@@ -1351,17 +1362,21 @@ const STYLES = `
|
|
|
1351
1362
|
display: flex; align-items: center; justify-content: center; gap: 6px;
|
|
1352
1363
|
}
|
|
1353
1364
|
.ps-tryon-sg-found svg { stroke: #4ade80; }
|
|
1354
|
-
.ps-tryon-sg-checking {
|
|
1355
|
-
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
}
|
|
1365
|
+
.ps-tryon-sg-checking { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; text-align: center; }
|
|
1366
|
+
.ps-tryon-sg-checking-icon { color: #bb945c; margin-bottom: 16px; animation: ps-pulse-ruler 1.5s ease-in-out infinite; }
|
|
1367
|
+
.ps-tryon-sg-checking-icon svg { stroke: currentColor; fill: none; }
|
|
1368
|
+
@keyframes ps-pulse-ruler { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.15); opacity: 1; } }
|
|
1369
|
+
.ps-tryon-sg-checking-bar-wrap { width: 180px; height: 4px; background: #333; border-radius: 2px; overflow: hidden; margin-bottom: 20px; }
|
|
1370
|
+
.ps-tryon-sg-checking-bar { height: 100%; width: 40%; background: linear-gradient(90deg, #bb945c, #d6ba7d); border-radius: 2px; animation: ps-sg-bar 1.5s ease-in-out infinite; }
|
|
1371
|
+
@keyframes ps-sg-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
|
|
1362
1372
|
.ps-tryon-sg-checking .ps-tryon-section-title { margin-bottom: 6px; }
|
|
1363
1373
|
.ps-tryon-sg-checking-sub { font-size: 13px; color: #999; margin: 0; }
|
|
1364
1374
|
|
|
1375
|
+
/* Back button */
|
|
1376
|
+
.ps-tryon-back { display: flex; align-items: center; gap: 6px; background: none; border: none; color: #999; font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 12px; font-family: inherit; transition: color 0.2s; }
|
|
1377
|
+
.ps-tryon-back:hover { color: #fff; }
|
|
1378
|
+
.ps-tryon-back svg { stroke: currentColor; fill: none; }
|
|
1379
|
+
|
|
1365
1380
|
/* Sizing form */
|
|
1366
1381
|
.ps-tryon-sizing-form { display: flex; flex-direction: column; gap: 12px; }
|
|
1367
1382
|
.ps-tryon-input-row { display: flex; align-items: center; gap: 10px; }
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@primestyleai/tryon",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/primestyle-tryon.js",
|
|
7
|
-
"module": "dist/primestyle-tryon.js",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/primestyle-tryon.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
},
|
|
14
|
-
"./react": {
|
|
15
|
-
"import": "./dist/react/index.js",
|
|
16
|
-
"types": "./dist/react/index.d.ts"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist",
|
|
21
|
-
"logo.svg",
|
|
22
|
-
"README.md"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "vite build --watch",
|
|
26
|
-
"build": "vite build && tsc --emitDeclarationOnly",
|
|
27
|
-
"prepublishOnly": "npm run build"
|
|
28
|
-
},
|
|
29
|
-
"keywords": [
|
|
30
|
-
"virtual-try-on",
|
|
31
|
-
"react",
|
|
32
|
-
"web-component",
|
|
33
|
-
"fashion",
|
|
34
|
-
"ai",
|
|
35
|
-
"primestyle"
|
|
36
|
-
],
|
|
37
|
-
"author": "PrimeStyle AI",
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"react": ">=18.0.0",
|
|
41
|
-
"react-dom": ">=18.0.0"
|
|
42
|
-
},
|
|
43
|
-
"peerDependenciesMeta": {
|
|
44
|
-
"react": {
|
|
45
|
-
"optional": true
|
|
46
|
-
},
|
|
47
|
-
"react-dom": {
|
|
48
|
-
"optional": true
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"@types/react": "^18.3.28",
|
|
53
|
-
"terser": "^5.31.0",
|
|
54
|
-
"typescript": "^5.5.0",
|
|
55
|
-
"vite": "^5.4.0"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@primestyleai/tryon",
|
|
3
|
+
"version": "3.3.0",
|
|
4
|
+
"description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/primestyle-tryon.js",
|
|
7
|
+
"module": "dist/primestyle-tryon.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/primestyle-tryon.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./react": {
|
|
15
|
+
"import": "./dist/react/index.js",
|
|
16
|
+
"types": "./dist/react/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"logo.svg",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite build --watch",
|
|
26
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
27
|
+
"prepublishOnly": "npm run build"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"virtual-try-on",
|
|
31
|
+
"react",
|
|
32
|
+
"web-component",
|
|
33
|
+
"fashion",
|
|
34
|
+
"ai",
|
|
35
|
+
"primestyle"
|
|
36
|
+
],
|
|
37
|
+
"author": "PrimeStyle AI",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": ">=18.0.0",
|
|
41
|
+
"react-dom": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"react": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"react-dom": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/react": "^18.3.28",
|
|
53
|
+
"terser": "^5.31.0",
|
|
54
|
+
"typescript": "^5.5.0",
|
|
55
|
+
"vite": "^5.4.0"
|
|
56
|
+
}
|
|
57
|
+
}
|