zakeke-configurator-react 0.1.292-prod → 0.1.293-prod
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,358 +1,358 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typescript_definitions/declarations/All.d.ts" />
|
|
2
|
-
import { FocusAttributesEventListener } from '@zakeke/zakeke-3d-core';
|
|
3
|
-
import { EventMessage, ExtensionFields, NftForm, NftSettings, OnBeforeSendDataToParent, TryOnMode, TryOnProvidersTypesMapping, VisibleEventMessage } from '.';
|
|
4
|
-
import { PlatformAttributeSelection } from './integrations/Integration';
|
|
5
|
-
import { BootParameters, Camera, Composition, FontFamily, Group, ImageMacroCategory, Item, Product, ProductQuantityRule, SellerSettings, Template, TemplateMacroCategory, Translations, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller } from './models';
|
|
6
|
-
import { DAMViewerAnalyticsEventType, PrintingMethodsRestrictions, TextSanitationResult, UIConfig, ZakekeImage } from './models';
|
|
7
|
-
declare global {
|
|
8
|
-
interface Window {
|
|
9
|
-
token: string;
|
|
10
|
-
isOwin: boolean;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
interface RestrictionColor {
|
|
14
|
-
colorCode: string;
|
|
15
|
-
isDefault: boolean;
|
|
16
|
-
}
|
|
17
|
-
interface CustomPreviewSize {
|
|
18
|
-
customCartPreviewWidth: number;
|
|
19
|
-
customCartPreviewHeight: number;
|
|
20
|
-
}
|
|
21
|
-
interface ThemeCompositions {
|
|
22
|
-
name: string;
|
|
23
|
-
docID: string;
|
|
24
|
-
previewImageUrl: string;
|
|
25
|
-
tags: string[];
|
|
26
|
-
}
|
|
27
|
-
interface CurrentCompositionInfo {
|
|
28
|
-
compositionId: string | null;
|
|
29
|
-
compositionName: string | null;
|
|
30
|
-
compositionTags: string[] | null;
|
|
31
|
-
}
|
|
32
|
-
export declare class ZakekeEnvironment {
|
|
33
|
-
private booted;
|
|
34
|
-
private token;
|
|
35
|
-
private platformAttributesSelection;
|
|
36
|
-
private settings;
|
|
37
|
-
private platform;
|
|
38
|
-
private viewer;
|
|
39
|
-
private selection;
|
|
40
|
-
private integration;
|
|
41
|
-
private previewWidth;
|
|
42
|
-
private previewHeight;
|
|
43
|
-
private clientPreviewWidth;
|
|
44
|
-
private clientPreviewHeight;
|
|
45
|
-
private shareUrlPrefix;
|
|
46
|
-
private events;
|
|
47
|
-
private zkProduct;
|
|
48
|
-
private zkScene;
|
|
49
|
-
private zkCurrentTemplate;
|
|
50
|
-
private zkTemplates;
|
|
51
|
-
private internalIsFullscreen;
|
|
52
|
-
private highlightSettings;
|
|
53
|
-
private previousMeshesVisibleStates;
|
|
54
|
-
private lastCameraLocation;
|
|
55
|
-
private enableShareCompositionUrl;
|
|
56
|
-
private sharedCompositionDocId;
|
|
57
|
-
private templateId;
|
|
58
|
-
loadedComposition: {
|
|
59
|
-
templateName: string;
|
|
60
|
-
attributesOptions: Map<number, number>;
|
|
61
|
-
selectedCategoryID: number | null;
|
|
62
|
-
} | null;
|
|
63
|
-
private savedCompositions;
|
|
64
|
-
private isDraftEditor;
|
|
65
|
-
private isViewerMode;
|
|
66
|
-
private isDAMViewer;
|
|
67
|
-
private isTemplateEditor;
|
|
68
|
-
private debugMode;
|
|
69
|
-
private draftCompositionDocId;
|
|
70
|
-
private initialSelection;
|
|
71
|
-
private undoStack;
|
|
72
|
-
private redoStack;
|
|
73
|
-
private pricingCalculator;
|
|
74
|
-
currentAttributesSelection: Object | null;
|
|
75
|
-
currentCompositionInfo: CurrentCompositionInfo | null;
|
|
76
|
-
private copyrightMessageLocalStorageKey;
|
|
77
|
-
private isPupillaryDistanceMandatory;
|
|
78
|
-
isAIEnabled: boolean;
|
|
79
|
-
sellerSettings: SellerSettings | null;
|
|
80
|
-
get internalProduct(): MPlaza.Model | null;
|
|
81
|
-
get internalScene(): Zakeke.Scene | null;
|
|
82
|
-
get internalCurrentTemplate(): MPlaza.Design | null | undefined;
|
|
83
|
-
themeCompositions: ThemeCompositions[] | null;
|
|
84
|
-
currency: string;
|
|
85
|
-
groups: Group[];
|
|
86
|
-
fonts: FontFamily[];
|
|
87
|
-
disableTextColors: boolean;
|
|
88
|
-
textColors: RestrictionColor[];
|
|
89
|
-
/**
|
|
90
|
-
* Get the current text default color.
|
|
91
|
-
*/
|
|
92
|
-
defaultColor: string;
|
|
93
|
-
quantity: number;
|
|
94
|
-
quantityRule: ProductQuantityRule | null;
|
|
95
|
-
culture: string;
|
|
96
|
-
productCode: string;
|
|
97
|
-
productName: string;
|
|
98
|
-
price: number;
|
|
99
|
-
isOutOfStock: boolean;
|
|
100
|
-
composition: any;
|
|
101
|
-
compositionId: string | null;
|
|
102
|
-
templates: Template[];
|
|
103
|
-
currentTemplate: Template | null;
|
|
104
|
-
product: Product | null;
|
|
105
|
-
templateMacroCategories: TemplateMacroCategory[] | null;
|
|
106
|
-
selectedTemplateCategory: string | null;
|
|
107
|
-
cameras: Camera[];
|
|
108
|
-
isExplodedMode: boolean;
|
|
109
|
-
isAssetsLoading: boolean;
|
|
110
|
-
additionalCustomProperties: ExtensionFields[];
|
|
111
|
-
nftSettings: NftSettings | null;
|
|
112
|
-
eventMessages: EventMessage[] | null;
|
|
113
|
-
personalizedMessages: EventMessage[] | null;
|
|
114
|
-
visibleEventMessages: VisibleEventMessage[];
|
|
115
|
-
tryOnProvidersSettings: TryOnProvidersTypesMapping | null;
|
|
116
|
-
tryOnProductSettings: TryOnProduct | null;
|
|
117
|
-
tryOnSellerSettings: TryOnSeller | null;
|
|
118
|
-
pdSettings: number;
|
|
119
|
-
isInfoPointContentVisible: boolean;
|
|
120
|
-
private internalTranslations;
|
|
121
|
-
private integrationVersion;
|
|
122
|
-
translations: Translations | null;
|
|
123
|
-
useLegacyScreenshot: boolean;
|
|
124
|
-
get isFullscreenMode(): boolean;
|
|
125
|
-
get isViewerReady(): boolean;
|
|
126
|
-
get isShoppingPreview(): boolean;
|
|
127
|
-
uiConfig: UIConfig | null;
|
|
128
|
-
backgroundColor: string | null;
|
|
129
|
-
removeBackground: boolean;
|
|
130
|
-
constructor();
|
|
131
|
-
private parseParameters;
|
|
132
|
-
makeDAMAnalyticsView(type: DAMViewerAnalyticsEventType): Promise<import("axios").AxiosResponse<any, any>>;
|
|
133
|
-
private getProduct;
|
|
134
|
-
private getScene;
|
|
135
|
-
private getComposerModels;
|
|
136
|
-
private getFonts;
|
|
137
|
-
private getSettings;
|
|
138
|
-
private getSellerSetting;
|
|
139
|
-
createQuote: (formData: any) => Promise<any>;
|
|
140
|
-
private getPrice;
|
|
141
|
-
private getTranslations;
|
|
142
|
-
private loadLocalization;
|
|
143
|
-
getTemplateMacroCategories: () => Promise<TemplateMacroCategory[]>;
|
|
144
|
-
private loadScript;
|
|
145
|
-
validationNFTEmail: (email: string) => boolean;
|
|
146
|
-
validationNFTWalletAddress: (address: string) => boolean;
|
|
147
|
-
private saveCustomerWalletInfo;
|
|
148
|
-
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
149
|
-
getCopyrightMessageAccepted: () => boolean;
|
|
150
|
-
/**
|
|
151
|
-
* @private
|
|
152
|
-
*/
|
|
153
|
-
boot: (parameters: BootParameters | null) => Promise<void>;
|
|
154
|
-
loadSceneFromGlbUrl: (glbUrl: string, sceneConfig: Zakeke.SceneConfig) => Promise<void>;
|
|
155
|
-
appendViewer: (container: HTMLElement) => void;
|
|
156
|
-
setHighlightSettings: (settings: {
|
|
157
|
-
color: string;
|
|
158
|
-
size: number;
|
|
159
|
-
}) => void;
|
|
160
|
-
renderDesign: () => Promise<void>;
|
|
161
|
-
private debouncedChange;
|
|
162
|
-
restoreLastCameraLocation: () => void;
|
|
163
|
-
private buildRecapProps;
|
|
164
|
-
updateRecapAndExtensionField: () => void;
|
|
165
|
-
private getCurrentExtensionFields;
|
|
166
|
-
private handleSceneLoaded;
|
|
167
|
-
private getComposition;
|
|
168
|
-
private getDesign;
|
|
169
|
-
private internalLoadDesign;
|
|
170
|
-
private addHotjarScript;
|
|
171
|
-
private addGoogleTagManagerID;
|
|
172
|
-
loadComposition: (id: string | null) => Promise<void>;
|
|
173
|
-
private internalLoadComposition;
|
|
174
|
-
sync3DAndPlatformSelectionWithCurrentSelection: () => Promise<void>;
|
|
175
|
-
private cloneSelection;
|
|
176
|
-
undo: () => Promise<void>;
|
|
177
|
-
redo: () => Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* Reset the platform attributes selection to the current selection
|
|
180
|
-
*/
|
|
181
|
-
private resetPlatformAttributesSelection;
|
|
182
|
-
reset: () => Promise<void>;
|
|
183
|
-
private handleAttributeSelectionChanged;
|
|
184
|
-
private handleAttributeEnabled;
|
|
185
|
-
private handleAttributeDisabled;
|
|
186
|
-
private handleAttributeOptionEnabled;
|
|
187
|
-
private handleAttributeOptionDisabled;
|
|
188
|
-
private setAttributeSelectionEnabled;
|
|
189
|
-
private setOptionSelectionEnabled;
|
|
190
|
-
private isOptionEnabled;
|
|
191
|
-
private updateComposition;
|
|
192
|
-
setQuantity(quantity: number): void;
|
|
193
|
-
private _updatePrice;
|
|
194
|
-
private updatePrice;
|
|
195
|
-
private buildStructure;
|
|
196
|
-
private createGroupFromSelection;
|
|
197
|
-
private createStep;
|
|
198
|
-
private createAttributeFromSelection;
|
|
199
|
-
private createOptionFromSelection;
|
|
200
|
-
private createTemplateGroupFromSelection;
|
|
201
|
-
private saveDesignBackbone;
|
|
202
|
-
private saveCompositionBackbone;
|
|
203
|
-
private trigger;
|
|
204
|
-
on: (event: string, callback: any) => void;
|
|
205
|
-
off: (event: string, callback: any) => void;
|
|
206
|
-
setTemplate: (templateId: number) => Promise<void>;
|
|
207
|
-
getTemplateUploadRestrictictions: (templateId: number, areaId: number) => {
|
|
208
|
-
isUserImageAllowed: boolean;
|
|
209
|
-
isJpgAllowed: boolean;
|
|
210
|
-
isPngAllowed: boolean;
|
|
211
|
-
isSvgAllowed: boolean;
|
|
212
|
-
isPdfAllowed: boolean;
|
|
213
|
-
isEpsAllowed: boolean;
|
|
214
|
-
isPdfWithRasterAllowed: boolean;
|
|
215
|
-
};
|
|
216
|
-
private getTemplates;
|
|
217
|
-
private saveProduct;
|
|
218
|
-
private getTemplate;
|
|
219
|
-
updateView: () => void;
|
|
220
|
-
selectOption: (optionId: number) => void;
|
|
221
|
-
selectOptionsbyPrompt(prompt: string): Promise<void>;
|
|
222
|
-
focusGroup: (groupId: number) => void;
|
|
223
|
-
focusAttribute: (attributeId: number) => Promise<void>;
|
|
224
|
-
setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
225
|
-
getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
|
|
226
|
-
setCameraLocation(name: string, animate?: boolean): void;
|
|
227
|
-
private base64StringToFile;
|
|
228
|
-
saveTemplate: (templateName: string, selectedCategoryID: number | null, attributeOptions: Map<number, number>) => Promise<void>;
|
|
229
|
-
addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<Record<string, any>>) | undefined, legacyScreenshot?: boolean, nftForm?: NftForm) => Promise<void>;
|
|
230
|
-
zoomIn: () => void;
|
|
231
|
-
zoomOut: () => void;
|
|
232
|
-
isFullscreenEnabled: () => boolean;
|
|
233
|
-
getDesignItemsInfo(): Item[];
|
|
234
|
-
switchFullscreen: () => void;
|
|
235
|
-
openSecondScreen: () => void;
|
|
236
|
-
private extendedUpdate;
|
|
237
|
-
exportSceneToUsdz: (hash: string) => Promise<import("@zakeke/zakeke-3d-core").Nullable<string> | undefined>;
|
|
238
|
-
exportSceneToGlb: () => Promise<string | Blob | null>;
|
|
239
|
-
setExplodedMode: (explodedMode: boolean) => Promise<void>;
|
|
240
|
-
hasExplodedMode: () => boolean;
|
|
241
|
-
setBackgroundColor: (color: string, alpha: number) => void;
|
|
242
|
-
getCurrentSelection: () => PlatformAttributeSelection[];
|
|
243
|
-
getScreenshot: (width?: number, height?: number, legacyScreenshot?: boolean, backgroundColor?: string | null, padding?: number, camera?: Zakeke.SceneCameraLocation | null) => Promise<string>;
|
|
244
|
-
private fireItemsChange;
|
|
245
|
-
isAreaVisible(areaId: number): boolean;
|
|
246
|
-
removeItem: (guid: string) => Promise<void>;
|
|
247
|
-
addItemText(settings: {
|
|
248
|
-
text: string;
|
|
249
|
-
fontFamily: string;
|
|
250
|
-
}, areaId: number): Promise<void>;
|
|
251
|
-
setItemText: (guid: string, text: string) => void;
|
|
252
|
-
setItemItalic: (guid: string, italic: boolean) => void;
|
|
253
|
-
setItemBold: (guid: string, bold: boolean) => void;
|
|
254
|
-
setItemColor: (guid: string, color: string) => void;
|
|
255
|
-
setItemFontFamily: (guid: string, fontFamily: string) => Promise<void>;
|
|
256
|
-
setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
|
|
257
|
-
fullyLoadFont(font: string | FontFamily): Promise<FontFamily>;
|
|
258
|
-
sanitizeString: (family: FontFamily, text: string) => string;
|
|
259
|
-
getSanitationText: (family: FontFamily, text: string) => TextSanitationResult;
|
|
260
|
-
createImage: (file: File, progress?: ((percentage: number) => void) | undefined) => Promise<ZakekeImage>;
|
|
261
|
-
createImageFromUrl: (url: string) => Promise<ZakekeImage>;
|
|
262
|
-
addItemImage: (id: number, areaId: number) => Promise<void>;
|
|
263
|
-
setItemImageFromFile: (guid: string, file: File, progress?: ((percentage: number) => void) | undefined) => Promise<void>;
|
|
264
|
-
setItemImageFromBase64: (guid: string, base64: string) => Promise<void>;
|
|
265
|
-
setItemImage: (guid: string, id: number) => Promise<void>;
|
|
266
|
-
getMacroCategories: () => Promise<ImageMacroCategory[]>;
|
|
267
|
-
getImages: (categoryId: number) => Promise<ZakekeImage[]>;
|
|
268
|
-
setCameraPivot(meshID: string): void;
|
|
269
|
-
resetCameraPivot(): void;
|
|
270
|
-
setCameraZoomEnabled(enabled: boolean): void;
|
|
271
|
-
setCameraByName(name: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
272
|
-
findObjectByName(name: string): BABYLON.AbstractMesh | null | undefined;
|
|
273
|
-
getPDF: () => Promise<string>;
|
|
274
|
-
private rewriteShareUrl;
|
|
275
|
-
getShareCompositionUrl: () => Promise<string>;
|
|
276
|
-
saveCompositionCopy: (isSharing?: boolean) => Promise<any>;
|
|
277
|
-
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
|
|
278
|
-
originalUrl: string;
|
|
279
|
-
rewrittenUrl: string;
|
|
280
|
-
}>;
|
|
281
|
-
isSceneArOnTheFly: () => boolean | undefined;
|
|
282
|
-
isArDeviceCompliant: () => boolean;
|
|
283
|
-
isAndroidOrIOS: () => boolean;
|
|
284
|
-
isAndroid: boolean;
|
|
285
|
-
isIOS: boolean;
|
|
286
|
-
private buildModelViewerUrl;
|
|
287
|
-
isSceneArEnabled: () => boolean;
|
|
288
|
-
private getPregeneratedARUrl;
|
|
289
|
-
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
290
|
-
getMobileArUrl: (onFlyArUrl?: string) => Promise<string | null>;
|
|
291
|
-
getMobileLocalArUrl: (onFlyArUrl?: string) => Promise<string>;
|
|
292
|
-
openArMobile: (url: string) => void;
|
|
293
|
-
private registerView;
|
|
294
|
-
getMeshIDbyName: (name: string) => string | undefined;
|
|
295
|
-
hightlightGroup(groupId: number): void;
|
|
296
|
-
highlightAttribute(attributeId: number): void;
|
|
297
|
-
/**
|
|
298
|
-
* Hide a mesh and its children and save the state
|
|
299
|
-
* @param meshId The mesh and childs to hide
|
|
300
|
-
*/
|
|
301
|
-
hideMeshAndSaveState: (meshId: string) => void;
|
|
302
|
-
/**
|
|
303
|
-
* Restore a mesh visibility state from a previous saved one (see hideMeshAndSaveState)
|
|
304
|
-
* @param meshId The mesh and childs to show
|
|
305
|
-
*/
|
|
306
|
-
restoreMeshVisibility: (meshId: string) => void;
|
|
307
|
-
/**
|
|
308
|
-
* Change opacity for a specific mesh
|
|
309
|
-
* @param meshId The mesh to change the opacity
|
|
310
|
-
* @param opacity The opacity to set
|
|
311
|
-
*/
|
|
312
|
-
setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
|
|
313
|
-
addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
|
|
314
|
-
clearListeners: () => void;
|
|
315
|
-
setCameraLocked: (isBlocked?: boolean) => void;
|
|
316
|
-
isSceneTryOnEnabled: () => boolean;
|
|
317
|
-
getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
|
|
318
|
-
saveComposition: (customPreviewSize?: CustomPreviewSize, legacyScreenshot?: boolean, isSharing?: boolean) => Promise<void>;
|
|
319
|
-
private bootstrapComposition;
|
|
320
|
-
loadSavedComposition: (docID: string) => Promise<void>;
|
|
321
|
-
private updateSavedCompositions;
|
|
322
|
-
themeCompositionsFromSavedCompositions: (compositions: Composition[]) => {
|
|
323
|
-
name: string;
|
|
324
|
-
docID: string;
|
|
325
|
-
previewImageUrl: string;
|
|
326
|
-
tags: string[];
|
|
327
|
-
}[];
|
|
328
|
-
saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
|
|
329
|
-
deleteSavedComposition: (docId: string) => Promise<void>;
|
|
330
|
-
applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
|
|
331
|
-
configureByAI: (text: string) => Promise<void>;
|
|
332
|
-
getTryOnProvidersList: () => Promise<TryOnProvidersTypesMapping>;
|
|
333
|
-
getTryOnProductInfo: () => Promise<TryOnProduct | null>;
|
|
334
|
-
private getMessagesByProductCode;
|
|
335
|
-
getTryOnSellerInfo: (typeID: number, providerID: number) => Promise<TryOnSeller | null>;
|
|
336
|
-
get hasVTryOnEnabled(): boolean;
|
|
337
|
-
get canUseTryOn(): boolean;
|
|
338
|
-
get canUsePD(): boolean;
|
|
339
|
-
get isVisibleMeshShownForTryOn(): boolean;
|
|
340
|
-
get isMandatoryPD(): boolean;
|
|
341
|
-
get isTryOnMeshVisible(): boolean;
|
|
342
|
-
get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
|
|
343
|
-
setPDDistance: (distance: number) => void;
|
|
344
|
-
pdDistance: () => number;
|
|
345
|
-
exportTryOnMeshToGlb: () => Promise<Blob | null>;
|
|
346
|
-
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
347
|
-
tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
|
|
348
|
-
/**
|
|
349
|
-
* Ottiene le restrizioni sul printing method (che nel caso di un prodotto configuratore 3D c'è sempre ed è 1 solo).
|
|
350
|
-
* @remarks
|
|
351
|
-
* Se non ci sono restrizioni, ritorna quelle di default
|
|
352
|
-
* @returns
|
|
353
|
-
* Le restrizioni sul printing method o quelle di default
|
|
354
|
-
*/
|
|
355
|
-
getPrintingMethodsRestrictions: () => PrintingMethodsRestrictions;
|
|
356
|
-
setMouseWheelZoomEnabled: (enabled: boolean) => void;
|
|
357
|
-
}
|
|
358
|
-
export {};
|
|
1
|
+
/// <reference path="../../../../../../../typescript_definitions/declarations/All.d.ts" />
|
|
2
|
+
import { FocusAttributesEventListener } from '@zakeke/zakeke-3d-core';
|
|
3
|
+
import { EventMessage, ExtensionFields, NftForm, NftSettings, OnBeforeSendDataToParent, TryOnMode, TryOnProvidersTypesMapping, VisibleEventMessage } from '.';
|
|
4
|
+
import { PlatformAttributeSelection } from './integrations/Integration';
|
|
5
|
+
import { BootParameters, Camera, Composition, FontFamily, Group, ImageMacroCategory, Item, Product, ProductQuantityRule, SellerSettings, Template, TemplateMacroCategory, Translations, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller } from './models';
|
|
6
|
+
import { DAMViewerAnalyticsEventType, PrintingMethodsRestrictions, TextSanitationResult, UIConfig, ZakekeImage } from './models';
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
token: string;
|
|
10
|
+
isOwin: boolean;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
interface RestrictionColor {
|
|
14
|
+
colorCode: string;
|
|
15
|
+
isDefault: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface CustomPreviewSize {
|
|
18
|
+
customCartPreviewWidth: number;
|
|
19
|
+
customCartPreviewHeight: number;
|
|
20
|
+
}
|
|
21
|
+
interface ThemeCompositions {
|
|
22
|
+
name: string;
|
|
23
|
+
docID: string;
|
|
24
|
+
previewImageUrl: string;
|
|
25
|
+
tags: string[];
|
|
26
|
+
}
|
|
27
|
+
interface CurrentCompositionInfo {
|
|
28
|
+
compositionId: string | null;
|
|
29
|
+
compositionName: string | null;
|
|
30
|
+
compositionTags: string[] | null;
|
|
31
|
+
}
|
|
32
|
+
export declare class ZakekeEnvironment {
|
|
33
|
+
private booted;
|
|
34
|
+
private token;
|
|
35
|
+
private platformAttributesSelection;
|
|
36
|
+
private settings;
|
|
37
|
+
private platform;
|
|
38
|
+
private viewer;
|
|
39
|
+
private selection;
|
|
40
|
+
private integration;
|
|
41
|
+
private previewWidth;
|
|
42
|
+
private previewHeight;
|
|
43
|
+
private clientPreviewWidth;
|
|
44
|
+
private clientPreviewHeight;
|
|
45
|
+
private shareUrlPrefix;
|
|
46
|
+
private events;
|
|
47
|
+
private zkProduct;
|
|
48
|
+
private zkScene;
|
|
49
|
+
private zkCurrentTemplate;
|
|
50
|
+
private zkTemplates;
|
|
51
|
+
private internalIsFullscreen;
|
|
52
|
+
private highlightSettings;
|
|
53
|
+
private previousMeshesVisibleStates;
|
|
54
|
+
private lastCameraLocation;
|
|
55
|
+
private enableShareCompositionUrl;
|
|
56
|
+
private sharedCompositionDocId;
|
|
57
|
+
private templateId;
|
|
58
|
+
loadedComposition: {
|
|
59
|
+
templateName: string;
|
|
60
|
+
attributesOptions: Map<number, number>;
|
|
61
|
+
selectedCategoryID: number | null;
|
|
62
|
+
} | null;
|
|
63
|
+
private savedCompositions;
|
|
64
|
+
private isDraftEditor;
|
|
65
|
+
private isViewerMode;
|
|
66
|
+
private isDAMViewer;
|
|
67
|
+
private isTemplateEditor;
|
|
68
|
+
private debugMode;
|
|
69
|
+
private draftCompositionDocId;
|
|
70
|
+
private initialSelection;
|
|
71
|
+
private undoStack;
|
|
72
|
+
private redoStack;
|
|
73
|
+
private pricingCalculator;
|
|
74
|
+
currentAttributesSelection: Object | null;
|
|
75
|
+
currentCompositionInfo: CurrentCompositionInfo | null;
|
|
76
|
+
private copyrightMessageLocalStorageKey;
|
|
77
|
+
private isPupillaryDistanceMandatory;
|
|
78
|
+
isAIEnabled: boolean;
|
|
79
|
+
sellerSettings: SellerSettings | null;
|
|
80
|
+
get internalProduct(): MPlaza.Model | null;
|
|
81
|
+
get internalScene(): Zakeke.Scene | null;
|
|
82
|
+
get internalCurrentTemplate(): MPlaza.Design | null | undefined;
|
|
83
|
+
themeCompositions: ThemeCompositions[] | null;
|
|
84
|
+
currency: string;
|
|
85
|
+
groups: Group[];
|
|
86
|
+
fonts: FontFamily[];
|
|
87
|
+
disableTextColors: boolean;
|
|
88
|
+
textColors: RestrictionColor[];
|
|
89
|
+
/**
|
|
90
|
+
* Get the current text default color.
|
|
91
|
+
*/
|
|
92
|
+
defaultColor: string;
|
|
93
|
+
quantity: number;
|
|
94
|
+
quantityRule: ProductQuantityRule | null;
|
|
95
|
+
culture: string;
|
|
96
|
+
productCode: string;
|
|
97
|
+
productName: string;
|
|
98
|
+
price: number;
|
|
99
|
+
isOutOfStock: boolean;
|
|
100
|
+
composition: any;
|
|
101
|
+
compositionId: string | null;
|
|
102
|
+
templates: Template[];
|
|
103
|
+
currentTemplate: Template | null;
|
|
104
|
+
product: Product | null;
|
|
105
|
+
templateMacroCategories: TemplateMacroCategory[] | null;
|
|
106
|
+
selectedTemplateCategory: string | null;
|
|
107
|
+
cameras: Camera[];
|
|
108
|
+
isExplodedMode: boolean;
|
|
109
|
+
isAssetsLoading: boolean;
|
|
110
|
+
additionalCustomProperties: ExtensionFields[];
|
|
111
|
+
nftSettings: NftSettings | null;
|
|
112
|
+
eventMessages: EventMessage[] | null;
|
|
113
|
+
personalizedMessages: EventMessage[] | null;
|
|
114
|
+
visibleEventMessages: VisibleEventMessage[];
|
|
115
|
+
tryOnProvidersSettings: TryOnProvidersTypesMapping | null;
|
|
116
|
+
tryOnProductSettings: TryOnProduct | null;
|
|
117
|
+
tryOnSellerSettings: TryOnSeller | null;
|
|
118
|
+
pdSettings: number;
|
|
119
|
+
isInfoPointContentVisible: boolean;
|
|
120
|
+
private internalTranslations;
|
|
121
|
+
private integrationVersion;
|
|
122
|
+
translations: Translations | null;
|
|
123
|
+
useLegacyScreenshot: boolean;
|
|
124
|
+
get isFullscreenMode(): boolean;
|
|
125
|
+
get isViewerReady(): boolean;
|
|
126
|
+
get isShoppingPreview(): boolean;
|
|
127
|
+
uiConfig: UIConfig | null;
|
|
128
|
+
backgroundColor: string | null;
|
|
129
|
+
removeBackground: boolean;
|
|
130
|
+
constructor();
|
|
131
|
+
private parseParameters;
|
|
132
|
+
makeDAMAnalyticsView(type: DAMViewerAnalyticsEventType): Promise<import("axios").AxiosResponse<any, any>>;
|
|
133
|
+
private getProduct;
|
|
134
|
+
private getScene;
|
|
135
|
+
private getComposerModels;
|
|
136
|
+
private getFonts;
|
|
137
|
+
private getSettings;
|
|
138
|
+
private getSellerSetting;
|
|
139
|
+
createQuote: (formData: any) => Promise<any>;
|
|
140
|
+
private getPrice;
|
|
141
|
+
private getTranslations;
|
|
142
|
+
private loadLocalization;
|
|
143
|
+
getTemplateMacroCategories: () => Promise<TemplateMacroCategory[]>;
|
|
144
|
+
private loadScript;
|
|
145
|
+
validationNFTEmail: (email: string) => boolean;
|
|
146
|
+
validationNFTWalletAddress: (address: string) => boolean;
|
|
147
|
+
private saveCustomerWalletInfo;
|
|
148
|
+
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
149
|
+
getCopyrightMessageAccepted: () => boolean;
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
boot: (parameters: BootParameters | null) => Promise<void>;
|
|
154
|
+
loadSceneFromGlbUrl: (glbUrl: string, sceneConfig: Zakeke.SceneConfig) => Promise<void>;
|
|
155
|
+
appendViewer: (container: HTMLElement) => void;
|
|
156
|
+
setHighlightSettings: (settings: {
|
|
157
|
+
color: string;
|
|
158
|
+
size: number;
|
|
159
|
+
}) => void;
|
|
160
|
+
renderDesign: () => Promise<void>;
|
|
161
|
+
private debouncedChange;
|
|
162
|
+
restoreLastCameraLocation: () => void;
|
|
163
|
+
private buildRecapProps;
|
|
164
|
+
updateRecapAndExtensionField: () => void;
|
|
165
|
+
private getCurrentExtensionFields;
|
|
166
|
+
private handleSceneLoaded;
|
|
167
|
+
private getComposition;
|
|
168
|
+
private getDesign;
|
|
169
|
+
private internalLoadDesign;
|
|
170
|
+
private addHotjarScript;
|
|
171
|
+
private addGoogleTagManagerID;
|
|
172
|
+
loadComposition: (id: string | null) => Promise<void>;
|
|
173
|
+
private internalLoadComposition;
|
|
174
|
+
sync3DAndPlatformSelectionWithCurrentSelection: () => Promise<void>;
|
|
175
|
+
private cloneSelection;
|
|
176
|
+
undo: () => Promise<void>;
|
|
177
|
+
redo: () => Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Reset the platform attributes selection to the current selection
|
|
180
|
+
*/
|
|
181
|
+
private resetPlatformAttributesSelection;
|
|
182
|
+
reset: () => Promise<void>;
|
|
183
|
+
private handleAttributeSelectionChanged;
|
|
184
|
+
private handleAttributeEnabled;
|
|
185
|
+
private handleAttributeDisabled;
|
|
186
|
+
private handleAttributeOptionEnabled;
|
|
187
|
+
private handleAttributeOptionDisabled;
|
|
188
|
+
private setAttributeSelectionEnabled;
|
|
189
|
+
private setOptionSelectionEnabled;
|
|
190
|
+
private isOptionEnabled;
|
|
191
|
+
private updateComposition;
|
|
192
|
+
setQuantity(quantity: number): void;
|
|
193
|
+
private _updatePrice;
|
|
194
|
+
private updatePrice;
|
|
195
|
+
private buildStructure;
|
|
196
|
+
private createGroupFromSelection;
|
|
197
|
+
private createStep;
|
|
198
|
+
private createAttributeFromSelection;
|
|
199
|
+
private createOptionFromSelection;
|
|
200
|
+
private createTemplateGroupFromSelection;
|
|
201
|
+
private saveDesignBackbone;
|
|
202
|
+
private saveCompositionBackbone;
|
|
203
|
+
private trigger;
|
|
204
|
+
on: (event: string, callback: any) => void;
|
|
205
|
+
off: (event: string, callback: any) => void;
|
|
206
|
+
setTemplate: (templateId: number) => Promise<void>;
|
|
207
|
+
getTemplateUploadRestrictictions: (templateId: number, areaId: number) => {
|
|
208
|
+
isUserImageAllowed: boolean;
|
|
209
|
+
isJpgAllowed: boolean;
|
|
210
|
+
isPngAllowed: boolean;
|
|
211
|
+
isSvgAllowed: boolean;
|
|
212
|
+
isPdfAllowed: boolean;
|
|
213
|
+
isEpsAllowed: boolean;
|
|
214
|
+
isPdfWithRasterAllowed: boolean;
|
|
215
|
+
};
|
|
216
|
+
private getTemplates;
|
|
217
|
+
private saveProduct;
|
|
218
|
+
private getTemplate;
|
|
219
|
+
updateView: () => void;
|
|
220
|
+
selectOption: (optionId: number) => void;
|
|
221
|
+
selectOptionsbyPrompt(prompt: string): Promise<void>;
|
|
222
|
+
focusGroup: (groupId: number) => void;
|
|
223
|
+
focusAttribute: (attributeId: number) => Promise<void>;
|
|
224
|
+
setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
225
|
+
getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
|
|
226
|
+
setCameraLocation(name: string, animate?: boolean): void;
|
|
227
|
+
private base64StringToFile;
|
|
228
|
+
saveTemplate: (templateName: string, selectedCategoryID: number | null, attributeOptions: Map<number, number>) => Promise<void>;
|
|
229
|
+
addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<Record<string, any>>) | undefined, legacyScreenshot?: boolean, nftForm?: NftForm) => Promise<void>;
|
|
230
|
+
zoomIn: () => void;
|
|
231
|
+
zoomOut: () => void;
|
|
232
|
+
isFullscreenEnabled: () => boolean;
|
|
233
|
+
getDesignItemsInfo(): Item[];
|
|
234
|
+
switchFullscreen: () => void;
|
|
235
|
+
openSecondScreen: () => void;
|
|
236
|
+
private extendedUpdate;
|
|
237
|
+
exportSceneToUsdz: (hash: string) => Promise<import("@zakeke/zakeke-3d-core").Nullable<string> | undefined>;
|
|
238
|
+
exportSceneToGlb: () => Promise<string | Blob | null>;
|
|
239
|
+
setExplodedMode: (explodedMode: boolean) => Promise<void>;
|
|
240
|
+
hasExplodedMode: () => boolean;
|
|
241
|
+
setBackgroundColor: (color: string, alpha: number) => void;
|
|
242
|
+
getCurrentSelection: () => PlatformAttributeSelection[];
|
|
243
|
+
getScreenshot: (width?: number, height?: number, legacyScreenshot?: boolean, backgroundColor?: string | null, padding?: number, camera?: Zakeke.SceneCameraLocation | null) => Promise<string>;
|
|
244
|
+
private fireItemsChange;
|
|
245
|
+
isAreaVisible(areaId: number): boolean;
|
|
246
|
+
removeItem: (guid: string) => Promise<void>;
|
|
247
|
+
addItemText(settings: {
|
|
248
|
+
text: string;
|
|
249
|
+
fontFamily: string;
|
|
250
|
+
}, areaId: number): Promise<void>;
|
|
251
|
+
setItemText: (guid: string, text: string) => void;
|
|
252
|
+
setItemItalic: (guid: string, italic: boolean) => void;
|
|
253
|
+
setItemBold: (guid: string, bold: boolean) => void;
|
|
254
|
+
setItemColor: (guid: string, color: string) => void;
|
|
255
|
+
setItemFontFamily: (guid: string, fontFamily: string) => Promise<void>;
|
|
256
|
+
setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
|
|
257
|
+
fullyLoadFont(font: string | FontFamily): Promise<FontFamily>;
|
|
258
|
+
sanitizeString: (family: FontFamily, text: string) => string;
|
|
259
|
+
getSanitationText: (family: FontFamily, text: string) => TextSanitationResult;
|
|
260
|
+
createImage: (file: File, progress?: ((percentage: number) => void) | undefined) => Promise<ZakekeImage>;
|
|
261
|
+
createImageFromUrl: (url: string) => Promise<ZakekeImage>;
|
|
262
|
+
addItemImage: (id: number, areaId: number) => Promise<void>;
|
|
263
|
+
setItemImageFromFile: (guid: string, file: File, progress?: ((percentage: number) => void) | undefined) => Promise<void>;
|
|
264
|
+
setItemImageFromBase64: (guid: string, base64: string) => Promise<void>;
|
|
265
|
+
setItemImage: (guid: string, id: number) => Promise<void>;
|
|
266
|
+
getMacroCategories: () => Promise<ImageMacroCategory[]>;
|
|
267
|
+
getImages: (categoryId: number) => Promise<ZakekeImage[]>;
|
|
268
|
+
setCameraPivot(meshID: string): void;
|
|
269
|
+
resetCameraPivot(): void;
|
|
270
|
+
setCameraZoomEnabled(enabled: boolean): void;
|
|
271
|
+
setCameraByName(name: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
272
|
+
findObjectByName(name: string): BABYLON.AbstractMesh | null | undefined;
|
|
273
|
+
getPDF: () => Promise<string>;
|
|
274
|
+
private rewriteShareUrl;
|
|
275
|
+
getShareCompositionUrl: () => Promise<string>;
|
|
276
|
+
saveCompositionCopy: (isSharing?: boolean) => Promise<any>;
|
|
277
|
+
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
|
|
278
|
+
originalUrl: string;
|
|
279
|
+
rewrittenUrl: string;
|
|
280
|
+
}>;
|
|
281
|
+
isSceneArOnTheFly: () => boolean | undefined;
|
|
282
|
+
isArDeviceCompliant: () => boolean;
|
|
283
|
+
isAndroidOrIOS: () => boolean;
|
|
284
|
+
isAndroid: boolean;
|
|
285
|
+
isIOS: boolean;
|
|
286
|
+
private buildModelViewerUrl;
|
|
287
|
+
isSceneArEnabled: () => boolean;
|
|
288
|
+
private getPregeneratedARUrl;
|
|
289
|
+
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
290
|
+
getMobileArUrl: (onFlyArUrl?: string) => Promise<string | null>;
|
|
291
|
+
getMobileLocalArUrl: (onFlyArUrl?: string) => Promise<string>;
|
|
292
|
+
openArMobile: (url: string) => void;
|
|
293
|
+
private registerView;
|
|
294
|
+
getMeshIDbyName: (name: string) => string | undefined;
|
|
295
|
+
hightlightGroup(groupId: number): void;
|
|
296
|
+
highlightAttribute(attributeId: number): void;
|
|
297
|
+
/**
|
|
298
|
+
* Hide a mesh and its children and save the state
|
|
299
|
+
* @param meshId The mesh and childs to hide
|
|
300
|
+
*/
|
|
301
|
+
hideMeshAndSaveState: (meshId: string) => void;
|
|
302
|
+
/**
|
|
303
|
+
* Restore a mesh visibility state from a previous saved one (see hideMeshAndSaveState)
|
|
304
|
+
* @param meshId The mesh and childs to show
|
|
305
|
+
*/
|
|
306
|
+
restoreMeshVisibility: (meshId: string) => void;
|
|
307
|
+
/**
|
|
308
|
+
* Change opacity for a specific mesh
|
|
309
|
+
* @param meshId The mesh to change the opacity
|
|
310
|
+
* @param opacity The opacity to set
|
|
311
|
+
*/
|
|
312
|
+
setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
|
|
313
|
+
addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
|
|
314
|
+
clearListeners: () => void;
|
|
315
|
+
setCameraLocked: (isBlocked?: boolean) => void;
|
|
316
|
+
isSceneTryOnEnabled: () => boolean;
|
|
317
|
+
getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
|
|
318
|
+
saveComposition: (customPreviewSize?: CustomPreviewSize, legacyScreenshot?: boolean, isSharing?: boolean) => Promise<void>;
|
|
319
|
+
private bootstrapComposition;
|
|
320
|
+
loadSavedComposition: (docID: string) => Promise<void>;
|
|
321
|
+
private updateSavedCompositions;
|
|
322
|
+
themeCompositionsFromSavedCompositions: (compositions: Composition[]) => {
|
|
323
|
+
name: string;
|
|
324
|
+
docID: string;
|
|
325
|
+
previewImageUrl: string;
|
|
326
|
+
tags: string[];
|
|
327
|
+
}[];
|
|
328
|
+
saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
|
|
329
|
+
deleteSavedComposition: (docId: string) => Promise<void>;
|
|
330
|
+
applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
|
|
331
|
+
configureByAI: (text: string) => Promise<void>;
|
|
332
|
+
getTryOnProvidersList: () => Promise<TryOnProvidersTypesMapping>;
|
|
333
|
+
getTryOnProductInfo: () => Promise<TryOnProduct | null>;
|
|
334
|
+
private getMessagesByProductCode;
|
|
335
|
+
getTryOnSellerInfo: (typeID: number, providerID: number) => Promise<TryOnSeller | null>;
|
|
336
|
+
get hasVTryOnEnabled(): boolean;
|
|
337
|
+
get canUseTryOn(): boolean;
|
|
338
|
+
get canUsePD(): boolean;
|
|
339
|
+
get isVisibleMeshShownForTryOn(): boolean;
|
|
340
|
+
get isMandatoryPD(): boolean;
|
|
341
|
+
get isTryOnMeshVisible(): boolean;
|
|
342
|
+
get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
|
|
343
|
+
setPDDistance: (distance: number) => void;
|
|
344
|
+
pdDistance: () => number;
|
|
345
|
+
exportTryOnMeshToGlb: () => Promise<Blob | null>;
|
|
346
|
+
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
347
|
+
tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* Ottiene le restrizioni sul printing method (che nel caso di un prodotto configuratore 3D c'è sempre ed è 1 solo).
|
|
350
|
+
* @remarks
|
|
351
|
+
* Se non ci sono restrizioni, ritorna quelle di default
|
|
352
|
+
* @returns
|
|
353
|
+
* Le restrizioni sul printing method o quelle di default
|
|
354
|
+
*/
|
|
355
|
+
getPrintingMethodsRestrictions: () => PrintingMethodsRestrictions;
|
|
356
|
+
setMouseWheelZoomEnabled: (enabled: boolean) => void;
|
|
357
|
+
}
|
|
358
|
+
export {};
|
|
@@ -1,214 +1,214 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Zakeke
|
|
3
|
-
*/
|
|
4
|
-
import { FocusAttributesEventListener } from '@zakeke/zakeke-3d-core';
|
|
5
|
-
import { EventMessage, FontFamily, Group, Item, NftForm, NftSettings, OnBeforeSendDataToParent, PrintingMethodsRestrictions, Product, Template, TemplateMacroCategory, TextSanitationResult, Translations, UIConfig, VisibleEventMessage } from '..';
|
|
6
|
-
import { Camera, ImageMacroCategory, ProductQuantityRule, SellerSettings, TemplateUploadRestrictictions, ZakekeImage } from '../models';
|
|
7
|
-
interface RestrictionColor {
|
|
8
|
-
colorCode: string;
|
|
9
|
-
isDefault: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface CustomPreviewSize {
|
|
12
|
-
customCartPreviewWidth: number;
|
|
13
|
-
customCartPreviewHeight: number;
|
|
14
|
-
}
|
|
15
|
-
interface ThemeCompositions {
|
|
16
|
-
name: string;
|
|
17
|
-
docID: string;
|
|
18
|
-
previewImageUrl: string;
|
|
19
|
-
tags: string[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Contains all the data and methods to control a Zakeke configuration
|
|
23
|
-
*/
|
|
24
|
-
export interface Zakeke {
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
internalProduct: MPlaza.Model | null;
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
internalScene: Zakeke.Scene | null;
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
internalCurrentTemplate: MPlaza.Design | null | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* The current price of the configuration plus the product price
|
|
39
|
-
*/
|
|
40
|
-
price: number;
|
|
41
|
-
isOutOfStock: boolean;
|
|
42
|
-
culture: string;
|
|
43
|
-
currency: string;
|
|
44
|
-
isSceneLoading: boolean;
|
|
45
|
-
isAddToCartLoading: boolean;
|
|
46
|
-
isInfoPointContentVisible: boolean;
|
|
47
|
-
isViewerReady: boolean;
|
|
48
|
-
fonts: FontFamily[];
|
|
49
|
-
disableTextColors: boolean;
|
|
50
|
-
defaultColor: string;
|
|
51
|
-
textColors: RestrictionColor[];
|
|
52
|
-
groups: Group[];
|
|
53
|
-
templates: Template[];
|
|
54
|
-
loadedComposition: {
|
|
55
|
-
templateName: string;
|
|
56
|
-
attributesOptions: Map<number, number>;
|
|
57
|
-
selectedCategoryID: number | null;
|
|
58
|
-
} | null;
|
|
59
|
-
currentTemplate: Template | null;
|
|
60
|
-
items: Item[];
|
|
61
|
-
productName: string;
|
|
62
|
-
productCode: string;
|
|
63
|
-
product: Product | null;
|
|
64
|
-
cameras: Camera[];
|
|
65
|
-
sellerSettings: SellerSettings | null;
|
|
66
|
-
quantityRule: ProductQuantityRule | null;
|
|
67
|
-
eventMessages: EventMessage[] | null;
|
|
68
|
-
personalizedMessages: EventMessage[] | null;
|
|
69
|
-
visibleEventMessages: VisibleEventMessage[];
|
|
70
|
-
isAssetsLoading: boolean;
|
|
71
|
-
draftCompositions: ThemeCompositions[] | null;
|
|
72
|
-
additionalCustomProperties: {
|
|
73
|
-
name: string;
|
|
74
|
-
value: number;
|
|
75
|
-
label: string;
|
|
76
|
-
formatString: string;
|
|
77
|
-
}[] | null;
|
|
78
|
-
currentAttributesSelection: object | null;
|
|
79
|
-
currentCompositionInfo: {
|
|
80
|
-
compositionId: string | null;
|
|
81
|
-
compositionName: string | null;
|
|
82
|
-
compositionTags: string[] | null;
|
|
83
|
-
} | null;
|
|
84
|
-
translations: Translations | null;
|
|
85
|
-
nftSettings: NftSettings | null;
|
|
86
|
-
useLegacyScreenshot: boolean;
|
|
87
|
-
isAIEnabled: boolean;
|
|
88
|
-
uiConfig: UIConfig | null;
|
|
89
|
-
backgroundColor: string;
|
|
90
|
-
removeBackground: boolean;
|
|
91
|
-
setMouseWheelZoomEnabled: (enabled: boolean) => void;
|
|
92
|
-
selectOption: (optionId: number) => void;
|
|
93
|
-
/**
|
|
94
|
-
* @internal
|
|
95
|
-
*/
|
|
96
|
-
internalAppendViewer: (container: HTMLElement) => void;
|
|
97
|
-
getPrintingMethodsRestrictions: () => PrintingMethodsRestrictions;
|
|
98
|
-
designUpdate: () => void;
|
|
99
|
-
createQuote: (formData: any) => Promise<any>;
|
|
100
|
-
setTemplate: (templateId: number) => Promise<void>;
|
|
101
|
-
isAreaVisible: (areaId: number) => boolean;
|
|
102
|
-
quantity: number;
|
|
103
|
-
saveTemplate: (templateName: string, selectedCategoryID: number | null, attributesOptions: Map<number, number>) => Promise<void>;
|
|
104
|
-
addToCart: (additionalProperties: Record<string, any>, OnBeforeSendDataToParent?: (data: OnBeforeSendDataToParent) => Promise<Record<string, any>>, legacyScreenshot?: boolean, nftForm?: NftForm) => Promise<void>;
|
|
105
|
-
/**
|
|
106
|
-
* Create a PDF of the current configuration
|
|
107
|
-
* @returns The URL of the PDF
|
|
108
|
-
*/
|
|
109
|
-
getPDF: () => Promise<string>;
|
|
110
|
-
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
|
|
111
|
-
originalUrl: string;
|
|
112
|
-
rewrittenUrl: string;
|
|
113
|
-
}>;
|
|
114
|
-
setCamera: (id: string, onlyAngleOfView?: boolean, animate?: boolean) => void;
|
|
115
|
-
setCameraByName: (name: string, onlyAngleOfView?: boolean, animate?: boolean) => void;
|
|
116
|
-
setCameraZoomEnabled: (enabled: boolean) => void;
|
|
117
|
-
resetCameraPivot: () => void;
|
|
118
|
-
setCameraPivot: (meshId: string) => void;
|
|
119
|
-
fullyLoadFont: (fontFamily: string | FontFamily) => Promise<FontFamily>;
|
|
120
|
-
sanitizeString: (family: FontFamily, text: string) => string;
|
|
121
|
-
getSanitationText: (family: FontFamily, text: string) => TextSanitationResult;
|
|
122
|
-
getImages: (categoryId: number) => Promise<ZakekeImage[]>;
|
|
123
|
-
getMacroCategories: () => Promise<ImageMacroCategory[]>;
|
|
124
|
-
previewOnly__setItemImageFromBase64: (guid: string, base64: string) => void;
|
|
125
|
-
setItemImageFromFile: (guid: string, file: File) => Promise<void>;
|
|
126
|
-
addItemImage: (id: number, areaId: number) => Promise<void>;
|
|
127
|
-
/**
|
|
128
|
-
* Upload an image and get the uploaded image
|
|
129
|
-
* @param file The file to upload
|
|
130
|
-
* @param progress A callback to get the upload progress
|
|
131
|
-
* @returns The uploaded image
|
|
132
|
-
*/
|
|
133
|
-
createImage: (file: File, progress?: (percentage: number) => void) => Promise<ZakekeImage>;
|
|
134
|
-
createImageFromUrl: (url: string) => Promise<ZakekeImage>;
|
|
135
|
-
setItemImage: (guid: string, imageId: number) => Promise<void>;
|
|
136
|
-
setItemFontFamily: (guid: string, fontFamily: string) => void;
|
|
137
|
-
setItemColor: (guid: string, color: string) => void;
|
|
138
|
-
setItemBold: (guid: string, bold: boolean) => void;
|
|
139
|
-
setItemItalic: (guid: string, italic: boolean) => void;
|
|
140
|
-
setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
|
|
141
|
-
setItemText: (guid: string, text: string) => void;
|
|
142
|
-
addItemText: (settings: {
|
|
143
|
-
text: string;
|
|
144
|
-
fontFamily: string;
|
|
145
|
-
}, areaId: number) => Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Remove an item from the customization
|
|
148
|
-
* @param guid The guid of the item to remove
|
|
149
|
-
*/
|
|
150
|
-
removeItem: (guid: string) => Promise<void>;
|
|
151
|
-
setQuantity: (quantity: number) => void;
|
|
152
|
-
getShareCompositionUrl: () => Promise<string>;
|
|
153
|
-
saveComposition: (customPreviewSize?: CustomPreviewSize) => Promise<void>;
|
|
154
|
-
loadComposition: (id: string) => Promise<void>;
|
|
155
|
-
switchFullscreen: () => void;
|
|
156
|
-
openSecondScreen: () => void;
|
|
157
|
-
isFullscreenMode: boolean;
|
|
158
|
-
zoomIn: () => void;
|
|
159
|
-
zoomOut: () => void;
|
|
160
|
-
updateView: (adjustCamera?: boolean) => void;
|
|
161
|
-
setHighlightSettings: (settings: {
|
|
162
|
-
color: string;
|
|
163
|
-
size: number;
|
|
164
|
-
}) => void;
|
|
165
|
-
hasExplodedMode: () => boolean;
|
|
166
|
-
isExplodedMode: boolean;
|
|
167
|
-
setExplodedMode: (exploded: boolean) => void;
|
|
168
|
-
getMeshIDbyName: (name: string) => string | undefined | null;
|
|
169
|
-
hideMeshAndSaveState: (meshId: string) => void;
|
|
170
|
-
restoreMeshVisibility: (meshId: string) => void;
|
|
171
|
-
setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
|
|
172
|
-
clearListeners: () => void;
|
|
173
|
-
addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
|
|
174
|
-
focusAttribute: (attributeId: number) => void;
|
|
175
|
-
highlightGroup: (groupId: number) => void;
|
|
176
|
-
highlightAttribute: (attributeId: number) => void;
|
|
177
|
-
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
178
|
-
getMobileArUrl: (onFlyArUrl?: string) => Promise<Blob | string | null>;
|
|
179
|
-
openArMobile: (url: string) => void;
|
|
180
|
-
isSceneArEnabled: () => boolean;
|
|
181
|
-
isArDeviceCompliant: () => boolean;
|
|
182
|
-
IS_ANDROID: boolean;
|
|
183
|
-
IS_IOS: boolean;
|
|
184
|
-
setBackgroundColor: (color: string, alpha: number) => void;
|
|
185
|
-
getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
|
|
186
|
-
isSceneTryOnEnabled: () => boolean;
|
|
187
|
-
setCameraLocked: (isBlocked: boolean) => void;
|
|
188
|
-
getTemplateUploadRestrictictions: (templateId: number, areaId: number) => TemplateUploadRestrictictions;
|
|
189
|
-
saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
|
|
190
|
-
loadSavedComposition: (docID: string) => Promise<void>;
|
|
191
|
-
deleteSavedComposition: (docId: string) => Promise<void>;
|
|
192
|
-
exportSceneToGlb: () => Promise<string | Blob | null>;
|
|
193
|
-
reset: () => Promise<void>;
|
|
194
|
-
undo: () => Promise<void>;
|
|
195
|
-
redo: () => Promise<void>;
|
|
196
|
-
getCopyrightMessageAccepted: () => boolean;
|
|
197
|
-
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
198
|
-
validationNFTEmail: (email: string) => boolean;
|
|
199
|
-
validationNFTWalletAddress: (walletAddress: string) => boolean;
|
|
200
|
-
templateMacroCategories: TemplateMacroCategory[] | null;
|
|
201
|
-
applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
|
|
202
|
-
configureByAI: (text: string) => Promise<void>;
|
|
203
|
-
hasVTryOnEnabled: boolean;
|
|
204
|
-
canUseTryOn: boolean;
|
|
205
|
-
canUsePD: boolean;
|
|
206
|
-
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
207
|
-
isTryOnMeshVisible: boolean;
|
|
208
|
-
isMandatoryPD: boolean;
|
|
209
|
-
isVisibleMeshShownForTryOn: boolean;
|
|
210
|
-
setPDDistance: (distance: number) => void;
|
|
211
|
-
pdDistance: () => number;
|
|
212
|
-
exportTryOnMeshToGlb: () => Promise<string | Blob | null>;
|
|
213
|
-
}
|
|
214
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @module Zakeke
|
|
3
|
+
*/
|
|
4
|
+
import { FocusAttributesEventListener } from '@zakeke/zakeke-3d-core';
|
|
5
|
+
import { EventMessage, FontFamily, Group, Item, NftForm, NftSettings, OnBeforeSendDataToParent, PrintingMethodsRestrictions, Product, Template, TemplateMacroCategory, TextSanitationResult, Translations, UIConfig, VisibleEventMessage } from '..';
|
|
6
|
+
import { Camera, ImageMacroCategory, ProductQuantityRule, SellerSettings, TemplateUploadRestrictictions, ZakekeImage } from '../models';
|
|
7
|
+
interface RestrictionColor {
|
|
8
|
+
colorCode: string;
|
|
9
|
+
isDefault: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface CustomPreviewSize {
|
|
12
|
+
customCartPreviewWidth: number;
|
|
13
|
+
customCartPreviewHeight: number;
|
|
14
|
+
}
|
|
15
|
+
interface ThemeCompositions {
|
|
16
|
+
name: string;
|
|
17
|
+
docID: string;
|
|
18
|
+
previewImageUrl: string;
|
|
19
|
+
tags: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Contains all the data and methods to control a Zakeke configuration
|
|
23
|
+
*/
|
|
24
|
+
export interface Zakeke {
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
internalProduct: MPlaza.Model | null;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
internalScene: Zakeke.Scene | null;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
internalCurrentTemplate: MPlaza.Design | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The current price of the configuration plus the product price
|
|
39
|
+
*/
|
|
40
|
+
price: number;
|
|
41
|
+
isOutOfStock: boolean;
|
|
42
|
+
culture: string;
|
|
43
|
+
currency: string;
|
|
44
|
+
isSceneLoading: boolean;
|
|
45
|
+
isAddToCartLoading: boolean;
|
|
46
|
+
isInfoPointContentVisible: boolean;
|
|
47
|
+
isViewerReady: boolean;
|
|
48
|
+
fonts: FontFamily[];
|
|
49
|
+
disableTextColors: boolean;
|
|
50
|
+
defaultColor: string;
|
|
51
|
+
textColors: RestrictionColor[];
|
|
52
|
+
groups: Group[];
|
|
53
|
+
templates: Template[];
|
|
54
|
+
loadedComposition: {
|
|
55
|
+
templateName: string;
|
|
56
|
+
attributesOptions: Map<number, number>;
|
|
57
|
+
selectedCategoryID: number | null;
|
|
58
|
+
} | null;
|
|
59
|
+
currentTemplate: Template | null;
|
|
60
|
+
items: Item[];
|
|
61
|
+
productName: string;
|
|
62
|
+
productCode: string;
|
|
63
|
+
product: Product | null;
|
|
64
|
+
cameras: Camera[];
|
|
65
|
+
sellerSettings: SellerSettings | null;
|
|
66
|
+
quantityRule: ProductQuantityRule | null;
|
|
67
|
+
eventMessages: EventMessage[] | null;
|
|
68
|
+
personalizedMessages: EventMessage[] | null;
|
|
69
|
+
visibleEventMessages: VisibleEventMessage[];
|
|
70
|
+
isAssetsLoading: boolean;
|
|
71
|
+
draftCompositions: ThemeCompositions[] | null;
|
|
72
|
+
additionalCustomProperties: {
|
|
73
|
+
name: string;
|
|
74
|
+
value: number;
|
|
75
|
+
label: string;
|
|
76
|
+
formatString: string;
|
|
77
|
+
}[] | null;
|
|
78
|
+
currentAttributesSelection: object | null;
|
|
79
|
+
currentCompositionInfo: {
|
|
80
|
+
compositionId: string | null;
|
|
81
|
+
compositionName: string | null;
|
|
82
|
+
compositionTags: string[] | null;
|
|
83
|
+
} | null;
|
|
84
|
+
translations: Translations | null;
|
|
85
|
+
nftSettings: NftSettings | null;
|
|
86
|
+
useLegacyScreenshot: boolean;
|
|
87
|
+
isAIEnabled: boolean;
|
|
88
|
+
uiConfig: UIConfig | null;
|
|
89
|
+
backgroundColor: string;
|
|
90
|
+
removeBackground: boolean;
|
|
91
|
+
setMouseWheelZoomEnabled: (enabled: boolean) => void;
|
|
92
|
+
selectOption: (optionId: number) => void;
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
internalAppendViewer: (container: HTMLElement) => void;
|
|
97
|
+
getPrintingMethodsRestrictions: () => PrintingMethodsRestrictions;
|
|
98
|
+
designUpdate: () => void;
|
|
99
|
+
createQuote: (formData: any) => Promise<any>;
|
|
100
|
+
setTemplate: (templateId: number) => Promise<void>;
|
|
101
|
+
isAreaVisible: (areaId: number) => boolean;
|
|
102
|
+
quantity: number;
|
|
103
|
+
saveTemplate: (templateName: string, selectedCategoryID: number | null, attributesOptions: Map<number, number>) => Promise<void>;
|
|
104
|
+
addToCart: (additionalProperties: Record<string, any>, OnBeforeSendDataToParent?: (data: OnBeforeSendDataToParent) => Promise<Record<string, any>>, legacyScreenshot?: boolean, nftForm?: NftForm) => Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Create a PDF of the current configuration
|
|
107
|
+
* @returns The URL of the PDF
|
|
108
|
+
*/
|
|
109
|
+
getPDF: () => Promise<string>;
|
|
110
|
+
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
|
|
111
|
+
originalUrl: string;
|
|
112
|
+
rewrittenUrl: string;
|
|
113
|
+
}>;
|
|
114
|
+
setCamera: (id: string, onlyAngleOfView?: boolean, animate?: boolean) => void;
|
|
115
|
+
setCameraByName: (name: string, onlyAngleOfView?: boolean, animate?: boolean) => void;
|
|
116
|
+
setCameraZoomEnabled: (enabled: boolean) => void;
|
|
117
|
+
resetCameraPivot: () => void;
|
|
118
|
+
setCameraPivot: (meshId: string) => void;
|
|
119
|
+
fullyLoadFont: (fontFamily: string | FontFamily) => Promise<FontFamily>;
|
|
120
|
+
sanitizeString: (family: FontFamily, text: string) => string;
|
|
121
|
+
getSanitationText: (family: FontFamily, text: string) => TextSanitationResult;
|
|
122
|
+
getImages: (categoryId: number) => Promise<ZakekeImage[]>;
|
|
123
|
+
getMacroCategories: () => Promise<ImageMacroCategory[]>;
|
|
124
|
+
previewOnly__setItemImageFromBase64: (guid: string, base64: string) => void;
|
|
125
|
+
setItemImageFromFile: (guid: string, file: File) => Promise<void>;
|
|
126
|
+
addItemImage: (id: number, areaId: number) => Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Upload an image and get the uploaded image
|
|
129
|
+
* @param file The file to upload
|
|
130
|
+
* @param progress A callback to get the upload progress
|
|
131
|
+
* @returns The uploaded image
|
|
132
|
+
*/
|
|
133
|
+
createImage: (file: File, progress?: (percentage: number) => void) => Promise<ZakekeImage>;
|
|
134
|
+
createImageFromUrl: (url: string) => Promise<ZakekeImage>;
|
|
135
|
+
setItemImage: (guid: string, imageId: number) => Promise<void>;
|
|
136
|
+
setItemFontFamily: (guid: string, fontFamily: string) => void;
|
|
137
|
+
setItemColor: (guid: string, color: string) => void;
|
|
138
|
+
setItemBold: (guid: string, bold: boolean) => void;
|
|
139
|
+
setItemItalic: (guid: string, italic: boolean) => void;
|
|
140
|
+
setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
|
|
141
|
+
setItemText: (guid: string, text: string) => void;
|
|
142
|
+
addItemText: (settings: {
|
|
143
|
+
text: string;
|
|
144
|
+
fontFamily: string;
|
|
145
|
+
}, areaId: number) => Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Remove an item from the customization
|
|
148
|
+
* @param guid The guid of the item to remove
|
|
149
|
+
*/
|
|
150
|
+
removeItem: (guid: string) => Promise<void>;
|
|
151
|
+
setQuantity: (quantity: number) => void;
|
|
152
|
+
getShareCompositionUrl: () => Promise<string>;
|
|
153
|
+
saveComposition: (customPreviewSize?: CustomPreviewSize) => Promise<void>;
|
|
154
|
+
loadComposition: (id: string) => Promise<void>;
|
|
155
|
+
switchFullscreen: () => void;
|
|
156
|
+
openSecondScreen: () => void;
|
|
157
|
+
isFullscreenMode: boolean;
|
|
158
|
+
zoomIn: () => void;
|
|
159
|
+
zoomOut: () => void;
|
|
160
|
+
updateView: (adjustCamera?: boolean) => void;
|
|
161
|
+
setHighlightSettings: (settings: {
|
|
162
|
+
color: string;
|
|
163
|
+
size: number;
|
|
164
|
+
}) => void;
|
|
165
|
+
hasExplodedMode: () => boolean;
|
|
166
|
+
isExplodedMode: boolean;
|
|
167
|
+
setExplodedMode: (exploded: boolean) => void;
|
|
168
|
+
getMeshIDbyName: (name: string) => string | undefined | null;
|
|
169
|
+
hideMeshAndSaveState: (meshId: string) => void;
|
|
170
|
+
restoreMeshVisibility: (meshId: string) => void;
|
|
171
|
+
setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
|
|
172
|
+
clearListeners: () => void;
|
|
173
|
+
addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
|
|
174
|
+
focusAttribute: (attributeId: number) => void;
|
|
175
|
+
highlightGroup: (groupId: number) => void;
|
|
176
|
+
highlightAttribute: (attributeId: number) => void;
|
|
177
|
+
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
178
|
+
getMobileArUrl: (onFlyArUrl?: string) => Promise<Blob | string | null>;
|
|
179
|
+
openArMobile: (url: string) => void;
|
|
180
|
+
isSceneArEnabled: () => boolean;
|
|
181
|
+
isArDeviceCompliant: () => boolean;
|
|
182
|
+
IS_ANDROID: boolean;
|
|
183
|
+
IS_IOS: boolean;
|
|
184
|
+
setBackgroundColor: (color: string, alpha: number) => void;
|
|
185
|
+
getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
|
|
186
|
+
isSceneTryOnEnabled: () => boolean;
|
|
187
|
+
setCameraLocked: (isBlocked: boolean) => void;
|
|
188
|
+
getTemplateUploadRestrictictions: (templateId: number, areaId: number) => TemplateUploadRestrictictions;
|
|
189
|
+
saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
|
|
190
|
+
loadSavedComposition: (docID: string) => Promise<void>;
|
|
191
|
+
deleteSavedComposition: (docId: string) => Promise<void>;
|
|
192
|
+
exportSceneToGlb: () => Promise<string | Blob | null>;
|
|
193
|
+
reset: () => Promise<void>;
|
|
194
|
+
undo: () => Promise<void>;
|
|
195
|
+
redo: () => Promise<void>;
|
|
196
|
+
getCopyrightMessageAccepted: () => boolean;
|
|
197
|
+
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
198
|
+
validationNFTEmail: (email: string) => boolean;
|
|
199
|
+
validationNFTWalletAddress: (walletAddress: string) => boolean;
|
|
200
|
+
templateMacroCategories: TemplateMacroCategory[] | null;
|
|
201
|
+
applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
|
|
202
|
+
configureByAI: (text: string) => Promise<void>;
|
|
203
|
+
hasVTryOnEnabled: boolean;
|
|
204
|
+
canUseTryOn: boolean;
|
|
205
|
+
canUsePD: boolean;
|
|
206
|
+
getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
|
|
207
|
+
isTryOnMeshVisible: boolean;
|
|
208
|
+
isMandatoryPD: boolean;
|
|
209
|
+
isVisibleMeshShownForTryOn: boolean;
|
|
210
|
+
setPDDistance: (distance: number) => void;
|
|
211
|
+
pdDistance: () => number;
|
|
212
|
+
exportTryOnMeshToGlb: () => Promise<string | Blob | null>;
|
|
213
|
+
}
|
|
214
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -24004,9 +24004,9 @@ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.fre
|
|
|
24004
24004
|
|
|
24005
24005
|
|
|
24006
24006
|
|
|
24007
|
-
var QRCodeAndTitleContainer = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: left;\n\tjustify-content: center;\n\tpadding: 20px;\n\ttext-align: center;\n\tspan {\n\t\tmargin-top: 20px;\n\t}\n
|
|
24008
|
-
var QRCodeTitle = styled_components__WEBPACK_IMPORTED_MODULE_2___default().span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tfont-size: 24px;\n\tcolor: black;\n\tfont-weight: bold;\n\tmargin: 0 0 20px 0;\n
|
|
24009
|
-
var QRCodeContainer = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n
|
|
24007
|
+
var QRCodeAndTitleContainer = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: left;\n\tjustify-content: center;\n\tpadding: 20px;\n\ttext-align: center;\n\tspan {\n\t\tmargin-top: 20px;\n\t}\n"])));
|
|
24008
|
+
var QRCodeTitle = styled_components__WEBPACK_IMPORTED_MODULE_2___default().span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tfont-size: 24px;\n\tcolor: black;\n\tfont-weight: bold;\n\tmargin: 0 0 20px 0;\n"])));
|
|
24009
|
+
var QRCodeContainer = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n"])));
|
|
24010
24010
|
var DeepARQrCodeContentContainer = function DeepARQrCodeContentContainer(_ref) {
|
|
24011
24011
|
var url = _ref.url;
|
|
24012
24012
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QRCodeAndTitleContainer, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QRCodeTitle, null, "Scan the QR code to virtually ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("br", null), " try your shoes"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(QRCodeContainer, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_qr_code__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
@@ -24339,7 +24339,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24339
24339
|
/* harmony import */ var _state_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../state/provider */ "./src/state/provider.tsx");
|
|
24340
24340
|
/* harmony import */ var _deepARQrCode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../deepARQrCode */ "./src/components/tryon/deepARQrCode.tsx");
|
|
24341
24341
|
/* harmony import */ var _tryOnFrame__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../tryOnFrame */ "./src/components/tryon/tryOnFrame.tsx");
|
|
24342
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../helpers */ "./src/helpers.tsx");
|
|
24343
24342
|
var _templateObject,
|
|
24344
24343
|
_templateObject2,
|
|
24345
24344
|
_templateObject3,
|
|
@@ -24369,7 +24368,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
24369
24368
|
|
|
24370
24369
|
|
|
24371
24370
|
|
|
24372
|
-
|
|
24373
24371
|
// #region interfaces
|
|
24374
24372
|
var DeepARTryOnBaseReceivedMessage = {
|
|
24375
24373
|
WaitingAuthentication: 'WAITING_AUTH',
|
|
@@ -24406,7 +24404,7 @@ var DeepARTryOnResponseMessage = _objectSpread(_objectSpread({}, _tryOnModels__W
|
|
|
24406
24404
|
// `;
|
|
24407
24405
|
|
|
24408
24406
|
var DeepARTryOnComponentContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: fixed;\n\tbackground-color: rgba(0, 0, 0, 0.7);\n\tleft: 0px;\n\ttop: 0px;\n\twidth: 100%;\n\theight: 100dvh;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\toverflow: auto;\n\tz-index: 12;\n\tborder-radius: 10px;\n"])));
|
|
24409
|
-
var DeepARContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tdisplay: grid;\n\tposition: relative;\n\twidth: 550px;\n\tbackground-color: white;\n\tborder-radius: 10px;\n\toverflow: hidden;\n
|
|
24407
|
+
var DeepARContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tdisplay: grid;\n\tposition: relative;\n\twidth: 550px;\n\tbackground-color: white;\n\tborder-radius: 10px;\n\toverflow: hidden;\n"])));
|
|
24410
24408
|
var DeepARMobileContainer = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tposition: fixed;\n\tbackground-color: rgba(0, 0, 0, 0.7);\n\tleft: 0px;\n\ttop: 0px;\n\twidth: 100%;\n\theight: 100%;\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n\talign-items: center;\n\toverflow: auto;\n\tz-index: 12;\n\tborder-radius: 10px;\n"])));
|
|
24411
24409
|
var CloseButton = styled_components__WEBPACK_IMPORTED_MODULE_1___default().button(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\tposition: absolute;\n\ttop: 10px;\n\tright: 10px;\n\tbackground-color: transparent;\n\tborder: none;\n\tcolor: black;\n\tfont-size: 20px;\n\tcursor: pointer;\n"])));
|
|
24412
24410
|
var DeepARTryOn = function DeepARTryOn(props) {
|
|
@@ -24432,10 +24430,7 @@ var DeepARTryOn = function DeepARTryOn(props) {
|
|
|
24432
24430
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24433
24431
|
deepARIframeUrl = _React$useState2[0],
|
|
24434
24432
|
setDeepARIframeUrl = _React$useState2[1];
|
|
24435
|
-
var isMobile =
|
|
24436
|
-
console.log('isMobile', isMobile);
|
|
24437
|
-
console.log('isAndroid', _helpers__WEBPACK_IMPORTED_MODULE_7__.IS_ANDROID);
|
|
24438
|
-
console.log('isIos', _helpers__WEBPACK_IMPORTED_MODULE_7__.IS_IOS);
|
|
24433
|
+
var isMobile = window.innerWidth <= 768;
|
|
24439
24434
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
24440
24435
|
setTryon(_objectSpread(_objectSpread({}, tryon), {}, {
|
|
24441
24436
|
closeFrame: function closeFrame() {
|
|
@@ -28689,18 +28684,18 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
28689
28684
|
while (1) switch (_context65.prev = _context65.next) {
|
|
28690
28685
|
case 0:
|
|
28691
28686
|
sceneCode = _this.isDAMViewer ? (_this$zkProduct$get2 = (_this$zkProduct4 = _this.zkProduct) === null || _this$zkProduct4 === void 0 ? void 0 : _this$zkProduct4.get('code')) !== null && _this$zkProduct$get2 !== void 0 ? _this$zkProduct$get2 : undefined : _this.selection.getCompositionHashCode();
|
|
28692
|
-
|
|
28693
|
-
_context65.
|
|
28687
|
+
url = null;
|
|
28688
|
+
_context65.prev = 2;
|
|
28689
|
+
_context65.next = 5;
|
|
28694
28690
|
return document.requestStorageAccess();
|
|
28695
|
-
case
|
|
28696
|
-
_context65.next =
|
|
28691
|
+
case 5:
|
|
28692
|
+
_context65.next = 10;
|
|
28697
28693
|
break;
|
|
28698
|
-
case
|
|
28699
|
-
_context65.prev =
|
|
28700
|
-
_context65.t0 = _context65["catch"](
|
|
28694
|
+
case 7:
|
|
28695
|
+
_context65.prev = 7;
|
|
28696
|
+
_context65.t0 = _context65["catch"](2);
|
|
28701
28697
|
console.error('Storage access denied');
|
|
28702
|
-
case
|
|
28703
|
-
url = null;
|
|
28698
|
+
case 10:
|
|
28704
28699
|
if (!_this.isSceneArOnTheFly()) {
|
|
28705
28700
|
_context65.next = 16;
|
|
28706
28701
|
break;
|
|
@@ -28709,34 +28704,48 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
|
|
|
28709
28704
|
return _this.getMobileLocalArUrl(onFlyArUrl);
|
|
28710
28705
|
case 13:
|
|
28711
28706
|
url = _context65.sent;
|
|
28712
|
-
_context65.next =
|
|
28707
|
+
_context65.next = 31;
|
|
28713
28708
|
break;
|
|
28714
28709
|
case 16:
|
|
28715
28710
|
if (!_helpers__WEBPACK_IMPORTED_MODULE_7__.IS_IOS) {
|
|
28711
|
+
_context65.next = 25;
|
|
28712
|
+
break;
|
|
28713
|
+
}
|
|
28714
|
+
_context65.t1 = _this.getPregeneratedARUrl('usdz');
|
|
28715
|
+
if (_context65.t1) {
|
|
28716
28716
|
_context65.next = 22;
|
|
28717
28717
|
break;
|
|
28718
28718
|
}
|
|
28719
|
-
_context65.next =
|
|
28719
|
+
_context65.next = 21;
|
|
28720
28720
|
return _this.viewer.exportSceneToUsdzAsync(_this.zkScene.get('sceneID'), sceneCode, false);
|
|
28721
|
-
case
|
|
28722
|
-
|
|
28723
|
-
_context65.next = 25;
|
|
28724
|
-
break;
|
|
28721
|
+
case 21:
|
|
28722
|
+
_context65.t1 = _context65.sent;
|
|
28725
28723
|
case 22:
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
url = _context65.sent;
|
|
28724
|
+
url = _context65.t1;
|
|
28725
|
+
_context65.next = 31;
|
|
28726
|
+
break;
|
|
28730
28727
|
case 25:
|
|
28728
|
+
_context65.t2 = _this.getPregeneratedARUrl('glb');
|
|
28729
|
+
if (_context65.t2) {
|
|
28730
|
+
_context65.next = 30;
|
|
28731
|
+
break;
|
|
28732
|
+
}
|
|
28733
|
+
_context65.next = 29;
|
|
28734
|
+
return _this.viewer.exportSceneToRemoteGLBAsync(_this.zkScene.get('sceneID'), sceneCode, false);
|
|
28735
|
+
case 29:
|
|
28736
|
+
_context65.t2 = _context65.sent;
|
|
28737
|
+
case 30:
|
|
28738
|
+
url = _context65.t2;
|
|
28739
|
+
case 31:
|
|
28731
28740
|
if (_this.isDAMViewer) {
|
|
28732
28741
|
_this.makeDAMAnalyticsView(_models__WEBPACK_IMPORTED_MODULE_11__.DAMViewerAnalyticsEventType.ViewArProdutc);
|
|
28733
28742
|
}
|
|
28734
28743
|
return _context65.abrupt("return", url);
|
|
28735
|
-
case
|
|
28744
|
+
case 33:
|
|
28736
28745
|
case "end":
|
|
28737
28746
|
return _context65.stop();
|
|
28738
28747
|
}
|
|
28739
|
-
}, _callee64, null, [[
|
|
28748
|
+
}, _callee64, null, [[2, 7]]);
|
|
28740
28749
|
}));
|
|
28741
28750
|
return function (_x60) {
|
|
28742
28751
|
return _ref67.apply(this, arguments);
|