zakeke-configurator-react 0.0.102 → 0.0.105

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.
@@ -23,8 +23,19 @@ export declare class Product {
23
23
  metadata?: any;
24
24
  areas: ProductArea[];
25
25
  quantityRule: ProductQuantityRule | null;
26
+ quoteRule: QuoteRule | null;
26
27
  static fromProduct(zkProduct: any): Product;
27
28
  }
29
+ export declare class QuoteRule {
30
+ quoteRuleID: number;
31
+ name: string;
32
+ sellerID: number;
33
+ formControlsData: string;
34
+ isValidForAllProducts: boolean;
35
+ allowAddToCart: boolean;
36
+ products: number[];
37
+ constructor(quoteRule: any);
38
+ }
28
39
  export declare class ProductArea {
29
40
  id: number;
30
41
  name: string;
@@ -192,6 +203,7 @@ export interface Settings {
192
203
  username: string;
193
204
  referrerID: number;
194
205
  ecommerceUrl: string;
206
+ ecommerceID: number | null;
195
207
  addons: Addon[];
196
208
  eventMessages: EventMessage[];
197
209
  }
@@ -293,4 +305,13 @@ export interface OnBeforeSendDataToParent {
293
305
  quantity: number;
294
306
  additionalProperties: any;
295
307
  }
308
+ export interface TemplateUploadRestrictictions {
309
+ isUserImageAllowed: boolean;
310
+ isJpgAllowed: boolean;
311
+ isPngAllowed: boolean;
312
+ isSvgAllowed: boolean;
313
+ isPdfAllowed: boolean;
314
+ isEpsAllowed: boolean;
315
+ isPdfWithRasterAllowed: boolean;
316
+ }
296
317
  export {};
@@ -1,6 +1,6 @@
1
1
  import { FontFamily, Group, Item, OnBeforeSendDataToParent, Product, Template } from "..";
2
2
  import { FocusAttributesEventListener } from "../../../../3D/src";
3
- import { Camera, Image, ImageMacroCategory, SellerSettings, TemplateUploadRestrictictions, ProductQuantityRule } from "../models";
3
+ import { Camera, Image, ImageMacroCategory, ProductQuantityRule, SellerSettings, TemplateUploadRestrictictions } from "../models";
4
4
  import { AppState } from "./state";
5
5
  interface RestrictionColor {
6
6
  colorCode: string;
package/dist/index.js CHANGED
@@ -10198,9 +10198,6 @@ class SceneHelper {
10198
10198
  }
10199
10199
  }
10200
10200
  }
10201
- if (arFileUrl && !arScale) {
10202
- arFileUrl += "#allowsContentScaling=0";
10203
- }
10204
10201
  return arFileUrl;
10205
10202
  });
10206
10203
  }
@@ -10223,8 +10220,6 @@ class SceneHelper {
10223
10220
  if (uploadResult && uploadResult.length > 0) {
10224
10221
  for (let i = 0; i < uploadResult.length; i++) {
10225
10222
  const res = uploadResult[i];
10226
- if (res.format === "usdz" && !arScale)
10227
- res.arFileUrl += "#allowsContentScaling=0";
10228
10223
  result.push(res);
10229
10224
  }
10230
10225
  //result = [...uploadResult];
@@ -19338,7 +19333,6 @@ class SceneEditor extends _SceneViewer__WEBPACK_IMPORTED_MODULE_10__.SceneViewer
19338
19333
  }
19339
19334
  // Applica la texture
19340
19335
  if (texture) {
19341
- console.log("texture prima di isReady ", texture);
19342
19336
  _Components_SceneHelper__WEBPACK_IMPORTED_MODULE_3__.SceneHelper.whenTextureIsReadyAsync(texture).then(() => {
19343
19337
  if (material) {
19344
19338
  const oldTexture = this.getMaterialTexture(material, type);
@@ -19346,13 +19340,11 @@ class SceneEditor extends _SceneViewer__WEBPACK_IMPORTED_MODULE_10__.SceneViewer
19346
19340
  if (oldTexture && !this.isTextureUsed(oldTexture))
19347
19341
  oldTexture.dispose();
19348
19342
  this.setRenderingNeeded();
19349
- console.log("sei prima del resolve");
19350
19343
  resolve();
19351
19344
  }
19352
19345
  });
19353
19346
  }
19354
19347
  else {
19355
- console.log("sei dopo il resolve 2");
19356
19348
  resolve();
19357
19349
  }
19358
19350
  });
@@ -24525,16 +24517,16 @@ __webpack_require__.r(__webpack_exports__);
24525
24517
  /* harmony export */ });
24526
24518
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
24527
24519
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
24528
- /* harmony import */ var _state_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../state/provider */ "./src/state/provider.tsx");
24520
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
24521
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
24529
24522
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers */ "./src/helpers.tsx");
24530
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
24531
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
24523
+ /* harmony import */ var _state_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../state/provider */ "./src/state/provider.tsx");
24532
24524
 
24533
24525
 
24534
24526
 
24535
24527
 
24536
24528
 
24537
- const ZakekeDesignerContainer = (styled_components__WEBPACK_IMPORTED_MODULE_3___default().div) `
24529
+ const ZakekeDesignerContainer = (styled_components__WEBPACK_IMPORTED_MODULE_1___default().div) `
24538
24530
  width: 100%;
24539
24531
  height: 100%;
24540
24532
  position: relative;
