efficient-web-builder 26.1.1 → 26.3.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.
- package/CHANGELOG.md +75 -0
- package/dist/editor/components/ShadowColourField.js +1 -1
- package/dist/editor/components/SwitchToBoxFooter.js +1 -1
- package/dist/editor/components/usePinnedChromeSeed.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/puck/ColourControl.d.ts +11 -1
- package/dist/editor/lib/puck/ColourControl.js +1 -1
- package/dist/editor/lib/puck/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/general/LogoBlock/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/general/TitleWithButtons/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/puck/box-footer.js +1 -0
- package/dist/editor/lib/puck/controls.d.ts +6 -1
- package/dist/editor/lib/puck/controls.js +1 -1
- package/dist/format/lib/content/block-align.d.ts +2 -0
- package/dist/format/lib/content/block-align.js +1 -0
- package/dist/format/lib/content/box-layout.d.ts +3 -0
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +5 -1
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/hero-arrows.d.ts +1 -1
- package/dist/format/lib/reel.d.ts +1 -1
- package/dist/format/lib/theme.d.ts +4 -0
- package/dist/format/lib/theme.js +2 -2
- package/dist/render/components/BoxCellWidthContext.d.ts +2 -0
- package/dist/render/components/BoxCellWidthContext.js +1 -0
- package/dist/render/components/ButtonBlock.d.ts +4 -2
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/Divider.d.ts +4 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/Flex.d.ts +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Heading.d.ts +1 -1
- package/dist/render/components/Logo.d.ts +1 -0
- package/dist/render/components/Logo.js +1 -1
- package/dist/render/components/LogoBlock.d.ts +3 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Text.d.ts +1 -1
- package/dist/render/lib/puck/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/puck/blocks/general/Divider/render.js +1 -1
- package/dist/render/lib/puck/blocks/general/LogoBlock/render.js +1 -1
- package/dist/render/lib/puck/passes/section-padding.js +1 -1
- package/package.json +1 -1
- package/dist/format/lib/puck/box-footer.js +0 -1
- /package/dist/{format → editor}/lib/puck/box-footer.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PadValues } from "../../format/lib/content/section-padding.js";
|
|
2
|
+
import type { BlockAlign as Align } from "../../format/lib/content/block-align.js";
|
|
2
3
|
type Level = "1" | "2" | "3" | "4" | "5" | "6";
|
|
3
|
-
type Align = "left" | "center" | "right";
|
|
4
4
|
interface HeadingProps {
|
|
5
5
|
pad?: PadValues;
|
|
6
6
|
level: Level;
|
|
@@ -23,6 +23,7 @@ export declare const HEADER_LOGO_PX: {
|
|
|
23
23
|
export declare const FOOTER_LOGO_PX = 44;
|
|
24
24
|
export declare const HEADER_LOGO_PX_MIN = 16;
|
|
25
25
|
export declare const HEADER_LOGO_PX_MAX = 140;
|
|
26
|
+
export declare const LOGO_BLOCK_PX_MAX: number;
|
|
26
27
|
export declare const WORDMARK_FIT_FLOOR_PX = 16;
|
|
27
28
|
export default function Logo({ variant, scrolled, src, reverse, color, onLightSurface, reversedSrc, inkIsDark, size, sizePx, wordmark, siteName, fitToContainer, fitWordmarkToContainer, fitFloorPx }: Props): import("react").JSX.Element;
|
|
28
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as A}from"react/jsx-runtime";import{useEffect as m,useId as
|
|
1
|
+
"use client";import{jsx as i,jsxs as A}from"react/jsx-runtime";import{useEffect as m,useId as lt,useRef as P,useState as h}from"react";import{NEUTRAL_SITE_NAME as rt}from"../../format/lib/content/site-name.js";import{isSvgUrl as it}from"../../format/lib/logo/reverse-svg.js";import{analyzeLogoViaServer as ct}from"../lib/logo/analyze-logo-client.js";const at={small:54,medium:66,large:84},W=44,ut=202/22,Et=16,Ot=140,Rt=W*4,dt=.88,vt=16,mt="invert(1)";function ht({variant:H="header",scrolled:j=!0,src:f,reverse:C=!1,color:p=null,onLightSurface:K,reversedSrc:L,inkIsDark:q,size:z="medium",sizePx:g,wordmark:_,siteName:B=rt,fitToContainer:S=!1,fitWordmarkToContainer:U=!1,fitFloorPx:x}){const c=_&&_.trim()?_.trim():B,[V,Z]=h(!1),b=P(null),J=t=>{b.current=t};m(()=>{const t=b.current?.ownerDocument??document,o=()=>{Z(t.documentElement.getAttribute("data-theme")==="light")};o();const d=new MutationObserver(o);return d.observe(t.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>d.disconnect()},[]);const n=f&&f.trim()?f.trim():null,a=!!n&&it(n),k=K??(V&&j),s=p&&p.trim()?p.trim():null,u=C&&!s,y=`logo-color-${lt().replace(/[^A-Za-z0-9_-]/g,"")}`,F=u&&a&&n&&L!=null?{reversed:L,inkIsDark:q??null}:null,$=F!==null,[Q,E]=h(null);m(()=>{if(!u||!n||!a||$){E(null);return}let t=!1;return E(null),ct(n).then(o=>{t||E(o)}),()=>{t=!0}},[u,n,a,$]);const r=F??Q,D=!!r&&r.inkIsDark!==null&&(k?!r.inkIsDark:r.inkIsDark),Y=u&&!!n&&!a&&!k,O=D&&r?r.reversed:n,w=O?[O]:[],[M,R]=h(0);m(()=>{R(0)},[n,D]);const tt=H==="footer"?W:at[z],l=g&&g>0?g:tt,et=Math.round(l*ut),e=M<w.length?w[M]:null,[nt,v]=h(O),T=e!==null&&e===nt,X=P(null);m(()=>{const t=X.current;if(!t||!t.complete)return;if(t.naturalWidth>0||t.naturalHeight>0){v(e);return}let o=!1;return t.decode().then(()=>!o&&v(e),()=>!o&&R(d=>d+1)),()=>{o=!0}},[e]);const G=S||U,N=`calc(100cqi / ${((c.length+1)*dt).toFixed(2)})`,I=G&&x&&x>0?Math.min(x,l):null,st=G?I===null?`min(${l}px, ${N})`:`clamp(${I}px, ${N}, ${l}px)`:`${l}px`,ot=A("span",{className:`font-display font-bold tracking-[0.18em] ${I===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:st,lineHeight:1,...s?{color:s}:{}},"aria-label":c,children:[c,i("span",{className:"text-accent",style:s?{color:s}:void 0,children:"."})]});return A("span",{ref:J,className:"inline-flex items-center",children:[!T&&ot,s&&e&&i("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:A("filter",{id:y,colorInterpolationFilters:"sRGB",children:[i("feFlood",{style:{floodColor:s}}),i("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),e&&i("img",{ref:X,src:e,alt:c,width:et,height:l,className:"shrink-0 object-contain",style:{...T?{height:`${l}px`,width:"auto",...S?{maxWidth:"100cqi"}:{}}:{display:"none"},...Y?{filter:mt}:{},...s?{filter:`url(#${y})`}:{}},onLoad:()=>v(e),onError:()=>R(t=>t+1)},e)]})}export{W as FOOTER_LOGO_PX,at as HEADER_LOGO_PX,Ot as HEADER_LOGO_PX_MAX,Et as HEADER_LOGO_PX_MIN,Rt as LOGO_BLOCK_PX_MAX,vt as WORDMARK_FIT_FLOOR_PX,ht as default};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type BlockAlign } from "../../format/lib/content/block-align.js";
|
|
1
2
|
export interface LogoBlockProps {
|
|
2
3
|
src?: string;
|
|
3
4
|
alt?: string;
|
|
4
5
|
href?: string;
|
|
5
6
|
heightPx?: number;
|
|
6
7
|
reverse?: boolean;
|
|
8
|
+
align?: BlockAlign;
|
|
7
9
|
color?: string | null;
|
|
8
10
|
}
|
|
9
|
-
export default function LogoBlock({ src, alt, href, heightPx, reverse, color, }: LogoBlockProps): import("react").JSX.Element;
|
|
11
|
+
export default function LogoBlock({ src, alt, href, heightPx, reverse, align, color, }: LogoBlockProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i}from"react/jsx-runtime";import{useContext as
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import{useContext as L}from"react";import{SiteLink as v}from"../lib/site-runtime.js";import I,{FOOTER_LOGO_PX as C,WORDMARK_FIT_FLOOR_PX as O}from"./Logo.js";import{media as _}from"../lib/media.js";import{BoxSurfaceContext as h}from"./BoxSurfaceContext.js";import{useBoxCellHasWidth as D}from"./BoxCellWidthContext.js";import{useInSiteHeader as N}from"./PhoneMenuTools.js";import{useSiteLogo as B}from"./SiteLogoContext.js";import{BLOCK_ALIGN_JUSTIFY as F}from"../../format/lib/content/block-align.js";function T({src:f,alt:d,href:t,heightPx:k=C,reverse:u=!0,align:s,color:p=null}){const e=B(),a=(f??"").trim(),o=a?{src:_(a),reversedSrc:null,inkIsDark:null,wordmark:d?.trim()||null}:{src:e.src,reversedSrc:e.reversedSrc,inkIsDark:e.inkIsDark,wordmark:e.wordmark},x=L(h),l=N(),S=D(),r=!l&&S,n=i(I,{variant:"footer",sizePx:k,src:o.src,reverse:u,color:p,reversedSrc:o.reversedSrc,inkIsDark:o.inkIsDark,wordmark:o.wordmark,siteName:e.siteName,fitToContainer:l,fitWordmarkToContainer:r,fitFloorPx:r?O:void 0,...x?.dark?{onLightSurface:!1}:{}}),c=r?"inline-flex max-w-full overflow-x-clip":"inline-flex",m=t?i(v,{href:t,className:c,children:n}):r?i("span",{className:c,children:n}):n;if(!s&&!r)return m;const w=["flex min-w-0",s?F[s]:"",r?"[container-type:inline-size]":""].filter(Boolean).join(" ");return i("div",{className:w,children:m})}export{T as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PadValues } from "../../format/lib/content/section-padding.js";
|
|
2
|
-
type
|
|
2
|
+
import type { BlockAlign as Align } from "../../format/lib/content/block-align.js";
|
|
3
3
|
type Tone = "default" | "dim";
|
|
4
4
|
interface TextProps {
|
|
5
5
|
pad?: PadValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import d from"../../../../../components/ButtonBlock.js";import{CTA_PH as s}from"../../../../../../format/lib/puck/blocks/placeholders.js";import{phPrev as b}from"../../scaffold.js";const v={label:"Button",defaultProps:{label:"",href:"#",variant:"primary",align:"left",contained:!0},render:({label:o,href:t,variant:r,align:n,contained:e,arrow:i,icon:a,iconPosition:l,widthFit:m,buttonColor:f,buttonTextColor:p,puck:c})=>u(d,{label:b(o,s.text,c)??"",href:t,variant:r,align:n,contained:e,arrow:i,icon:a,iconPosition:l,widthFit:m,buttonColor:f,buttonTextColor:p})};export{v as ButtonBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import d from"../../../../../components/Divider.js";import{DEFAULT_DIVIDER_STYLE as a}from"../../../../../../format/lib/sections/divider-style.js";const p={label:"Divider",defaultProps:{style:a,spacing:"md",contained:!0},render:({spacing:e,contained:i,style:r,thickness:t,lengthPct:n,hideOnMobile:o})=>s(d,{spacing:e,contained:i,style:r,thickness:t,lengthPct:n,hideOnMobile:o===!0})};export{p as DividerRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import m from"../../../../../components/LogoBlock.js";import{FOOTER_LOGO_PX as s}from"../../../../../components/Logo.js";import{readHidable as c}from"efficient-easel/draw";import{readLogoColor as p}from"../../../../../../format/lib/logo/logo-color.js";const L={label:"Logo",defaultProps:{heightPx:s,reverse:"auto"},render:({src:r,alt:t,href:d,heightPx:f,reverse:n,customColor:i,align:e})=>{const o=p(n,i);return l(m,{src:r||void 0,alt:c(t).text||void 0,href:d||void 0,heightPx:f,reverse:o.reverse,color:o.color,align:e==="left"||e==="center"||e==="right"?e:void 0})}};export{L as LogoBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as f}from"react/jsx-runtime";import{isBackgroundBox as
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import{isBackgroundBox as u}from"../../../../format/lib/content/box-background.js";import{resolveSectionPadding as h,sectionPadAttrs as r}from"../../../../format/lib/content/section-padding.js";const c={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120},DetailRows:{top:100,bottom:100}},P=new Set(Object.keys(c)),l=new Set(["Flex","Text","Heading"]),T=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),g=new Set(["ProductGrid"]);function a(t,n,o=!1){const d=t.render;t.render=e=>{if(n?.(e))return d(e);const i=o?r(e.sectionPaddingTop,e.sectionPaddingBottom,e.sectionPaddingTopPhone,e.sectionPaddingBottomPhone,e.sectionPaddingLeft,e.sectionPaddingRight,e.sectionPaddingLeftPhone,e.sectionPaddingRightPhone):r(e.sectionPaddingTop,e.sectionPaddingBottom,e.sectionPaddingTopPhone,e.sectionPaddingBottomPhone),s=d(e);return i?f("div",{className:i.className,style:i.style,children:s}):s}}const x={name:"sectionPadding",applies:(t,n,o)=>n.isSection(t)&&!T.has(t)&&!!o&&typeof o.render=="function",panel(t,n,o){P.has(n)||g.has(n)||(t.fields={...t.fields,...o.sidesPaddingFields()})},draw(t,n){if(P.has(n)){const o=t.render,d=c[n];t.render=e=>{const i=h(e,d);return o({...e,padTop:i.top,padBottom:i.bottom})};return}if(g.has(n)){a(t);return}l.has(n)||a(t,n==="Flex"?o=>u(o.bgImage):void 0,!0)}},_=["Heading","Text"],m=["LogoBlock"],A={name:"blockPadding",applies:(t,n,o)=>(_.includes(t)||m.includes(t))&&!!o&&typeof o.render=="function",panel(t,n,o){t.fields={...t.fields,...o.sidesPaddingFields()}},draw(t,n){l.has(n)||a(t,void 0,!0)}};export{l as PAD_ON_ROOT,P as SECTION_PAD_INNER,c as SECTION_PAD_INNER_DEFAULTS,A as blockPadding,x as sectionPadding};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildSectionGroup as F,SITE_FOOTER_TYPE as g}from"./section-groups.js";const c="Flex",d={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock"},f=r=>{const{id:t,...o}=r;return o},l=r=>typeof r=="string"?r:"";function u(r,t){const o=r.props??{},i=d[r.type];if(i)return[t(i,f(o))];switch(r.type){case"FooterLogo":{const e=t("LogoBlock",o.reverse?{reverse:o.reverse}:{}),n=l(o.tagline).trim();return n?[e,t("Text",{text:n,tone:"dim",align:o.align==="center"?"center":"left"})]:[e]}case"FooterText":return[t("Text",{text:l(o.text),tone:typeof o.tone=="string"?o.tone:"default"})];case"FooterDivider":return[t("Divider")];case"FooterGroup":{const e=Array.isArray(o.blocks)?o.blocks:[];return[t(c,{direction:o.direction==="horizontal"?"row":"column",content:e.flatMap(n=>u(n,t))})]}default:return[]}}function b(r,t,o){const e=(r&&Array.isArray(r.props?.blocks)?r.props.blocks:[]).flatMap(a=>{const s=u(a,t);return s.length<=1?s:[t(c,{direction:"column",content:s})]}),n=t(c,{direction:"row",wrap:!0,share:"equal",content:e}),p=t(c,{direction:"column",content:[t("LegalLineBlock")]});return F(g,o,[n,p])}export{b as boxFooterFromFooter,u as pageBlocksFromFooterBlock};
|
|
File without changes
|