@ikas/storefront 2.0.42 → 2.0.43
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/build/_virtual/index.js_commonjs-proxy2.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy3.js +1 -1
- package/build/_virtual/index.js_commonjs-proxy4.js +1 -1
- package/build/analytics/analytics.d.ts +3 -2
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/events.d.ts +2 -1
- package/build/analytics/events.js +1 -1
- package/build/ikas.js +2 -2
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/store/customer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'../ext/
|
|
1
|
+
import e from'../ext/strict-uri-encode/index.js';export{default}from"../node_modules/strict-uri-encode/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from'../ext/split-on-first/index.js';export{default}from"../node_modules/split-on-first/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from'../ext/decode-uri-component/index.js';export{default}from"../node_modules/decode-uri-component/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IkasProductDetail, IkasOrderLineItem, IkasCheckout, IkasCategory, IkasThemePageType, IkasOrderTransaction, IkasBrand } from "../models";
|
|
1
|
+
import { IkasProductDetail, IkasOrderLineItem, IkasCheckout, IkasCategory, IkasThemePageType, IkasOrderTransaction, IkasBrand, IkasCustomer } from "../models";
|
|
2
2
|
import { CheckoutStep } from "../components/checkout/model";
|
|
3
3
|
import { IkasCart } from "../models/data/cart";
|
|
4
4
|
import { IkasEventSubscriber } from "./events";
|
|
@@ -24,7 +24,8 @@ export declare class Analytics {
|
|
|
24
24
|
static disableHTML(): void;
|
|
25
25
|
static addToWishlist(productId: string): void;
|
|
26
26
|
static search(searchKeyword: string): void;
|
|
27
|
-
static completeRegistration(
|
|
27
|
+
static completeRegistration(customer: IkasCustomer): void;
|
|
28
|
+
static createEmailSubscripition(email: string): void;
|
|
28
29
|
static customerLogin(): Promise<void>;
|
|
29
30
|
static customerLogout(): Promise<void>;
|
|
30
31
|
static customerVisit(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as e,__generator as t,__assign as r}from'../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import"../models/data/blog/index.js";import{IkasBrand as i}from"../models/data/brand/index.js";import{IkasCategory as s}from"../models/data/category/index.js";import{IkasCheckout as a}from"../models/data/checkout/index.js";import"../models/data/customer/address/index.js";import"../models/data/customer/index.js";import"../models/data/customer-review/index.js";import"../models/data/html-meta-data/index.js";import"../models/data/image/index.js";import"../models/data/installment-info/index.js";import"../models/data/order/index.js";import"../models/data/order/line-item/index.js";import"../api/product-option-file/index.js";import"../models/data/product/index.js";import"../models/data/variant-type/index.js";import"../models/data/product/variant/index.js";import"../models/data/product/variant/price/index.js";import"../models/data/product-attribute/index.js";import"../models/data/product/attribute-value/index.js";import"../models/data/product-filter/index.js";import"../models/data/variant-type/variant-value/index.js";import"../models/data/order-transaction/index.js";import"../models/data/product-option-set/index.js";import"../models/data/raffle/index.js";import"../models/data/product-campaing/campaign/index.js";import"../models/data/customer-attribute/index.js";import"../models/data/customer-attribute/customer-attribute-sales-channel/index.js";import"../models/theme/theme.js";import"../models/theme/page/index.js";import"../models/theme/component/prop/index.js";import"../models/theme/page/component/prop-value/link.js";import"../models/ui/brand-list/index.js";import"../models/ui/blog-list/index.js";import"../models/ui/blog-category-list/index.js";import"../models/ui/category-list/index.js";import{IkasProductDetail as c}from"../models/ui/product-detail/index.js";import"../models/ui/product-list/index.js";import"../models/ui/product-attribute-detail/index.js";import"../models/ui/product-attribute-list/index.js";import"../models/ui/customer-review-list/index.js";import"../models/ui/customer-review-summary-list/index.js";import"../models/ui/validator/index.js";import"../models/ui/validator/rules/index.js";import"../models/ui/validator/form/login.js";import"../models/ui/validator/form/address.js";import"../models/ui/validator/form/register.js";import"../models/ui/validator/form/contact-form.js";import"../models/ui/validator/form/forgot-password.js";import"../models/ui/validator/form/recover-password.js";import"../models/ui/validator/form/account-info.js";import"../models/ui/validator/form/raffle-form.js";import"../models/ui/validator/form/customer-review.js";import"../models/ui/raffle-list/index.js";import"../models/theme/settings/index.js";import"../models/theme/custom-data/index.js";import{FacebookPixel as n}from"./facebookPixel.js";import{GoogleTagManager as u}from"./googleTagManager.js";import{IkasCart as d}from"../models/data/cart/index.js";import{IkasEventType as m}from"./events.js";import{IkasStorefrontConfig as l}from"../storefront/index.js";import p from'../ext/lodash/cloneDeep.js';import{tryForEach as b}from"../utils/helper.js";import"../utils/i18n.js";import f from"./ikas.js";import{GoogleAnalytics as h}from"./googleAnalytics.js";import{GoogleUniversal as g}from"./googleUniversal.js";var v=function(){function v(){o(this)}return v.getCustomerInfo=function(){return e(this,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return[4,(e=l.store).customerStore.waitUntilInitialized()];case 1:return t.sent(),(o=e.customerStore.customer)?[2,r(r({},o.basicInfo),{consentGranted:e.customerStore.customerConsentGranted})]:[2,null]}}))}))},v.pageView=function(r){return e(this,void 0,void 0,(function(){var e,o,i;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=window.location.href,[4,v.getCustomerInfo()];case 1:return o=t.sent(),u.pageView(e),f.pageView(r),b(v.subscribers,(function(t){t.callback({type:m.PAGE_VIEW,data:{url:e,pageType:r,customer:o}})})),[3,3];case 2:return i=t.sent(),console.error(i),[3,3];case 3:return[2]}}))}))},v.productView=function(e){try{if(n.productView(e),u.productView(e),f.productView(e),h.productView(e),g.productView(e),v.subscribers.length){var t=p(e),r=new c(t.product,t.selectedVariantValues);b(v.subscribers,(function(e){e.callback({type:m.PRODUCT_VIEW,data:{productDetail:r}})}))}}catch(e){console.error(e)}},v.addToCart=function(e,t,r,o){try{if(n.addToCart(e,t,r),u.addToCart(e,t),f.addToCart(e,t,o),h.addToCart(e,t),g.addToCart(e,t),v.subscribers.length){var i=p(e),s=new d(p(o));b(v.subscribers,(function(e){e.callback({type:m.ADD_TO_CART,data:{item:i,quantity:t,cart:s}})}))}}catch(e){console.error(e)}},v.removeFromCart=function(e,t,r){try{if(u.removeFromCart(e,t),h.removeFromCart(e,t),g.removeFromCart(e,t),v.subscribers.length){var o=p(e),i=new d(p(r));b(v.subscribers,(function(e){e.callback({type:m.REMOVE_FROM_CART,data:{item:o,quantity:t,cart:i}})}))}}catch(e){console.error(e)}},v.beginCheckout=function(e){try{var t=localStorage.getItem("gtmBeginCheckout");if(t&&e.id===t)return;if(localStorage.setItem("gtmBeginCheckout",e.id),n.beginCheckout(e),u.beginCheckout(e),f.beginCheckout(e),h.beginCheckout(e),v.subscribers.length){var r=new a(p(e));b(v.subscribers,(function(e){e.callback({type:m.BEGIN_CHECKOUT,data:{checkout:r}})}))}}catch(e){console.error(e)}},v.purchase=function(e,t){try{if(localStorage.removeItem("gtmBeginCheckout"),n.purchase(e,e.orderNumber||""),u.purchase(e,e.orderNumber||""),f.orderSuccess(e),h.purchase(e,e.orderNumber||""),g.purchase(e,e.orderNumber||""),v.subscribers.length){var r=new a(p(e)),o=p(t);b(v.subscribers,(function(e){e.callback({type:m.COMPLETE_CHECKOUT,data:{checkout:r,transaction:o}})}))}}catch(e){console.error(e)}},v.checkoutStep=function(e,t){try{if(u.checkoutStep(e,t),f.checkoutStep(e,t),h.checkoutStep(e,t),v.subscribers.length){var r=new a(p(e));b(v.subscribers,(function(e){e.callback({type:m.CHECKOUT_STEP,data:{checkout:r,step:t}})}))}}catch(e){console.error(e)}},v.disableHTML=function(){try{u.disableHTML()}catch(e){console.error(e)}},v.addToWishlist=function(e){try{n.addToWishlist(e),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.ADD_TO_WISHLIST,data:{productId:e}})}))}catch(e){console.error(e)}},v.search=function(e){try{n.search(e),u.search(e),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.SEARCH,data:{searchKeyword:e}})}))}catch(e){console.error(e)}},v.completeRegistration=function(e){try{n.completeRegistration(),u.completeRegistration(),f.customerRegister(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_REGISTER,data:{email:e.email,firstName:e.firstName,lastName:e.lastName}})}))}catch(e){console.error(e)}},v.createEmailSubscripition=function(e){try{v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.EMAIL_SUBSCRIPTION,data:{email:e}})}))}catch(e){console.error(e)}},v.customerLogin=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v.getCustomerInfo()];case 1:return(e=t.sent())&&e.email?(u.customerLogin(e.email),f.customerLogin(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_LOGIN,data:{customer:e}})})),[3,3]):[2];case 2:return r=t.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.customerLogout=function(){return e(this,void 0,void 0,(function(){return t(this,(function(e){try{v.subscribers.length&&b(v.subscribers,(function(e){e.callback({type:m.CUSTOMER_LOGOUT,data:{}})}))}catch(e){console.error(e)}return[2]}))}))},v.customerVisit=function(){return e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,v.getCustomerInfo()];case 1:return(e=t.sent())&&e.email?(u.customerVisit(e.email),f.customerVisit(),v.subscribers.length&&b(v.subscribers,(function(t){t.callback({type:m.CUSTOMER_VISIT,data:{customer:e}})})),[3,3]):[2];case 2:return r=t.sent(),console.error(r),[3,3];case 3:return[2]}}))}))},v.viewCart=function(e){try{if(e&&(n.viewCart(e),f.viewCart(e),h.viewCart(e),v.subscribers.length)){var t=new d(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_CART,data:{cart:t}})}))}}catch(e){console.error(e)}},v.viewCategory=function(e,t){try{if(n.viewCategory(e),u.viewCategory(t,e),f.viewCategory(t),v.subscribers.length){var r=new s(p(t));b(v.subscribers,(function(t){t.callback({type:m.VIEW_CATEGORY,data:{categoryPath:e,category:r}})}))}}catch(e){console.error(e)}},v.viewBrand=function(e){try{if(f.viewBrand(e),v.subscribers.length){var t=new i(p(e));b(v.subscribers,(function(e){e.callback({type:m.VIEW_BRAND,data:{brand:t}})}))}}catch(e){console.error(e)}},v.viewSearchResults=function(e,t){try{if(v.subscribers.length){var r=p(t).map((function(e){return new c(e.product,e.selectedVariantValues)}));b(v.subscribers,(function(t){t.callback({type:m.VIEW_SEARCH_RESULTS,data:{searchKeyword:e,productDetails:r}})}))}}catch(e){console.error(e)}},v.viewListing=function(e){try{if(v.subscribers.length){var t=p(e).map((function(e){return new c(e.product,e.selectedVariantValues)}));b(v.subscribers,(function(e){e.callback({type:m.VIEW_LISTING,data:{productDetails:t}})}))}}catch(e){console.error(e)}},v.contactForm=function(e){try{if(n.contactForm(),v.subscribers.length){var t=p(e);b(v.subscribers,(function(e){e.callback({type:m.CONTACT_FORM,data:{form:t}})}))}}catch(e){console.error(e)}},v.subscribers=[],v}();export{v as Analytics};
|
|
@@ -24,7 +24,8 @@ export declare enum IkasEventType {
|
|
|
24
24
|
VIEW_BRAND = "VIEW_BRAND",
|
|
25
25
|
VIEW_SEARCH_RESULTS = "VIEW_SEARCH_RESULTS",
|
|
26
26
|
VIEW_LISTING = "VIEW_LISTING",
|
|
27
|
-
CONTACT_FORM = "CONTACT_FORM"
|
|
27
|
+
CONTACT_FORM = "CONTACT_FORM",
|
|
28
|
+
EMAIL_SUBSCRIPTION = "EMAIL_SUBSCRIPTION"
|
|
28
29
|
}
|
|
29
30
|
export declare type IkasEventSubscriber = {
|
|
30
31
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Analytics as s}from"./analytics.js";function
|
|
1
|
+
import{Analytics as s}from"./analytics.js";function E(E){var r=function(E){if(T(E)){var r=s.subscribers.findIndex((function(s){return s.id===E.id}));-1!==r?s.subscribers[r]=E:s.subscribers.push(E)}};return E.forEach(r),{subscribe:r,unsubscribe:function(E){var r=s.subscribers.findIndex((function(s){return s.id===E}));-1!==r&&s.subscribers.splice(r,1)}}}function r(){if("undefined"!=typeof window){var s=[];try{var r=window.IkasEvents;r&&r.subscribers&&r.subscribers.length&&(s=r.subscribers)}catch(s){}window.IkasEvents=E(s)}}function n(){return"<script>\n var subscribers = [];\n var subscribe = (subscriber) => { subscribers.push(subscriber); }; \n var unsubscribe = () => {};\n \n window.IkasEvents = {\n subscribers,\n subscribe,\n unsubscribe\n };\n <\/script>"}function T(s){return!!(s&&s.id&&"string"==typeof s.id&&s.callback&&"function"==typeof s.callback)}var i;!function(s){s.PAGE_VIEW="PAGE_VIEW",s.PRODUCT_VIEW="PRODUCT_VIEW",s.ADD_TO_CART="ADD_TO_CART",s.REMOVE_FROM_CART="REMOVE_FROM_CART",s.BEGIN_CHECKOUT="BEGIN_CHECKOUT",s.CHECKOUT_STEP="CHECKOUT_STEP",s.COMPLETE_CHECKOUT="COMPLETE_CHECKOUT",s.ADD_TO_WISHLIST="ADD_TO_WISHLIST",s.SEARCH="SEARCH",s.CUSTOMER_REGISTER="CUSTOMER_REGISTER",s.CUSTOMER_LOGIN="CUSTOMER_LOGIN",s.CUSTOMER_LOGOUT="CUSTOMER_LOGOUT",s.CUSTOMER_VISIT="CUSTOMER_VISIT",s.VIEW_CART="VIEW_CART",s.VIEW_CATEGORY="VIEW_CATEGORY",s.VIEW_BRAND="VIEW_BRAND",s.VIEW_SEARCH_RESULTS="VIEW_SEARCH_RESULTS",s.VIEW_LISTING="VIEW_LISTING",s.CONTACT_FORM="CONTACT_FORM",s.EMAIL_SUBSCRIPTION="EMAIL_SUBSCRIPTION"}(i||(i={}));export{i as IkasEventType,E as IkasEvents,n as getIkasEventsScript,r as initIkasEvents,T as isValidIkasEventSubscriber};
|