zakeke-configurator-react 0.0.216 → 0.0.217
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.
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
2
|
-
import { TryOnFineTuningMazingSettings, TryOnGenericFineTuningSettings, TryOnProduct, TryOnProvider, TryOnSeller, TryOnType } from "../models";
|
|
3
|
-
export declare function parseJSON(json: string): any;
|
|
4
|
-
export declare enum TryOnMode {
|
|
5
|
-
Undefined = 0,
|
|
6
|
-
TryOn = 1,
|
|
7
|
-
PDTool = 2
|
|
8
|
-
}
|
|
9
|
-
export interface TryOnViewerProps {
|
|
10
|
-
mode: TryOnMode;
|
|
11
|
-
onTimeout?: (value: boolean) => void;
|
|
12
|
-
onPDUpdated?: (pd: number) => void;
|
|
13
|
-
onClose?: () => void;
|
|
14
|
-
}
|
|
15
|
-
export interface VTryOnViewerProps {
|
|
16
|
-
className?: string;
|
|
17
|
-
provider: TryOnProvider;
|
|
18
|
-
type: TryOnType;
|
|
19
|
-
obj: Blob;
|
|
20
|
-
settings?: TryOnGenericFineTuningSettings;
|
|
21
|
-
product: TryOnProduct;
|
|
22
|
-
customer: TryOnSeller;
|
|
23
|
-
onReady?: () => void;
|
|
24
|
-
onClose?: () => void;
|
|
25
|
-
}
|
|
26
|
-
export interface TryOnPDToolProps {
|
|
27
|
-
className?: string;
|
|
28
|
-
provider: TryOnProvider;
|
|
29
|
-
product: TryOnProduct;
|
|
30
|
-
customer: TryOnSeller;
|
|
31
|
-
onReady?: () => void;
|
|
32
|
-
onPDUpdated?: (pd: number) => void;
|
|
33
|
-
onClose?: () => void;
|
|
34
|
-
}
|
|
35
|
-
export declare const TryOnViewerComponent: FunctionComponent<TryOnViewerProps>;
|
|
36
|
-
export declare const VTryOnViewerComponent: FunctionComponent<VTryOnViewerProps>;
|
|
37
|
-
export declare const TryOnPDToolComponent: FunctionComponent<TryOnPDToolProps>;
|
|
38
|
-
export declare enum MazingTryOnState {
|
|
39
|
-
Start = "",
|
|
40
|
-
WaitingAuthentication = "WAITING_AUTH",
|
|
41
|
-
AuthSuccessful = "AUTH_SUCCESS",
|
|
42
|
-
TryOnLoaded = "MODEL_LOADED",
|
|
43
|
-
AuthError = "AUTH_ERROR",
|
|
44
|
-
WebcamError = "WEBCAM_ERROR",
|
|
45
|
-
ScreenShotTaken = "SCREENSHOT_TAKEN",
|
|
46
|
-
WebcamStopped = "WEBCAM_STOPPED"
|
|
47
|
-
}
|
|
48
|
-
export declare enum MazingTryOnOutMessage {
|
|
49
|
-
StartAuthenticationTryOn = "AUTH_TRY_ON",
|
|
50
|
-
LoadTryOn = "LOAD_MODEL",
|
|
51
|
-
TakeScreenshot = "TAKE_SCREENSHOT",
|
|
52
|
-
StopWebcam = "STOP_WEBCAM"
|
|
53
|
-
}
|
|
54
|
-
export declare enum MazingPDState {
|
|
55
|
-
Start = "",
|
|
56
|
-
WaitingAuthentication = "WAITING_AUTH",
|
|
57
|
-
AuthSuccessful = "AUTH_SUCCESS",
|
|
58
|
-
PDLoaded = "PD_LOADED",
|
|
59
|
-
PDUpdated = "NEW_PD",
|
|
60
|
-
AuthError = "AUTH_ERROR",
|
|
61
|
-
PDDataNotFoundError = "PD_ERROR",
|
|
62
|
-
WebcamError = "WEBCAM_ERROR",
|
|
63
|
-
PDCountdown = "PD_COUNTDOWN",
|
|
64
|
-
PDCountdownEnd = "PD_COUNTDOWN_END",
|
|
65
|
-
WebcamStopped = "WEBCAM_STOPPED"
|
|
66
|
-
}
|
|
67
|
-
export declare enum MazingPDOutMessage {
|
|
68
|
-
StartAuthenticationPD = "AUTH_TRY_ON",
|
|
69
|
-
LoadPD = "LOAD_PD",
|
|
70
|
-
StartPD = "START_PD",
|
|
71
|
-
StopWebcam = "STOP_WEBCAM"
|
|
72
|
-
}
|
|
73
|
-
export interface MazingTryOnInMessage {
|
|
74
|
-
type: MazingFrameState;
|
|
75
|
-
value: any;
|
|
76
|
-
}
|
|
77
|
-
export interface MazingFrameProps {
|
|
78
|
-
className?: string;
|
|
79
|
-
outMessageHandler: (e: MessageEvent<any>) => void;
|
|
80
|
-
onReady?: (w: Window) => void;
|
|
81
|
-
}
|
|
82
|
-
export interface MazingTryOnProps {
|
|
83
|
-
className?: string;
|
|
84
|
-
obj: Blob;
|
|
85
|
-
product: TryOnProduct;
|
|
86
|
-
customer: TryOnSeller;
|
|
87
|
-
fineTuningSettings?: TryOnFineTuningMazingSettings;
|
|
88
|
-
initialState?: MazingTryOnInMessage;
|
|
89
|
-
closeFlag: boolean;
|
|
90
|
-
onReady?: () => void;
|
|
91
|
-
onReadyToShow?: () => void;
|
|
92
|
-
onClosed?: () => void;
|
|
93
|
-
}
|
|
94
|
-
export interface MazingPDProps {
|
|
95
|
-
className?: string;
|
|
96
|
-
product: TryOnProduct;
|
|
97
|
-
customer: TryOnSeller;
|
|
98
|
-
initialState?: MazingTryOnInMessage;
|
|
99
|
-
closeFlag: boolean;
|
|
100
|
-
onReady?: () => void;
|
|
101
|
-
onReadyToShow?: () => void;
|
|
102
|
-
onPDUpdated?: (pd: number) => void;
|
|
103
|
-
onClosed?: () => void;
|
|
104
|
-
onClose?: () => void;
|
|
105
|
-
}
|
|
106
|
-
export type MazingFrameState = MazingTryOnState | MazingPDState;
|
|
107
|
-
export declare const MazingFrameComponent: (props: MazingFrameProps) => JSX.Element;
|
|
108
|
-
export declare const MazingTryOnComponent: FunctionComponent<MazingTryOnProps>;
|
|
109
|
-
export declare const MazingPDToolComponent: FunctionComponent<MazingPDProps>;
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import { TryOnFineTuningMazingSettings, TryOnGenericFineTuningSettings, TryOnProduct, TryOnProvider, TryOnSeller, TryOnType } from "../models";
|
|
3
|
+
export declare function parseJSON(json: string): any;
|
|
4
|
+
export declare enum TryOnMode {
|
|
5
|
+
Undefined = 0,
|
|
6
|
+
TryOn = 1,
|
|
7
|
+
PDTool = 2
|
|
8
|
+
}
|
|
9
|
+
export interface TryOnViewerProps {
|
|
10
|
+
mode: TryOnMode;
|
|
11
|
+
onTimeout?: (value: boolean) => void;
|
|
12
|
+
onPDUpdated?: (pd: number) => void;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface VTryOnViewerProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
provider: TryOnProvider;
|
|
18
|
+
type: TryOnType;
|
|
19
|
+
obj: Blob;
|
|
20
|
+
settings?: TryOnGenericFineTuningSettings;
|
|
21
|
+
product: TryOnProduct;
|
|
22
|
+
customer: TryOnSeller;
|
|
23
|
+
onReady?: () => void;
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface TryOnPDToolProps {
|
|
27
|
+
className?: string;
|
|
28
|
+
provider: TryOnProvider;
|
|
29
|
+
product: TryOnProduct;
|
|
30
|
+
customer: TryOnSeller;
|
|
31
|
+
onReady?: () => void;
|
|
32
|
+
onPDUpdated?: (pd: number) => void;
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const TryOnViewerComponent: FunctionComponent<TryOnViewerProps>;
|
|
36
|
+
export declare const VTryOnViewerComponent: FunctionComponent<VTryOnViewerProps>;
|
|
37
|
+
export declare const TryOnPDToolComponent: FunctionComponent<TryOnPDToolProps>;
|
|
38
|
+
export declare enum MazingTryOnState {
|
|
39
|
+
Start = "",
|
|
40
|
+
WaitingAuthentication = "WAITING_AUTH",
|
|
41
|
+
AuthSuccessful = "AUTH_SUCCESS",
|
|
42
|
+
TryOnLoaded = "MODEL_LOADED",
|
|
43
|
+
AuthError = "AUTH_ERROR",
|
|
44
|
+
WebcamError = "WEBCAM_ERROR",
|
|
45
|
+
ScreenShotTaken = "SCREENSHOT_TAKEN",
|
|
46
|
+
WebcamStopped = "WEBCAM_STOPPED"
|
|
47
|
+
}
|
|
48
|
+
export declare enum MazingTryOnOutMessage {
|
|
49
|
+
StartAuthenticationTryOn = "AUTH_TRY_ON",
|
|
50
|
+
LoadTryOn = "LOAD_MODEL",
|
|
51
|
+
TakeScreenshot = "TAKE_SCREENSHOT",
|
|
52
|
+
StopWebcam = "STOP_WEBCAM"
|
|
53
|
+
}
|
|
54
|
+
export declare enum MazingPDState {
|
|
55
|
+
Start = "",
|
|
56
|
+
WaitingAuthentication = "WAITING_AUTH",
|
|
57
|
+
AuthSuccessful = "AUTH_SUCCESS",
|
|
58
|
+
PDLoaded = "PD_LOADED",
|
|
59
|
+
PDUpdated = "NEW_PD",
|
|
60
|
+
AuthError = "AUTH_ERROR",
|
|
61
|
+
PDDataNotFoundError = "PD_ERROR",
|
|
62
|
+
WebcamError = "WEBCAM_ERROR",
|
|
63
|
+
PDCountdown = "PD_COUNTDOWN",
|
|
64
|
+
PDCountdownEnd = "PD_COUNTDOWN_END",
|
|
65
|
+
WebcamStopped = "WEBCAM_STOPPED"
|
|
66
|
+
}
|
|
67
|
+
export declare enum MazingPDOutMessage {
|
|
68
|
+
StartAuthenticationPD = "AUTH_TRY_ON",
|
|
69
|
+
LoadPD = "LOAD_PD",
|
|
70
|
+
StartPD = "START_PD",
|
|
71
|
+
StopWebcam = "STOP_WEBCAM"
|
|
72
|
+
}
|
|
73
|
+
export interface MazingTryOnInMessage {
|
|
74
|
+
type: MazingFrameState;
|
|
75
|
+
value: any;
|
|
76
|
+
}
|
|
77
|
+
export interface MazingFrameProps {
|
|
78
|
+
className?: string;
|
|
79
|
+
outMessageHandler: (e: MessageEvent<any>) => void;
|
|
80
|
+
onReady?: (w: Window) => void;
|
|
81
|
+
}
|
|
82
|
+
export interface MazingTryOnProps {
|
|
83
|
+
className?: string;
|
|
84
|
+
obj: Blob;
|
|
85
|
+
product: TryOnProduct;
|
|
86
|
+
customer: TryOnSeller;
|
|
87
|
+
fineTuningSettings?: TryOnFineTuningMazingSettings;
|
|
88
|
+
initialState?: MazingTryOnInMessage;
|
|
89
|
+
closeFlag: boolean;
|
|
90
|
+
onReady?: () => void;
|
|
91
|
+
onReadyToShow?: () => void;
|
|
92
|
+
onClosed?: () => void;
|
|
93
|
+
}
|
|
94
|
+
export interface MazingPDProps {
|
|
95
|
+
className?: string;
|
|
96
|
+
product: TryOnProduct;
|
|
97
|
+
customer: TryOnSeller;
|
|
98
|
+
initialState?: MazingTryOnInMessage;
|
|
99
|
+
closeFlag: boolean;
|
|
100
|
+
onReady?: () => void;
|
|
101
|
+
onReadyToShow?: () => void;
|
|
102
|
+
onPDUpdated?: (pd: number) => void;
|
|
103
|
+
onClosed?: () => void;
|
|
104
|
+
onClose?: () => void;
|
|
105
|
+
}
|
|
106
|
+
export type MazingFrameState = MazingTryOnState | MazingPDState;
|
|
107
|
+
export declare const MazingFrameComponent: (props: MazingFrameProps) => JSX.Element;
|
|
108
|
+
export declare const MazingTryOnComponent: FunctionComponent<MazingTryOnProps>;
|
|
109
|
+
export declare const MazingPDToolComponent: FunctionComponent<MazingPDProps>;
|
|
@@ -1,331 +1,331 @@
|
|
|
1
|
-
import { EventMessage, ExtensionFields, NftForm, NftSettings, OnBeforeSendDataToParent, TryOnMode, VisibleEventMessage } from '.';
|
|
2
|
-
import { FocusAttributesEventListener } from '../../../3D/src';
|
|
3
|
-
import { PlatformAttributeSelection } from './integrations/Integration';
|
|
4
|
-
import { BootParameters, Camera, Composition, FontFamily, Group, ImageMacroCategory, Item, Product, ProductQuantityRule, SellerSettings, Template, TemplateMacroCategory, Translations, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller } from './models';
|
|
5
|
-
import type { Image } from './models';
|
|
6
|
-
declare global {
|
|
7
|
-
interface Window {
|
|
8
|
-
token: string;
|
|
9
|
-
isOwin: boolean;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
interface RestrictionColor {
|
|
13
|
-
colorCode: string;
|
|
14
|
-
isDefault: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface CustomPreviewSize {
|
|
17
|
-
customCartPreviewWidth: number;
|
|
18
|
-
customCartPreviewHeight: number;
|
|
19
|
-
}
|
|
20
|
-
interface ThemeCompositions {
|
|
21
|
-
name: string;
|
|
22
|
-
docID: string;
|
|
23
|
-
previewImageUrl: string;
|
|
24
|
-
tags: string[];
|
|
25
|
-
}
|
|
26
|
-
interface CurrentCompositionInfo {
|
|
27
|
-
compositionId: string | null;
|
|
28
|
-
compositionName: string | null;
|
|
29
|
-
compositionTags: string[] | null;
|
|
30
|
-
}
|
|
31
|
-
export declare class ZakekeEnvironment {
|
|
32
|
-
private booted;
|
|
33
|
-
private token;
|
|
34
|
-
private platformAttributesSelection;
|
|
35
|
-
private settings;
|
|
36
|
-
private platform;
|
|
37
|
-
private viewer;
|
|
38
|
-
private selection;
|
|
39
|
-
private integration;
|
|
40
|
-
private previewWidth;
|
|
41
|
-
private previewHeight;
|
|
42
|
-
private clientPreviewWidth;
|
|
43
|
-
private clientPreviewHeight;
|
|
44
|
-
private shareUrlPrefix;
|
|
45
|
-
private events;
|
|
46
|
-
private zkProduct;
|
|
47
|
-
private zkScene;
|
|
48
|
-
private zkCurrentTemplate;
|
|
49
|
-
private zkTemplates;
|
|
50
|
-
private internalIsFullscreen;
|
|
51
|
-
private highlightSettings;
|
|
52
|
-
private previousMeshesVisibleStates;
|
|
53
|
-
private lastCameraLocation;
|
|
54
|
-
private enableShareCompositionUrl;
|
|
55
|
-
private sharedCompositionDocId;
|
|
56
|
-
private templateId;
|
|
57
|
-
loadedComposition: {
|
|
58
|
-
templateName: string;
|
|
59
|
-
attributesOptions: Map<number, number>;
|
|
60
|
-
selectedCategoryID: number | null;
|
|
61
|
-
} | null;
|
|
62
|
-
private savedCompositions;
|
|
63
|
-
private isDraftEditor;
|
|
64
|
-
private isViewerMode;
|
|
65
|
-
private isTemplateEditor;
|
|
66
|
-
private draftCompositionDocId;
|
|
67
|
-
private initialSelection;
|
|
68
|
-
private undoStack;
|
|
69
|
-
private redoStack;
|
|
70
|
-
private pricingCalculator;
|
|
71
|
-
currentAttributesSelection: Object | null;
|
|
72
|
-
currentCompositionInfo: CurrentCompositionInfo | null;
|
|
73
|
-
private copyrightMessageLocalStorageKey;
|
|
74
|
-
private isPupillaryDistanceMandatory;
|
|
75
|
-
isAIEnabled: boolean;
|
|
76
|
-
sellerSettings: SellerSettings | null;
|
|
77
|
-
get internalProduct(): MPlaza.Model | null;
|
|
78
|
-
get internalScene(): Zakeke.Scene | null;
|
|
79
|
-
get internalCurrentTemplate(): MPlaza.Design | null | undefined;
|
|
80
|
-
themeCompositions: ThemeCompositions[] | null;
|
|
81
|
-
currency: string;
|
|
82
|
-
groups: Group[];
|
|
83
|
-
fonts: FontFamily[];
|
|
84
|
-
disableTextColors: boolean;
|
|
85
|
-
textColors: RestrictionColor[];
|
|
86
|
-
/**
|
|
87
|
-
* Get the current text default color.
|
|
88
|
-
*/
|
|
89
|
-
defaultColor: string;
|
|
90
|
-
quantity: number;
|
|
91
|
-
quantityRule: ProductQuantityRule | null;
|
|
92
|
-
culture: string;
|
|
93
|
-
productCode: string;
|
|
94
|
-
productName: string;
|
|
95
|
-
price: number;
|
|
96
|
-
isOutOfStock: boolean;
|
|
97
|
-
composition: any;
|
|
98
|
-
compositionId: string | null;
|
|
99
|
-
templates: Template[];
|
|
100
|
-
currentTemplate: Template | null;
|
|
101
|
-
product: Product | null;
|
|
102
|
-
templateMacroCategories: TemplateMacroCategory[] | null;
|
|
103
|
-
cameras: Camera[];
|
|
104
|
-
isExplodedMode: boolean;
|
|
105
|
-
isAssetsLoading: boolean;
|
|
106
|
-
additionalCustomProperties: ExtensionFields[];
|
|
107
|
-
nftSettings: NftSettings | null;
|
|
108
|
-
eventMessages: EventMessage[] | null;
|
|
109
|
-
visibleEventMessages: VisibleEventMessage[];
|
|
110
|
-
tryOnProductSettings: TryOnProduct | null;
|
|
111
|
-
tryOnSellerSettings: TryOnSeller | null;
|
|
112
|
-
pdSettings: number;
|
|
113
|
-
isInfoPointContentVisible: boolean;
|
|
114
|
-
private internalTranslations;
|
|
115
|
-
private integrationVersion;
|
|
116
|
-
translations: Translations | null;
|
|
117
|
-
useLegacyScreenshot: boolean;
|
|
118
|
-
get isFullscreenMode(): boolean;
|
|
119
|
-
get isViewerReady(): boolean;
|
|
120
|
-
constructor();
|
|
121
|
-
private parseParameters;
|
|
122
|
-
private getProduct;
|
|
123
|
-
private getScene;
|
|
124
|
-
private getComposerModels;
|
|
125
|
-
private getFonts;
|
|
126
|
-
private getSettings;
|
|
127
|
-
private getSellerSetting;
|
|
128
|
-
createQuote: (formData: any) => Promise<any>;
|
|
129
|
-
private getPrice;
|
|
130
|
-
private getTranslations;
|
|
131
|
-
private loadLocalization;
|
|
132
|
-
getTemplateMacroCategories: () => Promise<TemplateMacroCategory[]>;
|
|
133
|
-
private loadScript;
|
|
134
|
-
validationNFTEmail: (email: string) => boolean;
|
|
135
|
-
validationNFTWalletAddress: (address: string) => boolean;
|
|
136
|
-
private saveCustomerWalletInfo;
|
|
137
|
-
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
138
|
-
getCopyrightMessageAccepted: () => boolean;
|
|
139
|
-
/**
|
|
140
|
-
* @private
|
|
141
|
-
*/
|
|
142
|
-
boot: (parameters: BootParameters | null) => Promise<void>;
|
|
143
|
-
appendViewer: (container: HTMLElement) => void;
|
|
144
|
-
setHighlightSettings: (settings: {
|
|
145
|
-
color: string;
|
|
146
|
-
size: number;
|
|
147
|
-
}) => void;
|
|
148
|
-
renderDesign: () => Promise<void>;
|
|
149
|
-
private debouncedChange;
|
|
150
|
-
resize: () => void;
|
|
151
|
-
private buildRecapProps;
|
|
152
|
-
updateRecapAndExtensionField: () => void;
|
|
153
|
-
private getCurrentExtensionFields;
|
|
154
|
-
private handleSceneLoaded;
|
|
155
|
-
private getComposition;
|
|
156
|
-
private getDesign;
|
|
157
|
-
private internalLoadDesign;
|
|
158
|
-
private addHotjarScript;
|
|
159
|
-
private addGoogleTagManagerID;
|
|
160
|
-
loadComposition: (id: string | null) => Promise<void>;
|
|
161
|
-
private internalLoadComposition;
|
|
162
|
-
sync3DAndPlatformSelectionWithCurrentSelection: () => Promise<void>;
|
|
163
|
-
private cloneSelection;
|
|
164
|
-
undo: () => Promise<void>;
|
|
165
|
-
redo: () => Promise<void>;
|
|
166
|
-
reset: () => Promise<void>;
|
|
167
|
-
private handleAttributeSelectionChanged;
|
|
168
|
-
private handleAttributeEnabled;
|
|
169
|
-
private handleAttributeDisabled;
|
|
170
|
-
private handleAttributeOptionEnabled;
|
|
171
|
-
private handleAttributeOptionDisabled;
|
|
172
|
-
private setAttributeSelectionEnabled;
|
|
173
|
-
private setOptionSelectionEnabled;
|
|
174
|
-
private isOptionEnabled;
|
|
175
|
-
private updateComposition;
|
|
176
|
-
setQuantity(quantity: number): void;
|
|
177
|
-
private _updatePrice;
|
|
178
|
-
private updatePrice;
|
|
179
|
-
private buildStructure;
|
|
180
|
-
private createGroupFromSelection;
|
|
181
|
-
private createStep;
|
|
182
|
-
private createAttributeFromSelection;
|
|
183
|
-
private createOptionFromSelection;
|
|
184
|
-
private createTemplateGroupFromSelection;
|
|
185
|
-
private saveDesignBackbone;
|
|
186
|
-
private saveCompositionBackbone;
|
|
187
|
-
private trigger;
|
|
188
|
-
on: (event: string, callback: any) => void;
|
|
189
|
-
off: (event: string, callback: any) => void;
|
|
190
|
-
setTemplate: (templateId: number) => void;
|
|
191
|
-
getTemplateUploadRestrictictions: (templateId: number, areaId: number) => {
|
|
192
|
-
isUserImageAllowed: boolean;
|
|
193
|
-
isJpgAllowed: boolean;
|
|
194
|
-
isPngAllowed: boolean;
|
|
195
|
-
isSvgAllowed: boolean;
|
|
196
|
-
isPdfAllowed: boolean;
|
|
197
|
-
isEpsAllowed: boolean;
|
|
198
|
-
isPdfWithRasterAllowed: boolean;
|
|
199
|
-
};
|
|
200
|
-
private getTemplates;
|
|
201
|
-
private saveProduct;
|
|
202
|
-
private getTemplate;
|
|
203
|
-
updateView: () => void;
|
|
204
|
-
selectOption: (optionId: number) => void;
|
|
205
|
-
selectOptionsbyPrompt(prompt: string): Promise<void>;
|
|
206
|
-
focusGroup: (groupId: number) => void;
|
|
207
|
-
focusAttribute: (attributeId: number) => Promise<void>;
|
|
208
|
-
setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
209
|
-
getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
|
|
210
|
-
setCameraLocation(name: string, animate?: boolean): void;
|
|
211
|
-
private base64StringToFile;
|
|
212
|
-
saveTemplate: (templateName: string, selectedCategoryID: number | null, attributeOptions: Map<number, number>) => Promise<void>;
|
|
213
|
-
addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<void>) | undefined, legacyScreenshot?: boolean, nftForm?: NftForm) => Promise<void>;
|
|
214
|
-
zoomIn: () => void;
|
|
215
|
-
zoomOut: () => void;
|
|
216
|
-
isFullscreenEnabled: () => boolean;
|
|
217
|
-
getDesignItemsInfo(): Item[];
|
|
218
|
-
switchFullscreen: () => void;
|
|
219
|
-
openSecondScreen: () => void;
|
|
220
|
-
private extendedUpdate;
|
|
221
|
-
exportSceneToUsdz: (hash: string) => Promise<import("../../../3D/src/types").Nullable<string> | undefined>;
|
|
222
|
-
exportSceneToGlb: () => Promise<string | Blob | null>;
|
|
223
|
-
setExplodedMode: (explodedMode: boolean) => Promise<void>;
|
|
224
|
-
hasExplodedMode: () => boolean;
|
|
225
|
-
setBackgroundColor: (color: string, alpha: number) => void;
|
|
226
|
-
getCurrentSelection: () => PlatformAttributeSelection[];
|
|
227
|
-
getScreenshot: (width?: number, height?: number, legacyScreenshot?: boolean, backgroundColor?: string | null, padding?: number) => Promise<string>;
|
|
228
|
-
private fireItemsChange;
|
|
229
|
-
isAreaVisible(areaId: number): boolean;
|
|
230
|
-
removeItem: (guid: string) => Promise<void>;
|
|
231
|
-
addItemText(settings: {
|
|
232
|
-
text: string;
|
|
233
|
-
fontFamily: string;
|
|
234
|
-
}, areaId: number): Promise<void>;
|
|
235
|
-
setItemText: (guid: string, text: string) => void;
|
|
236
|
-
setItemItalic: (guid: string, italic: boolean) => void;
|
|
237
|
-
setItemBold: (guid: string, bold: boolean) => void;
|
|
238
|
-
setItemColor: (guid: string, color: string) => void;
|
|
239
|
-
setItemFontFamily: (guid: string, fontFamily: string) => Promise<void>;
|
|
240
|
-
setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
|
|
241
|
-
createImage: (file: File, progress?: ((percentage: number) => void) | undefined) => Promise<Image>;
|
|
242
|
-
createImageFromUrl: (url: string) => Promise<Image>;
|
|
243
|
-
addItemImage: (id: number, areaId: number) => Promise<void>;
|
|
244
|
-
setItemImageFromFile: (guid: string, file: File, progress?: ((percentage: number) => void) | undefined) => Promise<void>;
|
|
245
|
-
setItemImageFromBase64: (guid: string, base64: string) => Promise<void>;
|
|
246
|
-
setItemImage: (guid: string, id: number) => Promise<void>;
|
|
247
|
-
getMacroCategories: () => Promise<ImageMacroCategory[]>;
|
|
248
|
-
getImages: (categoryId: number) => Promise<Image[]>;
|
|
249
|
-
setCameraPivot(meshID: string): void;
|
|
250
|
-
resetCameraPivot(): void;
|
|
251
|
-
setCameraZoomEnabled(enabled: boolean): void;
|
|
252
|
-
setCameraByName(name: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
253
|
-
findObjectByName(name: string): BABYLON.AbstractMesh | null | undefined;
|
|
254
|
-
getPDF: () => Promise<string>;
|
|
255
|
-
private rewriteShareUrl;
|
|
256
|
-
getShareCompositionUrl: () => Promise<string>;
|
|
257
|
-
saveCompositionCopy: (isSharing?: boolean) => Promise<any>;
|
|
258
|
-
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
|
|
259
|
-
originalUrl: string;
|
|
260
|
-
rewrittenUrl: string;
|
|
261
|
-
}>;
|
|
262
|
-
isSceneArOnTheFly: () => boolean | undefined;
|
|
263
|
-
isArDeviceCompliant: () => boolean;
|
|
264
|
-
isAndroidOrIOS: () => boolean;
|
|
265
|
-
isAndroid: boolean;
|
|
266
|
-
isIOS: boolean;
|
|
267
|
-
private buildModelViewerUrl;
|
|
268
|
-
isSceneArEnabled: () => boolean;
|
|
269
|
-
private getPregeneratedARUrl;
|
|
270
|
-
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
271
|
-
getMobileArUrl: (onFlyArUrl?: string) => Promise<string | null>;
|
|
272
|
-
getMobileLocalArUrl: (onFlyArUrl?: string) => Promise<string>;
|
|
273
|
-
openArMobile: (url: string) => void;
|
|
274
|
-
private registerView;
|
|
275
|
-
getMeshIDbyName: (name: string) => string | undefined;
|
|
276
|
-
hightlightGroup(groupId: number): void;
|
|
277
|
-
highlightAttribute(attributeId: number): void;
|
|
278
|
-
/**
|
|
279
|
-
* Hide a mesh and its children and save the state
|
|
280
|
-
* @param meshId The mesh and childs to hide
|
|
281
|
-
*/
|
|
282
|
-
hideMeshAndSaveState: (meshId: string) => void;
|
|
283
|
-
/**
|
|
284
|
-
* Restore a mesh visibility state from a previous saved one (see hideMeshAndSaveState)
|
|
285
|
-
* @param meshId The mesh and childs to show
|
|
286
|
-
*/
|
|
287
|
-
restoreMeshVisibility: (meshId: string) => void;
|
|
288
|
-
/**
|
|
289
|
-
* Change opacity for a specific mesh
|
|
290
|
-
* @param meshId The mesh to change the opacity
|
|
291
|
-
* @param opacity The opacity to set
|
|
292
|
-
*/
|
|
293
|
-
setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
|
|
294
|
-
addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
|
|
295
|
-
clearListeners: () => void;
|
|
296
|
-
setCameraLocked: (isBlocked?: boolean) => void;
|
|
297
|
-
isSceneTryOnEnabled: () => boolean;
|
|
298
|
-
getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
|
|
299
|
-
private getDisableTextColors;
|
|
300
|
-
private getTextColors;
|
|
301
|
-
private getDefaultColor;
|
|
302
|
-
saveComposition: (customPreviewSize?: CustomPreviewSize, legacyScreenshot?: boolean, isSharing?: boolean) => Promise<void>;
|
|
303
|
-
private bootstrapComposition;
|
|
304
|
-
loadSavedComposition: (docID: string) => Promise<void>;
|
|
305
|
-
private updateSavedCompositions;
|
|
306
|
-
themeCompositionsFromSavedCompositions: (compositions: Composition[]) => {
|
|
307
|
-
name: string;
|
|
308
|
-
docID: string;
|
|
309
|
-
previewImageUrl: string;
|
|
310
|
-
tags: string[];
|
|
311
|
-
}[];
|
|
312
|
-
saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
|
|
313
|
-
deleteSavedComposition: (docId: string) => Promise<void>;
|
|
314
|
-
applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
|
|
315
|
-
configureByAI: (text: string) => Promise<void>;
|
|
316
|
-
getTryOnProductInfo: () => Promise<TryOnProduct | null>;
|
|
317
|
-
getTryOnSellerInfo: (typeID: number, providerID: number) => Promise<TryOnSeller | null>;
|
|
318
|
-
get hasVTryOnEnabled(): boolean;
|
|
319
|
-
get canUseTryOn(): boolean;
|
|
320
|
-
get canUsePD(): boolean;
|
|
321
|
-
get isVisibleMeshShownForTryOn(): boolean;
|
|
322
|
-
get isMandatoryPD(): boolean;
|
|
323
|
-
get isTryOnMeshVisible(): boolean;
|
|
324
|
-
get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
|
|
325
|
-
setPDDistance: (distance: number) => void;
|
|
326
|
-
pdDistance: () => number;
|
|
327
|
-
exportTryOnMesh: () => Promise<Blob | null>;
|
|
328
|
-
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
329
|
-
tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
|
|
330
|
-
}
|
|
331
|
-
export {};
|
|
1
|
+
import { EventMessage, ExtensionFields, NftForm, NftSettings, OnBeforeSendDataToParent, TryOnMode, VisibleEventMessage } from '.';
|
|
2
|
+
import { FocusAttributesEventListener } from '../../../3D/src';
|
|
3
|
+
import { PlatformAttributeSelection } from './integrations/Integration';
|
|
4
|
+
import { BootParameters, Camera, Composition, FontFamily, Group, ImageMacroCategory, Item, Product, ProductQuantityRule, SellerSettings, Template, TemplateMacroCategory, Translations, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller } from './models';
|
|
5
|
+
import type { Image } from './models';
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
token: string;
|
|
9
|
+
isOwin: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
interface RestrictionColor {
|
|
13
|
+
colorCode: string;
|
|
14
|
+
isDefault: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface CustomPreviewSize {
|
|
17
|
+
customCartPreviewWidth: number;
|
|
18
|
+
customCartPreviewHeight: number;
|
|
19
|
+
}
|
|
20
|
+
interface ThemeCompositions {
|
|
21
|
+
name: string;
|
|
22
|
+
docID: string;
|
|
23
|
+
previewImageUrl: string;
|
|
24
|
+
tags: string[];
|
|
25
|
+
}
|
|
26
|
+
interface CurrentCompositionInfo {
|
|
27
|
+
compositionId: string | null;
|
|
28
|
+
compositionName: string | null;
|
|
29
|
+
compositionTags: string[] | null;
|
|
30
|
+
}
|
|
31
|
+
export declare class ZakekeEnvironment {
|
|
32
|
+
private booted;
|
|
33
|
+
private token;
|
|
34
|
+
private platformAttributesSelection;
|
|
35
|
+
private settings;
|
|
36
|
+
private platform;
|
|
37
|
+
private viewer;
|
|
38
|
+
private selection;
|
|
39
|
+
private integration;
|
|
40
|
+
private previewWidth;
|
|
41
|
+
private previewHeight;
|
|
42
|
+
private clientPreviewWidth;
|
|
43
|
+
private clientPreviewHeight;
|
|
44
|
+
private shareUrlPrefix;
|
|
45
|
+
private events;
|
|
46
|
+
private zkProduct;
|
|
47
|
+
private zkScene;
|
|
48
|
+
private zkCurrentTemplate;
|
|
49
|
+
private zkTemplates;
|
|
50
|
+
private internalIsFullscreen;
|
|
51
|
+
private highlightSettings;
|
|
52
|
+
private previousMeshesVisibleStates;
|
|
53
|
+
private lastCameraLocation;
|
|
54
|
+
private enableShareCompositionUrl;
|
|
55
|
+
private sharedCompositionDocId;
|
|
56
|
+
private templateId;
|
|
57
|
+
loadedComposition: {
|
|
58
|
+
templateName: string;
|
|
59
|
+
attributesOptions: Map<number, number>;
|
|
60
|
+
selectedCategoryID: number | null;
|
|
61
|
+
} | null;
|
|
62
|
+
private savedCompositions;
|
|
63
|
+
private isDraftEditor;
|
|
64
|
+
private isViewerMode;
|
|
65
|
+
private isTemplateEditor;
|
|
66
|
+
private draftCompositionDocId;
|
|
67
|
+
private initialSelection;
|
|
68
|
+
private undoStack;
|
|
69
|
+
private redoStack;
|
|
70
|
+
private pricingCalculator;
|
|
71
|
+
currentAttributesSelection: Object | null;
|
|
72
|
+
currentCompositionInfo: CurrentCompositionInfo | null;
|
|
73
|
+
private copyrightMessageLocalStorageKey;
|
|
74
|
+
private isPupillaryDistanceMandatory;
|
|
75
|
+
isAIEnabled: boolean;
|
|
76
|
+
sellerSettings: SellerSettings | null;
|
|
77
|
+
get internalProduct(): MPlaza.Model | null;
|
|
78
|
+
get internalScene(): Zakeke.Scene | null;
|
|
79
|
+
get internalCurrentTemplate(): MPlaza.Design | null | undefined;
|
|
80
|
+
themeCompositions: ThemeCompositions[] | null;
|
|
81
|
+
currency: string;
|
|
82
|
+
groups: Group[];
|
|
83
|
+
fonts: FontFamily[];
|
|
84
|
+
disableTextColors: boolean;
|
|
85
|
+
textColors: RestrictionColor[];
|
|
86
|
+
/**
|
|
87
|
+
* Get the current text default color.
|
|
88
|
+
*/
|
|
89
|
+
defaultColor: string;
|
|
90
|
+
quantity: number;
|
|
91
|
+
quantityRule: ProductQuantityRule | null;
|
|
92
|
+
culture: string;
|
|
93
|
+
productCode: string;
|
|
94
|
+
productName: string;
|
|
95
|
+
price: number;
|
|
96
|
+
isOutOfStock: boolean;
|
|
97
|
+
composition: any;
|
|
98
|
+
compositionId: string | null;
|
|
99
|
+
templates: Template[];
|
|
100
|
+
currentTemplate: Template | null;
|
|
101
|
+
product: Product | null;
|
|
102
|
+
templateMacroCategories: TemplateMacroCategory[] | null;
|
|
103
|
+
cameras: Camera[];
|
|
104
|
+
isExplodedMode: boolean;
|
|
105
|
+
isAssetsLoading: boolean;
|
|
106
|
+
additionalCustomProperties: ExtensionFields[];
|
|
107
|
+
nftSettings: NftSettings | null;
|
|
108
|
+
eventMessages: EventMessage[] | null;
|
|
109
|
+
visibleEventMessages: VisibleEventMessage[];
|
|
110
|
+
tryOnProductSettings: TryOnProduct | null;
|
|
111
|
+
tryOnSellerSettings: TryOnSeller | null;
|
|
112
|
+
pdSettings: number;
|
|
113
|
+
isInfoPointContentVisible: boolean;
|
|
114
|
+
private internalTranslations;
|
|
115
|
+
private integrationVersion;
|
|
116
|
+
translations: Translations | null;
|
|
117
|
+
useLegacyScreenshot: boolean;
|
|
118
|
+
get isFullscreenMode(): boolean;
|
|
119
|
+
get isViewerReady(): boolean;
|
|
120
|
+
constructor();
|
|
121
|
+
private parseParameters;
|
|
122
|
+
private getProduct;
|
|
123
|
+
private getScene;
|
|
124
|
+
private getComposerModels;
|
|
125
|
+
private getFonts;
|
|
126
|
+
private getSettings;
|
|
127
|
+
private getSellerSetting;
|
|
128
|
+
createQuote: (formData: any) => Promise<any>;
|
|
129
|
+
private getPrice;
|
|
130
|
+
private getTranslations;
|
|
131
|
+
private loadLocalization;
|
|
132
|
+
getTemplateMacroCategories: () => Promise<TemplateMacroCategory[]>;
|
|
133
|
+
private loadScript;
|
|
134
|
+
validationNFTEmail: (email: string) => boolean;
|
|
135
|
+
validationNFTWalletAddress: (address: string) => boolean;
|
|
136
|
+
private saveCustomerWalletInfo;
|
|
137
|
+
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
138
|
+
getCopyrightMessageAccepted: () => boolean;
|
|
139
|
+
/**
|
|
140
|
+
* @private
|
|
141
|
+
*/
|
|
142
|
+
boot: (parameters: BootParameters | null) => Promise<void>;
|
|
143
|
+
appendViewer: (container: HTMLElement) => void;
|
|
144
|
+
setHighlightSettings: (settings: {
|
|
145
|
+
color: string;
|
|
146
|
+
size: number;
|
|
147
|
+
}) => void;
|
|
148
|
+
renderDesign: () => Promise<void>;
|
|
149
|
+
private debouncedChange;
|
|
150
|
+
resize: () => void;
|
|
151
|
+
private buildRecapProps;
|
|
152
|
+
updateRecapAndExtensionField: () => void;
|
|
153
|
+
private getCurrentExtensionFields;
|
|
154
|
+
private handleSceneLoaded;
|
|
155
|
+
private getComposition;
|
|
156
|
+
private getDesign;
|
|
157
|
+
private internalLoadDesign;
|
|
158
|
+
private addHotjarScript;
|
|
159
|
+
private addGoogleTagManagerID;
|
|
160
|
+
loadComposition: (id: string | null) => Promise<void>;
|
|
161
|
+
private internalLoadComposition;
|
|
162
|
+
sync3DAndPlatformSelectionWithCurrentSelection: () => Promise<void>;
|
|
163
|
+
private cloneSelection;
|
|
164
|
+
undo: () => Promise<void>;
|
|
165
|
+
redo: () => Promise<void>;
|
|
166
|
+
reset: () => Promise<void>;
|
|
167
|
+
private handleAttributeSelectionChanged;
|
|
168
|
+
private handleAttributeEnabled;
|
|
169
|
+
private handleAttributeDisabled;
|
|
170
|
+
private handleAttributeOptionEnabled;
|
|
171
|
+
private handleAttributeOptionDisabled;
|
|
172
|
+
private setAttributeSelectionEnabled;
|
|
173
|
+
private setOptionSelectionEnabled;
|
|
174
|
+
private isOptionEnabled;
|
|
175
|
+
private updateComposition;
|
|
176
|
+
setQuantity(quantity: number): void;
|
|
177
|
+
private _updatePrice;
|
|
178
|
+
private updatePrice;
|
|
179
|
+
private buildStructure;
|
|
180
|
+
private createGroupFromSelection;
|
|
181
|
+
private createStep;
|
|
182
|
+
private createAttributeFromSelection;
|
|
183
|
+
private createOptionFromSelection;
|
|
184
|
+
private createTemplateGroupFromSelection;
|
|
185
|
+
private saveDesignBackbone;
|
|
186
|
+
private saveCompositionBackbone;
|
|
187
|
+
private trigger;
|
|
188
|
+
on: (event: string, callback: any) => void;
|
|
189
|
+
off: (event: string, callback: any) => void;
|
|
190
|
+
setTemplate: (templateId: number) => void;
|
|
191
|
+
getTemplateUploadRestrictictions: (templateId: number, areaId: number) => {
|
|
192
|
+
isUserImageAllowed: boolean;
|
|
193
|
+
isJpgAllowed: boolean;
|
|
194
|
+
isPngAllowed: boolean;
|
|
195
|
+
isSvgAllowed: boolean;
|
|
196
|
+
isPdfAllowed: boolean;
|
|
197
|
+
isEpsAllowed: boolean;
|
|
198
|
+
isPdfWithRasterAllowed: boolean;
|
|
199
|
+
};
|
|
200
|
+
private getTemplates;
|
|
201
|
+
private saveProduct;
|
|
202
|
+
private getTemplate;
|
|
203
|
+
updateView: () => void;
|
|
204
|
+
selectOption: (optionId: number) => void;
|
|
205
|
+
selectOptionsbyPrompt(prompt: string): Promise<void>;
|
|
206
|
+
focusGroup: (groupId: number) => void;
|
|
207
|
+
focusAttribute: (attributeId: number) => Promise<void>;
|
|
208
|
+
setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
209
|
+
getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
|
|
210
|
+
setCameraLocation(name: string, animate?: boolean): void;
|
|
211
|
+
private base64StringToFile;
|
|
212
|
+
saveTemplate: (templateName: string, selectedCategoryID: number | null, attributeOptions: Map<number, number>) => Promise<void>;
|
|
213
|
+
addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<void>) | undefined, legacyScreenshot?: boolean, nftForm?: NftForm) => Promise<void>;
|
|
214
|
+
zoomIn: () => void;
|
|
215
|
+
zoomOut: () => void;
|
|
216
|
+
isFullscreenEnabled: () => boolean;
|
|
217
|
+
getDesignItemsInfo(): Item[];
|
|
218
|
+
switchFullscreen: () => void;
|
|
219
|
+
openSecondScreen: () => void;
|
|
220
|
+
private extendedUpdate;
|
|
221
|
+
exportSceneToUsdz: (hash: string) => Promise<import("../../../3D/src/types").Nullable<string> | undefined>;
|
|
222
|
+
exportSceneToGlb: () => Promise<string | Blob | null>;
|
|
223
|
+
setExplodedMode: (explodedMode: boolean) => Promise<void>;
|
|
224
|
+
hasExplodedMode: () => boolean;
|
|
225
|
+
setBackgroundColor: (color: string, alpha: number) => void;
|
|
226
|
+
getCurrentSelection: () => PlatformAttributeSelection[];
|
|
227
|
+
getScreenshot: (width?: number, height?: number, legacyScreenshot?: boolean, backgroundColor?: string | null, padding?: number) => Promise<string>;
|
|
228
|
+
private fireItemsChange;
|
|
229
|
+
isAreaVisible(areaId: number): boolean;
|
|
230
|
+
removeItem: (guid: string) => Promise<void>;
|
|
231
|
+
addItemText(settings: {
|
|
232
|
+
text: string;
|
|
233
|
+
fontFamily: string;
|
|
234
|
+
}, areaId: number): Promise<void>;
|
|
235
|
+
setItemText: (guid: string, text: string) => void;
|
|
236
|
+
setItemItalic: (guid: string, italic: boolean) => void;
|
|
237
|
+
setItemBold: (guid: string, bold: boolean) => void;
|
|
238
|
+
setItemColor: (guid: string, color: string) => void;
|
|
239
|
+
setItemFontFamily: (guid: string, fontFamily: string) => Promise<void>;
|
|
240
|
+
setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
|
|
241
|
+
createImage: (file: File, progress?: ((percentage: number) => void) | undefined) => Promise<Image>;
|
|
242
|
+
createImageFromUrl: (url: string) => Promise<Image>;
|
|
243
|
+
addItemImage: (id: number, areaId: number) => Promise<void>;
|
|
244
|
+
setItemImageFromFile: (guid: string, file: File, progress?: ((percentage: number) => void) | undefined) => Promise<void>;
|
|
245
|
+
setItemImageFromBase64: (guid: string, base64: string) => Promise<void>;
|
|
246
|
+
setItemImage: (guid: string, id: number) => Promise<void>;
|
|
247
|
+
getMacroCategories: () => Promise<ImageMacroCategory[]>;
|
|
248
|
+
getImages: (categoryId: number) => Promise<Image[]>;
|
|
249
|
+
setCameraPivot(meshID: string): void;
|
|
250
|
+
resetCameraPivot(): void;
|
|
251
|
+
setCameraZoomEnabled(enabled: boolean): void;
|
|
252
|
+
setCameraByName(name: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
253
|
+
findObjectByName(name: string): BABYLON.AbstractMesh | null | undefined;
|
|
254
|
+
getPDF: () => Promise<string>;
|
|
255
|
+
private rewriteShareUrl;
|
|
256
|
+
getShareCompositionUrl: () => Promise<string>;
|
|
257
|
+
saveCompositionCopy: (isSharing?: boolean) => Promise<any>;
|
|
258
|
+
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
|
|
259
|
+
originalUrl: string;
|
|
260
|
+
rewrittenUrl: string;
|
|
261
|
+
}>;
|
|
262
|
+
isSceneArOnTheFly: () => boolean | undefined;
|
|
263
|
+
isArDeviceCompliant: () => boolean;
|
|
264
|
+
isAndroidOrIOS: () => boolean;
|
|
265
|
+
isAndroid: boolean;
|
|
266
|
+
isIOS: boolean;
|
|
267
|
+
private buildModelViewerUrl;
|
|
268
|
+
isSceneArEnabled: () => boolean;
|
|
269
|
+
private getPregeneratedARUrl;
|
|
270
|
+
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
271
|
+
getMobileArUrl: (onFlyArUrl?: string) => Promise<string | null>;
|
|
272
|
+
getMobileLocalArUrl: (onFlyArUrl?: string) => Promise<string>;
|
|
273
|
+
openArMobile: (url: string) => void;
|
|
274
|
+
private registerView;
|
|
275
|
+
getMeshIDbyName: (name: string) => string | undefined;
|
|
276
|
+
hightlightGroup(groupId: number): void;
|
|
277
|
+
highlightAttribute(attributeId: number): void;
|
|
278
|
+
/**
|
|
279
|
+
* Hide a mesh and its children and save the state
|
|
280
|
+
* @param meshId The mesh and childs to hide
|
|
281
|
+
*/
|
|
282
|
+
hideMeshAndSaveState: (meshId: string) => void;
|
|
283
|
+
/**
|
|
284
|
+
* Restore a mesh visibility state from a previous saved one (see hideMeshAndSaveState)
|
|
285
|
+
* @param meshId The mesh and childs to show
|
|
286
|
+
*/
|
|
287
|
+
restoreMeshVisibility: (meshId: string) => void;
|
|
288
|
+
/**
|
|
289
|
+
* Change opacity for a specific mesh
|
|
290
|
+
* @param meshId The mesh to change the opacity
|
|
291
|
+
* @param opacity The opacity to set
|
|
292
|
+
*/
|
|
293
|
+
setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
|
|
294
|
+
addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
|
|
295
|
+
clearListeners: () => void;
|
|
296
|
+
setCameraLocked: (isBlocked?: boolean) => void;
|
|
297
|
+
isSceneTryOnEnabled: () => boolean;
|
|
298
|
+
getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
|
|
299
|
+
private getDisableTextColors;
|
|
300
|
+
private getTextColors;
|
|
301
|
+
private getDefaultColor;
|
|
302
|
+
saveComposition: (customPreviewSize?: CustomPreviewSize, legacyScreenshot?: boolean, isSharing?: boolean) => Promise<void>;
|
|
303
|
+
private bootstrapComposition;
|
|
304
|
+
loadSavedComposition: (docID: string) => Promise<void>;
|
|
305
|
+
private updateSavedCompositions;
|
|
306
|
+
themeCompositionsFromSavedCompositions: (compositions: Composition[]) => {
|
|
307
|
+
name: string;
|
|
308
|
+
docID: string;
|
|
309
|
+
previewImageUrl: string;
|
|
310
|
+
tags: string[];
|
|
311
|
+
}[];
|
|
312
|
+
saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
|
|
313
|
+
deleteSavedComposition: (docId: string) => Promise<void>;
|
|
314
|
+
applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
|
|
315
|
+
configureByAI: (text: string) => Promise<void>;
|
|
316
|
+
getTryOnProductInfo: () => Promise<TryOnProduct | null>;
|
|
317
|
+
getTryOnSellerInfo: (typeID: number, providerID: number) => Promise<TryOnSeller | null>;
|
|
318
|
+
get hasVTryOnEnabled(): boolean;
|
|
319
|
+
get canUseTryOn(): boolean;
|
|
320
|
+
get canUsePD(): boolean;
|
|
321
|
+
get isVisibleMeshShownForTryOn(): boolean;
|
|
322
|
+
get isMandatoryPD(): boolean;
|
|
323
|
+
get isTryOnMeshVisible(): boolean;
|
|
324
|
+
get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
|
|
325
|
+
setPDDistance: (distance: number) => void;
|
|
326
|
+
pdDistance: () => number;
|
|
327
|
+
exportTryOnMesh: () => Promise<Blob | null>;
|
|
328
|
+
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
329
|
+
tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
|
|
330
|
+
}
|
|
331
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
2
|
-
import { Item } from "../models";
|
|
3
|
-
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
4
|
-
export default class MerchantIntegrationGeneric implements Integration {
|
|
5
|
-
private readonly callbacks;
|
|
6
|
-
private messageIds;
|
|
7
|
-
private pricingCalculator;
|
|
8
|
-
constructor();
|
|
9
|
-
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: any, shopifyNFTPrice: number): void;
|
|
10
|
-
getPrice(composition: any, design: any, model: any, attributes: any, compositionPrice: any, isCustomPricingConfiguratorEnabled: any, isCustomPricingRuleBasedEnabled: any, quantity: number): Promise<number>;
|
|
11
|
-
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
-
url: string;
|
|
13
|
-
}>;
|
|
14
|
-
close(): void;
|
|
15
|
-
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
16
|
-
}
|
|
1
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
2
|
+
import { Item } from "../models";
|
|
3
|
+
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
4
|
+
export default class MerchantIntegrationGeneric implements Integration {
|
|
5
|
+
private readonly callbacks;
|
|
6
|
+
private messageIds;
|
|
7
|
+
private pricingCalculator;
|
|
8
|
+
constructor();
|
|
9
|
+
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: any, shopifyNFTPrice: number): void;
|
|
10
|
+
getPrice(composition: any, design: any, model: any, attributes: any, compositionPrice: any, isCustomPricingConfiguratorEnabled: any, isCustomPricingRuleBasedEnabled: any, quantity: number): Promise<number>;
|
|
11
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
+
url: string;
|
|
13
|
+
}>;
|
|
14
|
+
close(): void;
|
|
15
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
16
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -33005,9 +33005,9 @@ var DracoCompression = /*#__PURE__*/function () {
|
|
|
33005
33005
|
}();
|
|
33006
33006
|
/**
|
|
33007
33007
|
* The configuration. Defaults to the following urls:
|
|
33008
|
-
* - wasmUrl: "https://
|
|
33009
|
-
* - wasmBinaryUrl: "https://
|
|
33010
|
-
* - fallbackUrl: "https://
|
|
33008
|
+
* - wasmUrl: "https://cdn.zakeke.com/cdn/Scripts/draco/1.3.4/rev.1/draco_wasm_wrapper.js"
|
|
33009
|
+
* - wasmBinaryUrl: "https://cdn.zakeke.com/cdn/Scripts/draco/1.3.4/rev.1/draco_decoder.wasm"
|
|
33010
|
+
* - fallbackUrl: "https://cdn.zakeke.com/cdn/Scripts/draco/1.3.4/rev.1/draco_decoder.js"
|
|
33011
33011
|
*/
|
|
33012
33012
|
_defineProperty(DracoCompression, "Configuration", {
|
|
33013
33013
|
decoder: {
|
|
@@ -47071,6 +47071,7 @@ _defineProperty(DefaultAssetUrls, "Environment", {
|
|
|
47071
47071
|
GroundTextureCDNUrl: "https://cdn.zakeke.com/cdn/3d/assets/environments/backgroundGround9.png",
|
|
47072
47072
|
SkyboxTextureCDNUrl: "https://cdn.zakeke.com/cdn/3d/assets/environments/backgroundSkybox.dds",
|
|
47073
47073
|
//EnvironmentTextureCDNUrl: "https://zakekecdn.azureedge.net/cdn/3d/assets/environments/environmentSpecular.dds"
|
|
47074
|
+
//EnvironmentTextureCDNUrl: "https://cdn.zakeke.com/cdn/3d/assets/environments/environmentSpecular.dds"
|
|
47074
47075
|
EnvironmentTextureCDNUrl: "https://zakekecdn.blob.core.windows.net/cdn/3d/assets/environments/environmentSpecular_0af79b7524dc4cd4825eae49c5d9e22fae220fd.env"
|
|
47075
47076
|
});
|
|
47076
47077
|
_defineProperty(DefaultAssetUrls, "Tryon", {
|
|
@@ -61403,14 +61404,7 @@ var ZakekeViewer = function ZakekeViewer(_ref) {
|
|
|
61403
61404
|
isViewerReady = _useZakeke.isViewerReady,
|
|
61404
61405
|
internalAppendViewer = _useZakeke.internalAppendViewer;
|
|
61405
61406
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
61406
|
-
if (isViewerReady)
|
|
61407
|
-
internalAppendViewer(document.getElementById('zakeke-viewer-container-' + guid));
|
|
61408
|
-
/* const element = new HTMLDivElement();
|
|
61409
|
-
element.className = 'zakeke-tryon-container';
|
|
61410
|
-
document.getElementById('zakeke-viewer-container-' + guid)!.appendChild(
|
|
61411
|
-
element
|
|
61412
|
-
) */
|
|
61413
|
-
}
|
|
61407
|
+
if (isViewerReady) internalAppendViewer(document.getElementById('zakeke-viewer-container-' + guid));
|
|
61414
61408
|
}, [isViewerReady]);
|
|
61415
61409
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(ZakekeViewerContainer, {
|
|
61416
61410
|
id: 'zakeke-viewer-container-' + guid,
|
|
@@ -61607,7 +61601,7 @@ var BanubaTryOnBaseResponseMessage = {
|
|
|
61607
61601
|
var BanubaTryOnResponseMessage = _objectSpread(_objectSpread({}, _tryOnModels__WEBPACK_IMPORTED_MODULE_2__.TryOnBaseProviderResponseMessage), BanubaTryOnBaseResponseMessage);
|
|
61608
61602
|
//#endregion
|
|
61609
61603
|
|
|
61610
|
-
var BanubaTryOnComponentContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n"])));
|
|
61604
|
+
var BanubaTryOnComponentContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tdisplay: flex;\n\t& .tryon-banuba-frame {\n\t\twidth: 77%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\toutline: none;\n\t\tmargin: auto;\n\t}\n"])));
|
|
61611
61605
|
|
|
61612
61606
|
// #region virtual try on
|
|
61613
61607
|
|
|
@@ -61688,7 +61682,7 @@ var BanubaTryOn = function BanubaTryOn(props) {
|
|
|
61688
61682
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(BanubaTryOnComponentContainer, {
|
|
61689
61683
|
className: "Banuba-tryon ".concat(props.className ? props.className : '')
|
|
61690
61684
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tryOnFrame__WEBPACK_IMPORTED_MODULE_4__.TryOnFrame, {
|
|
61691
|
-
providerTitle: "
|
|
61685
|
+
providerTitle: "banuba",
|
|
61692
61686
|
providerUrl: Zakeke.config.banubaSettings.url,
|
|
61693
61687
|
onReady: function onReady(w) {
|
|
61694
61688
|
var _props$onReady;
|
|
@@ -61779,7 +61773,7 @@ var MazingPupillaryDistanceBaseResponseMessage = {
|
|
|
61779
61773
|
var MazingPupillaryDistanceResponseMessage = _objectSpread(_objectSpread({}, _tryOnModels__WEBPACK_IMPORTED_MODULE_2__.PupillaryDistanceBaseProviderResponseMessage), MazingPupillaryDistanceBaseResponseMessage);
|
|
61780
61774
|
//#endregion
|
|
61781
61775
|
|
|
61782
|
-
var MazingTryOnComponentContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n"])));
|
|
61776
|
+
var MazingTryOnComponentContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tdisplay: flex;\n"])));
|
|
61783
61777
|
|
|
61784
61778
|
// #region virtual try on
|
|
61785
61779
|
|
|
@@ -61990,7 +61984,7 @@ var MazingPupillaryDistance = function MazingPupillaryDistance(props) {
|
|
|
61990
61984
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MazingTryOnComponentContainer, {
|
|
61991
61985
|
className: "mazing-pd ".concat(props.className ? props.className : "")
|
|
61992
61986
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tryOnFrame__WEBPACK_IMPORTED_MODULE_4__.TryOnFrame, {
|
|
61993
|
-
providerTitle: "
|
|
61987
|
+
providerTitle: "mazing",
|
|
61994
61988
|
providerUrl: Zakeke.config.mazingSettings.url,
|
|
61995
61989
|
onReady: function onReady(w) {
|
|
61996
61990
|
var _props$onReady2;
|
|
@@ -67968,6 +67962,7 @@ var MerchantIntegrationGeneric = /*#__PURE__*/function () {
|
|
|
67968
67962
|
key: "addToCart",
|
|
67969
67963
|
value: function addToCart(composition, design, model, attributes, designItems, quantity, additionalProperties, shopifyNFTPrice) {
|
|
67970
67964
|
var designPrice = this.pricingCalculator && design ? this.pricingCalculator.calculate(design, quantity) : 0;
|
|
67965
|
+
if (designPrice > 0) if (quantity > 1) designPrice = designPrice / quantity;
|
|
67971
67966
|
designPrice += shopifyNFTPrice;
|
|
67972
67967
|
window.parent.postMessage({
|
|
67973
67968
|
zakekeMessageType: MessageType.AddToCart,
|
|
@@ -68000,9 +67995,10 @@ var MerchantIntegrationGeneric = /*#__PURE__*/function () {
|
|
|
68000
67995
|
conditions = [];
|
|
68001
67996
|
}
|
|
68002
67997
|
if (!isCustomPricingConfiguratorEnabled) compositionPrice = 0;
|
|
68003
|
-
console.log(
|
|
68004
|
-
console.log(
|
|
68005
|
-
|
|
67998
|
+
console.log('Calculated Zakeke price:');
|
|
67999
|
+
console.log('- Composition price: ' + compositionPrice);
|
|
68000
|
+
if (designPrice > 0) if (quantity > 1) designPrice = designPrice / quantity;
|
|
68001
|
+
console.log('- Design price: ' + designPrice);
|
|
68006
68002
|
window.parent.postMessage({
|
|
68007
68003
|
zakekeMessageType: MessageType.Price,
|
|
68008
68004
|
messageId: messageId,
|
|
@@ -68023,7 +68019,7 @@ var MerchantIntegrationGeneric = /*#__PURE__*/function () {
|
|
|
68023
68019
|
return new Promise(function (resolve, reject) {
|
|
68024
68020
|
var messageId = _this3.messageIds++;
|
|
68025
68021
|
_this3.callbacks.set(messageId, resolve);
|
|
68026
|
-
console.log(
|
|
68022
|
+
console.log('getSharedCompositionUrl generic ts');
|
|
68027
68023
|
window.parent.postMessage({
|
|
68028
68024
|
zakekeMessageType: MessageType.SharedComposition,
|
|
68029
68025
|
messageId: messageId,
|
|
@@ -70433,15 +70429,18 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
|
|
|
70433
70429
|
});
|
|
70434
70430
|
_defineProperty(this, "calculate", function (design, quantity) {
|
|
70435
70431
|
var attributeMatchColorId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
70432
|
+
var isPricingAdvancedEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
70436
70433
|
var matchedConditions = [];
|
|
70437
70434
|
var totalPriceToAdd = _this.getPremiumPhotosPrice(design, quantity);
|
|
70438
70435
|
totalPriceToAdd += _this.getImagePrice(design, quantity);
|
|
70439
|
-
|
|
70440
|
-
|
|
70441
|
-
|
|
70442
|
-
|
|
70443
|
-
|
|
70444
|
-
|
|
70436
|
+
if (isPricingAdvancedEnabled) {
|
|
70437
|
+
matchedConditions = _this.getMatchedConditions(design, quantity, false, attributeMatchColorId);
|
|
70438
|
+
matchedConditions.forEach(function (matchedCondition) {
|
|
70439
|
+
var conditionPrice = matchedCondition.priceToAdd * matchedCondition.multiplier;
|
|
70440
|
+
if (!matchedCondition.isSetupPrice) conditionPrice *= quantity;
|
|
70441
|
+
totalPriceToAdd += conditionPrice;
|
|
70442
|
+
});
|
|
70443
|
+
}
|
|
70445
70444
|
Logger.info('Total custom price: ', totalPriceToAdd);
|
|
70446
70445
|
return totalPriceToAdd;
|
|
70447
70446
|
});
|