efficient-web-builder 60.0.0 → 62.0.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/editor/components/ShadowColourField.js +1 -1
  3. package/dist/editor/components/StorefrontEditor.js +1 -1
  4. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  5. package/dist/editor/lib/animation/hover-fields.js +1 -1
  6. package/dist/editor/lib/document/page-root.js +2 -2
  7. package/dist/format/lib/animation/hover.d.ts +7 -4
  8. package/dist/format/lib/animation/hover.js +1 -1
  9. package/dist/format/lib/content/card-state.d.ts +6 -1
  10. package/dist/format/lib/content/card-state.js +1 -1
  11. package/dist/format/lib/content/card-template.d.ts +8 -2
  12. package/dist/format/lib/content/card-template.js +1 -1
  13. package/dist/format/lib/content/hover-media.d.ts +7 -0
  14. package/dist/format/lib/content/hover-media.js +1 -1
  15. package/dist/format/lib/content/image-treatment.d.ts +6 -3
  16. package/dist/format/lib/content/image-treatment.js +1 -1
  17. package/dist/format/lib/content/ink.d.ts +1 -1
  18. package/dist/format/lib/content/ink.js +1 -1
  19. package/dist/format/lib/content/site-gutter.d.ts +2 -1
  20. package/dist/format/lib/content/site-gutter.js +1 -1
  21. package/dist/format/lib/document/card-template-layers.js +1 -1
  22. package/dist/format/lib/document/passes/card-template-on-insert.js +1 -1
  23. package/dist/format/lib/editor-words-catalogue.d.ts +1 -0
  24. package/dist/format/lib/editor-words-catalogue.js +1 -1
  25. package/dist/format/lib/editor-words-kept.js +1 -1
  26. package/dist/format/lib/source-rules/one-next-image-path.d.ts +6 -0
  27. package/dist/format/lib/source-rules/one-next-image-path.js +1 -0
  28. package/dist/format/lib/theme.d.ts +6 -3
  29. package/dist/format/lib/theme.js +4 -4
  30. package/dist/render/components/CardRowContext.d.ts +3 -1
  31. package/dist/render/components/CardRowContext.js +1 -1
  32. package/dist/render/components/Flex.js +1 -1
  33. package/dist/render/components/HeroSection.js +1 -1
  34. package/dist/render/components/ImageBlock.d.ts +9 -3
  35. package/dist/render/components/ImageBlock.js +1 -1
  36. package/dist/render/components/ThemeLightInkContext.d.ts +6 -0
  37. package/dist/render/components/ThemeLightInkContext.js +1 -0
  38. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  39. package/dist/render/lib/document/passes/section-theme.js +1 -1
  40. package/dist/render/lib/document/passes/section-width.js +1 -1
  41. package/dist/render/lib/document/slot-counts.js +1 -1
  42. package/package.json +5 -5
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{phoneKey as h}from"efficient-easel/draw";import{CardRowDrawn as p}from"../../../../../components/CardRowContext.js";import w from"../../../../../components/ImageBlock.js";import{recordPictureAlt as S}from"../../../../../../format/lib/content/record-row.js";import{namedRowField as x,rowFieldSpec as B,rowFieldText as I,rowNextPicture as b}from"../../../../../../format/lib/content/card-template.js";import{blockSizeOf as F,blockSizeValuesOf as O}from"../../../../content/block-size.js";import{padValuesOf as P}from"../../../../content/section-padding.js";import{pictureHoverOf as v}from"../../../../../../format/lib/animation/hover.js";import{viewFocusValues as z}from"../../../../../../format/lib/content/picture-focus-rows.js";import{ImageBlockMeta as R}from"../../../../../../format/lib/document/blocks/general/ImageBlock/meta.js";const _={...R,render:e=>{const t=x(e);return t?l(p,{type:"ImageBlock",props:e,children:(o,r,a)=>{const c=B(r,t),i=r?c?.alt:S(t);return m(e,o.src,(i&&I(a,i))??e.alt,b(r?.item,c?.next,typeof o.src=="string"?o.src:""))}}):m(e,e.src,e.alt)}};function m(e,t,o,r=""){const{aspect:a,contained:c,grayscale:i,darken:f,darkenStyle:d,href:s,fit:u,corners:k,cornerSides:g,editor:y}=e,n=z(e,"focal");return l(w,{src:t,alt:o,aspect:a,aspectPhone:e[h("aspect")],contained:c,grayscale:i,darken:f,darkenStyle:d,pictureHover:v(e,"ImageBlock"),...r?{nextSrc:r}:{},href:s,fit:u,focal:n.desktop,focalPhone:n.phone,focalTablet:n.tablet,corners:k,cornerSides:g,pad:P(e),ownSize:F(O(e))!==null,editing:y?.isEditing===!0})}export{_ as ImageBlockRender};
1
+ import{jsx as u}from"react/jsx-runtime";import{phoneKey as y}from"efficient-easel/draw";import{CardRowDrawn as p}from"../../../../../components/CardRowContext.js";import v from"../../../../../components/ImageBlock.js";import{recordPictureAlt as I}from"../../../../../../format/lib/content/record-row.js";import{namedRowField as x,rowFieldSpec as B,rowFieldText as k}from"../../../../../../format/lib/content/card-template.js";import{cardRowHoverMedia as b}from"../../../../../../format/lib/content/hover-media.js";import{blockSizeOf as F,blockSizeValuesOf as O}from"../../../../content/block-size.js";import{padValuesOf as R}from"../../../../content/section-padding.js";import{pictureHoverOf as z}from"../../../../../../format/lib/animation/hover.js";import{viewFocusValues as H}from"../../../../../../format/lib/content/picture-focus-rows.js";import{ImageBlockMeta as P}from"../../../../../../format/lib/document/blocks/general/ImageBlock/meta.js";const J={...P,render:e=>{const r=z(e,"ImageBlock"),o=x(e);return!o&&r.kind!=="nextImage"?g(e,e.src,e.alt,r):u(p,{type:"ImageBlock",props:e,children:(l,t,n)=>{const m=o?B(t,o):null,a=o?t?m?.alt:I(o):null,d=o?l.src:e.src,c=(a&&k(n,a))??e.alt,i=r.media?b(t,r.media):null,f=k(n,"name")??(typeof c=="string"?c:"");return g(e,d,c,r,i&&r.media?{media:i,name:f,cover:r.media.cover}:null)}})}};function g(e,r,o,l,t=null){const{aspect:n,contained:m,grayscale:a,darken:d,darkenStyle:c,href:i,fit:f,corners:w,cornerSides:S,editor:h}=e,s=H(e,"focal");return u(v,{src:r,alt:o,aspect:n,aspectPhone:e[y("aspect")],contained:m,grayscale:a,darken:d,darkenStyle:c,pictureHover:l,...t?{hoverLayer:t}:{},href:i,fit:f,focal:s.desktop,focalPhone:s.phone,focalTablet:s.tablet,corners:w,cornerSides:S,pad:R(e),ownSize:F(O(e))!==null,editing:h?.isEditing===!0})}export{J as ImageBlockRender};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{CellWrap as E}from"../../../components/InBoxContext.js";import{SectionRootChoice as T}from"../../../components/SiteGutterFrame.js";import{SITE_WIDTH_CAP as h,centredCap as _}from"../../../../format/lib/content/page-width.js";import{ownNodeWidth as C}from"../../../../format/lib/content/site-gutter.js";import{drawsCopiesInTheBox as L}from"../../../../format/lib/content/copies-in-box.js";import{SECTION_THEME_EXCLUDED as N,SECTION_THEME_NESTED_READING as m,nestedAccentValue as d,sectionThemeWrap as u}from"../../../../format/lib/content/section-surface.js";const W={name:"sectionTheme",applies:(e,t,s)=>t.isSection(e)&&!N.has(e)&&!!s&&typeof s.render=="function",panel(e,t,s){const{sectionThemeFields:o,SECTION_THEME_FOLLOW_LABEL:n}=s,i=m.has(t);e.fields={...e.fields,...i?o(d,n):o()}},draw(e,t){const s=m.has(t),o=e.render;e.render=n=>{const i=u(s?{...n,sectionAccent:d(n.sectionAccent)}:n),c=o(n);if(!i)return c;const l=f=>a(E,{className:i.className,style:f,children:c}),r=i.style;return L(t,n)?a("div",{className:i.className,style:{...r,display:"contents"},children:c}):C(t,n).background!=="content"?l(r):a(T,{own:()=>l({...r,..._(h)}),followed:()=>l(r)})}}},x={name:"slideTheme",applies:e=>e==="HeroSlide",panel(e,t,s){const{sectionThemeFields:o,BLOCK_THEME_FOLLOW_LABEL:n}=s;e?.fields&&(e.fields={...e.fields,...o(d,n)})}};export{W as sectionTheme,x as slideTheme};
1
+ import{jsx as a}from"react/jsx-runtime";import{CellWrap as E}from"../../../components/InBoxContext.js";import{SectionRootChoice as T}from"../../../components/SiteGutterFrame.js";import{SITE_WIDTH_CAP as _,centredCap as h}from"../../../../format/lib/content/page-width.js";import{sectionGroundAnswer as C}from"../../../../format/lib/content/site-gutter.js";import{drawsCopiesInTheBox as L}from"../../../../format/lib/content/copies-in-box.js";import{SECTION_THEME_EXCLUDED as N,SECTION_THEME_NESTED_READING as m,nestedAccentValue as d,sectionThemeWrap as u}from"../../../../format/lib/content/section-surface.js";const x={name:"sectionTheme",applies:(e,t,s)=>t.isSection(e)&&!N.has(e)&&!!s&&typeof s.render=="function",panel(e,t,s){const{sectionThemeFields:o,SECTION_THEME_FOLLOW_LABEL:n}=s,i=m.has(t);e.fields={...e.fields,...i?o(d,n):o()}},draw(e,t){const s=m.has(t),o=e.render;e.render=n=>{const i=u(s?{...n,sectionAccent:d(n.sectionAccent)}:n),c=o(n);if(!i)return c;const l=f=>a(E,{className:i.className,style:f,children:c}),r=i.style;return L(t,n)?a("div",{className:i.className,style:{...r,display:"contents"},children:c}):C(t,n)!=="content"?l(r):a(T,{own:()=>l({...r,...h(_)}),followed:()=>l(r)})}}},B={name:"slideTheme",applies:e=>e==="HeroSlide",panel(e,t,s){const{sectionThemeFields:o,BLOCK_THEME_FOLLOW_LABEL:n}=s;e?.fields&&(e.fields={...e.fields,...o(d,n)})}};export{x as sectionTheme,B as slideTheme};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{INTRO_EDGE_CLASS as K}from"../../../../format/lib/sections/intro-bleed-layout.js";import{resolveContainerDirection as j}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as X,HERO_CHROME_CAP_VAR as q,HERO_CHROME_INSET_VAR as z,FULL_SECTION_WIDTH as J,SITE_WIDTH_CAP as _,centredCap as B,heroBackgroundTokens as Q}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as v,SECTION_WIDTH_KEYS as G,hasOwnSectionWidth as Z,hasWidthFamily as tt,resolveWidth as D,siteWidthsOf as nt}from"../../../../format/lib/content/section-width.js";import{boxCardProps as et}from"../../../../format/lib/content/box-background.js";import{cardCopyPlace as ot}from"../../../../format/lib/content/card-template.js";import{BOX_GUTTER_KEY as it,boxGutterOf as ct,boxPlaceOf as rt,boxRunsEdgeToEdge as lt,isFrameContainer as T,ownNodeWidth as dt,siteDrawsGutter as ut}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as st}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as F,NestedBoxChoice as at,SectionGroupChoice as ft,SectionGroupWidthsProvider as ht,SectionRootChoice as _t,SplitBandAndColumn as H}from"../../../components/SiteGutterFrame.js";import{FRAME as L}from"../../../components/BlockFrame.js";import{sectionFillPassClass as M}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as Nt}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as E,withRowsShownWhen as O}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as wt,heldByANode as Ct,isNestedNode as Tt,NOT_HELD_BY_A_NODE as P}from"../../../../format/lib/document/passes/document-position.js";const N="--sf-sw-site",Et="--sf-sw-content",Ot="--sf-bg-cap",St="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",R=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",k="contents view-wide:[--sf-site-width:100vw]",A=({held:t},n,e)=>t?e:l(u,{className:n,children:e}),mt=`contents view-wide:[--sf-site-width:100vw] ${K} view-wide:[--sf-site-gutter:var(--intro-edge)]`,W=(t,n)=>n==="content"?`min(${t}px,var(${N}))`:`${t}px`;function S({content:t,contentMax:n},e){return t==="full"?e!=="content"?J:null:n===null?null:W(n,e)}function m(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:St,style:{[Et]:n},children:t})})}const pt="--sf-content-cap",xt="contents max-view-wide:[--sf-content-cap:none]";function Rt({content:t,contentMax:n},e){return t==="full"?null:n!==null?W(n,e):e==="content"?null:`var(${N})`}function At(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:xt,style:{[pt]:n},children:t})})}const y=`var(${N},${_})`,f=(t,n,e="")=>t==="content"?l(u,{className:e||void 0,style:B(_),children:l(F,{ground:y,children:n})}):n;function U(t,n,e,o,i){if(R(e))return f(o,A(e,k,l(H,{children:t({...n,contained:!0})})),i);if(e.content==="full")return f(o,t({...n,contained:!1}),i);const c=S(e,o);return o==="content"&&c===null&&!e.own?t({...n,contained:!0}):f(o,m(l(H,{children:t({...n,contained:!0})}),c),i)}function V(t,n,e,o){if(e==="hero"){const r=m(t(n),S(o,o.band));return o.band==="full"?l(u,{style:{[X]:"none",[z]:"initial",[q]:"initial"},children:r}):o.band==="content"?l(u,{style:Q(!0),children:r}):r}const i=o.band??"full",c=M(n);if(e==="rawMarkup"){if(o.content==="full")return f(i,t(n),c);const r=o.contentMax===null?_:W(o.contentMax,i);return l(u,{className:"contents",style:{[N]:_},children:f(i,l(u,{className:c||void 0,style:B(r),children:t(n)}),c)})}if(e==="scrollOver"){const r=o.content==="full",d=R(o)?A(o,mt,t({...n,fullWidth:!1})):m(t({...n,fullWidth:r}),r?null:S(o,i));return i==="content"?l(u,{className:"contents",style:{[Ot]:_},children:d}):d}switch(e){case"both":return f(i,At(t(n),Rt(o,i)),c);case"contained":return U(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=R(o),d=o.content==="full"&&!r?"full":"page",s=r?A(o,k,t({...n,widthMode:d})):m(t({...n,widthMode:d}),o.content==="full"?null:S(o,i));return e==="productGrid"&&!o.own?i==="content"?l(u,{className:c?`${L} ${c}`:L,children:s}):s:f(i,s,c)}default:return f(i,m(t(n),S(o,i)),c)}}function Wt(t,n){const e=v[n],o=t.render;t.render=i=>{const c=nt(i),r={band:c.background,content:c.content??"content",contentMax:null},d=()=>e==="rawMarkup"?o(i):l(ft,{draw:a=>a?.background==="content"?l(F,{ground:y,children:s(a)}):s(a)}),s=a=>{const C=a?{...r,band:a.background==="content"?r.band:a.background??r.band,content:a.content??r.content,own:a.background==="full"||a.content!==null,held:!0,siteContent:r.content}:r,x=V(o,i,e,C);if(!T(n))return x;const b=ct(i),g=b===void 0?C.content:b?"content":"full";return g===C.content?x:l(at,{atTop:x,nested:U(o,i,{...C,content:g,own:!1},C.band??"full",M(i))})},h=dt(n,i);if(!Z(h))return d();const w=e==="rawMarkup",I=h.background??(w?"full":c.background),Y=h.content??(w?"full":r.content),p={band:I,content:I==="content"?"content":Y,contentMax:h.contentMax,own:!w,siteContent:r.content};return l(_t,{own:()=>l(ht,{value:{background:p.band,content:p.content},children:V(o,i,e,p)}),followed:d})}}const It={all:[P,{not:{context:"runsEdgeToEdge",is:!0}}]},Qt={name:"sectionWidth",applies:(t,n,e)=>tt(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:v[n]==="rawMarkup"}),i=T(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=T(n)?$(n,t,c,[it]):c;E(t,{heldByANode:Ct}),T(n)&&E(t,{runsEdgeToEdge:(d,s)=>lt(et(d.props??{},ot(s.appState,d.props?.id)?.inCopy!==!1))}),t.fields=O(r,[G.background,G.content],T(n)?It:P)},draw(t,n){Wt(t,n)}};function bt(t,n){if(!t||!("widthMode"in t))return t;const e={...t},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:n.mode,inherited:n.inherited}),e}const gt=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),Zt={name:"containedWidth",applies:(t,n,e)=>gt.has(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.widthField;t.fields=$(n,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(c,r)=>{const d=i?i(c,r):r.fields,s=D(c?.props??{},"page"),h=w=>bt(w,s);return d&&typeof d.then=="function"?d.then(h):h(d)}},draw(t){const n=t.render;t.render=e=>{const{mode:o}=D(e,"page");return n({...e,contained:o!=="full"})}}},Bt={not:{context:"inHeroGroupRow",is:!0}},tn={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=O(n.fields??{},["align"],Bt),E(n,{inHeroGroupRow:(e,o)=>{const i=wt(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&j("HeroGroup",i.props?.direction)==="row"}})}};function vt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const Gt={any:[]},Dt={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},Ft={not:{context:"widthCappedByParent",is:!0}};function $(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return O(e,["_gWidth",...o],Gt);if(vt(e)){const i=(c,r)=>rt(r.appState?.data?.content,c.props?.id,ut(st()));return E(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),O(e,o,Dt)}return E(n,{widthCappedByParent:(i,c)=>"parent"in c?Nt(c.parent):Tt({props:i.props??{}},c)}),O(e,o,Ft)}export{Ot as SECTION_BACKGROUND_VAR,xt as SECTION_CONTENT_CAP_CLASS,pt as SECTION_CONTENT_CAP_VAR,St as SECTION_CONTENT_CLASS,Et as SECTION_CONTENT_VAR,N as SITE_CONTENT_VAR,tn as buttonAlignInRow,Zt as containedWidth,Qt as sectionWidth,bt as widthModeFields};
1
+ import{jsx as l}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{INTRO_EDGE_CLASS as K}from"../../../../format/lib/sections/intro-bleed-layout.js";import{resolveContainerDirection as j}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as X,HERO_CHROME_CAP_VAR as q,HERO_CHROME_INSET_VAR as z,FULL_SECTION_WIDTH as J,SITE_WIDTH_CAP as h,centredCap as g,heroBackgroundTokens as Q}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as G,SECTION_WIDTH_KEYS as v,hasOwnSectionWidth as Z,hasWidthFamily as tt,resolveWidth as D,siteWidthsOf as nt}from"../../../../format/lib/content/section-width.js";import{boxCardProps as et}from"../../../../format/lib/content/box-background.js";import{cardCopyPlace as ot}from"../../../../format/lib/content/card-template.js";import{BOX_GUTTER_KEY as it,boxGutterOf as ct,boxPlaceOf as rt,boxRunsEdgeToEdge as lt,isFrameContainer as C,ownNodeWidth as dt,sectionGroundAnswer as ut,siteDrawsGutter as st}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as at}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as F,NestedBoxChoice as ft,SectionGroupChoice as ht,SectionGroupWidthsProvider as _t,SectionRootChoice as Nt,SplitBandAndColumn as H}from"../../../components/SiteGutterFrame.js";import{FRAME as L}from"../../../components/BlockFrame.js";import{sectionFillPassClass as M}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as wt}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as T,withRowsShownWhen as E}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as Ct,heldByANode as Tt,isNestedNode as Et,NOT_HELD_BY_A_NODE as P}from"../../../../format/lib/document/passes/document-position.js";const N="--sf-sw-site",Ot="--sf-sw-content",St="--sf-bg-cap",mt="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",R=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",k="contents view-wide:[--sf-site-width:100vw]",A=({held:t},n,e)=>t?e:l(u,{className:n,children:e}),pt=`contents view-wide:[--sf-site-width:100vw] ${K} view-wide:[--sf-site-gutter:var(--intro-edge)]`,W=(t,n)=>n==="content"?`min(${t}px,var(${N}))`:`${t}px`;function O({content:t,contentMax:n},e){return t==="full"?e!=="content"?J:null:n===null?null:W(n,e)}function S(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:h},children:l(u,{className:mt,style:{[Ot]:n},children:t})})}const xt="--sf-content-cap",Rt="contents max-view-wide:[--sf-content-cap:none]";function At({content:t,contentMax:n},e){return t==="full"?null:n!==null?W(n,e):e==="content"?null:`var(${N})`}function Wt(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:h},children:l(u,{className:Rt,style:{[xt]:n},children:t})})}const y=`var(${N},${h})`,f=(t,n,e="")=>t==="content"?l(u,{className:e||void 0,style:g(h),children:l(F,{ground:y,children:n})}):n;function U(t,n,e,o,i){if(R(e))return f(o,A(e,k,l(H,{children:t({...n,contained:!0})})),i);if(e.content==="full")return f(o,t({...n,contained:!1}),i);const c=O(e,o);return o==="content"&&c===null&&!e.own?t({...n,contained:!0}):f(o,S(l(H,{children:t({...n,contained:!0})}),c),i)}function V(t,n,e,o){if(e==="hero"){const r=S(t(n),O(o,o.band));return o.band==="full"?l(u,{style:{[X]:"none",[z]:"initial",[q]:"initial"},children:r}):o.band==="content"?l(u,{style:Q(!0),children:r}):r}const i=o.band??"full",c=M(n);if(e==="rawMarkup"){if(o.content==="full")return f(i,t(n),c);const r=o.contentMax===null?h:W(o.contentMax,i);return l(u,{className:"contents",style:{[N]:h},children:f(i,l(u,{className:c||void 0,style:g(r),children:t(n)}),c)})}if(e==="scrollOver"){const r=o.content==="full",d=R(o)?A(o,pt,t({...n,fullWidth:!1})):S(t({...n,fullWidth:r}),r?null:O(o,i));return i==="content"?l(u,{className:"contents",style:{[St]:h},children:d}):d}switch(e){case"both":return f(i,Wt(t(n),At(o,i)),c);case"contained":return U(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=R(o),d=o.content==="full"&&!r?"full":"page",s=r?A(o,k,t({...n,widthMode:d})):S(t({...n,widthMode:d}),o.content==="full"?null:O(o,i));return e==="productGrid"&&!o.own?i==="content"?l(u,{className:c?`${L} ${c}`:L,children:s}):s:f(i,s,c)}default:return f(i,S(t(n),O(o,i)),c)}}function It(t,n){const e=G[n],o=t.render;t.render=i=>{const c=nt(i),r={band:c.background,content:c.content??"content",contentMax:null},d=()=>e==="rawMarkup"?o(i):l(ht,{draw:a=>a?.background==="content"?l(F,{ground:y,children:s(a)}):s(a)}),s=a=>{const w=a?{...r,band:a.background==="content"?r.band:a.background??r.band,content:a.content??r.content,own:a.background==="full"||a.content!==null,held:!0,siteContent:r.content}:r,x=V(o,i,e,w);if(!C(n))return x;const b=ct(i),B=b===void 0?w.content:b?"content":"full";return B===w.content?x:l(ft,{atTop:x,nested:U(o,i,{...w,content:B,own:!1},w.band??"full",M(i))})},_=dt(n,i);if(!Z(_))return d();const m=e==="rawMarkup",I=ut(n,i),Y=_.content??(m?"full":r.content),p={band:I,content:I==="content"?"content":Y,contentMax:_.contentMax,own:!m,siteContent:r.content};return l(Nt,{own:()=>l(_t,{value:{background:p.band,content:p.content},children:V(o,i,e,p)}),followed:d})}}const bt={all:[P,{not:{context:"runsEdgeToEdge",is:!0}}]},Zt={name:"sectionWidth",applies:(t,n,e)=>tt(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:G[n]==="rawMarkup"}),i=C(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=C(n)?$(n,t,c,[it]):c;T(t,{heldByANode:Tt}),C(n)&&T(t,{runsEdgeToEdge:(d,s)=>lt(et(d.props??{},ot(s.appState,d.props?.id)?.inCopy!==!1))}),t.fields=E(r,[v.background,v.content],C(n)?bt:P)},draw(t,n){It(t,n)}};function Bt(t,n){if(!t||!("widthMode"in t))return t;const e={...t},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:n.mode,inherited:n.inherited}),e}const gt=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),tn={name:"containedWidth",applies:(t,n,e)=>gt.has(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.widthField;t.fields=$(n,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(c,r)=>{const d=i?i(c,r):r.fields,s=D(c?.props??{},"page"),_=m=>Bt(m,s);return d&&typeof d.then=="function"?d.then(_):_(d)}},draw(t){const n=t.render;t.render=e=>{const{mode:o}=D(e,"page");return n({...e,contained:o!=="full"})}}},Gt={not:{context:"inHeroGroupRow",is:!0}},nn={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=E(n.fields??{},["align"],Gt),T(n,{inHeroGroupRow:(e,o)=>{const i=Ct(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&j("HeroGroup",i.props?.direction)==="row"}})}};function vt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const Dt={any:[]},Ft={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},Ht={not:{context:"widthCappedByParent",is:!0}};function $(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return E(e,["_gWidth",...o],Dt);if(vt(e)){const i=(c,r)=>rt(r.appState?.data?.content,c.props?.id,st(at()));return T(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),E(e,o,Ft)}return T(n,{widthCappedByParent:(i,c)=>"parent"in c?wt(c.parent):Et({props:i.props??{}},c)}),E(e,o,Ht)}export{St as SECTION_BACKGROUND_VAR,Rt as SECTION_CONTENT_CAP_CLASS,xt as SECTION_CONTENT_CAP_VAR,mt as SECTION_CONTENT_CLASS,Ot as SECTION_CONTENT_VAR,N as SITE_CONTENT_VAR,nn as buttonAlignInRow,tn as containedWidth,Zt as sectionWidth,Bt as widthModeFields};
@@ -1 +1 @@
1
- import{isNode as O,isNodeList as w}from"efficient-easel/data";import{hidableText as S,readHidable as y}from"efficient-easel/draw";import{blockSizeValuesOf as _}from"../content/block-size.js";import{nodeHiddenEverywhere as R,nodeViewHideClass as h}from"../../../format/lib/content/view-hide-class.js";import{CARD_ROW_FIELD_PROP as b,CARD_TEMPLATE_SLOT as x,namedRowField as E,ROW_BOUND_PROPS as P}from"../../../format/lib/content/card-template.js";import{SHOW_FOR_PROP as g}from"../../../format/lib/content/box-show-for-choices.js";const p="slotCounts",d=t=>!y(t).hidden&&S(t).trim()!=="",C=t=>typeof t=="string"&&t.trim()!=="",A={Flex:()=>!0,PostCard:()=>!0,ImageBlock:t=>C(t.src),Text:t=>d(t.text),Heading:t=>d(t.text),Eyebrow:t=>d(t.eyebrow)},F=["widthFit","width","minWidth"],u=t=>w(t);function N(t){if(Array.isArray(t.content))return u(t.content)?t.content:null;const e=Object.values(t).filter(u);return e.length===1?e[0]:null}function W(t,e){return[...new Set([b,...Object.values(P[t]??{})])].some(o=>E(e,o)!=="")}function D(t){const e=t.props??{},n=A[t.type];if(!n||!n(e)||W(t.type,e)||h(e))return!1;const o=e[g];if(o!=null&&o!=="")return!1;const r=_(e);return!F.some(s=>r[s]!==void 0)}function I(t){let e=0;for(const n of t)if(!R(n.props??{})){if(!D(n))return;e+=1}return e>0?e:void 0}function T(t){const e={},n=new Set,o=new Set,r=(s,a)=>{if(Array.isArray(s))for(const f of s){if(!O(f))continue;const i=f.props.id;typeof i=="string"&&(n.has(i)?o:n).add(i);const l=a?null:N(f.props);if(typeof i=="string"&&l){const c=I(l);c!==void 0&&(e[i]=c)}for(const[c,m]of Object.entries(f.props))u(m)&&r(m,a||c===x)}};r(t,!1);for(const s of o)delete e[s];return e}function z(t,e){return{...t??{},[p]:T(e)}}function B(t){const n=t.editor?.metadata?.[p],o=t.id,r=typeof o=="string"&&n&&typeof n=="object"?n[o]:void 0;return typeof r=="number"&&Number.isInteger(r)&&r>0?r:void 0}export{A as DRAWS_FOR_SURE,p as SLOT_COUNTS_KEY,B as slotCountOf,T as slotCountsOf,z as withSlotCounts};
1
+ import{isNode as O,isNodeList as w}from"efficient-easel/data";import{hidableText as S,readHidable as y}from"efficient-easel/draw";import{blockSizeValuesOf as _}from"../content/block-size.js";import{nodeHiddenEverywhere as h,nodeViewHideClass as R}from"../../../format/lib/content/view-hide-class.js";import{CARD_ROW_FIELD_PROP as b,isCardTemplateSlot as x,namedRowField as g,ROW_BOUND_PROPS as C}from"../../../format/lib/content/card-template.js";import{SHOW_FOR_PROP as P}from"../../../format/lib/content/box-show-for-choices.js";const m="slotCounts",d=t=>!y(t).hidden&&S(t).trim()!=="",E=t=>typeof t=="string"&&t.trim()!=="",F={Flex:()=>!0,PostCard:()=>!0,ImageBlock:t=>E(t.src),Text:t=>d(t.text),Heading:t=>d(t.text),Eyebrow:t=>d(t.eyebrow)},N=["widthFit","width","minWidth"],u=t=>w(t);function W(t){if(Array.isArray(t.content))return u(t.content)?t.content:null;const e=Object.values(t).filter(u);return e.length===1?e[0]:null}function A(t,e){return[...new Set([b,...Object.values(C[t]??{})])].some(o=>g(e,o)!=="")}function I(t){const e=t.props??{},n=F[t.type];if(!n||!n(e)||A(t.type,e)||R(e))return!1;const o=e[P];if(o!=null&&o!=="")return!1;const r=_(e);return!N.some(s=>r[s]!==void 0)}function D(t){let e=0;for(const n of t)if(!h(n.props??{})){if(!I(n))return;e+=1}return e>0?e:void 0}function H(t){const e={},n=new Set,o=new Set,r=(s,a)=>{if(Array.isArray(s))for(const i of s){if(!O(i))continue;const f=i.props.id;typeof f=="string"&&(n.has(f)?o:n).add(f);const l=a?null:W(i.props);if(typeof f=="string"&&l){const c=D(l);c!==void 0&&(e[f]=c)}for(const[c,p]of Object.entries(i.props))u(p)&&r(p,a||x(i.type,c))}};r(t,!1);for(const s of o)delete e[s];return e}function z(t,e){return{...t??{},[m]:H(e)}}function B(t){const n=t.editor?.metadata?.[m],o=t.id,r=typeof o=="string"&&n&&typeof n=="object"?n[o]:void 0;return typeof r=="number"&&Number.isInteger(r)&&r>0?r:void 0}export{F as DRAWS_FOR_SURE,m as SLOT_COUNTS_KEY,B as slotCountOf,H as slotCountsOf,z as withSlotCounts};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "60.0.0",
3
+ "version": "62.0.0",
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",
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@tabler/icons-react": "^3.46.0",
56
- "efficient-easel": "^29.0.0",
57
- "efficient-shell": "^12.17.0",
56
+ "efficient-easel": "^30.0.0",
57
+ "efficient-shell": "^12.18.0",
58
58
  "isomorphic-dompurify": "^3.18.0",
59
59
  "next": ">=16",
60
60
  "react": ">=19",
@@ -72,8 +72,8 @@
72
72
  "@types/node": "^20",
73
73
  "@types/react": "^19",
74
74
  "@types/react-dom": "^19",
75
- "efficient-easel": "^29.0.0",
76
- "efficient-shell": "^12.17.0",
75
+ "efficient-easel": "^30.0.0",
76
+ "efficient-shell": "^12.18.0",
77
77
  "esbuild": "^0.28.0",
78
78
  "happy-dom": "^20.14.5",
79
79
  "isomorphic-dompurify": "^3.18.0",