@primestyleai/tryon 5.10.0 → 5.10.1

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.
@@ -840,12 +840,15 @@ const STYLES = `
840
840
  .ps-tryon-logo-img { height: var(--ps-logo-height); width: auto; }
841
841
  .ps-tryon-header-actions { display: flex; align-items: center; gap: 0.42vw; }
842
842
  .ps-tryon-header-icon {
843
- width: 2.2vw; height: 2.2vw; display: flex; align-items: center; justify-content: center;
844
- border: 1.5px solid var(--ps-border-color); border-radius: 0.52vw; background: transparent;
843
+ /* Pure vw sizing collapsed to ~8 px on 375 px mobile. Clamp so the icon
844
+ stays finger-tappable (min 30 px) while scaling up on large screens. */
845
+ width: clamp(30px, 2.2vw, 34px); height: clamp(30px, 2.2vw, 34px);
846
+ display: flex; align-items: center; justify-content: center;
847
+ border: 1.5px solid var(--ps-border-color); border-radius: clamp(6px, 0.52vw, 10px); background: transparent;
845
848
  cursor: pointer; color: var(--ps-text-secondary); transition: all 0.2s;
846
849
  }
847
850
  .ps-tryon-header-icon:hover { border-color: var(--ps-accent); color: var(--ps-accent); }
848
- .ps-tryon-header-icon svg { stroke: currentColor; fill: none; width: 0.9vw; height: 0.9vw; }
851
+ .ps-tryon-header-icon svg { stroke: currentColor; fill: none; width: clamp(14px, 0.9vw, 16px); height: clamp(14px, 0.9vw, 16px); }
849
852
  .ps-tryon-close {
850
853
  width: 2.2vw; height: 2.2vw; display: flex; align-items: center; justify-content: center;
851
854
  background: none; border: none; color: var(--ps-modal-close-color, #999);
@@ -893,7 +896,10 @@ const STYLES = `
893
896
  }
894
897
 
895
898
  .ps-tryon-lang-list {
896
- max-height: min(18vw, 280px); overflow-y: auto; padding: clamp(3px, 0.31vw, 5px);
899
+ /* max(...) picks the larger of the two values so the dropdown is tall
900
+ enough to scroll through a handful of languages on any viewport.
901
+ Pure min(18vw, 280px) collapsed to ~67 px on 375 px mobile. */
902
+ max-height: max(260px, min(18vw, 280px)); overflow-y: auto; padding: clamp(3px, 0.31vw, 5px);
897
903
  scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent;
898
904
  }
899
905
  .ps-tryon-lang-item {
@@ -3286,6 +3292,33 @@ const STYLES = `
3286
3292
 
3287
3293
  /* ── Preserve existing previews and modal-wide overrides ── */
3288
3294
  .ps-tryon-preview { height: 320px; }
3295
+
3296
+ /* ── Drawer list (history / profiles / settings) ── */
3297
+ /* Pure vw gap (0.52vw = ~2 px on mobile) crushed list rows together. */
3298
+ .ps-tryon-drawer-list { gap: 12px !important; padding: 0 !important; }
3299
+ .ps-tryon-drawer { padding: 16px !important; }
3300
+
3301
+ /* ── Profile cards inside the sizing-profiles drawer ── */
3302
+ .ps-msp-card {
3303
+ padding: 16px !important;
3304
+ border-radius: 14px !important;
3305
+ }
3306
+ .ps-msp-card-tag { font-size: 11px !important; padding: 4px 8px !important; border-radius: 999px !important; }
3307
+ .ps-msp-card-circle { width: 72px !important; height: 72px !important; margin: 8px auto 12px !important; }
3308
+ .ps-msp-card-name { font-size: 16px !important; margin-bottom: 6px !important; }
3309
+ .ps-msp-meta-row { padding: 6px 0 !important; gap: 8px !important; }
3310
+ .ps-msp-card-meta { font-size: 12px !important; }
3311
+ .ps-msp-card-actions { gap: 8px !important; margin-top: 10px !important; }
3312
+ .ps-msp-card-select { font-size: 13px !important; padding: 10px 12px !important; border-radius: 8px !important; }
3313
+ .ps-msp-card-edit, .ps-msp-card-delete { width: 36px !important; height: 36px !important; border-radius: 8px !important; }
3314
+ .ps-msp-card-create { min-height: 120px !important; font-size: 14px !important; }
3315
+
3316
+ /* ── Language switcher dropdown ── */
3317
+ /* Default min(18vw, 280px) collapsed to ~67 px on mobile — unusable. */
3318
+ .ps-tryon-lang-list { max-height: 320px !important; }
3319
+ .ps-tryon-lang-item { padding: 10px 14px !important; gap: 10px !important; }
3320
+ .ps-tryon-lang-name { font-size: 14px !important; }
3321
+ .ps-tryon-lang-code { font-size: 11px !important; }
3289
3322
  }
3290
3323
 
3291
3324
  @keyframes ps-mobile-slide-up {
@@ -14330,7 +14363,14 @@ function PrimeStyleTryonInner({
14330
14363
  }
14331
14364
  }, [apiUrl, sizingMethod, sizingCountry, heightUnit, weightUnit, sizingUnit, sizeGuide, productTitle, dynamicFields, persistResultToProfile]);
14332
14365
  const handleQuickEstimate = useCallback(async (height, weight, heightUnit2, weightUnit2, gender, age, bodyType, chestProfile, midsectionProfile, hipProfile, bodyImage) => {
14333
- if (!apiRef.current) return;
14366
+ if (!apiRef.current) {
14367
+ const msg = t("SDK not configured. Please refresh and try again.");
14368
+ console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded.");
14369
+ setErrorMessage(msg);
14370
+ setView("error");
14371
+ onError?.({ message: msg, code: "SDK_NOT_CONFIGURED" });
14372
+ return;
14373
+ }
14334
14374
  getApiUrl(apiUrl);
14335
14375
  getApiKey();
14336
14376
  const SKIP_ESTIMATE_KEYS = /* @__PURE__ */ new Set(["weight", "weightKg", "height", "heightCm"]);
@@ -14387,7 +14427,11 @@ function PrimeStyleTryonInner({
14387
14427
  apiUrl
14388
14428
  });
14389
14429
  if (!apiRef.current || !sseRef.current) {
14430
+ const msg = t("SDK not configured. Please refresh and try again.");
14390
14431
  console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init.");
14432
+ setErrorMessage(msg);
14433
+ setView("error");
14434
+ onError?.({ message: msg, code: "SDK_NOT_CONFIGURED" });
14391
14435
  return;
14392
14436
  }
14393
14437
  const baseUrl = getApiUrl(apiUrl);