efficient-storefront-blocks 0.68.0 → 0.74.0
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/CHANGELOG.md +65 -0
- package/README.md +5 -5
- package/dist/chunks/EditorPreviewCheckout-YQ3F5MSG.js +4 -0
- package/dist/chunks/{SiteEditorProvider-A7YYACG3.js → SiteEditorProvider-Z33JB5BA.js} +1 -1
- package/dist/chunks/chunk-5OFEWRWI.js +1 -0
- package/dist/chunks/{chunk-FL3KMJAT.js → chunk-BZDVZUF4.js} +1 -1
- package/dist/chunks/{chunk-EPJ5SM3A.js → chunk-QJDTP7K6.js} +1 -1
- package/dist/chunks/chunk-UGXNUQRA.js +246 -0
- package/dist/chunks/chunk-UJW4B64R.js +1 -0
- package/dist/chunks/{fitment-data-RXCNCZLU.js → fitment-data-DHKRLKNI.js} +1 -1
- package/dist/contract.js +10 -2
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.d.ts +4 -7
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/PreviewHeader.d.ts +0 -1
- package/dist/editor/components/PreviewHeader.js +1 -11
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterDivider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMenu/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/FooterPayment/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/MessagingCards/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/OpeningHours/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/OpeningHours/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/index.js +1 -1
- package/dist/editor/lib/document/config.d.ts +2 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/editor/lib/header-settings-source.d.ts +2 -1
- package/dist/editor/lib/header-settings-source.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +25 -7
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +193 -318
- package/dist/links.d.ts +0 -2
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +41 -13
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/ChatLauncher.js +1 -1
- package/dist/render/components/ContactCards.d.ts +13 -0
- package/dist/render/components/ContactCards.js +1 -0
- package/dist/render/components/CopyText.d.ts +4 -0
- package/dist/render/components/CopyText.js +1 -0
- package/dist/render/components/Events.d.ts +3 -0
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FooterMessaging.d.ts +5 -0
- package/dist/render/components/FooterMessaging.js +1 -0
- package/dist/render/components/FooterPayment.d.ts +11 -0
- package/dist/render/components/FooterPayment.js +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/Header.d.ts +2 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderCallButton.d.ts +9 -0
- package/dist/render/components/HeaderCallButton.js +1 -0
- package/dist/render/components/MessagingCards.d.ts +9 -0
- package/dist/render/components/MessagingCards.js +1 -0
- package/dist/render/components/OpeningHours.d.ts +12 -0
- package/dist/render/components/OpeningHours.js +1 -0
- package/dist/render/components/QrCode.d.ts +5 -0
- package/dist/render/components/QrCode.js +1 -0
- package/dist/render/components/Reviews.d.ts +14 -4
- package/dist/render/components/Reviews.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.d.ts +2 -25
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -3
- package/dist/render/components/checkout/checkout-parts.d.ts +5 -0
- package/dist/render/components/checkout/checkout-parts.js +1 -0
- package/dist/render/components/checkout/checkout-state.d.ts +169 -0
- package/dist/render/components/checkout/checkout-state.js +3 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.d.ts +6 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +3 -2
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
- package/dist/render/lib/api/index.d.ts +1 -0
- package/dist/render/lib/api/types.d.ts +3 -0
- package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactCards/meta.d.ts +7 -0
- package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/ContactCards/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/ContactCards/render.js +1 -0
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Footer/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterGroup/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterMessaging/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/FooterMessaging/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/FooterMessaging/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/FooterMessaging/render.js +1 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/meta.d.ts +3 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/render.js +1 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/render.js +1 -0
- package/dist/render/lib/document/blocks/service/OpeningHours/meta.d.ts +11 -0
- package/dist/render/lib/document/blocks/service/OpeningHours/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/OpeningHours/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/OpeningHours/render.js +1 -0
- package/dist/render/lib/document/blocks/service/Reviews/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/service/Reviews/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Reviews/render.js +1 -1
- package/dist/render/lib/document/blocks/service/metas.d.ts +5 -0
- package/dist/render/lib/document/blocks/service/metas.js +1 -1
- package/dist/render/lib/document/blocks/service/renders.d.ts +5 -0
- package/dist/render/lib/document/blocks/service/renders.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +147 -6
- package/dist/render/lib/document/card-templates.d.ts +2 -0
- package/dist/render/lib/document/card-templates.js +1 -0
- package/dist/render/lib/document/footer-page-blocks.d.ts +1 -0
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-config.d.ts +2 -0
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +1 -0
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -0
- package/dist/render/lib/links/link-rules.d.ts +1 -1
- package/dist/render/lib/links/link-rules.js +1 -1
- package/dist/render/lib/qr.d.ts +5 -0
- package/dist/render/lib/qr.js +1 -0
- package/dist/render/lib/sections/messaging.d.ts +45 -0
- package/dist/render/lib/sections/messaging.js +1 -0
- package/dist/render/lib/sections/opening-hours.d.ts +53 -0
- package/dist/render/lib/sections/opening-hours.js +1 -0
- package/dist/render/lib/sections/reviews.d.ts +1 -0
- package/dist/render/lib/sections/reviews.js +1 -0
- package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
- package/dist/render/lib/wheels/collections.js +1 -1
- package/dist/words.d.ts +51 -12
- package/dist/words.js +4 -4
- package/package.json +4 -4
- package/dist/chunks/EditorPreviewCheckout-HFP2TRRR.js +0 -4
- package/dist/chunks/chunk-CFYEYTU6.js +0 -254
- package/dist/chunks/chunk-YACB7UXA.js +0 -1
- package/dist/chunks/chunk-YTQS5GY6.js +0 -1
- package/dist/render/components/useStorefrontReviews.d.ts +0 -2
- package/dist/render/components/useStorefrontReviews.js +0 -1
- /package/dist/chunks/{chunk-CFYEYTU6.js.LEGAL.txt → chunk-UGXNUQRA.js.LEGAL.txt} +0 -0
package/dist/links.d.ts
CHANGED
|
@@ -26,8 +26,6 @@ export function postPath(slug: string): string;
|
|
|
26
26
|
export function wheelPath(slug: string): string;
|
|
27
27
|
/** A section anchor on a page: the page's path and `#<hash>`. */
|
|
28
28
|
export function anchorPath(pageSlug: string, hash: string): string;
|
|
29
|
-
/** Anchor name → URL hash id, exactly as the page renders it. */
|
|
30
|
-
export function slugifyAnchor(name: string): string;
|
|
31
29
|
/** The section anchors across a page's documents (published, then draft), in
|
|
32
30
|
* order, each slug once. */
|
|
33
31
|
export function pageAnchors(...docs: unknown[]): { slug: string; name: string }[];
|
package/dist/links.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var h={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ze={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text"};var Q=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var x=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],X=["highlight","quiet"],Ue=Q.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!X.includes(e)),De=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function v(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Be.includes(n[1].toLowerCase())}var J=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function M(e){let n=We.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return J.every(i=>{let[a,u]=Ge[i];return t[i]>=a&&t[i]<=u})?t:null}function L(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function ee(e){return[L({width:e.width}),L({width:e.width,profile:e.profile}),L(e)]}var S=["alloy-wheel","tyre"],ne=["alloy-wheel"],w={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Hn=S.map(e=>({value:e,label:w[e]}));function z(e){return e==null?[...ne]:Array.isArray(e)?S.filter(n=>e.includes(n)):[...ne]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function te(e){return m(e).prices??void 0}function re(e){return m(e).inStock!==!1}function ie(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function D(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function oe(e){return D(e).map(n=>n.family)}function le(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function se(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ae(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function ce(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>M(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var pe=null;function de(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=pe?pe[e]:void 0;if(typeof t=="function"){try{let r=t(n??{});if(typeof r=="string"&&r)return r}catch{}return de(e,n)}return de(typeof t=="string"&&t?t:e,n)}var fe="homepage";function me(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var $="#popup:";function ge(e){return`${$}${e}`}function he(e){return e.startsWith($)&&e.slice($.length).trim()||null}function P(e){return e===fe?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function B(e){return me(e)}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=B(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function I(e,n,t){if(!e)return"page";if(he(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Pe(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:_(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:ge(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function W(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function be(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function Se(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function ke(e){return je(e,"filter")}var He="collection";function G(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":He},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function je(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,n){let t=e?.[n];return Ze(t)?t:null}function Le(e,n,t,r){if(t==null&&r==null)return!0;let i=xe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},_t=Object.keys(Ve);var we=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let n=we.filter(t=>e.every(r=>Qe[t].includes(r)));return n.filter(t=>{let r=Xe[t];return!r||!n.includes(r)})}function en(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Fe={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function nn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of we){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Te(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!Le(te(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!re(e))}var tn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Te(e,n){switch(n){case"tyreSizes":return[...new Set(ce(e).flatMap(ee))];case"brands":return U(e)?[U(e)]:[];case"finishes":return oe(e);case"diameters":return ie(e).map(String);case"collections":return le(e);case"pcds":return se(e);case"tyreTypes":return ae(e);case"speedRatings":return ue(e)}}function rn(e){let n=new Map;for(let t of e)for(let r of D(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function _e(e,n,t,r=en(e),i=[]){let a=o=>ln(o,r,i),u=rn(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,N=new Map,k=new Map;for(let d of e){let b=Te(d,o);for(let g of b)c.add(g);for(let g of new Set(b))k.set(g,(k.get(g)??0)+1);if(nn(d,n,t,o))for(let g of new Set(b))N.set(g,(N.get(g)??0)+1)}let Me=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let g=(k.get(b.value)??0)-(k.get(d.value)??0);return g!==0?g:d.value.localeCompare(b.value)});return{key:o,label:tn[o],options:Me}}).filter(o=>o.options.length>on),s=[];for(let o of p){let l=sn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...Se(p,o=>o.key,s,"filterOrder")]}var on=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ln(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>ke(W(t,r))(G(e,r)))}function sn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=be(W(t,i),"filter")(G(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var Y={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},q="type";var Re="AlloyWheelsListing";function Ee(e){return v(e.trim())}var C="/wheels",K="Products";function Ie(e,n){return n>1?`${K} \xB7 ${e}`:K}function H(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Re);if(t)return t.props??{}}return null}function O(...e){return H(...e)!==null}function Ce(e,n){let t=e.filter(r=>O(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var j=[q,...Object.entries(Y).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ke(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function an(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Oe(e){let n=new URLSearchParams(Ke(e).query);for(let t of j){let r=n.get(t);if(r)return{param:t,value:r}}return null}function Z(e,n){let{path:t,query:r,hash:i}=Ke(e),a=r.split("&").filter(u=>u&&!j.includes(an(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,n){let t=Z(e,null);return n.includes(t)?t:e}function un(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ne(r,t)})}function cn(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var ve="Product type",pn="AUD";function V(e,n){let t=n.listing??{},r=z(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(t),u=_e(i,Fe,pn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:Y[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:q,label:ve,values:p.map(s=>({value:s,label:w[s]}))}),u}function dn(e){return n=>{let t=Ce(n,{fallback:e.offersCommerce}),r=n.filter(i=>O(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&O(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:K}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return V(e.catalogue,{listing:a?H(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Oe,withFilter:Z}}}function fn(e){let n=dn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ee},filtersFor:t.filtersFor??(()=>null)}}function Yt(e,n){return V(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,j as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,ve as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,cn as fieldUsageFromAdminRows,un as inferLinkKind,O as isProductListingPage,Ee as isSafeLink,T as linkKindsFor,fn as linkPickerSetup,Yt as listingFilterFields,H as listingNode,Ie as listingPageLabel,Ne as listingTarget,E as pageAnchors,P as pagePath,_ as postPath,Ce as productListingPaths,Oe as readListingFilter,B as slugifyAnchor,A as wheelPath,Z as withListingFilter};
|
|
1
|
+
var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var De={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text"};var X=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var x=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],J=["highlight","quiet"],Ue=X.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!J.includes(e)),ze=[...x,{open:"*",close:"*",kind:"accent"}],$e=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Be=["http","https","mailto","tel"];function M(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Be.includes(n[1].toLowerCase())}var ee=["width","profile","rim"];var We=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,Ge={width:[100,500],profile:[20,100],rim:[10,30]};function v(e){let n=We.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return ee.every(i=>{let[a,u]=Ge[i];return t[i]>=a&&t[i]<=u})?t:null}function w(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function ne(e){return[w({width:e.width}),w({width:e.width,profile:e.profile}),w(e)]}var S=["alloy-wheel","tyre"],te=["alloy-wheel"],L={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Hn=S.map(e=>({value:e,label:L[e]}));function D(e){return e==null?[...te]:Array.isArray(e)?S.filter(n=>e.includes(n)):[...te]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function U(e){return m(e).brand??""}function re(e){return m(e).prices??void 0}function ie(e){return m(e).inStock!==!1}function oe(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function z(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function le(e){return z(e).map(n=>n.family)}function se(e){if(f(e)==="tyre")return[];let n=m(e),t=n.categories;return t&&t.length>0?t:n.process?[n.process]:[]}function ae(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ce(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function pe(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>v(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var $=e=>typeof e=="string"&&e?e:void 0;var de=null;function fe(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=de?de[e]:void 0;if(typeof t=="function"){try{let r=$(t(n??{}));if(r)return r}catch{}return fe(e,n)}return fe($(t)??e,n)}var me="homepage";function B(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function T(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var W="#popup:";function he(e){return`${W}${e}`}function ge(e){return e.startsWith(W)&&e.slice(W.length).trim()||null}function P(e){return e===me?"/":`/${e}`}function _(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function Ye(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function E(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=Ye(i?.props?.anchor);if(!a)continue;let u=B(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function ye(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function I(e,n,t){if(!e)return"page";if(ge(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(ye(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function Pe(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:E(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:_(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:he(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=T(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>I(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>I(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}function G(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function be(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function Se(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function ke(e){return je(e,"filter")}var He="collection";function Y(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":He},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function je(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ze(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xe(e,n){let t=e?.[n];return Ze(t)?t:null}function we(e,n,t,r){if(t==null&&r==null)return!0;let i=xe(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Ve={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},It=Object.keys(Ve);var Le=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Qe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Xe={diameters:"tyreSizes"};function Je(e){if(e.length===0)return[];let n=Le.filter(t=>e.every(r=>Qe[t].includes(r)));return n.filter(t=>{let r=Xe[t];return!r||!n.includes(r)})}function en(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Fe={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function nn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of Le){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Te(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!we(re(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!ie(e))}var tn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Te(e,n){switch(n){case"tyreSizes":return[...new Set(pe(e).flatMap(ne))];case"brands":return U(e)?[U(e)]:[];case"finishes":return le(e);case"diameters":return oe(e).map(String);case"collections":return se(e);case"pcds":return ae(e);case"tyreTypes":return ue(e);case"speedRatings":return ce(e)}}function rn(e){let n=new Map;for(let t of e)for(let r of z(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function _e(e,n,t,r=en(e),i=[]){let a=o=>ln(o,r,i),u=rn(e),p=Je(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,N=new Map,k=new Map;for(let d of e){let b=Te(d,o);for(let h of b)c.add(h);for(let h of new Set(b))k.set(h,(k.get(h)??0)+1);if(nn(d,n,t,o))for(let h of new Set(b))N.set(h,(N.get(h)??0)+1)}let ve=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:N.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let h=(k.get(b.value)??0)-(k.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:o,label:tn[o],options:ve}}).filter(o=>o.options.length>on),s=[];for(let o of p){let l=sn(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...Se(p,o=>o.key,s,"filterOrder")]}var on=1;function Ae(e){return e.showCollection===!1?["collections"]:[]}function ln(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>ke(G(t,r))(Y(e,r)))}function sn(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=be(G(t,i),"filter")(Y(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var q={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},H="type";var Re="AlloyWheelsListing";function Ee(e){return M(e.trim())}var C="/wheels",O="Products";function Ie(e,n){return n>1?`${O} \xB7 ${e}`:O}function j(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Re);if(t)return t.props??{}}return null}function K(...e){return j(...e)!==null}function Ce(e,n){let t=e.filter(r=>K(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var Z=[H,...Object.entries(q).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Oe(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function an(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ke(e){let n=new URLSearchParams(Oe(e).query);for(let t of Z){let r=n.get(t);if(r)return{param:t,value:r}}return null}function V(e,n){let{path:t,query:r,hash:i}=Oe(e),a=r.split("&").filter(u=>u&&!Z.includes(an(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function Ne(e,n){let t=V(e,null);return n.includes(t)?t:e}function un(e,n,t=[]){return I(e,n,{listingPaths:t,targetOf:r=>Ne(r,t)})}function cn(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var Me="Product type",pn="AUD";function Q(e,n){let t=n.listing??{},r=D(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Ae(t),u=_e(i,Fe,pn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:q[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:H,label:Me,values:p.map(s=>({value:s,label:L[s]}))}),u}function dn(e){return n=>{let t=Ce(n,{fallback:e.offersCommerce}),r=n.filter(i=>K(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&K(...p.docs)?{...u,label:Ie(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:O}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return Q(e.catalogue,{listing:a?j(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ke,withFilter:V}}}function fn(e){let n=dn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Pe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:A(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ee},filtersFor:t.filtersFor??(()=>null)}}function Zt(e,n){return Q(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,Z as LISTING_FILTER_PARAMS,O as LISTING_PAGE_LABEL,Me as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,cn as fieldUsageFromAdminRows,un as inferLinkKind,K as isProductListingPage,Ee as isSafeLink,T as linkKindsFor,fn as linkPickerSetup,Zt as listingFilterFields,j as listingNode,Ie as listingPageLabel,Ne as listingTarget,E as pageAnchors,P as pagePath,_ as postPath,Ce as productListingPaths,Ke as readListingFilter,A as wheelPath,V as withListingFilter};
|
|
@@ -1295,7 +1295,7 @@ body:has([data-page-width="full"]) footer {
|
|
|
1295
1295
|
phone / tablet / desktop split. A class names the tier, never a number:
|
|
1296
1296
|
`view-tablet:flex` is width ≥ 720, `max-view-tablet:flex` is width < 720, so
|
|
1297
1297
|
the two halves of a pair always meet. Hand-typed pairs did not: the header's
|
|
1298
|
-
`max-[800px]` / `min-[801px]` left exactly 800px —
|
|
1298
|
+
`max-[800px]` / `min-[801px]` left exactly 800px — The editor's Tablet view —
|
|
1299
1299
|
with no header at all (duplicate audit 2026-10-23, D01). CSS cannot import
|
|
1300
1300
|
the constants, so scripts/test-view-tier-breakpoints.ts fails if these two
|
|
1301
1301
|
lines and easel ever disagree. */
|
|
@@ -1521,7 +1521,7 @@ body:has([data-page-width="full"]) footer {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
|
-
/* Section height — the "Height" field on any
|
|
1524
|
+
/* Section height — the "Height" field on any the editor section (card 66215). The
|
|
1525
1525
|
injected pass wraps a section that sets one in this class and publishes the
|
|
1526
1526
|
length as a custom property; the property is what varies per section, so the
|
|
1527
1527
|
rule itself lives here once.
|
|
@@ -1550,7 +1550,7 @@ body:has([data-page-width="full"]) footer {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
|
-
/* Section anchors — the "Anchor" field on any
|
|
1553
|
+
/* Section anchors — the "Anchor" field on any the editor section. When set,
|
|
1554
1554
|
the section renders an invisible, zero-height <span id> as its first child
|
|
1555
1555
|
(see SectionAnchor in lib/document/config.tsx). `display:block; height:0` makes it
|
|
1556
1556
|
a real scroll target that adds no layout box; `scroll-margin-top` clears the
|
|
@@ -1564,7 +1564,7 @@ body:has([data-page-width="full"]) footer {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
|
|
1566
1566
|
/* Hero slider — never show the horizontal scroll-snap scrollbar. Covers the
|
|
1567
|
-
track itself AND any descendant, because in the page-builder
|
|
1567
|
+
track itself AND any descendant, because in the page-builder the editor wraps the
|
|
1568
1568
|
slot children, so the actual scroll container can be a nested element the
|
|
1569
1569
|
utility classes on `.hero-track` don't reach. */
|
|
1570
1570
|
.hero-track,
|
|
@@ -2016,7 +2016,7 @@ em.text-accent {
|
|
|
2016
2016
|
the design: the hero's height is the merchant's, a phone breaks every stored
|
|
2017
2017
|
coordinate, and "bottom left" means the same thing at any size.
|
|
2018
2018
|
|
|
2019
|
-
⚠️ WHY THIS IS A GRID AND NOT NINE ABSOLUTE CORNERS.
|
|
2019
|
+
⚠️ WHY THIS IS A GRID AND NOT NINE ABSOLUTE CORNERS. The editor engine 0.20 hands a slot's
|
|
2020
2020
|
children to ONE container as a flat list — there is no per-child wrapper — so
|
|
2021
2021
|
`HeroSlide` cannot sort its groups into nine corner boxes, and nine absolute
|
|
2022
2022
|
siblings cannot stack by content height without measuring in JS (which means
|
|
@@ -2074,13 +2074,13 @@ em.text-accent {
|
|
|
2074
2074
|
surface on top of the merchant's own heading. */
|
|
2075
2075
|
.sf-hero-group-layer-edit .sf-hero-group-zone { pointer-events: auto; }
|
|
2076
2076
|
|
|
2077
|
-
/*
|
|
2077
|
+
/* The editor's own drop zone, laid over the SAME rows as the copy beside it (card
|
|
2078
2078
|
66213). This is the one layer, and this element is what makes it one:
|
|
2079
2079
|
`subgrid` means a group's `--sf-hg-row` counts the layer's tracks, not a
|
|
2080
2080
|
private set of its own, so a group and the copy on one square STACK instead of
|
|
2081
2081
|
overlapping — which two stacked layers can never do.
|
|
2082
2082
|
|
|
2083
|
-
⚠️ A REAL BOX, DELIBERATELY, AND NOT `display: contents`.
|
|
2083
|
+
⚠️ A REAL BOX, DELIBERATELY, AND NOT `display: contents`. The editor measures this
|
|
2084
2084
|
element to decide where a drag lands; `display: contents` removes the box and
|
|
2085
2085
|
takes the measurement with it. Spanning every row costs nothing because the
|
|
2086
2086
|
zone is not a hit target (above) and its rows are the layer's own.
|
|
@@ -2230,7 +2230,7 @@ em.text-accent {
|
|
|
2230
2230
|
answer is asked where it is free. `lib/document/config.tsx`'s cell-width pass is
|
|
2231
2231
|
the same shape for the EDITOR half of a position question.
|
|
2232
2232
|
|
|
2233
|
-
⚠️ TWO SELECTORS, BECAUSE THE EDITOR ADDS A LAYER.
|
|
2233
|
+
⚠️ TWO SELECTORS, BECAUSE THE EDITOR ADDS A LAYER. The editor engine 0.20 wraps every slot
|
|
2234
2234
|
child in a drag element unless the component declares `inline`; the published
|
|
2235
2235
|
page has no wrapper (HeroGroup's own docblock carries that measurement, card
|
|
2236
2236
|
66290). So the first line is the page and the second is the canvas.
|
|
@@ -2621,13 +2621,13 @@ em.text-accent {
|
|
|
2621
2621
|
How many of a Grid row's positions ONE block takes.
|
|
2622
2622
|
|
|
2623
2623
|
⚠️ THE RULE IS WRITTEN TWICE ON PURPOSE, AND DELETING EITHER HALF BREAKS
|
|
2624
|
-
EXACTLY ONE OF THE TWO PLACES THIS RUNS.
|
|
2624
|
+
EXACTLY ONE OF THE TWO PLACES THIS RUNS. The editor engine 0.20 wraps every slot child in
|
|
2625
2625
|
a drag element of its own unless the component declares `inline`
|
|
2626
2626
|
(components/HeroGroup.tsx carries the measurement, card 66290). So:
|
|
2627
2627
|
|
|
2628
2628
|
published page .sf-grid-zone > [data-sf-span] the block itself is
|
|
2629
2629
|
the grid item
|
|
2630
|
-
editor canvas .sf-grid-zone > *:has(> [data-sf-span])
|
|
2630
|
+
editor canvas .sf-grid-zone > *:has(> [data-sf-span]) the editor's wrapper is
|
|
2631
2631
|
the grid item, and
|
|
2632
2632
|
the attribute is one
|
|
2633
2633
|
level inside it
|
|
@@ -2640,7 +2640,7 @@ em.text-accent {
|
|
|
2640
2640
|
the overlay rules in storefront-editor.css).
|
|
2641
2641
|
|
|
2642
2642
|
NOT `display: contents` on the wrapper, which is the other way to make the
|
|
2643
|
-
block the grid item:
|
|
2643
|
+
block the grid item: The editor MEASURES that element to place a drop and to draw
|
|
2644
2644
|
its selection overlay, and `display: contents` removes the box and takes the
|
|
2645
2645
|
measurement with it. The same warning is written out at .sf-hero-group-zone.
|
|
2646
2646
|
|
|
@@ -2720,7 +2720,7 @@ em.text-accent {
|
|
|
2720
2720
|
droppable into a Grid, and scripts/test-cell-stretch.ts holds that.
|
|
2721
2721
|
|
|
2722
2722
|
Still NOT `display: contents` on the wrapper — see the warning on the span
|
|
2723
|
-
rules above:
|
|
2723
|
+
rules above: The editor measures that element for drops and the outline. */
|
|
2724
2724
|
.sf-grid-zone > [data-easel-block] {
|
|
2725
2725
|
display: grid;
|
|
2726
2726
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -3011,6 +3011,34 @@ em.text-accent {
|
|
|
3011
3011
|
.sf-section-corners > .sf-ticker-join { border-radius: 0; overflow: visible; }
|
|
3012
3012
|
.sf-section-corners > .sf-ticker-join > * { border-radius: var(--sf-section-radius, 0); overflow: clip; }
|
|
3013
3013
|
|
|
3014
|
+
/* ── A padding's TABLET value (three-views plan 2026-10-23, PR 3a) ───────────
|
|
3015
|
+
The same split as the phone block below: the desktop padding is INLINE, and
|
|
3016
|
+
efficient-web-builder (lib/content/section-padding, `sectionPadAttrs`) adds
|
|
3017
|
+
`.sf-pad-<side>-tablet` and its variable only for a side whose tablet value
|
|
3018
|
+
is drawn (stored, or worked out by the page's rule version). A node with no
|
|
3019
|
+
tablet value carries no class, matches nothing here, and draws the bytes it
|
|
3020
|
+
drew before this block existed.
|
|
3021
|
+
|
|
3022
|
+
The widths are the Tablet view's: efficient-easel's VIEW_TABLET_MIN (720) up
|
|
3023
|
+
to, not including, VIEW_DESKTOP_MIN (1100) — the builder's
|
|
3024
|
+
lib/content/view-values `TABLET_MEDIA`, the same string. `!important` and no
|
|
3025
|
+
`var()` fallback, for the reasons the phone block gives.
|
|
3026
|
+
scripts/test-tablet-padding-css.ts holds all of it. */
|
|
3027
|
+
@media (min-width: 720px) and (max-width: 1099.98px) {
|
|
3028
|
+
.sf-pad-top-tablet {
|
|
3029
|
+
padding-top: var(--sf-pad-t-tablet) !important;
|
|
3030
|
+
}
|
|
3031
|
+
.sf-pad-bottom-tablet {
|
|
3032
|
+
padding-bottom: var(--sf-pad-b-tablet) !important;
|
|
3033
|
+
}
|
|
3034
|
+
.sf-pad-left-tablet {
|
|
3035
|
+
padding-left: var(--sf-pad-l-tablet) !important;
|
|
3036
|
+
}
|
|
3037
|
+
.sf-pad-right-tablet {
|
|
3038
|
+
padding-right: var(--sf-pad-r-tablet) !important;
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3014
3042
|
/* ── A section's phone padding ────────────────────────────────────────────────
|
|
3015
3043
|
The phone half of the override ruled by the owner on 2026-09-07: ONE value
|
|
3016
3044
|
used on both screens, and a setting MAY also carry a phone value. Set, the
|
|
@@ -3141,7 +3169,7 @@ em.text-accent {
|
|
|
3141
3169
|
|
|
3142
3170
|
ONE RULE FOR THE PAGE AND THE EDITOR'S CANVAS (GG 2026-10-23, the hartesmetal
|
|
3143
3171
|
Home name Box: apart on the canvas, on top of each other live). On the canvas
|
|
3144
|
-
two elements stand between the Box and each block:
|
|
3172
|
+
two elements stand between the Box and each block: The editor's item
|
|
3145
3173
|
(`[data-easel-block]`) and the builder's part host (`[data-sf-part-host]`,
|
|
3146
3174
|
`display: contents`). Each rule names both shapes of "the Box's blocks", so
|
|
3147
3175
|
the canvas reads THIS rule from this sheet and no copy of it can lag behind
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l,Fragment as b}from"react/jsx-runtime";import{ChatBubbleLeftRightIcon as f,ChatBubbleOvalLeftEllipsisIcon as m,ChatIcon as g,MegaphoneIcon as x,PhoneIcon as L,SparklesIcon as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l,Fragment as b}from"react/jsx-runtime";import{ChatBubbleLeftRightIcon as f,ChatBubbleOvalLeftEllipsisIcon as m,ChatIcon as g,MegaphoneIcon as x,PhoneIcon as L,SparklesIcon as I}from"efficient-shell/icons/efficient-glyphs";import{chatLauncherColor as C,chatLauncherIcon as _,chatLauncherPosition as v}from"efficient-web-builder/format/lib/content/chat-launcher";import{accentInk as w}from"efficient-web-builder/format/lib/theme";import{PHONE_MEDIA as y}from"efficient-web-builder/render/lib/content/view-values";const E={"chat-bubble-left-right":f,"chat-bubble-oval-left-ellipsis":m,chat:g,megaphone:x,phone:L,sparkles:I};function O(a){const t=C(a?.launcherColor)||"var(--btn)";return{"--assistant-launcher-bg":t,"--assistant-launcher-ink":t==="var(--btn)"?"var(--btn-ink)":w(t),"--assistant-launcher-bg-hover":`color-mix(in oklab, ${t} 85%, black)`}}function S(a){return a?.launcherLabel?.trim()??""}function P(a){return v(a?.launcherPosition)==="left"}const k={position:"fixed",bottom:16,minWidth:48,height:48,padding:0,display:"flex",alignItems:"center",border:0,borderRadius:9999,cursor:"pointer",background:"var(--assistant-launcher-bg)",color:"var(--assistant-launcher-ink)",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},N={width:48,height:48,flex:"none",display:"flex",alignItems:"center",justifyContent:"center"},j="[data-chat-launcher-label]{max-width:0;opacity:0;overflow:hidden;white-space:nowrap;font-size:14px;font-weight:500;line-height:1;transition:max-width 120ms ease-out,opacity 120ms ease-out,padding 120ms ease-out}[data-chat-launcher]:hover [data-chat-launcher-label],[data-chat-launcher]:focus-visible [data-chat-launcher-label]{max-width:16em;opacity:1;padding-inline-end:16px}@media (prefers-reduced-motion:reduce){[data-chat-launcher-label]{transition:none}}",H=`@media ${y}{[data-chat-launcher][data-hide-on-phones]{display:none!important}}`;function A({label:a,onOpen:t,onWarm:c,zIndex:d=1e3,badge:u,look:n}){const r=_(n?.launcherIcon),p=E[r],o=S(n),i=P(n),s=n?.showOnPhones===!1,h=(o?j:"")+(s?H:"");return l(b,{children:[h&&e("style",{children:h}),l("button",{type:"button","aria-label":a,onClick:t,onPointerEnter:c,onFocus:c,"data-sf-floating":"","data-chat-launcher":"","data-side":i?"left":"right","data-hide-on-phones":s?"":void 0,style:{...O(n),...k,...i?{left:16}:{right:16},zIndex:d},children:[e("span",{style:N,children:e(p,{size:22,"data-icon":r})}),o&&e("span",{"data-chat-launcher-label":"",children:o}),u]})]})}export{P as chatLauncherOnLeft,O as chatLauncherTokens,A as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ContactView } from "../lib/sections/messaging.js";
|
|
2
|
+
export declare const CONTACT_WORDS: {
|
|
3
|
+
call: (name: string) => string;
|
|
4
|
+
email: (name: string) => string;
|
|
5
|
+
};
|
|
6
|
+
interface ContactCardsProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
contacts: readonly ContactView[];
|
|
10
|
+
contained: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default function ContactCards({ title, description, contacts, contained }: ContactCardsProps): import("react").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a,jsxs as r}from"react/jsx-runtime";import x from"efficient-web-builder/render/components/BlockFrame";import{renderGold as f,renderHeadline as g,splitParagraphs as o}from"efficient-web-builder/render/components/goldPhrases";import N from"./CopyText.js";import t from"./QrCode.js";import{MESSAGING_ACTION as i,MESSAGING_WORDS as d}from"../lib/sections/messaging.js";const p={call:l=>l?`Call ${l}`:"Call",email:l=>l?`Email ${l}`:"Email"};function c({title:l,description:s,contacts:n,contained:h}){return n.length?a(x,{contained:h,className:"py-6",children:r("div",{className:"flex flex-col gap-6",children:[(l||s)&&r("div",{className:"flex max-w-[680px] flex-col gap-3",children:[l&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(l,!1)}),s&&o(s).map((e,m)=>a("p",{className:"text-[15px] leading-[1.6] opacity-85",children:f(e)},m))]}),a("ul",{className:"grid gap-3 sm:grid-cols-2 md:gap-4 lg:grid-cols-3","data-contact-cards":"",children:n.map((e,m)=>r("li",{className:"flex min-w-0 items-start justify-between gap-4 rounded-[var(--radius-card,12px)] border border-line p-4 md:p-5",children:[r("div",{className:"flex min-w-0 flex-col gap-1.5",children:[a("p",{className:"font-mono text-[12px] uppercase tracking-[0.14em] text-fg-dim",children:e.way}),e.name&&a("p",{className:"font-heading2 text-[18px] font-medium leading-tight",children:e.name}),a("p",{className:"break-all text-[15px] text-fg-dim",children:e.handle}),a("div",{className:"pt-1",children:e.kind==="phone"?a("a",{href:e.href,className:i,children:p.call(e.name)}):e.kind==="email"?a("a",{href:e.href,className:i,children:p.email(e.name)}):e.href?r("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:i,children:[d.open(e.way),r("span",{className:"sr-only",children:[" ",d.opensApp]})]}):a(N,{text:e.handle,className:i})})]}),e.qr&&a(t,{text:e.qr,label:d.qrLabel(e.way,e.handle),className:"aspect-square w-24 shrink-0 rounded-sm"})]},m))})]})}):null}export{p as CONTACT_WORDS,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as n,jsxs as a}from"react/jsx-runtime";import{useEffect as c,useState as l}from"react";import{MESSAGING_WORDS as i}from"../lib/sections/messaging.js";function u({text:t,className:r}){const[e,o]=l(!1);return c(()=>{if(!e)return;const s=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(s)},[e]),a("button",{type:"button",className:r,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>o(!0),()=>{})},children:[e?i.copied:i.copyId,n("span",{className:"sr-only","aria-live":"polite",children:e?` ${t}`:""})]})}export{u as default};
|
|
@@ -3,7 +3,10 @@ export type { EventPost };
|
|
|
3
3
|
export type EventCard = EventPost & {
|
|
4
4
|
href?: string;
|
|
5
5
|
facets?: CardFacets;
|
|
6
|
+
tags?: readonly string[];
|
|
6
7
|
};
|
|
8
|
+
export declare const MAX_CARD_TAGS = 4;
|
|
9
|
+
export declare function readTags(value: unknown): readonly string[] | undefined;
|
|
7
10
|
export type CardFacets = Readonly<Record<string, string | readonly string[]>>;
|
|
8
11
|
export declare function readFacets(value: unknown): CardFacets | undefined;
|
|
9
12
|
export declare function facetChoices(cards: readonly EventCard[]): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,jsxs as l}from"react/jsx-runtime";import{useId as xe,useState as K}from"react";import{containerGapProps as ge}from"efficient-web-builder/format/lib/content/container-gap";import ue from"efficient-web-builder/render/components/SectionHeader";import F from"efficient-web-builder/render/components/PostCard";import he from"efficient-web-builder/render/components/Placeholder";import{SiteLink as z}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as x,renderHeadline as v}from"efficient-web-builder/render/components/goldPhrases";import{say as N}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as be}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as G}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as ve}from"../lib/sections/fill-row.js";import{headIsEmpty as Ne,ownPadding as Ee}from"../lib/sections/own-padding.js";function tt(t){if(!t||typeof t!="object"||Array.isArray(t))return;const a={};for(const[e,s]of Object.entries(t))if(e.trim()){if(typeof s=="string")s.trim()&&(a[e]=s.trim());else if(Array.isArray(s)){const o=s.filter(c=>typeof c=="string"&&!!c.trim()).map(c=>c.trim());o.length&&(a[e]=o)}}return Object.keys(a).length?a:void 0}function H(t,a){const e=t.facets?.[a];return e===void 0?[]:typeof e=="string"?[e]:e}const ye=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Te(t){const a=[],e=new Map;for(const s of t)for(const o of Object.keys(s.facets??{})){e.has(o)||(a.push(o),e.set(o,new Set));for(const c of H(s,o))e.get(o).add(c)}return a.map(s=>({label:s,values:[...e.get(s)].sort(ye.compare)}))}function _e(t,a){return Object.entries(a).every(([e,s])=>s===""||H(t,e).includes(s))}const W=3,J="featured",X="tabs",q="portrait",u="spread",Q="count",nt=[{label:"Even grid",value:"even"},{label:"Featured first",value:J},{label:"Tabs",value:X},{label:"Photo cards",value:q},{label:"Staggered spread",value:u},{label:"Count",value:Q}],Ae=[q,u],at="even",k={min:2,max:11,step:1,fallback:7,unit:"of 12"},Le="bottom-left",Ce=55,Oe="bottom";function Se(t){const a=typeof t=="number"?t:Number.parseFloat(String(t??"")),e=Number.isFinite(a)?Math.min(k.max,Math.max(k.min,Math.round(a))):k.fallback;return`${e}fr ${12-e}fr`}const Z={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1"},ee={2:"grid-cols-2",3:"grid-cols-3 max-[800px]:grid-cols-2",4:"grid-cols-4 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-2"},$e="Find by name",we="Nobody by that name.",Fe="Nobody matches.",ze="Any";function ke(t,a){const e=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),s=e(a);return s===""||e(t).includes(s)}function te({typed:t,onType:a,wide:e=!1}){return l("label",{className:`flex max-w-[360px] flex-col gap-1.5${e?" w-full":""}`,children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:$e}),n("input",{type:"search",value:t,onChange:s=>a(s.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function Re({card:t,scaffold:a,lower:e=!1}){return l(z,{href:t.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${e?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[n("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:n(he,{label:`card-${t.slug}`,src:t.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),n("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),t.meta&&n("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:x(t.meta)}),l("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-[800px]:p-3",children:[n("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:v(t.title,!1)}),t.dateLabel&&n("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:x(t.dateLabel)}),t.excerpt&&n("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:x(t.excerpt)})]})]})}function Ie({cards:t,scaffold:a}){return n("nav",{"aria-label":"Days",className:"-mx-1 [scrollbar-width:none] max-[800px]:overflow-x-auto [&::-webkit-scrollbar]:hidden",children:n("ul",{className:"flex flex-wrap gap-2 px-1 pb-1 max-[800px]:min-w-max max-[800px]:flex-nowrap",children:t.map((e,s)=>{const o=!!e.meta;return n("li",{children:l(z,{href:e.href||"#","aria-current":o?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${o?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`,children:[n("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:v(e.title,!1)}),e.excerpt&&n("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:x(e.excerpt)})]})},`${e.slug}-${s}`)})})})}function Ue({count:t,words:a,href:e}){const s=l("span",{className:"inline-flex items-baseline gap-3",children:[n("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:t}),a!==void 0&&n("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return e?n(z,{href:e,className:"inline-flex hover:opacity-85",children:s}):s}const Me="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",De="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",Pe="relative z-[2] bg-bg py-[32px] max-[800px]:py-[24px]";function je({num:t,title:a,link:e,posts:s,columns:o,limit:c,showAll:E=!1,editing:y=!1,cardImage:ne,gap:ae,layout:f,featuredWidth:se,listCover:re=!0,featuredDarken:oe,omitHead:h=!1,sample:T,nameFilter:le=!1,padTop:ce,padBottom:ie}){const[_,R]=K(""),[I,de]=K({}),A=`ev-${xe().replace(/:/g,"")}`,U=s??[],M=E?U.length:typeof c=="number"&&c>0?c:W,L=U.slice(0,M),m=y&&L.length===0;if(L.length===0&&!y)return null;const D=E?W:M,i=m?T?.length?T.slice(0,E?T.length:D):Array.from({length:D},(r,d)=>({slug:`placeholder-${d}`,title:N("Blog post title"),excerpt:N("A short summary of the post appears here."),cover:"",meta:N("Journal"),dateLabel:N("Date")})):L,p=ge("Events",ae,"both"),C=f===J&&i.length>1,pe=Se(se),O=f===X,P=f===Q,j=Ae.includes(f??""),S=le&&!O&&!P&&!C,$=S?Te(i):[],b=S?i.filter(r=>ke(r.title,_)&&_e(r,I)):i,w=Ee(ce,ie),fe=!y&&Ne(t,a,e?.text),V=f===u?"grid-cols-3 max-[800px]:grid-cols-2":ee[Math.min(4,Math.max(2,o??3))]??ee[3],Y=Z[Math.min(4,Math.max(1,o??3))]??Z[3],B=O||C||f===u?"":ve(A,j?V:Y,{cards:b.length});return P?n("section",{className:Pe,style:Object.keys(w).length?w:void 0,children:n("div",{className:G,children:n(Ue,{count:i.length,words:h||a===void 0?void 0:v(a,!1),href:h?void 0:e?.href})})}):n("section",{className:h?De:Me,style:{...be(ne),...w},children:l("div",{className:G,children:[h||fe?null:n(ue,{num:t!==void 0?x(t):void 0,title:a!==void 0?v(a,!1):void 0,link:e?{text:x(e.text),href:e.href}:void 0}),S&&l("div",{className:"mb-6 flex flex-col gap-2",children:[$.length===0?n(te,{typed:_,onType:R}):l("div",{className:"flex flex-wrap items-end gap-3",children:[n(te,{typed:_,onType:R,wide:!0}),$.map(({label:r,values:d})=>l("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-[800px]:flex-1",children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:r}),l("select",{value:I[r]??"",onChange:g=>de(me=>({...me,[r]:g.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[n("option",{value:"",children:ze}),d.map(g=>n("option",{value:g,children:g},g))]})]},r))]}),b.length===0&&n("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:$.length===0?we:Fe})]}),B&&n("style",{children:B}),O?n(Ie,{cards:i,scaffold:m}):j?n("div",{className:`${A} sf-card-grid grid${p.className} ${V}`,style:p.style,children:b.map((r,d)=>n(Re,{card:r,scaffold:m,lower:f===u&&d%3===1},`${r.slug}-${d}`))}):C?l("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-[800px]:grid-cols-1${p.className}`,style:{...p.style,"--sf-events-split":pe},children:[n(F,{post:i[0],href:i[0].href,scaffold:m,layout:"cover",darken:oe??Ce,darkenStyle:Oe,placement:Le},`${i[0].slug}-0`),n("div",{className:`grid auto-rows-min${p.className}`,style:p.style,children:i.slice(1).map((r,d)=>n(F,{post:r,href:r.href,scaffold:m,showCover:re},`${r.slug}-${d+1}`))})]}):n("div",{className:`${A} sf-card-grid grid${p.className} ${Y}`,style:p.style,children:b.map((r,d)=>n(F,{post:r,href:r.href,scaffold:m},`${r.slug}-${d}`))})]})})}export{k as EVENTS_FEATURED_WIDTH,nt as EVENTS_LAYOUTS,Q as EVENTS_LAYOUT_COUNT,at as EVENTS_LAYOUT_FALLBACK,J as EVENTS_LAYOUT_FEATURED,q as EVENTS_LAYOUT_PORTRAIT,u as EVENTS_LAYOUT_SPREAD,X as EVENTS_LAYOUT_TABS,Ae as EVENTS_PHOTO_LAYOUTS,je as default,Te as facetChoices,_e as matchesFacets,ke as matchesName,tt as readFacets};
|
|
1
|
+
import{jsx as n,jsxs as o}from"react/jsx-runtime";import{useId as ge,useState as G}from"react";import{containerGapProps as ue}from"efficient-web-builder/format/lib/content/container-gap";import he from"efficient-web-builder/render/components/SectionHeader";import v from"efficient-web-builder/render/components/PostCard";import be from"efficient-web-builder/render/components/Placeholder";import{SiteLink as z}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as x,renderHeadline as N}from"efficient-web-builder/render/components/goldPhrases";import{say as y}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as ve}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as K}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as Ne}from"../lib/sections/fill-row.js";import{headIsEmpty as ye,ownPadding as Ee}from"../lib/sections/own-padding.js";const Te=4;function at(t){if(!Array.isArray(t))return;const a=t.filter(e=>typeof e=="string"&&!!e.trim()).map(e=>e.trim()).slice(0,Te);return a.length?a:void 0}function rt(t){if(!t||typeof t!="object"||Array.isArray(t))return;const a={};for(const[e,r]of Object.entries(t))if(e.trim()){if(typeof r=="string")r.trim()&&(a[e]=r.trim());else if(Array.isArray(r)){const l=r.filter(c=>typeof c=="string"&&!!c.trim()).map(c=>c.trim());l.length&&(a[e]=l)}}return Object.keys(a).length?a:void 0}function H(t,a){const e=t.facets?.[a];return e===void 0?[]:typeof e=="string"?[e]:e}const Ae=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function _e(t){const a=[],e=new Map;for(const r of t)for(const l of Object.keys(r.facets??{})){e.has(l)||(a.push(l),e.set(l,new Set));for(const c of H(r,l))e.get(l).add(c)}return a.map(r=>({label:r,values:[...e.get(r)].sort(Ae.compare)}))}function Le(t,a){return Object.entries(a).every(([e,r])=>r===""||H(t,e).includes(r))}const W=3,X="featured",J="tabs",q="portrait",u="spread",Q="count",st=[{label:"Even grid",value:"even"},{label:"Featured first",value:X},{label:"Tabs",value:J},{label:"Photo cards",value:q},{label:"Staggered spread",value:u},{label:"Count",value:Q}],Ce=[q,u],lt="even",k={min:2,max:11,step:1,fallback:7,unit:"of 12"},$e="bottom-left",Oe=55,Se="bottom";function we(t){const a=typeof t=="number"?t:Number.parseFloat(String(t??"")),e=Number.isFinite(a)?Math.min(k.max,Math.max(k.min,Math.round(a))):k.fallback;return`${e}fr ${12-e}fr`}const Z={1:"grid-cols-1",2:"grid-cols-2 max-[800px]:grid-cols-1",3:"grid-cols-3 max-[800px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[800px]:grid-cols-1"},ee={2:"grid-cols-2",3:"grid-cols-3 max-[800px]:grid-cols-2",4:"grid-cols-4 max-[1100px]:grid-cols-3 max-[800px]:grid-cols-2"},Fe="Find by name",ze="Nobody by that name.",ke="Nobody matches.",Re="Any";function Ie(t,a){const e=l=>l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=e(a);return r===""||e(t).includes(r)}function te({typed:t,onType:a,wide:e=!1}){return o("label",{className:`flex max-w-[360px] flex-col gap-1.5${e?" w-full":""}`,children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:Fe}),n("input",{type:"search",value:t,onChange:r=>a(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function ne({tags:t}){return n("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:t.map((a,e)=>n("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:a},`${a}-${e}`))})}function Me({card:t,scaffold:a,lower:e=!1}){return o(z,{href:t.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${e?" min-[801px]:mt-16":""}`,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,children:[n("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:n(be,{label:`card-${t.slug}`,src:t.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),n("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),t.meta&&n("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:x(t.meta)}),o("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-[800px]:p-3",children:[n("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:N(t.title,!1)}),t.dateLabel&&n("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:x(t.dateLabel)}),t.tags&&t.tags.length>0&&n(ne,{tags:t.tags}),t.excerpt&&n("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:x(t.excerpt)})]})]})}function Ue({cards:t,scaffold:a}){return n("nav",{"aria-label":"Days",className:"-mx-1 [scrollbar-width:none] max-[800px]:overflow-x-auto [&::-webkit-scrollbar]:hidden",children:n("ul",{className:"flex flex-wrap gap-2 px-1 pb-1 max-[800px]:min-w-max max-[800px]:flex-nowrap",children:t.map((e,r)=>{const l=!!e.meta;return n("li",{children:o(z,{href:e.href||"#","aria-current":l?"page":void 0,"aria-disabled":a||void 0,tabIndex:a?-1:void 0,className:`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${l?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`,children:[n("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:N(e.title,!1)}),e.excerpt&&n("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${l?"opacity-80":"text-fg-dim"}`,children:x(e.excerpt)})]})},`${e.slug}-${r}`)})})})}function De({count:t,words:a,href:e}){const r=o("span",{className:"inline-flex items-baseline gap-3",children:[n("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:t}),a!==void 0&&n("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:a})]});return e?n(z,{href:e,className:"inline-flex hover:opacity-85",children:r}):r}const Pe="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",je="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",Ve="relative z-[2] bg-bg py-[32px] max-[800px]:py-[24px]";function Ye({num:t,title:a,link:e,posts:r,columns:l,limit:c,showAll:E=!1,editing:T=!1,cardImage:ae,gap:re,layout:f,featuredWidth:se,listCover:le=!0,featuredDarken:oe,omitHead:h=!1,sample:A,nameFilter:ie=!1,padTop:ce,padBottom:de}){const[_,R]=G(""),[I,pe]=G({}),L=`ev-${ge().replace(/:/g,"")}`,M=r??[],U=E?M.length:typeof c=="number"&&c>0?c:W,C=M.slice(0,U),m=T&&C.length===0;if(C.length===0&&!T)return null;const D=E?W:U,d=m?A?.length?A.slice(0,E?A.length:D):Array.from({length:D},(s,i)=>({slug:`placeholder-${i}`,title:y("Blog post title"),excerpt:y("A short summary of the post appears here."),cover:"",meta:y("Journal"),dateLabel:y("Date")})):C,p=ue("Events",re,"both"),$=f===X&&d.length>1,fe=we(se),O=f===J,P=f===Q,j=Ce.includes(f??""),S=ie&&!O&&!P&&!$,w=S?_e(d):[],b=S?d.filter(s=>Ie(s.title,_)&&Le(s,I)):d,F=Ee(ce,de),me=!T&&ye(t,a,e?.text),V=f===u?"grid-cols-3 max-[800px]:grid-cols-2":ee[Math.min(4,Math.max(2,l??3))]??ee[3],Y=Z[Math.min(4,Math.max(1,l??3))]??Z[3],B=O||$||f===u?"":Ne(L,j?V:Y,{cards:b.length});return P?n("section",{className:Ve,style:Object.keys(F).length?F:void 0,children:n("div",{className:K,children:n(De,{count:d.length,words:h||a===void 0?void 0:N(a,!1),href:h?void 0:e?.href})})}):n("section",{className:h?je:Pe,style:{...ve(ae),...F},children:o("div",{className:K,children:[h||me?null:n(he,{num:t!==void 0?x(t):void 0,title:a!==void 0?N(a,!1):void 0,link:e?{text:x(e.text),href:e.href}:void 0}),S&&o("div",{className:"mb-6 flex flex-col gap-2",children:[w.length===0?n(te,{typed:_,onType:R}):o("div",{className:"flex flex-wrap items-end gap-3",children:[n(te,{typed:_,onType:R,wide:!0}),w.map(({label:s,values:i})=>o("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-[800px]:flex-1",children:[n("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:s}),o("select",{value:I[s]??"",onChange:g=>pe(xe=>({...xe,[s]:g.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[n("option",{value:"",children:Re}),i.map(g=>n("option",{value:g,children:g},g))]})]},s))]}),b.length===0&&n("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:w.length===0?ze:ke})]}),B&&n("style",{children:B}),O?n(Ue,{cards:d,scaffold:m}):j?n("div",{className:`${L} sf-card-grid grid${p.className} ${V}`,style:p.style,children:b.map((s,i)=>n(Me,{card:s,scaffold:m,lower:f===u&&i%3===1},`${s.slug}-${i}`))}):$?o("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-[800px]:grid-cols-1${p.className}`,style:{...p.style,"--sf-events-split":fe},children:[n(v,{post:d[0],href:d[0].href,scaffold:m,layout:"cover",darken:oe??Oe,darkenStyle:Se,placement:$e},`${d[0].slug}-0`),n("div",{className:`grid auto-rows-min${p.className}`,style:p.style,children:d.slice(1).map((s,i)=>n(v,{post:s,href:s.href,scaffold:m,showCover:le},`${s.slug}-${i+1}`))})]}):n("div",{className:`${L} sf-card-grid grid${p.className} ${Y}`,style:p.style,children:b.map((s,i)=>s.tags&&s.tags.length>0?o("div",{className:"flex flex-col gap-2",children:[n(v,{post:s,href:s.href,scaffold:m}),n(ne,{tags:s.tags})]},`${s.slug}-${i}`):n(v,{post:s,href:s.href,scaffold:m},`${s.slug}-${i}`))})]})})}export{k as EVENTS_FEATURED_WIDTH,st as EVENTS_LAYOUTS,Q as EVENTS_LAYOUT_COUNT,lt as EVENTS_LAYOUT_FALLBACK,X as EVENTS_LAYOUT_FEATURED,q as EVENTS_LAYOUT_PORTRAIT,u as EVENTS_LAYOUT_SPREAD,J as EVENTS_LAYOUT_TABS,Ce as EVENTS_PHOTO_LAYOUTS,Te as MAX_CARD_TAGS,Ye as default,_e as facetChoices,Le as matchesFacets,Ie as matchesName,rt as readFacets,at as readTags};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r,jsxs as a}from"react/jsx-runtime";import m from"./QrCode.js";import{MESSAGING_WORDS as o}from"../lib/sections/messaging.js";function d({heading:l,channels:t}){const s=t.filter(e=>e.qr),p=t.filter(e=>!e.qr&&e.handle);return!s.length&&!p.length?null:a("div",{className:"flex flex-col gap-2.5 text-[13px]","data-footer-messaging":"",children:[l&&r("p",{children:l}),s.length>0&&r("ul",{className:"flex flex-wrap gap-x-4 gap-y-3","aria-label":l||void 0,children:s.map(e=>a("li",{className:"flex w-[72px] flex-col items-center gap-1.5 md:w-[88px]",children:[r(m,{text:e.qr,label:o.qrLabel(e.name,e.handle),className:"aspect-square w-full rounded-sm"}),e.href?a("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-[12px] underline underline-offset-4",children:[e.name,a("span",{className:"sr-only",children:[" ",o.opensApp]})]}):r("span",{className:"text-[12px]",children:e.name})]},e.app))}),p.map(e=>a("p",{children:[e.name," ID ",r("span",{className:"break-all",children:e.handle})]},e.app))]})}export{d as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PaymentMethodLike } from "efficient-shell/icons/payment";
|
|
2
|
+
export type FooterPaymentSize = "sm" | "md";
|
|
3
|
+
export type FooterPaymentAlign = "start" | "center" | "end";
|
|
4
|
+
export interface FooterPaymentProps {
|
|
5
|
+
lead?: string;
|
|
6
|
+
methods: readonly PaymentMethodLike[];
|
|
7
|
+
size?: FooterPaymentSize;
|
|
8
|
+
align?: FooterPaymentAlign;
|
|
9
|
+
editing?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default function FooterPayment({ lead, methods, size, align, editing }: FooterPaymentProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as c}from"react/jsx-runtime";import{PaymentMark as y,paymentMarks as u}from"efficient-shell/icons/payment";import{say as r}from"efficient-web-builder/format/lib/editor-words";const s={sm:{mark:16,text:"text-[12px]"},md:{mark:20,text:"text-[13px]"}},n={start:"justify-start",center:"justify-center",end:"justify-end"};function h({lead:t,methods:i,size:m="sm",align:d="start",editing:l=!1}){const a=u(i);if(!a.length)return l?e("div",{"data-payment-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:r("Add the ways you take payment")}):null;const{mark:x,text:o}=s[m]??s.sm;return c("div",{"data-footer-payment":"",className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 leading-[1.5] text-fg-dim ${o} ${n[d]??n.start}`,children:[t&&e("span",{"aria-hidden":!0,children:t}),e("ul",{"aria-label":t||r("Ways to pay"),className:"flex list-none flex-wrap items-center gap-x-3 gap-y-1.5 p-0 text-fg",children:a.map((p,f)=>e("li",{className:"flex",children:e(y,{item:p,size:x})},f))})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as
|
|
1
|
+
"use client";import{jsx as r,jsxs as n,Fragment as m}from"react/jsx-runtime";import{createContext as G,useCallback as M,useContext as Y,useEffect as W,useRef as B,useState as L}from"react";import S from"next/link";import{slugify as D}from"efficient-shell/format";import F from"./GalleryCard.js";import V,{LightboxClose as q}from"./Lightbox.js";import{useSiteSells as U}from"./SiteRecordContext.js";import{renderGold as d,renderHeadline as $}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as Z}from"efficient-web-builder/format/lib/sized-image";const J="(max-width: 1100px) 100vw, min(59vw, 1050px)",K=G({}),fe=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Q="data-gallery-grid",C="data-gallery-tile";function X(t,o){const[l,s]=L(null);return W(()=>{const c=t.current,a=c?.closest(`[${Q}]`);if(!c||!a)return;const u=()=>{const v=Array.from(a.querySelectorAll(`[${C}]`)),y=v.indexOf(c),x=y>=0?{index:y+1,total:v.length}:null;s(h=>h?.index===x?.index&&h?.total===x?.total?h:x)};if(u(),!o)return;const b=new MutationObserver(u);return b.observe(a,{childList:!0,subtree:!0}),()=>b.disconnect()},[t,o]),l}const ge={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},ee=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),ue=Array.from({length:6},ee);function te(t){const o=(t.photos??[]).map(a=>a?.src).filter(a=>!!a),l=t.image||o[0]||"",s=[l,...o].filter(a=>!!a),c=D(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:l||void 0,detailSrc:o[0]||l||void 0,photos:s,href:t.href}}function re({editing:t=!1,previewHover:o,ratio:l,captionPlace:s,...c}){const{galleryHref:a="/gallery",submitHref:u="/contact",previewHover:b,display:v,displayPhone:y,styleOwner:x,photosOnly:h=!1}=Y(K),e=te(c),f=U()&&!h,P=!f&&!oe(e),i=e.photos??(e.imageSrc?[e.imageSrc]:[]),_=B(null),z=M(p=>{_.current=p},[]),j=X(_,t),H=t&&(!!o||!!b),[I,g]=L(!1),[w,N]=L(0),E=()=>N(p=>(p-1+i.length)%i.length),T=()=>N(p=>(p+1)%i.length),k=i[w]??e.imageSrc??"",O=r(F,{build:e,forceHover:H,index:j?.index,total:j?.total,ratio:l,captionPlace:s,display:v,displayPhone:y,styleOwner:x,editing:t});return n(m,{children:[t?r("div",{ref:z,[C]:"",className:"block w-full text-left",children:O}):r("button",{ref:z,[C]:"",type:"button","aria-label":f?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:R(e),onClick:()=>{N(0),g(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:O}),r(V,{open:I,onClose:()=>g(!1),label:f?`${e.car} on ${e.wheel}`:R(e),onPrev:i.length>1?E:void 0,onNext:i.length>1?T:void 0,className:"flex items-center justify-center p-6 backdrop-blur-[8px] max-[700px]:p-3",style:{background:"color-mix(in oklab, var(--bg) 78%, transparent)"},children:n("div",{onClick:p=>p.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${P?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-[1100px]:grid-cols-1 max-[1100px]:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(q,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:"color-mix(in oklab, var(--bg) 70%, transparent)"},children:"✕"}),n("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-[1100px]:min-h-[450px]",children:[k&&r("img",{...Z(k,{fallbackWidth:1280}),sizes:J,alt:`${(f?e.car:e.wheel||e.car)||"Photo"} — ${w+1} of ${i.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},k),i.length>1&&n(m,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:E,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:T,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),n("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[w+1," / ",i.length]})]})]}),f?n("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:d(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:$(e.wheel,!1)}),e.car&&n("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:d(e.car,!0)})]}),n("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:d(e.wheel)})]}),e.process&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:d(e.process)})]}),e.finish&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:d(e.finish)})]}),e.car&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:d(e.car)})]})]}),n("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[n(S,{href:e.href||"/wheels",onClick:()=>g(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),n(S,{href:a,onClick:()=>g(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),n(S,{href:u,onClick:()=>g(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!P&&r(ne,{build:e})]})})]})}function A(t){return[t.process,t.car,t.finish].filter((o,l,s)=>!!o&&o!==t.wheel&&s.indexOf(o)===l)}function oe(t){return!!t.wheel||A(t).length>0}function R(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function ne({build:t}){const o=t.wheel,l=A(t);return n("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-[1100px]:px-9 max-[1100px]:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:$(o,!1)}),l.map(s=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:d(s)},s))]})}export{Q as GALLERY_GRID_ATTR,ge as GALLERY_ITEM_HINTS,ue as GALLERY_ITEM_SEEDS,C as GALLERY_TILE_ATTR,fe as GALLERY_TILE_PARTS,K as GalleryLinksContext,re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as r,Fragment as N}from"react/jsx-runtime";import $e from"next/link";import{useMemo as W,useState as w}from"react";import{stripMarkup as F}from"efficient-web-builder/format/lib/markup";import{renderChrome as k,renderGold as i,renderHeadline as Ce}from"efficient-web-builder/render/components/goldPhrases";import T from"efficient-web-builder/render/components/Placeholder";import je,{LightboxClose as ze}from"./Lightbox.js";import Se from"./ThemedSelect.js";import{say as $}from"efficient-web-builder/format/lib/editor-words";const n={bodyUpTo720:"max-[720px]:text-[length:var(--size-body,15px)]",labelUpTo720:"max-[720px]:text-[length:var(--size-label,11px)]",body:"text-[length:var(--size-body,17px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"};function G(m,d){return(m??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||d}function Y(m){const d=[m.image,...(m.photos??[]).map(u=>u?.src)].filter(u=>!!u);return d.length?d:[""]}const O=6,Le=()=>Array.from({length:O},(m,d)=>({image:"",process:$("Tag"),eyebrow:$("Category"),name:$("Item name"),meta:$("{n} photos",{n:`0${d+1}`})}));function _e({mode:m="both",kicker:d,breadcrumbLabel:u,vehicleTabLabel:X="Gallery A",vehicleTitle:ee,vehicleBody1:te,vehicleBody2:ae,vehicleStats:re,vehicleCards:B,wheelTabLabel:U="Gallery B",wheelTitle:ne,wheelBody1:le,wheelBody2:se,wheelStats:oe,wheelCards:E,othersTitle:ie,othersBody1:ce,othersBody2:pe,othersStats:me,othersCards:de,showBreadcrumb:xe=!0,showStats:ge=!0,showIntro:ue=!0,showTabs:fe=!0,showFilters:H=!0,showCount:M=!0,showSort:I=!0,previewTab:C,previewHover:he=!1,editing:b=!1}){const j=m==="both",v=j?["vehicles","wheels"]:m==="wheels"?["wheels"]:m==="others"?["others"]:["vehicles"],[Z,be]=w(v[0]),y=(b&&j&&C&&v.includes(C)?C:null)??(v.includes(Z)?Z:v[0]),ve=b&&he,[z,D]=w("all"),[S,ye]=w("newest"),[L,h]=w(null),l=y==="vehicles"?{title:ee,body1:te,body2:ae,stats:re??[],cards:B??[],unit:"items",word:X}:y==="others"?{title:ie,body1:ce,body2:pe,stats:me??[],cards:de??[],unit:"items",word:"Others"}:{title:ne,body1:le,body2:se,stats:oe??[],cards:E??[],unit:"items",word:U},V=W(()=>{const e=[];for(const a of l.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[l.cards]),_=z!=="all"&&V.includes(z)?z:"all",q=_==="all"?l.cards:l.cards.filter(e=>e.process===_),J=W(()=>{const e=[...q];return S==="name"&&e.sort((a,o)=>(a.name??"").localeCompare(o.name??"")),e},[q,S]),K=l.cards.length===0,A=b&&K,P=A?Le():J,Ne=A?O:l.cards.length,we=A?O:J.length,Q=d?`${d} · ${F(l.word)}`:void 0;function ke(e){e!==y&&(be(e),D("all"))}return r("section",{className:"relative z-[2] bg-bg",children:[xe&&r("nav",{className:`mx-auto flex max-w-[var(--sf-site-width,1600px)] items-center gap-4 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-4`,children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:u?k(u):"Gallery"})]}),r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-end gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] pt-[100px] pb-[60px] max-[1100px]:grid-cols-1 max-[1100px]:gap-5 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-[60px]",children:[t("span",{className:`pb-4 font-mono ${n.labelXl} uppercase tracking-[0.3em] text-accent`,children:Q?i(Q):null}),t("h2",{className:"font-display text-[length:min(var(--size-headingLarge,clamp(64px,9vw,140px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.9] tracking-[-0.04em]",children:l.title?Ce(l.title,!0):null}),t("div",{className:`pb-4 text-right font-mono ${n.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-[1100px]:text-left`,children:ge&&l.stats.map((e,a)=>r("div",{children:[e.value?t("strong",{className:"font-normal text-fg",children:i(e.value)}):null," ",e.label?i(e.label):null]},a))})]}),ue&&(l.body1||l.body2)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 gap-[60px] px-[var(--sf-site-gutter,40px)] pt-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-4 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[l.body1&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body1)}),l.body2&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body2)})]}),j&&fe&&t("div",{className:"mx-auto mt-10 flex max-w-[var(--sf-site-width,1600px)] items-stretch border-y border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-3",children:["vehicles","wheels"].map((e,a)=>{const o=y===e,c=e==="vehicles"?X:U,f=e==="vehicles"?(B??[]).length:(E??[]).length,p=(c||"").trim().split(/\s+/),x=p.slice(0,-1).join(" "),s=p.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>ke(e),className:["group relative grid flex-1 cursor-pointer grid-cols-[auto_1fr_auto] items-end gap-5 px-6 py-8 text-left transition-colors",a===0?"border-r border-line":"","max-[720px]:grid-cols-[auto_1fr] max-[720px]:items-center max-[720px]:gap-2 max-[720px]:px-3 max-[720px]:py-3",o?"bg-surface":"hover:bg-fg/[0.04]"].join(" "),children:[t("span",{className:[`pb-2 font-mono ${n.labelLarge} tracking-[0.3em] max-[720px]:pb-0 ${n.labelUpTo720} max-[720px]:tracking-[0.24em]`,o?"text-accent":"text-fg-dim group-hover:text-accent"].join(" "),children:a===0?"A":"B"}),r("span",{className:`font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.6vw,48px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] ${n.bodyUpTo720}`,children:[x?r(N,{children:[k(x)," "]}):null,t("em",{className:"font-normal italic text-accent",children:k(s)})]}),r("span",{className:`pb-2 text-right font-mono ${n.labelSmall} uppercase leading-[1.7] tracking-[0.24em] text-fg-dim max-[720px]:hidden`,children:[t("strong",{className:"font-normal text-fg",children:f})," ","items",t("br",{}),e==="vehicles"?"Community photos":"Featured photos"]}),o&&t("span",{className:"pointer-events-none absolute inset-x-0 -bottom-px h-0.5 bg-accent"})]},e)})}),(H||M||I)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-5 max-[720px]:grid-cols-1 max-[720px]:gap-4 max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-3",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:H&&["all",...V].map(e=>{const a=_===e,o=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>D(e),className:[`cursor-pointer border px-4 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.2em] transition-colors`,a?"border-fg bg-fg text-bg":"border-transparent text-fg-dim hover:text-fg"].join(" "),children:k(o)},e)})}),M?r("div",{className:`text-center font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[t("strong",{className:"font-normal text-accent",children:we})," / ",Ne," ",l.unit]}):t("div",{}),I?r("div",{className:`flex items-center gap-3 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:[t("span",{children:"Sort"}),r(Se,{value:S,onChange:e=>ye(e.target.value),className:`cursor-pointer border border-line bg-bg px-3 py-2 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg`,children:[t("option",{value:"newest",children:"Newest"}),t("option",{value:"featured",children:"Featured"}),t("option",{value:"name",children:"Name A–Z"})]})]}):t("div",{})]}),t("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-5 pb-20 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:P.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",children:P.map((e,a)=>{const o=Y(e)[0],f=`group relative block aspect-[4/3] w-full overflow-hidden bg-surface-2 text-left ${a<2?"col-span-3 max-[1100px]:col-span-1":"col-span-2 max-[1100px]:col-span-1"}`,p=`${e.name??"card"}-${a}`,x=r(N,{children:[t(T,{label:G(e.name,`gallery-card-${a+1}`),src:o||void 0,alt:F(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ve?"scale-[1.04]":"group-hover:scale-[1.04]"}`}),r("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col justify-between p-6 max-[720px]:p-3",style:{background:"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)"},children:[r("div",{className:`flex items-start justify-between font-mono ${n.labelSmall} uppercase tracking-[0.24em]`,children:[e.process?t("span",{className:"text-accent",children:i(e.process)}):t("span",{}),r("span",{className:"text-overlay-fg/70",children:[String(a+1).padStart(2,"0")," / ",String(P.length).padStart(2,"0")]})]}),r("div",{className:"flex flex-col gap-2",children:[e.eyebrow&&t("div",{className:`font-mono ${n.labelSmall} uppercase tracking-[0.24em] text-accent`,children:i(e.eyebrow)}),e.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,clamp(22px,2.4vw,32px))] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg",children:i(e.name)}),e.meta&&t("div",{className:`flex flex-wrap gap-3 pt-1 font-mono ${n.labelXs} uppercase tracking-[0.2em] text-overlay-fg/70`,children:t("span",{children:i(e.meta)})})]})]})]});return b?t("div",{className:f,children:x},p):t("button",{type:"button",onClick:()=>h({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${f} cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2`,children:x},p)})}):t("div",{className:`py-20 text-center font-mono ${n.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:K?"No items in this gallery yet.":"No items match this filter."})}),L&&(()=>{const e=Y(L.card),{card:a,index:o}=L,c=e.length,f=e[o]??e[0]??"",p=s=>h(g=>g&&{...g,index:(g.index+s+c)%c}),x=[a.process,a.meta].filter(Boolean).join(" · ");return r(je,{open:!0,onClose:()=>h(null),label:a.name??"Gallery item",onPrev:c>1?()=>p(-1):void 0,onNext:c>1?()=>p(1):void 0,className:"flex cursor-zoom-out flex-col items-center justify-center bg-overlay-scrim/92 p-6 backdrop-blur-sm max-[720px]:p-3",children:[r("div",{className:"relative flex w-full flex-1 items-center justify-center",children:[t("div",{className:"relative h-full max-h-[72vh] w-full max-w-[92vw]",children:t(T,{label:G(a.name,"gallery-photo"),src:f||void 0,alt:F(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r(N,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:s=>{s.stopPropagation(),p(-1)},className:"absolute left-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:s=>{s.stopPropagation(),p(1)},className:"absolute right-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"})]})]}),r("div",{className:`mt-5 flex flex-col items-center gap-3 text-center font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,onClick:s=>s.stopPropagation(),children:[r("div",{className:"flex flex-col items-center gap-1",children:[a.name&&t("span",{className:"text-accent",children:i(a.name)}),a.eyebrow&&t("span",{children:i(a.eyebrow)}),r("span",{className:"text-fg-dim/70",children:[x?r(N,{children:[i(x)," · "]}):null,o+1," / ",c]})]}),a.href&&t($e,{href:a.href,onClick:()=>h(null),className:`cursor-pointer border border-btn bg-btn/[0.08] px-5 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.28em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:"View Product →"})]}),c>1&&t("div",{onClick:s=>s.stopPropagation(),className:"mt-5 flex max-w-[92vw] gap-2 overflow-x-auto pb-1",children:e.map((s,g)=>t("button",{type:"button","aria-label":`Photo ${g+1}`,onClick:()=>h(R=>R&&{...R,index:g}),className:["relative h-16 w-24 shrink-0 cursor-pointer overflow-hidden border transition-colors max-[720px]:h-12 max-[720px]:w-16",g===o?"border-accent":"border-line opacity-60 hover:border-fg-dim hover:opacity-100"].join(" "),children:t(T,{label:G(a.name,"gallery-photo"),src:s||void 0,alt:"",sizes:"120px"})},`${s}-${g}`))}),t(ze,{})]})})()]})}export{_e as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as r,Fragment as N}from"react/jsx-runtime";import $e from"next/link";import{useMemo as W,useState as w}from"react";import{slugify as F}from"efficient-shell/format";import{stripMarkup as T}from"efficient-web-builder/format/lib/markup";import{renderChrome as k,renderGold as i,renderHeadline as Ce}from"efficient-web-builder/render/components/goldPhrases";import G from"efficient-web-builder/render/components/Placeholder";import je,{LightboxClose as Se}from"./Lightbox.js";import ze from"./ThemedSelect.js";import{say as $}from"efficient-web-builder/format/lib/editor-words";const n={bodyUpTo720:"max-[720px]:text-[length:var(--size-body,15px)]",labelUpTo720:"max-[720px]:text-[length:var(--size-label,11px)]",body:"text-[length:var(--size-body,17px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"};function Y(x){const g=[x.image,...(x.photos??[]).map(u=>u?.src)].filter(u=>!!u);return g.length?g:[""]}const O=6,Le=()=>Array.from({length:O},(x,g)=>({image:"",process:$("Tag"),eyebrow:$("Category"),name:$("Item name"),meta:$("{n} photos",{n:`0${g+1}`})}));function _e({mode:x="both",kicker:g,breadcrumbLabel:u,vehicleTabLabel:X="Gallery A",vehicleTitle:ee,vehicleBody1:te,vehicleBody2:ae,vehicleStats:re,vehicleCards:B,wheelTabLabel:U="Gallery B",wheelTitle:ne,wheelBody1:le,wheelBody2:se,wheelStats:oe,wheelCards:E,othersTitle:ie,othersBody1:ce,othersBody2:pe,othersStats:me,othersCards:de,showBreadcrumb:xe=!0,showStats:ge=!0,showIntro:ue=!0,showTabs:fe=!0,showFilters:H=!0,showCount:M=!0,showSort:I=!0,previewTab:C,previewHover:he=!1,editing:b=!1}){const j=x==="both",v=j?["vehicles","wheels"]:x==="wheels"?["wheels"]:x==="others"?["others"]:["vehicles"],[Z,be]=w(v[0]),y=(b&&j&&C&&v.includes(C)?C:null)??(v.includes(Z)?Z:v[0]),ve=b&&he,[S,D]=w("all"),[z,ye]=w("newest"),[L,h]=w(null),l=y==="vehicles"?{title:ee,body1:te,body2:ae,stats:re??[],cards:B??[],unit:"items",word:X}:y==="others"?{title:ie,body1:ce,body2:pe,stats:me??[],cards:de??[],unit:"items",word:"Others"}:{title:ne,body1:le,body2:se,stats:oe??[],cards:E??[],unit:"items",word:U},V=W(()=>{const e=[];for(const a of l.cards)a.process&&!e.includes(a.process)&&e.push(a.process);return e},[l.cards]),_=S!=="all"&&V.includes(S)?S:"all",q=_==="all"?l.cards:l.cards.filter(e=>e.process===_),J=W(()=>{const e=[...q];return z==="name"&&e.sort((a,o)=>(a.name??"").localeCompare(o.name??"")),e},[q,z]),K=l.cards.length===0,A=b&&K,P=A?Le():J,Ne=A?O:l.cards.length,we=A?O:J.length,Q=g?`${g} · ${T(l.word)}`:void 0;function ke(e){e!==y&&(be(e),D("all"))}return r("section",{className:"relative z-[2] bg-bg",children:[xe&&r("nav",{className:`mx-auto flex max-w-[var(--sf-site-width,1600px)] items-center gap-4 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-4`,children:[t("span",{className:"hover:text-fg",children:"Home"}),t("span",{className:"opacity-40",children:"/"}),t("span",{className:"text-fg",children:u?k(u):"Gallery"})]}),r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-end gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] pt-[100px] pb-[60px] max-[1100px]:grid-cols-1 max-[1100px]:gap-5 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-[60px]",children:[t("span",{className:`pb-4 font-mono ${n.labelXl} uppercase tracking-[0.3em] text-accent`,children:Q?i(Q):null}),t("h2",{className:"font-display text-[length:min(var(--size-headingLarge,clamp(64px,9vw,140px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.9] tracking-[-0.04em]",children:l.title?Ce(l.title,!0):null}),t("div",{className:`pb-4 text-right font-mono ${n.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-[1100px]:text-left`,children:ge&&l.stats.map((e,a)=>r("div",{children:[e.value?t("strong",{className:"font-normal text-fg",children:i(e.value)}):null," ",e.label?i(e.label):null]},a))})]}),ue&&(l.body1||l.body2)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-2 gap-[60px] px-[var(--sf-site-gutter,40px)] pt-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-4 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[l.body1&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body1)}),l.body2&&t("p",{className:`max-w-[540px] font-display ${n.body} leading-[1.6] text-fg-dim`,children:i(l.body2)})]}),j&&fe&&t("div",{className:"mx-auto mt-10 flex max-w-[var(--sf-site-width,1600px)] items-stretch border-y border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-3",children:["vehicles","wheels"].map((e,a)=>{const o=y===e,c=e==="vehicles"?X:U,f=e==="vehicles"?(B??[]).length:(E??[]).length,p=(c||"").trim().split(/\s+/),m=p.slice(0,-1).join(" "),s=p.slice(-1)[0]??"";return r("button",{type:"button",onClick:()=>ke(e),className:["group relative grid flex-1 cursor-pointer grid-cols-[auto_1fr_auto] items-end gap-5 px-6 py-8 text-left transition-colors",a===0?"border-r border-line":"","max-[720px]:grid-cols-[auto_1fr] max-[720px]:items-center max-[720px]:gap-2 max-[720px]:px-3 max-[720px]:py-3",o?"bg-surface":"hover:bg-fg/[0.04]"].join(" "),children:[t("span",{className:[`pb-2 font-mono ${n.labelLarge} tracking-[0.3em] max-[720px]:pb-0 ${n.labelUpTo720} max-[720px]:tracking-[0.24em]`,o?"text-accent":"text-fg-dim group-hover:text-accent"].join(" "),children:a===0?"A":"B"}),r("span",{className:`font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.6vw,48px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] ${n.bodyUpTo720}`,children:[m?r(N,{children:[k(m)," "]}):null,t("em",{className:"font-normal italic text-accent",children:k(s)})]}),r("span",{className:`pb-2 text-right font-mono ${n.labelSmall} uppercase leading-[1.7] tracking-[0.24em] text-fg-dim max-[720px]:hidden`,children:[t("strong",{className:"font-normal text-fg",children:f})," ","items",t("br",{}),e==="vehicles"?"Community photos":"Featured photos"]}),o&&t("span",{className:"pointer-events-none absolute inset-x-0 -bottom-px h-0.5 bg-accent"})]},e)})}),(H||M||I)&&r("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[auto_1fr_auto] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-5 max-[720px]:grid-cols-1 max-[720px]:gap-4 max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[720px]:py-3",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[t("div",{className:"flex flex-wrap gap-1",children:H&&["all",...V].map(e=>{const a=_===e,o=e==="all"?"All":e;return t("button",{type:"button",onClick:()=>D(e),className:[`cursor-pointer border px-4 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.2em] transition-colors`,a?"border-fg bg-fg text-bg":"border-transparent text-fg-dim hover:text-fg"].join(" "),children:k(o)},e)})}),M?r("div",{className:`text-center font-mono ${n.labelLarge} uppercase tracking-[0.2em] text-fg-dim`,children:[t("strong",{className:"font-normal text-accent",children:we})," / ",Ne," ",l.unit]}):t("div",{}),I?r("div",{className:`flex items-center gap-3 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:[t("span",{children:"Sort"}),r(ze,{value:z,onChange:e=>ye(e.target.value),className:`cursor-pointer border border-line bg-bg px-3 py-2 font-mono ${n.labelLarge} uppercase tracking-[0.18em] text-fg`,children:[t("option",{value:"newest",children:"Newest"}),t("option",{value:"featured",children:"Featured"}),t("option",{value:"name",children:"Name A–Z"})]})]}):t("div",{})]}),t("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-5 pb-20 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[720px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:P.length>0?t("div",{className:"grid grid-cols-6 gap-2 max-[1100px]:grid-cols-2 max-[720px]:grid-cols-1",children:P.map((e,a)=>{const o=Y(e)[0],f=`group relative block aspect-[4/3] w-full overflow-hidden bg-surface-2 text-left ${a<2?"col-span-3 max-[1100px]:col-span-1":"col-span-2 max-[1100px]:col-span-1"}`,p=`${e.name??"card"}-${a}`,m=r(N,{children:[t(G,{label:F(e.name)||`gallery-card-${a+1}`,src:o||void 0,alt:T(e.name??""),sizes:"(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",className:`transition-transform duration-700 ${ve?"scale-[1.04]":"group-hover:scale-[1.04]"}`}),r("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col justify-between p-6 max-[720px]:p-3",style:{background:"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)"},children:[r("div",{className:`flex items-start justify-between font-mono ${n.labelSmall} uppercase tracking-[0.24em]`,children:[e.process?t("span",{className:"text-accent",children:i(e.process)}):t("span",{}),r("span",{className:"text-overlay-fg/70",children:[String(a+1).padStart(2,"0")," / ",String(P.length).padStart(2,"0")]})]}),r("div",{className:"flex flex-col gap-2",children:[e.eyebrow&&t("div",{className:`font-mono ${n.labelSmall} uppercase tracking-[0.24em] text-accent`,children:i(e.eyebrow)}),e.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,clamp(22px,2.4vw,32px))] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg",children:i(e.name)}),e.meta&&t("div",{className:`flex flex-wrap gap-3 pt-1 font-mono ${n.labelXs} uppercase tracking-[0.2em] text-overlay-fg/70`,children:t("span",{children:i(e.meta)})})]})]})]});return b?t("div",{className:f,children:m},p):t("button",{type:"button",onClick:()=>h({card:e,index:0}),"aria-label":`Open ${e.name??"gallery item"}`,className:`${f} cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2`,children:m},p)})}):t("div",{className:`py-20 text-center font-mono ${n.labelXl} uppercase tracking-[0.2em] text-fg-dim`,children:K?"No items in this gallery yet.":"No items match this filter."})}),L&&(()=>{const e=Y(L.card),{card:a,index:o}=L,c=e.length,f=e[o]??e[0]??"",p=s=>h(d=>d&&{...d,index:(d.index+s+c)%c}),m=[a.process,a.meta].filter(Boolean).join(" · ");return r(je,{open:!0,onClose:()=>h(null),label:a.name??"Gallery item",onPrev:c>1?()=>p(-1):void 0,onNext:c>1?()=>p(1):void 0,className:"flex cursor-zoom-out flex-col items-center justify-center bg-overlay-scrim/92 p-6 backdrop-blur-sm max-[720px]:p-3",children:[r("div",{className:"relative flex w-full flex-1 items-center justify-center",children:[t("div",{className:"relative h-full max-h-[72vh] w-full max-w-[92vw]",children:t(G,{label:F(a.name)||"gallery-photo",src:f||void 0,alt:T(a.name??""),objectFit:"contain",sizes:"92vw"})}),c>1&&r(N,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:s=>{s.stopPropagation(),p(-1)},className:"absolute left-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:s=>{s.stopPropagation(),p(1)},className:"absolute right-2 top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"})]})]}),r("div",{className:`mt-5 flex flex-col items-center gap-3 text-center font-mono ${n.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,onClick:s=>s.stopPropagation(),children:[r("div",{className:"flex flex-col items-center gap-1",children:[a.name&&t("span",{className:"text-accent",children:i(a.name)}),a.eyebrow&&t("span",{children:i(a.eyebrow)}),r("span",{className:"text-fg-dim/70",children:[m?r(N,{children:[i(m)," · "]}):null,o+1," / ",c]})]}),a.href&&t($e,{href:a.href,onClick:()=>h(null),className:`cursor-pointer border border-btn bg-btn/[0.08] px-5 py-3 font-mono ${n.labelLarge} uppercase tracking-[0.28em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:"View Product →"})]}),c>1&&t("div",{onClick:s=>s.stopPropagation(),className:"mt-5 flex max-w-[92vw] gap-2 overflow-x-auto pb-1",children:e.map((s,d)=>t("button",{type:"button","aria-label":`Photo ${d+1}`,onClick:()=>h(R=>R&&{...R,index:d}),className:["relative h-16 w-24 shrink-0 cursor-pointer overflow-hidden border transition-colors max-[720px]:h-12 max-[720px]:w-16",d===o?"border-accent":"border-line opacity-60 hover:border-fg-dim hover:opacity-100"].join(" "),children:t(G,{label:F(a.name)||"gallery-photo",src:s||void 0,alt:"",sizes:"120px"})},`${s}-${d}`))}),t(Se,{})]})})()]})}export{_e as default};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type HeaderCall } from "./HeaderCallButton.js";
|
|
1
2
|
import { type HeaderSettings } from "../lib/api/index.js";
|
|
2
3
|
import type { PreviewHeaderSettings } from "efficient-web-builder/render/components/PreviewHeaderContext";
|
|
3
4
|
export default function Header({ previewSettings, initialSettings, editorPreview, showThemeToggle, wordmark, hideLogo, hideMenu, siteName, commerceEnabled, }?: {
|
|
4
|
-
previewSettings?: PreviewHeaderSettings;
|
|
5
|
+
previewSettings?: PreviewHeaderSettings & HeaderCall;
|
|
5
6
|
initialSettings?: HeaderSettings | null;
|
|
6
7
|
editorPreview?: boolean;
|
|
7
8
|
showThemeToggle?: boolean;
|