zakeke-configurator-react 0.1.367 → 0.1.369

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