@ikas/storefront 2.0.37 → 2.0.38
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 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 +1 @@
|
|
|
1
|
-
import{__assign as t}from'../../ext/tslib/tslib.es6.js';import*as
|
|
1
|
+
import{__assign as t,__spreadArray as e}from'../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import r 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 d}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 m}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 p}from"../../storefront/index.js";import{IkasPageDataInit as l}from"../../providers/page-data-init.js";var c=i((function(i){var c=i.pageType,u=i.pageTitle,f=i.pageDescription,g=i.pageSpecificDataStr,h=i.merchantSettingsStr,v=i.addOgpMetas,j=i.productReviewSummary,x="undefined"!=typeof window,y=o.useState([]);y[0],y[1],o.useEffect((function(){var t;document.documentElement.lang=(null===(t=p.routings.find((function(t){return t.id===p.storefrontRoutingId})))||void 0===t?void 0:t.locale)||"tr"}),[c]);var b=o.useMemo((function(){if(h)return new s(JSON.parse(h))}),[h]),w=o.useMemo((function(){if(!g)return g;var t=JSON.parse(g);switch(c){case d.PRODUCT:return new m(t.product,t.selectedVariantValues);case d.CATEGORY:return new n(t);case d.BRAND:return new a(t);default:return g}}),[g]),S=o.useMemo((function(){if(w&&w.href)return"https://".concat(p.domain).concat(w.href)}),[w]),O=o.useMemo((function(){var t,e=[];if(v)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+p.domain}),u&&e.push({property:"og:title",content:u}),f&&e.push({property:"og:description",content:f}),e.push({property:"og:url",content:S||(x?window.location.href:"")||"https://".concat(p.domain)}),w&&c===d.PRODUCT){var o=w;o.selectedVariant.mainImage&&e.push({property:"og:image",content:null===(t=o.selectedVariant.mainImage)||void 0===t?void 0:t.src})}else b&&e.push({property:"og:image",content:b.logo.src});return e}),[u,w,S,f,b,v,b]),V=o.useMemo((function(){var o=[];if(b){var i={"@context":"https://schema.org","@type":"Website",url:"https://"+p.domain},r=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://"+p.domain}}(b);o.push(i),o.push(r)}if(w&&c===d.PRODUCT){var a=function(e,o){var i,r;try{"undefined"!=typeof window&&l._initProductDetailOnBrowser(e);var a="https://".concat(p.domain).concat(e.href);return t(t({"@context":"https://schema.org/","@type":"Product",name:e.product.name,description:null===(i=e.product.metaData)||void 0===i?void 0:i.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===(r=e.product.brand)||void 0===r?void 0:r.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){}}(w,j?JSON.parse(j):null);a&&o.push(a)}if(w&&c===d.CATEGORY){var n=function(t){var e,o,i;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(p.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===(i=t.image)||void 0===i?void 0:i.src}}catch(t){}}(w),s=function(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://"+p.domain+t.href}})),!0),[{"@type":"ListItem",position:t.path.length+1,name:t.name,item:"https://"+p.domain+t.href}],!1):[{"@type":"ListItem",position:1,name:t.name,item:"https://"+p.domain+t.href}]}}catch(t){}}(w);n&&o.push(n),s&&o.push(s)}return o}),[w,b]);return o.createElement(r,null,o.createElement("title",null,u||""),o.createElement("meta",{name:"description",content:f||""}),!!v&&O.map((function(t,e){return o.createElement("meta",{key:"".concat(t.content,"-").concat(e),property:t.property,content:t.content})})),!!V.length&&V.map((function(t,e){return o.createElement("script",{key:e,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})})))}));export{c as IkasPageHead};
|