efficient-web-builder 30.1.0 → 30.1.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 CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 30.1.2 - 2026-10-21
6
+
7
+ ### Fixed
8
+
9
+ - **Events (efficient-storefront-blocks) is a band section.** Its words sit in `SITE_COLUMN` inside its band, so its old Width row moved the band only. 30.0.0 put it in the `both` family, where an untouched Events would read as Content Full width and its words would run to the screen edge once it drew the two rows. It is in the `background` family now (like Q&A), and it leaves the waiting list: the pass draws both rows from outside and the words already read `--sf-site-width`, so no blocks release is needed. Unset and old Full stored: nothing drawn; old Content width: the band box, as before.
10
+
11
+ ### Guards
12
+
13
+ - `scripts/test-section-width-mapping.ts`: Events' rows (red first).
14
+ - `scripts/test-section-width-draw.tsx` §15 (red on 30.1.1): Events draws the two rows with no flag.
15
+
16
+ ## 30.1.1 - 2026-10-21
17
+
18
+ ### Fixed
19
+
20
+ - **Product Grid's Content width framed the whole section.** Its old Content width wrapped the whole section in the site `FRAME` (the column plus its gutter) and capped the grid at its own number inside it. The 30.0.0 mapping pinned Content only, so a Product Grid moved onto the two rows would have lost the frame. The mapping now pins Background to Content width too, and the width pass draws that band as the `FRAME`, outside the content override, so the frame reads the site's width. Found by a pixel check of efficient-storefront-blocks' Product Grid on 29.0.0 against this release; after the fix all 94 cases match at 1920, 1280 and 390 px.
21
+ - **The `productGrid` family draws like Brand Text and Section Header.** The pass tells the grid Full or Content (`widthMode`) and hands no stored `pageWidth` on: the old number is Content's own number, and the grid caps at `--sf-site-width`, never at the stored number as well. No web-builder section is in this family; Product Grid (efficient-storefront-blocks) moves when its render says `widthRows: "two"`.
22
+
23
+ ### Guards
24
+
25
+ - `scripts/test-section-width-draw.tsx` §14 (red first): an unset grid draws no wrapper; an old Content width draws the `FRAME` band and the number inside it.
26
+ - `scripts/test-section-width-mapping.ts`: Product Grid's two Content-width rows pin Background too (red first).
27
+
5
28
  ## 30.1.0 - 2026-10-21
6
29
 
