@primestyleai/tryon 5.7.11 → 5.8.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 +268 -73
- package/dist/react/styles.d.ts +1 -1
- package/dist/storefront/primestyle-tryon.js +268 -73
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -634,14 +634,14 @@ const STYLES = `
|
|
|
634
634
|
.ps-tryon-modal {
|
|
635
635
|
background: var(--ps-modal-bg, #FFFFFF); color: var(--ps-modal-color, #1C1D1E);
|
|
636
636
|
border-radius: var(--ps-modal-radius, 0.83vw); width: var(--ps-modal-width, 100%);
|
|
637
|
-
max-width: var(--ps-modal-max-width, 36vw); max-height: 92vh; overflow-y: auto;
|
|
637
|
+
max-width: var(--ps-modal-max-width, min(36vw, 560px)); max-height: min(92vh, 800px); overflow-y: auto;
|
|
638
638
|
font-family: var(--ps-modal-font, system-ui, -apple-system, sans-serif);
|
|
639
639
|
box-shadow: 0 1.3vw 2.6vw rgba(0,0,0,0.08); animation: ps-slide-up 0.3s ease;
|
|
640
640
|
scrollbar-width: thin; scrollbar-color: var(--ps-border-color) transparent;
|
|
641
641
|
flex-shrink: 0;
|
|
642
642
|
}
|
|
643
|
-
.ps-tryon-modal-wide { max-width: 55vw; width: 55vw; height: 70vh; max-height: 70vh; display: flex; flex-direction: column; overflow: visible; transition: height 0.45s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
|
|
644
|
-
.ps-tryon-modal-tall.ps-tryon-modal-wide { height: 88vh; max-height: 88vh; }
|
|
643
|
+
.ps-tryon-modal-wide { max-width: min(55vw, 900px); width: min(55vw, 900px); height: min(70vh, 680px); max-height: min(70vh, 680px); display: flex; flex-direction: column; overflow: visible; transition: height 0.45s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
|
|
644
|
+
.ps-tryon-modal-tall.ps-tryon-modal-wide { height: min(88vh, 800px); max-height: min(88vh, 800px); }
|
|
645
645
|
.ps-tryon-modal:has(.ps-tryon-drawer-open) { overflow: hidden; }
|
|
646
646
|
@keyframes ps-slide-up { from { transform: translateY(1.04vw) scale(0.97); opacity: 0; filter: blur(4px); } to { transform: none; opacity: 1; filter: none; } }
|
|
647
647
|
|
|
@@ -3683,11 +3683,11 @@ const STYLES = `
|
|
|
3683
3683
|
overflow: hidden;
|
|
3684
3684
|
}
|
|
3685
3685
|
.ps-msc-stage-slot {
|
|
3686
|
-
animation: ps-msc-stage-in 0.
|
|
3686
|
+
animation: ps-msc-stage-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
3687
3687
|
}
|
|
3688
3688
|
@keyframes ps-msc-stage-in {
|
|
3689
|
-
|
|
3690
|
-
|
|
3689
|
+
0% { opacity: 0; transform: translateY(18px); filter: blur(4px); }
|
|
3690
|
+
100% { opacity: 1; transform: translateY(0); filter: blur(0); }
|
|
3691
3691
|
}
|
|
3692
3692
|
.ps-msc-stage-title {
|
|
3693
3693
|
font-size: 16px; font-weight: 700;
|
|
@@ -4249,6 +4249,86 @@ const STYLES = `
|
|
|
4249
4249
|
border-color: var(--ps-accent);
|
|
4250
4250
|
color: var(--ps-accent);
|
|
4251
4251
|
}
|
|
4252
|
+
.ps-msp-card-delete {
|
|
4253
|
+
width: 36px; height: 36px;
|
|
4254
|
+
background: var(--ps-bg-primary);
|
|
4255
|
+
border: 1px solid var(--ps-border-subtle);
|
|
4256
|
+
border-radius: 6px;
|
|
4257
|
+
display: flex; align-items: center; justify-content: center;
|
|
4258
|
+
color: var(--ps-text-secondary); cursor: pointer;
|
|
4259
|
+
transition: border-color 0.15s, color 0.15s;
|
|
4260
|
+
}
|
|
4261
|
+
.ps-msp-card-delete:hover {
|
|
4262
|
+
border-color: #F87171;
|
|
4263
|
+
color: #F87171;
|
|
4264
|
+
}
|
|
4265
|
+
|
|
4266
|
+
/* Edit measurements modal */
|
|
4267
|
+
.ps-msp-edit-overlay {
|
|
4268
|
+
position: absolute; inset: 0; z-index: 100;
|
|
4269
|
+
background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
|
|
4270
|
+
display: flex; align-items: center; justify-content: center;
|
|
4271
|
+
padding: 16px; animation: ps-fade-in 0.2s ease;
|
|
4272
|
+
}
|
|
4273
|
+
.ps-msp-edit-modal {
|
|
4274
|
+
background: var(--ps-bg-primary); border-radius: 14px;
|
|
4275
|
+
width: 100%; max-width: 380px; padding: 20px;
|
|
4276
|
+
box-shadow: 0 12px 40px rgba(0,0,0,0.15);
|
|
4277
|
+
animation: ps-slide-up 0.25s ease;
|
|
4278
|
+
}
|
|
4279
|
+
.ps-msp-edit-header {
|
|
4280
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
4281
|
+
margin-bottom: 16px;
|
|
4282
|
+
}
|
|
4283
|
+
.ps-msp-edit-header h3 {
|
|
4284
|
+
font-size: 16px; font-weight: 600; color: var(--ps-text-primary); margin: 0;
|
|
4285
|
+
}
|
|
4286
|
+
.ps-msp-edit-close {
|
|
4287
|
+
background: none; border: none; color: var(--ps-text-secondary);
|
|
4288
|
+
cursor: pointer; padding: 4px;
|
|
4289
|
+
}
|
|
4290
|
+
.ps-msp-edit-grid {
|
|
4291
|
+
display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
|
|
4292
|
+
margin-bottom: 18px;
|
|
4293
|
+
}
|
|
4294
|
+
.ps-msp-edit-field {
|
|
4295
|
+
display: flex; flex-direction: column; gap: 4px;
|
|
4296
|
+
}
|
|
4297
|
+
.ps-msp-edit-label {
|
|
4298
|
+
font-size: 10px; font-weight: 600; text-transform: uppercase;
|
|
4299
|
+
letter-spacing: 0.06em; color: var(--ps-text-muted);
|
|
4300
|
+
}
|
|
4301
|
+
.ps-msp-edit-input-wrap {
|
|
4302
|
+
display: flex; align-items: center;
|
|
4303
|
+
border: 1px solid var(--ps-border-color); border-radius: 8px;
|
|
4304
|
+
overflow: hidden; background: var(--ps-bg-secondary);
|
|
4305
|
+
}
|
|
4306
|
+
.ps-msp-edit-input {
|
|
4307
|
+
flex: 1; border: none; background: transparent; padding: 8px 10px;
|
|
4308
|
+
font-size: 14px; color: var(--ps-text-primary); outline: none;
|
|
4309
|
+
min-width: 0; -moz-appearance: textfield;
|
|
4310
|
+
}
|
|
4311
|
+
.ps-msp-edit-input::-webkit-inner-spin-button,
|
|
4312
|
+
.ps-msp-edit-input::-webkit-outer-spin-button { -webkit-appearance: none; }
|
|
4313
|
+
.ps-msp-edit-input:focus { box-shadow: inset 0 0 0 1px var(--ps-accent); }
|
|
4314
|
+
.ps-msp-edit-unit {
|
|
4315
|
+
font-size: 11px; color: var(--ps-text-muted); padding-right: 10px;
|
|
4316
|
+
font-weight: 500; flex-shrink: 0;
|
|
4317
|
+
}
|
|
4318
|
+
.ps-msp-edit-actions {
|
|
4319
|
+
display: flex; gap: 8px; justify-content: flex-end;
|
|
4320
|
+
}
|
|
4321
|
+
.ps-msp-edit-cancel {
|
|
4322
|
+
padding: 8px 16px; font-size: 13px; font-weight: 500;
|
|
4323
|
+
border: 1px solid var(--ps-border-color); border-radius: 8px;
|
|
4324
|
+
background: transparent; color: var(--ps-text-secondary); cursor: pointer;
|
|
4325
|
+
}
|
|
4326
|
+
.ps-msp-edit-save {
|
|
4327
|
+
padding: 8px 20px; font-size: 13px; font-weight: 600;
|
|
4328
|
+
border: none; border-radius: 8px;
|
|
4329
|
+
background: var(--ps-accent); color: #fff; cursor: pointer;
|
|
4330
|
+
}
|
|
4331
|
+
.ps-msp-edit-save:hover { opacity: 0.9; }
|
|
4252
4332
|
|
|
4253
4333
|
/* "Create New Profile" empty card */
|
|
4254
4334
|
.ps-msp-card-create {
|
|
@@ -8782,11 +8862,83 @@ function ProfileMeasurementsView({
|
|
|
8782
8862
|
] })
|
|
8783
8863
|
] });
|
|
8784
8864
|
}
|
|
8865
|
+
function EditMeasurementsModal({
|
|
8866
|
+
profile,
|
|
8867
|
+
onSave,
|
|
8868
|
+
onCancel,
|
|
8869
|
+
t
|
|
8870
|
+
}) {
|
|
8871
|
+
const m = profile.measurements || {};
|
|
8872
|
+
const fields = [
|
|
8873
|
+
{ key: "bust", label: "Bust" },
|
|
8874
|
+
{ key: "waist", label: "Waist" },
|
|
8875
|
+
{ key: "hips", label: "Hips" },
|
|
8876
|
+
{ key: "shoulderWidth", label: "Shoulder" },
|
|
8877
|
+
{ key: "sleeveLength", label: "Sleeve" },
|
|
8878
|
+
{ key: "neckCircumference", label: "Neck" },
|
|
8879
|
+
{ key: "inseam", label: "Inseam" },
|
|
8880
|
+
{ key: "thighCircumference", label: "Thigh" }
|
|
8881
|
+
];
|
|
8882
|
+
const [values, setValues] = useState(() => {
|
|
8883
|
+
const init = {};
|
|
8884
|
+
fields.forEach((f) => {
|
|
8885
|
+
init[f.key] = m[f.key] != null ? String(Math.round(m[f.key] * 10) / 10) : "";
|
|
8886
|
+
});
|
|
8887
|
+
return init;
|
|
8888
|
+
});
|
|
8889
|
+
const unit = profile.measurementsUnit || "cm";
|
|
8890
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-msp-edit-overlay", onClick: onCancel, children: /* @__PURE__ */ jsxs("div", { className: "ps-msp-edit-modal", onClick: (e) => e.stopPropagation(), children: [
|
|
8891
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-edit-header", children: [
|
|
8892
|
+
/* @__PURE__ */ jsx("h3", { children: t("Edit Measurements") }),
|
|
8893
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-msp-edit-close", onClick: onCancel, "aria-label": t("Close"), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", width: "18", height: "18", children: [
|
|
8894
|
+
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
8895
|
+
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
8896
|
+
] }) })
|
|
8897
|
+
] }),
|
|
8898
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msp-edit-grid", children: fields.map((f) => /* @__PURE__ */ jsxs("label", { className: "ps-msp-edit-field", children: [
|
|
8899
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-edit-label", children: t(f.label) }),
|
|
8900
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-edit-input-wrap", children: [
|
|
8901
|
+
/* @__PURE__ */ jsx(
|
|
8902
|
+
"input",
|
|
8903
|
+
{
|
|
8904
|
+
type: "number",
|
|
8905
|
+
step: "0.1",
|
|
8906
|
+
className: "ps-msp-edit-input",
|
|
8907
|
+
value: values[f.key] || "",
|
|
8908
|
+
onChange: (e) => setValues((v) => ({ ...v, [f.key]: e.target.value })),
|
|
8909
|
+
placeholder: "—"
|
|
8910
|
+
}
|
|
8911
|
+
),
|
|
8912
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-edit-unit", children: unit })
|
|
8913
|
+
] })
|
|
8914
|
+
] }, f.key)) }),
|
|
8915
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-edit-actions", children: [
|
|
8916
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-msp-edit-cancel", onClick: onCancel, children: t("Cancel") }),
|
|
8917
|
+
/* @__PURE__ */ jsx(
|
|
8918
|
+
"button",
|
|
8919
|
+
{
|
|
8920
|
+
type: "button",
|
|
8921
|
+
className: "ps-msp-edit-save",
|
|
8922
|
+
onClick: () => {
|
|
8923
|
+
const updated = { ...profile.measurements || {} };
|
|
8924
|
+
fields.forEach((f) => {
|
|
8925
|
+
const v = parseFloat(values[f.key]);
|
|
8926
|
+
if (!isNaN(v) && v > 0) updated[f.key] = v;
|
|
8927
|
+
});
|
|
8928
|
+
onSave(updated);
|
|
8929
|
+
},
|
|
8930
|
+
children: t("Save")
|
|
8931
|
+
}
|
|
8932
|
+
)
|
|
8933
|
+
] })
|
|
8934
|
+
] }) });
|
|
8935
|
+
}
|
|
8785
8936
|
function ProfileCard({
|
|
8786
8937
|
profile,
|
|
8787
8938
|
isActive,
|
|
8788
8939
|
onSelect,
|
|
8789
8940
|
onEdit,
|
|
8941
|
+
onDelete,
|
|
8790
8942
|
onOpenDetail,
|
|
8791
8943
|
t
|
|
8792
8944
|
}) {
|
|
@@ -8848,6 +9000,13 @@ function ProfileCard({
|
|
|
8848
9000
|
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-msp-card-edit", onClick: onEdit, "aria-label": t("Edit"), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
8849
9001
|
/* @__PURE__ */ jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
8850
9002
|
/* @__PURE__ */ jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
9003
|
+
] }) }),
|
|
9004
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-msp-card-delete", onClick: (e) => {
|
|
9005
|
+
e.stopPropagation();
|
|
9006
|
+
if (confirm(t("Delete this profile?"))) onDelete();
|
|
9007
|
+
}, "aria-label": t("Delete"), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
9008
|
+
/* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
9009
|
+
/* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
8851
9010
|
] }) })
|
|
8852
9011
|
] })
|
|
8853
9012
|
]
|
|
@@ -8877,79 +9036,99 @@ function MySizingProfilesView({
|
|
|
8877
9036
|
}) {
|
|
8878
9037
|
const [creating, setCreating] = useState(false);
|
|
8879
9038
|
const [viewingId, setViewingId] = useState(null);
|
|
9039
|
+
const [editingId, setEditingId] = useState(null);
|
|
8880
9040
|
const viewingProfile = viewingId ? profiles.find((p) => p.id === viewingId) || null : null;
|
|
9041
|
+
const editingProfile = editingId ? profiles.find((p) => p.id === editingId) || null : null;
|
|
8881
9042
|
const handleSaveNewProfile = (data) => {
|
|
8882
9043
|
onSaveNewProfile(data);
|
|
8883
9044
|
setCreating(false);
|
|
8884
9045
|
};
|
|
8885
|
-
return /* @__PURE__ */
|
|
8886
|
-
/*
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
9046
|
+
return /* @__PURE__ */ jsxs("div", { className: "ps-msp-root", children: [
|
|
9047
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msp-scroll", children: viewingProfile ? (
|
|
9048
|
+
/* ── Profile detail view (full body measurements) ── */
|
|
9049
|
+
/* @__PURE__ */ jsx(
|
|
9050
|
+
ProfileMeasurementsView,
|
|
9051
|
+
{
|
|
9052
|
+
profile: viewingProfile,
|
|
9053
|
+
isActive: viewingProfile.id === activeProfileId,
|
|
9054
|
+
onSelect: () => {
|
|
9055
|
+
onSelectProfile(viewingProfile.id);
|
|
9056
|
+
setViewingId(null);
|
|
9057
|
+
},
|
|
9058
|
+
onSaveMeasurements: (m) => onSaveProfileMeasurements(viewingProfile.id, m),
|
|
9059
|
+
onDelete: () => {
|
|
9060
|
+
onDeleteProfile(viewingProfile.id);
|
|
9061
|
+
setViewingId(null);
|
|
9062
|
+
},
|
|
9063
|
+
onBack: () => setViewingId(null),
|
|
9064
|
+
onSave: () => setViewingId(null),
|
|
9065
|
+
t
|
|
9066
|
+
}
|
|
9067
|
+
)
|
|
9068
|
+
) : creating ? (
|
|
9069
|
+
/* ── Multi-step create wizard (Identity → Silhouette) ── */
|
|
9070
|
+
/* @__PURE__ */ jsx(
|
|
9071
|
+
CreateProfileWizard,
|
|
9072
|
+
{
|
|
9073
|
+
onSave: (data) => {
|
|
9074
|
+
handleSaveNewProfile(data);
|
|
9075
|
+
setTimeout(() => {
|
|
9076
|
+
const latest = typeof window !== "undefined" ? (() => {
|
|
9077
|
+
try {
|
|
9078
|
+
const raw = localStorage.getItem("primestyle_profiles");
|
|
9079
|
+
if (raw) {
|
|
9080
|
+
const list = JSON.parse(raw);
|
|
9081
|
+
if (list.length > 0) return list[0].id;
|
|
9082
|
+
}
|
|
9083
|
+
} catch {
|
|
8920
9084
|
}
|
|
8921
|
-
|
|
8922
|
-
}
|
|
8923
|
-
|
|
8924
|
-
})
|
|
8925
|
-
|
|
8926
|
-
|
|
9085
|
+
return null;
|
|
9086
|
+
})() : null;
|
|
9087
|
+
if (latest) setViewingId(latest);
|
|
9088
|
+
}, 50);
|
|
9089
|
+
},
|
|
9090
|
+
onCancel: () => setCreating(false),
|
|
9091
|
+
t
|
|
9092
|
+
}
|
|
9093
|
+
)
|
|
9094
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9095
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-header", children: [
|
|
9096
|
+
/* @__PURE__ */ jsx("h2", { className: "ps-msp-title", children: t("My Sizing Profiles") }),
|
|
9097
|
+
/* @__PURE__ */ jsx("p", { className: "ps-msp-subtitle", children: t("Manage your bespoke silhouettes. Switch between profiles for different fits or create a new one for specific garment types.") })
|
|
9098
|
+
] }),
|
|
9099
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-grid", children: [
|
|
9100
|
+
/* @__PURE__ */ jsx(CreateProfileCard, { onClick: () => setCreating(true), t }),
|
|
9101
|
+
profiles.map((p) => /* @__PURE__ */ jsx(
|
|
9102
|
+
ProfileCard,
|
|
9103
|
+
{
|
|
9104
|
+
profile: p,
|
|
9105
|
+
isActive: p.id === activeProfileId,
|
|
9106
|
+
onSelect: () => onSelectProfile(p.id),
|
|
9107
|
+
onEdit: () => setEditingId(p.id),
|
|
9108
|
+
onDelete: () => {
|
|
9109
|
+
onDeleteProfile(p.id);
|
|
9110
|
+
if (viewingId === p.id) setViewingId(null);
|
|
9111
|
+
},
|
|
9112
|
+
onOpenDetail: () => setViewingId(p.id),
|
|
9113
|
+
t
|
|
9114
|
+
},
|
|
9115
|
+
p.id
|
|
9116
|
+
))
|
|
9117
|
+
] })
|
|
9118
|
+
] }) }),
|
|
9119
|
+
editingProfile && /* @__PURE__ */ jsx(
|
|
9120
|
+
EditMeasurementsModal,
|
|
9121
|
+
{
|
|
9122
|
+
profile: editingProfile,
|
|
9123
|
+
onSave: (m) => {
|
|
9124
|
+
onSaveProfileMeasurements(editingProfile.id, m);
|
|
9125
|
+
setEditingId(null);
|
|
8927
9126
|
},
|
|
8928
|
-
onCancel: () =>
|
|
9127
|
+
onCancel: () => setEditingId(null),
|
|
8929
9128
|
t
|
|
8930
9129
|
}
|
|
8931
9130
|
)
|
|
8932
|
-
)
|
|
8933
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-header", children: [
|
|
8934
|
-
/* @__PURE__ */ jsx("h2", { className: "ps-msp-title", children: t("My Sizing Profiles") }),
|
|
8935
|
-
/* @__PURE__ */ jsx("p", { className: "ps-msp-subtitle", children: t("Manage your bespoke silhouettes. Switch between profiles for different fits or create a new one for specific garment types.") })
|
|
8936
|
-
] }),
|
|
8937
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-msp-grid", children: [
|
|
8938
|
-
/* @__PURE__ */ jsx(CreateProfileCard, { onClick: () => setCreating(true), t }),
|
|
8939
|
-
profiles.map((p) => /* @__PURE__ */ jsx(
|
|
8940
|
-
ProfileCard,
|
|
8941
|
-
{
|
|
8942
|
-
profile: p,
|
|
8943
|
-
isActive: p.id === activeProfileId,
|
|
8944
|
-
onSelect: () => onSelectProfile(p.id),
|
|
8945
|
-
onEdit: () => onEditProfile(p),
|
|
8946
|
-
onOpenDetail: () => setViewingId(p.id),
|
|
8947
|
-
t
|
|
8948
|
-
},
|
|
8949
|
-
p.id
|
|
8950
|
-
))
|
|
8951
|
-
] })
|
|
8952
|
-
] }) }) });
|
|
9131
|
+
] });
|
|
8953
9132
|
}
|
|
8954
9133
|
function ResultView({ setView }) {
|
|
8955
9134
|
useEffect(() => {
|
|
@@ -9387,7 +9566,7 @@ function ImageOptionCard({
|
|
|
9387
9566
|
);
|
|
9388
9567
|
}
|
|
9389
9568
|
const MALE_STEPS = ["basics", "chest", "midsection", "seat"];
|
|
9390
|
-
const FEMALE_STEPS = ["basics", "midsection", "seat", "hips"
|
|
9569
|
+
const FEMALE_STEPS = ["basics", "midsection", "seat", "hips"];
|
|
9391
9570
|
const BAND_SIZES = {
|
|
9392
9571
|
US: ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"],
|
|
9393
9572
|
UK: ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"],
|
|
@@ -10259,6 +10438,7 @@ function PrimeStyleTryonInner({
|
|
|
10259
10438
|
const [profileSaved, setProfileSaved] = useState(false);
|
|
10260
10439
|
const [drawer, setDrawer] = useState(null);
|
|
10261
10440
|
const [profileDetail, setProfileDetail] = useState(null);
|
|
10441
|
+
const prevViewRef = useRef(null);
|
|
10262
10442
|
const fileInputRef = useRef(null);
|
|
10263
10443
|
const apiRef = useRef(null);
|
|
10264
10444
|
const sseRef = useRef(null);
|
|
@@ -10511,6 +10691,14 @@ function PrimeStyleTryonInner({
|
|
|
10511
10691
|
onClose?.();
|
|
10512
10692
|
}, [onClose, previewUrl]);
|
|
10513
10693
|
const handleBack = useCallback(() => {
|
|
10694
|
+
if (drawer) {
|
|
10695
|
+
setDrawer(null);
|
|
10696
|
+
if (prevViewRef.current) {
|
|
10697
|
+
setView(prevViewRef.current);
|
|
10698
|
+
prevViewRef.current = null;
|
|
10699
|
+
}
|
|
10700
|
+
return;
|
|
10701
|
+
}
|
|
10514
10702
|
switch (view) {
|
|
10515
10703
|
case "body-profile":
|
|
10516
10704
|
handleClose();
|
|
@@ -10532,13 +10720,13 @@ function PrimeStyleTryonInner({
|
|
|
10532
10720
|
setView("body-profile");
|
|
10533
10721
|
break;
|
|
10534
10722
|
case "profiles":
|
|
10535
|
-
|
|
10723
|
+
handleClose();
|
|
10536
10724
|
break;
|
|
10537
10725
|
default:
|
|
10538
10726
|
handleClose();
|
|
10539
10727
|
break;
|
|
10540
10728
|
}
|
|
10541
|
-
}, [view, activeSection, handleClose]);
|
|
10729
|
+
}, [view, drawer, activeSection, handleClose]);
|
|
10542
10730
|
const showBackButton = view !== "idle" && view !== "processing" && view !== "result" && view !== "welcome" && view !== "body-profile" && view !== "size-result";
|
|
10543
10731
|
const handleFileSelect = useCallback((file) => {
|
|
10544
10732
|
if (!isValidImageFile(file)) {
|
|
@@ -11529,7 +11717,14 @@ function PrimeStyleTryonInner({
|
|
|
11529
11717
|
/* @__PURE__ */ jsxs("div", { className: cx("ps-tryon-header ps-tryon-header-minimal", cn.header), children: [
|
|
11530
11718
|
/* @__PURE__ */ jsx(LangSwitcher, { activeLocale, onSelect: setActiveLocale }),
|
|
11531
11719
|
/* @__PURE__ */ jsx("button", { className: "ps-tryon-header-icon", title: t("Profiles"), onClick: () => setView(view === "profiles" ? "body-profile" : "profiles"), children: /* @__PURE__ */ jsx(UserIcon, {}) }),
|
|
11532
|
-
/* @__PURE__ */ jsx("button", { className: "ps-tryon-header-icon", title: t("History"), onClick: () =>
|
|
11720
|
+
/* @__PURE__ */ jsx("button", { className: "ps-tryon-header-icon", title: t("History"), onClick: () => {
|
|
11721
|
+
if (drawer === "history") {
|
|
11722
|
+
setDrawer(null);
|
|
11723
|
+
} else {
|
|
11724
|
+
prevViewRef.current = view;
|
|
11725
|
+
setDrawer("history");
|
|
11726
|
+
}
|
|
11727
|
+
}, children: /* @__PURE__ */ jsx(ClockIcon, {}) }),
|
|
11533
11728
|
/* @__PURE__ */ jsx("button", { onClick: handleClose, className: cx("ps-tryon-close", cn.closeButton), children: /* @__PURE__ */ jsx(XIcon, {}) })
|
|
11534
11729
|
] }),
|
|
11535
11730
|
view !== "body-profile" && view !== "processing" && !(view === "size-result" && sizeGuide?.sections && Object.keys(sizeGuide.sections).length > 1) && /* @__PURE__ */ jsx(Stepper, { view, stepIndex }),
|