@primestyleai/tryon 5.10.99 → 5.10.101

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.
@@ -135,7 +135,7 @@ export interface SizeGuide {
135
135
  /** Mapping of section name → product image URL (classified by AI) */
136
136
  sectionImages?: Record<string, string>;
137
137
  }
138
- export type ViewState = "idle" | "welcome" | "body-profile" | "estimation-review" | "size-result" | "upload" | "processing" | "result" | "error" | "no-chart" | "profiles";
138
+ export type ViewState = "idle" | "welcome" | "body-profile" | "estimation-review" | "size-result" | "upload" | "photo-guide" | "processing" | "result" | "error" | "no-chart" | "profiles";
139
139
  export type DrawerType = "profiles" | "history" | null;
140
140
  export interface PrimeStyleTryonProps {
141
141
  productImage: string;
@@ -0,0 +1,18 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ /**
3
+ * Photo guide screen — mirrors the inline `showPhotoGuide` overlay inside
4
+ * SizeResultView. Used for try-on flows that don't have a size result yet
5
+ * (e.g. NoChartView's "See how it looks on you").
6
+ *
7
+ * Desktop: split — photo upload on the left, Do/Don't/Pro-Tip on the right.
8
+ * Mobile: stacked — title + preview + checklist + START TRY-ON.
9
+ */
10
+ export declare function PhotoGuideView({ measurementType, apiUrl, apiKey, onBack, onSubmit, t, }: {
11
+ measurementType?: "body" | "face" | "head" | "foot";
12
+ /** Backend URL for the age-check call (passed through to PhotoUploadZone). */
13
+ apiUrl?: string;
14
+ apiKey?: string;
15
+ onBack: () => void;
16
+ onSubmit: (file: File) => void;
17
+ t: TranslateFn;
18
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ /**
3
+ * Single source of truth for photo upload UX across the SDK. Handles:
4
+ * • drag / drop (with proper enter+over+leave+drop handlers — drop fails
5
+ * silently in Chromium without preventDefault on every event)
6
+ * • click-to-open file picker
7
+ * • optional Gemini age-check (when apiUrl + apiKey are supplied)
8
+ * • size + type validation
9
+ * • internal preview, processing spinner, rejection card
10
+ *
11
+ * Used by PhotoGuideView, SizeResultView's photo-guide overlay, and any
12
+ * other place a customer is asked for a photo. Replaces the duplicated
13
+ * handlePhotoSelect blocks in BodyProfileView / CreateProfileWizard /
14
+ * AccessorySizeView (incrementally — those still have their own state).
15
+ */
16
+ export type PhotoUploadZoneVariant = "block" | "inline";
17
+ export declare function PhotoUploadZone({ apiUrl, apiKey, previewUrl, requireAgeConfirm, ageConfirmed, disabled, hintLine, emptyTitle, variant, onPhotoAccepted, onClearPhoto, t, }: {
18
+ /** When provided with apiKey, runs Gemini age-check before accepting. */
19
+ apiUrl?: string;
20
+ apiKey?: string;
21
+ /** External preview URL (e.g. parent already has a previewUrl from an
22
+ * earlier flow). Pass null to render the empty drop state. */
23
+ previewUrl?: string | null;
24
+ /** When true, the zone refuses uploads until ageConfirmed is true. */
25
+ requireAgeConfirm?: boolean;
26
+ ageConfirmed?: boolean;
27
+ /** Disables click + drop (e.g. while parent is processing). */
28
+ disabled?: boolean;
29
+ /** Optional copy under the empty-state title. */
30
+ hintLine?: string;
31
+ /** Custom empty-state title. Defaults to "Upload your photo". */
32
+ emptyTitle?: string;
33
+ /** "block" (default) — full upload card with title/hint/icon.
34
+ * "inline" — just the drop area sized to its parent (preview-only). */
35
+ variant?: PhotoUploadZoneVariant;
36
+ /** Called with the validated File once it passes age-check + size/type
37
+ * validation. Parent is responsible for compressing or sending it. */
38
+ onPhotoAccepted: (file: File) => void;
39
+ /** Called when the user removes the current photo (via the X on preview). */
40
+ onClearPhoto?: () => void;
41
+ t: TranslateFn;
42
+ }): import("react/jsx-runtime").JSX.Element;