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.
- package/CHANGELOG.md +11 -0
- package/dist/editor/lib/document/blocks/service/SiteFooter/fields.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 +24 -24
- package/dist/render/app/globals.css +29 -0
- package/dist/render/components/SectionGroupBody.d.ts +2 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/lib/content/footer-reveal.d.ts +3 -0
- package/dist/render/lib/content/footer-reveal.js +1 -0
- package/dist/render/lib/document/blocks/service/SiteFooter/render.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
|
@@ -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
|
|
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 @@
|
|
|
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
|
|
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};
|