@primestyleai/tryon 4.3.2 → 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.
- package/dist/api-client.d.ts +2 -2
- package/dist/i18n.d.ts +20 -0
- package/dist/index-J6U0-q_3.js +2638 -0
- package/dist/index.d.ts +2 -1
- package/dist/locales/ar.d.ts +2 -0
- package/dist/locales/da.d.ts +2 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/es.d.ts +2 -0
- package/dist/locales/fi.d.ts +2 -0
- package/dist/locales/fr.d.ts +2 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/it.d.ts +2 -0
- package/dist/locales/ja.d.ts +2 -0
- package/dist/locales/ko.d.ts +2 -0
- package/dist/locales/nb.d.ts +2 -0
- package/dist/locales/nl.d.ts +2 -0
- package/dist/locales/pl.d.ts +2 -0
- package/dist/locales/pt.d.ts +2 -0
- package/dist/locales/ru.d.ts +2 -0
- package/dist/locales/sv.d.ts +2 -0
- package/dist/locales/th.d.ts +2 -0
- package/dist/locales/tr.d.ts +2 -0
- package/dist/locales/vi.d.ts +2 -0
- package/dist/locales/zh.d.ts +2 -0
- package/dist/pose-detect.d.ts +73 -0
- package/dist/primestyle-tryon.css +1 -0
- package/dist/primestyle-tryon.js +14 -3
- package/dist/react/PrimeStyleTryon.d.ts +2 -0
- package/dist/react/PrimeStyleTryonInner.d.ts +2 -0
- package/dist/react/assets/body-illustrations-png.d.ts +36 -0
- package/dist/react/assets/body-illustrations.d.ts +36 -0
- package/dist/react/components/DrawerPanel.d.ts +13 -0
- package/dist/react/components/FullChartOverlay.d.ts +1 -0
- package/dist/react/components/InputRow.d.ts +9 -0
- package/dist/react/components/LangSwitcher.d.ts +4 -0
- package/dist/react/components/ProfileDetailModal.d.ts +10 -0
- package/dist/react/components/ProfileEditView.d.ts +8 -0
- package/dist/react/components/Stepper.d.ts +5 -0
- package/dist/react/components/UnitToggle.d.ts +8 -0
- package/dist/react/constants.d.ts +17 -0
- package/dist/react/icons.d.ts +64 -0
- package/dist/react/index.d.ts +3 -35
- package/dist/react/index.js +6945 -2399
- package/dist/react/styles.d.ts +1 -0
- package/dist/react/types.d.ts +106 -0
- package/dist/react/utils/classnames.d.ts +1 -0
- package/dist/react/utils/locale.d.ts +3 -0
- package/dist/react/utils/storage.d.ts +3 -0
- package/dist/react/utils/units.d.ts +6 -0
- package/dist/react/views/BodyProfileView.d.ts +41 -0
- package/dist/react/views/ErrorView.d.ts +8 -0
- package/dist/react/views/EstimationReviewView.d.ts +21 -0
- package/dist/react/views/HeightPickerView.d.ts +8 -0
- package/dist/react/views/ProcessingView.d.ts +11 -0
- package/dist/react/views/QuizView.d.ts +9 -0
- package/dist/react/views/ResultView.d.ts +4 -0
- package/dist/react/views/SizeResultView.d.ts +27 -0
- package/dist/react/views/SizingChoiceView.d.ts +37 -0
- package/dist/react/views/UploadView.d.ts +14 -0
- package/dist/react/views/WeightPickerView.d.ts +8 -0
- package/dist/react/views/WelcomeView.d.ts +7 -0
- package/dist/sizing/fit-compute.d.ts +15 -0
- package/dist/sizing/normalizer.d.ts +9 -33
- package/dist/types.d.ts +41 -0
- package/package.json +7 -3
- package/dist/index-CILUifQv.js +0 -2991
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pose detection using MediaPipe — detects body landmarks to overlay
|
|
3
|
+
* measurement lines on a try-on result image.
|
|
4
|
+
*/
|
|
5
|
+
export interface MeasurementLine {
|
|
6
|
+
y: number;
|
|
7
|
+
x1: number;
|
|
8
|
+
x2: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MeasurementLines {
|
|
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;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
leftWrist: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
};
|
|
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;
|
|
67
|
+
y: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
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 */
|
package/dist/primestyle-tryon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-
|
|
2
|
-
import { P, b, T, d, r } from "./index-
|
|
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 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,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;
|