@primestyleai/tryon 4.4.0 → 4.6.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.
Files changed (66) hide show
  1. package/dist/api-client.d.ts +2 -2
  2. package/dist/i18n.d.ts +20 -0
  3. package/dist/index-J6U0-q_3.js +2638 -0
  4. package/dist/index.d.ts +2 -1
  5. package/dist/locales/ar.d.ts +2 -0
  6. package/dist/locales/da.d.ts +2 -0
  7. package/dist/locales/de.d.ts +2 -0
  8. package/dist/locales/es.d.ts +2 -0
  9. package/dist/locales/fi.d.ts +2 -0
  10. package/dist/locales/fr.d.ts +2 -0
  11. package/dist/locales/index.d.ts +1 -0
  12. package/dist/locales/it.d.ts +2 -0
  13. package/dist/locales/ja.d.ts +2 -0
  14. package/dist/locales/ko.d.ts +2 -0
  15. package/dist/locales/nb.d.ts +2 -0
  16. package/dist/locales/nl.d.ts +2 -0
  17. package/dist/locales/pl.d.ts +2 -0
  18. package/dist/locales/pt.d.ts +2 -0
  19. package/dist/locales/ru.d.ts +2 -0
  20. package/dist/locales/sv.d.ts +2 -0
  21. package/dist/locales/th.d.ts +2 -0
  22. package/dist/locales/tr.d.ts +2 -0
  23. package/dist/locales/vi.d.ts +2 -0
  24. package/dist/locales/zh.d.ts +2 -0
  25. package/dist/pose-detect.d.ts +62 -16
  26. package/dist/primestyle-tryon.css +1 -0
  27. package/dist/primestyle-tryon.js +14 -3
  28. package/dist/react/PrimeStyleTryon.d.ts +2 -0
  29. package/dist/react/PrimeStyleTryonInner.d.ts +2 -0
  30. package/dist/react/assets/body-illustrations-png.d.ts +36 -0
  31. package/dist/react/assets/body-illustrations.d.ts +36 -0
  32. package/dist/react/components/DrawerPanel.d.ts +13 -0
  33. package/dist/react/components/FullChartOverlay.d.ts +1 -0
  34. package/dist/react/components/InputRow.d.ts +9 -0
  35. package/dist/react/components/LangSwitcher.d.ts +4 -0
  36. package/dist/react/components/ProfileDetailModal.d.ts +10 -0
  37. package/dist/react/components/ProfileEditView.d.ts +8 -0
  38. package/dist/react/components/Stepper.d.ts +5 -0
  39. package/dist/react/components/UnitToggle.d.ts +8 -0
  40. package/dist/react/constants.d.ts +17 -0
  41. package/dist/react/icons.d.ts +64 -0
  42. package/dist/react/index.d.ts +3 -35
  43. package/dist/react/index.js +6330 -2394
  44. package/dist/react/styles.d.ts +1 -0
  45. package/dist/react/types.d.ts +106 -0
  46. package/dist/react/utils/classnames.d.ts +1 -0
  47. package/dist/react/utils/locale.d.ts +3 -0
  48. package/dist/react/utils/storage.d.ts +3 -0
  49. package/dist/react/utils/units.d.ts +6 -0
  50. package/dist/react/views/BodyProfileView.d.ts +41 -0
  51. package/dist/react/views/ErrorView.d.ts +8 -0
  52. package/dist/react/views/EstimationReviewView.d.ts +21 -0
  53. package/dist/react/views/HeightPickerView.d.ts +8 -0
  54. package/dist/react/views/ProcessingView.d.ts +11 -0
  55. package/dist/react/views/QuizView.d.ts +9 -0
  56. package/dist/react/views/ResultView.d.ts +4 -0
  57. package/dist/react/views/SizeResultView.d.ts +27 -0
  58. package/dist/react/views/SizingChoiceView.d.ts +37 -0
  59. package/dist/react/views/UploadView.d.ts +14 -0
  60. package/dist/react/views/WeightPickerView.d.ts +8 -0
  61. package/dist/react/views/WelcomeView.d.ts +7 -0
  62. package/dist/sizing/fit-compute.d.ts +15 -0
  63. package/dist/sizing/normalizer.d.ts +9 -33
  64. package/dist/types.d.ts +41 -0
  65. package/package.json +4 -3
  66. package/dist/index-CZHknuGH.js +0 -2993
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import "./locales";
1
2
  export { PrimeStyleTryon } from "./PrimeStyleTryon";
