efficient-storefront-blocks 0.90.0 → 0.91.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 +16 -0
- package/dist/chunks/{EditorPreviewCheckout-M4LID5YF.js → EditorPreviewCheckout-NFLTZCIQ.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-2JWQZN2Q.js → SiteEditorProvider-UWRLDKJS.js} +1 -1
- package/dist/chunks/chunk-4VRLGKYU.js +387 -0
- package/dist/chunks/{chunk-3XIZADE6.js → chunk-HRTZ7SYX.js} +1 -1
- package/dist/chunks/{chunk-JMUP4FBL.js → chunk-PHQQRGQZ.js} +1 -1
- package/dist/chunks/{chunk-U6UPMVSX.js → chunk-YL2HPWVT.js} +1 -1
- package/dist/chunks/{fitment-data-3VLLTJW6.js → fitment-data-6KHIA3AT.js} +1 -1
- package/dist/contract.js +1 -9
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/lib/document/block-align-row.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/editor/lib/storefront-editor-words-kept.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +6 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +32 -32
- package/dist/render/app/globals.css +10 -1
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/FooterMenu.d.ts +3 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterPayment.js +1 -1
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/PublishedFooter.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +2 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
- package/dist/render/lib/content/menu-card-seed.d.ts +4 -0
- package/dist/render/lib/content/menu-card-seed.js +1 -1
- package/dist/render/lib/content/menu-entry-type.d.ts +2 -0
- package/dist/render/lib/content/menu-entry-type.js +1 -0
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/render/lib/sections/product-pictures.d.ts +2 -1
- package/dist/render/lib/sections/product-pictures.js +1 -1
- package/dist/words.d.ts +7 -0
- package/dist/words.js +2 -2
- package/package.json +2 -2
- package/dist/chunks/chunk-6TDIG6W3.js +0 -395
- package/dist/render/lib/content/legacy-block-align.d.ts +0 -2
- package/dist/render/lib/content/legacy-block-align.js +0 -1
- /package/dist/chunks/{chunk-6TDIG6W3.js.LEGAL.txt → chunk-4VRLGKYU.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-N445XY3W.js → chunk-XMTQMRA3.js} +0 -0
|
@@ -3004,7 +3004,16 @@ em.text-accent {
|
|
|
3004
3004
|
wide.
|
|
3005
3005
|
|
|
3006
3006
|
The card's own ratio is overridden by specificity, not by `!important` —
|
|
3007
|
-
`.sf-gallery-zone .sf-card` is two classes against Tailwind's one.
|
|
3007
|
+
`.sf-gallery-zone .sf-card` is two classes against Tailwind's one.
|
|
3008
|
+
|
|
3009
|
+
⚠️ A LAYOUT WITH A RATIO HAS NO FIXED ROW. The builder's layout table may
|
|
3010
|
+
give a layout its tile ratio (`galleryLayoutRatio`; "Two, then threes ·
|
|
3011
|
+
photo" is 4:3). Its emitted rules then make the rows `auto` and give each
|
|
3012
|
+
CELL that ratio, with the class written twice so they outrank the fixed row
|
|
3013
|
+
and the cell's 100% below in any order. The rules here stay as they are:
|
|
3014
|
+
the tile and its card fill the cell, so they draw at the layout's ratio.
|
|
3015
|
+
No ratio is written here; it is the builder's.
|
|
3016
|
+
scripts/browser-gallery-layout-ratio.tsx measures it in Chromium. */
|
|
3008
3017
|
.sf-gallery-zone {
|
|
3009
3018
|
display: grid;
|
|
3010
3019
|
grid-auto-flow: row dense;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
2
|
import type { FooterMenuItem } from "../lib/menu-link.js";
|
|
3
|
+
import type { SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
|
|
3
4
|
export interface FooterMenuValue {
|
|
4
5
|
id?: string;
|
|
5
6
|
handle?: string;
|
|
@@ -14,6 +15,7 @@ export interface MenuOwner {
|
|
|
14
15
|
export interface FooterMenuProps {
|
|
15
16
|
owner: MenuOwner;
|
|
16
17
|
menu?: FooterMenuValue | null;
|
|
18
|
+
served?: readonly SourceRow[] | null;
|
|
17
19
|
heading?: string;
|
|
18
20
|
accordionMobile?: boolean;
|
|
19
21
|
showDividers?: boolean;
|
|
@@ -26,4 +28,4 @@ export interface FooterMenuProps {
|
|
|
26
28
|
}
|
|
27
29
|
export declare const MENU_STYLE_PLAIN = "plain";
|
|
28
30
|
export declare const MENU_STYLE_TABS = "tabs";
|
|
29
|
-
export default function FooterMenu({ owner, menu, heading, accordionMobile, showDividers, editing, layout, linkAlign, linkRange, menuStyle, currentPage, }: FooterMenuProps): import("react").JSX.Element;
|
|
31
|
+
export default function FooterMenu({ owner, menu, served, heading, accordionMobile, showDividers, editing, layout, linkAlign, linkRange, menuStyle, currentPage, }: FooterMenuProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as F,jsxs as
|
|
1
|
+
"use client";import{jsx as e,Fragment as F,jsxs as s}from"react/jsx-runtime";import{useCallback as j,useEffect as B,useRef as Y,useState as O}from"react";import W from"next/link";import{REPEAT_ATTRIBUTE as G,REPEAT_INDEX_ATTRIBUTE as z}from"efficient-easel/draw";import q from"./CountrySelect.js";import{MenuPlaceContext as V}from"./MenuLinkBlock.js";import X from"./ThemeToggle.js";import{CardRowContext as Z,CardTemplateRows as J}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as v}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as K}from"./HeaderTools.js";import{usePhoneMenuTools as Q}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as ee}from"./SearchContext.js";import{useModalDismiss as ne}from"./useModalDismiss.js";import le from"efficient-easel/screen/components/UiIcon";import{usePreviewMenus as re}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as te,FOOTER_MENU_PLACEHOLDER_HEADING as ae,FOOTER_MENU_PLACEHOLDER_HINT as oe}from"../lib/content/menu-placeholder.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";import{UNDER_HEADER_SHEET_CLASS as se}from"../lib/content/header-bar.js";import{isMenuOrphaned as ie}from"../lib/menu-source.js";import{legacyBlockAlignOf as ce}from"efficient-web-builder/format/lib/content/block-align";import{menuLinkInRange as me,resolveMenuLinkRange as ue}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as P}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as H,currentLinkIndex as de}from"../lib/content/tab-strip.js";import{useCurrentPagePath as pe}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as E}from"efficient-web-builder/render/components/ViewHideRoot";const qe="plain",he="tabs",fe=`flex list-none flex-col gap-3 ${P}`,y="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",L="text-[12px] italic text-fg-dim/70",U=(n,l)=>n&&l>0?"border-t border-line pt-3":"",xe=n=>({label:n.label??"",url:n.href??"",served:n}),D=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},be=Array.from({length:te},()=>({label:"",href:""}));function M({owner:n,items:l,place:a,wrap:i,markCurrent:h=!1}){const x=l?l.map(D):be,c=pe(),m=l&&h?de(l.map(g=>g.url??""),c):-1,u=m<0?null:{index:m,href:l[m].url??""};return e(V.Provider,{value:l?u?{...a,current:u}:a:{...a,placeholder:!0},children:e(J,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:x,items:l??void 0,fallback:null,wrapCopy:i,children:g=>g})})}const R=n=>(n.template?.blockCount??0)>0,Ne="Nothing to show yet: this menu's entries come from its Menu content.",$="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function Ee({owner:n,items:l,label:a,editing:i,linkAlign:h,linkRange:x,markCurrent:c}){const m=ce(h),u=ue(x),g=!!u&&l!==null&&u.to!==void 0&&u.to<l.length,[w,C]=O(!1),_=Y(null),b=Q(),{open:S}=ee(),N=a||"Menu",o=j(()=>C(!1),[]);ne({active:w,onDismiss:o,scopeRef:_});const f=e(M,{owner:n,items:l,place:{place:"row"},markCurrent:c,wrap:(r,t)=>{const p=l!==null&&u&&!me(u,t.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...p,children:r})}}),k=(r,t,p)=>i?{[G]:`${r}:${p<0?"panel":"dropdown"}`,[z]:`${p+1}.${t.index}`}:null,A=e(M,{owner:n,items:l,place:{place:"panel",onNavigate:o},markCurrent:c,wrap:(r,t)=>s(F,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...k(n.id,t,-1),children:r}),l===null?null:(t.item?.dropdown_items??[]).map((p,I)=>e(Z.Provider,{value:{...t,row:D(p),item:p},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...k(n.id,t,I),children:r})},I))]})}),d=b&&(b.search||b.region||b.account||b.theme)?b:null;return!i&&l!==null&&!R(n)&&!d?null:s(E,{as:"nav",ref:_,"aria-label":N,"data-menu-row":"",...m?{"data-menu-align":m}:null,...g?{"data-menu-part":"lead"}:null,className:"min-w-0",children:[e("ul",{className:`m-0 hidden list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${P} uppercase tracking-[0.18em] view-tablet:flex`,children:f}),e("button",{type:"button",className:"flex h-11 w-11 items-center justify-center view-tablet:hidden","aria-expanded":w,"aria-label":w?"Close the menu":"Open the menu",onClick:()=>C(r=>!r),children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:w?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),w?s("div",{role:"dialog","aria-label":N,className:`${se} z-[60] flex flex-col overflow-y-auto bg-bg text-fg view-tablet:hidden`,children:[e("ul",{className:"m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",children:A}),d?s("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[d.search?s("button",{type:"button",className:"flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]",onClick:i?void 0:()=>{o(),S()},children:[e(le,{name:"search",size:18,strokeWidth:1.6,rounded:!0}),K.search]}):null,d.account?s("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),e(W,{href:"/account",onClick:o,className:"mono-eyebrow underline",children:"Your account"})]}):null,d.region?s("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),e(q,{})]}):null,d.theme?s("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),e(X,{})]}):null]}):null]}):null]})}function ge({owner:n,items:l,label:a,editing:i,markCurrent:h}){return!i&&(l===null||l.length===0||!R(n))?null:e(E,{as:"nav","aria-label":a||"Menu","data-menu-tabs":"",className:"min-w-0",children:e("ul",{className:H.list,children:e(M,{owner:n,items:l,place:{place:"tab"},markCurrent:h,wrap:x=>e("li",{className:H.item,children:x})})})})}function we({owner:n,menu:l,served:a,heading:i,accordionMobile:h=!1,showDividers:x=!1,editing:c=!1,layout:m="column",linkAlign:u,linkRange:g,menuStyle:w,currentPage:C}){const _=m==="row"&&C===!0,{live:b,ready:S}=re(),N=!a&&ie({id:l?.id,handle:l?.handle,editing:c,ready:S,live:b}),o=a?a.map(xe):N?[]:l?.items??[],f=i||(a?"":l?.name)||"",[k,A]=O(!1);if(B(()=>{if(!h)return;const r=window.matchMedia("(max-width: 800px)"),t=()=>A(r.matches);return t(),r.addEventListener("change",t),()=>r.removeEventListener("change",t)},[h]),a&&o.length===0)return c?e(E,{as:"p",className:L,children:T(Ne)}):null;if(m==="row"&&c&&!N&&o.length>0&&!R(n))return e(E,{as:"p",className:L,children:T($)});if(m==="row"&&w===he)return e(ge,{owner:n,items:N?null:o,label:f,editing:c,markCurrent:_});if(m==="row")return e(Ee,{owner:n,items:N?null:o,label:f,editing:c,linkAlign:u,linkRange:g,markCurrent:_});const d=r=>e("ul",{className:fe,children:e(M,{owner:n,items:r,place:{place:"column"},wrap:(t,p)=>e("li",{className:r?U(x,p.index):`text-fg ${U(x,p.index)}`,children:t})})});return N?s(E,{as:"div",className:"min-w-0",children:[e("h4",{className:y,children:i?v(i):T(ae)}),d(null),e("p",{className:`mt-3 ${L}`,children:T(oe)})]}):o.length===0||!R(n)?s(E,{as:"div",className:"min-w-0",children:[f?e("h4",{className:y,children:v(f)}):null,c?e("p",{className:L,children:o.length===0?T("This menu has no links yet — add them in {place}.",{place:T("Storefront → Menus")}):T($)}):null]}):h&&k?s(E,{as:"details",className:"min-w-0 border-b border-line",children:[s("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[v(f),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:d(o)})]}):s(E,{as:"div",className:"min-w-0",children:[f?e("h4",{className:y,children:v(f)}):null,d(o)]})}export{qe as MENU_STYLE_PLAIN,he as MENU_STYLE_TABS,we as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as c}from"react/jsx-runtime";import{PaymentMark as y,paymentMarks as g}from"efficient-shell/icons/payment";import{say as r}from"efficient-web-builder/format/lib/editor-words";import{BLOCK_ALIGN_JUSTIFY as h}from"efficient-web-builder/format/lib/content/block-align";import{
|
|
1
|
+
import{jsx as e,jsxs as c}from"react/jsx-runtime";import{PaymentMark as y,paymentMarks as g}from"efficient-shell/icons/payment";import{say as r}from"efficient-web-builder/format/lib/editor-words";import{BLOCK_ALIGN_JUSTIFY as h,legacyBlockAlignOf as u}from"efficient-web-builder/format/lib/content/block-align";import{HideTaker as s}from"efficient-web-builder/render/components/ViewHideRoot";const m={sm:{mark:16,text:"text-[12px]"},md:{mark:20,text:"text-[13px]"}};function k({lead:t,methods:i,size:n="sm",align:l,editing:o=!1}){const a=g(i);if(!a.length)return o?e(s,{as:"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:p,text:d}=m[n]??m.sm;return c(s,{as:"div","data-footer-payment":"",className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 leading-[1.5] text-fg-dim ${d} ${h[u(l)??"left"]}`,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((x,f)=>e("li",{className:"flex",children:e(y,{item:x,size:p})},f))})]})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{useSiteSocialLinks as x}from"./SiteRecordContext.js";import{SOCIAL_GAP_DEFAULT as _,SOCIAL_GAP_MAX as A,SOCIAL_GAP_MIN as S}from"../lib/sections/footer-social-gap.js";import{DEFAULT_SOCIAL_ICON_STYLE as b,SocialMark as h}from"efficient-web-builder/render/components/socialIcons";import{normalizeSocialLinks as k,socialLinksToDraw as L}from"efficient-web-builder/format/lib/content/social-links";import{say as v}from"efficient-web-builder/format/lib/editor-words";import{BLOCK_ALIGN_JUSTIFY as w}from"efficient-web-builder/format/lib/content/block-align";import{
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useSiteSocialLinks as x}from"./SiteRecordContext.js";import{SOCIAL_GAP_DEFAULT as _,SOCIAL_GAP_MAX as A,SOCIAL_GAP_MIN as S}from"../lib/sections/footer-social-gap.js";import{DEFAULT_SOCIAL_ICON_STYLE as b,SocialMark as h}from"efficient-web-builder/render/components/socialIcons";import{normalizeSocialLinks as k,socialLinksToDraw as L}from"efficient-web-builder/format/lib/content/social-links";import{say as v}from"efficient-web-builder/format/lib/editor-words";import{BLOCK_ALIGN_JUSTIFY as w,legacyBlockAlignOf as g}from"efficient-web-builder/format/lib/content/block-align";import{HideTaker as l}from"efficient-web-builder/render/components/ViewHideRoot";const t={small:16,medium:20,large:24};function I({iconStyle:s=b,iconSize:n="medium",align:c,gap:i=_,editing:m=!1}){const d=x(),a=L(k(d));if(a.length===0)return m?e(l,{as:"div","data-social-placeholder":"",className:"rounded border border-dashed border-line px-3 py-2 text-[13px] text-fg-dim",children:v("Add your social links")}):null;const o=t[n]??t.medium,f={gap:Math.min(A,Math.max(S,Number.isFinite(i)?i:0)),"--social-mark":`${o}px`};return e(l,{as:"ul","data-social-block":"","aria-label":"Social media",className:`flex list-none flex-wrap p-0 [margin:calc((44px-var(--social-mark))/-2)] max-view-wide:[margin:calc((40px-var(--social-mark))/-2)] ${w[g(c)??"left"]}`,style:f,children:a.map(({platform:r,href:p,label:u})=>e("li",{children:e("a",{href:p,target:"_blank",rel:"noopener noreferrer","aria-label":`${u} (opens in a new tab)`,className:"grid h-11 w-11 place-items-center rounded text-fg transition-colors hover:text-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-4px] focus-visible:outline-current motion-reduce:transition-none max-view-wide:h-10 max-view-wide:w-10",children:e(h,{platform:r,iconStyle:s,size:o})})},r))})}export{t as SOCIAL_ICON_PX,I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import{Render as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{Render as s}from"efficient-easel/render";import{renderConfig as d}from"../lib/document/render-config.js";import{migrateRenamedProps as p}from"efficient-web-builder/format/lib/document/renamed-props";import{dropEmptySourcedBoxes as f}from"efficient-web-builder/render/lib/document/head-core-boxes";import{markWallLabels as u}from"efficient-web-builder/render/lib/document/wall-labels";import{SITE_FOOTER_KIND as c}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as g}from"efficient-web-builder/render/components/PublishedFooterContext";import{EMPTY_SOCIAL_LINKS as I}from"efficient-web-builder/format/lib/content/social-links";function k({footerBlock:l,rootProps:e,headerSettings:o,siteName:m,legalName:n,foundedYear:t,socialLinks:i}){const a=u(f(p({root:{props:{...e??{},kind:c}},content:[l],zones:{}})));return r(g.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:m,legalName:n??null,foundedYear:t??null,socialLinks:i??I},children:r(s,{config:d(),data:a})})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as S}from"react/jsx-runtime";import C from"efficient-web-builder/render/components/Btn";import j,{GALLERY_GRID_ATTR as D,GalleryLinksContext as F}from"../GalleryItem.js";import{SharedPartKinds as K}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as U}from"efficient-web-builder/render/components/goldPhrases";import Z from"efficient-web-builder/render/components/SectionHeader";import $ from"./KindGate.js";import z from"./RecordPhotoGallery.js";import{headIsEmpty as V,ownPadding as W}from"../../lib/sections/own-padding.js";import{PLP_KINDS as X}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as Y}from"../../lib/document/current-product.js";import{SAMPLE_PICTURE_COUNT as T,SAMPLE_RECORD as q,recordPictures as J,useCurrentRecord as Q,useDrawsOtherRecord as ee}from"../../lib/document/current-record.js";import{mediaGroupVehicle as re}from"../../lib/content/source-values.js";import{useSampleProduct as te}from"./useSampleProduct.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";import{galleryLayoutRatio as ie,resolveGalleryLayout as oe}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as L}from"efficient-web-builder/render/components/ViewHideRoot";const ae=X,O=["photos","lifestyle","accessories","others"];function se(e,o){if(!e)return[];if(o==="all")return O.flatMap(s=>e[s]??[]);const r=O.includes(o)?o:null;return r?e[r]??[]:[]}const k="relative z-[2] bg-bg py-[120px] max-view-wide:py-[70px]",H="relative z-[2] bg-bg pt-0 pb-[120px] max-view-wide:pt-0 max-view-wide:pb-[70px]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";function ne(e){return ee(!!e.editing)?t(le,{...e}):t($,{kinds:ae,type:"GalleryB",editing:e.editing,children:t(me,{...e})})}function le(e){const{editing:o=!1}=e,r=Q(),s=r?J(r,{firstField:!0}).map(a=>({images:[a.url],eyebrow:a.alt&&a.alt!==r.title?a.alt:void 0,...a.video?{video:a.video}:{}})):o?Array.from({length:T},()=>({images:[""]})):[];return t(A,{...e,tiles:s,owner:{name:(r??q).title},photosOnly:!0,emptyHint:_("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function Ae(e){const{rows:o,limit:r,layout:s,editing:a=!1,title:h}=e,d=oe(s),c=typeof r=="number"&&r>0?Math.floor(r):void 0,p=o.filter(n=>typeof n.cover=="string"&&n.cover).map(n=>({images:[n.cover],...n.video?{video:n.video}:{}})),g=a&&p.length===0?Array.from({length:c??T},()=>({images:[""]})):p;return t(A,{...e,tiles:c?g.slice(0,c):g,owner:{name:(h??"").replace(/==/g,"").trim()},photosOnly:!0,tilesAcross:d?.across===3?3:4,tileRatio:d?ie(d):null,emptyHint:_("The website’s pictures appear here, in the order they are put in. A website with no pictures draws nothing.")})}function me({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:h="/gallery",submitHref:d="/contact",zone:c="all",photoDisplay:p="covers",previewHover:g,display:n,displayPhone:y,styleOwner:v,editing:f=!1,padTop:G,padBottom:x}){const w=Y(),N=te(f&&!w),u=w?.product??N,b=se(u?.mediaGroups,c).map(i=>({images:(i.items??[]).filter(m=>m.kind==="image").map(m=>m.url),vehicle:re(i),finish:i.finish})).filter(i=>i.images.length>0),R=(p==="auto"?b.length>=4?"covers":"all":p)==="all"?b.flatMap(i=>i.images.map(m=>({images:[m],vehicle:i.vehicle,finish:i.finish}))):b;return t(A,{omitHead:e,num:o,title:r,linkText:s,linkHref:a,galleryHref:h,submitHref:d,previewHover:g,display:n,displayPhone:y,styleOwner:v,editing:f,padTop:G,padBottom:x,tiles:u?R.map(i=>({images:i.images,eyebrow:i.vehicle||void 0,meta:i.finish})):[],owner:{name:u?.name??"",href:u?.href,process:u?.eyebrow},emptyHint:_("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function A({omitHead:e=!1,num:o,title:r,linkText:s,linkHref:a,galleryHref:h="/gallery",submitHref:d="/contact",previewHover:c,display:p,displayPhone:g,styleOwner:n,editing:y=!1,tiles:v,owner:f,emptyHint:G,photosOnly:x=!1,tilesAcross:w,tileRatio:N=null,padTop:u,padBottom:b}){const P=s?{text:s,href:a||"#"}:void 0,R=r?U(r,!1):void 0,i=e?null:t(Z,{num:o,title:R,link:P}),m=!y&&V(o,r,P?.text)?null:i,E=W(u,b);return v.length===0?y?t(L,{as:"section",className:e?H:k,style:E,children:S("div",{className:M,children:[m,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:G})]})}):null:t(L,{as:"section",className:e?H:k,style:E,children:S("div",{className:M,children:[m,x?t(z,{pictures:v.map(l=>({url:l.images[0]??"",alt:l.eyebrow,video:l.video})),name:f.name,editing:y,...w?{fit:"tiles",across:w,ratio:N}:{}}):t(F.Provider,{value:{galleryHref:h,submitHref:d,previewHover:c,display:p,displayPhone:g,styleOwner:n,photosOnly:x},children:t(K,{children:t("div",{[D]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1 max-view-wide:gap-1",children:v.map((l,I)=>t(j,{image:l.images[0],photos:l.images.slice(1).map(B=>({src:B})),href:f.href,process:f.process,eyebrow:l.eyebrow,name:f.name,meta:l.meta,editing:y},`${l.eyebrow}-${I}`))})})}),!x&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(C,{href:h,variant:"ghost",children:"See Gallery"})})]})})}export{Ae as SourcedGalleryGrid,ne as default,ae as supportedKinds};
|
|
@@ -4,10 +4,11 @@ export interface GalleryPicture {
|
|
|
4
4
|
video?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function pictureLabel(picture: GalleryPicture, name: string): string;
|
|
7
|
-
export default function RecordPhotoGallery({ pictures, name, editing, fit, across, }: {
|
|
7
|
+
export default function RecordPhotoGallery({ pictures, name, editing, fit, across, ratio, }: {
|
|
8
8
|
pictures: readonly GalleryPicture[];
|
|
9
9
|
fit?: "section" | "column" | "tiles";
|
|
10
10
|
across?: 3 | 4;
|
|
11
|
+
ratio?: readonly [number, number] | null;
|
|
11
12
|
name: string;
|
|
12
13
|
editing?: boolean;
|
|
13
14
|
}): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as
|
|
1
|
+
"use client";import{jsx as t,Fragment as v,jsxs as c}from"react/jsx-runtime";import{useCallback as M,useRef as P,useState as $}from"react";import{sizedImage as R}from"efficient-web-builder/format/lib/sized-image";import U from"efficient-web-builder/render/components/Placeholder";import z,{LightboxClose as G,LIGHTBOX_CLOSE_TINT as D}from"../Lightbox.js";import{GALLERY_GRID_ATTR as S}from"../GalleryItem.js";const H="(max-width: 1600px) 100vw, 1600px",X="(max-width: 1100px) 100vw, 50vw",Z="(max-width: 800px) 30vw, 200px",F="100vw";function g(s,l){return s.video?l?`Play video of ${l}`:"Play video":l?`Open photo of ${l}`:"Open photo"}function W({small:s=!1}){return t("span",{"aria-hidden":!0,"data-play-badge":"",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("span",{className:`flex items-center justify-center rounded-full bg-bg/75 text-fg ${s?"h-8 w-8 text-[length:12px]":"h-16 w-16 text-[length:22px]"}`,children:"▶"})})}const q="relative block w-full overflow-hidden bg-surface-2",Y="block h-[min(78vh,820px)] w-full object-cover max-view-wide:h-[min(70vh,560px)]",J="block aspect-[4/5] max-h-[80vh] w-full object-cover",K="grid grid-cols-4 gap-2",Q="relative block aspect-square w-full overflow-hidden bg-surface-2",O="block h-full w-full object-cover",V="grid grid-cols-6 gap-2 max-view-wide:grid-cols-4",ee={3:"grid grid-cols-3 gap-2 max-view-wide:grid-cols-2",4:"grid grid-cols-4 gap-2 max-view-wide:grid-cols-2"},te="relative block aspect-[4/5] w-full overflow-hidden bg-surface-2",le="relative block w-full overflow-hidden bg-surface-2",oe="(max-width: 800px) 50vw, 25vw",se="cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",T="absolute top-1/2 z-[2] flex h-14 w-14 -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,22px)] text-fg-dim transition-colors hover:border-accent hover:text-accent max-[700px]:h-11 max-[700px]:w-11";function ne({pictures:s,name:l,editing:w=!1,fit:y="section",across:j=4,ratio:f=null}){const[B,_]=$(!1),[i,h]=$(0),x=P(null),C=M(e=>{e?x.current=e:(x.current?.pause(),x.current=null)},[]),o=s.length,N=y==="column";if(o===0)return null;const k=()=>h(e=>(e-1+o)%o),E=()=>h(e=>(e+1)%o),A=e=>{h(e),_(!0)},r=s[Math.min(i,o-1)],u=(e,n,a,p)=>e.url?t("span",{className:`${a} relative`,children:t(U,{label:e.alt||l||"photo",src:e.url,alt:e.alt||l,sizes:n,objectFit:"cover",showBackground:!1})}):t("span",{"aria-hidden":!0,className:`${a} bg-surface-2`}),d=y==="tiles",b=f?{aspectRatio:`${f[0]} / ${f[1]}`}:null,m=(e,n,a)=>{const p=c(v,{children:[d?u(e,oe,O,800):a?N?u(e,X,J,1200):u(e,H,Y,1600):u(e,Z,O,400),e.video&&t(W,{small:!a&&!d})]}),I=d?b?le:te:a?q:Q,L=d&&b?b:void 0;return w?t("div",{className:I,style:L,children:p}):t("button",{type:"button","aria-label":g(e,l),onClick:()=>A(n),className:`${I} ${se}`,style:L,children:p})};return c(v,{children:[d?t("ul",{[S]:"","data-record-gallery":"tiles",className:ee[j===3?3:4],children:s.map((e,n)=>t("li",{children:m(e,n,!1)},`${e.url}-${n}`))}):c("div",{[S]:"","data-record-gallery":"",className:"flex flex-col gap-2",children:[m(s[0],0,!0),o>1&&t("ul",{className:N?K:V,children:s.slice(1).map((e,n)=>t("li",{children:m(e,n+1,!1)},`${e.url}-${n+1}`))})]}),!w&&t(z,{open:B,onClose:()=>_(!1),label:g(r,l),onPrev:o>1?k:void 0,onNext:o>1?E:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:c("div",{onClick:e=>e.stopPropagation(),className:"relative flex h-full w-full items-center justify-center",children:[t(G,{className:"absolute right-0 top-0 z-[3] flex h-12 w-12 cursor-pointer items-center justify-center border border-line font-mono text-[length:var(--size-label,18px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:D},children:"✕"}),r.video?t("video",{ref:C,controls:!0,playsInline:!0,preload:"metadata",poster:r.url,src:r.video,"aria-label":g(r,l),className:"block max-h-[calc(100vh-120px)] max-w-full bg-bg"},`video-${i}`):t("img",{...R(r.url,{fallbackWidth:1600}),sizes:F,alt:`${r.alt||l||"Photo"} — ${i+1} of ${o}`,className:"block max-h-[calc(100vh-120px)] max-w-full object-contain"},`photo-${i}`),o>1&&c(v,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:k,className:`${T} left-0`,children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:E,className:`${T} right-0`,children:"▷"}),c("span",{"data-gallery-counter":"",className:"absolute bottom-0 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,14px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[i+1," / ",o]})]})]})})]})}export{ne as default,g as pictureLabel};
|
|
@@ -2,5 +2,9 @@ import { type SeededNode } from "efficient-web-builder/format/lib/document/seed-
|
|
|
2
2
|
type Props = Record<string, unknown>;
|
|
3
3
|
export declare const MENU_LINK_BLOCK = "MenuLinkBlock";
|
|
4
4
|
export declare function menuCardSeed(nodeId: string): SeededNode[];
|
|
5
|
+
export declare const MENU_BLOG_CATEGORIES_SOURCE = "blog-categories";
|
|
6
|
+
export declare const MENU_COUNT_FIELD = "count";
|
|
7
|
+
export declare function menuCountCardSeed(nodeId: string): SeededNode[];
|
|
8
|
+
export declare function menuTemplateFollowsContent(props: Props): Props;
|
|
5
9
|
export declare function withMenuTemplate(props: Props): Props;
|
|
6
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{seedNodes as
|
|
1
|
+
import{INNER_BOX as g,TEXT as N,seedNodes as i}from"efficient-web-builder/format/lib/document/seed-parts";import{BOX_TYPE as c,CONTAINER_BLOCKS_SLOT as _}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as O}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{declaredBlockSource as d}from"efficient-web-builder/format/lib/content/block-sources";import{MENU_ENTRY_SIZE_PX as C}from"./menu-entry-type.js";const r="MenuLinkBlock";function l(t){return i([{type:r}],()=>`${t}~link`)}const E="blog-categories",T="count",y={...g,direction:"row",align:"center",gap:8,gapPhone:8,phoneRow:2,sharePhone:"content",wrapPhone:!1,name:"Card"},S="main",h={size:C,lineHeight:1,color:S};function a(t){const e={0:`${t}~card`,"0.0":`${t}~link`,"0.1":`${t}~count`};return i([{type:c,props:y,slots:{[_]:[{type:r},O(T,{...N,tag:"p"},h)]}}],(o,n)=>e[n]??`${t}~${n}`)}const s=t=>typeof t.id=="string"&&t.id.trim()?t.id:"Menu",u=t=>d(t)===E,m=t=>(u(t)?a:l)(s(t)),w=(t,e)=>Array.isArray(t)&&t.length===e.length&&JSON.stringify(t)===JSON.stringify(e);function x(t){const e=t.template;if(!Array.isArray(e)||e.length!==1)return t;const o=e[0]?.type;if(o!==r&&o!==c)return t;const n=s(t),f=u(t)?l(n):a(n);return w(e,f)?{...t,template:m(t)}:t}function $(t){return t.template!==void 0?x(t):{...t,template:m(t)}}export{E as MENU_BLOG_CATEGORIES_SOURCE,T as MENU_COUNT_FIELD,r as MENU_LINK_BLOCK,l as menuCardSeed,a as menuCountCardSeed,x as menuTemplateFollowsContent,$ as withMenuTemplate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=13,E="text-[13px]";export{E as MENU_ENTRY_SIZE_CLASS,t as MENU_ENTRY_SIZE_PX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import{declaredBlockSource as k,sourcedRows as B}from"efficient-web-builder/format/lib/content/block-sources";import F from"../../components/FooterMenu.js";const p={MenuBlock:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment"},E="column";function M({id:o,template:e,menu:r,dataSource:n,dataRows:i,heading:l,accordionMobile:c,showDividers:u,direction:a,linkAlign:d,linkRange:s,menuStyle:m,currentPage:g,editor:t}){return f(F,{owner:{id:String(o??""),type:"MenuBlock",template:e},menu:r,served:k({dataSource:n})?B({dataSource:n,dataRows:i},!!t?.isEditing).rows:void 0,heading:l||void 0,accordionMobile:c,showDividers:u,layout:a==="row"?"row":"column",linkAlign:d,linkRange:s,menuStyle:m,currentPage:g,editing:t?.isEditing})}function _(o){for(const[r,n]of Object.entries(p))o[r]={...o[n]};const e=o.MenuBlock;e.defaultProps={...e.defaultProps,direction:E},e.render=M}export{p as PAGE_BLOCKS_FROM_FOOTER,E as PAGE_MENU_DIRECTION_DEFAULT,_ as addPageBlocksFromFooter};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { type GalleryLayoutKey } from "efficient-web-builder/format/lib/content/gallery-layout";
|
|
1
2
|
import type { ProductSourceOptions } from "./product-source.js";
|
|
2
3
|
export declare const PRODUCT_PICTURES_SOURCE = "product-pictures";
|
|
3
4
|
export declare const EVERY_IMAGE_ZONE = "all";
|
|
4
5
|
export interface ProductPicturesOptions extends ProductSourceOptions {
|
|
5
6
|
mediaZone?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const PRODUCT_PICTURES_LAYOUT
|
|
8
|
+
export declare const PRODUCT_PICTURES_LAYOUT: GalleryLayoutKey;
|
|
8
9
|
export declare function productPicturesLayout(props: Record<string, unknown>): string | undefined;
|
|
9
10
|
export interface ProductPictureTile {
|
|
10
11
|
image: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sourcedRows as E}from"efficient-web-builder/format/lib/content/block-sources";import{say as r}from"efficient-web-builder/format/lib/editor-words";import{resolveGalleryLayout as
|
|
1
|
+
import{sourcedRows as E}from"efficient-web-builder/format/lib/content/block-sources";import{say as r}from"efficient-web-builder/format/lib/editor-words";import{resolveGalleryLayout as P}from"efficient-web-builder/format/lib/content/gallery-layout";import{servedListOf as T,servedRowLists as R,servedWords as _}from"../content/served-lists.js";const A="product-pictures",b="all",O="twoThenThreesPhoto";function I(t){const o=typeof t.layout=="string"&&t.layout?t.layout:void 0;return o&&P(o)||t.columns!=null&&t.columns!==""?o:O}const L=12,S=4,v=t=>Array.from({length:t},(o,n)=>({key:`sample-${n+1}`,process:r("Category"),eyebrow:r("Vehicle"),name:r("Product name"),meta:r("Finish")}));function M(t,o,n){const c=typeof n=="number"&&n>0?Math.floor(n):void 0,{rows:p,sample:f}=E(t,o,v(c??S)),y=f?null:R(t,e=>_(e.photos,L)),l=new Set,u=[];return p.forEach((e,m)=>{const s=e.cover??"";if(!f&&!s)return;const a=e.key||`row-${m+1}`;if(l.has(a))return;l.add(a);const i=T(y,e,m)??[],h=i[0]===s?i.slice(1):i.filter(d=>d!==s);u.push({image:s,photos:h.map(d=>({src:d})),href:e.href||void 0,process:e.process||void 0,eyebrow:e.eyebrow||void 0,name:e.name||void 0,meta:e.meta||void 0,tile:{id:a,tag:e.process??"",name:e.name??""}})}),c?u.slice(0,c):u}export{b as EVERY_IMAGE_ZONE,O as PRODUCT_PICTURES_LAYOUT,A as PRODUCT_PICTURES_SOURCE,M as productPictureTiles,I as productPicturesLayout};
|
package/dist/words.d.ts
CHANGED
|
@@ -753,6 +753,7 @@ export type WebBuilderPhrase =
|
|
|
753
753
|
| "Map"
|
|
754
754
|
| "Map & Theme"
|
|
755
755
|
| "Map theme"
|
|
756
|
+
| "Marks"
|
|
756
757
|
| "Marquee"
|
|
757
758
|
| "Match / done (green)"
|
|
758
759
|
| "Media"
|
|
@@ -1694,6 +1695,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1694
1695
|
| "Find your *match.*"
|
|
1695
1696
|
| "Finish"
|
|
1696
1697
|
| "First card"
|
|
1698
|
+
| "First category"
|
|
1697
1699
|
| "First detail"
|
|
1698
1700
|
| "First image on the left"
|
|
1699
1701
|
| "First name"
|
|
@@ -1726,6 +1728,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1726
1728
|
| "Gallery"
|
|
1727
1729
|
| "Gallery A"
|
|
1728
1730
|
| "Gallery A comes from the product’s Relative / lifestyle photos, Gallery B from its Product photos and the Others gallery from its Others — edit those in the product’s Media tab and refresh. Each media group is a card: its name is the eyebrow, its finish the meta line; the card’s title is the product name and its tag the category. Headings, intro copy and stats stay yours."
|
|
1731
|
+
| "Gallery A comes from the product’s Relative / lifestyle photos, Gallery B from its Product photos and the Others gallery from its Others — edit those in the product’s Media tab and refresh. Each media group is a card: the car set on the group is the eyebrow (a card keeps its caption when the group has no car), its finish the meta line; the card’s title is the product name and its tag the category. Headings, intro copy and stats stay yours."
|
|
1729
1732
|
| "Gallery B"
|
|
1730
1733
|
| "Gallery Item"
|
|
1731
1734
|
| "Gallery link"
|
|
@@ -1833,6 +1836,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1833
1836
|
| "Max"
|
|
1834
1837
|
| "Media group"
|
|
1835
1838
|
| "Menu Item"
|
|
1839
|
+
| "Menu content"
|
|
1836
1840
|
| "Menu link"
|
|
1837
1841
|
| "Menu row"
|
|
1838
1842
|
| "Menu style"
|
|
@@ -1891,6 +1895,7 @@ export type StorefrontBlocksPhrase =
|
|
|
1891
1895
|
| "None — this section will be empty"
|
|
1892
1896
|
| "Not authorized yet — reopen once the editor has loaded."
|
|
1893
1897
|
| "Not your size"
|
|
1898
|
+
| "Nothing to show yet: this menu's entries come from its Menu content."
|
|
1894
1899
|
| "Number or ID"
|
|
1895
1900
|
| "OEM front"
|
|
1896
1901
|
| "OEM front tyres"
|
|
@@ -2010,6 +2015,7 @@ export type StorefrontBlocksPhrase =
|
|
|
2010
2015
|
| "Search forms…"
|
|
2011
2016
|
| "Search your catalog…"
|
|
2012
2017
|
| "Second card"
|
|
2018
|
+
| "Second category"
|
|
2013
2019
|
| "Second detail"
|
|
2014
2020
|
| "Second place"
|
|
2015
2021
|
| "Second rate"
|
|
@@ -2132,6 +2138,7 @@ export type StorefrontBlocksPhrase =
|
|
|
2132
2138
|
| "The week"
|
|
2133
2139
|
| "The whole hero comes from the product record — title, price, pictures, options and Add to Cart. Edit the product in the Products database and this hero updates to match."
|
|
2134
2140
|
| "Third card"
|
|
2141
|
+
| "Third category"
|
|
2135
2142
|
| "Third detail"
|
|
2136
2143
|
| "Third room"
|
|
2137
2144
|
| "This column isn't linked to a menu, so the preview shows placeholder links. Pick a menu above."
|