zakeke-configurator-react 0.0.198 → 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.
@@ -1,109 +1,109 @@
1
- import { FunctionComponent } from "react";
2
- import { TryOnFineTuningMazingSettings, TryOnGenericFineTuningSettings, TryOnProduct, TryOnProvider, TryOnSeller, TryOnType } from "../models";
3
- export declare function parseJSON(json: string): any;
4
- export declare enum TryOnMode {
5
- Undefined = 0,
6
- TryOn = 1,
7
- PDTool = 2
8
- }
9
- export interface TryOnViewerProps {
10
- mode: TryOnMode;
11
- onTimeout?: (value: boolean) => void;
12
- onPDUpdated?: (pd: number) => void;
13
- onClose?: () => void;
14
- }
15
- export interface VTryOnViewerProps {
16
- className?: string;
17
- provider: TryOnProvider;
18
- type: TryOnType;
19
- obj: Blob;
20
- settings?: TryOnGenericFineTuningSettings;
21
- product: TryOnProduct;
22
- customer: TryOnSeller;
23
- onReady?: () => void;
24
- onClose?: () => void;
25
- }
26
- export interface TryOnPDToolProps {
27
- className?: string;
28
- provider: TryOnProvider;
29
- product: TryOnProduct;
30
- customer: TryOnSeller;
31
- onReady?: () => void;
32
- onPDUpdated?: (pd: number) => void;
33
- onClose?: () => void;
34
- }
35
- export declare const TryOnViewerComponent: FunctionComponent<TryOnViewerProps>;
36
- export declare const VTryOnViewerComponent: FunctionComponent<VTryOnViewerProps>;
37
- export declare const TryOnPDToolComponent: FunctionComponent<TryOnPDToolProps>;
38
- export declare enum MazingTryOnState {
39
- Start = "",
40
- WaitingAuthentication = "WAITING_AUTH",
41
- AuthSuccessful = "AUTH_SUCCESS",
42
- TryOnLoaded = "MODEL_LOADED",
43
- AuthError = "AUTH_ERROR",
44
- WebcamError = "WEBCAM_ERROR",
45
- ScreenShotTaken = "SCREENSHOT_TAKEN",
46
- WebcamStopped = "WEBCAM_STOPPED"
47
- }
48
- export declare enum MazingTryOnOutMessage {
49
- StartAuthenticationTryOn = "AUTH_TRY_ON",
50
- LoadTryOn = "LOAD_MODEL",
51
- TakeScreenshot = "TAKE_SCREENSHOT",
52
- StopWebcam = "STOP_WEBCAM"
53
- }
54
- export declare enum MazingPDState {
55
- Start = "",
56
- WaitingAuthentication = "WAITING_AUTH",
57
- AuthSuccessful = "AUTH_SUCCESS",
58
- PDLoaded = "PD_LOADED",
59
- PDUpdated = "NEW_PD",
60
- AuthError = "AUTH_ERROR",
61
- PDDataNotFoundError = "PD_ERROR",
62
- WebcamError = "WEBCAM_ERROR",
63
- PDCountdown = "PD_COUNTDOWN",
64
- PDCountdownEnd = "PD_COUNTDOWN_END",
65
- WebcamStopped = "WEBCAM_STOPPED"
66
- }
67
- export declare enum MazingPDOutMessage {
68
- StartAuthenticationPD = "AUTH_TRY_ON",
69
- LoadPD = "LOAD_PD",
70
- StartPD = "START_PD",
71
- StopWebcam = "STOP_WEBCAM"
72
- }
73
- export interface MazingTryOnInMessage {
74
- type: MazingFrameState;
75
- value: any;
76
- }
77
- export interface MazingFrameProps {
78
- className?: string;
79
- outMessageHandler: (e: MessageEvent<any>) => void;
80
- onReady?: (w: Window) => void;
81
- }
82
- export interface MazingTryOnProps {
83
- className?: string;
84
- obj: Blob;
85
- product: TryOnProduct;
86
- customer: TryOnSeller;
87
- fineTuningSettings?: TryOnFineTuningMazingSettings;
88
- initialState?: MazingTryOnInMessage;
89
- closeFlag: boolean;
90
- onReady?: () => void;
91
- onReadyToShow?: () => void;
92
- onClosed?: () => void;
93
- }
94
- export interface MazingPDProps {
95
- className?: string;
96
- product: TryOnProduct;
97
- customer: TryOnSeller;
98
- initialState?: MazingTryOnInMessage;
99
- closeFlag: boolean;
100
- onReady?: () => void;
101
- onReadyToShow?: () => void;
102
- onPDUpdated?: (pd: number) => void;
103
- onClosed?: () => void;
104
- onClose?: () => void;
105
- }
106
- export type MazingFrameState = MazingTryOnState | MazingPDState;
107
- export declare const MazingFrameComponent: (props: MazingFrameProps) => JSX.Element;
108
- export declare const MazingTryOnComponent: FunctionComponent<MazingTryOnProps>;
109
- export declare const MazingPDToolComponent: FunctionComponent<MazingPDProps>;
1
+ import { FunctionComponent } from "react";
2
+ import { TryOnFineTuningMazingSettings, TryOnGenericFineTuningSettings, TryOnProduct, TryOnProvider, TryOnSeller, TryOnType } from "../models";
3
+ export declare function parseJSON(json: string): any;
4
+ export declare enum TryOnMode {
5
+ Undefined = 0,
6
+ TryOn = 1,
7
+ PDTool = 2
8
+ }
9
+ export interface TryOnViewerProps {
10
+ mode: TryOnMode;
11
+ onTimeout?: (value: boolean) => void;
12
+ onPDUpdated?: (pd: number) => void;
13
+ onClose?: () => void;
14
+ }
15
+ export interface VTryOnViewerProps {
16
+ className?: string;
17
+ provider: TryOnProvider;
18
+ type: TryOnType;
19
+ obj: Blob;
20
+ settings?: TryOnGenericFineTuningSettings;
21
+ product: TryOnProduct;
22
+ customer: TryOnSeller;
23
+ onReady?: () => void;
24
+ onClose?: () => void;
25
+ }
26
+ export interface TryOnPDToolProps {
27
+ className?: string;
28
+ provider: TryOnProvider;
29
+ product: TryOnProduct;
30
+ customer: TryOnSeller;
31
+ onReady?: () => void;
32
+ onPDUpdated?: (pd: number) => void;
33
+ onClose?: () => void;
34
+ }
35
+ export declare const TryOnViewerComponent: FunctionComponent<TryOnViewerProps>;
36
+ export declare const VTryOnViewerComponent: FunctionComponent<VTryOnViewerProps>;
37
+ export declare const TryOnPDToolComponent: FunctionComponent<TryOnPDToolProps>;
38
+ export declare enum MazingTryOnState {
39
+ Start = "",
40
+ WaitingAuthentication = "WAITING_AUTH",
41
+ AuthSuccessful = "AUTH_SUCCESS",
42
+ TryOnLoaded = "MODEL_LOADED",
43
+ AuthError = "AUTH_ERROR",
44
+ WebcamError = "WEBCAM_ERROR",
45
+ ScreenShotTaken = "SCREENSHOT_TAKEN",
46
+ WebcamStopped = "WEBCAM_STOPPED"
47
+ }
48
+ export declare enum MazingTryOnOutMessage {
49
+ StartAuthenticationTryOn = "AUTH_TRY_ON",
50
+ LoadTryOn = "LOAD_MODEL",
51
+ TakeScreenshot = "TAKE_SCREENSHOT",
52
+ StopWebcam = "STOP_WEBCAM"
53
+ }
54
+ export declare enum MazingPDState {
55
+ Start = "",
56
+ WaitingAuthentication = "WAITING_AUTH",
57
+ AuthSuccessful = "AUTH_SUCCESS",
58
+ PDLoaded = "PD_LOADED",
59
+ PDUpdated = "NEW_PD",
60
+ AuthError = "AUTH_ERROR",
61
+ PDDataNotFoundError = "PD_ERROR",
62
+ WebcamError = "WEBCAM_ERROR",
63
+ PDCountdown = "PD_COUNTDOWN",
64
+ PDCountdownEnd = "PD_COUNTDOWN_END",
65
+ WebcamStopped = "WEBCAM_STOPPED"
66
+ }
67
+ export declare enum MazingPDOutMessage {
68
+ StartAuthenticationPD = "AUTH_TRY_ON",
69
+ LoadPD = "LOAD_PD",
70
+ StartPD = "START_PD",
71
+ StopWebcam = "STOP_WEBCAM"
72
+ }
73
+ export interface MazingTryOnInMessage {
74
+ type: MazingFrameState;
75
+ value: any;
76
+ }
77
+ export interface MazingFrameProps {
78
+ className?: string;
79
+ outMessageHandler: (e: MessageEvent<any>) => void;
80
+ onReady?: (w: Window) => void;
81
+ }
82
+ export interface MazingTryOnProps {
83
+ className?: string;
84
+ obj: Blob;
85
+ product: TryOnProduct;
86
+ customer: TryOnSeller;
87
+ fineTuningSettings?: TryOnFineTuningMazingSettings;
88
+ initialState?: MazingTryOnInMessage;
89
+ closeFlag: boolean;
90
+ onReady?: () => void;
91
+ onReadyToShow?: () => void;
92
+ onClosed?: () => void;
93
+ }
94
+ export interface MazingPDProps {
95
+ className?: string;
96
+ product: TryOnProduct;
97
+ customer: TryOnSeller;
98
+ initialState?: MazingTryOnInMessage;
99
+ closeFlag: boolean;
100
+ onReady?: () => void;
101
+ onReadyToShow?: () => void;
102
+ onPDUpdated?: (pd: number) => void;
103
+ onClosed?: () => void;
104
+ onClose?: () => void;
105
+ }
106
+ export type MazingFrameState = MazingTryOnState | MazingPDState;
107
+ export declare const MazingFrameComponent: (props: MazingFrameProps) => JSX.Element;
108
+ export declare const MazingTryOnComponent: FunctionComponent<MazingTryOnProps>;
109
+ export declare const MazingPDToolComponent: FunctionComponent<MazingPDProps>;
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.getSceneFileUploadUrl(),
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') == (attributeMatchColorId || _this.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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zakeke-configurator-react",
3
- "version": "0.0.198",
3
+ "version": "0.0.199",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/declarations/composer/Module/src/index.d.ts",