zakeke-configurator-react 0.0.125 → 0.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declarations/3D/src/Components/DesignManagers/MeshDesignManager.d.ts +1 -0
- package/dist/declarations/3D/src/Components/Environment/EnvironmentManager.d.ts +4 -1
- package/dist/declarations/3D/src/Components/ScenePreview/ScenePreview.d.ts +5 -5
- package/dist/declarations/3D/src/Layers/LightsLayer.d.ts +1 -1
- package/dist/declarations/3D/src/Misc/WorkerPool.d.ts +2 -2
- package/dist/declarations/3D/src/Viewers/SceneEditor.d.ts +1 -1
- package/dist/declarations/3D/src/Viewers/SceneViewer.d.ts +27 -2
- package/dist/declarations/composer/Module/src/environment.d.ts +17 -2
- package/dist/declarations/composer/Module/src/integrations/Integration.d.ts +7 -2
- package/dist/declarations/composer/Module/src/integrations/generic.d.ts +8 -2
- package/dist/declarations/composer/Module/src/integrations/preview.d.ts +7 -2
- package/dist/declarations/composer/Module/src/models.d.ts +16 -0
- package/dist/declarations/composer/Module/src/state/providerValue.d.ts +3 -1
- package/dist/declarations/libs/pricingRuleBase/DesignPriceCalculatorRuleBased.d.ts +81 -0
- package/dist/declarations/libs/pricingRuleBase/pricing_model.graphql.d.ts +40 -0
- package/dist/declarations/utils/rectangle.d.ts +14 -0
- package/dist/globals0.js +1 -1
- package/dist/globals2.js +1 -1
- package/dist/globals3.js +1 -0
- package/dist/index.js +10776 -199
- package/package.json +2 -2
- package/dist/declarations/composer/Components/Layout/src/Layout.d.ts +0 -5
- package/dist/declarations/composer/Components/Widgets/src/Widgets.d.ts +0 -693
- package/dist/index.js.map +0 -1
|
@@ -57,6 +57,7 @@ export declare class MeshDesignManager implements IDisposable {
|
|
|
57
57
|
private _debouncedUpdateDynamicTexture;
|
|
58
58
|
private _originalViewMatrixValues;
|
|
59
59
|
private _grids;
|
|
60
|
+
private isFirstRender;
|
|
60
61
|
get showDesign(): boolean;
|
|
61
62
|
set showDesign(value: boolean);
|
|
62
63
|
get side(): Nullable<MPlaza.Side>;
|
|
@@ -9,8 +9,11 @@ export declare class EnvironmentManager implements IDisposable {
|
|
|
9
9
|
private _sceneHelper;
|
|
10
10
|
private _environmentHelper;
|
|
11
11
|
private _shadowLight;
|
|
12
|
+
private _isHologram;
|
|
12
13
|
get scene(): BABYLON.Scene;
|
|
13
|
-
|
|
14
|
+
get isHologram(): boolean;
|
|
15
|
+
set isHologram(value: boolean);
|
|
16
|
+
constructor(zkScene: Zakeke.Scene, scene: BABYLON.Scene, isHologram?: boolean);
|
|
14
17
|
dispose(): void;
|
|
15
18
|
update(): void;
|
|
16
19
|
configureSkybox(): void;
|
|
@@ -2,18 +2,18 @@ export interface IScenePreviewOptions {
|
|
|
2
2
|
width?: number;
|
|
3
3
|
height?: number;
|
|
4
4
|
crop?: boolean;
|
|
5
|
-
camera
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
camera: {
|
|
6
|
+
position: BABYLON.Vector3;
|
|
7
|
+
target: BABYLON.Vector3;
|
|
8
8
|
};
|
|
9
9
|
zkScene?: Zakeke.Scene;
|
|
10
10
|
zkModel?: MPlaza.Model;
|
|
11
|
-
zkDesign?: MPlaza.Design;
|
|
11
|
+
zkDesign?: MPlaza.Design | null;
|
|
12
12
|
meshesWithCustomizationIds?: string[];
|
|
13
13
|
}
|
|
14
14
|
export declare class ScenePreviewData {
|
|
15
15
|
previewFile: string;
|
|
16
16
|
}
|
|
17
17
|
export declare class ScenesPreview {
|
|
18
|
-
static getPreviewsAsync(scene: BABYLON.Scene, rootUrl: string, options
|
|
18
|
+
static getPreviewsAsync(scene: BABYLON.Scene, rootUrl: string, options: IScenePreviewOptions): Promise<ScenePreviewData>;
|
|
19
19
|
}
|
|
@@ -3,8 +3,8 @@ import { IDisposable } from "../Interfaces/IDisposable";
|
|
|
3
3
|
* Helper class to push actions to a pool of workers.
|
|
4
4
|
*/
|
|
5
5
|
export declare class WorkerPool implements IDisposable {
|
|
6
|
-
private _workerInfos
|
|
7
|
-
private _pendingActions
|
|
6
|
+
private _workerInfos?;
|
|
7
|
+
private _pendingActions?;
|
|
8
8
|
/**
|
|
9
9
|
* Constructor
|
|
10
10
|
* @param workers Array of workers to use for actions
|
|
@@ -418,7 +418,7 @@ export declare class SceneEditor extends SceneViewer implements ISceneEditor, ID
|
|
|
418
418
|
loadTextureFilesAsync(filesToLoad: File[], material: Nullable<BABYLON.Material>, type: string): Promise<void>;
|
|
419
419
|
loadTextureFiles(filesToLoad: File[], material: Nullable<BABYLON.Material>, type: string, onSuccess?: () => void, onError?: (reason: any) => void): void;
|
|
420
420
|
uploadTextureFileAsync(fileToLoad: File, material: Nullable<BABYLON.Material>): Promise<Nullable<Zakeke.SceneTexture>>;
|
|
421
|
-
uploadTextureFiles(filesToLoad: File[], material: Nullable<BABYLON.Material>, type: string, onSuccess?: (zkSceneTextures: Zakeke.SceneTexture[]) => void, onError?: (reason: any) => void): void;
|
|
421
|
+
uploadTextureFiles(filesToLoad: File[], material: Nullable<BABYLON.Material>, type: string, onSuccess?: (zkSceneTextures: Zakeke.SceneTexture[]) => void, onError?: (reason: any) => void, resize?: boolean): void;
|
|
422
422
|
protected getTexturesUploadUrl(materialID: string): string;
|
|
423
423
|
removeAllMaterialPhotos(material: BABYLON.Material): void;
|
|
424
424
|
removeMaterialPhotoAtIndex(material: BABYLON.Material, index: number): void;
|
|
@@ -20,6 +20,11 @@ export declare type FocusAttributesEventArgs = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare type FocusAttributesEventListener = (evt: FocusAttributesEventArgs) => void;
|
|
22
22
|
export declare type ArFileFormat = 'usdz' | 'glTF' | 'glb';
|
|
23
|
+
export declare enum BroadcastChannelEventType {
|
|
24
|
+
CameraMovement = "camera-movement",
|
|
25
|
+
ScriptExecution = "script-execution",
|
|
26
|
+
DesignChanged = "design-changed"
|
|
27
|
+
}
|
|
23
28
|
export declare type DracoDecodingResult = {
|
|
24
29
|
indices?: BABYLON.IndicesArray;
|
|
25
30
|
positions?: BABYLON.FloatArray;
|
|
@@ -93,6 +98,9 @@ export declare class SceneViewer implements IDisposable {
|
|
|
93
98
|
protected _infoPointsManagerStyle: Nullable<InfoPointsManagerStyle>;
|
|
94
99
|
protected _canShowInfoPoints: boolean;
|
|
95
100
|
protected _canShowInfoPointsContent: boolean;
|
|
101
|
+
private _broadcastChannel;
|
|
102
|
+
private _isHologramSource;
|
|
103
|
+
private _isHologram;
|
|
96
104
|
get zkScene(): Zakeke.Scene | null;
|
|
97
105
|
get zkModel(): MPlaza.Model | null;
|
|
98
106
|
get canvas(): Nullable<HTMLCanvasElement>;
|
|
@@ -102,6 +110,10 @@ export declare class SceneViewer implements IDisposable {
|
|
|
102
110
|
set autoRender(value: boolean);
|
|
103
111
|
get antialias(): boolean;
|
|
104
112
|
set antialias(value: boolean);
|
|
113
|
+
get isHologramSource(): boolean;
|
|
114
|
+
set isHologramSource(value: boolean);
|
|
115
|
+
get isHologram(): boolean;
|
|
116
|
+
set isHologram(value: boolean);
|
|
105
117
|
getAntialiasEnabled(): boolean;
|
|
106
118
|
setAntialiasEnabled(value: boolean): void;
|
|
107
119
|
getARScale(): boolean;
|
|
@@ -114,7 +126,7 @@ export declare class SceneViewer implements IDisposable {
|
|
|
114
126
|
setPrefetchMaterials(value: boolean): void;
|
|
115
127
|
getShowHideInfoPoints(): boolean;
|
|
116
128
|
setShowHideInfoPoints(value: boolean): void;
|
|
117
|
-
get camera():
|
|
129
|
+
get camera(): Nullable<BABYLON.Camera>;
|
|
118
130
|
get deviceType(): MPlaza.DeviceType;
|
|
119
131
|
set deviceType(value: MPlaza.DeviceType);
|
|
120
132
|
getDeviceType(): MPlaza.DeviceType;
|
|
@@ -154,6 +166,9 @@ export declare class SceneViewer implements IDisposable {
|
|
|
154
166
|
protected disposePostProcesses(): void;
|
|
155
167
|
protected emptyArFileCache(): void;
|
|
156
168
|
resetSceneAsync(): Promise<void>;
|
|
169
|
+
private closeBroadcastChannel;
|
|
170
|
+
private openBroadcastChannel;
|
|
171
|
+
private getOrCreateBroadcastChannel;
|
|
157
172
|
protected createEngine(): void;
|
|
158
173
|
createEmptySceneAsync(): Promise<void>;
|
|
159
174
|
protected setupSceneAsync(): Promise<void>;
|
|
@@ -263,7 +278,7 @@ export declare class SceneViewer implements IDisposable {
|
|
|
263
278
|
addEndSceneLoadingListener(callback: () => void): void;
|
|
264
279
|
private fireEndSceneLoadingEvent;
|
|
265
280
|
getSceneScreenshotAsync(width: number, height: number): Promise<Nullable<string>>;
|
|
266
|
-
getSceneContentScreenshotAsync(width: any, height: any, padding?: number, zkDesign?:
|
|
281
|
+
getSceneContentScreenshotAsync(width: any, height: any, padding?: number, zkDesign?: MPlaza.Design | null, legacyScreenshot?: boolean, camera?: Zakeke.SceneCameraLocation): Promise<Nullable<string>>;
|
|
267
282
|
protected preSceneContentScreenshot(): void;
|
|
268
283
|
protected postSceneContentScreenshot(): void;
|
|
269
284
|
protected preSceneMaterialScreenshot(): void;
|
|
@@ -337,4 +352,14 @@ export declare class SceneViewer implements IDisposable {
|
|
|
337
352
|
reloadLoadingErrorTextureAsync(texture: BABYLON.BaseTexture): Promise<void>;
|
|
338
353
|
isTextureLoadingError(texture: BABYLON.BaseTexture): boolean;
|
|
339
354
|
materialHasLoadingErrorTextues(material: BABYLON.Material): boolean;
|
|
355
|
+
notifyCameraMovement(): void;
|
|
356
|
+
notifyScriptExecution(script: ComposerScript): void;
|
|
357
|
+
notifyDesignChanged(zkDesign: MPlaza.Design): void;
|
|
358
|
+
protected notifyActionExecution(attributeID: Nullable<number>, selectedValue: Nullable<string>, actions: MPlaza.AttributeSceneAction[]): void;
|
|
359
|
+
protected attachBroadcastChannelEventHandlers(): void;
|
|
360
|
+
protected detachBroadcastChannelEventHandlers(): void;
|
|
361
|
+
private onBroadcastMessageReceived;
|
|
362
|
+
private processCameraMovementEvent;
|
|
363
|
+
private processScriptExecution;
|
|
364
|
+
private processDesignChanged;
|
|
340
365
|
}
|
|
@@ -32,6 +32,8 @@ export declare class ZakekeEnvironment {
|
|
|
32
32
|
private integration;
|
|
33
33
|
private previewWidth;
|
|
34
34
|
private previewHeight;
|
|
35
|
+
private clientPreviewWidth;
|
|
36
|
+
private clientPreviewHeight;
|
|
35
37
|
private shareUrlPrefix;
|
|
36
38
|
private events;
|
|
37
39
|
private zkProduct;
|
|
@@ -45,11 +47,16 @@ export declare class ZakekeEnvironment {
|
|
|
45
47
|
private enableShareCompositionUrl;
|
|
46
48
|
private sharedCompositionDocId;
|
|
47
49
|
private savedCompositions;
|
|
50
|
+
private isDraftEditor;
|
|
51
|
+
private isViewerMode;
|
|
52
|
+
private draftCompositionDocId;
|
|
48
53
|
private initialSelection;
|
|
49
54
|
private undoStack;
|
|
50
55
|
private redoStack;
|
|
51
56
|
currentAttributesSelection: Object | null;
|
|
52
57
|
currentCompositionInfo: CurrentCompositionInfo | null;
|
|
58
|
+
private pricingCalculator;
|
|
59
|
+
private copyrightMessageLocalStorageKey;
|
|
53
60
|
sellerSettings: SellerSettings | null;
|
|
54
61
|
get internalProduct(): MPlaza.Model | null;
|
|
55
62
|
get internalScene(): Zakeke.Scene | null;
|
|
@@ -76,7 +83,6 @@ export declare class ZakekeEnvironment {
|
|
|
76
83
|
isExplodedMode: boolean;
|
|
77
84
|
isAssetsLoading: boolean;
|
|
78
85
|
extensionFields: ExtensionFields[];
|
|
79
|
-
private copyrightMessageLocalStorageKey;
|
|
80
86
|
get isFullscreenMode(): boolean;
|
|
81
87
|
get isViewerReady(): boolean;
|
|
82
88
|
eventMessages: EventMessage[] | null;
|
|
@@ -89,6 +95,7 @@ export declare class ZakekeEnvironment {
|
|
|
89
95
|
private getSettings;
|
|
90
96
|
private getSellerSetting;
|
|
91
97
|
createQuote: (formData: any) => Promise<any>;
|
|
98
|
+
private loadLocalization;
|
|
92
99
|
private loadScript;
|
|
93
100
|
setCopyrightMessageAccepted: (copyrightMandatoryCheckbox: boolean) => void;
|
|
94
101
|
getCopyrightMessageAccepted: () => boolean;
|
|
@@ -154,12 +161,14 @@ export declare class ZakekeEnvironment {
|
|
|
154
161
|
setCamera(cameraLocationId: string, onlyAngleOfView?: boolean, animate?: boolean): void;
|
|
155
162
|
getCameraByName(name: string): Zakeke.SceneCameraLocation | undefined;
|
|
156
163
|
setCameraLocation(name: string, animate?: boolean): void;
|
|
164
|
+
private base64StringToFile;
|
|
157
165
|
addToCart: (additionalProperties: Record<string, any>, onBeforeSendDataToParent?: ((data: OnBeforeSendDataToParent) => Promise<void>) | undefined, legacyScreenshot?: boolean | undefined) => Promise<void>;
|
|
158
166
|
zoomIn: () => void;
|
|
159
167
|
zoomOut: () => void;
|
|
160
168
|
isFullscreenEnabled: () => boolean;
|
|
161
169
|
getDesignItemsInfo(): Item[];
|
|
162
170
|
switchFullscreen: () => void;
|
|
171
|
+
openSecondScreen: () => void;
|
|
163
172
|
private extendedUpdate;
|
|
164
173
|
exportSceneToUsdz: (hash: string) => Promise<string | null | undefined>;
|
|
165
174
|
setExplodedMode: (explodedMode: boolean) => Promise<void>;
|
|
@@ -198,11 +207,17 @@ export declare class ZakekeEnvironment {
|
|
|
198
207
|
getShareCompositionUrl: () => Promise<string>;
|
|
199
208
|
saveCompositionCopy: () => Promise<any>;
|
|
200
209
|
getOnlineScreenshot: (width: number, height: number, legacyScreenshot?: boolean | undefined, backgroundColor?: string | undefined, padding?: number) => Promise<string>;
|
|
210
|
+
isSceneArOnTheFly: () => boolean | undefined;
|
|
211
|
+
isArDeviceCompliant: () => boolean;
|
|
212
|
+
isAndroidOrIOS: () => boolean;
|
|
213
|
+
isAndroid: boolean;
|
|
214
|
+
isIOS: boolean;
|
|
201
215
|
private buildModelViewerUrl;
|
|
202
216
|
isSceneArEnabled: () => boolean;
|
|
203
217
|
private getPregeneratedARUrl;
|
|
204
218
|
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
205
|
-
getMobileArUrl: (
|
|
219
|
+
getMobileArUrl: (onFlyArUrl?: string | undefined) => Promise<Blob | string | null>;
|
|
220
|
+
getMobileLocalArUrl: (onFlyArUrl?: string | undefined) => Promise<string | Blob>;
|
|
206
221
|
openArMobile: (url: string) => void;
|
|
207
222
|
private registerView;
|
|
208
223
|
getMeshIDbyName: (name: string) => string | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Item } from "..";
|
|
2
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
2
3
|
export declare class PlatformAttributeSelection {
|
|
3
4
|
attributeCode: string;
|
|
4
5
|
optionCode: string;
|
|
@@ -9,7 +10,11 @@ export declare class PlatformAttributeSelection {
|
|
|
9
10
|
constructor(attributeCode: string, optionCode: string, attributeLabel: string, optionLabel: string, attributeIsEnabled: boolean, optionIsEnabled: boolean);
|
|
10
11
|
}
|
|
11
12
|
export interface Integration {
|
|
12
|
-
addToCart(composition: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>): void;
|
|
13
|
-
getPrice(composition: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, quantity: number): Promise<number>;
|
|
13
|
+
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>): void;
|
|
14
|
+
getPrice(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, quantity: number): Promise<number>;
|
|
15
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
16
|
+
url: string;
|
|
17
|
+
}>;
|
|
18
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): any;
|
|
14
19
|
close(): any;
|
|
15
20
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
1
2
|
import { Item } from "../models";
|
|
2
3
|
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
3
4
|
export default class MerchantIntegrationGeneric implements Integration {
|
|
4
5
|
private readonly callbacks;
|
|
5
6
|
private messageIds;
|
|
7
|
+
private pricingCalculator;
|
|
6
8
|
constructor();
|
|
7
|
-
addToCart(composition: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>): void;
|
|
8
|
-
getPrice(composition: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, quantity: number): Promise<number>;
|
|
9
|
+
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>): void;
|
|
10
|
+
getPrice(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, quantity: number): Promise<number>;
|
|
11
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
+
url: string;
|
|
13
|
+
}>;
|
|
14
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
9
15
|
close(): void;
|
|
10
16
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Item } from "..";
|
|
2
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
2
3
|
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
3
4
|
export default class MerchantIntegrationPreview implements Integration {
|
|
4
5
|
constructor();
|
|
5
|
-
addToCart(composition: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>): void;
|
|
6
|
-
getPrice(composition: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, quantity: number): Promise<number>;
|
|
6
|
+
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>): void;
|
|
7
|
+
getPrice(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, quantity: number): Promise<number>;
|
|
8
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
9
|
+
url: string;
|
|
10
|
+
}>;
|
|
11
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
7
12
|
close(): void;
|
|
8
13
|
}
|
|
@@ -15,6 +15,11 @@ export declare class User {
|
|
|
15
15
|
name: string;
|
|
16
16
|
constructor(id: number, username: string, name: string);
|
|
17
17
|
}
|
|
18
|
+
declare enum ZakekeEnvironment {
|
|
19
|
+
Customizer = 1,
|
|
20
|
+
Composer = 2,
|
|
21
|
+
Viewer = 3
|
|
22
|
+
}
|
|
18
23
|
export declare class Product {
|
|
19
24
|
id: number;
|
|
20
25
|
sku: string;
|
|
@@ -24,6 +29,8 @@ export declare class Product {
|
|
|
24
29
|
areas: ProductArea[];
|
|
25
30
|
quantityRule: ProductQuantityRule | null;
|
|
26
31
|
quoteRule: QuoteRule | null;
|
|
32
|
+
environment: ZakekeEnvironment | null;
|
|
33
|
+
isShowSecondScreenEnabled: boolean;
|
|
27
34
|
static fromProduct(zkProduct: any): Product;
|
|
28
35
|
}
|
|
29
36
|
export declare class QuoteRule {
|
|
@@ -374,4 +381,13 @@ export interface ExtensionFields {
|
|
|
374
381
|
label: string;
|
|
375
382
|
formatString: string;
|
|
376
383
|
}
|
|
384
|
+
export interface PreviewCameraImage {
|
|
385
|
+
id: number;
|
|
386
|
+
url: string;
|
|
387
|
+
}
|
|
388
|
+
export interface CompositionClientPreview {
|
|
389
|
+
fileObjectID: number;
|
|
390
|
+
cameraName: string;
|
|
391
|
+
url: string;
|
|
392
|
+
}
|
|
377
393
|
export {};
|
|
@@ -94,6 +94,7 @@ export interface ProviderValue {
|
|
|
94
94
|
saveComposition: (customPreviewSize?: CustomPreviewSize) => Promise<void>;
|
|
95
95
|
loadComposition: (id: string) => Promise<void>;
|
|
96
96
|
switchFullscreen: () => void;
|
|
97
|
+
openSecondScreen: () => void;
|
|
97
98
|
isFullscreenMode: boolean;
|
|
98
99
|
zoomIn: () => void;
|
|
99
100
|
zoomOut: () => void;
|
|
@@ -115,9 +116,10 @@ export interface ProviderValue {
|
|
|
115
116
|
highlightGroup: (groupId: number) => void;
|
|
116
117
|
highlightAttribute: (attributeId: number) => void;
|
|
117
118
|
getQrCodeArUrl: (device: 'iOS' | 'Android') => Promise<string>;
|
|
118
|
-
getMobileArUrl: (
|
|
119
|
+
getMobileArUrl: (onFlyArUrl?: string) => Promise<Blob | string | null>;
|
|
119
120
|
openArMobile: (url: string) => void;
|
|
120
121
|
isSceneArEnabled: () => boolean;
|
|
122
|
+
isArDeviceCompliant: () => boolean;
|
|
121
123
|
IS_ANDROID: boolean;
|
|
122
124
|
IS_IOS: boolean;
|
|
123
125
|
setBackgroundColor: (color: string, alpha: number) => void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { pricing_model } from "./pricing_model.graphql";
|
|
2
|
+
interface FormulaModel {
|
|
3
|
+
operator: string;
|
|
4
|
+
values: number[];
|
|
5
|
+
}
|
|
6
|
+
interface PricingRulePropertyModel {
|
|
7
|
+
propertyID: number;
|
|
8
|
+
functionName: string;
|
|
9
|
+
}
|
|
10
|
+
interface IContext {
|
|
11
|
+
sides: any;
|
|
12
|
+
items: any;
|
|
13
|
+
}
|
|
14
|
+
export declare class DesignPriceCalculatorRuleFactory {
|
|
15
|
+
static create: (product: any, apiUrl?: string | undefined, token?: string | undefined, isOwin?: boolean | undefined, cloudFlareApiUrl?: string | undefined) => Promise<DesignPriceCalculatorRuleBased>;
|
|
16
|
+
}
|
|
17
|
+
export declare class DesignPriceCalculatorRuleBased {
|
|
18
|
+
colorID: number;
|
|
19
|
+
private product?;
|
|
20
|
+
private pricings?;
|
|
21
|
+
private pricing?;
|
|
22
|
+
private properties?;
|
|
23
|
+
private config;
|
|
24
|
+
constructor(apiUrl?: string, token?: string, isOwin?: boolean, cloudFlareApiUrl?: string);
|
|
25
|
+
init: (product: any) => Promise<void>;
|
|
26
|
+
getPricings: (product: any, callback: (pricings: any, properties?: PricingRulePropertyModel[] | undefined) => void) => Promise<void>;
|
|
27
|
+
getPricing: (design: any) => pricing_model | undefined;
|
|
28
|
+
distinct: (value: any, index: any, self: any) => boolean;
|
|
29
|
+
ElementSizeFunction: (pContext: any, formula: FormulaModel) => {
|
|
30
|
+
result: boolean;
|
|
31
|
+
multiplier: number;
|
|
32
|
+
items: any;
|
|
33
|
+
};
|
|
34
|
+
NumberOfElementsSimplifiedFunction: (pContext: any, formula: FormulaModel) => {
|
|
35
|
+
result: boolean;
|
|
36
|
+
multiplier: any;
|
|
37
|
+
items: any;
|
|
38
|
+
};
|
|
39
|
+
LinesLengthFunction: (pContext: any, formula: FormulaModel) => any;
|
|
40
|
+
AmountOfElementsFunction: (pContext: any, formula: FormulaModel) => any;
|
|
41
|
+
AmountOfUsedColorsFunction: (pContext: any, formula: FormulaModel) => any;
|
|
42
|
+
CanvasSizeFunction: (pContext: any, formula: FormulaModel) => any;
|
|
43
|
+
DesignSizeFunction: (pContext: any, formula: FormulaModel) => any;
|
|
44
|
+
DesignTextLengthFunction: (pContext: any, formula: FormulaModel) => any;
|
|
45
|
+
CustomizedSidesFunction: (pContext: any, formula: FormulaModel) => any;
|
|
46
|
+
TextLengthFunction: (pContext: any, formula: FormulaModel) => any;
|
|
47
|
+
conditionsToConditionsGroupByFormula: (conditions: any) => {
|
|
48
|
+
formula: string;
|
|
49
|
+
position: any;
|
|
50
|
+
conditions: any[];
|
|
51
|
+
}[];
|
|
52
|
+
getFunctionName: (properties: any, rule: any) => any;
|
|
53
|
+
clearPricings: () => void;
|
|
54
|
+
GetContextForRule: (rule: any, product: any, design: any) => IContext;
|
|
55
|
+
isUsingAmountOfColors: (design: any) => boolean;
|
|
56
|
+
getPremiumPhotosPrice: (design: any, quantity: number) => number;
|
|
57
|
+
/**
|
|
58
|
+
* Get Image Price
|
|
59
|
+
*
|
|
60
|
+
* Metodo che calcola il prezzo per le immagini nel design a cui a backoffice
|
|
61
|
+
* è stato valorizzato un prezzo
|
|
62
|
+
*
|
|
63
|
+
* @author f.checchia
|
|
64
|
+
*
|
|
65
|
+
* @param design Il design in input
|
|
66
|
+
* @param {number} quantity La quantità del prodotto che si sta acquistando
|
|
67
|
+
*
|
|
68
|
+
* @return {number} Il prezzo complessivo delle immagini per la quantità
|
|
69
|
+
*
|
|
70
|
+
* */
|
|
71
|
+
getImagePrice: (design: any, quantity: number) => number;
|
|
72
|
+
getMatchedConditions: (design: any, quantity: number, includePercentage: boolean) => any;
|
|
73
|
+
calculate: (design: any, quantity: number) => number;
|
|
74
|
+
getPricingAdditionalInfo: (design: any) => {
|
|
75
|
+
description: string | null;
|
|
76
|
+
priceDescriptionEnabled: boolean | null;
|
|
77
|
+
infoPricingText: string | null;
|
|
78
|
+
priceStructure: "CUSTOMIZATION_PRICE" | "FINAL_PRICE" | "SEPARATED_PRICES" | null;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare type PriceStructure = "CUSTOMIZATION_PRICE" | "FINAL_PRICE" | "SEPARATED_PRICES";
|
|
2
|
+
export declare type pricing_model = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly pricingID: number;
|
|
5
|
+
readonly pricingName: string | null;
|
|
6
|
+
readonly description: string | null;
|
|
7
|
+
readonly priceDescriptionEnabled: boolean | null;
|
|
8
|
+
readonly priceStructure: PriceStructure | null;
|
|
9
|
+
readonly infoPricingText: string | null;
|
|
10
|
+
readonly printTypes: ReadonlyArray<{
|
|
11
|
+
readonly printTypeID: number;
|
|
12
|
+
readonly printTypeName: string | null;
|
|
13
|
+
}>;
|
|
14
|
+
readonly products: ReadonlyArray<{
|
|
15
|
+
readonly productID: number;
|
|
16
|
+
readonly productName: string | null;
|
|
17
|
+
}>;
|
|
18
|
+
readonly rules: ReadonlyArray<{
|
|
19
|
+
readonly allMatchType: boolean;
|
|
20
|
+
readonly elementID: number;
|
|
21
|
+
readonly elementTitle: string | null;
|
|
22
|
+
readonly isSetupPrice: boolean;
|
|
23
|
+
readonly propertyID: number;
|
|
24
|
+
readonly ruleID: number;
|
|
25
|
+
readonly priceType: number;
|
|
26
|
+
readonly conditions: ReadonlyArray<{
|
|
27
|
+
readonly conditionID: number;
|
|
28
|
+
readonly formula: string | null;
|
|
29
|
+
readonly position: number;
|
|
30
|
+
readonly priceToAdd: unknown;
|
|
31
|
+
readonly quantity: number;
|
|
32
|
+
} | null> | null;
|
|
33
|
+
readonly targets: ReadonlyArray<{
|
|
34
|
+
readonly area: string | null;
|
|
35
|
+
readonly color: string | null;
|
|
36
|
+
readonly side: string | null;
|
|
37
|
+
readonly targetID: number;
|
|
38
|
+
} | null> | null;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class Rectangle {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
constructor(width: any, height: any, x: any, y: any);
|
|
7
|
+
maxX: () => number;
|
|
8
|
+
maxY: () => number;
|
|
9
|
+
area: () => number;
|
|
10
|
+
areaPPCM: (ppcm: number) => number;
|
|
11
|
+
equals: (rectangleToCompare: Rectangle) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const rectangleArea: (r: Rectangle) => number;
|
|
14
|
+
export declare const rectanglesDistinctArea: (rectangles: Rectangle[], ppcm?: number | undefined) => number;
|