2
3
  export { ApiClient, PrimeStyleError } from "./api-client";
3
4
  export { SseClient } from "./sse-client";
4
5
  export { detectProductImage } from "./product-detector";
5
6
  export { compressImage, isValidImageFile } from "./image-utils";
6
- export type { PrimeStyleConfig, ButtonStyles, ModalStyles, TryOnResponse, TryOnStatus, VtoUpdate, PrimeStyleEvents, } from "./types";
7
+ export type { PrimeStyleConfig, ButtonStyles, ModalStyles, TryOnResponse, TryOnStatus, VtoUpdate, PrimeStyleEvents, FitAreaInfo, } from "./types";
7
8
  export { registerLocale, createT, SUPPORTED_LOCALES, TRANSLATION_KEYS, detectLanguage } from "./i18n";
8
9
  export type { TranslateFn } from "./i18n";
@@ -0,0 +1,2 @@
1
+ declare const ar: Record<string, string>;
2
+ export default ar;
@@ -0,0 +1,2 @@
1
+ declare const da: Record<string, string>;
2
+ export default da;
@@ -0,0 +1,2 @@
1
+ declare const de: Record<string, string>;
2
+ export default de;
@@ -0,0 +1,2 @@
1
+ declare const es: Record<string, string>;
2
+ export default es;
@@ -0,0 +1,2 @@
1
+ declare const fi: Record<string, string>;
2
+ export default fi;
@@ -0,0 +1,2 @@
1
+ declare const fr: Record<string, string>;
2
+ export default fr;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const it: Record<string, string>;
2
+ export default it;
@@ -0,0 +1,2 @@
1
+ declare const ja: Record<string, string>;
2
+ export default ja;
@@ -0,0 +1,2 @@
1
+ declare const ko: Record<string, string>;
2
+ export default ko;
@@ -0,0 +1,2 @@
1
+ declare const nb: Record<string, string>;
2
+ export default nb;
@@ -0,0 +1,2 @@
1
+ declare const nl: Record<string, string>;
2
+ export default nl;
@@ -0,0 +1,2 @@
1
+ declare const pl: Record<string, string>;
2
+ export default pl;
@@ -0,0 +1,2 @@
1
+ declare const pt: Record<string, string>;
2
+ export default pt;
@@ -0,0 +1,2 @@
1
+ declare const ru: Record<string, string>;
2
+ export default ru;
@@ -0,0 +1,2 @@
1
+ declare const sv: Record<string, string>;
2
+ export default sv;
@@ -0,0 +1,2 @@
1
+ declare const th: Record<string, string>;
2
+ export default th;
@@ -0,0 +1,2 @@
1
+ declare const tr: Record<string, string>;
2
+ export default tr;
@@ -0,0 +1,2 @@
1
+ declare const vi: Record<string, string>;
2
+ export default vi;
@@ -0,0 +1,2 @@
1
+ declare const zh: Record<string, string>;
2
+ export default zh;
@@ -1,27 +1,73 @@
1
1
  /**
2
- * Pose landmark detection using MediaPipe Pose Landmarker.
3
- * Loaded dynamically from CDN zero bundle size impact.
4
- * Returns normalized (0-1) coordinates for measurement lines.
2
+ * Pose detection using MediaPipe detects body landmarks to overlay
3
+ * measurement lines on a try-on result image.
5
4
  */
