@gem-sdk/core 4.0.0-staging.1179 → 4.0.0-staging.1182

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 +1 @@
1
- "use strict";const pageview=(e,a)=>{window.gtag&&a&&window.gtag("config",a,{page_path:e}),window.ga&&window.ga("send","pageview",e)},addToCart=e=>{window.ga&&e&&(window.ga("ec:addProduct",{...e,id:e.sku,name:"Default Title"===e.variant?e.name:`${e.name} - ${e.variant}`,variant:"Default Title"===e.variant?e.name:e.variant}),window.ga("ec:setAction","add"),window.ga("send","event",{eventCategory:"EnhancedEcommerce",eventAction:"Added Product",nonInteraction:!0}))},productClick=e=>{window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,category:e.category,brand:e.brand,variant:e.variant}),ga("ec:setAction","click"),ga("send","event",{eventAction:"Click",eventCategory:"Product"}))},productDetail=e=>{e&&window.ga&&(ga("ec:addProduct",{brand:e.brand,category:e.category,id:e.id,name:e.name,variant:e.variant}),ga("ec:setAction","detail"),ga("send","event",{eventAction:"Detail",eventCategory:"Ecommerce",nonInteraction:1}))},removeFromCart=(e,a)=>{e&&window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,price:a}),ga("ec:setAction","remove"),ga("send","event",{eventAction:"Click",eventCategory:"Remove from cart"}))};exports.addToCart=addToCart,exports.pageview=pageview,exports.productClick=productClick,exports.productDetail=productDetail,exports.removeFromCart=removeFromCart;
1
+ "use strict";const pageview=(e,a)=>{window.gtag&&a&&window.gtag("config",a,{page_path:e}),window.ga&&window.ga("send","pageview",e)},addToCart=e=>{window.ga&&e&&(window.ga("ec:addProduct",{...e,id:e.sku,name:"Default Title"===e.variant?e.name:`${e.name} - ${e.variant}`,variant:"Default Title"===e.variant?e.name:e.variant}),window.ga("ec:setAction","add"),window.ga("send","event",{eventCategory:"EnhancedEcommerce",eventAction:"Added Product",nonInteraction:!0}))},productClick=e=>{window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,category:e.category,brand:e.brand,variant:e.variant}),ga("ec:setAction","click"),ga("send","event",{eventAction:"Click",eventCategory:"Product"}))},productDetail=e=>{e&&window.ga&&(ga("ec:addProduct",{brand:e.brand,category:e.category,id:e.id,name:e.name,variant:e.variant}),ga("ec:setAction","detail"),ga("send","event",{eventAction:"Detail",eventCategory:"Ecommerce",nonInteraction:1}))},removeFromCart=(e,a)=>{e&&window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,price:a}),ga("ec:setAction","remove"),ga("send","event",{eventAction:"Click",eventCategory:"Remove from cart"}))},sharePageView=(e,a,t)=>{window.gtag&&a&&window.gtag("event","share_page_view",{page_path:e,...t})};exports.addToCart=addToCart,exports.pageview=pageview,exports.productClick=productClick,exports.productDetail=productDetail,exports.removeFromCart=removeFromCart,exports.sharePageView=sharePageView;
@@ -1 +1 @@
1
- "use strict";var verifyExternalLink=require("../helpers/verify-external-link.js");const DOM_QUERY_DELAY_MS=100,usePreviewSharePage=()=>{let e=()=>{setTimeout(()=>{let e=document.querySelectorAll("a[href]");e.forEach(e=>{let r=e.getAttribute("href")??"";verifyExternalLink.isExternalLink(r)&&e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})})},100)};return{disableExternalLinks:e}};exports.usePreviewSharePage=usePreviewSharePage;
1
+ "use strict";var verifyExternalLink=require("../helpers/verify-external-link.js");const DOM_QUERY_DELAY_MS=500,usePreviewSharePage=()=>{let e=()=>{setTimeout(()=>{let e=document.querySelectorAll("a[href]");e.forEach(e=>{e.addEventListener("click",r=>{let t=e.getAttribute("href")??"",a="_blank"===e.getAttribute("target");(verifyExternalLink.isExternalLink(t)||a)&&(r.preventDefault(),r.stopPropagation())})})},500)};return{disableExternalLinks:e}};exports.usePreviewSharePage=usePreviewSharePage;
@@ -1 +1 @@
1
- let pageview=(e,a)=>{window.gtag&&a&&window.gtag("config",a,{page_path:e}),window.ga&&window.ga("send","pageview",e)},addToCart=e=>{window.ga&&e&&(window.ga("ec:addProduct",{...e,id:e.sku,name:"Default Title"===e.variant?e.name:`${e.name} - ${e.variant}`,variant:"Default Title"===e.variant?e.name:e.variant}),window.ga("ec:setAction","add"),window.ga("send","event",{eventCategory:"EnhancedEcommerce",eventAction:"Added Product",nonInteraction:!0}))},productClick=e=>{window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,category:e.category,brand:e.brand,variant:e.variant}),ga("ec:setAction","click"),ga("send","event",{eventAction:"Click",eventCategory:"Product"}))},productDetail=e=>{e&&window.ga&&(ga("ec:addProduct",{brand:e.brand,category:e.category,id:e.id,name:e.name,variant:e.variant}),ga("ec:setAction","detail"),ga("send","event",{eventAction:"Detail",eventCategory:"Ecommerce",nonInteraction:1}))},removeFromCart=(e,a)=>{e&&window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,price:a}),ga("ec:setAction","remove"),ga("send","event",{eventAction:"Click",eventCategory:"Remove from cart"}))};export{addToCart,pageview,productClick,productDetail,removeFromCart};
1
+ let pageview=(e,a)=>{window.gtag&&a&&window.gtag("config",a,{page_path:e}),window.ga&&window.ga("send","pageview",e)},addToCart=e=>{window.ga&&e&&(window.ga("ec:addProduct",{...e,id:e.sku,name:"Default Title"===e.variant?e.name:`${e.name} - ${e.variant}`,variant:"Default Title"===e.variant?e.name:e.variant}),window.ga("ec:setAction","add"),window.ga("send","event",{eventCategory:"EnhancedEcommerce",eventAction:"Added Product",nonInteraction:!0}))},productClick=e=>{window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,category:e.category,brand:e.brand,variant:e.variant}),ga("ec:setAction","click"),ga("send","event",{eventAction:"Click",eventCategory:"Product"}))},productDetail=e=>{e&&window.ga&&(ga("ec:addProduct",{brand:e.brand,category:e.category,id:e.id,name:e.name,variant:e.variant}),ga("ec:setAction","detail"),ga("send","event",{eventAction:"Detail",eventCategory:"Ecommerce",nonInteraction:1}))},removeFromCart=(e,a)=>{e&&window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,price:a}),ga("ec:setAction","remove"),ga("send","event",{eventAction:"Click",eventCategory:"Remove from cart"}))},sharePageView=(e,a,t)=>{window.gtag&&a&&window.gtag("event","share_page_view",{page_path:e,...t})};export{addToCart,pageview,productClick,productDetail,removeFromCart,sharePageView};
@@ -1 +1 @@
1
- import{isExternalLink as e}from"../helpers/verify-external-link.js";let DOM_QUERY_DELAY_MS=100,usePreviewSharePage=()=>{let t=()=>{setTimeout(()=>{let t=document.querySelectorAll("a[href]");t.forEach(t=>{let r=t.getAttribute("href")??"";e(r)&&t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()})})},100)};return{disableExternalLinks:t}};export{usePreviewSharePage};
1
+ import{isExternalLink as e}from"../helpers/verify-external-link.js";let DOM_QUERY_DELAY_MS=500,usePreviewSharePage=()=>{let t=()=>{setTimeout(()=>{let t=document.querySelectorAll("a[href]");t.forEach(t=>{t.addEventListener("click",r=>{let a=t.getAttribute("href")??"",l="_blank"===t.getAttribute("target");(e(a)||l)&&(r.preventDefault(),r.stopPropagation())})})},500)};return{disableExternalLinks:t}};export{usePreviewSharePage};
@@ -35515,11 +35515,16 @@ declare const productDetail: (product: ProductInputAnalytic) => void;
35515
35515
  * https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#add-remove-cart
35516
35516
  */
35517
35517
  declare const removeFromCart: (product: ProductInputAnalytic, price: number) => void;
35518
+ declare const sharePageView: (url: string, trackingId?: string | null, params?: {
35519
+ page_id?: string;
35520
+ source_shop_id?: string;
35521
+ }) => void;
35518
35522
 
35519
35523
  declare const gtag_pageview: typeof pageview;
35520
35524
  declare const gtag_productClick: typeof productClick;
35521
35525
  declare const gtag_productDetail: typeof productDetail;
35522
35526
  declare const gtag_removeFromCart: typeof removeFromCart;
35527
+ declare const gtag_sharePageView: typeof sharePageView;
35523
35528
  declare namespace gtag {
35524
35529
  export {
35525
35530
  addToCart$1 as addToCart,
@@ -35527,6 +35532,7 @@ declare namespace gtag {
35527
35532
  gtag_productClick as productClick,
35528
35533
  gtag_productDetail as productDetail,
35529
35534
  gtag_removeFromCart as removeFromCart,
35535
+ gtag_sharePageView as sharePageView,
35530
35536
  };
35531
35537
  }
35532
35538
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "4.0.0-staging.1179",
3
+ "version": "4.0.0-staging.1182",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",