@@ -24548,7 +24540,7 @@ const ZakekeDesignerContainer = (styled_components__WEBPACK_IMPORTED_MODULE_3___
24548
24540
  // You should save the current editor with the ref
24549
24541
  const ZakekeDesigner = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, ref) => {
24550
24542
  const [guid] = react__WEBPACK_IMPORTED_MODULE_0__.useState((0,_helpers__WEBPACK_IMPORTED_MODULE_2__.uuid)());
24551
- const { designUpdate, internalProduct, currentTemplate, internalCurrentTemplate } = (0,_state_provider__WEBPACK_IMPORTED_MODULE_1__.useZakeke)();
24543
+ const { designUpdate, internalProduct, currentTemplate, internalCurrentTemplate } = (0,_state_provider__WEBPACK_IMPORTED_MODULE_3__.useZakeke)();
24552
24544
  const [customizer, setCustomizer] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);
24553
24545
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
24554
24546
  const container = document.getElementById('zakeke-designer-container-' + guid);
@@ -24571,8 +24563,9 @@ const ZakekeDesigner = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, ref
24571
24563
  if (side && customizer && internalCurrentTemplate) {
24572
24564
  customizer.model = internalProduct;
24573
24565
  customizer.setDesign(internalCurrentTemplate);
24574
- customizer.setSide(side);
24575
- customizer.adaptZoomToSideAreas(false);
24566
+ customizer.setSide(side).then(() => {
24567
+ customizer.adaptZoomToSideAreas(false);
24568
+ });
24576
24569
  }
24577
24570
  }
24578
24571
  }, [props.areaId, currentTemplate, !!customizer]);
@@ -26881,6 +26874,7 @@ __webpack_require__.r(__webpack_exports__);
26881
26874
  /* harmony export */ "Product": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.Product),
26882
26875
  /* harmony export */ "ProductArea": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.ProductArea),
26883
26876
  /* harmony export */ "ProductQuantityRule": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.ProductQuantityRule),
26877
+ /* harmony export */ "QuoteRule": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.QuoteRule),
26884
26878
  /* harmony export */ "Step": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.Step),
26885
26879
  /* harmony export */ "Template": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.Template),
26886
26880
  /* harmony export */ "TemplateArea": () => (/* reexport safe */ _models__WEBPACK_IMPORTED_MODULE_4__.TemplateArea),
@@ -27096,6 +27090,7 @@ __webpack_require__.r(__webpack_exports__);
27096
27090
  /* harmony export */ "Product": () => (/* binding */ Product),
27097
27091
  /* harmony export */ "ProductArea": () => (/* binding */ ProductArea),
27098
27092
  /* harmony export */ "ProductQuantityRule": () => (/* binding */ ProductQuantityRule),
27093
+ /* harmony export */ "QuoteRule": () => (/* binding */ QuoteRule),
27099
27094
  /* harmony export */ "Step": () => (/* binding */ Step),
27100
27095
  /* harmony export */ "Template": () => (/* binding */ Template),
27101
27096
  /* harmony export */ "TemplateArea": () => (/* binding */ TemplateArea),
@@ -27133,6 +27128,7 @@ class Product {
27133
27128
  constructor() {
27134
27129
  this.areas = [];
27135
27130
  this.quantityRule = null;
27131
+ this.quoteRule = null;
27136
27132
  }
27137
27133
  static fromProduct(zkProduct) {
27138
27134
  const product = new Product();
@@ -27142,9 +27138,21 @@ class Product {
27142
27138
  product.previewUrl = zkProduct.get("largeImageUrl");
27143
27139
  product.quantityRule = zkProduct.get("quantityRule") ? ProductQuantityRule.fromQuantityRule(zkProduct.get("quantityRule")) : null;
27144
27140
  product.areas = zkProduct.get("colors").length > 0 ? zkProduct.get("colors").at(0).get("sides").map(side => ProductArea.fromSide(side)) : [];
27141
+ product.quoteRule = zkProduct.get("quoteRule") ? new QuoteRule(zkProduct.get("quoteRule")) : null;
27145
27142
  return product;
27146
27143
  }
27147
27144
  }
27145
+ class QuoteRule {
27146
+ constructor(quoteRule) {
27147
+ this.quoteRuleID = quoteRule.quoteRuleID;
27148
+ this.name = quoteRule.name;
27149
+ this.sellerID = quoteRule.sellerID;
27150
+ this.formControlsData = quoteRule.formControlsData;
27151
+ this.isValidForAllProducts = quoteRule.isValidForAllProducts;
27152
+ this.allowAddToCart = quoteRule.allowAddToCart;
27153
+ this.products = quoteRule.products;
27154
+ }
27155
+ }
27148
27156
  class ProductArea {
27149
27157
  static fromSide(modelSide) {
27150
27158
  let area = new ProductArea();
@@ -27556,7 +27564,7 @@ const createProviderValue = (state, dispatch) => {
27556
27564
  setCameraZoomEnabled: state.environment.setCameraZoomEnabled.bind(state.environment),
27557
27565
  resetCameraPivot: state.environment.resetCameraPivot.bind(state.environment),
27558
27566
  setCameraPivot: state.environment.setCameraPivot.bind(state.environment),
27559
- setQuantity: state.environment.setQuantity,
27567
+ setQuantity: state.environment.setQuantity.bind(state.environment),
27560
27568
  getImages: state.environment.getImages.bind(state.environment),
27561
27569
  getMacroCategories: state.environment.getMacroCategories.bind(state.environment),
27562
27570
  previewOnly__setItemImageFromBase64: (guid, base64) => __awaiter(void 0, void 0, void 0, function* () { return dispatch({ type: 'SET_ITEM_IMAGE_FROM_BASE64', guid, base64 }); }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zakeke-configurator-react",
3
- "version": "0.0.102",
3
+ "version": "0.0.105",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/declarations/composer/Module/src/index.d.ts",