efficient-web-builder 26.3.0 → 26.3.1

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,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 26.3.1 - 2026-10-20
6
+
7
+ **`format/lib/puck/box-footer` is back** (26.3.0 removed it by mistake). A PATCH: every file 26.2.0 published is in the package again.
8
+
9
+ ### Fixed for hosts
10
+
11
+ - **26.3.0 shipped `lib/puck/box-footer` under `editor/`, not `format/`.** It imported `FOOTER_LOGO_PX` from `components/Logo`, a React module, and a format module may import only format modules (`scripts/entry-sides.mjs`). A host that imports `efficient-web-builder/format/lib/puck/box-footer` (efficient-storefront-blocks' `SwitchToBoxHeader`) broke on 26.3.0. The logo sizes (`HEADER_LOGO_PX`, `FOOTER_LOGO_PX`, `HEADER_LOGO_PX_MIN`, `HEADER_LOGO_PX_MAX`, `LOGO_BLOCK_PX_MAX`) now live in `lib/logo/logo-size`, which has no React; `components/Logo` re-exports every one, so each import of them still works. `editor/lib/puck/box-footer`, which only 26.3.0 had, goes.
12
+
13
+ ### Guards
14
+
15
+ - New `scripts/verify-published-entries.mjs`, run by `verify:dist` (CI and the release): it packs the newest npm release older than `package.json`'s version and fails when a file under its `dist/` is missing here, unless the version is a new major or the script's `REMOVALS` names the file for this version with its reason. It fails, and does not skip, when npm cannot be read. Red against 26.3.0 (the two `format/lib/puck/box-footer` files).
16
+
5
17
  ## 26.3.0 - 2026-10-20
6
18
 
7
19
  **The old footer's settings come with it to the Box footer** (box footer gaps). A minor: new optional rows on the Logo block, Divider and Box, none seeded, so every stored page draws what it drew.
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as g,jsxs as y}from"react/jsx-runtime";import{useState as k}from"react";import{createNode as w,newId as x}from"efficient-easel/data";import{useEasel as F}from"efficient-easel/easel";import{Banner as S,Button as s}from"efficient-shell/ui";import{useStorefrontDocument as T}from"./StorefrontDocumentContext.js";import{boxFooterFromFooter as B}from"../lib/puck/box-footer.js";import{FOOTER_TYPE as E}from"../lib/puck/footer-blocks.js";import{SITE_FOOTER_TYPE as a,withSectionGroup as _}from"../../format/lib/puck/section-groups.js";import{say as t}from"../../format/lib/editor-words.js";function O(){const{appState:c,dispatch:m,config:l}=F(o=>o),{readOnly:f}=T(),[u,n]=k(!1),i=c.data.content;if(f||i.some(o=>o.type===a))return null;const p=i.find(o=>o.type===E)??null,d=(o,e)=>w(l,o,e),h=()=>{const o=B(p,d,x(a));m({type:"setData",data:e=>({...e,content:[..._(e.content,o)]}),recordHistory:!0}),n(!1)};return r(S,{tone:"info",title:t("This footer uses the old layout"),action:u?y(g,{children:[r(s,{variant:"primary",size:"sm",onClick:h,children:t("Switch now")}),r(s,{variant:"secondary",size:"sm",onClick:()=>n(!1),children:t("Cancel")})]}):r(s,{variant:"secondary",size:"sm",onClick:()=>n(!0),children:t("Switch to Box footer")}),children:t("Build this footer out of Boxes and blocks, like a page: the same menus, signup, social links and logo, with the copyright as a Legal Line. Your current footer is kept.")})}export{O as default};
1
+ "use client";import{jsx as r,Fragment as g,jsxs as y}from"react/jsx-runtime";import{useState as k}from"react";import{createNode as w,newId as x}from"efficient-easel/data";import{useEasel as F}from"efficient-easel/easel";import{Banner as S,Button as s}from"efficient-shell/ui";import{useStorefrontDocument as T}from"./StorefrontDocumentContext.js";import{boxFooterFromFooter as B}from"../../format/lib/puck/box-footer.js";import{FOOTER_TYPE as E}from"../lib/puck/footer-blocks.js";import{SITE_FOOTER_TYPE as a,withSectionGroup as _}from"../../format/lib/puck/section-groups.js";import{say as t}from"../../format/lib/editor-words.js";function O(){const{appState:c,dispatch:m,config:l}=F(o=>o),{readOnly:f}=T(),[u,n]=k(!1),i=c.data.content;if(f||i.some(o=>o.type===a))return null;const p=i.find(o=>o.type===E)??null,d=(o,e)=>w(l,o,e),h=()=>{const o=B(p,d,x(a));m({type:"setData",data:e=>({...e,content:[..._(e.content,o)]}),recordHistory:!0}),n(!1)};return r(S,{tone:"info",title:t("This footer uses the old layout"),action:u?y(g,{children:[r(s,{variant:"primary",size:"sm",onClick:h,children:t("Switch now")}),r(s,{variant:"secondary",size:"sm",onClick:()=>n(!1),children:t("Cancel")})]}):r(s,{variant:"secondary",size:"sm",onClick:()=>n(!0),children:t("Switch to Box footer")}),children:t("Build this footer out of Boxes and blocks, like a page: the same menus, signup, social links and logo, with the copyright as a Legal Line. Your current footer is kept.")})}export{O as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as A,jsxs as k}from"react/jsx-runtime";import{useCallback as _,useEffect as b,useRef as X,useState as J}from"react";import{Button as Q,Tooltip as $}from"efficient-shell/ui";import{SettingsSwitch as ee}from"efficient-easel/panel";import{PagesIcon as te,StylesIcon as oe}from"efficient-easel/rail";import{TemplateIcon as re}from"efficient-easel/icons";import{Subtree as ne,TreeRow as y}from"efficient-easel/tree";import{useEasel as ie}from"efficient-easel/easel";import{useEaselStrings as B}from"efficient-easel/strings";import{LocationsTreeContext as se}from"./LocationsTreeContext.js";import ae from"./PagesPanel.js";import{usePreviewChat as ce}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as le}from"./preview-devices.js";import{PreviewDeviceContext as de}from"efficient-easel/draw/client";import{usePreviewHeader as pe}from"../../render/components/PreviewHeaderContext.js";import{usePreviewSocial as me}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as fe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as ue,usePreviewTicker as Se}from"../../render/components/PreviewTickerContext.js";import{usePreviewHeroPart as we}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ee,HERO_PART_MODE as H,heroMediaRows as he,heroPartId as N,readHeroPartId as Pe}from"../../render/lib/puck/hero-media-parts.js";import Te,{CHAT_MODE as be,HEADER_MODE as D,SOCIAL_MODE as ge,WEBSITE_MODE as W}from"./SectionEditor.js";import L from"./SectionIcon.js";import Ie from"./SectionThumbnail.js";import{useStorefrontDocument as R}from"./StorefrontDocumentContext.js";import ve from"./StylesPanel.js";import{LOCATIONS_TYPE as ke,useLocationsTree as _e}from"./useLocationsTree.js";import{usePinnedChromeSeed as Ce}from"./usePinnedChromeSeed.js";import{usePreviewHref as Le}from"./usePreviewHref.js";import{WebsitePreviewButton as Re}from"./WebsitePreviewButton.js";import{SITE_STYLES_TABS as Oe,SITE_STYLES_TEXT_TAB as Ae,useWebsiteName as ye}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Be}from"./useWebsiteMainAction.js";import{useEditorSession as He}from"../lib/editor-session-context.js";import{useOpenPageName as Ne}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as De,heroGroupNestDepth as We}from"../../format/lib/hero-group-placement.js";import{stripMarkup as xe}from"../../format/lib/markup.js";import{categoryShortLabel as Me,PINNED_SECTION_TYPE as Ve}from"../lib/puck/add-palette.js";import{canAddTo as Ye}from"../lib/puck/add-target.js";import{blockIsOffered as Ge}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Fe,setBookingPreview as ze}from"../../render/lib/puck/booking-preview.js";import{footerBlockRowName as je}from"../../format/lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as Ke,HEADER_TYPE as x}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as Ue,readLeftView as Ze,resolveLeftView as qe,writeLeftView as Xe}from"../../format/lib/puck/left-view.js";import{websiteIsLockedBlock as Je}from"../lib/puck/locked-blocks.js";import{everyPageBadge as Qe,everyPageNotice as $e,pinnedGroupTab as et,websiteDuplicateBlocked as tt}from"../lib/puck/every-page.js";import{pinnedChromeInPlace as C}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as ot,scrollPreviewToTop as M}from"../lib/puck/preview-dom.js";import{SiteCanvas as rt}from"../lib/puck/overrides.js";import{labelAtLevel as nt}from"../../format/lib/puck/section-catalog.js";import{editorWords as it,say as c}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as st}from"../../format/lib/puck/section-descriptions.js";import{groupAccepts as at,isSectionGroupType as ct,sectionGroupZone as lt,SITE_FOOTER_TYPE as dt,SITE_HEADER_TYPE as pt}from"../../format/lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as mt,SAVE_AS_TEMPLATE_EVENT as ft}from"../../format/lib/save-as-template-action.js";import{newSectionNode as ut}from"../lib/sections/new-section-node.js";import{useHostProducts as St}from"../lib/use-host-products.js";import{backendOf as wt}from"../lib/website-session.js";function V({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:n}=Se(),l=B().tree,d=e,p=d.kind==="ticker"?d.heroId:null,a=_(i=>{if(!i)return;t({kind:"ticker",heroId:i}),ot(i)},[t]);return b(()=>{o(p)},[p,o]),b(()=>{n(a)},[n,a]),{partRows:(i,{rowClick:u})=>{const m=String(i.props.id);return i.type==="Hero"&&r(y,{icon:r(L,{type:"ticker",size:13}),name:c(ue),onSelect:()=>a(m),selected:p===m,rowProps:{onClick:u(()=>a(m))},words:l})}}}function Y({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:n}=we(),l=B().tree,{appState:d}=ie(f=>f),p=d.data.content??[],a=X(p);a.current=p;const i=e,u=Ee.find(f=>H[f]===i.kind),m=u&&"nodeId"in i?N(String(i.nodeId),u):null,E=_(f=>{const s=Pe(f);if(!s)return;const h=a.current.findIndex(S=>String(S.props.id)===s.nodeId);if(h<0)return;const T={kind:H[s.part],nodeId:s.nodeId};t({index:h},T)},[t]);return b(()=>{o(m)},[m,o]),b(()=>{n(E)},[n,E]),{partRows:(f,{rowClick:s})=>{const h=String(f.props.id),T=he(f);if(T.length===0)return null;const S=I=>{const g=N(h,I.part);return r(y,{icon:r(L,{type:I.part==="media"?"heroMedia":"heroImage",size:13}),name:c(I.label),onSelect:()=>E(g),selected:m===g,rowProps:{onClick:s(()=>E(g))},words:l},g)},[w,...P]=T;return k(A,{children:[S(w),P.length>0&&r(ne,{children:P.map(S)})]})}}}function G(e,t){return{partRows:(o,n)=>k(A,{children:[e.partRows?.(o,n),t.partRows?.(o,n)]})}}function Et(e){const{adapter:t,capabilities:o,currentSlug:n,siteId:l,docId:d,hasUnsavedEdits:p,bridgeCapabilities:a,notifyParent:i,token:u}=R(),{hasPreviewLink:m}=o,E=wt(He()).preview?.draftLink,f=Be(e.data),s=mt({hasTrustedConsole:!!u,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:l,hasUnsavedEdits:p}),h=_(()=>{!l||!n||i(ft,{siteId:l,slug:n})},[i,l,n]),T=Le({pageSlug:n,siteId:l,token:u}),S=t.previewHref?.(n)??T;return{barLead:()=>s.visible&&r($,{side:"bottom",content:s.enabled?c("Save this website as a platform template"):c(s.disabledReason),children:r("span",{className:"sf-tip-disabled",tabIndex:s.enabled?void 0:0,children:r(Q,{variant:"secondary",disabled:!s.enabled,onClick:h,rightIcon:r(re,{size:15}),children:c("Save as Template")})})}),barTrail:()=>m&&n&&r(Re,{liveHref:S,pageId:d??null,draftLink:E}),mainAction:f}}function ht(){return k("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M12 3a9 9 0 0 0 0 18 2.3 2.3 0 0 0 2.3-2.3c0-.55-.22-1.05-.57-1.42-.34-.37-.56-.87-.56-1.43A2.35 2.35 0 0 1 15.6 13.5H18a3 3 0 0 0 3-3c0-4.14-4-7.5-9-7.5z"}),r("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function Pt(e,t){const{capabilities:o,templateId:n,siteId:l,tokenRef:d,navigate:p}=R(),{hasSiteTheme:a,explainsSiteSettings:i}=o,u=w=>t.setView(w),[m,E]=J(Oe[0].id),{surface:f,setSurface:s}=fe(),h=()=>{if(a){u("styles"),t.reveal(),M();return}e.show(W),e.reveal(),M()},T={id:"pages",label:c("Pages"),icon:r(te,{}),panel:({onHide:w})=>r(ae,{activeSurface:f,onPreviewSurface:s,onNavigate:P=>{s(null),p(n?{kind:"template",id:n,pageSlug:P}:{kind:"page",slug:P,siteId:l??void 0})},onClose:w})},S=[];return!a&&i&&S.push({id:"appearance",label:c("Appearance"),icon:r(ht,{}),active:e.kind==="website",onSelect:h}),a&&S.push({id:"styles",label:c("Site styles"),icon:r(oe,{}),panel:({onHide:w,notify:P})=>r(ve,{tokenRef:d,siteId:l??void 0,onClose:w,onNotify:P,tab:m,onTabChange:E})}),{railLead:[T],railTrail:S,resolveLeftView:(w,P)=>qe(w,a,P),openSettings:h,openStyles:()=>{E(Ae),u("styles")}}}function Tt(e,t,o,n){const{kind:l,open:d}=e,{selected:p,zoneOf:a}=t;b(()=>{ze(p?.type==="BookingBox"&&p.props.region==="confirm"?Fe(a(String(p.props.id))):null)},[p?.props.id]);const i=_e(e,t),{capabilities:{hasSiteSettings:u}}=R(),{setSelected:m,setSelectHandler:E}=pe(),{chat:f,setChat:s,setSelected:h,setSelectHandler:T}=ce(),S=l==="header";b(()=>{m(S)},[S,m]),b(()=>{E(()=>d(D))},[E,d]);const w=_(()=>d(be),[d]),P=l==="chat";b(()=>{h(P)},[P,h]),b(()=>{T(w)},[T,w]);const{setOpenHandler:I}=me(),g=_(()=>d(ge),[d]);b(()=>{I(g)},[I,g]);const j=G(V(e),Y(e)),K=Et(t),U=Pt(e,n),Z=o.device;return{...j,...K,...U,hasOwnRows:v=>v.type===ke,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:v=>r(se.Provider,{value:!0,children:r(de.Provider,{value:Z,children:v})}),addPanelRow:v=>u?k("div",{className:"sf-addside-sitewide",children:[r("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:r(L,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{v(),w()},children:[c("Live chat"),r("span",{className:"sf-addside-sitewide-desc",children:c("A chat bubble on every page")})]}),r(ee,{checked:f.enabled,onChange:q=>s({enabled:q}),ariaLabel:c("Show the chat bubble on the whole site")})]}):void 0}}let F=null,O=new WeakMap;function bt(e){const t=it();if(!e||!t)return e;F!==t&&(F=t,O=new WeakMap);let o=O.get(e);return o||(o={...e,choices:e.choices?e.choices.map(n=>({...n,label:c(n.label)})):null,spec:e.spec?{...e.spec,addLabel:c(e.spec.addLabel)}:null},O.set(e,o)),o}const gt={isLockedBlock:Je,duplicateBlocked:tt,nestDepth:(e,t,o)=>t===De?We(e,o):0,newSectionNode:ut,canAddTo:(e,t)=>bt(Ye(e,t)),blockIsOffered:Ge},It=new Proxy(st,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?c(o):o}}),vt={labelAtLevel:(e,t,o)=>c(nt(e,t,o)),descriptions:It,categoryLabel:e=>{const t=Me(e);return t===void 0?void 0:c(t)},firstSection:Ve,blockRowName:je,plainText:xe,Icon:L,Thumbnail:Ie,useProducts:St},kt={desktop:2e3,tablet:800,mobile:390},z="desktop",_t={options:le,initial:z,fluid:z,widths:kt},Ct={read:Ze,write:e=>Xe(e),forSelection:(e,t)=>Ue(e,t)},Lt={first:x,last:Ke,firstGroup:pt,lastGroup:dt,isSectionGroup:ct,sectionGroupZone:lt,panelOf:e=>e===x?D:null,get groupTab(){return C()?et:void 0},get groupBadge(){return C()?Qe():void 0},get changeNotice(){return C()?$e():void 0},get band(){return C()?Rt:void 0},get groupAccepts(){return C()?at:void 0}},Rt={foldable:!0};function Ot(e){return{...G(V(e),Y(e)),openSettings:()=>e.show(W)}}const Bo={useOwnerName:ye,useDocumentLabel:Ne,useBridges:Tt,useStandaloneBridges:Ot,useDocumentPass:Ce,blockRules:gt,blockLook:vt,devices:_t,leftView:Ct,pinned:Lt,Canvas:rt,Inspector:Te};export{Bo as WEBSITE_SCREEN};
1
+ "use client";import{jsx as n,Fragment as A,jsxs as C}from"react/jsx-runtime";import{useCallback as k,useEffect as h,useRef as X,useState as J}from"react";import{Button as Q,Tooltip as $}from"efficient-shell/ui";import{SettingsSwitch as ee}from"efficient-easel/panel";import{PagesIcon as te,StylesIcon as oe}from"efficient-easel/rail";import{PaletteIcon as re}from"efficient-shell/icons/efficient";import{TemplateIcon as ne}from"efficient-easel/icons";import{Subtree as ie,TreeRow as B}from"efficient-easel/tree";import{useEasel as se}from"efficient-easel/easel";import{useEaselStrings as y}from"efficient-easel/strings";import{LocationsTreeContext as ae}from"./LocationsTreeContext.js";import ce from"./PagesPanel.js";import{usePreviewChat as de}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as le}from"./preview-devices.js";import{PreviewDeviceContext as pe}from"efficient-easel/draw/client";import{usePreviewHeader as me}from"../../render/components/PreviewHeaderContext.js";import{usePreviewSocial as fe}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as ue}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Se,usePreviewTicker as we}from"../../render/components/PreviewTickerContext.js";import{usePreviewHeroPart as Ee}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Pe,HERO_PART_MODE as N,heroMediaRows as Te,heroPartId as H,readHeroPartId as be}from"../../render/lib/puck/hero-media-parts.js";import he,{CHAT_MODE as ge,HEADER_MODE as D,SOCIAL_MODE as Ie,WEBSITE_MODE as W}from"./SectionEditor.js";import L from"./SectionIcon.js";import ve from"./SectionThumbnail.js";import{useStorefrontDocument as R}from"./StorefrontDocumentContext.js";import ke from"./StylesPanel.js";import{LOCATIONS_TYPE as _e,useLocationsTree as Ce}from"./useLocationsTree.js";import{usePinnedChromeSeed as Le}from"./usePinnedChromeSeed.js";import{usePreviewHref as Re}from"./usePreviewHref.js";import{WebsitePreviewButton as Oe}from"./WebsitePreviewButton.js";import{SITE_STYLES_TABS as Ae,SITE_STYLES_TEXT_TAB as Be,useWebsiteName as ye}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Ne}from"./useWebsiteMainAction.js";import{useEditorSession as He}from"../lib/editor-session-context.js";import{useOpenPageName as De}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as We,heroGroupNestDepth as Me}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ve}from"../../format/lib/markup.js";import{categoryShortLabel as xe,PINNED_SECTION_TYPE as Ye}from"../lib/puck/add-palette.js";import{canAddTo as Ge}from"../lib/puck/add-target.js";import{blockIsOffered as Fe}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as ze,setBookingPreview as Ke}from"../../render/lib/puck/booking-preview.js";import{footerBlockRowName as je}from"../../format/lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as Ue,HEADER_TYPE as M}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as Ze,readLeftView as qe,resolveLeftView as Xe,writeLeftView as Je}from"../../format/lib/puck/left-view.js";import{websiteIsLockedBlock as Qe}from"../lib/puck/locked-blocks.js";import{everyPageBadge as $e,everyPageNotice as et,pinnedGroupTab as tt,websiteDuplicateBlocked as ot}from"../lib/puck/every-page.js";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as rt,scrollPreviewToTop as V}from"../lib/puck/preview-dom.js";import{SiteCanvas as nt}from"../lib/puck/overrides.js";import{labelAtLevel as it}from"../../format/lib/puck/section-catalog.js";import{editorWords as st,say as c}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as at}from"../../format/lib/puck/section-descriptions.js";import{groupAccepts as ct,isSectionGroupType as dt,sectionGroupZone as lt,SITE_FOOTER_TYPE as pt,SITE_HEADER_TYPE as mt}from"../../format/lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as ft,SAVE_AS_TEMPLATE_EVENT as ut}from"../../format/lib/save-as-template-action.js";import{newSectionNode as St}from"../lib/sections/new-section-node.js";import{useHostProducts as wt}from"../lib/use-host-products.js";import{backendOf as Et}from"../lib/website-session.js";function x({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=we(),d=y().tree,l=e,p=l.kind==="ticker"?l.heroId:null,a=k(i=>{if(!i)return;t({kind:"ticker",heroId:i}),rt(i)},[t]);return h(()=>{o(p)},[p,o]),h(()=>{r(a)},[r,a]),{partRows:(i,{rowClick:u})=>{const m=String(i.props.id);return i.type==="Hero"&&n(B,{icon:n(L,{type:"ticker",size:13}),name:c(Se),onSelect:()=>a(m),selected:p===m,rowProps:{onClick:u(()=>a(m))},words:d})}}}function Y({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Ee(),d=y().tree,{appState:l}=se(f=>f),p=l.data.content??[],a=X(p);a.current=p;const i=e,u=Pe.find(f=>N[f]===i.kind),m=u&&"nodeId"in i?H(String(i.nodeId),u):null,E=k(f=>{const s=be(f);if(!s)return;const P=a.current.findIndex(S=>String(S.props.id)===s.nodeId);if(P<0)return;const b={kind:N[s.part],nodeId:s.nodeId};t({index:P},b)},[t]);return h(()=>{o(m)},[m,o]),h(()=>{r(E)},[r,E]),{partRows:(f,{rowClick:s})=>{const P=String(f.props.id),b=Te(f);if(b.length===0)return null;const S=I=>{const g=H(P,I.part);return n(B,{icon:n(L,{type:I.part==="media"?"heroMedia":"heroImage",size:13}),name:c(I.label),onSelect:()=>E(g),selected:m===g,rowProps:{onClick:s(()=>E(g))},words:d},g)},[w,...T]=b;return C(A,{children:[S(w),T.length>0&&n(ie,{children:T.map(S)})]})}}}function G(e,t){return{partRows:(o,r)=>C(A,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Pt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:d,docId:l,hasUnsavedEdits:p,bridgeCapabilities:a,notifyParent:i,token:u}=R(),{hasPreviewLink:m}=o,E=Et(He()).preview?.draftLink,f=Ne(e.data),s=ft({hasTrustedConsole:!!u,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:d,hasUnsavedEdits:p}),P=k(()=>{!d||!r||i(ut,{siteId:d,slug:r})},[i,d,r]),b=Re({pageSlug:r,siteId:d,token:u}),S=t.previewHref?.(r)??b;return{barLead:()=>s.visible&&n($,{side:"bottom",content:s.enabled?c("Save this website as a platform template"):c(s.disabledReason),children:n("span",{className:"sf-tip-disabled",tabIndex:s.enabled?void 0:0,children:n(Q,{variant:"secondary",disabled:!s.enabled,onClick:P,rightIcon:n(ne,{size:15}),children:c("Save as Template")})})}),barTrail:()=>m&&r&&n(Oe,{liveHref:S,pageId:l??null,draftLink:E}),mainAction:f}}function Tt(e,t){const{capabilities:o,templateId:r,siteId:d,tokenRef:l,navigate:p}=R(),{hasSiteTheme:a,explainsSiteSettings:i}=o,u=w=>t.setView(w),[m,E]=J(Ae[0].id),{surface:f,setSurface:s}=ue(),P=()=>{if(a){u("styles"),t.reveal(),V();return}e.show(W),e.reveal(),V()},b={id:"pages",label:c("Pages"),icon:n(te,{}),panel:({onHide:w})=>n(ce,{activeSurface:f,onPreviewSurface:s,onNavigate:T=>{s(null),p(r?{kind:"template",id:r,pageSlug:T}:{kind:"page",slug:T,siteId:d??void 0})},onClose:w})},S=[];return!a&&i&&S.push({id:"appearance",label:c("Appearance"),icon:n(re,{}),active:e.kind==="website",onSelect:P}),a&&S.push({id:"styles",label:c("Site styles"),icon:n(oe,{}),panel:({onHide:w,notify:T})=>n(ke,{tokenRef:l,siteId:d??void 0,onClose:w,onNotify:T,tab:m,onTabChange:E})}),{railLead:[b],railTrail:S,resolveLeftView:(w,T)=>Xe(w,a,T),openSettings:P,openStyles:()=>{E(Be),u("styles")}}}function bt(e,t,o,r){const{kind:d,open:l}=e,{selected:p,zoneOf:a}=t;h(()=>{Ke(p?.type==="BookingBox"&&p.props.region==="confirm"?ze(a(String(p.props.id))):null)},[p?.props.id]);const i=Ce(e,t),{capabilities:{hasSiteSettings:u}}=R(),{setSelected:m,setSelectHandler:E}=me(),{chat:f,setChat:s,setSelected:P,setSelectHandler:b}=de(),S=d==="header";h(()=>{m(S)},[S,m]),h(()=>{E(()=>l(D))},[E,l]);const w=k(()=>l(ge),[l]),T=d==="chat";h(()=>{P(T)},[T,P]),h(()=>{b(w)},[b,w]);const{setOpenHandler:I}=fe(),g=k(()=>l(Ie),[l]);h(()=>{I(g)},[I,g]);const K=G(x(e),Y(e)),j=Pt(t),U=Tt(e,r),Z=o.device;return{...K,...j,...U,hasOwnRows:v=>v.type===_e,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:v=>n(ae.Provider,{value:!0,children:n(pe.Provider,{value:Z,children:v})}),addPanelRow:v=>u?C("div",{className:"sf-addside-sitewide",children:[n("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:n(L,{type:"chat",size:16})}),C("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{v(),w()},children:[c("Live chat"),n("span",{className:"sf-addside-sitewide-desc",children:c("A chat bubble on every page")})]}),n(ee,{checked:f.enabled,onChange:q=>s({enabled:q}),ariaLabel:c("Show the chat bubble on the whole site")})]}):void 0}}let F=null,O=new WeakMap;function ht(e){const t=st();if(!e||!t)return e;F!==t&&(F=t,O=new WeakMap);let o=O.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:c(r.label)})):null,spec:e.spec?{...e.spec,addLabel:c(e.spec.addLabel)}:null},O.set(e,o)),o}const gt={isLockedBlock:Qe,duplicateBlocked:ot,nestDepth:(e,t,o)=>t===We?Me(e,o):0,newSectionNode:St,canAddTo:(e,t)=>ht(Ge(e,t)),blockIsOffered:Fe},It=new Proxy(at,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?c(o):o}}),vt={labelAtLevel:(e,t,o)=>c(it(e,t,o)),descriptions:It,categoryLabel:e=>{const t=xe(e);return t===void 0?void 0:c(t)},firstSection:Ye,blockRowName:je,plainText:Ve,Icon:L,Thumbnail:ve,useProducts:wt},kt={desktop:2e3,tablet:800,mobile:390},z="desktop",_t={options:le,initial:z,fluid:z,widths:kt},Ct={read:qe,write:e=>Je(e),forSelection:(e,t)=>Ze(e,t)},Lt={first:M,last:Ue,firstGroup:mt,lastGroup:pt,isSectionGroup:dt,sectionGroupZone:lt,panelOf:e=>e===M?D:null,get groupTab(){return _()?tt:void 0},get groupBadge(){return _()?$e():void 0},get changeNotice(){return _()?et():void 0},get band(){return _()?Rt:void 0},get groupAccepts(){return _()?ct:void 0}},Rt={foldable:!0};function Ot(e){return{...G(x(e),Y(e)),openSettings:()=>e.show(W)}}const No={useOwnerName:ye,useDocumentLabel:De,useBridges:bt,useStandaloneBridges:Ot,useDocumentPass:Le,blockRules:gt,blockLook:vt,devices:_t,leftView:Ct,pinned:Lt,Canvas:nt,Inspector:he};export{No as WEBSITE_SCREEN};
@@ -1 +1 @@
1
- "use client";import{useEffect as G,useRef as L}from"react";import{createNode as x,newId as z}from"efficient-easel/data";import{useEaselApi as U}from"efficient-easel/easel";import{useStorefrontDocument as Z}from"./StorefrontDocumentContext.js";import{SITE_FOOTER_SLUG as H}from"../../format/lib/content/footer.js";import{boxFooterFromFooter as B}from"../lib/puck/box-footer.js";import{ROOT_ZONE as l,missingPinnedTypes as j,pinnedDuplicateIds as P}from"efficient-easel/draw";import{FOOTER_TYPE as c,HEADER_TYPE as p,buildDefaultFooterBlocks as D,buildDefaultHeaderNode as E}from"../lib/puck/footer-blocks.js";import{canSeedPinnedChrome as q}from"../lib/puck/pinned-seed-gate.js";import{siteFooterDocChrome as J,SITE_FOOTER_TYPE as f}from"../../format/lib/puck/section-groups.js";import{inPlaceSeedPlan as K}from"../lib/puck/pinned-in-place-seed.js";function se(t,F){const{adapter:k,capabilities:T,currentSlug:O,docId:u,data:y,saveStatus:I}=Z(),{hasSiteSettings:N,hasPinnedChrome:b}=T,C=!!T.editsPinnedInPlace&&O!==H,R=O===H,_=U().getState,v=L(null);G(()=>{if(!q({docId:u,saveStatus:I,seededDocId:v.current})||(v.current=u,!b))return;const m=_().appState.data,o=m.content,a=y?.content??[],d=(e,n)=>e.some(r=>r?.type===n);if(!N){const e=new Set(P(o)),n=e.size?o.filter(s=>!e.has(s.props.id)):o;e.size&&t.setDocument({...m,content:n});const r=j(n,a);if(r.includes(c)){const s=n.length,i=t.insertSection(c,s);t.replaceComponent(l,s,{type:c,props:{id:i,blocks:D()}})}r.includes(p)&&t.insertNode(l,0,E());return}if(R){const e=J(o);if(e!==o&&t.setDocument({...m,content:[...e]}),!e.find(r=>r.type===c)&&!d(a,c)&&!d(e,f)&&!d(a,f)){const r=(i,g)=>x(F,i,g),s={type:c,props:{blocks:D()}};t.insertNode(l,e.length,B(s,r,z(f)))}return}if(C){const e=!!k?.pinnedChrome?.state().docId,n=K(o,{hasChromeDoc:e}),r=new Set([...n.remove,...P(o.filter(i=>!n.remove.includes(String(i.props.id))))]),s=r.size?o.filter(i=>!r.has(String(i.props.id))):o;if(s.length!==o.length&&t.setDocument({...m,content:s}),n.seedFooter&&!d(a,c)&&!d(a,f)){const i=(Y,A)=>x(F,Y,A),g={type:c,props:{blocks:D()}};t.insertNode(l,s.length,B(g,i,z(f)))}if(n.seedHeader&&!d(a,p)){const i=s[0]?.type==="SiteHeader"?1:0;t.insertNode(l,i,E())}return}const h=o.filter(e=>e.type!==c),w=new Set(P(h)),S=w.size?h.filter(e=>!w.has(e.props.id)):h;S.length!==o.length&&t.setDocument({...m,content:S}),!d(S,p)&&!d(a,p)&&t.insertNode(l,0,E())},[u,I,y,_,t,N,b,R,C,k])}export{se as usePinnedChromeSeed};
1
+ "use client";import{useEffect as G,useRef as L}from"react";import{createNode as x,newId as z}from"efficient-easel/data";import{useEaselApi as U}from"efficient-easel/easel";import{useStorefrontDocument as Z}from"./StorefrontDocumentContext.js";import{SITE_FOOTER_SLUG as H}from"../../format/lib/content/footer.js";import{boxFooterFromFooter as B}from"../../format/lib/puck/box-footer.js";import{ROOT_ZONE as l,missingPinnedTypes as j,pinnedDuplicateIds as P}from"efficient-easel/draw";import{FOOTER_TYPE as c,HEADER_TYPE as p,buildDefaultFooterBlocks as D,buildDefaultHeaderNode as E}from"../lib/puck/footer-blocks.js";import{canSeedPinnedChrome as q}from"../lib/puck/pinned-seed-gate.js";import{siteFooterDocChrome as J,SITE_FOOTER_TYPE as f}from"../../format/lib/puck/section-groups.js";import{inPlaceSeedPlan as K}from"../lib/puck/pinned-in-place-seed.js";function se(t,F){const{adapter:k,capabilities:T,currentSlug:O,docId:u,data:y,saveStatus:I}=Z(),{hasSiteSettings:N,hasPinnedChrome:b}=T,C=!!T.editsPinnedInPlace&&O!==H,R=O===H,_=U().getState,v=L(null);G(()=>{if(!q({docId:u,saveStatus:I,seededDocId:v.current})||(v.current=u,!b))return;const m=_().appState.data,o=m.content,a=y?.content??[],d=(e,n)=>e.some(r=>r?.type===n);if(!N){const e=new Set(P(o)),n=e.size?o.filter(s=>!e.has(s.props.id)):o;e.size&&t.setDocument({...m,content:n});const r=j(n,a);if(r.includes(c)){const s=n.length,i=t.insertSection(c,s);t.replaceComponent(l,s,{type:c,props:{id:i,blocks:D()}})}r.includes(p)&&t.insertNode(l,0,E());return}if(R){const e=J(o);if(e!==o&&t.setDocument({...m,content:[...e]}),!e.find(r=>r.type===c)&&!d(a,c)&&!d(e,f)&&!d(a,f)){const r=(i,g)=>x(F,i,g),s={type:c,props:{blocks:D()}};t.insertNode(l,e.length,B(s,r,z(f)))}return}if(C){const e=!!k?.pinnedChrome?.state().docId,n=K(o,{hasChromeDoc:e}),r=new Set([...n.remove,...P(o.filter(i=>!n.remove.includes(String(i.props.id))))]),s=r.size?o.filter(i=>!r.has(String(i.props.id))):o;if(s.length!==o.length&&t.setDocument({...m,content:s}),n.seedFooter&&!d(a,c)&&!d(a,f)){const i=(Y,A)=>x(F,Y,A),g={type:c,props:{blocks:D()}};t.insertNode(l,s.length,B(g,i,z(f)))}if(n.seedHeader&&!d(a,p)){const i=s[0]?.type==="SiteHeader"?1:0;t.insertNode(l,i,E())}return}const h=o.filter(e=>e.type!==c),w=new Set(P(h)),S=w.size?h.filter(e=>!w.has(e.props.id)):h;S.length!==o.length&&t.setDocument({...m,content:S}),!d(S,p)&&!d(a,p)&&t.insertNode(l,0,E())},[u,I,y,_,t,N,b,R,C,k])}export{se as usePinnedChromeSeed};
@@ -0,0 +1,9 @@
1
+ export declare const HEADER_LOGO_PX: {
2
+ readonly small: 54;
3
+ readonly medium: 66;
4
+ readonly large: 84;
5
+ };
6
+ export declare const FOOTER_LOGO_PX = 44;
7
+ export declare const HEADER_LOGO_PX_MIN = 16;
8
+ export declare const HEADER_LOGO_PX_MAX = 140;
9
+ export declare const LOGO_BLOCK_PX_MAX: number;
@@ -0,0 +1 @@
1
+ const _={small:54,medium:66,large:84},O=44,o=16,t=140,e=O*4;export{O as FOOTER_LOGO_PX,_ as HEADER_LOGO_PX,t as HEADER_LOGO_PX_MAX,o as HEADER_LOGO_PX_MIN,e as LOGO_BLOCK_PX_MAX};
@@ -0,0 +1 @@
1
+ import{FOOTER_LOGO_PX as T}from"../logo/logo-size.js";import{resolveContainerGap as E}from"../content/container-gap.js";import{buildSectionGroup as _,SITE_FOOTER_TYPE as m}from"./section-groups.js";const p="Flex",O={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock"},P=o=>{const{id:e,...t}=o;return t},d=o=>typeof o=="string"?o:"",u=o=>typeof o=="number"&&Number.isFinite(o)?o:void 0,a={sm:12,md:13,lg:15},x="md",f=1.5,y={size:13,lineHeight:f,width:280},L=14,b=40,A=o=>o==="center"||o==="right"?o:"left";function w(o){const e={},t=[["padTop","sectionPaddingTop"],["padRight","sectionPaddingRight"],["padBottom","sectionPaddingBottom"],["padLeft","sectionPaddingLeft"]];for(const[s,r]of t){const n=u(o[s]);n&&(e[r]=n)}return e}function h(o,e){const t=o.props??{},s=O[o.type];if(s)return[e(s,P(t))];switch(o.type){case"FooterLogo":{const r=A(t.align),n=e("LogoBlock",{...t.reverse?{reverse:t.reverse}:{},...typeof t.customColor=="string"&&t.customColor?{customColor:t.customColor}:{},heightPx:Math.round(T*((u(t.widthPct)??100)/100)),href:"/",align:r,...w(t)}),i=d(t.tagline).trim();return i?[n,e("Text",{text:i,tone:"dim",align:r,_partStyles:{text:{...y}}})]:[n]}case"FooterText":{const r=typeof t.size=="string"&&t.size in a?t.size:x;return[e("Text",{text:d(t.text),tone:typeof t.tone=="string"?t.tone:"default",_partStyles:{text:{size:a[r],lineHeight:f}}})]}case"FooterDivider":{const r=u(t.thickness),n=u(t.lengthPct);return[e("Divider",{...r!==void 0?{thickness:r}:{},...n!==void 0?{lengthPct:n}:{},...t.hideOnMobile===!0?{hideOnMobile:!0}:{}})]}case"FooterGroup":{const r=Array.isArray(t.blocks)?t.blocks:[];return[e(p,{direction:t.direction==="horizontal"?"row":"column",gap:E("FooterGroup",t.gap),align:t.align==="center"||t.align==="end"?t.align:"start",content:r.flatMap(n=>h(n,e))})]}default:return[]}}function I(o,e,t){const s=o&&Array.isArray(o.props?.blocks)?o.props.blocks:[],r=c=>e(p,{direction:"row",wrap:!0,share:"equal",gap:b,content:c}),n=[];let i=[];for(const c of s){const l=h(c,e);if(c.type==="FooterDivider"){i.length&&n.push(r(i)),i=[],n.push(...l);continue}l.length<=1?i.push(...l):i.push(e(p,{direction:"column",gap:L,align:"stretch",content:l}))}(i.length||!n.length)&&n.push(r(i));const F=e(p,{direction:"column",content:[e("LegalLineBlock")]}),g=_(m,t,[...n,F]);return{...g,props:{...g.props,...o?.props?.width==="full"?{fullWidth:!0}:{}}}}export{I as boxFooterFromFooter,h as pageBlocksFromFooterBlock};
@@ -15,15 +15,6 @@ interface Props {
15
15
  fitWordmarkToContainer?: boolean;
16
16
  fitFloorPx?: number;
17
17
  }
18
- export declare const HEADER_LOGO_PX: {
19
- readonly small: 54;
20
- readonly medium: 66;
21
- readonly large: 84;
22
- };
23
- export declare const FOOTER_LOGO_PX = 44;
24
- export declare const HEADER_LOGO_PX_MIN = 16;
25
- export declare const HEADER_LOGO_PX_MAX = 140;
26
- export declare const LOGO_BLOCK_PX_MAX: number;
18
+ export { FOOTER_LOGO_PX, HEADER_LOGO_PX, HEADER_LOGO_PX_MAX, HEADER_LOGO_PX_MIN, LOGO_BLOCK_PX_MAX } from "../../format/lib/logo/logo-size.js";
27
19
  export declare const WORDMARK_FIT_FLOOR_PX = 16;
28
20
  export default function Logo({ variant, scrolled, src, reverse, color, onLightSurface, reversedSrc, inkIsDark, size, sizePx, wordmark, siteName, fitToContainer, fitWordmarkToContainer, fitFloorPx }: Props): import("react").JSX.Element;
29
- export {};
@@ -1 +1 @@
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
+ "use client";import{jsx as i,jsxs as L}from"react/jsx-runtime";import{useEffect as m,useId as ot,useRef as H,useState as h}from"react";import{NEUTRAL_SITE_NAME as lt}from"../../format/lib/content/site-name.js";import{isSvgUrl as rt}from"../../format/lib/logo/reverse-svg.js";import{analyzeLogoViaServer as it}from"../lib/logo/analyze-logo-client.js";import{FOOTER_LOGO_PX as at,HEADER_LOGO_PX as ct}from"../../format/lib/logo/logo-size.js";import{FOOTER_LOGO_PX as It,HEADER_LOGO_PX as Lt,HEADER_LOGO_PX_MAX as At,HEADER_LOGO_PX_MIN as St,LOGO_BLOCK_PX_MAX as Ft}from"../../format/lib/logo/logo-size.js";const ut=202/22,dt=.88,Rt=16,mt="invert(1)";function ht({variant:N="header",scrolled:W=!0,src:f,reverse:j=!1,color:p=null,onLightSurface:C,reversedSrc:A,inkIsDark:K,size:q="medium",sizePx:_,wordmark:O,siteName:z=lt,fitToContainer:S=!1,fitWordmarkToContainer:B=!1,fitFloorPx:g}){const a=O&&O.trim()?O.trim():z,[U,V]=h(!1),F=H(null),Z=t=>{F.current=t};m(()=>{const t=F.current?.ownerDocument??document,o=()=>{V(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,c=!!n&&rt(n),b=C??(U&&W),s=p&&p.trim()?p.trim():null,u=j&&!s,k=`logo-color-${ot().replace(/[^A-Za-z0-9_-]/g,"")}`,y=u&&c&&n&&A!=null?{reversed:A,inkIsDark:K??null}:null,D=y!==null,[J,E]=h(null);m(()=>{if(!u||!n||!c||D){E(null);return}let t=!1;return E(null),it(n).then(o=>{t||E(o)}),()=>{t=!0}},[u,n,c,D]);const r=y??J,$=!!r&&r.inkIsDark!==null&&(b?!r.inkIsDark:r.inkIsDark),Q=u&&!!n&&!c&&!b,R=$&&r?r.reversed:n,X=R?[R]:[],[w,x]=h(0);m(()=>{x(0)},[n,$]);const Y=N==="footer"?at:ct[q],l=_&&_>0?_:Y,tt=Math.round(l*ut),e=w<X.length?X[w]:null,[et,v]=h(R),G=e!==null&&e===et,M=H(null);m(()=>{const t=M.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&&x(d=>d+1)),()=>{o=!0}},[e]);const P=S||B,T=`calc(100cqi / ${((a.length+1)*dt).toFixed(2)})`,I=P&&g&&g>0?Math.min(g,l):null,nt=P?I===null?`min(${l}px, ${T})`:`clamp(${I}px, ${T}, ${l}px)`:`${l}px`,st=L("span",{className:`font-display font-bold tracking-[0.18em] ${I===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:nt,lineHeight:1,...s?{color:s}:{}},"aria-label":a,children:[a,i("span",{className:"text-accent",style:s?{color:s}:void 0,children:"."})]});return L("span",{ref:Z,className:"inline-flex items-center",children:[!G&&st,s&&e&&i("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:L("filter",{id:k,colorInterpolationFilters:"sRGB",children:[i("feFlood",{style:{floodColor:s}}),i("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),e&&i("img",{ref:M,src:e,alt:a,width:tt,height:l,className:"shrink-0 object-contain",style:{...G?{height:`${l}px`,width:"auto",...S?{maxWidth:"100cqi"}:{}}:{display:"none"},...Q?{filter:mt}:{},...s?{filter:`url(#${k})`}:{}},onLoad:()=>v(e),onError:()=>x(t=>t+1)},e)]})}export{It as FOOTER_LOGO_PX,Lt as HEADER_LOGO_PX,At as HEADER_LOGO_PX_MAX,St as HEADER_LOGO_PX_MIN,Ft as LOGO_BLOCK_PX_MAX,Rt as WORDMARK_FIT_FLOOR_PX,ht as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "26.3.0",
3
+ "version": "26.3.1",
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",
@@ -44,7 +44,7 @@
44
44
  "test:screen": "node scripts/test-screen-in-easel.mjs",
45
45
  "test:own-ui": "efficient-shell-ui-check",
46
46
  "build": "node scripts/build.mjs",
47
- "verify:dist": "node scripts/verify-dist.mjs",
47
+ "verify:dist": "node scripts/verify-dist.mjs && node scripts/verify-published-entries.mjs",
48
48
  "verify": "pnpm run typecheck && pnpm run test:boundary && pnpm run test:screen && pnpm run test:own-ui && pnpm run test:guards && pnpm run build && pnpm run verify:dist",
49
49
  "test:guards": "tsc --noEmit -p scripts/tsconfig.json && node scripts/run-guards.mjs",
50
50
  "words": "TSX_TSCONFIG_PATH=scripts/tsconfig.json tsx scripts/write-editor-words.ts",
@@ -1 +0,0 @@
1
- import{FOOTER_LOGO_PX as T}from"../../../render/components/Logo.js";import{resolveContainerGap as E}from"../../../format/lib/content/container-gap.js";import{buildSectionGroup as _,SITE_FOOTER_TYPE as m}from"../../../format/lib/puck/section-groups.js";const p="Flex",O={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock"},P=o=>{const{id:e,...t}=o;return t},d=o=>typeof o=="string"?o:"",u=o=>typeof o=="number"&&Number.isFinite(o)?o:void 0,a={sm:12,md:13,lg:15},x="md",f=1.5,y={size:13,lineHeight:f,width:280},L=14,b=40,A=o=>o==="center"||o==="right"?o:"left";function w(o){const e={},t=[["padTop","sectionPaddingTop"],["padRight","sectionPaddingRight"],["padBottom","sectionPaddingBottom"],["padLeft","sectionPaddingLeft"]];for(const[s,r]of t){const n=u(o[s]);n&&(e[r]=n)}return e}function h(o,e){const t=o.props??{},s=O[o.type];if(s)return[e(s,P(t))];switch(o.type){case"FooterLogo":{const r=A(t.align),n=e("LogoBlock",{...t.reverse?{reverse:t.reverse}:{},...typeof t.customColor=="string"&&t.customColor?{customColor:t.customColor}:{},heightPx:Math.round(T*((u(t.widthPct)??100)/100)),href:"/",align:r,...w(t)}),i=d(t.tagline).trim();return i?[n,e("Text",{text:i,tone:"dim",align:r,_partStyles:{text:{...y}}})]:[n]}case"FooterText":{const r=typeof t.size=="string"&&t.size in a?t.size:x;return[e("Text",{text:d(t.text),tone:typeof t.tone=="string"?t.tone:"default",_partStyles:{text:{size:a[r],lineHeight:f}}})]}case"FooterDivider":{const r=u(t.thickness),n=u(t.lengthPct);return[e("Divider",{...r!==void 0?{thickness:r}:{},...n!==void 0?{lengthPct:n}:{},...t.hideOnMobile===!0?{hideOnMobile:!0}:{}})]}case"FooterGroup":{const r=Array.isArray(t.blocks)?t.blocks:[];return[e(p,{direction:t.direction==="horizontal"?"row":"column",gap:E("FooterGroup",t.gap),align:t.align==="center"||t.align==="end"?t.align:"start",content:r.flatMap(n=>h(n,e))})]}default:return[]}}function I(o,e,t){const s=o&&Array.isArray(o.props?.blocks)?o.props.blocks:[],r=c=>e(p,{direction:"row",wrap:!0,share:"equal",gap:b,content:c}),n=[];let i=[];for(const c of s){const l=h(c,e);if(c.type==="FooterDivider"){i.length&&n.push(r(i)),i=[],n.push(...l);continue}l.length<=1?i.push(...l):i.push(e(p,{direction:"column",gap:L,align:"stretch",content:l}))}(i.length||!n.length)&&n.push(r(i));const F=e(p,{direction:"column",content:[e("LegalLineBlock")]}),g=_(m,t,[...n,F]);return{...g,props:{...g.props,...o?.props?.width==="full"?{fullWidth:!0}:{}}}}export{I as boxFooterFromFooter,h as pageBlocksFromFooterBlock};