@ikas/storefront 4.13.8 → 4.13.9
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/components/page/head.js +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../../ext/tslib/tslib.es6.js';import*as e from"react";import{observer as o}from"mobx-react-lite";import i from"next/head.js";import{useRouter as a}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/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/ikas-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{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as d}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var l=o((function(o){var d,l,p,u=o.pageType,g=o.pageTitle,v=o.pageDescription,f=o.canonicals,h=o.disableIndex,j=o.pageSpecificData,x=o.merchantSettings,y=o.addOgpMetas,b=o.productReviewSummary,C=a(),k="undefined"!=typeof window,D="local"===process.env.NEXT_PUBLIC_ENV,T=C.asPath.split("?")[0].replace("/",""),E=(T="/"===T.charAt(T.length-1)?T.slice(0,-1):T).startsWith("pages/"),w=s.getCurrentRouting(),L=(null==w?void 0:w.path)?"/"+w.path:"",P=D?"http://localhost:3333":"https://"+s.getDomain(),R=null===(d=s.getIndexPageSeoSettings())||void 0===d?void 0:d.find((function(t){return t.locale===s.getCurrentLocale()})),_=R?new n(R):null;e.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[u,j]);var S=e.useMemo((function(){if(j&&j.href)return"".concat(P).concat(j.href)}),[j]),O=e.useMemo((function(){var t,e,o=[];if(y){if(o.push({property:"og:type",content:"website"}),o.push({property:"og:site_name",content:"https://"+s.getDomain()}),g&&o.push({property:"og:title",content:g}),v&&o.push({property:"og:description",content:v}),u===r.INDEX){var i=null,a=null;!g&&(null==_?void 0:_.pageTitle)&&(i=_.pageTitle),!v&&(null==_?void 0:_.description)&&(a=_.description);var n=null===(t=s.getMetaTemplates())||void 0===t?void 0:t.find((function(t){return t.locale===s.getCurrentLocale()&&t.pageType===u}));n&&(i=m(j,u,n.titleTemplate||""),a=m(j,u,n.descriptionTemplate||"")),i&&o.push({property:"og:title",content:i}),a&&o.push({property:"og:description",content:a})}if(o.push({property:"og:url",content:S||(k?window.location.href:"")||"https://".concat(s.getDomain())}),j&&u===r.PRODUCT){var d=j.selectedVariant.mainImage;(null==d?void 0:d.image)&&o.push({property:"og:image",content:d.image.src})}else(null==_?void 0:_.icon)?o.push({property:"og:image",content:null===(e=null==_?void 0:_.icon)||void 0===e?void 0:e.src}):(null==x?void 0:x.logo)&&o.push({property:"og:image",content:x.logo.src});if(j&&u===r.CATEGORY){var l=j;l.image&&o.push({property:"og:image",content:l.image.src})}if(j&&u===r.BRAND){var c=j;c.image&&o.push({property:"og:image",content:c.image.src})}}return o}),[g,j,S,v,x,y,x]),I=e.useMemo((function(){var e=[];if(x){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},i=function(e){var o,i,a,r,n,d,l=(null==e?void 0:e.logo)?e.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==e?void 0:e.merchantName,logo:l,image:l,url:"https://"+s.getDomain(),telephone:null==e?void 0:e.phone,address:t(t({"@type":"PostalAddress",streetAddress:null===(o=e.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(a=null===(i=e.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},e.address&&e.address.state&&{addressRegion:e.address.state.code}),{postalCode:null===(r=e.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(d=null===(n=e.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(x);e.push(o),e.push(i)}if(j&&u===r.PRODUCT){var a=j,n=function(e,o){var i,a,r,n,d;try{var l=s.getCurrentRouting(),c=null==l?void 0:l.path,m=function(t){return c?"https://".concat(s.getDomain(),"/").concat(c).concat(t):"https://".concat(s.getDomain()).concat(t)},p=e.selectedVariant;return t(t({"@context":"https://schema.org/","@type":"Product",name:e.name,description:null===(i=e.metaData)||void 0===i?void 0:i.description,image:null===(a=p.images)||void 0===a?void 0:a.map((function(t){return t.image?t.image.src:""})),productId:p.id,sku:p.sku,mpn:(null===(r=p.barcodeList)||void 0===r?void 0:r.length)?p.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=e.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:m(e.href),priceCurrency:p.price.currency||"TRY",price:(null!==(d=p.campaignPrice)&&void 0!==d?d:p.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:p.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(t){}}(a,b||null);if(n&&e.push(n),a.categories.length)(l=c(a.categories[0],a))&&e.push(l)}if(j&&u===r.CATEGORY){var d=function(t){var e,o;try{var i=s.getCurrentRouting(),a=null==i?void 0:i.path,r=function(t){return a?"https://".concat(s.getDomain(),"/").concat(a).concat(t):"https://".concat(s.getDomain()).concat(t)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(t.href),name:null===(e=t.metaData)||void 0===e?void 0:e.pageTitle,description:null===(o=t.metaData)||void 0===o?void 0:o.description,image:t.image?t.image.src:void 0}}catch(t){}}(j),l=c(j);d&&e.push(d),l&&e.push(l)}if(j&&u===r.BLOG){var m=function(e){var o;try{var i="https://".concat(s.getDomain()).concat(e.href),a=function(t){var e=new Date(t),o=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".concat(e.writer.firstName," ").concat(e.writer.lastName),n=(new DOMParser).parseFromString(e.blogContent.content,"text/html").body.textContent;return t(t({"@context":"https://schema.org","@type":"BlogPosting",headline:e.title,image:null===(o=e.image)||void 0===o?void 0:o.src},e.category&&{genre:e.category.name}),{url:i,datePublished:a(e.createdAt),dateCreated:a(e.createdAt),dateModified:a(e.updatedAt),description:e.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(t){}}(j);m&&e.push(m)}return e}),[j,x]),A=e.useMemo((function(){var t,e=null===(t=s.getMetaTemplates())||void 0===t?void 0:t.find((function(t){return t.locale===s.getCurrentLocale()&&t.pageType===u}));return e?m(j,u,e.titleTemplate||""):null}),[u,j]),M=e.useMemo((function(){var t,e=null===(t=s.getMetaTemplates())||void 0===t?void 0:t.find((function(t){return t.locale===s.getCurrentLocale()&&t.pageType===u}));return e?m(j,u,e.descriptionTemplate||""):null}),[u,j]),N=e.useMemo((function(){var t,e=null===(t=s.getFavicon())||void 0===t?void 0:t.id;return(null==_?void 0:_.favIcon)&&(e=_.favIcon),e||null}),[]),B=e.useCallback((function(){var t=s.getCustom();return!!t&&!!t.isEPayKolayEnabled}),[]),U=[];s.getRoutings().forEach((function(t){var e;(null===(e=t.countryCodes)||void 0===e?void 0:e.length)?t.countryCodes.forEach((function(e){U.push({routing:t,hrefLang:t.locale+"-"+e})})):U.push({routing:t,hrefLang:t.locale})}));var V=function(t){var e,o,i,a,r,n=j,s=null===(o=null===(e=null==n?void 0:n.metaData)||void 0===e?void 0:e.translations)||void 0===o?void 0:o.find((function(e){return e.locale===t.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=U.find((function(t){return!t.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(t){return t.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""};return e.createElement(i,null,e.createElement("title",null,g||A||(null==_?void 0:_.pageTitle)||""),e.createElement("meta",{name:"description",content:v||M||(null==_?void 0:_.description)||""}),u===r.CHECKOUT&&B()&&e.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(l=s.getApiUrl())||void 0===l?void 0:l.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(p=s.getApiUrl())||void 0===p?void 0:p.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),U.length>1&&U.filter((function(t){return!E||t.routing.id===(null==w?void 0:w.id)})).map((function(t){return e.createElement("link",{key:t.routing.id+t.hrefLang,rel:"alternate",hrefLang:t.hrefLang,href:"".concat(P+(t.routing.path?"/"+t.routing.path:""),"/").concat(V(t.routing))})})),!!h&&e.createElement("meta",{name:"robots",content:"noindex"}),!!y&&O.map((function(t,o){return e.createElement("meta",{key:"".concat(t.content,"-").concat(o),property:t.property,content:t.content})})),!!f&&f.map((function(t,o){return e.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(P).concat(L).concat(t)})})),N&&e.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(N,"/image_180.webp"),type:"image/webp"}),e.createElement("link",{rel:"canonical",href:"".concat(P).concat(L,"/").concat(T)}),!!I.length&&I.map((function(t,o){return e.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})})))}));function c(t,e){try{var o=d.getInstance(),i=s.getCurrentRouting(),a=null==i?void 0:i.path,n=function(t){return a?"https://".concat(s.getDomain(),"/").concat(a).concat(t):"https://".concat(s.getDomain()).concat(t)},l=t.categoryPathItems.map((function(t,e){return{"@type":"ListItem",position:e+1,name:t.name,item:n(t.href)}}));return l.push({"@type":"ListItem",position:t.categoryPathItems.length+1,name:t.name,item:n(t.href)}),o.currentPageType===r.PRODUCT&&e&&l.push({"@type":"ListItem",position:l.length+1,name:e.name,item:n(e.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:l}}catch(t){}}function m(t,e,o){var i,a,n,s=o;try{switch(e){case r.PRODUCT:var d=t,l=d.name,c=(null===(i=d.brand)||void 0===i?void 0:i.name)||"",m=d.selectedVariant.sku||"",u=(null===(a=d.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?d.selectedVariant.barcodeList[0]:"",g=null!==(n=d.selectedVariant.formattedCampaignPrice)&&void 0!==n?n:d.selectedVariant.formattedFinalPrice;s.includes("{{name}}")&&(s=p(s,"{{name}}",l)),s.includes("{{brand}}")&&(s=p(s,"{{brand}}",c)),s.includes("{{sku}}")&&(s=p(s,"{{sku}}",m)),s.includes("{{barcode}}")&&(s=p(s,"{{barcode}}",u)),s.includes("{{price}}")&&(s=p(s,"{{price}}",g.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var v=t.name||"";s.includes("{{name}}")&&(s=p(s,"{{name}}",v));break;case r.BLOG:var f=t.title;s.includes("{{name}}")&&(s=p(s,"{{name}}",f))}}catch(t){}return s.trimEnd()}function p(t,e,o){var i=new RegExp(e,"g");return t.replace(i,o)}export{l as IkasPageHead};
|
|
1
|
+
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import i from"next/head.js";import{useRouter as a}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as r}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/region/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/region/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/campaign-offer/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/shipping-zone/state/city/district/region/index.js";import"../../models/data/state/index.js";import{IkasIndexPageSeoSetting as n}from"../../models/data/storefront/index-page-seo-setting/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/component/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/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/ikas-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{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as d}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var l=o((function(o){var d,l,p,u=o.pageType,g=o.pageTitle,v=o.pageDescription,f=o.canonicals,h=o.disableIndex,j=o.pageSpecificData,x=o.merchantSettings,y=o.addOgpMetas,b=o.productReviewSummary,C=a(),k="undefined"!=typeof window,w="local"===process.env.NEXT_PUBLIC_ENV,D=C.asPath.split("?")[0].replace("/",""),T=(D="/"===D.charAt(D.length-1)?D.slice(0,-1):D).startsWith("pages/"),E=s.getCurrentRouting(),L=(null==E?void 0:E.path)?"/"+E.path:"",P=w?"http://localhost:3333":"https://"+s.getDomain(),R=null===(d=s.getIndexPageSeoSettings())||void 0===d?void 0:d.find((function(e){return e.locale===s.getCurrentLocale()})),_=R?new n(R):null;t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[u,j]);var S=t.useMemo((function(){if(j&&j.href)return"".concat(P).concat(j.href)}),[j]),O=t.useMemo((function(){var e,t,o=[];if(y){if(o.push({property:"og:type",content:"website"}),o.push({property:"og:site_name",content:"https://"+s.getDomain()}),g&&o.push({property:"og:title",content:g}),v&&o.push({property:"og:description",content:v}),u===r.INDEX){var i=null,a=null;!g&&(null==_?void 0:_.pageTitle)&&(i=_.pageTitle),!v&&(null==_?void 0:_.description)&&(a=_.description);var n=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===u}));n&&(i=m(j,u,n.titleTemplate||""),a=m(j,u,n.descriptionTemplate||"")),i&&o.push({property:"og:title",content:i}),a&&o.push({property:"og:description",content:a})}if(o.push({property:"og:url",content:S||(k?window.location.href:"")||"https://".concat(s.getDomain())}),j&&u===r.PRODUCT){var d=j.selectedVariant.mainImage;(null==d?void 0:d.image)&&o.push({property:"og:image",content:d.image.src.replace(".webp",".jpg")})}else(null==_?void 0:_.icon)?o.push({property:"og:image",content:null===(t=null==_?void 0:_.icon)||void 0===t?void 0:t.src.replace(".webp",".jpg")}):(null==x?void 0:x.logo)&&o.push({property:"og:image",content:x.logo.src.replace(".webp",".jpg")});if(j&&u===r.CATEGORY){var l=j;l.image&&o.push({property:"og:image",content:l.image.src.replace(".webp",".jpg")})}if(j&&u===r.BRAND){var c=j;c.image&&o.push({property:"og:image",content:c.image.src.replace(".webp",".jpg")})}}return o}),[g,j,S,v,x,y,x]),I=t.useMemo((function(){var t=[];if(x){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},i=function(t){var o,i,a,r,n,d,l=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:l,image:l,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(a=null===(i=t.address)||void 0===i?void 0:i.city)||void 0===a?void 0:a.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(r=t.address)||void 0===r?void 0:r.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(x);t.push(o),t.push(i)}if(j&&u===r.PRODUCT){var a=j,n=function(t,o){var i,a,r,n,d;try{var l=s.getCurrentRouting(),c=null==l?void 0:l.path,m=function(e){return c?"https://".concat(s.getDomain(),"/").concat(c).concat(e):"https://".concat(s.getDomain()).concat(e)},p=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(i=t.metaData)||void 0===i?void 0:i.description,image:null===(a=p.images)||void 0===a?void 0:a.map((function(e){return e.image?e.image.src:""})),productId:p.id,sku:p.sku,mpn:(null===(r=p.barcodeList)||void 0===r?void 0:r.length)?p.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:m(t.href),priceCurrency:p.price.currency||"TRY",price:(null!==(d=p.campaignPrice)&&void 0!==d?d:p.price.finalPrice).toFixed(2),priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:p.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(a,b||null);if(n&&t.push(n),a.categories.length)(l=c(a.categories[0],a))&&t.push(l)}if(j&&u===r.CATEGORY){var d=function(e){var t,o;try{var i=s.getCurrentRouting(),a=null==i?void 0:i.path,r=function(e){return a?"https://".concat(s.getDomain(),"/").concat(a).concat(e):"https://".concat(s.getDomain()).concat(e)};return{"@context":"http://schema.org","@type":"CollectionPage",url:r(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(j),l=c(j);d&&t.push(d),l&&t.push(l)}if(j&&u===r.BLOG){var m=function(t){var o;try{var i="https://".concat(s.getDomain()).concat(t.href),a=function(e){var t=new Date(e),o=t.getFullYear(),i=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return"".concat(o,"-").concat(i,"-").concat(a)},r="".concat(t.writer.firstName," ").concat(t.writer.lastName),n=(new DOMParser).parseFromString(t.blogContent.content,"text/html").body.textContent;return e(e({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,image:null===(o=t.image)||void 0===o?void 0:o.src},t.category&&{genre:t.category.name}),{url:i,datePublished:a(t.createdAt),dateCreated:a(t.createdAt),dateModified:a(t.updatedAt),description:t.shortDescription,articleBody:n,author:{"@type":"Person",name:r}})}catch(e){}}(j);m&&t.push(m)}return t}),[j,x]),A=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===u}));return t?m(j,u,t.titleTemplate||""):null}),[u,j]),M=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===u}));return t?m(j,u,t.descriptionTemplate||""):null}),[u,j]),N=t.useMemo((function(){var e,t=null===(e=s.getFavicon())||void 0===e?void 0:e.id;return(null==_?void 0:_.favIcon)&&(t=_.favIcon),t||null}),[]),B=t.useCallback((function(){var e=s.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]),U=[];s.getRoutings().forEach((function(e){var t;(null===(t=e.countryCodes)||void 0===t?void 0:t.length)?e.countryCodes.forEach((function(t){U.push({routing:e,hrefLang:e.locale+"-"+t})})):U.push({routing:e,hrefLang:e.locale})}));var V=function(e){var t,o,i,a,r,n=j,s=null===(o=null===(t=null==n?void 0:n.metaData)||void 0===t?void 0:t.translations)||void 0===o?void 0:o.find((function(t){return t.locale===e.locale}));if(s&&(null==s?void 0:s.slug))return s.slug;var d=U.find((function(e){return!e.routing.path}));return d&&(null===(r=null===(a=null===(i=null==n?void 0:n.metaData)||void 0===i?void 0:i.translations)||void 0===a?void 0:a.find((function(e){return e.locale===d.routing.locale})))||void 0===r?void 0:r.slug)||""};return t.createElement(i,null,t.createElement("title",null,g||A||(null==_?void 0:_.pageTitle)||""),t.createElement("meta",{name:"description",content:v||M||(null==_?void 0:_.description)||""}),u===r.CHECKOUT&&B()&&t.createElement("script",{type:"text/javascript",src:"https://cdn-epeykolay.mncdn.com/".concat((null===(l=s.getApiUrl())||void 0===l?void 0:l.includes("myikas.com"))?"epay":"epay-uat","/").concat((null===(p=s.getApiUrl())||void 0===p?void 0:p.includes("myikas.com"))?"containerServices":"containerServicesTest",".js")}),U.length>1&&U.filter((function(e){return!T||e.routing.id===(null==E?void 0:E.id)})).map((function(e){return t.createElement("link",{key:e.routing.id+e.hrefLang,rel:"alternate",hrefLang:e.hrefLang,href:"".concat(P+(e.routing.path?"/"+e.routing.path:""),"/").concat(V(e.routing))})})),!!h&&t.createElement("meta",{name:"robots",content:"noindex"}),!!y&&O.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!f&&f.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(P).concat(L).concat(e)})})),N&&t.createElement("link",{rel:"shortcut icon",href:"".concat(process.env.NEXT_PUBLIC_CDN_URL,"images/").concat(N,"/image_180.webp"),type:"image/webp"}),t.createElement("link",{rel:"canonical",href:"".concat(P).concat(L,"/").concat(D)}),!!I.length&&I.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function c(e,t){try{var o=d.getInstance(),i=s.getCurrentRouting(),a=null==i?void 0:i.path,n=function(e){return a?"https://".concat(s.getDomain(),"/").concat(a).concat(e):"https://".concat(s.getDomain()).concat(e)},l=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:n(e.href)}}));return l.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:n(e.href)}),o.currentPageType===r.PRODUCT&&t&&l.push({"@type":"ListItem",position:l.length+1,name:t.name,item:n(t.productHref)}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:l}}catch(e){}}function m(e,t,o){var i,a,n,s=o;try{switch(t){case r.PRODUCT:var d=e,l=d.name,c=(null===(i=d.brand)||void 0===i?void 0:i.name)||"",m=d.selectedVariant.sku||"",u=(null===(a=d.selectedVariant.barcodeList)||void 0===a?void 0:a.length)?d.selectedVariant.barcodeList[0]:"",g=null!==(n=d.selectedVariant.formattedCampaignPrice)&&void 0!==n?n:d.selectedVariant.formattedFinalPrice;s.includes("{{name}}")&&(s=p(s,"{{name}}",l)),s.includes("{{brand}}")&&(s=p(s,"{{brand}}",c)),s.includes("{{sku}}")&&(s=p(s,"{{sku}}",m)),s.includes("{{barcode}}")&&(s=p(s,"{{barcode}}",u)),s.includes("{{price}}")&&(s=p(s,"{{price}}",g.toString()));break;case r.BRAND:case r.CATEGORY:case r.BLOG_CATEGORY:var v=e.name||"";s.includes("{{name}}")&&(s=p(s,"{{name}}",v));break;case r.BLOG:var f=e.title;s.includes("{{name}}")&&(s=p(s,"{{name}}",f))}}catch(e){}return s.trimEnd()}function p(e,t,o){var i=new RegExp(t,"g");return e.replace(i,o)}export{l as IkasPageHead};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.9",
|
|
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.13.
|
|
21
|
-
"@ikas/storefront-config": "^4.13.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.13.
|
|
23
|
-
"@ikas/storefront-models": "^4.13.
|
|
24
|
-
"@ikas/storefront-providers": "^4.13.
|
|
20
|
+
"@ikas/storefront-api": "^4.13.9",
|
|
21
|
+
"@ikas/storefront-config": "^4.13.9",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.13.9",
|
|
23
|
+
"@ikas/storefront-models": "^4.13.9",
|
|
24
|
+
"@ikas/storefront-providers": "^4.13.9",
|
|
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.13.
|
|
59
|
-
"@ikas/storefront-config": "^4.13.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.13.
|
|
61
|
-
"@ikas/storefront-models": "^4.13.
|
|
62
|
-
"@ikas/storefront-providers": "^4.13.
|
|
58
|
+
"@ikas/storefront-api": "^4.13.9",
|
|
59
|
+
"@ikas/storefront-config": "^4.13.9",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.13.9",
|
|
61
|
+
"@ikas/storefront-models": "^4.13.9",
|
|
62
|
+
"@ikas/storefront-providers": "^4.13.9",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|