efficient-storefront-blocks 0.130.10 → 0.130.11
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 client";import{Fragment as f,jsx as o,jsxs as p}from"react/jsx-runtime";import{withRMark as c}from"efficient-web-builder/render/components/RMark";import y from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as h}from"efficient-web-builder/render/lib/document/part-styles";import w from"../../../../../components/card-pieces/HostPart.js";import{useHeroStateOrNull as E,useProductCardStateOrNull as g}from"../../../../../components/card-pieces/ProductCardState.js";import x from"../../../../../components/card-pieces/HeadlineEyebrow.js";import{MarkedLabel as u}from"../../../../../components/product-hero/hero-view.js";import{EYEBROW_BADGE_PROP as k,EYEBROW_SHOW_PROP as P,TITLE_LOOK_PROP as C,parseEyebrowShow as O,parseTitleLook as _}from"../../../../content/title-look.js";import R
|
|
1
|
+
"use client";import{Fragment as f,jsx as o,jsxs as p}from"react/jsx-runtime";import{withRMark as c}from"efficient-web-builder/render/components/RMark";import y from"../../../../../components/card-pieces/CardEyebrow.js";import{readPartStyles as h}from"efficient-web-builder/render/lib/document/part-styles";import w from"../../../../../components/card-pieces/HostPart.js";import{useHeroStateOrNull as E,useProductCardStateOrNull as g}from"../../../../../components/card-pieces/ProductCardState.js";import x from"../../../../../components/card-pieces/HeadlineEyebrow.js";import{MarkedLabel as u}from"../../../../../components/product-hero/hero-view.js";import{EYEBROW_BADGE_PROP as k,EYEBROW_SHOW_PROP as P,TITLE_LOOK_PROP as C,parseEyebrowShow as O,parseTitleLook as _}from"../../../../content/title-look.js";import{SiteLink as R}from"efficient-web-builder/render/lib/site-runtime";import{useGridCard as m}from"../../../../../components/GridCardTemplate.js";import{itemBrand as B,plpKindNoun as L}from"../../../../catalog/plp-item.js";import{productCardEyebrow as S,wheelCardEyebrow as H}from"../../../../../components/ProductCardEyebrow.js";import{keepForCard as N}from"../../../../content/field-usage.js";import{ProductEyebrowMeta as b}from"./meta.js";function T(r){const{fieldUsage:t,tyreFieldUsage:e,eyebrow:n}=m();if(r.kind==="tyre"){const a=(n.tyreBrand??n.brand)&&N(e)("brand")&&r.tyre.brand||null,s=n.kindLabel?L(["tyre"]).one:null;return S(s,a)}const l=r.kind==="wheel"?r.wheel:null,i=l&&n.brand?B(l):null,d={kindLabel:l?n.kindLabel:null,brand:i?c(i):null,process:l&&n.process&&l.process?c(l.process):null};return H(d,t)}function W({state:r,children:t}){return o(f,{children:t(T(r),null)})}const j="data-product-crumbs";function v({product:r}){const t=r.crumbs.slice(1,-1);return t.length===0?null:o("nav",{"aria-label":"Breadcrumb",[j]:"",className:"text-xs text-fg-dim",children:t.map((e,n)=>p("span",{children:[n>0&&" / ",e.href?o(R,{href:e.href,className:"hover:text-fg",children:o(u,{text:e.label})}):o(u,{text:e.label})]},`${e.label}-${n}`))})}function F({props:r,region:t}){const e=E(),n=g(),{reserveEyebrow:l}=m(),i=_(r[C])==="headline",d=(a,s)=>i?o(x,{eyebrow:a,badge:r[k]===!0?s:null,region:t}):o(y,{reserve:l,region:t,children:a});return e&&O(r[P])==="crumbs"?o(v,{product:e.product}):e?d(e.title.eyebrow?o(u,{text:e.title.eyebrow}):null,e.title.badge):n?o(W,{state:n,children:d}):null}const Z={...b,render:r=>{const t=!!r.editor?.isEditing;return o(w,{label:b.label??"",editing:t,onHero:!0,children:o(F,{props:r,region:{nodeId:typeof r.id=="string"?r.id:void 0,partStyles:h(r),editing:t}})})}};export{Z as ProductEyebrowRender};
|