zakeke-configurator-react 0.0.197 → 0.0.199
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/composer/Module/src/api.d.ts +3 -3
- package/dist/declarations/composer/Module/src/components/customizer.d.ts +9 -9
- package/dist/declarations/composer/Module/src/components/sceneViewer.d.ts +5 -5
- package/dist/declarations/composer/Module/src/components/tryon/tryOnFrame.d.ts +10 -0
- package/dist/declarations/composer/Module/src/components/tryon/tryOnModels.d.ts +63 -0
- package/dist/declarations/composer/Module/src/components/tryon/tryOnProviders/tryOnMazing.d.ts +57 -0
- package/dist/declarations/composer/Module/src/components/tryon/tryOnViewer.d.ts +39 -0
- package/dist/declarations/composer/Module/src/exceptions.d.ts +19 -19
- package/dist/declarations/composer/Module/src/fontsManager.d.ts +12 -12
- package/dist/declarations/composer/Module/src/helpers.d.ts +56 -56
- package/dist/declarations/composer/Module/src/hooks/tryonContext.d.ts +5 -0
- package/dist/declarations/composer/Module/src/hooks/useZakeke.d.ts +9 -9
- package/dist/declarations/composer/Module/src/imageUploadTask.d.ts +10 -10
- package/dist/declarations/composer/Module/src/index.d.ts +8 -7
- package/dist/declarations/composer/Module/src/integrations/Helpers.d.ts +2 -2
- package/dist/declarations/composer/Module/src/integrations/Integration.d.ts +24 -24
- package/dist/declarations/composer/Module/src/integrations/generic.d.ts +16 -16
- package/dist/declarations/composer/Module/src/integrations/preview.d.ts +16 -16
- package/dist/declarations/composer/Module/src/state/boot.d.ts +6 -6
- package/dist/declarations/composer/Module/src/state/reducer.d.ts +3 -3
- package/dist/declarations/composer/Module/src/state/state.d.ts +7 -7
- package/dist/index.js +7 -3
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AxiosInstance } from "axios";
|
|
2
|
-
export declare let axiosApi: AxiosInstance;
|
|
3
|
-
export declare function setupApi(culture: string, token: string): void;
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
export declare let axiosApi: AxiosInstance;
|
|
3
|
+
export declare function setupApi(culture: string, token: string): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface ExposedMethods {
|
|
3
|
-
zoomIn: () => void;
|
|
4
|
-
zoomOut: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const ZakekeDesigner: React.ForwardRefExoticComponent<{
|
|
7
|
-
areaId: number;
|
|
8
|
-
} & React.RefAttributes<ExposedMethods>>;
|
|
9
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ExposedMethods {
|
|
3
|
+
zoomIn: () => void;
|
|
4
|
+
zoomOut: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ZakekeDesigner: React.ForwardRefExoticComponent<{
|
|
7
|
+
areaId: number;
|
|
8
|
+
} & React.RefAttributes<ExposedMethods>>;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
export declare const ZakekeViewer: FunctionComponent<{
|
|
3
|
-
backgroundColor?: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
}>;
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
export declare const ZakekeViewer: FunctionComponent<{
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
export interface TryOnFrameProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
providerUrl: string;
|
|
5
|
+
providerTitle: string;
|
|
6
|
+
outMessageHandler: (e: MessageEvent<any>) => void;
|
|
7
|
+
onReady?: (w: Window) => void;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const TryOnFrame: FunctionComponent<TryOnFrameProps>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { TryOnProvider, TryOnGenericFineTuningSettings, TryOnProduct, TryOnSeller, TryOnFineTuningMazingSettings } from '../../models';
|
|
2
|
+
import { MazingPupillaryDistanceStateReceivedMessageType, MazingTryOnReceivedMessageType } from './tryOnProviders/tryOnMazing';
|
|
3
|
+
export declare enum TryOnMode {
|
|
4
|
+
TryOn = 1,
|
|
5
|
+
PDTool = 2
|
|
6
|
+
}
|
|
7
|
+
export interface TryOnData {
|
|
8
|
+
product?: TryOnProduct;
|
|
9
|
+
customer?: TryOnSeller;
|
|
10
|
+
provider?: TryOnProvider;
|
|
11
|
+
mode?: TryOnMode;
|
|
12
|
+
obj?: Blob | null;
|
|
13
|
+
settings?: TryOnGenericFineTuningSettings;
|
|
14
|
+
}
|
|
15
|
+
export interface TryOnProviderExchangeData {
|
|
16
|
+
type: TryOnProvidersTypeUnion;
|
|
17
|
+
value: any;
|
|
18
|
+
}
|
|
19
|
+
export type TryOnProvidersTypeUnion = MazingTryOnReceivedMessageType | MazingPupillaryDistanceStateReceivedMessageType;
|
|
20
|
+
export type ValueOf<T> = T[keyof T];
|
|
21
|
+
export declare const TryOnBaseProviderReceivedMessage: {
|
|
22
|
+
readonly Start: "";
|
|
23
|
+
readonly WaitingAuthentication: "WAITING_AUTH";
|
|
24
|
+
readonly AuthSuccessful: "AUTH_SUCCESS";
|
|
25
|
+
readonly AuthError: "AUTH_ERROR";
|
|
26
|
+
readonly WebcamError: "WEBCAM_ERROR";
|
|
27
|
+
};
|
|
28
|
+
export declare const TryOnBaseProviderResponseMessage: {};
|
|
29
|
+
export declare const PupillaryDistanceBaseProviderReceivedMessage: {
|
|
30
|
+
readonly Start: "";
|
|
31
|
+
readonly WaitingAuthentication: "WAITING_AUTH";
|
|
32
|
+
readonly AuthSuccessful: "AUTH_SUCCESS";
|
|
33
|
+
readonly AuthError: "AUTH_ERROR";
|
|
34
|
+
};
|
|
35
|
+
export declare const PupillaryDistanceBaseProviderResponseMessage: {};
|
|
36
|
+
export interface ZakekeTryOnExposedMethods {
|
|
37
|
+
closeFrame?: () => void;
|
|
38
|
+
takeScreenshot?: () => void;
|
|
39
|
+
startPupillaryDistance?: (time: number) => void;
|
|
40
|
+
switchMode?: (mode: TryOnMode) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface TryOnProviderProps {
|
|
43
|
+
className?: string;
|
|
44
|
+
obj: Blob;
|
|
45
|
+
product: TryOnProduct;
|
|
46
|
+
customer: TryOnSeller;
|
|
47
|
+
fineTuningSettings?: TryOnFineTuningMazingSettings;
|
|
48
|
+
onReady?: () => void;
|
|
49
|
+
onLoaded?: () => void;
|
|
50
|
+
onClose?: () => void;
|
|
51
|
+
onWebcamError: () => void;
|
|
52
|
+
}
|
|
53
|
+
export interface PupillaryDistanceProviderProps {
|
|
54
|
+
className?: string;
|
|
55
|
+
product: TryOnProduct;
|
|
56
|
+
customer: TryOnSeller;
|
|
57
|
+
onReady?: () => void;
|
|
58
|
+
onLoaded?: () => void;
|
|
59
|
+
onPDUpdated?: (pd: number) => void;
|
|
60
|
+
onClose?: () => void;
|
|
61
|
+
onWebcamError: () => void;
|
|
62
|
+
}
|
|
63
|
+
export declare function parseJSON(json: string): any;
|
package/dist/declarations/composer/Module/src/components/tryon/tryOnProviders/tryOnMazing.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PupillaryDistanceProviderProps, TryOnProviderProps, ValueOf } from '../tryOnModels';
|
|
3
|
+
export declare const MazingTryOnReceivedMessage: {
|
|
4
|
+
readonly WaitingAuthentication: "WAITING_AUTH";
|
|
5
|
+
readonly TryOnLoaded: "MODEL_LOADED";
|
|
6
|
+
readonly ScreenShotTaken: "SCREENSHOT_TAKEN";
|
|
7
|
+
readonly WebcamStopped: "WEBCAM_STOPPED";
|
|
8
|
+
readonly Start: "";
|
|
9
|
+
readonly AuthSuccessful: "AUTH_SUCCESS";
|
|
10
|
+
readonly AuthError: "AUTH_ERROR";
|
|
11
|
+
readonly WebcamError: "WEBCAM_ERROR";
|
|
12
|
+
};
|
|
13
|
+
export type MazingTryOnReceivedMessageType = ValueOf<typeof MazingTryOnReceivedMessage>;
|
|
14
|
+
export declare const MazingTryOnResponseMessage: {
|
|
15
|
+
readonly StartAuthenticationTryOn: "AUTH_TRY_ON";
|
|
16
|
+
readonly LoadTryOn: "LOAD_MODEL";
|
|
17
|
+
readonly TakeScreenshot: "TAKE_SCREENSHOT";
|
|
18
|
+
readonly StopWebcam: "STOP_WEBCAM";
|
|
19
|
+
};
|
|
20
|
+
export type MazingTryOnResponseMessageType = ValueOf<typeof MazingTryOnResponseMessage>;
|
|
21
|
+
declare const MazingPupillaryDistanceBaseStateReceivedMessage: {
|
|
22
|
+
readonly PDLoaded: "PD_LOADED";
|
|
23
|
+
readonly PDUpdated: "NEW_PD";
|
|
24
|
+
readonly PDDataNotFoundError: "PD_ERROR";
|
|
25
|
+
readonly WebcamError: "WEBCAM_ERROR";
|
|
26
|
+
readonly PDCountdown: "PD_COUNTDOWN";
|
|
27
|
+
readonly WebcamStopped: "WEBCAM_STOPPED";
|
|
28
|
+
};
|
|
29
|
+
export declare const MazingPupillaryDistanceStateReceivedMessage: {
|
|
30
|
+
readonly PDLoaded: "PD_LOADED";
|
|
31
|
+
readonly PDUpdated: "NEW_PD";
|
|
32
|
+
readonly PDDataNotFoundError: "PD_ERROR";
|
|
33
|
+
readonly WebcamError: "WEBCAM_ERROR";
|
|
34
|
+
readonly PDCountdown: "PD_COUNTDOWN";
|
|
35
|
+
readonly WebcamStopped: "WEBCAM_STOPPED";
|
|
36
|
+
readonly Start: "";
|
|
37
|
+
readonly WaitingAuthentication: "WAITING_AUTH";
|
|
38
|
+
readonly AuthSuccessful: "AUTH_SUCCESS";
|
|
39
|
+
readonly AuthError: "AUTH_ERROR";
|
|
40
|
+
};
|
|
41
|
+
export type MazingPupillaryDistanceStateReceivedMessageType = ValueOf<typeof MazingPupillaryDistanceBaseStateReceivedMessage>;
|
|
42
|
+
declare const MazingPupillaryDistanceBaseResponseMessage: {
|
|
43
|
+
readonly StartAuthenticationPD: "AUTH_TRY_ON";
|
|
44
|
+
readonly LoadPD: "LOAD_PD";
|
|
45
|
+
readonly StartPD: "START_PD";
|
|
46
|
+
readonly StopWebcam: "STOP_WEBCAM";
|
|
47
|
+
};
|
|
48
|
+
export declare const MazingPupillaryDistanceResponseMessage: {
|
|
49
|
+
readonly StartAuthenticationPD: "AUTH_TRY_ON";
|
|
50
|
+
readonly LoadPD: "LOAD_PD";
|
|
51
|
+
readonly StartPD: "START_PD";
|
|
52
|
+
readonly StopWebcam: "STOP_WEBCAM";
|
|
53
|
+
};
|
|
54
|
+
export type MazingPupillaryDistanceResponseMessageType = ValueOf<typeof MazingPupillaryDistanceBaseResponseMessage>;
|
|
55
|
+
export declare const MazingTryOn: FunctionComponent<TryOnProviderProps>;
|
|
56
|
+
export declare const MazingPupillaryDistance: FunctionComponent<PupillaryDistanceProviderProps>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { TryOnGenericFineTuningSettings, TryOnProduct, TryOnProvider, TryOnSeller, TryOnType } from '../../models';
|
|
3
|
+
import { TryOnMode, ZakekeTryOnExposedMethods } from './tryOnModels';
|
|
4
|
+
export interface ZakekeTryOnViewerProps {
|
|
5
|
+
mode: TryOnMode;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
onPDUpdated: (pd: number) => void;
|
|
8
|
+
onReady?: () => void;
|
|
9
|
+
onLoaded?: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onWebcamError: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const ZakekeTryOnViewer: React.ForwardRefExoticComponent<ZakekeTryOnViewerProps & React.RefAttributes<ZakekeTryOnExposedMethods>>;
|
|
14
|
+
export interface TryOnViewProps {
|
|
15
|
+
className?: string;
|
|
16
|
+
provider: TryOnProvider;
|
|
17
|
+
type: TryOnType;
|
|
18
|
+
obj: Blob;
|
|
19
|
+
settings?: TryOnGenericFineTuningSettings;
|
|
20
|
+
product: TryOnProduct;
|
|
21
|
+
customer: TryOnSeller;
|
|
22
|
+
onReady?: () => void;
|
|
23
|
+
onLoaded?: () => void;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
onWebcamError: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const TryOnView: FunctionComponent<TryOnViewProps>;
|
|
28
|
+
export interface PupillaryDistanceViewProps {
|
|
29
|
+
className?: string;
|
|
30
|
+
provider: TryOnProvider;
|
|
31
|
+
product: TryOnProduct;
|
|
32
|
+
customer: TryOnSeller;
|
|
33
|
+
onReady?: () => void;
|
|
34
|
+
onLoaded?: () => void;
|
|
35
|
+
onPDUpdated?: (pd: number) => void;
|
|
36
|
+
onClose: () => void;
|
|
37
|
+
onWebcamError: () => void;
|
|
38
|
+
}
|
|
39
|
+
export declare const PupillaryDistanceView: FunctionComponent<PupillaryDistanceViewProps>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Platform } from "./models";
|
|
2
|
-
export declare class Exception {
|
|
3
|
-
message: string;
|
|
4
|
-
constructor(message: string);
|
|
5
|
-
}
|
|
6
|
-
export declare class ParametersParseFailException extends Exception {
|
|
7
|
-
parameter: string;
|
|
8
|
-
constructor(parameter: string);
|
|
9
|
-
}
|
|
10
|
-
export declare class UnsupportedPlatformException extends Exception {
|
|
11
|
-
platform: Platform;
|
|
12
|
-
constructor(platform: Platform);
|
|
13
|
-
}
|
|
14
|
-
export declare class UploadFailedExpection extends Exception {
|
|
15
|
-
constructor();
|
|
16
|
-
}
|
|
17
|
-
export declare class NonSquarePixelException extends Exception {
|
|
18
|
-
constructor();
|
|
19
|
-
}
|
|
1
|
+
import { Platform } from "./models";
|
|
2
|
+
export declare class Exception {
|
|
3
|
+
message: string;
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class ParametersParseFailException extends Exception {
|
|
7
|
+
parameter: string;
|
|
8
|
+
constructor(parameter: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class UnsupportedPlatformException extends Exception {
|
|
11
|
+
platform: Platform;
|
|
12
|
+
constructor(platform: Platform);
|
|
13
|
+
}
|
|
14
|
+
export declare class UploadFailedExpection extends Exception {
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
17
|
+
export declare class NonSquarePixelException extends Exception {
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FontFamily } from ".";
|
|
2
|
-
/**
|
|
3
|
-
* Download a list of font families so that are available for the browser
|
|
4
|
-
*/
|
|
5
|
-
export declare function loadFonts(fontFamilies: FontFamily[]): Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* Downlod all fonts used in a design
|
|
8
|
-
*
|
|
9
|
-
* @param design Design to load fonts for
|
|
10
|
-
* @param downloadedFonts A list of downloaded fonts
|
|
11
|
-
*/
|
|
12
|
-
export declare function downloadFontsOfDesign(design: MPlaza.Design, downloadedFonts: FontFamily[]): Promise<void>;
|
|
1
|
+
import { FontFamily } from ".";
|
|
2
|
+
/**
|
|
3
|
+
* Download a list of font families so that are available for the browser
|
|
4
|
+
*/
|
|
5
|
+
export declare function loadFonts(fontFamilies: FontFamily[]): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Downlod all fonts used in a design
|
|
8
|
+
*
|
|
9
|
+
* @param design Design to load fonts for
|
|
10
|
+
* @param downloadedFonts A list of downloaded fonts
|
|
11
|
+
*/
|
|
12
|
+
export declare function downloadFontsOfDesign(design: MPlaza.Design, downloadedFonts: FontFamily[]): Promise<void>;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { PlatformSettings } from './models';
|
|
2
|
-
export interface PublicTranslations {
|
|
3
|
-
statics: Map<string, string>;
|
|
4
|
-
dynamics: Map<string, string>;
|
|
5
|
-
}
|
|
6
|
-
export declare class T {
|
|
7
|
-
static translations: PublicTranslations | null;
|
|
8
|
-
static _(str: string, domain: string): any;
|
|
9
|
-
static _d(str: string): string;
|
|
10
|
-
}
|
|
11
|
-
export declare function dataURLtoFile(dataurl: any, filename: any): File;
|
|
12
|
-
export declare class StringHelper {
|
|
13
|
-
static padLeft(str: string | number, width: number, char: string): string;
|
|
14
|
-
static padRight(str: string | number, width: number, char: string): string;
|
|
15
|
-
static format(str: string, ...args: string[]): string;
|
|
16
|
-
static camelToSnake(o: any): any[] | {
|
|
17
|
-
[key: string]: {
|
|
18
|
-
val: any;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
static pascalToCamel(o: any): any[] | {
|
|
22
|
-
[key: string]: {
|
|
23
|
-
val: any;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export declare class Browser {
|
|
28
|
-
static openWindow(url: string, width: number, height: number): Window | null;
|
|
29
|
-
}
|
|
30
|
-
export declare class Pagination {
|
|
31
|
-
static nextPage(headerLink: string): string | null;
|
|
32
|
-
}
|
|
33
|
-
export declare function hex2rgb(c: string): {
|
|
34
|
-
r: number;
|
|
35
|
-
g: number;
|
|
36
|
-
b: number;
|
|
37
|
-
};
|
|
38
|
-
export declare function rgb2hex(r: any, g: any, b: any): string;
|
|
39
|
-
export declare function rgbToHsl(r: any, g: any, b: any): any[];
|
|
40
|
-
export declare function hslToRgb(h: any, s: any, l: any): number[];
|
|
41
|
-
export declare function hue2rgb(p: any, q: any, t: any): any;
|
|
42
|
-
export declare function rgbToHsv(r: any, g: any, b: any): any[];
|
|
43
|
-
export declare function hsvToRgb(h: any, s: any, v: any): number[];
|
|
44
|
-
export declare const iOS: boolean;
|
|
45
|
-
export declare function copy(obj: any): any;
|
|
46
|
-
export declare function compare(_obj1: any, _obj2: any): any;
|
|
47
|
-
export declare function isValidJSON(code: string): boolean;
|
|
48
|
-
export declare function isPlatformCode(code: string): any;
|
|
49
|
-
export declare function matchCodes(code1: string, code2: string): any;
|
|
50
|
-
export declare function getPlatformSettings(): PlatformSettings;
|
|
51
|
-
export declare const IS_ANDROID: boolean;
|
|
52
|
-
export declare const IS_IOS: boolean;
|
|
53
|
-
export declare const IS_AR_DEVICE_COMPLIANT: boolean;
|
|
54
|
-
export declare function uuid(): string;
|
|
55
|
-
export declare function sleep(ms: number): Promise<unknown>;
|
|
56
|
-
export declare function ascComparator(getProp: (item: any) => string): (a: any, b: any) => 1 | -1 | 0;
|
|
1
|
+
import { PlatformSettings } from './models';
|
|
2
|
+
export interface PublicTranslations {
|
|
3
|
+
statics: Map<string, string>;
|
|
4
|
+
dynamics: Map<string, string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class T {
|
|
7
|
+
static translations: PublicTranslations | null;
|
|
8
|
+
static _(str: string, domain: string): any;
|
|
9
|
+
static _d(str: string): string;
|
|
10
|
+
}
|
|
11
|
+
export declare function dataURLtoFile(dataurl: any, filename: any): File;
|
|
12
|
+
export declare class StringHelper {
|
|
13
|
+
static padLeft(str: string | number, width: number, char: string): string;
|
|
14
|
+
static padRight(str: string | number, width: number, char: string): string;
|
|
15
|
+
static format(str: string, ...args: string[]): string;
|
|
16
|
+
static camelToSnake(o: any): any[] | {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
val: any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
static pascalToCamel(o: any): any[] | {
|
|
22
|
+
[key: string]: {
|
|
23
|
+
val: any;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare class Browser {
|
|
28
|
+
static openWindow(url: string, width: number, height: number): Window | null;
|
|
29
|
+
}
|
|
30
|
+
export declare class Pagination {
|
|
31
|
+
static nextPage(headerLink: string): string | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function hex2rgb(c: string): {
|
|
34
|
+
r: number;
|
|
35
|
+
g: number;
|
|
36
|
+
b: number;
|
|
37
|
+
};
|
|
38
|
+
export declare function rgb2hex(r: any, g: any, b: any): string;
|
|
39
|
+
export declare function rgbToHsl(r: any, g: any, b: any): any[];
|
|
40
|
+
export declare function hslToRgb(h: any, s: any, l: any): number[];
|
|
41
|
+
export declare function hue2rgb(p: any, q: any, t: any): any;
|
|
42
|
+
export declare function rgbToHsv(r: any, g: any, b: any): any[];
|
|
43
|
+
export declare function hsvToRgb(h: any, s: any, v: any): number[];
|
|
44
|
+
export declare const iOS: boolean;
|
|
45
|
+
export declare function copy(obj: any): any;
|
|
46
|
+
export declare function compare(_obj1: any, _obj2: any): any;
|
|
47
|
+
export declare function isValidJSON(code: string): boolean;
|
|
48
|
+
export declare function isPlatformCode(code: string): any;
|
|
49
|
+
export declare function matchCodes(code1: string, code2: string): any;
|
|
50
|
+
export declare function getPlatformSettings(): PlatformSettings;
|
|
51
|
+
export declare const IS_ANDROID: boolean;
|
|
52
|
+
export declare const IS_IOS: boolean;
|
|
53
|
+
export declare const IS_AR_DEVICE_COMPLIANT: boolean;
|
|
54
|
+
export declare function uuid(): string;
|
|
55
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
56
|
+
export declare function ascComparator(getProp: (item: any) => string): (a: any, b: any) => 1 | -1 | 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use Zakeke hook
|
|
3
|
-
* @module useZakeke
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* The entry point to use all Zakeke features
|
|
7
|
-
* @returns {import("../state/providerValue").Zakeke} Contains all the data and methods to control a Zakeke configuration
|
|
8
|
-
*/
|
|
9
|
-
export declare const useZakeke: () => import("../state/providerValue").Zakeke;
|
|
1
|
+
/**
|
|
2
|
+
* Use Zakeke hook
|
|
3
|
+
* @module useZakeke
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The entry point to use all Zakeke features
|
|
7
|
+
* @returns {import("../state/providerValue").Zakeke} Contains all the data and methods to control a Zakeke configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare const useZakeke: () => import("../state/providerValue").Zakeke;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export default class ImageUploadTask {
|
|
2
|
-
culture: string;
|
|
3
|
-
token: string;
|
|
4
|
-
constructor(culture: string, token: string);
|
|
5
|
-
upload: (file: File, onProgress?: ((progress: number) => void) | undefined) => Promise<any[] | null | undefined>;
|
|
6
|
-
private uploadFileChunked;
|
|
7
|
-
private resumableUpload;
|
|
8
|
-
private createImageTask;
|
|
9
|
-
private getImageFromTask;
|
|
10
|
-
}
|
|
1
|
+
export default class ImageUploadTask {
|
|
2
|
+
culture: string;
|
|
3
|
+
token: string;
|
|
4
|
+
constructor(culture: string, token: string);
|
|
5
|
+
upload: (file: File, onProgress?: ((progress: number) => void) | undefined) => Promise<any[] | null | undefined>;
|
|
6
|
+
private uploadFileChunked;
|
|
7
|
+
private resumableUpload;
|
|
8
|
+
private createImageTask;
|
|
9
|
+
private getImageFromTask;
|
|
10
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from './components/customizer';
|
|
2
|
-
export * from './components/sceneViewer';
|
|
3
|
-
export * from './components/tryOnViewer';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
1
|
+
export * from './components/customizer';
|
|
2
|
+
export * from './components/sceneViewer';
|
|
3
|
+
export * from './components/tryon/tryOnViewer';
|
|
4
|
+
export * from './components/tryon/tryOnModels';
|
|
5
|
+
export * from './environment';
|
|
6
|
+
export * from './hooks/useZakeke';
|
|
7
|
+
export * from './models';
|
|
8
|
+
export * from './state/provider';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Integration } from "./Integration";
|
|
2
|
-
export declare function integrationFor(platform: string): Promise<Integration>;
|
|
1
|
+
import { Integration } from "./Integration";
|
|
2
|
+
export declare function integrationFor(platform: string): Promise<Integration>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Item } from "..";
|
|
2
|
-
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
3
|
-
export declare class PlatformAttributeSelection {
|
|
4
|
-
attributeCode: string;
|
|
5
|
-
optionCode: string;
|
|
6
|
-
attributeLabel: string;
|
|
7
|
-
optionLabel: string;
|
|
8
|
-
attributeIsEnabled: boolean;
|
|
9
|
-
optionIsEnabled: boolean;
|
|
10
|
-
constructor(attributeCode: string, optionCode: string, attributeLabel: string, optionLabel: string, attributeIsEnabled: boolean, optionIsEnabled: boolean);
|
|
11
|
-
}
|
|
12
|
-
export interface Integration {
|
|
13
|
-
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>, shopifyNFTPrice: number): void;
|
|
14
|
-
getPrice(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, isCustomPricingConfiguratorEnabled: boolean, isCustomPricingRuleBasedEnabled: boolean, quantity: number, shopifyNFTPrice: number): Promise<number | {
|
|
15
|
-
price: number;
|
|
16
|
-
isOutOfStock: boolean;
|
|
17
|
-
}>;
|
|
18
|
-
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
19
|
-
url: string;
|
|
20
|
-
}>;
|
|
21
|
-
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
22
|
-
close(): void;
|
|
23
|
-
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
24
|
-
}
|
|
1
|
+
import { Item } from "..";
|
|
2
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
3
|
+
export declare class PlatformAttributeSelection {
|
|
4
|
+
attributeCode: string;
|
|
5
|
+
optionCode: string;
|
|
6
|
+
attributeLabel: string;
|
|
7
|
+
optionLabel: string;
|
|
8
|
+
attributeIsEnabled: boolean;
|
|
9
|
+
optionIsEnabled: boolean;
|
|
10
|
+
constructor(attributeCode: string, optionCode: string, attributeLabel: string, optionLabel: string, attributeIsEnabled: boolean, optionIsEnabled: boolean);
|
|
11
|
+
}
|
|
12
|
+
export interface Integration {
|
|
13
|
+
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: Record<string, any>, shopifyNFTPrice: number): void;
|
|
14
|
+
getPrice(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], compositionPrice: number, isCustomPricingConfiguratorEnabled: boolean, isCustomPricingRuleBasedEnabled: boolean, quantity: number, shopifyNFTPrice: number): Promise<number | {
|
|
15
|
+
price: number;
|
|
16
|
+
isOutOfStock: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
19
|
+
url: string;
|
|
20
|
+
}>;
|
|
21
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
22
|
+
close(): void;
|
|
23
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
24
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
2
|
-
import { Item } from "../models";
|
|
3
|
-
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
4
|
-
export default class MerchantIntegrationGeneric implements Integration {
|
|
5
|
-
private readonly callbacks;
|
|
6
|
-
private messageIds;
|
|
7
|
-
private pricingCalculator;
|
|
8
|
-
constructor();
|
|
9
|
-
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: any, shopifyNFTPrice: number): void;
|
|
10
|
-
getPrice(composition: any, design: any, model: any, attributes: any, compositionPrice: any, isCustomPricingConfiguratorEnabled: any, isCustomPricingRuleBasedEnabled: any, quantity: number): Promise<number>;
|
|
11
|
-
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
-
url: string;
|
|
13
|
-
}>;
|
|
14
|
-
close(): void;
|
|
15
|
-
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
16
|
-
}
|
|
1
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
2
|
+
import { Item } from "../models";
|
|
3
|
+
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
4
|
+
export default class MerchantIntegrationGeneric implements Integration {
|
|
5
|
+
private readonly callbacks;
|
|
6
|
+
private messageIds;
|
|
7
|
+
private pricingCalculator;
|
|
8
|
+
constructor();
|
|
9
|
+
addToCart(composition: any, design: any, model: any, attributes: PlatformAttributeSelection[], designItems: Item[], quantity: number, additionalProperties: any, shopifyNFTPrice: number): void;
|
|
10
|
+
getPrice(composition: any, design: any, model: any, attributes: any, compositionPrice: any, isCustomPricingConfiguratorEnabled: any, isCustomPricingRuleBasedEnabled: any, quantity: number): Promise<number>;
|
|
11
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
+
url: string;
|
|
13
|
+
}>;
|
|
14
|
+
close(): void;
|
|
15
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
16
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Item } from "..";
|
|
2
|
-
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
3
|
-
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
4
|
-
export default class MerchantIntegrationPreview implements Integration {
|
|
5
|
-
constructor();
|
|
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: any, compositionPrice: any, isCustomPricingConfiguratorEnabled: any, isCustomPricingRuleBasedEnabled: any, quantity: number): Promise<{
|
|
8
|
-
price: number;
|
|
9
|
-
isOutOfStock: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
-
url: string;
|
|
13
|
-
}>;
|
|
14
|
-
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
15
|
-
close(): void;
|
|
16
|
-
}
|
|
1
|
+
import { Item } from "..";
|
|
2
|
+
import { DesignPriceCalculatorRuleBased } from "../../../../libs/pricingRuleBase/DesignPriceCalculatorRuleBased";
|
|
3
|
+
import { Integration, PlatformAttributeSelection } from "./Integration";
|
|
4
|
+
export default class MerchantIntegrationPreview implements Integration {
|
|
5
|
+
constructor();
|
|
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: any, compositionPrice: any, isCustomPricingConfiguratorEnabled: any, isCustomPricingRuleBasedEnabled: any, quantity: number): Promise<{
|
|
8
|
+
price: number;
|
|
9
|
+
isOutOfStock: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
getSharedCompositionUrl(compositionDocID: string): Promise<{
|
|
12
|
+
url: string;
|
|
13
|
+
}>;
|
|
14
|
+
setPricingCalculator(pricingCalculator: DesignPriceCalculatorRuleBased): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { BootParameters } from '..';
|
|
3
|
-
declare const Boot: FC<{
|
|
4
|
-
parameters?: BootParameters | null;
|
|
5
|
-
}>;
|
|
6
|
-
export default Boot;
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BootParameters } from '..';
|
|
3
|
+
declare const Boot: FC<{
|
|
4
|
+
parameters?: BootParameters | null;
|
|
5
|
+
}>;
|
|
6
|
+
export default Boot;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AppState } from "./state";
|
|
2
|
-
export type Reducer = (prevState: AppState, action: any) => AppState;
|
|
3
|
-
export declare function reducer(prevState: AppState, action: any): AppState;
|
|
1
|
+
import { AppState } from "./state";
|
|
2
|
+
export type Reducer = (prevState: AppState, action: any) => AppState;
|
|
3
|
+
export declare function reducer(prevState: AppState, action: any): AppState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ZakekeEnvironment } from "../environment";
|
|
2
|
-
export interface AppState {
|
|
3
|
-
environment: ZakekeEnvironment;
|
|
4
|
-
isAddToCartLoading: boolean;
|
|
5
|
-
isSceneLoading: boolean;
|
|
6
|
-
parametersReceived: boolean;
|
|
7
|
-
}
|
|
1
|
+
import { ZakekeEnvironment } from "../environment";
|
|
2
|
+
export interface AppState {
|
|
3
|
+
environment: ZakekeEnvironment;
|
|
4
|
+
isAddToCartLoading: boolean;
|
|
5
|
+
isSceneLoading: boolean;
|
|
6
|
+
parametersReceived: boolean;
|
|
7
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -50343,7 +50343,7 @@ var SceneEditor = /*#__PURE__*/function (_SceneViewer) {
|
|
|
50343
50343
|
formData.append('file_' + i, blobInfo.blob, blobInfo.name);
|
|
50344
50344
|
}
|
|
50345
50345
|
jQuery.ajax({
|
|
50346
|
-
url: zkScene.
|
|
50346
|
+
url: zkScene.getSceneIncrementalFileUploadUrl(),
|
|
50347
50347
|
data: formData,
|
|
50348
50348
|
cache: false,
|
|
50349
50349
|
contentType: false,
|
|
@@ -67502,6 +67502,7 @@ var MerchantIntegrationGeneric = /*#__PURE__*/function () {
|
|
|
67502
67502
|
zakekeMessageType: MessageType.AddToCart,
|
|
67503
67503
|
message: {
|
|
67504
67504
|
composition: composition.id,
|
|
67505
|
+
design: design === null || design === void 0 ? void 0 : design.id,
|
|
67505
67506
|
preview: composition.get('previewImageUrl'),
|
|
67506
67507
|
designPrice: designPrice,
|
|
67507
67508
|
attributes: attributes,
|
|
@@ -69589,11 +69590,14 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
|
|
|
69589
69590
|
//verifichiamo prima i targets e poi gli elements
|
|
69590
69591
|
var colorName = ''; //ci serve per i target
|
|
69591
69592
|
|
|
69593
|
+
var attributeColor = attributeMatchColorId ? product.get('colors').find(function (c) {
|
|
69594
|
+
return c.get('colorID') == attributeMatchColorId;
|
|
69595
|
+
}) : null;
|
|
69592
69596
|
var colore = product.get('colors').find(function (c) {
|
|
69593
|
-
return c.get('colorID') ==
|
|
69597
|
+
return c.get('colorID') == _this.colorID;
|
|
69594
69598
|
});
|
|
69595
69599
|
if (colore == null || colore == undefined) return context;
|
|
69596
|
-
colorName = colore.get('name');
|
|
69600
|
+
colorName = attributeColor ? attributeColor.get('name') : colore.get('name');
|
|
69597
69601
|
var sides = colore.get('sides');
|
|
69598
69602
|
context.sides = [];
|
|
69599
69603
|
if (rule.targets.length == 0) {
|