zakeke-configurator-react 0.0.88 → 0.0.91

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,7 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import { FocusAttributesEventListener } from '../../../3D/src';
3
3
  import { PlatformAttributeSelection } from './integrations/Integration';
4
- import { Camera, FontFamily, Group, Image, ImageMacroCategory, Item, Product, Template } from './models';
4
+ import { Camera, FontFamily, Group, Image, ImageMacroCategory, Item, Product, Template, SellerSettings } from './models';
5
5
  export declare class ZakekeEnvironment {
6
6
  private token;
7
7
  private platformAttributesSelection;
@@ -22,6 +22,7 @@ export declare class ZakekeEnvironment {
22
22
  private highlightSettings;
23
23
  private previousMeshesVisibleStates;
24
24
  private lastCameraLocation;
25
+ sellerSettings: SellerSettings | null;
25
26
  get internalProduct(): MPlaza.Model | null;
26
27
  get internalScene(): Zakeke.Scene | null;
27
28
  get internalCurrentTemplate(): MPlaza.Design | null | undefined;
@@ -49,6 +50,7 @@ export declare class ZakekeEnvironment {
49
50
  private getComposerModels;
50
51
  private getFonts;
51
52
  private getSettings;
53
+ private getSellerSetting;
52
54
  private loadScript;
53
55
  boot: (parameters?: any) => Promise<void>;
54
56
  appendViewer: (container: HTMLElement) => void;
@@ -1,6 +1,6 @@
1
1
  import { FontFamily, Group, Item, Product, Template } from "..";
2
2
  import { FocusAttributesEventListener } from "../../../../3D/src";
3
- import { Camera, Image, ImageMacroCategory } from "../models";
3
+ import { Camera, Image, ImageMacroCategory, SellerSettings } from "../models";
4
4
  import { AppState } from "./state";
5
5
  export interface ProviderValue {
6
6
  internalProduct: MPlaza.Model | null;
@@ -21,6 +21,7 @@ export interface ProviderValue {
21
21
  productCode: string;
22
22
  product: Product | null;
23
23
  cameras: Camera[];
24
+ sellerSettings: SellerSettings | null;
24
25
  selectOption: (optionId: number) => void;
25
26
  internalAppendViewer: (container: HTMLElement) => void;
26
27
  designUpdate: () => void;
package/dist/index.js CHANGED
@@ -48499,6 +48499,7 @@ class ZakekeEnvironment {
48499
48499
  this.highlightSettings = null;
48500
48500
  this.previousMeshesVisibleStates = {};
48501
48501
  this.lastCameraLocation = null;
48502
+ this.sellerSettings = null;
48502
48503
  this.currency = 'EUR';
48503
48504
  this.groups = [];
48504
48505
  this.fonts = [];
@@ -48719,6 +48720,13 @@ class ZakekeEnvironment {
48719
48720
  throw "Failed loading settings";
48720
48721
  }
48721
48722
  });
48723
+ this.getSellerSetting = () => __awaiter(this, void 0, void 0, function* () {
48724
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
48725
+ // Fetch the seller setting
48726
+ const sellerSetting = (yield _api__WEBPACK_IMPORTED_MODULE_2__["axiosApi"].get("sellerSetting/")).data;
48727
+ resolve(sellerSetting);
48728
+ }));
48729
+ });
48722
48730
  this.loadScript = (src) => __awaiter(this, void 0, void 0, function* () {
48723
48731
  return new Promise((resolve, reject) => {
48724
48732
  var script = document.createElement("script");
@@ -48738,6 +48746,7 @@ class ZakekeEnvironment {
48738
48746
  this.zkProduct = composerModels.get('model');
48739
48747
  this.product = _models__WEBPACK_IMPORTED_MODULE_9__["Product"].fromProduct(this.zkProduct);
48740
48748
  this.integration = yield Object(_integrations_Helpers__WEBPACK_IMPORTED_MODULE_7__["integrationFor"])(this.platform);
48749
+ this.sellerSettings = yield this.getSellerSetting();
48741
48750
  if (!this.zkScene)
48742
48751
  throw new Error('Product has no 3D scene.');
48743
48752
  this.trigger("change");
@@ -48882,7 +48891,9 @@ class ZakekeEnvironment {
48882
48891
  });
48883
48892
  if (option) {
48884
48893
  this.selection.selectAttributeValue(attribute.get('attributeID'), option.get('optionID'));
48894
+ // Update here the labels because events are not attached yet (attached below)
48885
48895
  platformSelection.attributeLabel = attribute.get("name");
48896
+ platformSelection.optionLabel = option.get("name");
48886
48897
  }
48887
48898
  }
48888
48899
  }
@@ -51265,6 +51276,7 @@ const createProviderValue = (state, dispatch) => {
51265
51276
  productCode: state.environment.productCode,
51266
51277
  product: state.environment.product,
51267
51278
  cameras: state.environment.cameras,
51279
+ sellerSettings: state.environment.sellerSettings,
51268
51280
  getPDF: state.environment.getPDF.bind(state.environment),
51269
51281
  getOnlineScreenshot: state.environment.getOnlineScreenshot.bind(state.environment),
51270
51282
  setCamera: state.environment.setCamera.bind(state.environment),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zakeke-configurator-react",
3
- "version": "0.0.88",
3
+ "version": "0.0.91",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/declarations/composer/Module/src/index.d.ts",