7
30
  **Every web-builder section draws the two Width rows** (Background, Content — 30.0.0's rows, mockup v6). 30.0.0 moved the heroes, Scroll-Over Text and the band sections; this moves the rest.
@@ -1 +1 @@
1
- import{PAGE_WIDTH as p}from"./page-width.js";const b=["contained","page","full"],T=["full","page"],M={full:"Full width",page:"Content width"},h="inherit",k=t=>typeof t=="string"&&b.includes(t),i=t=>t===h;function c(t,n){const e=typeof t.pageWidth=="number"?t.pageWidth:p.default;return i(t.widthMode)?{mode:"full",pageWidth:e,inherited:!0}:t.widthMode==="contained"?{mode:"page",pageWidth:e,inherited:!1}:k(t.widthMode)?{mode:t.widthMode,pageWidth:e,inherited:!1}:t.contained===!0?{mode:"page",pageWidth:e,inherited:!1}:typeof t.fullWidth=="boolean"?{mode:t.fullWidth?"full":"page",pageWidth:e,inherited:!1}:t.contained===!1?{mode:"full",pageWidth:e,inherited:!1}:{mode:n,pageWidth:e,inherited:n==="full"}}function C(t){return c(t,"page").mode==="full"}const l="site",s={Hero:"hero",HeroSingle:"hero",IntroBleed:"scrollOver",SpecStrip:"background",Timeline:"background",Footprint:"background",Prose:"background",ParagraphsA:"background",Cards:"background",KeyFeatures:"background",Chart:"background",Mockup:"background",Testimonials:"background",TitleWithButtons:"background",Countdown:"background",DocMasthead:"background",DocBody:"background",DocMetaCards:"background",Gallery:"background",GalleryB:"background",Reviews:"background",ReviewForm:"background",Form:"background",AppointmentBooking:"background",FAQ:"background",Split:"both",Breadcrumb:"both",Collections:"both",Events:"both",BrandStrip:"both",CatalogFilterBar:"both",AlloyWheelsListing:"both",Banner:"contained",Stats:"contained",Logos:"contained",Divider:"contained",OrderSummary:"contained",DeliveryOptions:"contained",PaymentBadges:"contained",CheckoutCTA:"contained",Flex:"contained",Grid:"contained",Manifesto:"contentColumn",SectionHeader:"contentFull",ProductHero:"contentFull",ProductGrid:"productGrid",TimelineTrack:"capped",DetailRows:"capped",FitmentTable:"capped",TyreSizes:"capped",TyreFitment:"capped",EuTyreLabel:"capped",BundleOffer:"capped",CompatibleTyres:"capped",RelatedProducts:"capped",ProcessSteps:"capped",StatsParagraph:"capped",Masthead:"capped",FeaturedCover:"capped",LongRead:"capped",Series:"capped",ContactLocations:"capped",FitmentFinder:"capped",SpecTable:"capped",Subscribe:"capped",SubscribeBlogs:"capped",ContactRouting:"capped",SubmitBuild:"capped"};function m(t){return Object.prototype.hasOwnProperty.call(s,t)}const u=t=>t==="full"||t==="content",W=t=>typeof t=="number"&&Number.isFinite(t)&&t>0,g=({widthMode:t,fullWidth:n,pageWidth:e})=>({widthMode:t,fullWidth:n,pageWidth:e});function x(t,n){const e={background:null,content:null,contentMax:null};switch(t){case"hero":return i(n.widthMode)||n.widthMode!=="full"?e:{...e,background:"full"};case"scrollOver":return n.fullWidth===!1?e:{...e,content:"full"};case"background":return c(n,"full").mode==="full"?e:{...e,background:"content"};case"both":return c(n,"full").mode==="full"?{...e,content:"full"}:{...e,background:"content"};case"contained":return c(n,"page").mode==="full"?{...e,content:"full"}:{...e,background:"content"};case"contentColumn":return c(g(n),"page").mode==="full"?{...e,content:"full"}:e;case"contentFull":return c(g(n),"full").mode==="full"?{...e,content:"full"}:e;case"productGrid":{const o=c(n,"full");return o.mode==="full"?{...e,content:"full"}:{...e,content:"content",contentMax:o.pageWidth}}case"capped":return{...e,background:"content"}}}function y(t,n){if(!m(t))return{background:null,content:null,contentMax:null};const e=s[t],o=n,r=x(e,o),d=o.backgroundWidth===l?null:u(o.backgroundWidth)?o.backgroundWidth:r.background;return o.contentWidth===l?{background:d,content:null,contentMax:null}:u(o.contentWidth)?{background:d,content:o.contentWidth,contentMax:o.contentWidth==="content"&&W(o.contentMax)?o.contentMax:null}:{background:d,content:r.content,contentMax:r.contentMax}}const f="siteWidths";function a(t){return u(t)?t:null}function F(t,n){return{[f]:{background:a(t),content:a(n)}}}function w(t){const e=t.puck?.metadata?.[f];return{background:a(e?.background),content:a(e?.content)}}export{l as FOLLOW_SITE,T as SECTION_WIDTH_CHOICES,s as SECTION_WIDTH_FAMILY,f as SITE_WIDTHS_KEY,M as WIDTH_CHOICE_LABEL,h as WIDTH_INHERIT,b as WIDTH_MODES,i as isInheritValue,a as normalizeSiteBackground,y as resolveSectionWidth,c as resolveWidth,m as sectionHasWidthRows,C as sectionRunsFullWidth,F as siteWidthsMetadata,w as siteWidthsOf};
1
+ import{PAGE_WIDTH as p}from"./page-width.js";const b=["contained","page","full"],T=["full","page"],M={full:"Full width",page:"Content width"},h="inherit",k=t=>typeof t=="string"&&b.includes(t),i=t=>t===h;function c(t,n){const e=typeof t.pageWidth=="number"?t.pageWidth:p.default;return i(t.widthMode)?{mode:"full",pageWidth:e,inherited:!0}:t.widthMode==="contained"?{mode:"page",pageWidth:e,inherited:!1}:k(t.widthMode)?{mode:t.widthMode,pageWidth:e,inherited:!1}:t.contained===!0?{mode:"page",pageWidth:e,inherited:!1}:typeof t.fullWidth=="boolean"?{mode:t.fullWidth?"full":"page",pageWidth:e,inherited:!1}:t.contained===!1?{mode:"full",pageWidth:e,inherited:!1}:{mode:n,pageWidth:e,inherited:n==="full"}}function C(t){return c(t,"page").mode==="full"}const l="site",s={Hero:"hero",HeroSingle:"hero",IntroBleed:"scrollOver",SpecStrip:"background",Timeline:"background",Footprint:"background",Prose:"background",ParagraphsA:"background",Cards:"background",KeyFeatures:"background",Chart:"background",Mockup:"background",Testimonials:"background",TitleWithButtons:"background",Countdown:"background",DocMasthead:"background",DocBody:"background",DocMetaCards:"background",Gallery:"background",GalleryB:"background",Reviews:"background",ReviewForm:"background",Form:"background",AppointmentBooking:"background",FAQ:"background",Events:"background",Split:"both",Breadcrumb:"both",Collections:"both",BrandStrip:"both",CatalogFilterBar:"both",AlloyWheelsListing:"both",Banner:"contained",Stats:"contained",Logos:"contained",Divider:"contained",OrderSummary:"contained",DeliveryOptions:"contained",PaymentBadges:"contained",CheckoutCTA:"contained",Flex:"contained",Grid:"contained",Manifesto:"contentColumn",SectionHeader:"contentFull",ProductHero:"contentFull",ProductGrid:"productGrid",TimelineTrack:"capped",DetailRows:"capped",FitmentTable:"capped",TyreSizes:"capped",TyreFitment:"capped",EuTyreLabel:"capped",BundleOffer:"capped",CompatibleTyres:"capped",RelatedProducts:"capped",ProcessSteps:"capped",StatsParagraph:"capped",Masthead:"capped",FeaturedCover:"capped",LongRead:"capped",Series:"capped",ContactLocations:"capped",FitmentFinder:"capped",SpecTable:"capped",Subscribe:"capped",SubscribeBlogs:"capped",ContactRouting:"capped",SubmitBuild:"capped"};function m(t){return Object.prototype.hasOwnProperty.call(s,t)}const u=t=>t==="full"||t==="content",W=t=>typeof t=="number"&&Number.isFinite(t)&&t>0,g=({widthMode:t,fullWidth:n,pageWidth:e})=>({widthMode:t,fullWidth:n,pageWidth:e});function x(t,n){const e={background:null,content:null,contentMax:null};switch(t){case"hero":return i(n.widthMode)||n.widthMode!=="full"?e:{...e,background:"full"};case"scrollOver":return n.fullWidth===!1?e:{...e,content:"full"};case"background":return c(n,"full").mode==="full"?e:{...e,background:"content"};case"both":return c(n,"full").mode==="full"?{...e,content:"full"}:{...e,background:"content"};case"contained":return c(n,"page").mode==="full"?{...e,content:"full"}:{...e,background:"content"};case"contentColumn":return c(g(n),"page").mode==="full"?{...e,content:"full"}:e;case"contentFull":return c(g(n),"full").mode==="full"?{...e,content:"full"}:e;case"productGrid":{const o=c(n,"full");return o.mode==="full"?{...e,content:"full"}:{background:"content",content:"content",contentMax:o.pageWidth}}case"capped":return{...e,background:"content"}}}function y(t,n){if(!m(t))return{background:null,content:null,contentMax:null};const e=s[t],o=n,r=x(e,o),d=o.backgroundWidth===l?null:u(o.backgroundWidth)?o.backgroundWidth:r.background;return o.contentWidth===l?{background:d,content:null,contentMax:null}:u(o.contentWidth)?{background:d,content:o.contentWidth,contentMax:o.contentWidth==="content"&&W(o.contentMax)?o.contentMax:null}:{background:d,content:r.content,contentMax:r.contentMax}}const f="siteWidths";function a(t){return u(t)?t:null}function F(t,n){return{[f]:{background:a(t),content:a(n)}}}function w(t){const e=t.puck?.metadata?.[f];return{background:a(e?.background),content:a(e?.content)}}export{l as FOLLOW_SITE,T as SECTION_WIDTH_CHOICES,s as SECTION_WIDTH_FAMILY,f as SITE_WIDTHS_KEY,M as WIDTH_CHOICE_LABEL,h as WIDTH_INHERIT,b as WIDTH_MODES,i as isInheritValue,a as normalizeSiteBackground,y as resolveSectionWidth,c as resolveWidth,m as sectionHasWidthRows,C as sectionRunsFullWidth,F as siteWidthsMetadata,w as siteWidthsOf};
@@ -1 +1 @@
1
- import{jsx as u}from"react/jsx-runtime";import{resolveContainerDirection as m}from"../../../../format/lib/content/container-direction.js";import{IMAGE_WIDTH as p}from"../../../../format/lib/content/image-width.js";import{HERO_BACKGROUND_VAR as A,HERO_CHROME_CAP_VAR as W,HERO_CHROME_INSET_VAR as b,SITE_WIDTH_CAP as h,centredCap as R,heroBackgroundTokens as B}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as I,resolveSectionWidth as g,resolveWidth as N,sectionHasWidthRows as y,siteWidthsOf as F}from"../../../../format/lib/content/section-width.js";import{isInsideSiteGutter as H}from"../../../../format/lib/content/site-gutter.js";import{SplitBandAndColumn as D}from"../../../components/SiteGutterFrame.js";import{parentCapsWidth as P}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as E,withRowsShownWhen as O}from"../../../../format/lib/puck/show-when-attach.js";import{findParentNode as M,isNestedNode as G}from"../../../../format/lib/puck/passes/document-position.js";const k=new Set(["ProductGrid","RelatedProducts","DeliveryOptions","CheckoutCTA","Ticker","CategoryBar","DocTabs","CustomHTML","Spacer"]),L=new Set(["ProductHero"]),V=new Set(["Collections","Events","BrandStrip","CatalogFilterBar","AlloyWheelsListing","DeliveryOptions","CheckoutCTA","ProductHero","ProductGrid","DetailRows","FitmentTable","TyreSizes","TyreFitment","EuTyreLabel","BundleOffer","CompatibleTyres","RelatedProducts","FitmentFinder","SpecTable","Subscribe","SubscribeBlogs","ContactRouting","SubmitBuild"]);function S(t,n){return y(t)?!V.has(t)||n?.widthRows==="two":!1}const T="--sf-sw-site",j="--sf-sw-content",$="--sf-bg-cap",U="contents [--sf-site-width:var(--sf-sw-content)] max-[800px]:[--sf-site-width:var(--sf-sw-site)]";function C(t,n){const e=n==="content";return t.content==="full"?e?null:"100vw":t.content==="content"&&t.contentMax!==null?e?`min(${t.contentMax}px,var(${T}))`:`${t.contentMax}px`:null}function w(t,n){return n===null?t:u("div",{className:"contents",style:{[T]:h},children:u("div",{className:U,style:{[j]:n},children:t})})}const K="--sf-content-cap",Y="contents max-[800px]:[--sf-content-cap:none]";function z(t,n){if((t.content??"content")==="full")return null;const e=n==="content";return t.contentMax!==null?e?`min(${t.contentMax}px,var(${T}))`:`${t.contentMax}px`:e?null:`var(${T})`}function X(t,n){return n===null?t:u("div",{className:"contents",style:{[T]:h},children:u("div",{className:Y,style:{[K]:n},children:t})})}const _=(t,n)=>t==="content"?u("div",{style:R(h),children:n}):n;function q(t,n){const e=I[n],i=t.render;t.render=o=>{const s=F(o),l=g(n,o),r={...l,content:l.content??s.content};if(e==="hero"){const d=r.background??s.background,f=w(i(o),C(r,d));return d==="full"?u("div",{style:{[A]:"none",[b]:"initial",[W]:"initial"},children:f}):d==="content"?u("div",{style:B(!0),children:f}):f}const c=r.background??s.background??"full";if(e==="scrollOver"){const d=(r.content??"content")==="full",f=w(i({...o,fullWidth:d}),d?null:C(r,c));return c==="content"?u("div",{className:"contents",style:{[$]:h},children:f}):f}const a=r.content??"content";switch(e){case"both":return _(c,X(i(o),z(r,c)));case"contained":{if(a==="full")return _(c,i({...o,contained:!1}));const d=C(r,c);if(c==="content"&&d===null)return i({...o,contained:!0});const f=u(D,{children:i({...o,contained:!0})});return _(c,w(f,d))}case"contentColumn":case"contentFull":{const f={...o,widthMode:a==="full"?"full":"page",fullWidth:void 0,contained:void 0};return _(c,w(i(f),a==="full"?null:C(r,c)))}default:return _(c,w(i(o),C(r,c)))}}}const ht={name:"sectionWidth",applies:(t,n,e)=>(n.isSection(t)&&!k.has(t)||S(t,e))&&!!e&&typeof e.render=="function",panel(t,n,e){if(S(n,t)){const s=e.sectionWidthFields(n),l={...t.fields,...s};t.fields=I[n]==="contained"?v(n,t,l,Object.keys(s)):l;return}const i=e.widthField;t.fields={...t.fields,...i("full")};const o=t.resolveFields;t.resolveFields=(s,l)=>{const r=o?o(s,l):l.fields,c=N(s?.props??{},"full");return r&&typeof r.then=="function"?r.then(a=>x(a,c)):x(r,c)}},draw(t,n){if(S(n,t)){q(t,n);return}const e=L.has(n),i=t.render;t.render=o=>{const{mode:s}=N(o,"full"),l=i(o);if(s==="full")return l;const r=R(h);return e?u("div",{style:{"--sf-page-cap":h},children:l}):u("div",{style:r,children:l})}}};function x(t,n){if(!t||!("widthMode"in t))return t;const e={...t},i=e.widthMode;return i&&(e.widthMode={...i,currentValue:n.mode,inherited:n.inherited}),e}const J=new Set(["Heading","Text","ImageBlock","ButtonBlock","Banner","Stats","Logos","Divider","Flex","Grid","OrderSummary","DeliveryOptions","PaymentBadges","CheckoutCTA"]),pt={name:"containedWidth",applies:(t,n,e)=>J.has(t)&&!S(t,e)&&!!e&&typeof e.render=="function",panel(t,n,e){const i=e.widthField;t.fields=v(n,t,{...t.fields,...i("page")});const o=t.resolveFields;t.resolveFields=(s,l)=>{const r=o?o(s,l):l.fields,c=N(s?.props??{},"page"),a=d=>x(d,c);return r&&typeof r.then=="function"?r.then(a):a(r)}},draw(t){const n=t.render;t.render=e=>{const{mode:i}=N(e,"page");return n({...e,contained:i!=="full"})}}},Q={not:{context:"inHeroGroupRow",is:!0}},Tt={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=O(n.fields??{},["align"],Q),E(n,{inHeroGroupRow:(e,i)=>{const o=M(i.appState,e.props?.id);return!!o&&o.type==="HeroGroup"&&m("HeroGroup",o.props?.direction)==="row"}})}};function Z(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const tt={any:[]},nt={not:{context:"insideSiteGutter",is:!0}},et={not:{context:"widthCappedByParent",is:!0}};function v(t,n,e,i=["widthMode","pageWidth"]){return t==="ButtonBlock"?O(e,["_gWidth",...i],tt):Z(e)?(E(n,{insideSiteGutter:(o,s)=>H(s.appState?.data?.content,o.props?.id)}),O(e,i,nt)):(E(n,{widthCappedByParent:(o,s)=>"parent"in s?P(s.parent):G({props:o.props??{}},s)}),O(e,i,et))}const Ct={name:"imageWidth",applies:t=>t==="ImageBlock",panel(t,n,e){const{slider:i,WidthIcon:o}=e;if(t?.fields){const s=i("Image width",u(o,{}),p.min,p.max,p.step,p.fallback,p.unit),l="focal",r=Object.entries(t.fields),c=r.findIndex(([a])=>a===l);t.fields=Object.fromEntries(c===-1?[...r,["width",s]]:[...r.slice(0,c+1),["width",s],...r.slice(c+1)])}}};export{$ as SECTION_BACKGROUND_VAR,Y as SECTION_CONTENT_CAP_CLASS,K as SECTION_CONTENT_CAP_VAR,U as SECTION_CONTENT_CLASS,j as SECTION_CONTENT_VAR,T as SITE_CONTENT_VAR,Tt as buttonAlignInRow,pt as containedWidth,C as contentOverride,S as drawsTwoWidthRows,Ct as imageWidth,ht as sectionWidth,x as widthModeFields};
1
+ import{jsx as d}from"react/jsx-runtime";import{resolveContainerDirection as A}from"../../../../format/lib/content/container-direction.js";import{IMAGE_WIDTH as p}from"../../../../format/lib/content/image-width.js";import{HERO_BACKGROUND_VAR as W,HERO_CHROME_CAP_VAR as b,HERO_CHROME_INSET_VAR as g,SITE_WIDTH_CAP as h,centredCap as m,heroBackgroundTokens as B}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as I,resolveSectionWidth as y,resolveWidth as N,sectionHasWidthRows as F,siteWidthsOf as H}from"../../../../format/lib/content/section-width.js";import{isInsideSiteGutter as D}from"../../../../format/lib/content/site-gutter.js";import{SplitBandAndColumn as M}from"../../../components/SiteGutterFrame.js";import{FRAME as P}from"../../../components/BlockFrame.js";import{parentCapsWidth as G}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as x,withRowsShownWhen as O}from"../../../../format/lib/puck/show-when-attach.js";import{findParentNode as k,isNestedNode as L}from"../../../../format/lib/puck/passes/document-position.js";const V=new Set(["ProductGrid","RelatedProducts","DeliveryOptions","CheckoutCTA","Ticker","CategoryBar","DocTabs","CustomHTML","Spacer"]),j=new Set(["ProductHero"]),$=new Set(["Collections","BrandStrip","CatalogFilterBar","AlloyWheelsListing","DeliveryOptions","CheckoutCTA","ProductHero","ProductGrid","DetailRows","FitmentTable","TyreSizes","TyreFitment","EuTyreLabel","BundleOffer","CompatibleTyres","RelatedProducts","FitmentFinder","SpecTable","Subscribe","SubscribeBlogs","ContactRouting","SubmitBuild"]);function S(t,n){return F(t)?!$.has(t)||n?.widthRows==="two":!1}const T="--sf-sw-site",U="--sf-sw-content",K="--sf-bg-cap",Y="contents [--sf-site-width:var(--sf-sw-content)] max-[800px]:[--sf-site-width:var(--sf-sw-site)]";function C(t,n){const e=n==="content";return t.content==="full"?e?null:"100vw":t.content==="content"&&t.contentMax!==null?e?`min(${t.contentMax}px,var(${T}))`:`${t.contentMax}px`:null}function w(t,n){return n===null?t:d("div",{className:"contents",style:{[T]:h},children:d("div",{className:Y,style:{[U]:n},children:t})})}const z="--sf-content-cap",X="contents max-[800px]:[--sf-content-cap:none]";function q(t,n){if((t.content??"content")==="full")return null;const e=n==="content";return t.contentMax!==null?e?`min(${t.contentMax}px,var(${T}))`:`${t.contentMax}px`:e?null:`var(${T})`}function J(t,n){return n===null?t:d("div",{className:"contents",style:{[T]:h},children:d("div",{className:X,style:{[z]:n},children:t})})}const _=(t,n)=>t==="content"?d("div",{style:m(h),children:n}):n;function Q(t,n){const e=I[n],i=t.render;t.render=o=>{const s=H(o),l=y(n,o),r={...l,content:l.content??s.content};if(e==="hero"){const u=r.background??s.background,f=w(i(o),C(r,u));return u==="full"?d("div",{style:{[W]:"none",[g]:"initial",[b]:"initial"},children:f}):u==="content"?d("div",{style:B(!0),children:f}):f}const c=r.background??s.background??"full";if(e==="scrollOver"){const u=(r.content??"content")==="full",f=w(i({...o,fullWidth:u}),u?null:C(r,c));return c==="content"?d("div",{className:"contents",style:{[K]:h},children:f}):f}const a=r.content??"content";switch(e){case"both":return _(c,J(i(o),q(r,c)));case"contained":{if(a==="full")return _(c,i({...o,contained:!1}));const u=C(r,c);if(c==="content"&&u===null)return i({...o,contained:!0});const f=d(M,{children:i({...o,contained:!0})});return _(c,w(f,u))}case"contentColumn":case"contentFull":case"productGrid":{const f={...o,widthMode:a==="full"?"full":"page",fullWidth:void 0,pageWidth:void 0,contained:void 0},E=w(i(f),a==="full"?null:C(r,c));return e==="productGrid"?c==="content"?d("div",{className:P,children:E}):E:_(c,E)}default:return _(c,w(i(o),C(r,c)))}}}const Ct={name:"sectionWidth",applies:(t,n,e)=>(n.isSection(t)&&!V.has(t)||S(t,e))&&!!e&&typeof e.render=="function",panel(t,n,e){if(S(n,t)){const s=e.sectionWidthFields(n),l={...t.fields,...s};t.fields=I[n]==="contained"?v(n,t,l,Object.keys(s)):l;return}const i=e.widthField;t.fields={...t.fields,...i("full")};const o=t.resolveFields;t.resolveFields=(s,l)=>{const r=o?o(s,l):l.fields,c=N(s?.props??{},"full");return r&&typeof r.then=="function"?r.then(a=>R(a,c)):R(r,c)}},draw(t,n){if(S(n,t)){Q(t,n);return}const e=j.has(n),i=t.render;t.render=o=>{const{mode:s}=N(o,"full"),l=i(o);if(s==="full")return l;const r=m(h);return e?d("div",{style:{"--sf-page-cap":h},children:l}):d("div",{style:r,children:l})}}};function R(t,n){if(!t||!("widthMode"in t))return t;const e={...t},i=e.widthMode;return i&&(e.widthMode={...i,currentValue:n.mode,inherited:n.inherited}),e}const Z=new Set(["Heading","Text","ImageBlock","ButtonBlock","Banner","Stats","Logos","Divider","Flex","Grid","OrderSummary","DeliveryOptions","PaymentBadges","CheckoutCTA"]),wt={name:"containedWidth",applies:(t,n,e)=>Z.has(t)&&!S(t,e)&&!!e&&typeof e.render=="function",panel(t,n,e){const i=e.widthField;t.fields=v(n,t,{...t.fields,...i("page")});const o=t.resolveFields;t.resolveFields=(s,l)=>{const r=o?o(s,l):l.fields,c=N(s?.props??{},"page"),a=u=>R(u,c);return r&&typeof r.then=="function"?r.then(a):a(r)}},draw(t){const n=t.render;t.render=e=>{const{mode:i}=N(e,"page");return n({...e,contained:i!=="full"})}}},tt={not:{context:"inHeroGroupRow",is:!0}},_t={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=O(n.fields??{},["align"],tt),x(n,{inHeroGroupRow:(e,i)=>{const o=k(i.appState,e.props?.id);return!!o&&o.type==="HeroGroup"&&A("HeroGroup",o.props?.direction)==="row"}})}};function nt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const et={any:[]},ot={not:{context:"insideSiteGutter",is:!0}},it={not:{context:"widthCappedByParent",is:!0}};function v(t,n,e,i=["widthMode","pageWidth"]){return t==="ButtonBlock"?O(e,["_gWidth",...i],et):nt(e)?(x(n,{insideSiteGutter:(o,s)=>D(s.appState?.data?.content,o.props?.id)}),O(e,i,ot)):(x(n,{widthCappedByParent:(o,s)=>"parent"in s?G(s.parent):L({props:o.props??{}},s)}),O(e,i,it))}const Nt={name:"imageWidth",applies:t=>t==="ImageBlock",panel(t,n,e){const{slider:i,WidthIcon:o}=e;if(t?.fields){const s=i("Image width",d(o,{}),p.min,p.max,p.step,p.fallback,p.unit),l="focal",r=Object.entries(t.fields),c=r.findIndex(([a])=>a===l);t.fields=Object.fromEntries(c===-1?[...r,["width",s]]:[...r.slice(0,c+1),["width",s],...r.slice(c+1)])}}};export{K as SECTION_BACKGROUND_VAR,X as SECTION_CONTENT_CAP_CLASS,z as SECTION_CONTENT_CAP_VAR,Y as SECTION_CONTENT_CLASS,U as SECTION_CONTENT_VAR,T as SITE_CONTENT_VAR,_t as buttonAlignInRow,wt as containedWidth,C as contentOverride,S as drawsTwoWidthRows,Nt as imageWidth,Ct as sectionWidth,R as widthModeFields};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "30.1.0",
3
+ "version": "30.1.2",
4
4
  "description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",