zakeke-configurator-react 0.1.355 → 0.1.357

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,438 +1,438 @@
1
- /// <reference path="../../../../../../../typescript_definitions/declarations/All.d.ts" />
2
- import { FocusAttributesEventListener } from '@zakeke/zakeke-3d-core';
3
- import { EventMessage, ExtensionFields, NftForm, NftSettings, OnBeforeSendDataToParent, SceneAnimationsConfig, TryOnMode, TryOnProvidersTypesMapping, VisibleEventMessage } from '.';
4
- import { PlatformAttributeSelection } from './integrations/Integration';
5
- import { BootParameters, Camera, Composition, FontFamily, Group, ImageMacroCategory, Item, Product, ProductQuantityRule, SellerSettings, Settings, Template, TemplateMacroCategory, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller, AIPresetCategory, AIPreset, AIProductStagingRule, AIProductStagingOptions, AIProductStagingResult, AIVirtualTryOnOptions, AIVirtualTryOnResult, AIVirtualModelRule } from './models';
6
- import { AxiosResponse } from 'axios';
7
- import { DAMViewerAnalyticsEventType, PrintingMethodsRestrictions, TextSanitationResult, UIConfig, ZakekeImage } from './models';
8
- declare global {
9
- interface Window {
10
- token: string;
11
- isOwin: boolean;
12
- }
13
- }
14
- interface RestrictionColor {
15
- colorCode: string;
16
- isDefault: boolean;
17
- }
18
- interface CustomPreviewSize {
19
- customCartPreviewWidth: number;
20
- customCartPreviewHeight: number;
21
- }
22
- interface ThemeCompositions {
23
- name: string;
24
- docID: string;
25
- previewImageUrl: string;
26
- tags: string[];
27
- }
28
- interface CurrentCompositionInfo {
29
- compositionId: string | null;
30
- compositionName: string | null;
31
- compositionTags: string[] | null;
32
- }
33
- export declare class ZakekeEnvironment {
34
- private booted;
35
- private token;
36
- private platformAttributesSelection;
37
- private settings;
38
- private platform;
39
- private viewer;
40
- private selection;
41
- private integration;
42
- private previewWidth;
43
- private previewHeight;
44
- private clientPreviewWidth;
45
- private clientPreviewHeight;
46
- private shareUrlPrefix;
47
- private events;
48
- private zkProduct;
49
- private zkScene;
50
- private zkCurrentTemplate;
51
- private zkTemplates;
52
- private internalIsFullscreen;
53
- private highlightSettings;
54
- private previousMeshesVisibleStates;
55
- private lastCameraLocation;
56
- private enableShareCompositionUrl;
57
- private sharedCompositionDocId;
58
- private templateId;
59
- deepARsceneGLBUrl: string | null;
60
- loadedComposition: {
61
- templateName: string;
62
- attributesOptions: Map<number, number>;
63
- selectedCategoryID: number | null;
64
- } | null;
65
- private savedCompositions;
66
- private isDraftEditor;
67
- private isViewerMode;
68
- private isDAMViewer;
69
- private isPresetConfigurationEditor;
70
- shouldLoadDesign: boolean | null;
71
- private debugMode;
72
- private draftCompositionDocId;
73
- private initialSelection;
74
- private undoStack;
75
- private redoStack;
76
- private pricingCalculator;
77
- currentAttributesSelection: Object | null;
78
- currentCompositionInfo: CurrentCompositionInfo | null;
79
- private copyrightMessageLocalStorageKey;
80
- private isPupillaryDistanceMandatory;
81
- isAIEnabled: boolean;
82
- isAIStudioShoppingPreviewEnabled: boolean;
83
- isAIStudioEditorEnabled: boolean;
84
- isAIStudioEnabled: boolean;
85
- isAiProductStagingEnabled: boolean;
86
- isAiVtoEnabled: boolean;
87
- private lastProductStagingGenerationTime;
88
- private lastVirtualTryonGenerationTime;
89
- /** Session ID (GUID) persisted for the lifetime of this environment instance, sent as ZKK-Session-ID header */
90
- private readonly aiSessionId;
91
- sellerSettings: SellerSettings | null;
92
- get internalProduct(): MPlaza.Model | null;
93
- get internalScene(): Zakeke.Scene | null;
94
- get internalCurrentTemplate(): MPlaza.Design | null | undefined;
95
- themeCompositions: ThemeCompositions[] | null;
96
- currency: string;
97
- groups: Group[];
98
- fonts: FontFamily[];
99
- defaultFontID: number | null;
100
- disableTextColors: boolean;
101
- textColors: RestrictionColor[];
102
- /**
103
- * Get the current text default color.
104
- */
105
- defaultColor: string;
106
- quantity: number;
107
- quantityRule: ProductQuantityRule | null;
108
- culture: string;
109
- productCode: string;
110
- productName: string;
111
- price: number;
112
- isOutOfStock: boolean;
113
- composition: any;
114
- compositionId: string | null;
115
- templates: Template[];
116
- currentTemplate: Template | null;
117
- product: Product | null;
118
- templateMacroCategories: TemplateMacroCategory[] | null;
119
- selectedTemplateCategory: string | null;
120
- cameras: Camera[];
121
- isExplodedMode: boolean;
122
- isAssetsLoading: boolean;
123
- isCompositionSaving: boolean;
124
- additionalCustomProperties: ExtensionFields[];
125
- nftSettings: NftSettings | null;
126
- eventMessages: EventMessage[] | null;
127
- personalizedMessages: EventMessage[] | null;
128
- visibleEventMessages: VisibleEventMessage[];
129
- tryOnProvidersSettings: TryOnProvidersTypesMapping | null;
130
- tryOnProductSettings: TryOnProduct | null;
131
- tryOnSellerSettings: TryOnSeller | null;
132
- pdSettings: number;
133
- isInfoPointContentVisible: boolean;
134
- imagesMacroCategories: ImageMacroCategory[];
135
- private internalTranslations;
136
- areTranslationsLoaded: boolean;
137
- private integrationVersion;
138
- useLegacyScreenshot: boolean;
139
- visibleCustomizer: MPlaza.Customizer | null;
140
- get isFullscreenMode(): boolean;
141
- get userSettings(): Settings;
142
- get isViewerReady(): boolean;
143
- get isShoppingPreview(): boolean;
144
- uiConfig: UIConfig | null;
145
- animationsConfig: SceneAnimationsConfig | null;
146
- backgroundColor: string | null;
147
- removeBackground: boolean;
148
- constructor();
149
- private fetchVisitorToken;
150
- private parseParameters;
151
- makeDAMAnalyticsView(type: DAMViewerAnalyticsEventType): Promise<AxiosResponse<any, any, {}>>;
152
- private getProduct;
153
- private getScene;
154
- private getComposerModels;
155
- private getFonts;
156
- getFontWeights: (font: FontFamily) => {
157
- normal: boolean;
158
- bold: boolean;
159
- italic: boolean;
160
- italicBold: boolean;
161
- normalWeight: number;
162
- boldWeight: number;
163
- italicWeight: number;
164
- italicBoldWeight: number;
165
- };
166
- private updateFontWeightForTextItem;
167
- checkFontSupports: (fontName: string, needsBold: boolean, needsItalic: boolean) => {
168
- canKeepStyles: boolean;
169
- supportsBold: boolean;
170
- supportsItalic: boolean;
171
- };
172
- private getSettings;
173
- private getSellerSetting;
174
- createQuote: (formData: any) => Promise<any>;
175
- private getPrice;
176
- private getTranslations;
177
- private loadLocalization;
178
- getTemplateMacroCategories: () => Promise<TemplateMacroCategory[]>;
179
- private loadScript;
180
- validationNFTEmail: (email: string) => boolean;
181
- validationNFTWalletAddress: (address: string) => boolean;
182
- private saveCustomerWalletInfo;
183
- setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
184
- getCopyrightMessageAccepted: () => boolean;
185
- /**
186
- * @private
187
- */
188
- boot: (parameters: BootParameters | null) => Promise<void>;
189
- private buildDeepARSceneGLBUrl;
190
- stopAllAnimations: () => void;
191
- hasAnimations: () => boolean;
192
- playAnimations: () => void;
193
- loadSceneFromGlbUrl: (glbUrl: string, sceneConfig: Zakeke.SceneConfig) => Promise<void>;
194
- appendViewer: (container: HTMLElement) => void;
195
- setHighlightSettings: (settings: {
196
- color: string;
197
- size: number;
198
- }) => void;
199
- renderDesign: () => Promise<void>;
200
- private debouncedChange;
201
- restoreLastCameraLocation: () => void;
202
- private buildRecapProps;
203
- updateRecapAndExtensionField: () => void;
204
- private getCurrentExtensionFields;
205
- private handleSceneLoaded;
206
- private getComposition;
207
- private getDesign;
208
- private internalLoadDesign;
209
- private addHotjarScript;
210
- private addGoogleTagManagerID;
211
- loadComposition: (id: string | null) => Promise<void>;
212
- private internalLoadComposition;
213
- sync3DAndPlatformSelectionWithCurrentSelection: () => Promise<void>;
214
- private cloneSelection;
215
- undo: () => Promise<void>;
216
- redo: () => Promise<void>;
217
- /**
218
- * Reset the platform attributes selection to the current selection
219
- */
220
- private resetPlatformAttributesSelection;
221
- reset: () => Promise<void>;
222
- private handleAttributeSelectionChanged;
223
- private handleAttributeEnabled;
224
- private handleAttributeDisabled;
225
- private handleAttributeOptionEnabled;
226
- private handleAttributeOptionDisabled;
227
- private setAttributeSelectionEnabled;
228
- private setOptionSelectionEnabled;
229
- private isOptionEnabled;
230
- private updateComposition;
231
- setQuantity(quantity: number): void;
232
- private _updatePrice;
233
- private updatePrice;
234
- private buildStructure;
235
- private createGroupFromSelection;
236
- private createStep;
237
- private createAttributeFromSelection;
238
- private createOptionFromSelection;
239
- private createTemplateGroupFromSelection;
240
- private saveDesignBackbone;
241
- private saveCompositionBackbone;
242
- private trigger;
243
- on: (event: string, callback: any) => void;
244
- off: (event: string, callback: any) => void;
245
- setTemplate: (templateId: number) => Promise<void>;
246
- getTemplateUploadRestrictions: (areaId: number) => {
247
- isUserImageAllowed: boolean;
248
- isJpgAllowed: boolean;
249
- isPngAllowed: boolean;
250
- isSvgAllowed: boolean;
251
- isPdfAllowed: boolean;
252
- isEpsAllowed: boolean;
253
- isPdfWithRasterAllowed: boolean;
254
- };
255
- private getTemplates;
256
- private saveProduct;
257
- private getTemplate;
258
- updateView: () => void;
259
- selectOption: (optionId: number) => void;
260
- selectOptionsbyPrompt(prompt: string): Promise<void>;
261
- focusGroup: (groupId: number) => void;
262
- focusAttribute: (attributeId: number) => Promise<void>;
263
- setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
264
- getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
265
- setCameraLocation(name: string, animate?: boolean): void;
266
- private base64StringToFile;
267
- saveTemplate: (templateName: string, selectedCategoryID: number | null, attributeOptions: Map<number, number>, save2dDesign?: boolean) => Promise<void>;
268
- addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<Record<string, any>>) | undefined, legacyScreenshot?: boolean, nftForm?: NftForm, saveDesignFromTemplateEditor?: boolean) => Promise<void>;
269
- zoomIn: () => void;
270
- zoomOut: () => void;
271
- isFullscreenEnabled: () => boolean;
272
- getDesignItemsInfo(): Item[];
273
- switchFullscreen: () => void;
274
- openSecondScreen: () => void;
275
- private extendedUpdate;
276
- exportSceneToUsdz: (hash: string) => Promise<import("@zakeke/zakeke-3d-core").Nullable<string> | undefined>;
277
- exportSceneToGlb: () => Promise<string | Blob | null>;
278
- setExplodedMode: (explodedMode: boolean) => Promise<void>;
279
- hasExplodedMode: () => boolean;
280
- setBackgroundColor: (color: string, alpha: number) => void;
281
- getCurrentSelection: () => PlatformAttributeSelection[];
282
- getScreenshot: (width?: number, height?: number, legacyScreenshot?: boolean, backgroundColor?: string | null, padding?: number, camera?: Zakeke.SceneCameraLocation | null) => Promise<string>;
283
- private fireItemsChange;
284
- isAreaVisible(areaId: number): boolean;
285
- removeItem: (guid: string) => Promise<void>;
286
- addItemText(settings: {
287
- text: string;
288
- fontFamily: string;
289
- }, areaId: number): Promise<void>;
290
- setPrintingMethod(printingMethodId: number, areaId: number): Promise<void>;
291
- getPrintingMethods(): Array<{
292
- printMethodId: number;
293
- name: string;
294
- }>;
295
- moveItemUp: (guid: string) => void;
296
- moveItemDown: (guid: string) => void;
297
- setItemText: (guid: string, text: string) => string;
298
- setItemItalic: (guid: string, italic: boolean, font?: FontFamily) => void;
299
- setItemBold: (guid: string, bold: boolean, font?: FontFamily) => void;
300
- setItemColor: (guid: string, color: string) => void;
301
- setItemFontFamily: (guid: string, fontFamily: string) => Promise<void>;
302
- setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
303
- fullyLoadFont(font: string | FontFamily): Promise<FontFamily>;
304
- sanitizeString: (family: FontFamily, text: string) => string;
305
- getSanitationText: (family: FontFamily, text: string) => TextSanitationResult;
306
- createImage: (file: File, progress?: ((percentage: number) => void) | undefined) => Promise<ZakekeImage>;
307
- createImageFromUrl: (url: string) => Promise<ZakekeImage>;
308
- addItemImage: (id: number, areaId: number) => Promise<string | null | undefined>;
309
- setItemImageFromFile: (guid: string, file: File, progress?: ((percentage: number) => void) | undefined) => Promise<void>;
310
- setItemImageFromBase64: (guid: string, base64: string) => Promise<void>;
311
- setItemImage: (guid: string, id: number) => Promise<void>;
312
- setItemSize: (guid: string, width: number, height: number) => Promise<void>;
313
- setItemConstraints: (guid: string, constraints: {
314
- canMove?: boolean;
315
- canResize?: boolean;
316
- canRotate?: boolean;
317
- canDelete?: boolean;
318
- }) => Promise<void>;
319
- T_static: (str: string) => any;
320
- T_dynamic: (str: string) => string;
321
- getMacroCategories: () => Promise<ImageMacroCategory[]>;
322
- getImages: (categoryId: number) => Promise<ZakekeImage[]>;
323
- setCameraPivot(meshID: string): void;
324
- resetCameraPivot(): void;
325
- setCameraZoomEnabled(enabled: boolean): void;
326
- setCameraByName(name: string, onlyAngleOfView?: boolean, animate?: boolean): void;
327
- findObjectByName(name: string): BABYLON.AbstractMesh | null | undefined;
328
- getPDF: () => Promise<string>;
329
- private rewriteShareUrl;
330
- getShareCompositionUrl: () => Promise<string>;
331
- saveCompositionCopy: (isSharing?: boolean) => Promise<any>;
332
- getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
333
- originalUrl: string;
334
- rewrittenUrl: string;
335
- }>;
336
- isSceneArOnTheFly: () => boolean | undefined;
337
- isArDeviceCompliant: () => boolean;
338
- isAndroidOrIOS: () => boolean;
339
- isAndroid: boolean;
340
- isIOS: boolean;
341
- private buildModelViewerUrl;
342
- isSceneArEnabled: () => boolean;
343
- private getPregeneratedARUrl;
344
- getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
345
- getMobileArUrl: () => Promise<string | null>;
346
- getMobileLocalArUrl: () => Promise<string>;
347
- openArMobile: (url: string) => void;
348
- private registerView;
349
- getMeshIDbyName: (name: string) => string | undefined;
350
- hightlightGroup(groupId: number): void;
351
- highlightAttribute(attributeId: number): void;
352
- /**
353
- * Hide a mesh and its children and save the state
354
- * @param meshId The mesh and childs to hide
355
- */
356
- hideMeshAndSaveState: (meshId: string) => void;
357
- /**
358
- * Restore a mesh visibility state from a previous saved one (see hideMeshAndSaveState)
359
- * @param meshId The mesh and childs to show
360
- */
361
- restoreMeshVisibility: (meshId: string) => void;
362
- /**
363
- * Change opacity for a specific mesh
364
- * @param meshId The mesh to change the opacity
365
- * @param opacity The opacity to set
366
- */
367
- setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
368
- addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
369
- clearListeners: () => void;
370
- setCameraLocked: (isBlocked?: boolean) => void;
371
- isSceneTryOnEnabled: () => boolean;
372
- getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
373
- saveComposition: (customPreviewSize?: CustomPreviewSize, legacyScreenshot?: boolean, isSharing?: boolean, saveDesignFromTemplateEditor?: boolean) => Promise<void>;
374
- private bootstrapComposition;
375
- loadSavedComposition: (docID: string) => Promise<void>;
376
- private updateSavedCompositions;
377
- themeCompositionsFromSavedCompositions: (compositions: Composition[]) => {
378
- name: string;
379
- docID: string;
380
- previewImageUrl: string;
381
- tags: string[];
382
- }[];
383
- saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
384
- deleteSavedComposition: (docId: string) => Promise<void>;
385
- applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
386
- configureByAI: (text: string) => Promise<void>;
387
- getTryOnProvidersList: () => Promise<TryOnProvidersTypesMapping | null>;
388
- getTryOnProductInfo: () => Promise<TryOnProduct | null>;
389
- getTryOnSellerInfo: (typeID: number, providerID: number) => Promise<TryOnSeller | null>;
390
- private getMessagesByProductCode;
391
- get hasVTryOnEnabled(): boolean;
392
- get canUseTryOn(): boolean;
393
- get canUsePD(): boolean;
394
- get isVisibleMeshShownForTryOn(): boolean;
395
- get isMandatoryPD(): boolean;
396
- get isTryOnMeshVisible(): boolean;
397
- get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
398
- setPDDistance: (distance: number) => void;
399
- pdDistance: () => number;
400
- exportTryOnMeshToGlb: () => Promise<Blob | null>;
401
- getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
402
- getDeepARDesktopIframeUrl: () => Promise<string>;
403
- tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
404
- /**
405
- * Ottiene le restrizioni sul printing method (che nel caso di un prodotto configuratore 3D c'è sempre ed è 1 solo).
406
- * @remarks
407
- * Se non ci sono restrizioni, ritorna quelle di default
408
- * @returns
409
- * Le restrizioni sul printing method o quelle di default
410
- */
411
- getPrintingMethodsRestrictions: () => PrintingMethodsRestrictions;
412
- setMouseWheelZoomEnabled: (enabled: boolean) => void;
413
- setCameraPinchingZoom: (toggle: boolean) => void;
414
- get isAiEditorEnabled(): boolean;
415
- startAIStudio: () => Promise<void>;
416
- private _aiPresetCategoriesPromise;
417
- private _aiPresetPresetsPromise;
418
- private fetchAllAIPresetCategories;
419
- private fetchAllAIPresetPresets;
420
- getAIPresetCategories: (presetType: string) => Promise<AIPresetCategory[]>;
421
- getAIPresetPresets: (presetType: string) => Promise<AIPreset[]>;
422
- getApplicableAIStagingRules: (options: {
423
- productID?: number;
424
- printTypeID?: number;
425
- }) => Promise<AIProductStagingRule | null>;
426
- getApplicableAIVirtualModelRules: (options: {
427
- productID?: number;
428
- printTypeID?: number;
429
- }) => Promise<AIVirtualModelRule | null>;
430
- private fetchServicesAvailability;
431
- private createAIProductStagingTask;
432
- private pollAIProductStagingTask;
433
- generateAIProductStaging: (options: AIProductStagingOptions) => Promise<AIProductStagingResult>;
434
- private createAIVirtualTryonTask;
435
- private pollAIVirtualTryonTask;
436
- generateAIVirtualTryon: (options: AIVirtualTryOnOptions) => Promise<AIVirtualTryOnResult>;
437
- }
438
- 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, SceneAnimationsConfig, TryOnMode, TryOnProvidersTypesMapping, VisibleEventMessage } from '.';
4
+ import { PlatformAttributeSelection } from './integrations/Integration';
5
+ import { BootParameters, Camera, Composition, FontFamily, Group, ImageMacroCategory, Item, Product, ProductQuantityRule, SellerSettings, Settings, Template, TemplateMacroCategory, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller, AIPresetCategory, AIPreset, AIProductStagingRule, AIProductStagingOptions, AIProductStagingResult, AIVirtualTryOnOptions, AIVirtualTryOnResult, AIVirtualModelRule } from './models';
6
+ import { AxiosResponse } from 'axios';
7
+ import { DAMViewerAnalyticsEventType, PrintingMethodsRestrictions, TextSanitationResult, UIConfig, ZakekeImage } from './models';
8
+ declare global {
9
+ interface Window {
10
+ token: string;
11
+ isOwin: boolean;
12
+ }
13
+ }
14
+ interface RestrictionColor {
15
+ colorCode: string;
16
+ isDefault: boolean;
17
+ }
18
+ interface CustomPreviewSize {
19
+ customCartPreviewWidth: number;
20
+ customCartPreviewHeight: number;
21
+ }
22
+ interface ThemeCompositions {
23
+ name: string;
24
+ docID: string;
25
+ previewImageUrl: string;
26
+ tags: string[];
27
+ }
28
+ interface CurrentCompositionInfo {
29
+ compositionId: string | null;
30
+ compositionName: string | null;
31
+ compositionTags: string[] | null;
32
+ }
33
+ export declare class ZakekeEnvironment {
34
+ private booted;
35
+ private token;
36
+ private platformAttributesSelection;
37
+ private settings;
38
+ private platform;
39
+ private viewer;
40
+ private selection;
41
+ private integration;
42
+ private previewWidth;
43
+ private previewHeight;
44
+ private clientPreviewWidth;
45
+ private clientPreviewHeight;
46
+ private shareUrlPrefix;
47
+ private events;
48
+ private zkProduct;
49
+ private zkScene;
50
+ private zkCurrentTemplate;
51
+ private zkTemplates;
52
+ private internalIsFullscreen;
53
+ private highlightSettings;
54
+ private previousMeshesVisibleStates;
55
+ private lastCameraLocation;
56
+ private enableShareCompositionUrl;
57
+ private sharedCompositionDocId;
58
+ private templateId;
59
+ deepARsceneGLBUrl: string | null;
60
+ loadedComposition: {
61
+ templateName: string;
62
+ attributesOptions: Map<number, number>;
63
+ selectedCategoryID: number | null;
64
+ } | null;
65
+ private savedCompositions;
66
+ private isDraftEditor;
67
+ private isViewerMode;
68
+ private isDAMViewer;
69
+ private isPresetConfigurationEditor;
70
+ shouldLoadDesign: boolean | null;
71
+ private debugMode;
72
+ private draftCompositionDocId;
73
+ private initialSelection;
74
+ private undoStack;
75
+ private redoStack;
76
+ private pricingCalculator;
77
+ currentAttributesSelection: Object | null;
78
+ currentCompositionInfo: CurrentCompositionInfo | null;
79
+ private copyrightMessageLocalStorageKey;
80
+ private isPupillaryDistanceMandatory;
81
+ isAIEnabled: boolean;
82
+ isAIStudioShoppingPreviewEnabled: boolean;
83
+ isAIStudioEditorEnabled: boolean;
84
+ isAIStudioEnabled: boolean;
85
+ isAiProductStagingEnabled: boolean;
86
+ isAiVtoEnabled: boolean;
87
+ private lastProductStagingGenerationTime;
88
+ private lastVirtualTryonGenerationTime;
89
+ /** Session ID (GUID) persisted for the lifetime of this environment instance, sent as ZKK-Session-ID header */
90
+ private readonly aiSessionId;
91
+ sellerSettings: SellerSettings | null;
92
+ get internalProduct(): MPlaza.Model | null;
93
+ get internalScene(): Zakeke.Scene | null;
94
+ get internalCurrentTemplate(): MPlaza.Design | null | undefined;
95
+ themeCompositions: ThemeCompositions[] | null;
96
+ currency: string;
97
+ groups: Group[];
98
+ fonts: FontFamily[];
99
+ defaultFontID: number | null;
100
+ disableTextColors: boolean;
101
+ textColors: RestrictionColor[];
102
+ /**
103
+ * Get the current text default color.
104
+ */
105
+ defaultColor: string;
106
+ quantity: number;
107
+ quantityRule: ProductQuantityRule | null;
108
+ culture: string;
109
+ productCode: string;
110
+ productName: string;
111
+ price: number;
112
+ isOutOfStock: boolean;
113
+ composition: any;
114
+ compositionId: string | null;
115
+ templates: Template[];
116
+ currentTemplate: Template | null;
117
+ product: Product | null;
118
+ templateMacroCategories: TemplateMacroCategory[] | null;
119
+ selectedTemplateCategory: string | null;
120
+ cameras: Camera[];
121
+ isExplodedMode: boolean;
122
+ isAssetsLoading: boolean;
123
+ isCompositionSaving: boolean;
124
+ additionalCustomProperties: ExtensionFields[];
125
+ nftSettings: NftSettings | null;
126
+ eventMessages: EventMessage[] | null;
127
+ personalizedMessages: EventMessage[] | null;
128
+ visibleEventMessages: VisibleEventMessage[];
129
+ tryOnProvidersSettings: TryOnProvidersTypesMapping | null;
130
+ tryOnProductSettings: TryOnProduct | null;
131
+ tryOnSellerSettings: TryOnSeller | null;
132
+ pdSettings: number;
133
+ isInfoPointContentVisible: boolean;
134
+ imagesMacroCategories: ImageMacroCategory[];
135
+ private internalTranslations;
136
+ areTranslationsLoaded: boolean;
137
+ private integrationVersion;
138
+ useLegacyScreenshot: boolean;
139
+ visibleCustomizer: MPlaza.Customizer | null;
140
+ get isFullscreenMode(): boolean;
141
+ get userSettings(): Settings;
142
+ get isViewerReady(): boolean;
143
+ get isShoppingPreview(): boolean;
144
+ uiConfig: UIConfig | null;
145
+ animationsConfig: SceneAnimationsConfig | null;
146
+ backgroundColor: string | null;
147
+ removeBackground: boolean;
148
+ constructor();
149
+ private fetchVisitorToken;
150
+ private parseParameters;
151
+ makeDAMAnalyticsView(type: DAMViewerAnalyticsEventType): Promise<AxiosResponse<any, any, {}>>;
152
+ private getProduct;
153
+ private getScene;
154
+ private getComposerModels;
155
+ private getFonts;
156
+ getFontWeights: (font: FontFamily) => {
157
+ normal: boolean;
158
+ bold: boolean;
159
+ italic: boolean;
160
+ italicBold: boolean;
161
+ normalWeight: number;
162
+ boldWeight: number;
163
+ italicWeight: number;
164
+ italicBoldWeight: number;
165
+ };
166
+ private updateFontWeightForTextItem;
167
+ checkFontSupports: (fontName: string, needsBold: boolean, needsItalic: boolean) => {
168
+ canKeepStyles: boolean;
169
+ supportsBold: boolean;
170
+ supportsItalic: boolean;
171
+ };
172
+ private getSettings;
173
+ private getSellerSetting;
174
+ createQuote: (formData: any) => Promise<any>;
175
+ private getPrice;
176
+ private getTranslations;
177
+ private loadLocalization;
178
+ getTemplateMacroCategories: () => Promise<TemplateMacroCategory[]>;
179
+ private loadScript;
180
+ validationNFTEmail: (email: string) => boolean;
181
+ validationNFTWalletAddress: (address: string) => boolean;
182
+ private saveCustomerWalletInfo;
183
+ setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
184
+ getCopyrightMessageAccepted: () => boolean;
185
+ /**
186
+ * @private
187
+ */
188
+ boot: (parameters: BootParameters | null) => Promise<void>;
189
+ private buildDeepARSceneGLBUrl;
190
+ stopAllAnimations: () => void;
191
+ hasAnimations: () => boolean;
192
+ playAnimations: () => void;
193
+ loadSceneFromGlbUrl: (glbUrl: string, sceneConfig: Zakeke.SceneConfig) => Promise<void>;
194
+ appendViewer: (container: HTMLElement) => void;
195
+ setHighlightSettings: (settings: {
196
+ color: string;
197
+ size: number;
198
+ }) => void;
199
+ renderDesign: () => Promise<void>;
200
+ private debouncedChange;
201
+ restoreLastCameraLocation: () => void;
202
+ private buildRecapProps;
203
+ updateRecapAndExtensionField: () => void;
204
+ private getCurrentExtensionFields;
205
+ private handleSceneLoaded;
206
+ private getComposition;
207
+ private getDesign;
208
+ private internalLoadDesign;
209
+ private addHotjarScript;
210
+ private addGoogleTagManagerID;
211
+ loadComposition: (id: string | null) => Promise<void>;
212
+ private internalLoadComposition;
213
+ sync3DAndPlatformSelectionWithCurrentSelection: () => Promise<void>;
214
+ private cloneSelection;
215
+ undo: () => Promise<void>;
216
+ redo: () => Promise<void>;
217
+ /**
218
+ * Reset the platform attributes selection to the current selection
219
+ */
220
+ private resetPlatformAttributesSelection;
221
+ reset: () => Promise<void>;
222
+ private handleAttributeSelectionChanged;
223
+ private handleAttributeEnabled;
224
+ private handleAttributeDisabled;
225
+ private handleAttributeOptionEnabled;
226
+ private handleAttributeOptionDisabled;
227
+ private setAttributeSelectionEnabled;
228
+ private setOptionSelectionEnabled;
229
+ private isOptionEnabled;
230
+ private updateComposition;
231
+ setQuantity(quantity: number): void;
232
+ private _updatePrice;
233
+ private updatePrice;
234
+ private buildStructure;
235
+ private createGroupFromSelection;
236
+ private createStep;
237
+ private createAttributeFromSelection;
238
+ private createOptionFromSelection;
239
+ private createTemplateGroupFromSelection;
240
+ private saveDesignBackbone;
241
+ private saveCompositionBackbone;
242
+ private trigger;
243
+ on: (event: string, callback: any) => void;
244
+ off: (event: string, callback: any) => void;
245
+ setTemplate: (templateId: number) => Promise<void>;
246
+ getTemplateUploadRestrictions: (areaId: number) => {
247
+ isUserImageAllowed: boolean;
248
+ isJpgAllowed: boolean;
249
+ isPngAllowed: boolean;
250
+ isSvgAllowed: boolean;
251
+ isPdfAllowed: boolean;
252
+ isEpsAllowed: boolean;
253
+ isPdfWithRasterAllowed: boolean;
254
+ };
255
+ private getTemplates;
256
+ private saveProduct;
257
+ private getTemplate;
258
+ updateView: () => void;
259
+ selectOption: (optionId: number) => void;
260
+ selectOptionsbyPrompt(prompt: string): Promise<void>;
261
+ focusGroup: (groupId: number) => void;
262
+ focusAttribute: (attributeId: number) => Promise<void>;
263
+ setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
264
+ getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
265
+ setCameraLocation(name: string, animate?: boolean): void;
266
+ private base64StringToFile;
267
+ saveTemplate: (templateName: string, selectedCategoryID: number | null, attributeOptions: Map<number, number>, save2dDesign?: boolean) => Promise<void>;
268
+ addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<Record<string, any>>) | undefined, legacyScreenshot?: boolean, nftForm?: NftForm, saveDesignFromTemplateEditor?: boolean) => Promise<void>;
269
+ zoomIn: () => void;
270
+ zoomOut: () => void;
271
+ isFullscreenEnabled: () => boolean;
272
+ getDesignItemsInfo(): Item[];
273
+ switchFullscreen: () => void;
274
+ openSecondScreen: () => void;
275
+ private extendedUpdate;
276
+ exportSceneToUsdz: (hash: string) => Promise<import("@zakeke/zakeke-3d-core").Nullable<string> | undefined>;
277
+ exportSceneToGlb: () => Promise<string | Blob | null>;
278
+ setExplodedMode: (explodedMode: boolean) => Promise<void>;
279
+ hasExplodedMode: () => boolean;
280
+ setBackgroundColor: (color: string, alpha: number) => void;
281
+ getCurrentSelection: () => PlatformAttributeSelection[];
282
+ getScreenshot: (width?: number, height?: number, legacyScreenshot?: boolean, backgroundColor?: string | null, padding?: number, camera?: Zakeke.SceneCameraLocation | null) => Promise<string>;
283
+ private fireItemsChange;
284
+ isAreaVisible(areaId: number): boolean;
285
+ removeItem: (guid: string) => Promise<void>;
286
+ addItemText(settings: {
287
+ text: string;
288
+ fontFamily: string;
289
+ }, areaId: number): Promise<void>;
290
+ setPrintingMethod(printingMethodId: number, areaId: number): Promise<void>;
291
+ getPrintingMethods(): Array<{
292
+ printMethodId: number;
293
+ name: string;
294
+ }>;
295
+ moveItemUp: (guid: string) => void;
296
+ moveItemDown: (guid: string) => void;
297
+ setItemText: (guid: string, text: string) => string;
298
+ setItemItalic: (guid: string, italic: boolean, font?: FontFamily) => void;
299
+ setItemBold: (guid: string, bold: boolean, font?: FontFamily) => void;
300
+ setItemColor: (guid: string, color: string) => void;
301
+ setItemFontFamily: (guid: string, fontFamily: string) => Promise<void>;
302
+ setItemTextOnPath: (guid: string, areaId: number, value: boolean) => void;
303
+ fullyLoadFont(font: string | FontFamily): Promise<FontFamily>;
304
+ sanitizeString: (family: FontFamily, text: string) => string;
305
+ getSanitationText: (family: FontFamily, text: string) => TextSanitationResult;
306
+ createImage: (file: File, progress?: ((percentage: number) => void) | undefined) => Promise<ZakekeImage>;
307
+ createImageFromUrl: (url: string) => Promise<ZakekeImage>;
308
+ addItemImage: (id: number, areaId: number) => Promise<string | null | undefined>;
309
+ setItemImageFromFile: (guid: string, file: File, progress?: ((percentage: number) => void) | undefined) => Promise<void>;
310
+ setItemImageFromBase64: (guid: string, base64: string) => Promise<void>;
311
+ setItemImage: (guid: string, id: number) => Promise<void>;
312
+ setItemSize: (guid: string, width: number, height: number) => Promise<void>;
313
+ setItemConstraints: (guid: string, constraints: {
314
+ canMove?: boolean;
315
+ canResize?: boolean;
316
+ canRotate?: boolean;
317
+ canDelete?: boolean;
318
+ }) => Promise<void>;
319
+ T_static: (str: string) => any;
320
+ T_dynamic: (str: string) => string;
321
+ getMacroCategories: () => Promise<ImageMacroCategory[]>;
322
+ getImages: (categoryId: number) => Promise<ZakekeImage[]>;
323
+ setCameraPivot(meshID: string): void;
324
+ resetCameraPivot(): void;
325
+ setCameraZoomEnabled(enabled: boolean): void;
326
+ setCameraByName(name: string, onlyAngleOfView?: boolean, animate?: boolean): void;
327
+ findObjectByName(name: string): BABYLON.AbstractMesh | null | undefined;
328
+ getPDF: () => Promise<string>;
329
+ private rewriteShareUrl;
330
+ getShareCompositionUrl: () => Promise<string>;
331
+ saveCompositionCopy: (isSharing?: boolean) => Promise<any>;
332
+ getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean, backgroundColor?: string, padding?: number) => Promise<{
333
+ originalUrl: string;
334
+ rewrittenUrl: string;
335
+ }>;
336
+ isSceneArOnTheFly: () => boolean | undefined;
337
+ isArDeviceCompliant: () => boolean;
338
+ isAndroidOrIOS: () => boolean;
339
+ isAndroid: boolean;
340
+ isIOS: boolean;
341
+ private buildModelViewerUrl;
342
+ isSceneArEnabled: () => boolean;
343
+ private getPregeneratedARUrl;
344
+ getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
345
+ getMobileArUrl: () => Promise<string | null>;
346
+ getMobileLocalArUrl: () => Promise<string>;
347
+ openArMobile: (url: string) => void;
348
+ private registerView;
349
+ getMeshIDbyName: (name: string) => string | undefined;
350
+ hightlightGroup(groupId: number): void;
351
+ highlightAttribute(attributeId: number): void;
352
+ /**
353
+ * Hide a mesh and its children and save the state
354
+ * @param meshId The mesh and childs to hide
355
+ */
356
+ hideMeshAndSaveState: (meshId: string) => void;
357
+ /**
358
+ * Restore a mesh visibility state from a previous saved one (see hideMeshAndSaveState)
359
+ * @param meshId The mesh and childs to show
360
+ */
361
+ restoreMeshVisibility: (meshId: string) => void;
362
+ /**
363
+ * Change opacity for a specific mesh
364
+ * @param meshId The mesh to change the opacity
365
+ * @param opacity The opacity to set
366
+ */
367
+ setMeshDesignVisibility: (meshId: string, visible: boolean) => void;
368
+ addFocusAttributesListener: (listenerFunction: FocusAttributesEventListener) => void;
369
+ clearListeners: () => void;
370
+ setCameraLocked: (isBlocked?: boolean) => void;
371
+ isSceneTryOnEnabled: () => boolean;
372
+ getTryOnUrl: (tryOnUrl?: string) => Promise<string>;
373
+ saveComposition: (customPreviewSize?: CustomPreviewSize, legacyScreenshot?: boolean, isSharing?: boolean, saveDesignFromTemplateEditor?: boolean) => Promise<void>;
374
+ private bootstrapComposition;
375
+ loadSavedComposition: (docID: string) => Promise<void>;
376
+ private updateSavedCompositions;
377
+ themeCompositionsFromSavedCompositions: (compositions: Composition[]) => {
378
+ name: string;
379
+ docID: string;
380
+ previewImageUrl: string;
381
+ tags: string[];
382
+ }[];
383
+ saveDraftsComposition: (name: string, tags: string[], isCopy?: boolean) => Promise<void>;
384
+ deleteSavedComposition: (docId: string) => Promise<void>;
385
+ applyTemplate: (templateGroupCompositionId: number) => Promise<void>;
386
+ configureByAI: (text: string) => Promise<void>;
387
+ getTryOnProvidersList: () => Promise<TryOnProvidersTypesMapping | null>;
388
+ getTryOnProductInfo: () => Promise<TryOnProduct | null>;
389
+ getTryOnSellerInfo: (typeID: number, providerID: number) => Promise<TryOnSeller | null>;
390
+ private getMessagesByProductCode;
391
+ get hasVTryOnEnabled(): boolean;
392
+ get canUseTryOn(): boolean;
393
+ get canUsePD(): boolean;
394
+ get isVisibleMeshShownForTryOn(): boolean;
395
+ get isMandatoryPD(): boolean;
396
+ get isTryOnMeshVisible(): boolean;
397
+ get tryOnMeshVisibleSettings(): TryOnGenericFineTuningSettings | undefined;
398
+ setPDDistance: (distance: number) => void;
399
+ pdDistance: () => number;
400
+ exportTryOnMeshToGlb: () => Promise<Blob | null>;
401
+ getTryOnSettings: () => Zakeke.TryOnSettings | undefined;
402
+ getDeepARDesktopIframeUrl: () => Promise<string>;
403
+ tryOnCountView: (sellerID: number, providerID: number, modeChosen: TryOnMode) => Promise<void>;
404
+ /**
405
+ * Ottiene le restrizioni sul printing method (che nel caso di un prodotto configuratore 3D c'è sempre ed è 1 solo).
406
+ * @remarks
407
+ * Se non ci sono restrizioni, ritorna quelle di default
408
+ * @returns
409
+ * Le restrizioni sul printing method o quelle di default
410
+ */
411
+ getPrintingMethodsRestrictions: () => PrintingMethodsRestrictions;
412
+ setMouseWheelZoomEnabled: (enabled: boolean) => void;
413
+ setCameraPinchingZoom: (toggle: boolean) => void;
414
+ get isAiEditorEnabled(): boolean;
415
+ startAIStudio: () => Promise<void>;
416
+ private _aiPresetCategoriesPromise;
417
+ private _aiPresetPresetsPromise;
418
+ private fetchAllAIPresetCategories;
419
+ private fetchAllAIPresetPresets;
420
+ getAIPresetCategories: (presetType: string) => Promise<AIPresetCategory[]>;
421
+ getAIPresetPresets: (presetType: string) => Promise<AIPreset[]>;
422
+ getApplicableAIStagingRules: (options: {
423
+ productID?: number;
424
+ printTypeID?: number;
425
+ }) => Promise<AIProductStagingRule | null>;
426
+ getApplicableAIVirtualModelRules: (options: {
427
+ productID?: number;
428
+ printTypeID?: number;
429
+ }) => Promise<AIVirtualModelRule | null>;
430
+ private fetchServicesAvailability;
431
+ private createAIProductStagingTask;
432
+ private pollAIProductStagingTask;
433
+ generateAIProductStaging: (options: AIProductStagingOptions) => Promise<AIProductStagingResult>;
434
+ private createAIVirtualTryonTask;
435
+ private pollAIVirtualTryonTask;
436
+ generateAIVirtualTryon: (options: AIVirtualTryOnOptions) => Promise<AIVirtualTryOnResult>;
437
+ }
438
+ export {};