5
+ export interface MeasurementLine {
6
+ y: number;
7
+ x1: number;
8
+ x2: number;
9
+ }
6
10
  export interface MeasurementLines {
7
- chest: {
11
+ chest: MeasurementLine;
12
+ waist: MeasurementLine;
13
+ hips: MeasurementLine;
14
+ }
15
+ /** Extended landmarks for per-field measurement guides */
16
+ export interface BodyLandmarks {
17
+ leftShoulder: {
18
+ x: number;
19
+ y: number;
20
+ };
21
+ rightShoulder: {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ leftHip: {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ rightHip: {
30
+ x: number;
31
+ y: number;
32
+ };
33
+ leftElbow: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ rightElbow: {
38
+ x: number;
8
39
  y: number;
9
- x1: number;
10
- x2: number;
11
40
  };
12
- waist: {
41
+ leftWrist: {
42
+ x: number;
13
43
  y: number;
14
- x1: number;
15
- x2: number;
16
44
  };
17
- hips: {
45
+ rightWrist: {
46
+ x: number;
47
+ y: number;
48
+ };
49
+ leftKnee: {
50
+ x: number;
51
+ y: number;
52
+ };
53
+ rightKnee: {
54
+ x: number;
55
+ y: number;
56
+ };
57
+ leftAnkle: {
58
+ x: number;
59
+ y: number;
60
+ };
61
+ rightAnkle: {
62
+ x: number;
63
+ y: number;
64
+ };
65
+ nose: {
66
+ x: number;
18
67
  y: number;
19
- x1: number;
20
- x2: number;
21
68
  };
22
69
  }
23
- /**
24
- * Detect pose landmarks on an image and return measurement line positions.
25
- * Coordinates are normalized 0-1 (percentage of image width/height).
26
- */
27
70
  export declare function detectMeasurementLines(imageSrc: string): Promise<MeasurementLines | null>;
71
+ /** Detect full body landmarks for per-field measurement guides.
72
+ * Accepts a URL string OR an already-loaded HTMLImageElement to avoid CORS issues. */
73
+ export declare function detectBodyLandmarks(imageSrc: string | HTMLImageElement): Promise<BodyLandmarks | null>;
@@ -0,0 +1 @@
1
+ /* PrimeStyle Try-On — styles are injected at runtime */
@@ -1,5 +1,5 @@
1
- import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-CZHknuGH.js";
2
- import { P, b, T, d, r } from "./index-CZHknuGH.js";
1
+ import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-J6U0-q_3.js";
2
+ import { P, b, T, d, r } from "./index-J6U0-q_3.js";
3
3
  function detectProductImage() {
4
4
  const ogImage = document.querySelector(
5
5
  'meta[property="og:image"]'
@@ -996,7 +996,18 @@ class PrimeStyleTryon extends HTMLElement {
996
996
  primaryButtonTextColor: "--ps-modal-primary-color",
997
997
  primaryButtonBorderRadius: "--ps-modal-primary-radius",
998
998
  loaderColor: "--ps-loader",
999
- resultBorderRadius: "--ps-result-radius"
999
+ resultBorderRadius: "--ps-result-radius",
1000
+ accentColor: "--ps-accent",
1001
+ accentHoverColor: "--ps-accent-hover",
1002
+ accentLightColor: "--ps-accent-light",
1003
+ textPrimaryColor: "--ps-text-primary",
1004
+ textSecondaryColor: "--ps-text-secondary",
1005
+ textMutedColor: "--ps-text-muted",
1006
+ borderColor: "--ps-border-color",
1007
+ secondaryBackgroundColor: "--ps-bg-secondary",
1008
+ errorColor: "--ps-error-color",
1009
+ successColor: "--ps-success-color",
1010
+ logoHeight: "--ps-logo-height"
1000
1011
  };
1001
1012
  for (const [key, cssVar] of Object.entries(map)) {
1002
1013
  const value = this.modalStyles[key];
@@ -0,0 +1,2 @@
1
+ import type { PrimeStyleTryonProps } from "./types";
2
+ export declare function PrimeStyleTryon(props: PrimeStyleTryonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { PrimeStyleTryonProps } from "./types";
2
+ export declare function PrimeStyleTryonInner({ productImage, productTitle, buttonText, apiUrl, showPoweredBy, showIcon, buttonIcon, locale, buttonStyles: btnS, modalStyles: mdlS, classNames: cn, className, style, onOpen, onClose, onUpload, onProcessing, onComplete, onError, sizeGuideData, }: PrimeStyleTryonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ export declare const BODY_IMAGES: {
2
+ readonly female: {
3
+ readonly stomach: {
4
+ readonly flat: string;
5
+ readonly average: string;
6
+ readonly round: string;
7
+ };
8
+ readonly seat: {
9
+ readonly narrow: string;
10
+ readonly average: string;
11
+ readonly full: string;
12
+ };
13
+ readonly hips: {
14
+ readonly narrow: string;
15
+ readonly average: string;
16
+ readonly full: string;
17
+ };
18
+ };
19
+ readonly male: {
20
+ readonly chest: {
21
+ readonly narrow: string;
22
+ readonly average: string;
23
+ readonly broad: string;
24
+ };
25
+ readonly stomach: {
26
+ readonly flat: string;
27
+ readonly average: string;
28
+ readonly round: string;
29
+ };
30
+ readonly seat: {
31
+ readonly narrow: string;
32
+ readonly average: string;
33
+ readonly full: string;
34
+ };
35
+ };
36
+ };
@@ -0,0 +1,36 @@
1
+ export declare const BODY_ILLUSTRATIONS: {
2
+ readonly male: {
3
+ readonly chest: {
4
+ readonly narrow: string;
5
+ readonly average: string;
6
+ readonly broad: string;
7
+ };
8
+ readonly stomach: {
9
+ readonly flat: string;
10
+ readonly average: string;
11
+ readonly round: string;
12
+ };
13
+ readonly seat: {
14
+ readonly narrow: string;
15
+ readonly average: string;
16
+ readonly full: string;
17
+ };
18
+ };
19
+ readonly female: {
20
+ readonly hips: {
21
+ readonly narrow: string;
22
+ readonly average: string;
23
+ readonly broad: string;
24
+ };
25
+ readonly stomach: {
26
+ readonly flat: string;
27
+ readonly average: string;
28
+ readonly round: string;
29
+ };
30
+ readonly seat: {
31
+ readonly narrow: string;
32
+ readonly average: string;
33
+ readonly full: string;
34
+ };
35
+ };
36
+ };
@@ -0,0 +1,13 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { Profile, HistoryEntry, DrawerType } from "../types";
3
+ export declare function DrawerPanel({ drawer, setDrawer, profiles, setProfiles, history, setHistory, setProfileDetail, restoreHistory, t, }: {
4
+ drawer: DrawerType;
5
+ setDrawer: (d: DrawerType) => void;
6
+ profiles: Profile[];
7
+ setProfiles: React.Dispatch<React.SetStateAction<Profile[]>>;
8
+ history: HistoryEntry[];
9
+ setHistory: React.Dispatch<React.SetStateAction<HistoryEntry[]>>;
10
+ setProfileDetail: (p: Profile | null) => void;
11
+ restoreHistory: (entry: HistoryEntry) => void;
12
+ t: TranslateFn;
13
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare function InputRow({ label, fieldKey, placeholder, type, unit, formRef, updateField }: {
2
+ label: string;
3
+ fieldKey: string;
4
+ placeholder?: string;
5
+ type?: string;
6
+ unit?: string;
7
+ formRef: React.MutableRefObject<Record<string, string>>;
8
+ updateField: (key: string, val: string) => void;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function LangSwitcher({ activeLocale: current, onSelect }: {
2
+ activeLocale: string;
3
+ onSelect: (code: string) => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { Profile } from "../types";
3
+ export declare function ProfileDetailModal({ profileDetail, setProfileDetail, setProfiles, activeProfileId, setActiveProfileId, t, }: {
4
+ profileDetail: Profile | null;
5
+ setProfileDetail: (p: Profile | null) => void;
6
+ setProfiles: React.Dispatch<React.SetStateAction<Profile[]>>;
7
+ activeProfileId: string | null;
8
+ setActiveProfileId: (id: string | null) => void;
9
+ t: TranslateFn;
10
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import type { TranslateFn } from "../../i18n";
2
+ import type { Profile } from "../types";
3
+ export declare function ProfileEditView({ profile, onSave, onCancel, t, }: {
4
+ profile?: Profile | null;
5
+ onSave: (p: Omit<Profile, "id" | "createdAt">) => void;
6
+ onCancel: () => void;
7
+ t: TranslateFn;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { ViewState } from "../types";
2
+ export declare function Stepper({ view, stepIndex }: {
3
+ view: ViewState;
4
+ stepIndex: number;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ export declare function UnitToggle({ options, value, onChange }: {
2
+ options: {
3
+ label: string;
4
+ value: string;
5
+ }[];
6
+ value: string;
7
+ onChange: (v: string) => void;
8
+ }): import("react/jsx-runtime").JSX.Element;