@ikas/storefront 4.9.0-beta.5 → 4.9.0-beta.6
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.
|
@@ -2,6 +2,7 @@ import { IkasCheckout, IkasProduct, IkasOrderLineItem } from "../models";
|
|
|
2
2
|
import { IkasCart } from "../models/data/cart";
|
|
3
3
|
export declare class FacebookPixel {
|
|
4
4
|
constructor();
|
|
5
|
+
private static get fbpId();
|
|
5
6
|
static productView(productDetail: IkasProduct): void;
|
|
6
7
|
static addToCart(item: IkasOrderLineItem, quantity: number, eventId: string): void;
|
|
7
8
|
static beginCheckout(checkout: IkasCheckout): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as t}from"mobx";var
|
|
1
|
+
import{makeAutoObservable as t}from"mobx";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";var e="undefined"==typeof window,r=function(){function r(){t(this)}return Object.defineProperty(r,"fbpId",{get:function(){return n.getFbpId()},enumerable:!1,configurable:!0}),r.productView=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ViewContent",(n=t,{content_name:n.name,content_category:n.categories.length>0?n.categories[0].path.map((function(t){return t.name})).join(" > "):"",content_ids:[n.selectedVariant.id],content_type:"product",value:n.selectedVariant.price.finalPrice,currency:""===n.selectedVariant.price.currency?"TRY":n.selectedVariant.price.currency})))}catch(t){console.error(t)}var n},r.addToCart=function(t,n,r){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","AddToCart",function(t,n){var e,r=[];t.variant.categories&&(null===(e=t.variant.categories[0].categoryPath)||void 0===e||e.map((function(t){return r.push(t.name)}))),t.variant.categories&&t.variant.categories.length>0&&r.push(t.variant.categories[0].name);var o=r.length>0?r.join(" > "):"";return{content_name:t.variant.name,content_category:o,content_ids:[t.variant.id],content_type:"product",value:t.finalPrice,currency:t.currencyCode}}(t),{eventID:r}))}catch(t){console.error(t)}},r.beginCheckout=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","InitiateCheckout",o(t)))}catch(t){console.error(t)}},r.purchase=function(t,n){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","Purchase",o(t),{eventID:n}))}catch(t){console.error(t)}},r.addToWishlist=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","AddToWishlist",{content_ids:[t]}))}catch(t){console.error(t)}},r.search=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","Search",{search_string:t}))}catch(t){console.error(t)}},r.completeRegistration=function(){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","CompleteRegistration",{status:!0,value:0,currency:"TRY"}))}catch(t){console.error(t)}},r.viewCart=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ViewCart",function(t){var n=[],e=[];return t.items.map((function(t){n.push(t.variant.id||""),e.push({id:t.variant.id,quantity:t.quantity})})),{contents:e,content_type:"product_group",content_ids:n,currency:t.items[0].currencyCode,value:t.totalPrice,num_items:t.items.length}}(t)))}catch(t){console.error(t)}},r.viewCategory=function(t){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ViewCategory",{content_name:t}))}catch(t){console.error(t)}},r.contactForm=function(){try{return void(!e&&this.fbpId&&window.fbq&&window.fbq("track","ContactForm",{}))}catch(t){console.error(t)}},r}();function o(t){var n=[],e=[];return t.items.map((function(t){n.push(t.variant.id||""),e.push({id:t.variant.id,quantity:t.quantity})})),{contents:e,content_category:"",content_type:"product",content_ids:n,currency:t.items[0].currencyCode,value:t.totalFinalPrice,num_items:t.items.length}}export{r as FacebookPixel};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IkasCheckout, IkasProduct, IkasOrderLineItem, IkasCategory } from "../models";
|
|
2
2
|
export declare class TiktokPixel {
|
|
3
3
|
constructor();
|
|
4
|
+
private static get tiktokPixelId();
|
|
4
5
|
static productView(productDetail: IkasProduct): void;
|
|
5
6
|
static addToCart(item: IkasOrderLineItem, quantity: number): void;
|
|
6
7
|
static beginCheckout(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as t}from"mobx";import{IkasBaseStore as
|
|
1
|
+
import{makeAutoObservable as t}from"mobx";import{IkasBaseStore as e}from"../store/base.js";import"../store/customer/index.js";import"../store/cart/index.js";import{IkasStorefrontConfig as n}from"@ikas/storefront-config";var o="undefined"==typeof window,r=function(){function e(){t(this)}return Object.defineProperty(e,"tiktokPixelId",{get:function(){return n.getTiktokPixelId()},enumerable:!1,configurable:!0}),e.productView=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("ViewContent",function(t,e){void 0===e&&(e=1);return{content_type:"product",quantity:e,content_id:t.selectedVariant.id,value:t.selectedVariant.price.finalPrice,currency:""===t.selectedVariant.price.currency?"TRY":t.selectedVariant.price.currency}}(t)))}catch(t){console.error(t)}},e.addToCart=function(t,e){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("AddToCart",function(t,e){void 0===e&&(e=1);return{content_id:t.variant.id,content_type:"product",content_name:t.variant.name,quantity:e,value:t.finalPrice,currency:t.currencyCode}}(t,e)))}catch(t){console.error(t)}},e.beginCheckout=function(){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("InitiateCheckout"))}catch(t){console.error(t)}},e.purchase=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("CompletePayment",function(t){var e=[];return null==t||t.items.map((function(t){e.push({content_id:t.variant.id,content_type:"product",content_name:t.variant.name,price:t.finalPrice,quantity:t.quantity})})),{contents:e,content_type:"product_group",currency:t.items[0].currencyCode,value:t.totalPrice}}(t)))}catch(t){console.error(t)}},e.addToWishlist=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("AddToWishlist",{content_id:t}))}catch(t){console.error(t)}},e.search=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("Search",{query:t,content_id:"Search"}))}catch(t){console.error(t)}},e.completeRegistration=function(){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("CompleteRegistration"))}catch(t){console.error(t)}},e.viewCategory=function(t){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("ViewContent",{content_id:t.id,content_type:"product_group",content_category:t.name}))}catch(t){console.error(t)}},e.contactForm=function(){try{return i(),void(!o&&this.tiktokPixelId&&window.ttq&&window.ttq.track("Contact"))}catch(t){console.error(t)}},e}();function i(){try{var t=e.getInstance().customerStore.customer;if(!t)return;return void(!o&&n.getTiktokPixelId()&&window.ttq&&window.ttq.identify({external_id:t.id,email:t.email,phone_number:t.phone||""}))}catch(t){console.error(t)}}export{r as TiktokPixel};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.9.0-beta.
|
|
3
|
+
"version": "4.9.0-beta.6",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.9.0-beta.
|
|
21
|
-
"@ikas/storefront-config": "^4.9.0-beta.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.9.0-beta.
|
|
23
|
-
"@ikas/storefront-models": "^4.9.0-beta.
|
|
24
|
-
"@ikas/storefront-providers": "^4.9.0-beta.
|
|
20
|
+
"@ikas/storefront-api": "^4.9.0-beta.6",
|
|
21
|
+
"@ikas/storefront-config": "^4.9.0-beta.6",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.9.0-beta.6",
|
|
23
|
+
"@ikas/storefront-models": "^4.9.0-beta.6",
|
|
24
|
+
"@ikas/storefront-providers": "^4.9.0-beta.6",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
58
|
-
"@ikas/storefront-api": "^4.9.0-beta.
|
|
59
|
-
"@ikas/storefront-config": "^4.9.0-beta.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.9.0-beta.
|
|
61
|
-
"@ikas/storefront-models": "^4.9.0-beta.
|
|
62
|
-
"@ikas/storefront-providers": "^4.9.0-beta.
|
|
58
|
+
"@ikas/storefront-api": "^4.9.0-beta.6",
|
|
59
|
+
"@ikas/storefront-config": "^4.9.0-beta.6",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.9.0-beta.6",
|
|
61
|
+
"@ikas/storefront-models": "^4.9.0-beta.6",
|
|
62
|
+
"@ikas/storefront-providers": "^4.9.0-beta.6",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|