efficient-storefront-blocks 0.133.10 → 0.133.11

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.
@@ -4811,3 +4811,20 @@ main.sf-themed-content ~ :has([data-footer-reveal="on"]) {
4811
4811
  bottom: 0;
4812
4812
  z-index: 0;
4813
4813
  }
4814
+
4815
+ /* The reveal's `Page shadow` (lib/content/footer-reveal): a shadow from the
4816
+ page's bottom edge down over the footer's words, 160 px deep. It is drawn by
4817
+ <main>, which sits above the footer, so it falls ON the words. Its strength
4818
+ is set on the page root from how much page is left, so it fades out over
4819
+ the last 160 px and the footer's top row is clear at the end. */
4820
+ body:has([data-footer-shadow="on"]) main.sf-themed-content::after {
4821
+ content: "";
4822
+ position: absolute;
4823
+ left: 0;
4824
+ right: 0;
4825
+ top: 100%;
4826
+ height: 160px;
4827
+ pointer-events: none;
4828
+ background: linear-gradient(180deg, color-mix(in srgb, var(--overlay-scrim) 85%, transparent) 0, transparent 100%);
4829
+ opacity: var(--sf-footer-shadow, 1);
4830
+ }
@@ -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, revealOnScroll, }: {
2
+ export default function SectionGroupBody({ place, sections: Sections, editing, widths, navTextCase, menuRow, toolTextStyle, iconSize, cartIcon, revealOnScroll, revealShadow, }: {
3
3
  place: "header" | "footer";
4
4
  sections: SlotComponent;
5
5
  editing?: boolean;
@@ -10,4 +10,5 @@ export default function SectionGroupBody({ place, sections: Sections, editing, w
10
10
  iconSize?: unknown;
11
11
  cartIcon?: unknown;
12
12
  revealOnScroll?: unknown;
13
+ revealShadow?: unknown;
13
14
  }): import("react").JSX.Element;
@@ -1 +1 @@
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};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import{useEffect as w,useState as y}from"react";import{PhoneMenuToolsProvider as _}from"efficient-web-builder/render/components/PhoneMenuTools";import{AccountInPhoneMenuProvider as b}from"./PhoneMenuAccount.js";import{SectionGroupWidthsProvider as A}from"efficient-web-builder/render/components/SiteGutterFrame";import{chromeOwnWidth as H}from"efficient-web-builder/format/lib/content/section-width";import{centredCap as P,SITE_WIDTH_CAP as L}from"efficient-web-builder/format/lib/content/page-width";import{resolveHeaderToolLook as x,resolveMenuRow as k,resolveNavTextCase as z}from"../lib/content/header-bar.js";import{HeaderToolLookContext as F}from"./HeaderTools.js";import{HideTaker as W}from"efficient-web-builder/render/components/ViewHideRoot";import{textKindVars as C}from"../lib/content/text-kind-vars.js";import{blockParts as p}from"../lib/block-parts.js";import{FOOTER_REVEAL_ATTR as M,FOOTER_SHADOW_ATTR as V,FOOTER_SHADOW_VAR as E,footerRevealOn as D,footerRevealWanted as j,footerShadowStrength as I,footerShadowWanted as B}from"../lib/content/footer-reveal.js";const G=p("SiteHeader")("header-content"),N=p("SiteFooter")("footer"),Y={font:"--sf-header-tool-font",size:"--sf-header-tool-size"};function q(e){const o=C(e,Y);return Object.keys(o).length?o:null}function K(e,o){const t=j(e)&&!o,[a,d]=y(!1);return w(()=>{if(!t){d(!1);return}const i=document.querySelector('[data-section-group="footer"]');if(!i)return;const n=()=>d(D(e,i.getBoundingClientRect().height,window.innerHeight,o));n(),window.addEventListener("resize",n);const l=typeof ResizeObserver>"u"?null:new ResizeObserver(n);return l?.observe(i),()=>{window.removeEventListener("resize",n),l?.disconnect()}},[t,e,o]),a}function $(e){w(()=>{if(!e)return;const o=document.documentElement,t=()=>o.style.setProperty(E,String(I(o.scrollHeight-(window.scrollY+window.innerHeight))));return t(),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t),o.style.removeProperty(E)}},[e])}function J({place:e,sections:o,editing:t=!1,widths:a,navTextCase:d,menuRow:i,toolTextStyle:n,iconSize:l,cartIcon:R,revealOnScroll:T,revealShadow:O}){const g=e==="footer"?"footer":"div",r=H(a),c=r.content==="full"?"100vw":r.contentMax===null?null:`${r.contentMax}px`,f=e==="footer"&&r.background==="content"?P(L):null,u=e==="header"?q(n):null,m=K(e==="footer"?T:void 0,t),h=m&&B(O);$(h);const S=c===null&&f===null&&u===null?void 0:{...f,...c===null?null:{"--sf-site-width":c},...u},v=s(W,{as:g,"data-section-group":e,...e==="header"?{"data-header-nav-case":z(d),"data-header-menu-row":k(i)??"top",...u?{"data-header-tool-style":String(n)}:null}:null,...m?{[M]:"on"}:null,...h?{[V]:"on"}:null,className:t&&e==="footer"?"sf-theme-surfaces bg-bg text-fg":void 0,style:S,...e==="header"?G:N,children:s(A,{value:{background:r.background,content:r.content==="content"?"content":null},children:s(o,{minEmptyHeight:120})})});return e==="header"?s(_,{children:s(b,{children:s(F.Provider,{value:x({cartIcon:R,iconSize:l}),children:v})})}):v}export{J as default};
@@ -1,3 +1,8 @@
1
1
  export declare const FOOTER_REVEAL_ATTR = "data-footer-reveal";
2
2
  export declare function footerRevealWanted(stored: unknown): boolean;
3
3
  export declare function footerRevealOn(stored: unknown, footerHeight: number, windowHeight: number, editing: boolean): boolean;
4
+ export declare const FOOTER_SHADOW_ATTR = "data-footer-shadow";
5
+ export declare const FOOTER_SHADOW_VAR = "--sf-footer-shadow";
6
+ export declare const FOOTER_SHADOW_PX = 160;
7
+ export declare function footerShadowWanted(stored: unknown): boolean;
8
+ export declare function footerShadowStrength(left: number): number;
@@ -1 +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
+ const f="data-footer-reveal";function n(t){return t===!0}function u(t,r,e,o){return!n(t)||o||!(r>0)||!(e>0)?!1:r<=e}const O="data-footer-shadow",s="--sf-footer-shadow",a=160;function R(t){return t===!0}function x(t){return Number.isNaN(t)?1:Math.min(1,Math.max(0,t/a))}export{f as FOOTER_REVEAL_ATTR,O as FOOTER_SHADOW_ATTR,a as FOOTER_SHADOW_PX,s as FOOTER_SHADOW_VAR,u as footerRevealOn,n as footerRevealWanted,x as footerShadowStrength,R as footerShadowWanted};
@@ -1 +1 @@
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};
1
+ import{jsx as n}from"react/jsx-runtime";import s from"../../../../../components/SectionGroupBody.js";import{SiteFooterMeta as d}from"./meta.js";const c={...d,render:({sections:o,editor:e,revealOnScroll:r,revealShadow:t,...i})=>n(s,{place:"footer",sections:o,widths:i,editing:e?.isEditing,revealOnScroll:r,revealShadow:t})};export{c as SiteFooterRender};