efficient-web-builder 30.1.1 → 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,17 @@
|
|
|
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
|
+
|
|
5
16
|
## 30.1.1 - 2026-10-21
|
|
6
17
|
|
|
7
18
|
### Fixed
|
|
@@ -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",
|
|
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 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
|
|
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.
|
|
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",
|