efficient-storefront-blocks 0.133.2 → 0.133.3
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 +11 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +26 -26
- package/dist/render/components/FooterMenu.d.ts +1 -0
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/PhoneSheet.d.ts +2 -1
- package/dist/render/components/PhoneSheet.js +1 -1
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +1 -0
- package/dist/words.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as we,useCallback as be,useContext as ge,useEffect as X,useRef as F,useState as P}from"react";import{createPortal as xe}from"react-dom";import{CloseIcon as Ne,MenuIcon as Ee}from"efficient-shell/icons/efficient-glyphs";import Ce from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as Z}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Te,REPEAT_INDEX_ATTRIBUTE as _e}from"efficient-easel/draw";import{MenuPlaceContext as ye}from"./MenuLinkBlock.js";import{CardRowContext as Me,CardTemplateRows as ke}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as J}from"./HeaderTools.js";import{usePhoneMenuTools as ve}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Le}from"./SearchContext.js";import{useModalDismiss as Oe}from"./useModalDismiss.js";import{PhoneSheet as Ae}from"./PhoneSheet.js";import{useAccountInPhoneMenu as Re}from"./PhoneMenuAccount.js";import{usePreviewMenus as Se}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Pe,FOOTER_MENU_PLACEHOLDER_HEADING as Ie,FOOTER_MENU_PLACEHOLDER_HINT as Ue}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as De}from"../lib/menu-source.js";import{legacyBlockAlignOf as He}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as Fe,MENU_PANEL_WIDTH_DEFAULT as $e,MENU_STYLE_BUTTON as ee,MENU_STYLE_TABS as Be,menuLinkInRange as Ye,menuShowClasses as ne,resolveMenuLinkRange as Qe}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as te}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as re,currentLinkIndex as We,marksCurrentLink as le}from"../lib/content/tab-strip.js";import{useAddressQuery as je}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as qe}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as M}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as ze}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as Ge}from"../lib/document/document-nodes.js";const l=ze(Ge),Ve=`flex list-none flex-col gap-3 ${te}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",B="text-[12px] italic text-fg-dim/70",oe=(n,t)=>n&&t>0?"border-t border-line pt-3":"",Ke=n=>({label:n.label??"",url:n.href??"",served:n}),ae=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},Xe=Array.from({length:Pe},()=>({label:"",href:""}));function I({owner:n,items:t,place:c,wrap:h,markCurrent:E=!1}){const C=t?t.map(ae):Xe,m=qe(),w=ge(ce),_=t&&E?We(t.map(g=>g.url??""),m,w):-1,b=_<0?null:{index:_,href:t[_].url??""};return e(ye.Provider,{value:t?b?{...c,current:b}:c:{...c,placeholder:!0},children:e(ke,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:C,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const Y=n=>(n.template?.blockCount??0)>0,Ze="Nothing to show yet: this menu's entries come from its Menu content.",ie="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function se({owner:n,items:t,label:c,editing:h,linkAlign:E,linkRange:C,markCurrent:m,menuStyle:w,menuStylePhone:_,panelLook:b}){const g=He(E),k=Qe(C),A=!!k&&t!==null&&k.to!==void 0&&k.to<t.length,[u,R]=P(!1),v=F(null),f=ve(),Q=Re(),{open:W}=Le(),N=c||"Menu",i=be(()=>R(!1),[]),r=w===ee||_===ee,y=ne(w,_),[U,S]=P("sheet"),d=F(null),x=F(null),[D,me]=P(void 0),[L,ue]=P(null),V=()=>{if(!u&&r){const s=v.current?.ownerDocument.defaultView;S(s?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const o=d.current?.querySelector("span");if(o&&s){const a=s.getComputedStyle(o);me({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const T=(d.current?.querySelector("svg")??d.current)?.getBoundingClientRect();ue(T?{left:T.left,top:T.top,height:T.height}:null)}}R(s=>!s)};X(()=>{if(!u||!r)return;const o=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!o)return;const a=()=>R(!1);return o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[u,r]);const j=F(null);Oe({active:u&&!(u&&r&&U==="side"),onDismiss:i,scopeRef:v,focusRef:j,trapRef:j});const de=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:m,wrap:(s,o)=>{const a=t!==null&&k&&!Ye(k,o.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,...l("menu-item"),children:s})}}),q=(s,o,a)=>h?{[Te]:`${s}:${a<0?"panel":"dropdown"}`,[_e]:`${a+1}.${o.index}`}:null,pe=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(s,o)=>p(H,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...q(n.id,o,-1),...l("menu-item"),children:s}),t===null?null:(o.item?.dropdown_items??[]).map((a,T)=>e(Me.Provider,{value:{...o,row:ae(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...q(n.id,o,T),...l("menu-item"),children:s})},T))]})}),he=f&&(f.search||f.cart||f.region||f.account||f.theme)?f:null;if(!h&&t!==null&&!Y(n)&&!he)return null;const K=e(Ae,{role:"dialog",panelRef:j,name:N,entries:pe,tools:f,withAccount:!r||Q,editing:h,onClose:i,onSearch:W,phoneOnly:!r,marker:r?"sheet":void 0,listStyle:r&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let z=null;if(r){const s=v.current?.ownerDocument,o={...Z,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:$e,tintColor:typeof b?.tintColor=="string"?b.tintColor:Z.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:Fe},a=e(Ce,{look:o,drawer:{closeRef:x},open:!0,onClose:i,label:N,children:p("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:L?{paddingLeft:L.left}:void 0,children:p("button",{ref:x,type:"button",onClick:i,className:"inline-flex h-11 items-center gap-2",style:D,children:[e(Ne,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:J.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:L?{paddingLeft:L.left}:void 0,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(T,fe)=>e("li",{className:"flex min-h-12 items-center",...q(n.id,fe,-1),...l("menu-item"),children:T})})})]})});z=p(H,{children:[p("button",{ref:d,type:"button",className:`mono-eyebrow-ctl ${y.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...l("menu-button"),children:[e(Ee,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:J.menu})]}),u&&s?xe(U==="side"?a:K,s.body):null]})}else y.drawsButton&&(z=p(H,{children:[e("button",{type:"button",className:`${y.buttonHead} h-11 w-11 items-center justify-center${y.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...l("menu-button"),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:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?K:null]}));return p(M,{as:"nav",ref:v,"aria-label":N,"data-menu-row":"",...r?{"data-menu-show":"button"}:null,...!r&&g?{"data-menu-align":g}:null,...!r&&A?{"data-menu-part":"lead"}:null,className:"min-w-0",...l("menu-block"),children:[e("ul",{className:`m-0 ${y.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${te} uppercase tracking-[0.18em]${y.listTail}`,...l("menu"),children:de}),z]})}function Je({owner:n,items:t,label:c,editing:h,markCurrent:E,strip:C=""}){return!h&&(t===null||t.length===0||!Y(n))?null:e(M,{as:"nav","aria-label":c||"Menu","data-menu-tabs":"",className:C?`min-w-0 ${C}`:"min-w-0",...l("menu-block"),children:e("ul",{className:re.list,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(m,w)=>e("li",{className:re.item(w.index===0,h),...l("menu-item"),children:m})})})})}const ce=we("");function en(n){const t=!n.editing&&le(n.layout,n.currentPage),c=je(n.pageQuery??"",t);return e(ce.Provider,{value:c,children:e(nn,{...n})})}function nn({owner:n,menu:t,served:c,heading:h,accordionMobile:E=!1,showDividers:C=!1,editing:m=!1,layout:w="column",linkAlign:_,linkRange:b,menuStyle:g,currentPage:k,menuStylePhone:A,menuPanelWidth:u,menuPanelTintColor:R,menuPanelTintOpacity:v}){const f=le(w,k),{live:Q,ready:W}=Se(),N=!c&&De({id:t?.id,handle:t?.handle,editing:m,ready:W,live:Q}),i=c?c.map(Ke):N?[]:t?.items??[],r=h||(c?"":t?.name)||"",[y,U]=P(!1);if(X(()=>{if(!E)return;const d=window.matchMedia("(max-width: 800px)"),x=()=>U(d.matches);return x(),d.addEventListener("change",x),()=>d.removeEventListener("change",x)},[E]),c&&i.length===0)return m?e(M,{as:"p",className:B,children:O(Ze)}):null;if(w==="row"&&m&&!N&&i.length>0&&!Y(n))return e(M,{as:"p",className:B,children:O(ie)});if(w==="row"&&g===Be){const{strip:d}=ne(g,A),x=e(Je,{owner:n,items:N?null:i,label:r,editing:m,markCurrent:f,strip:d});return d?p(H,{children:[x,e(se,{owner:n,items:N?null:i,label:r,editing:m,markCurrent:f,menuStyle:g,menuStylePhone:A})]}):x}if(w==="row")return e(se,{owner:n,items:N?null:i,label:r,editing:m,linkAlign:_,linkRange:b,markCurrent:f,menuStyle:g,menuStylePhone:A,panelLook:{width:u,tintColor:R,tintOpacity:v}});const S=d=>e("ul",{className:Ve,...l("menu"),children:e(I,{owner:n,items:d,place:{place:"column"},wrap:(x,D)=>e("li",{className:d?oe(C,D.index):`text-fg ${oe(C,D.index)}`,...l("menu-item"),children:x})})});return N?p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[e("h4",{className:G,...l("heading"),children:h?$(h):O(Ie)}),S(null),e("p",{className:`mt-3 ${B}`,children:O(Ue)})]}):i.length===0||!Y(n)?p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,m?e("p",{className:B,children:i.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(ie)}):null]}):E&&y?p(M,{as:"details",className:"min-w-0 border-b border-line",...l("menu-block"),children:[p("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:[$(r),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:S(i)})]}):p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,S(i)]})}export{en as default};
|
|
1
|
+
"use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as Ne,useCallback as Ee,useContext as Te,useEffect as J,useRef as F,useState as P}from"react";import{createPortal as Ce}from"react-dom";import{CloseIcon as ee,MenuIcon as _e}from"efficient-shell/icons/efficient-glyphs";import ye from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as ne}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Me,REPEAT_INDEX_ATTRIBUTE as ke}from"efficient-easel/draw";import{MenuPlaceContext as ve}from"./MenuLinkBlock.js";import{CardRowContext as Le,CardTemplateRows as Oe}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as te}from"./HeaderTools.js";import{usePhoneMenuTools as Ae}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Re}from"./SearchContext.js";import{useModalDismiss as Se}from"./useModalDismiss.js";import{PhoneSheet as Pe}from"./PhoneSheet.js";import{useAccountInPhoneMenu as Ie}from"./PhoneMenuAccount.js";import{usePreviewMenus as Ue}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as De,FOOTER_MENU_PLACEHOLDER_HEADING as He,FOOTER_MENU_PLACEHOLDER_HINT as Fe}from"../lib/content/menu-placeholder.js";import{say as R}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as $e}from"../lib/menu-source.js";import{legacyBlockAlignOf as Be}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as ze,MENU_PANEL_WIDTH_DEFAULT as Ve,MENU_STYLE_BUTTON as re,MENU_STYLE_TABS as We,menuLinkInRange as Ye,menuShowClasses as le,resolveMenuLinkRange as je}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as oe}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as ae,currentLinkIndex as Qe,marksCurrentLink as ie}from"../lib/content/tab-strip.js";import{useAddressQuery as qe}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as Ge}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as k}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as Ke}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as Xe}from"../lib/document/document-nodes.js";import{textKindVars as Ze}from"../lib/content/text-kind-vars.js";const l=Ke(Xe),Je=`flex list-none flex-col gap-3 ${oe}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",en={font:"--sf-menu-panel-font",size:"--sf-menu-panel-size"},B="text-[12px] italic text-fg-dim/70",se=(n,t)=>n&&t>0?"border-t border-line pt-3":"",nn=n=>({label:n.label??"",url:n.href??"",served:n}),ce=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},tn=Array.from({length:De},()=>({label:"",href:""}));function I({owner:n,items:t,place:c,wrap:h,markCurrent:E=!1}){const T=t?t.map(ce):tn,m=Ge(),w=Te(de),y=t&&E?Qe(t.map(g=>g.url??""),m,w):-1,b=y<0?null:{index:y,href:t[y].url??""};return e(ve.Provider,{value:t?b?{...c,current:b}:c:{...c,placeholder:!0},children:e(Oe,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:T,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const z=n=>(n.template?.blockCount??0)>0,rn="Nothing to show yet: this menu's entries come from its Menu content.",me="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function ue({owner:n,items:t,label:c,editing:h,linkAlign:E,linkRange:T,markCurrent:m,menuStyle:w,menuStylePhone:y,panelLook:b,panelTextStyle:g}){const U=Be(E),C=je(T),V=!!C&&t!==null&&C.to!==void 0&&C.to<t.length,[u,S]=P(!1),v=F(null),f=Ae(),W=Ie(),{open:Y}=Re(),x=c||"Menu",i=Ee(()=>S(!1),[]),r=w===re||y===re,M=le(w,y),D=Ze(g,en),L=Object.keys(D).length>0?D:void 0,[d,N]=P("sheet"),O=F(null),K=F(null),[pe,he]=P(void 0),[A,fe]=P(null),X=()=>{if(!u&&r){const s=v.current?.ownerDocument.defaultView;N(s?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const o=O.current?.querySelector("span");if(o&&s){const a=s.getComputedStyle(o);he({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const _=(O.current?.querySelector("svg")??O.current)?.getBoundingClientRect();fe(_?{left:_.left,top:_.top,height:_.height}:null)}}S(s=>!s)};J(()=>{if(!u||!r)return;const o=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!o)return;const a=()=>S(!1);return o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[u,r]);const j=F(null);Se({active:u&&!(u&&r&&d==="side"),onDismiss:i,scopeRef:v,focusRef:j,trapRef:j});const we=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:m,wrap:(s,o)=>{const a=t!==null&&C&&!Ye(C,o.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,...l("menu-item"),children:s})}}),Q=(s,o,a)=>h?{[Me]:`${s}:${a<0?"panel":"dropdown"}`,[ke]:`${a+1}.${o.index}`}:null,be=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(s,o)=>p(H,{children:[e("li",{className:L?"flex min-h-12 items-center":"flex min-h-14 items-center border-b border-line",...Q(n.id,o,-1),...l("menu-item"),children:s}),t===null?null:(o.item?.dropdown_items??[]).map((a,_)=>e(Le.Provider,{value:{...o,row:ce(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...Q(n.id,o,_),...l("menu-item"),children:s})},_))]})}),ge=f&&(f.search||f.cart||f.region||f.account||f.theme)?f:null;if(!h&&t!==null&&!z(n)&&!ge)return null;const Z=e(Pe,{role:"dialog",panelRef:j,name:x,entries:be,tools:f,withAccount:!r||W,editing:h,onClose:i,onSearch:Y,phoneOnly:!r,marker:r?"sheet":void 0,listStyle:r&&A?{paddingLeft:A.left,paddingRight:A.left}:void 0,words:L});let q=null;if(r){const s=v.current?.ownerDocument,o={...ne,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:Ve,tintColor:typeof b?.tintColor=="string"?b.tintColor:ne.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:ze},a=e(ye,{look:o,drawer:{closeRef:K},open:!0,onClose:i,label:x,children:p("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:A?{paddingLeft:A.left}:void 0,children:p("button",{ref:K,type:"button",onClick:i,className:"inline-flex h-11 items-center gap-2",style:pe,children:[e(ee,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:te.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:A?{paddingLeft:A.left}:void 0,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(_,xe)=>e("li",{className:"flex min-h-12 items-center",...Q(n.id,xe,-1),...l("menu-item"),children:_})})})]})});q=p(H,{children:[p("button",{ref:O,type:"button",className:`mono-eyebrow-ctl ${M.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:X,...l("menu-button"),children:[L&&u&&d==="sheet"?e(ee,{size:20,"aria-hidden":"true"}):e(_e,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:te.menu})]}),u&&s?Ce(d==="side"?a:Z,s.body):null]})}else M.drawsButton&&(q=p(H,{children:[e("button",{type:"button",className:`${M.buttonHead} h-11 w-11 items-center justify-center${M.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:X,...l("menu-button"),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:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?Z:null]}));return p(k,{as:"nav",ref:v,"aria-label":x,"data-menu-row":"",...r?{"data-menu-show":"button"}:null,...!r&&U?{"data-menu-align":U}:null,...!r&&V?{"data-menu-part":"lead"}:null,className:"min-w-0",...l("menu-block"),children:[e("ul",{className:`m-0 ${M.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${oe} uppercase tracking-[0.18em]${M.listTail}`,...l("menu"),children:we}),q]})}function ln({owner:n,items:t,label:c,editing:h,markCurrent:E,strip:T=""}){return!h&&(t===null||t.length===0||!z(n))?null:e(k,{as:"nav","aria-label":c||"Menu","data-menu-tabs":"",className:T?`min-w-0 ${T}`:"min-w-0",...l("menu-block"),children:e("ul",{className:ae.list,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(m,w)=>e("li",{className:ae.item(w.index===0,h),...l("menu-item"),children:m})})})})}const de=Ne("");function on(n){const t=!n.editing&&ie(n.layout,n.currentPage),c=qe(n.pageQuery??"",t);return e(de.Provider,{value:c,children:e(an,{...n})})}function an({owner:n,menu:t,served:c,heading:h,accordionMobile:E=!1,showDividers:T=!1,editing:m=!1,layout:w="column",linkAlign:y,linkRange:b,menuStyle:g,currentPage:U,menuStylePhone:C,menuPanelWidth:V,menuPanelTintColor:u,menuPanelTintOpacity:S,menuPanelTextStyle:v}){const f=ie(w,U),{live:W,ready:Y}=Ue(),x=!c&&$e({id:t?.id,handle:t?.handle,editing:m,ready:Y,live:W}),i=c?c.map(nn):x?[]:t?.items??[],r=h||(c?"":t?.name)||"",[M,D]=P(!1);if(J(()=>{if(!E)return;const d=window.matchMedia("(max-width: 800px)"),N=()=>D(d.matches);return N(),d.addEventListener("change",N),()=>d.removeEventListener("change",N)},[E]),c&&i.length===0)return m?e(k,{as:"p",className:B,children:R(rn)}):null;if(w==="row"&&m&&!x&&i.length>0&&!z(n))return e(k,{as:"p",className:B,children:R(me)});if(w==="row"&&g===We){const{strip:d}=le(g,C),N=e(ln,{owner:n,items:x?null:i,label:r,editing:m,markCurrent:f,strip:d});return d?p(H,{children:[N,e(ue,{owner:n,items:x?null:i,label:r,editing:m,markCurrent:f,menuStyle:g,menuStylePhone:C})]}):N}if(w==="row")return e(ue,{owner:n,items:x?null:i,label:r,editing:m,linkAlign:y,linkRange:b,markCurrent:f,menuStyle:g,menuStylePhone:C,panelLook:{width:V,tintColor:u,tintOpacity:S},panelTextStyle:v});const L=d=>e("ul",{className:Je,...l("menu"),children:e(I,{owner:n,items:d,place:{place:"column"},wrap:(N,O)=>e("li",{className:d?se(T,O.index):`text-fg ${se(T,O.index)}`,...l("menu-item"),children:N})})});return x?p(k,{as:"div",className:"min-w-0",...l("menu-block"),children:[e("h4",{className:G,...l("heading"),children:h?$(h):R(He)}),L(null),e("p",{className:`mt-3 ${B}`,children:R(Fe)})]}):i.length===0||!z(n)?p(k,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,m?e("p",{className:B,children:i.length===0?R("This menu has no links yet — add them in {place}.",{place:R("Storefront → Menus")}):R(me)}):null]}):E&&M?p(k,{as:"details",className:"min-w-0 border-b border-line",...l("menu-block"),children:[p("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:[$(r),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:L(i)})]}):p(k,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,L(i)]})}export{on as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode, RefObject } from "react";
|
|
2
2
|
import type { PhoneMenuTools } from "efficient-web-builder/render/components/PhoneMenuTools";
|
|
3
|
-
export declare function PhoneSheet({ role, panelRef, name, entries, tools, withAccount, editing, onClose, onSearch, phoneOnly, marker, listStyle, }: {
|
|
3
|
+
export declare function PhoneSheet({ role, panelRef, name, entries, tools, withAccount, editing, onClose, onSearch, phoneOnly, marker, listStyle, words, }: {
|
|
4
4
|
role: "dialog";
|
|
5
5
|
panelRef: RefObject<HTMLDivElement | null>;
|
|
6
6
|
name: string;
|
|
@@ -13,4 +13,5 @@ export declare function PhoneSheet({ role, panelRef, name, entries, tools, withA
|
|
|
13
13
|
phoneOnly?: boolean;
|
|
14
14
|
marker?: string;
|
|
15
15
|
listStyle?: CSSProperties;
|
|
16
|
+
words?: Readonly<Record<string, string>>;
|
|
16
17
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as t}from"react/jsx-runtime";import y from"next/link";import N from"efficient-easel/screen/components/UiIcon";import v from"./CountrySelect.js";import T from"./ThemeToggle.js";import{useCart as _}from"./CartContext.js";import{CartGlyph as S,cartLabel as j,useHeaderGlyph as w,UTIL_WORDS as x}from"./HeaderTools.js";import{UNDER_HEADER_SHEET_CLASS as C}from"../lib/content/header-bar.js";const h="flex h-12 items-center gap-3 border border-line bg-bg px-4 text-left text-[15px]",R="m-0 flex list-none flex-col px-5 py-3 font-mono text-[16px] uppercase tracking-[0.18em]",k="m-0 flex list-none flex-col px-5 py-6 font-[family-name:var(--sf-menu-panel-font)] text-[length:var(--sf-menu-panel-size)]";function $({role:r,panelRef:a,name:o,entries:c,tools:e,withAccount:m,editing:f,onClose:i,onSearch:b,phoneOnly:g=!1,marker:u,listStyle:d,words:s}){const p=w(),l=e&&(e.search||e.cart||e.region||m&&e.account||e.theme)?e:null;return t("div",{ref:a,role:r,"aria-modal":"true","aria-label":o,tabIndex:-1,...u?{"data-menu-panel":u}:null,className:`${C} z-[60] flex flex-col overflow-y-auto bg-bg text-fg${g?" view-tablet:hidden":""}`,children:[n("ul",{className:s?k:R,style:s?{...d,...s}:d,children:c}),l?t("div",{className:"mt-auto flex flex-col gap-4 border-t border-line bg-surface p-5",children:[l.search?t("button",{type:"button",className:h,onClick:f?void 0:()=>{i(),b()},children:[n(N,{name:"search",size:p.size,strokeWidth:p.stroke,rounded:!0}),x.search]}):null,l.cart?n(L,{editing:f,onClose:i}):null,m&&l.account?t("div",{className:"flex items-center justify-between",children:[n("span",{className:"mono-eyebrow text-fg-dim",children:"Account"}),n(y,{href:"/account",onClick:i,className:"mono-eyebrow underline",children:"Your account"})]}):null,l.region?t("div",{className:"flex items-center justify-between",children:[n("span",{className:"mono-eyebrow text-fg-dim",children:"Region"}),n(v,{})]}):null,l.theme?t("div",{className:"flex items-center justify-between",children:[n("span",{className:"mono-eyebrow text-fg-dim",children:"Theme"}),n(T,{})]}):null]}):null]})}function L({editing:r,onClose:a}){const{open:o,totals:c}=_(),e=c.sets;return t("button",{type:"button",className:h,"aria-label":j(e),onClick:r?void 0:()=>{a(),o()},children:[n(S,{}),x.cart,e>0?` ${e}`:""]})}export{$ as PhoneSheet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{declaredBlockSource as k,sourcedRows as M}from"efficient-web-builder/format/lib/content/block-sources";import
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{declaredBlockSource as k,sourcedRows as M}from"efficient-web-builder/format/lib/content/block-sources";import S from"../../components/FooterMenu.js";import{addressQueryOf as x}from"../wheels/selected-ranges.js";import{menuLayoutOf as w}from"../content/tab-strip.js";import{MENU_BLOCK_TYPE as l}from"./document-nodes.js";import{resolveNavTextCase as A}from"../content/header-bar.js";const C={[l]:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment"},L="data-menu-case",N="column";function R({id:e,template:o,menu:r,dataSource:n,dataRows:d,heading:m,accordionMobile:s,showDividers:u,direction:c,linkAlign:f,linkRange:p,menuStyle:g,currentPage:P,menuStylePhone:E,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,menuPanelTextStyle:B,textCase:O,editor:t,...T}){const i=a(S,{owner:{id:String(e??""),type:l,template:o},menu:r,served:k({dataSource:n})?M({dataSource:n,dataRows:d},!!t?.isEditing).rows:void 0,heading:m||void 0,accordionMobile:s,showDividers:u,layout:w(c),linkAlign:f,linkRange:p,menuStyle:g,currentPage:P,pageQuery:x(T)||void 0,menuStylePhone:E,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,menuPanelTextStyle:B,editing:t?.isEditing});return A(O)!=="capitalised"?i:a("div",{className:"contents",[L]:"capitalised",children:i})}function G(e){for(const[r,n]of Object.entries(C))e[r]={...e[n]};const o=e.MenuBlock;o.defaultProps={...o.defaultProps,direction:N},o.render=R}export{L as MENU_CASE_ATTR,C as PAGE_BLOCKS_FROM_FOOTER,N as PAGE_MENU_DIRECTION_DEFAULT,G as addPageBlocksFromFooter};
|