@ikas/storefront 2.0.61 → 2.0.62
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
|
-
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import i from"next/head.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as n}from"../../models/data/category/index.js";import"../../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"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasMerchantSettings as s}from"../../models/data/merchant-settings/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{IkasThemePageType as m}from"../../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 d}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{IkasStorefrontConfig as c}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";import{useRouter as p}from"next/router";var u=r((function(e){var r=e.pageType,u=e.pageTitle,h=e.pageDescription,g=e.canonicals,v=e.disableIndex,j=e.pageSpecificDataStr,x=e.merchantSettingsStr,y=e.addOgpMetas,b=e.productReviewSummary,w=p(),E="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,V=w.asPath.split("?")[0].replace("/",""),O=c.routings.filter((function(t){return t.id!==c.storefrontRoutingId})),S=c.getCurrentRouting(),C=(null==S?void 0:S.path)?"/"+S.path:"",R=k?"http://localhost:3333":"https://"+c.domain;o.useEffect((function(){document.documentElement.lang=c.getCurrentLocale()}),[r,j]);var L=o.useMemo((function(){if(x)return new s(JSON.parse(x))}),[x]),I=o.useMemo((function(){if(!j)return j;var t=JSON.parse(j);switch(r){case m.PRODUCT:return new d(t.product,t.selectedVariantValues);case m.CATEGORY:return new n(t);case m.BRAND:return new a(t);default:return j}}),[j]),T=o.useMemo((function(){if(I&&I.href)return"".concat(R).concat(I.href)}),[I]),D=o.useMemo((function(){var t,e=[];if(y)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+c.domain}),u&&e.push({property:"og:title",content:u}),h&&e.push({property:"og:description",content:h}),e.push({property:"og:url",content:T||(E?window.location.href:"")||"https://".concat(c.domain)}),I&&r===m.PRODUCT){var o=I;o.selectedVariant.mainImage&&e.push({property:"og:image",content:null===(t=o.selectedVariant.mainImage)||void 0===t?void 0:t.src})}else L&&e.push({property:"og:image",content:L.logo.src});return e}),[u,I,T,h,L,y,L]),N=o.useMemo((function(){var e=[];if(L){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+c.domain},i=function(t){var e,o;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:null===(e=null==t?void 0:t.logo)||void 0===e?void 0:e.src,image:null===(o=null==t?void 0:t.logo)||void 0===o?void 0:o.src,url:"https://"+c.domain}}(L);e.push(o),e.push(i)}if(I&&r===m.PRODUCT){var a=I,n=function(e,o){var r,i;try{"undefined"!=typeof window&&l._initProductDetailOnBrowser(e);var a="https://".concat(c.domain).concat(e.href);return t(t({"@context":"https://schema.org/","@type":"Product",name:e.product.name,description:null===(r=e.product.metaData)||void 0===r?void 0:r.description,image:e.selectedVariant.images.map((function(t){return t.src})),productId:e.selectedVariant.id,sku:e.selectedVariant.sku,mpn:e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(i=e.product.brand)||void 0===i?void 0:i.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:a,priceCurrency:e.selectedVariant.price.currency||"TRY",price:e.selectedVariant.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.selectedVariant.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(t){}}(a,b?JSON.parse(b):null);if(n&&e.push(n),a.product.categories.length)(d=f(a.product.categories[0]))&&e.push(d)}if(I&&r===m.CATEGORY){var s=function(t){var e,o,r;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(c.domain).concat(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:null===(r=t.image)||void 0===r?void 0:r.src}}catch(t){}}(I),d=f(I);s&&e.push(s),d&&e.push(d)}return e}),[I,L]);return o.createElement(i,null,o.createElement("title",null,u||""),o.createElement("meta",{name:"description",content:h||""}),O.map((function(t){return o.createElement("link",{key:t.id,rel:"alternate",hrefLang:t.locale,href:"".concat(R+(t.path?"/"+t.path:""),"/").concat(V)})})),!!S&&o.createElement("link",{key:"current-routing-hreflang",rel:"alternate",hrefLang:S.locale,href:"".concat(R).concat(C,"/").concat(V)}),!!v&&o.createElement("meta",{name:"robots",content:"noindex"}),!!y&&D.map((function(t,e){return o.createElement("meta",{key:"".concat(t.content,"-").concat(e),property:t.property,content:t.content})})),!!g&&g.map((function(t,e){return o.createElement("link",{key:e+"url",rel:"canonical",href:"".concat(R).concat(C).concat(t)})})),o.createElement("link",{rel:"canonical",href:"".concat(R).concat(C,"/").concat(V)}),!!N.length&&N.map((function(t,e){return o.createElement("script",{key:e,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})})))}));function f(t){try{return{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:t.path.length?e(e([],t.path.map((function(t,e){return{"@type":"ListItem",position:e+1,name:t.name,item:"https://"+c.domain+t.href}})),!0),[{"@type":"ListItem",position:t.path.length+1,name:t.name,item:"https://"+c.domain+t.href}],!1):[{"@type":"ListItem",position:1,name:t.name,item:"https://"+c.domain+t.href}]}}catch(t){}}export{u as IkasPageHead};
|
|
1
|
+
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as r}from"mobx-react-lite";import i from"next/head.js";import"../../models/data/blog/index.js";import{IkasBrand as a}from"../../models/data/brand/index.js";import{IkasCategory as n}from"../../models/data/category/index.js";import"../../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"mobx";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/installment-info/index.js";import{IkasMerchantSettings as s}from"../../models/data/merchant-settings/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{IkasThemePageType as m}from"../../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 d}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{IkasStorefrontConfig as c}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";import{useRouter as p}from"next/router";var u=r((function(e){var r=e.pageType,u=e.pageTitle,h=e.pageDescription,g=e.canonicals,v=e.disableIndex,j=e.pageSpecificDataStr,x=e.merchantSettingsStr,y=e.addOgpMetas,b=e.productReviewSummary,w=p(),E="undefined"!=typeof window,k="local"===process.env.NEXT_PUBLIC_ENV,V=w.asPath.split("?")[0].replace("/",""),O=c.routings.filter((function(t){return t.id!==c.storefrontRoutingId})),S=c.getCurrentRouting(),C=(null==S?void 0:S.path)?"/"+S.path:"",R=k?"http://localhost:3333":"https://"+c.domain;o.useEffect((function(){document.documentElement.lang=c.getCurrentLocale()}),[r,j]);var L=o.useMemo((function(){if(x)return new s(JSON.parse(x))}),[x]),I=o.useMemo((function(){if(!j)return j;var t=JSON.parse(j);switch(r){case m.PRODUCT:return new d(t.product,t.selectedVariantValues);case m.CATEGORY:return new n(t);case m.BRAND:return new a(t);default:return j}}),[j]),T=o.useMemo((function(){if(I&&I.href)return"".concat(R).concat(I.href)}),[I]),D=o.useMemo((function(){var t,e=[];if(y)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+c.domain}),u&&e.push({property:"og:title",content:u}),h&&e.push({property:"og:description",content:h}),e.push({property:"og:url",content:T||(E?window.location.href:"")||"https://".concat(c.domain)}),I&&r===m.PRODUCT){var o=I;o.selectedVariant.mainImage&&e.push({property:"og:image",content:null===(t=o.selectedVariant.mainImage)||void 0===t?void 0:t.src})}else L&&e.push({property:"og:image",content:L.logo.src});return e}),[u,I,T,h,L,y,L]),N=o.useMemo((function(){var e=[];if(L){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+c.domain},i=function(t){var e,o;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:null===(e=null==t?void 0:t.logo)||void 0===e?void 0:e.src,image:null===(o=null==t?void 0:t.logo)||void 0===o?void 0:o.src,url:"https://"+c.domain}}(L);e.push(o),e.push(i)}if(I&&r===m.PRODUCT){var a=I,n=function(e,o){var r,i;try{"undefined"!=typeof window&&l._initProductDetailOnBrowser(e);var a="https://".concat(c.domain).concat(e.href);return t(t({"@context":"https://schema.org/","@type":"Product",name:e.product.name,description:null===(r=e.product.metaData)||void 0===r?void 0:r.description,image:e.selectedVariant.images.map((function(t){return t.src})),productId:e.selectedVariant.id,sku:e.selectedVariant.sku,mpn:e.selectedVariant.barcodeList.length?e.selectedVariant.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(i=e.product.brand)||void 0===i?void 0:i.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:a,priceCurrency:e.selectedVariant.price.currency||"TRY",price:e.selectedVariant.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:e.selectedVariant.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(t){}}(a,b?JSON.parse(b):null);if(n&&e.push(n),a.product.categories.length)(d=f(a.product.categories[0]))&&e.push(d)}if(I&&r===m.CATEGORY){var s=function(t){var e,o,r;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(c.domain).concat(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:null===(r=t.image)||void 0===r?void 0:r.src}}catch(t){}}(I),d=f(I);s&&e.push(s),d&&e.push(d)}return e}),[I,L]);return o.createElement(i,null,o.createElement("title",null,u||""),o.createElement("meta",{name:"description",content:h||""}),O.map((function(t){return o.createElement("link",{key:t.id,rel:"alternate",hrefLang:t.locale,href:"".concat(R+(t.path?"/"+t.path:""),"/").concat(V)})})),!!S&&!!O.length&&o.createElement("link",{key:"current-routing-hreflang",rel:"alternate",hrefLang:S.locale,href:"".concat(R).concat(C,"/").concat(V)}),!!v&&o.createElement("meta",{name:"robots",content:"noindex"}),!!y&&D.map((function(t,e){return o.createElement("meta",{key:"".concat(t.content,"-").concat(e),property:t.property,content:t.content})})),!!g&&g.map((function(t,e){return o.createElement("link",{key:e+"url",rel:"canonical",href:"".concat(R).concat(C).concat(t)})})),o.createElement("link",{rel:"canonical",href:"".concat(R).concat(C,"/").concat(V)}),!!N.length&&N.map((function(t,e){return o.createElement("script",{key:e,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})})))}));function f(t){try{return{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:t.path.length?e(e([],t.path.map((function(t,e){return{"@type":"ListItem",position:e+1,name:t.name,item:"https://"+c.domain+t.href}})),!0),[{"@type":"ListItem",position:t.path.length+1,name:t.name,item:"https://"+c.domain+t.href}],!1):[{"@type":"ListItem",position:1,name:t.name,item:"https://"+c.domain+t.href}]}}catch(t){}}export{u as IkasPageHead};
|