@ikas/storefront 2.0.49 → 2.0.51-alpha.1

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,6 +1,7 @@
1
1
  export declare class IkasImage {
2
2
  id: string;
3
- constructor(id: string);
3
+ isVideo: boolean;
4
+ constructor(id: string, isVideo?: boolean);
4
5
  get editorApiKey(): any;
5
6
  get src(): string;
6
7
  get thumbnailSrc(): string;
@@ -1 +1 @@
1
- import{makeAutoObservable as e}from"mobx";import{decodeBase64 as t}from"../../../utils/helper.js";import{IkasStorefrontConfig as i}from"../../../storefront/index.js";import"../../../utils/i18n.js";var r=function(){function r(t){this.id=t,e(this)}return Object.defineProperty(r.prototype,"editorApiKey",{get:function(){if("undefined"!=typeof window)return window.editorApiKey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"src",{get:function(){return this.getSrc(1080)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"thumbnailSrc",{get:function(){return this.getSrc(180)},enumerable:!1,configurable:!0}),r.prototype.getSrc=function(e){if(this.id.includes("/"))return"".concat(process.env.NEXT_PUBLIC_IMG_BASE_URL,"images/").concat(this.id,"/image_").concat(e,".webp");var r=t(this.editorApiKey||i.config.apiKey||"");return"".concat(process.env.NEXT_PUBLIC_IMG_BASE_URL,"images/").concat(r,"/").concat(this.id,"/image_").concat(e,".webp")},r}();export{r as IkasImage};
1
+ import{makeAutoObservable as e}from"mobx";import{decodeBase64 as t}from"../../../utils/helper.js";import{IkasStorefrontConfig as i}from"../../../storefront/index.js";import"../../../utils/i18n.js";var o=function(){function o(t,i){this.id=t,this.isVideo=i||!1,e(this)}return Object.defineProperty(o.prototype,"editorApiKey",{get:function(){if("undefined"!=typeof window)return window.editorApiKey},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"src",{get:function(){return this.getSrc(1080)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"thumbnailSrc",{get:function(){return this.getSrc(180)},enumerable:!1,configurable:!0}),o.prototype.getSrc=function(e){if(this.id.includes("/"))return this.isVideo?"".concat(process.env.NEXT_PUBLIC_VIDEO_BASE_URL,"videos/").concat(this.id,"/original.mp4"):"".concat(process.env.NEXT_PUBLIC_IMG_BASE_URL,"images/").concat(this.id,"/image_").concat(e,".webp");var o=t(this.editorApiKey||i.config.apiKey||"");return this.isVideo?"".concat(process.env.NEXT_PUBLIC_VIDEO_BASE_URL,"videos/").concat(o,"/").concat(this.id,"/original.mp4"):"".concat(process.env.NEXT_PUBLIC_IMG_BASE_URL,"images/").concat(o,"/").concat(this.id,"/image_").concat(e,".webp")},o}();export{o as IkasImage};
@@ -53,6 +53,7 @@ export interface ISimpleProductPrice {
53
53
  export interface ISimpleProductImage {
54
54
  order: number;
55
55
  isMain: boolean;
56
+ isVideo?: boolean;
56
57
  id: string;
57
58
  }
58
59
  export interface ISimpleVariationValueRelation {
@@ -25,6 +25,8 @@ export declare class AccountInfoForm {
25
25
  set lastName(value: string);
26
26
  get phone(): string;
27
27
  set phone(value: string);
28
+ get isMarketingAccepted(): boolean;
29
+ set isMarketingAccepted(value: boolean);
28
30
  get firstNameErrorMessage(): string | undefined;
29
31
  get lastNameErrorMessage(): string | undefined;
30
32
  get phoneErrorMessage(): string | undefined;
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t,__spreadArray as r}from'../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as o,action as i}from"mobx";import{Validator as a}from"../index.js";import{PhoneRule as n,RequiredRule as u}from"../rules/index.js";var l=function(){function l(e){var t=this;this.validatorRules=function(e){return void 0===e&&(e=!1),r([new u({model:t.customer,fieldKey:"firstName",valuePath:"firstName",message:t.message.requiredRule}),new u({model:t.customer,fieldKey:"lastName",valuePath:"lastName",message:t.message.requiredRule})],e?[new n({model:t.customer,fieldKey:"phone",valuePath:"phone",message:t.message.phoneRule})]:[],!0)},this.onFirstNameChange=function(e){t.customer.firstName=e},this.onLastNameChange=function(e){t.customer.lastName=e},this.onPhoneChange=function(e){t.customer.phone=e||null,e||t.validator.setRules(t.validatorRules())},s(this,{firstNameErrorMessage:o,lastNameErrorMessage:o,phoneErrorMessage:o,hasError:o,firstName:o,lastName:o,phone:o,validateAll:i,submit:i}),this.customer=e.customer,this.store=e.store,this.message=e.message,this.validator=new a(this.customer,this.validatorRules())}return Object.defineProperty(l.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"email",{get:function(){return this.customer.email},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"firstName",{get:function(){return this.customer.firstName},set:function(e){this.customer.firstName=e},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"lastName",{get:function(){return this.customer.lastName},set:function(e){this.customer.lastName=e},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"phone",{get:function(){return this.customer.phone||""},set:function(e){this.customer.phone=e},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"firstNameErrorMessage",{get:function(){var e,t;return null===(t=null===(e=this.validator.results)||void 0===e?void 0:e.firstName)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"lastNameErrorMessage",{get:function(){var e,t;return null===(t=null===(e=this.validator.results)||void 0===e?void 0:e.lastName)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"phoneErrorMessage",{get:function(){var e,t;return null===(t=null===(e=this.validator.results)||void 0===e?void 0:e.phone)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),l.prototype.validateAll=function(){return this.validator.validateAll()},l.prototype.submit=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e={isFormError:!1,isSuccess:!1},this.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(t.sent())return e.isFormError=!0,[2,e];t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.store.customerStore.saveCustomer(this.customer)];case 3:return t.sent()&&(e.isSuccess=!0),[2,e];case 4:return t.sent(),[2,e];case 5:return[2]}}))}))},l}();export{l as AccountInfoForm};
1
+ import{__awaiter as e,__generator as t,__spreadArray as r}from'../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as o,action as i}from"mobx";import{Validator as a}from"../index.js";import{PhoneRule as n,RequiredRule as u}from"../rules/index.js";import{IkasCustomerEmailSubscriptionStatus as l}from"../../../data/customer/index.js";var m=function(){function m(e){var t=this;this.validatorRules=function(e){return void 0===e&&(e=!1),r([new u({model:t.customer,fieldKey:"firstName",valuePath:"firstName",message:t.message.requiredRule}),new u({model:t.customer,fieldKey:"lastName",valuePath:"lastName",message:t.message.requiredRule})],e?[new n({model:t.customer,fieldKey:"phone",valuePath:"phone",message:t.message.phoneRule})]:[],!0)},this.onFirstNameChange=function(e){t.customer.firstName=e},this.onLastNameChange=function(e){t.customer.lastName=e},this.onPhoneChange=function(e){t.customer.phone=e||null,e||t.validator.setRules(t.validatorRules())},s(this,{firstNameErrorMessage:o,lastNameErrorMessage:o,phoneErrorMessage:o,isMarketingAccepted:o,hasError:o,firstName:o,lastName:o,phone:o,validateAll:i,submit:i}),this.customer=e.customer,this.store=e.store,this.message=e.message,this.validator=new a(this.customer,this.validatorRules())}return Object.defineProperty(m.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"email",{get:function(){return this.customer.email},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"firstName",{get:function(){return this.customer.firstName},set:function(e){this.customer.firstName=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"lastName",{get:function(){return this.customer.lastName},set:function(e){this.customer.lastName=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"phone",{get:function(){return this.customer.phone||""},set:function(e){this.customer.phone=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isMarketingAccepted",{get:function(){return this.customer.isSubscribed},set:function(e){this.customer.subscriptionStatus=e?l.SUBSCRIBED:l.NOT_SUBSCRIBED},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"firstNameErrorMessage",{get:function(){var e,t;return null===(t=null===(e=this.validator.results)||void 0===e?void 0:e.firstName)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"lastNameErrorMessage",{get:function(){var e,t;return null===(t=null===(e=this.validator.results)||void 0===e?void 0:e.lastName)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"phoneErrorMessage",{get:function(){var e,t;return null===(t=null===(e=this.validator.results)||void 0===e?void 0:e.phone)||void 0===t?void 0:t.errorMessage},enumerable:!1,configurable:!0}),m.prototype.validateAll=function(){return this.validator.validateAll()},m.prototype.submit=function(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e={isFormError:!1,isSuccess:!1},this.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(t.sent())return e.isFormError=!0,[2,e];t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.store.customerStore.saveCustomer(this.customer)];case 3:return t.sent()&&(e.isSuccess=!0),[2,e];case 4:return t.sent(),[2,e];case 5:return[2]}}))}))},m}();export{m as AccountInfoForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "2.0.49",
3
+ "version": "2.0.51-alpha.1",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.js",
6
6
  "author": "Umut Ozan Yıldırım",