geno/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/product-title-frontend.js

1 line
5.7 KiB
JavaScript
Raw Permalink Normal View History

2024-02-01 17:24:18 +05:30
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[6925],{3719:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(721),o=n(9196),l=n(4184),s=n.n(l),c=n(2864),a=n(5271),i=n(2629);n(5641);const u=({className:e="",disabled:t=!1,name:n,permalink:r="",target:l,rel:c,style:a,onClick:u,...d})=>{const p=s()("wc-block-components-product-name",e);if(t){const e=d;return(0,o.createElement)("span",{className:p,...e,dangerouslySetInnerHTML:{__html:(0,i.decodeEntities)(n)}})}return(0,o.createElement)("a",{className:p,href:r,target:l,...d,dangerouslySetInnerHTML:{__html:(0,i.decodeEntities)(n)},style:a})};var d=n(5918),p=n(3611);n(5160);const v=({children:e,headingLevel:t,elementType:n=`h${t}`,...r})=>(0,o.createElement)(n,{...r},e),f=(0,r.withProductDataContext)((e=>{const{className:t,headingLevel:n=2,showProductLink:r=!0,linkTarget:l,align:i}=e,f=(0,p.F)(e),{parentClassName:m}=(0,c.useInnerBlockLayoutContext)(),{product:y}=(0,c.useProductDataContext)(),{dispatchStoreEvent:g}=(0,d.n)();return y.id?(0,o.createElement)(v,{headingLevel:n,className:s()(t,f.className,"wc-block-components-product-title",{[`${m}__product-title`]:m,[`wc-block-components-product-title--align-${i}`]:i&&(0,a.uq)()}),style:(0,a.uq)()?f.style:{}},(0,o.createElement)(u,{disabled:!r,name:y.name,permalink:y.permalink,target:l,onClick:()=>{g("product-view-link",{product:y})}})):(0,o.createElement)(v,{headingLevel:n,className:s()(t,f.className,"wc-block-components-product-title",{[`${m}__product-title`]:m,[`wc-block-components-product-title--align-${i}`]:i&&(0,a.uq)()}),style:(0,a.uq)()?f.style:{}})}));let m={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},linkTarget:{type:"string"},productId:{type:"number",default:0}};(0,a.uq)()&&(m={...m,align:{type:"string"}});const y=m,g=(0,r.withFilteredAttributes)(y)(f)},3611:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(4184),o=n.n(r),l=n(7884),s=n(2646),c=n(1473),a=n(2661);const i=e=>{const t=(e=>{const t=(0,l.Kn)(e)?e:{style:{}};let n=t.style;return(0,s.H)(n)&&(n=JSON.parse(n)||{}),(0,l.Kn)(n)||(n={}),{...t,style:n}})(e),n=(0,a.vc)(t),r=(0,a.l8)(t),i=(0,a.su)(t),u=(0,c.f)(t);return{className:o()(u.className,n.className,r.className,i.className),style:{...u.style,...n.style,...r.style,...i.style}}}},1473:(e,t,n)=>{"use strict";n.d(t,{f:()=>l});var r=n(7884),o=n(2646);const l=e=>{const t=(0,r.Kn)(e.style.typography)?e.style.typography:{},n=(0,o.H)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:n,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}}},2661:(e,t,n)=>{"use strict";n.d(t,{l8:()=>d,su:()=>p,vc:()=>u});var r=n(4184),o=n.n(r),l=n(9784),s=n(2289),c=n(7884);function a(e={}){const t={};return(0,s.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function i(e,t){return e&&t?`has-${(0,l.o)(t)}-${e}`:""}function u(e){var t,n,r,l,s,u,d;const{backgroundColor:p,textColor:v,gradient:f,style:m}=e,y=i("background-color",p),g=i("color",v),h=function(e){if(e)return`has-${e}-gradient-background`}(f),k=h||(null==m||null===(t=m.color)||void 0===t?void 0:t.gradient);return{className:o()(g,h,{[y]:!k&&!!y,"has-text-color":v||(null==m||null===(n=m.color)||void 0===n?void 0:n.text),"has-background":p||(null==m||null===(r=m.color)||void 0===r?void 0:r.background)||f||(null==m||null===(l=m.color)||void 0===l?void 0:l.gradient),"has-link-color":(0,c.Kn)(null==m||null===(s=m.elements)||void 0===s?void 0:s.link)?null==m||null===(u=m.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:a({color:(null==m?void 0:m.color)||{}})}}function d(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:n,style:r}=e,l=n?i("border-color",n):"";return o()({"has-border-color":!!n||!(null==r||null===(t=r.border)||void 0===t||!t.color