efficient-storefront-blocks 0.128.1 → 0.128.2

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.
@@ -4580,3 +4580,32 @@ em.text-accent {
4580
4580
  .sf-card-tracks:has(> :nth-child(12)):not(:has(> :nth-child(13))) {
4581
4581
  --sf-card-skip: calc(100% / 5 + 1px - clamp(0px, (100% - (min(6, var(--sf-cols)) * var(--sf-card-min) * 1px + (min(6, var(--sf-cols)) - 1) * var(--sf-card-gap))) * 1000, 100000px) - clamp(0px, (5 + 1 - var(--sf-cols)) * 100000px, 100000px));
4582
4582
  }
4583
+
4584
+ /* ─── The footer's `Reveal on scroll` ──────────────────────────────────────
4585
+ The Site Footer carries `data-footer-reveal="on"` only while its setting is
4586
+ on, the page is not being edited and the footer fits in the window
4587
+ (lib/content/footer-reveal, components/SectionGroupBody). Then the footer
4588
+ stays fixed at the bottom of the window and the page slides up off it.
4589
+
4590
+ ⚠️ WHY THE WRAPPER AND NOT THE <footer> ITSELF. Live, the footer sits three
4591
+ wrappers deep inside the box that is <main>'s sibling (measured in a real
4592
+ browser, 2026-11-25: body > .contents > header, main, div > div > div >
4593
+ footer). `position: sticky` holds an element only inside its parent, and
4594
+ each of those wrappers is exactly the footer's height, so a sticky <footer>
4595
+ would never move. The sibling of <main> that holds the footer is the box
4596
+ whose parent (via the `display: contents` carrier) is <body>, the page's
4597
+ full height, so that is the one made sticky. `:has()` reaches it, as the
4598
+ page-width rules above do.
4599
+
4600
+ <main> is lifted over it and paints the page colour, so the footer is
4601
+ hidden under the page until the page's bottom passes it. */
4602
+ body:has([data-footer-reveal="on"]) main.sf-themed-content {
4603
+ position: relative;
4604
+ z-index: 1;
4605
+ background: var(--bg);
4606
+ }
4607
+ main.sf-themed-content ~ :has([data-footer-reveal="on"]) {
4608
+ position: sticky;
4609
+ bottom: 0;
4610
+ z-index: 0;
4611
+ }
@@ -1,5 +1,5 @@
1
1
  import type { SlotComponent } from "efficient-easel/blocks";
2
- export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, toolTextStyle, iconSize, cartIcon, }: {
2
+ export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, toolTextStyle, iconSize, cartIcon, revealOnScroll, }: {
3
3
  place: "header" | "footer";
4
4
  sections: SlotComponent;
5
5
  editing?: boolean;
@@ -9,4 +9,5 @@ export default function SectionGroupBody({ place, sections: Sections, editing, w
9
9
  toolTextStyle?: unknown;
10
10
  iconSize?: unknown;
11
11
  cartIcon?: unknown;
12
+ revealOnScroll?: unknown;
12
13
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{PhoneMenuToolsProvider as g}from"efficient-web-builder/render/components/PhoneMenuTools";import{AccountInPhoneMenuProvider as P}from"./PhoneMenuAccount.js";import{SectionGroupWidthsProvider as b}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as x}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as k,SITE_WIDTH_CAP as S}from"efficient-web-builder/format/lib/content/page-width";import{resolveHeaderToolLook as y,resolveMenuRow as H,resolveNavTextCase as _}from"../lib/content/header-bar.js";import{HeaderToolLookContext as w}from"./HeaderTools.js";import{HideTaker as A}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as E}from"../lib/content/text-kind-vars.js";import{blockParts as a}from"../lib/block-parts.js";const O=a("SiteHeader")("header-content"),R=a("SiteFooter")("footer"),M={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function C(o){const n=E(o,M);return Object.keys(n).length?n:null}function L({place:o,sections:n,editing:c=!1,widths:u,navTextCase:f,menuRow:m,toolTextStyle:s,iconSize:h,cartIcon:v}){const p=o==="footer"?"footer":"div",e=x(u),r=e.content==="full"?"100vw":e.contentMax===null?null:`${e.contentMax}px`,d=o==="footer"&&e.background==="content"?k(S):null,l=o==="header"?C(s):null,T=r===null&&d===null&&l===null?void 0:{...d,...r===null?null:{"--sf-site-width":r},...l},i=t(A,{as:p,"data-section-group":o,...o==="header"?{"data-header-nav-case":_(f),"data-header-menu-row":H(m)??"top",...l?{"data-header-tool-style":String(s)}:null}:null,className:c&&o==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:T,...o==="header"?O:R,children:t(b,{value:{background:e.background,content:e.content==="content"?"content":null},children:t(n,{minEmptyHeight:120})})});return o==="header"?t(g,{children:t(P,{children:t(w.Provider,{value:y({cartIcon:v,iconSize:h}),children:i})})}):i}export{L as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{useEffect as g,useState as b}from"react";import{PhoneMenuToolsProvider as E}from"efficient-web-builder/render/components/PhoneMenuTools";import{AccountInPhoneMenuProvider as O}from"./PhoneMenuAccount.js";import{SectionGroupWidthsProvider as P}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as S}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as x,SITE_WIDTH_CAP as y}from"efficient-web-builder/format/lib/content/page-width";import{resolveHeaderToolLook as _,resolveMenuRow as k,resolveNavTextCase as A}from"../lib/content/header-bar.js";import{HeaderToolLookContext as H}from"./HeaderTools.js";import{HideTaker as L}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as z}from"../lib/content/text-kind-vars.js";import{blockParts as h}from"../lib/block-parts.js";import{FOOTER_REVEAL_ATTR as C,footerRevealOn as M,footerRevealWanted as F}from"../lib/content/footer-reveal.js";const V=h("SiteHeader")("header-content"),W=h("SiteFooter")("footer"),j={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function I(e){const o=z(e,j);return Object.keys(o).length?o:null}function B(e,o){const s=F(e)&&!o,[d,l]=b(!1);return g(()=>{if(!s){l(!1);return}const i=document.querySelector('[data-section-group="footer"]');if(!i)return;const t=()=>l(M(e,i.getBoundingClientRect().height,window.innerHeight,o));t(),window.addEventListener("resize",t);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(t);return a?.observe(i),()=>{window.removeEventListener("resize",t),a?.disconnect()}},[s,e,o]),d}function D({place:e,sections:o,editing:s=!1,widths:d,navTextCase:l,menuRow:i,toolTextStyle:t,iconSize:a,cartIcon:v,revealOnScroll:p}){const w=e==="footer"?"footer":"div",n=S(d),u=n.content==="full"?"100vw":n.contentMax===null?null:`${n.contentMax}px`,f=e==="footer"&&n.background==="content"?x(y):null,c=e==="header"?I(t):null,R=B(e==="footer"?p:void 0,s),T=u===null&&f===null&&c===null?void 0:{...f,...u===null?null:{"--sf-site-width":u},...c},m=r(L,{as:w,"data-section-group":e,...e==="header"?{"data-header-nav-case":A(l),"data-header-menu-row":k(i)??"top",...c?{"data-header-tool-style":String(t)}:null}:null,...R?{[C]:"on"}:null,className:s&&e==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:T,...e==="header"?V:W,children:r(P,{value:{background:n.background,content:n.content==="content"?"content":null},children:r(o,{minEmptyHeight:120})})});return e==="header"?r(E,{children:r(O,{children:r(H.Provider,{value:_({cartIcon:v,iconSize:a}),children:m})})}):m}export{D as default};
@@ -0,0 +1,3 @@
1
+ export declare const FOOTER_REVEAL_ATTR = "data-footer-reveal";
2
+ export declare function footerRevealWanted(stored: unknown): boolean;
3
+ export declare function footerRevealOn(stored: unknown, footerHeight: number, windowHeight: number, editing: boolean): boolean;
@@ -0,0 +1 @@
1
+ const a="data-footer-reveal";function o(e){return e===!0}function f(e,r,t,n){return!o(e)||n||!(r>0)||!(t>0)?!1:r<=t}export{a as FOOTER_REVEAL_ATTR,f as footerRevealOn,o as footerRevealWanted};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import i from"../../../../../components/SectionGroupBody.js";import{SiteFooterMeta as s}from"./meta.js";const p={...s,render:({sections:o,editor:t,...e})=>r(i,{place:"footer",sections:o,widths:e,editing:t?.isEditing})};export{p as SiteFooterRender};
1
+ import{jsx as i}from"react/jsx-runtime";import n from"../../../../../components/SectionGroupBody.js";import{SiteFooterMeta as s}from"./meta.js";const c={...s,render:({sections:o,editor:e,revealOnScroll:r,...t})=>i(n,{place:"footer",sections:o,widths:t,editing:e?.isEditing,revealOnScroll:r})};export{c as SiteFooterRender};