@primestyleai/tryon 5.10.179 → 5.10.180
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.
|
@@ -11,6 +11,7 @@ interface MySizingProfilesViewProps {
|
|
|
11
11
|
onDeleteProfile?: (id: string) => void;
|
|
12
12
|
/** Called when user clicks delete — parent owns the confirmation modal */
|
|
13
13
|
onRequestDelete: (id: string) => void;
|
|
14
|
+
onLogout: () => void;
|
|
14
15
|
onClose: () => void;
|
|
15
16
|
/** Forwarded to CreateProfileWizard for the pre-upload age check. */
|
|
16
17
|
apiUrl?: string;
|
|
@@ -47,5 +48,5 @@ export declare function DeleteConfirmModal({ onConfirm, onCancel, t, }: {
|
|
|
47
48
|
onCancel: () => void;
|
|
48
49
|
t: TranslateFn;
|
|
49
50
|
}): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
export declare function MySizingProfilesView({ profiles, activeProfileId, onSelectProfile, onEditProfile, onSaveNewProfile, onSaveProfileMeasurements, onSaveBraSize, onRequestDelete, onClose, apiUrl, apiKey, onPhotoPreview, initialCreateDraft, onProfileDraftConsumed, onEstimateFromPhoto, estimatingProfileIds, t, onRegisterBackInterceptor, }: MySizingProfilesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function MySizingProfilesView({ profiles, activeProfileId, onSelectProfile, onEditProfile, onSaveNewProfile, onSaveProfileMeasurements, onSaveBraSize, onRequestDelete, onLogout, onClose, apiUrl, apiKey, onPhotoPreview, initialCreateDraft, onProfileDraftConsumed, onEstimateFromPhoto, estimatingProfileIds, t, onRegisterBackInterceptor, }: MySizingProfilesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
51
52
|
export {};
|
|
@@ -11404,6 +11404,14 @@ function setStoredProfileSession(session) {
|
|
|
11404
11404
|
} catch {
|
|
11405
11405
|
}
|
|
11406
11406
|
}
|
|
11407
|
+
function clearStoredProfileSession() {
|
|
11408
|
+
const storage = readStorage();
|
|
11409
|
+
if (!storage) return;
|
|
11410
|
+
try {
|
|
11411
|
+
storage.removeItem(SESSION_KEY);
|
|
11412
|
+
} catch {
|
|
11413
|
+
}
|
|
11414
|
+
}
|
|
11407
11415
|
function startSocialProfileLogin(provider, apiUrl) {
|
|
11408
11416
|
if (typeof window === "undefined") {
|
|
11409
11417
|
return Promise.reject(new Error("Social login must run in the browser."));
|
|
@@ -18158,7 +18166,56 @@ const STYLES = `
|
|
|
18158
18166
|
overflow-y: auto; -webkit-overflow-scrolling: touch;
|
|
18159
18167
|
padding: 4px;
|
|
18160
18168
|
}
|
|
18169
|
+
.ps-msp-home {
|
|
18170
|
+
height: 100%;
|
|
18171
|
+
min-height: 0;
|
|
18172
|
+
display: flex;
|
|
18173
|
+
flex-direction: column;
|
|
18174
|
+
gap: max(12px, 0.95vw);
|
|
18175
|
+
}
|
|
18176
|
+
.ps-msp-welcome-panel,
|
|
18177
|
+
.ps-msp-cards-panel {
|
|
18178
|
+
min-width: 0;
|
|
18179
|
+
min-height: 0;
|
|
18180
|
+
background: var(--ps-bg-primary);
|
|
18181
|
+
}
|
|
18182
|
+
.ps-msp-welcome-panel {
|
|
18183
|
+
display: flex;
|
|
18184
|
+
align-items: flex-start;
|
|
18185
|
+
justify-content: space-between;
|
|
18186
|
+
gap: max(12px, 1vw);
|
|
18187
|
+
padding: max(12px, 1vw) 0 max(12px, 0.95vw);
|
|
18188
|
+
border-bottom: 1px solid var(--ps-border-subtle);
|
|
18189
|
+
}
|
|
18190
|
+
.ps-msp-cards-panel {
|
|
18191
|
+
display: flex;
|
|
18192
|
+
flex-direction: column;
|
|
18193
|
+
overflow: hidden;
|
|
18194
|
+
flex: 1;
|
|
18195
|
+
}
|
|
18196
|
+
.ps-msp-cards-scroll {
|
|
18197
|
+
flex: 1;
|
|
18198
|
+
min-height: 0;
|
|
18199
|
+
overflow-y: auto;
|
|
18200
|
+
-webkit-overflow-scrolling: touch;
|
|
18201
|
+
padding: max(4px, 0.35vw) 0 max(8px, 0.65vw);
|
|
18202
|
+
}
|
|
18161
18203
|
.ps-msp-header { margin-bottom: max(10px, 0.85vw); }
|
|
18204
|
+
.ps-msp-header-row {
|
|
18205
|
+
display: flex;
|
|
18206
|
+
align-items: flex-start;
|
|
18207
|
+
justify-content: space-between;
|
|
18208
|
+
gap: max(10px, 0.8vw);
|
|
18209
|
+
}
|
|
18210
|
+
.ps-msp-header-copy { min-width: 0; }
|
|
18211
|
+
.ps-msp-kicker {
|
|
18212
|
+
font-size: max(9px, 0.58vw);
|
|
18213
|
+
font-weight: 800;
|
|
18214
|
+
letter-spacing: 0.12em;
|
|
18215
|
+
text-transform: uppercase;
|
|
18216
|
+
color: var(--ps-accent);
|
|
18217
|
+
margin-bottom: max(4px, 0.32vw);
|
|
18218
|
+
}
|
|
18162
18219
|
.ps-msp-title {
|
|
18163
18220
|
font-size: max(13px, 0.95vw);
|
|
18164
18221
|
font-weight: 700;
|
|
@@ -18167,16 +18224,56 @@ const STYLES = `
|
|
|
18167
18224
|
letter-spacing: -0.005em;
|
|
18168
18225
|
}
|
|
18169
18226
|
.ps-msp-subtitle {
|
|
18170
|
-
font-size: max(
|
|
18227
|
+
font-size: max(11px, 0.72vw);
|
|
18171
18228
|
color: var(--ps-text-muted);
|
|
18172
|
-
margin: 0;
|
|
18229
|
+
margin: 0;
|
|
18230
|
+
line-height: 1.55;
|
|
18231
|
+
max-width: 54ch;
|
|
18232
|
+
}
|
|
18233
|
+
.ps-msp-header-actions {
|
|
18234
|
+
display: flex;
|
|
18235
|
+
align-items: center;
|
|
18236
|
+
gap: max(8px, 0.65vw);
|
|
18237
|
+
flex-shrink: 0;
|
|
18238
|
+
}
|
|
18239
|
+
.ps-msp-primary-create {
|
|
18240
|
+
border: 0;
|
|
18241
|
+
border-radius: 999px;
|
|
18242
|
+
background: var(--ps-accent);
|
|
18243
|
+
color: #FFFFFF;
|
|
18244
|
+
font-family: inherit;
|
|
18245
|
+
font-size: max(10px, 0.66vw);
|
|
18246
|
+
font-weight: 800;
|
|
18247
|
+
padding: max(7px, 0.52vw) max(11px, 0.8vw);
|
|
18248
|
+
cursor: pointer;
|
|
18249
|
+
transition: opacity 0.15s, transform 0.15s;
|
|
18250
|
+
}
|
|
18251
|
+
.ps-msp-primary-create:hover { opacity: 0.88; }
|
|
18252
|
+
.ps-msp-primary-create:active { transform: scale(0.98); }
|
|
18253
|
+
.ps-msp-logout {
|
|
18254
|
+
flex-shrink: 0;
|
|
18255
|
+
border: 1px solid var(--ps-border-color);
|
|
18256
|
+
border-radius: 999px;
|
|
18257
|
+
background: #FFFFFF;
|
|
18258
|
+
color: #DC2626;
|
|
18259
|
+
font-family: inherit;
|
|
18260
|
+
font-size: max(10px, 0.62vw);
|
|
18261
|
+
font-weight: 700;
|
|
18262
|
+
padding: max(6px, 0.42vw) max(9px, 0.68vw);
|
|
18263
|
+
cursor: pointer;
|
|
18264
|
+
transition: border-color 0.15s, color 0.15s, background 0.15s;
|
|
18265
|
+
}
|
|
18266
|
+
.ps-msp-logout:hover {
|
|
18267
|
+
border-color: #DC2626;
|
|
18268
|
+
color: #B91C1C;
|
|
18269
|
+
background: #FEF2F2;
|
|
18173
18270
|
}
|
|
18174
18271
|
|
|
18175
18272
|
/* Card grid — compact saved profile cards */
|
|
18176
18273
|
.ps-msp-grid {
|
|
18177
18274
|
display: grid;
|
|
18178
|
-
grid-template-columns: repeat(auto-fill, minmax(max(
|
|
18179
|
-
gap: max(
|
|
18275
|
+
grid-template-columns: repeat(auto-fill, minmax(max(160px, 12vw), 1fr));
|
|
18276
|
+
gap: max(10px, 0.8vw);
|
|
18180
18277
|
margin-bottom: max(14px, 1.2vw);
|
|
18181
18278
|
}
|
|
18182
18279
|
.ps-msp-card {
|
|
@@ -18477,27 +18574,28 @@ const STYLES = `
|
|
|
18477
18574
|
}
|
|
18478
18575
|
/* When create card is the only item (no saved profiles), make it wider */
|
|
18479
18576
|
.ps-msp-grid > .ps-msp-card-create:only-child {
|
|
18480
|
-
grid-column:
|
|
18481
|
-
|
|
18482
|
-
|
|
18483
|
-
|
|
18577
|
+
grid-column: auto;
|
|
18578
|
+
width: max(150px, 12vw);
|
|
18579
|
+
min-height: max(96px, 7.4vw);
|
|
18580
|
+
max-width: max(150px, 12vw);
|
|
18581
|
+
margin: 0;
|
|
18484
18582
|
}
|
|
18485
18583
|
.ps-msp-create-icon {
|
|
18486
|
-
width: max(
|
|
18487
|
-
height: max(
|
|
18584
|
+
width: max(28px, 2.2vw);
|
|
18585
|
+
height: max(28px, 2.2vw);
|
|
18488
18586
|
background: var(--ps-accent); color: #FFFFFF;
|
|
18489
18587
|
border-radius: max(4px, 0.35vw);
|
|
18490
18588
|
display: flex; align-items: center; justify-content: center;
|
|
18491
18589
|
margin-bottom: max(6px, 0.55vw);
|
|
18492
18590
|
}
|
|
18493
18591
|
.ps-msp-create-title {
|
|
18494
|
-
font-size: max(
|
|
18592
|
+
font-size: max(10px, 0.68vw);
|
|
18495
18593
|
font-weight: 700;
|
|
18496
18594
|
color: var(--ps-text-primary);
|
|
18497
18595
|
margin-bottom: max(2px, 0.2vw);
|
|
18498
18596
|
}
|
|
18499
18597
|
.ps-msp-create-sub {
|
|
18500
|
-
font-size: max(
|
|
18598
|
+
font-size: max(7px, 0.46vw);
|
|
18501
18599
|
font-weight: 700;
|
|
18502
18600
|
letter-spacing: 0.14em; text-transform: uppercase;
|
|
18503
18601
|
color: var(--ps-text-muted);
|
|
@@ -18767,11 +18865,34 @@ const STYLES = `
|
|
|
18767
18865
|
|
|
18768
18866
|
@media (max-width: 768px) {
|
|
18769
18867
|
/* Profile card grid */
|
|
18868
|
+
.ps-msp-home {
|
|
18869
|
+
height: auto;
|
|
18870
|
+
gap: 3vw;
|
|
18871
|
+
}
|
|
18872
|
+
.ps-msp-welcome-panel {
|
|
18873
|
+
gap: 3vw;
|
|
18874
|
+
padding: 3vw 0;
|
|
18875
|
+
}
|
|
18876
|
+
.ps-msp-cards-scroll {
|
|
18877
|
+
max-height: 66vh;
|
|
18878
|
+
padding: 1vw 0 3vw;
|
|
18879
|
+
}
|
|
18880
|
+
.ps-msp-header-actions { width: 100%; gap: 2vw; }
|
|
18881
|
+
.ps-msp-primary-create { font-size: 3vw; padding: 2.4vw 3.4vw; }
|
|
18882
|
+
.ps-msp-header-actions .ps-msp-primary-create { flex: 1; }
|
|
18770
18883
|
.ps-msp-grid { grid-template-columns: 1fr; gap: 3vw; }
|
|
18771
18884
|
.ps-msp-card-create { min-height: 22vw; }
|
|
18885
|
+
.ps-msp-grid > .ps-msp-card-create:only-child {
|
|
18886
|
+
width: 46vw;
|
|
18887
|
+
max-width: 46vw;
|
|
18888
|
+
min-height: 30vw;
|
|
18889
|
+
}
|
|
18772
18890
|
.ps-msp-header { margin-bottom: 3vw; }
|
|
18891
|
+
.ps-msp-header-row { align-items: flex-start; gap: 3vw; }
|
|
18892
|
+
.ps-msp-kicker { font-size: 2.4vw; margin-bottom: 1vw; }
|
|
18773
18893
|
.ps-msp-title { font-size: 5.6vw; }
|
|
18774
18894
|
.ps-msp-subtitle { font-size: 3vw; }
|
|
18895
|
+
.ps-msp-logout { font-size: 2.8vw; padding: 2vw 2.8vw; }
|
|
18775
18896
|
.ps-msp-card { padding: 3.5vw; border-radius: 3vw; }
|
|
18776
18897
|
.ps-msp-card-tag { font-size: 2.3vw; padding: 1vw 2vw; border-radius: 1vw; }
|
|
18777
18898
|
.ps-msp-card-circle { width: 18vw; height: 18vw; margin: 2vw auto 3vw; }
|
|
@@ -28053,6 +28174,7 @@ function MySizingProfilesView({
|
|
|
28053
28174
|
onSaveProfileMeasurements,
|
|
28054
28175
|
onSaveBraSize,
|
|
28055
28176
|
onRequestDelete,
|
|
28177
|
+
onLogout,
|
|
28056
28178
|
onClose,
|
|
28057
28179
|
apiUrl,
|
|
28058
28180
|
apiKey,
|
|
@@ -28064,18 +28186,9 @@ function MySizingProfilesView({
|
|
|
28064
28186
|
t: t2,
|
|
28065
28187
|
onRegisterBackInterceptor
|
|
28066
28188
|
}) {
|
|
28067
|
-
const [creating, setCreating] = reactExports.useState(
|
|
28189
|
+
const [creating, setCreating] = reactExports.useState(false);
|
|
28068
28190
|
const [viewingId, setViewingId] = reactExports.useState(null);
|
|
28069
|
-
const handledDraftKeyRef = reactExports.useRef(initialCreateDraft?.createdAt ?? null);
|
|
28070
28191
|
const viewingProfile = viewingId ? profiles.find((p2) => p2.id === viewingId) || null : null;
|
|
28071
|
-
reactExports.useEffect(() => {
|
|
28072
|
-
if (!initialCreateDraft) return;
|
|
28073
|
-
const draftKey = initialCreateDraft.createdAt ?? "draft";
|
|
28074
|
-
if (handledDraftKeyRef.current === draftKey && creating) return;
|
|
28075
|
-
handledDraftKeyRef.current = draftKey;
|
|
28076
|
-
setViewingId(null);
|
|
28077
|
-
setCreating(true);
|
|
28078
|
-
}, [creating, initialCreateDraft]);
|
|
28079
28192
|
reactExports.useEffect(() => {
|
|
28080
28193
|
if (viewingId && !profiles.find((p2) => p2.id === viewingId)) {
|
|
28081
28194
|
setViewingId(null);
|
|
@@ -28146,12 +28259,19 @@ function MySizingProfilesView({
|
|
|
28146
28259
|
t: t2
|
|
28147
28260
|
},
|
|
28148
28261
|
`create-${initialCreateDraft?.createdAt ?? "blank"}`
|
|
28149
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
28150
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("
|
|
28151
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
28152
|
-
|
|
28262
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msp-home", children: [
|
|
28263
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "ps-msp-welcome-panel", "aria-label": t2("Profile welcome"), children: [
|
|
28264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
28265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msp-kicker", children: t2("Welcome") }),
|
|
28266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "ps-msp-title", children: t2("My Sizing Profiles") }),
|
|
28267
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-msp-subtitle", children: profiles.length > 0 ? t2("Choose a saved profile or create a new one before finding your best fit.") : t2("Create your first fit profile to save your measurements, photo, and size history.") })
|
|
28268
|
+
] }),
|
|
28269
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msp-header-actions", children: [
|
|
28270
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "ps-msp-primary-create", onClick: () => setCreating(true), children: t2("Create New Profile") }),
|
|
28271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "ps-msp-logout", onClick: onLogout, children: t2("Sign out") })
|
|
28272
|
+
] })
|
|
28153
28273
|
] }),
|
|
28154
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msp-grid", children: [
|
|
28274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "ps-msp-cards-panel", "aria-label": t2("Your profiles"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msp-cards-scroll", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msp-grid", children: [
|
|
28155
28275
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CreateProfileCard, { onClick: () => setCreating(true), t: t2 }),
|
|
28156
28276
|
profiles.map((p2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28157
28277
|
ProfileCard,
|
|
@@ -28166,7 +28286,7 @@ function MySizingProfilesView({
|
|
|
28166
28286
|
},
|
|
28167
28287
|
p2.id
|
|
28168
28288
|
))
|
|
28169
|
-
] })
|
|
28289
|
+
] }) }) })
|
|
28170
28290
|
] }) }) });
|
|
28171
28291
|
}
|
|
28172
28292
|
const googleIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cpath%20fill='%23FFC107'%20d='M43.6%2020.5H42V20H24v8h11.3C33.7%2032.7%2029.3%2036%2024%2036c-6.6%200-12-5.4-12-12s5.4-12%2012-12c3.1%200%205.9%201.2%208%203.1l5.7-5.7C34.1%206.1%2029.3%204%2024%204%2012.9%204%204%2012.9%204%2024s8.9%2020%2020%2020%2020-8.9%2020-20c0-1.3-.1-2.4-.4-3.5z'/%3e%3cpath%20fill='%23FF3D00'%20d='M6.3%2014.7l6.6%204.8C14.7%2015.1%2019%2012%2024%2012c3.1%200%205.9%201.2%208%203.1l5.7-5.7C34.1%206.1%2029.3%204%2024%204%2016.2%204%209.5%208.5%206.3%2014.7z'/%3e%3cpath%20fill='%234CAF50'%20d='M24%2044c5.2%200%209.9-2%2013.4-5.2l-6.2-5.2C29.2%2035.1%2026.7%2036%2024%2036c-5.2%200-9.6-3.3-11.3-7.8l-6.5%205C9.4%2039.6%2016.1%2044%2024%2044z'/%3e%3cpath%20fill='%231976D2'%20d='M43.6%2020.5H42V20H24v8h11.3c-.8%202.3-2.3%204.2-4.1%205.6l6.2%205.2C36.9%2039.2%2044%2034%2044%2024c0-1.3-.1-2.4-.4-3.5z'/%3e%3c/svg%3e";
|
|
@@ -32635,6 +32755,12 @@ function PrimeStyleTryonInner({
|
|
|
32635
32755
|
setProfileAuthLoadingProvider(null);
|
|
32636
32756
|
}
|
|
32637
32757
|
}, [activeProfileId, apiUrl, hydrateProfileStore, profiles, t2]);
|
|
32758
|
+
const handleProfileLogout = reactExports.useCallback(() => {
|
|
32759
|
+
clearStoredProfileSession();
|
|
32760
|
+
setProfileSession(null);
|
|
32761
|
+
setProfileAuthError(null);
|
|
32762
|
+
setProfileAuthLoadingProvider(null);
|
|
32763
|
+
}, []);
|
|
32638
32764
|
const fileInputRef = reactExports.useRef(null);
|
|
32639
32765
|
const apiRef = reactExports.useRef(null);
|
|
32640
32766
|
const sseRef = reactExports.useRef(null);
|
|
@@ -34930,6 +35056,7 @@ function PrimeStyleTryonInner({
|
|
|
34930
35056
|
lsSet("profiles", lsGet("profiles", []).filter((p2) => p2.id !== id2));
|
|
34931
35057
|
},
|
|
34932
35058
|
onRequestDelete: (id2) => setDeleteConfirmId(id2),
|
|
35059
|
+
onLogout: handleProfileLogout,
|
|
34933
35060
|
onClose: () => setView("body-profile"),
|
|
34934
35061
|
onRegisterBackInterceptor: handleRegisterProfilesBack,
|
|
34935
35062
|
t: t2
|