efficient-web-builder 74.4.0 → 74.6.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 74.6.0 - 2026-11-22
4
+
5
+ From main at `ca2a3c7d`.
6
+
7
+ A minor: accept efficient-shell 15. The peer range widens to `^14.5.1 || ^15.0.0` and the repository builds against `^15.1.0`. No new peer, no removed path, no stored key or value moves.
8
+
9
+ **For hosts:**
10
+ - No step on shell 14. A host may now pin efficient-shell `^15.1.0` (admin-portal next). efficient-easel 37.3.x still peers on `^13.23.1 || ^14.0.0`, so a host on shell 15 sees easel's peer warning until easel widens too.
11
+
12
+ ### Changed
13
+
14
+ - **Version history is a centred popup.** efficient-shell 15.0.0 took the side `Drawer` away (`side`, `size`, `DrawerSize`; harness UI-20: a popup never slides in from the side). The Publish menu's Version history, the builder's one side drawer, is now the shell's `Dialog` at `size="xl"`, centred on the editor, its list scrolling inside it. Same title, lines, rows and Restore; on shell 14 it draws the same. `components/VersionHistoryDrawer` keeps its name and path.
15
+
16
+ ## 74.5.0 - 2026-11-22
17
+
18
+ From main at `2a217a08`: #834.
19
+
20
+ A minor: the "Website" rows (Count side space once, Offices, Custom CSS, from 74.2.0) show on the in-place Footer of every page, where a merchant can reach them. New exports; no new peer, no removed path, no new stored field. The values stay stored on the site-footer root only; an untouched round trip is byte-same.
21
+
22
+ **For hosts:**
23
+ - No host step. admin-portal: the admin bump checks the rows in the real editor (preview admin, view only).
24
+
25
+ ### Fixed
26
+
27
+ - **The Website rows can be reached.** Before, they were only on the site-footer page's root, and the editor never opens that page. Now, while a page edits its header and footer in place, selecting the in-place Footer shows the same `WEBSITE_ROWS` on its Design tab (`withInPlaceFooterRows`, `resolveInPlaceFooterData`, `lib/document/page-root-fields`). `spliceChrome` puts the root's values on the footer node, and `splitChrome` writes them back to the chrome root and strips them from every node (`WEBSITE_KEYS`, `IN_PLACE_FOOTER_TYPES`, `lib/pinned-chrome-doc`). The canvas shows an edit before it is saved (`chromeRootWithFooter`, `inPlaceFooterProps`). "Duplicate to another page" drops the three values (`withoutWebsiteKeys`). The site-footer page's own root keeps its rows. (#834)
28
+
3
29
  ## 74.4.0 - 2026-11-22
4
30
 
5
31
  From main at `622db175`: #832.
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as x,Fragment as S}from"react/jsx-runtime";import{useCallback as j,useRef as A,useState as p}from"react";import{InspectorIconButton as B}from"efficient-easel/chrome";import{useEasel as O}from"efficient-easel/easel";import{PopupMenu as R,PopupMenuItem as _,PopupMenuLabel as f}from"efficient-shell/ui";import{CopyToPageIcon as L}from"efficient-easel/icons";import{backendOf as E}from"../lib/website-session.js";import{useEaselSession as z}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import{cloneNodeWithFreshIds as W}from"efficient-easel/screen/lib/document/section-doc";import{FOOTER_TYPE as H}from"efficient-easel/draw";import{settlingPages as Y}from"../lib/editor-document-adapter.js";function $(i,r,l){const n=W(i,void 0,r);return l?.(n)??n}function q({node:i,currentSlug:r,siteId:l,tokenRef:n,runAuthed:c,onNotify:u}){const[s,a]=p(!1),[m,P]=p(null),d=z(),N=O(e=>e.config.components),[T,g]=p(!1),[h,b]=p(null),k=A(null),[y,v]=p(null),M=j(async()=>{if(d.usesBridgedToken&&!n.current){g(!0);return}try{P(await E(d).pages.list(l?{siteId:l}:void 0))}catch{g(!0)}},[n,l,d]),D=()=>{if(s){a(!1);return}const e=k.current?.getBoundingClientRect();e&&v({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),P(null),g(!1),M(),a(!0)},w=(m??[]).filter(e=>e.slug!==r),F=async e=>{if(h)return;b(e.slug);const I=$(i,N,d.documentHooks?.storedNode),C=await c(()=>G(E(d).pages,e,I));b(null),a(!1),u?.(C?o("Duplicated to “{name}”",{name:e.label}):o("Couldn’t duplicate the section — please retry"),C?"success":"error")};return x(S,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(B,{buttonRef:k,label:o("Duplicate to another page"),hasPopup:"menu",expanded:s,onClick:D,children:t(L,{size:15})})}),s&&y&&t(R,{portal:!0,style:{top:y.top,right:y.right},onClose:()=>a(!1),children:x("div",{role:"menu","aria-label":o("Duplicate to page"),children:[t(f,{children:o("Duplicate to page")}),T?t(f,{children:o("Couldn’t load pages")}):m===null?t(f,{children:o("Loading…")}):w.length===0?t(f,{children:o("No other pages")}):w.map(e=>x(_,{role:"menuitem",disabled:h!==null,onClick:()=>{F(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),h===e.slug?t("span",{className:"shrink-0 text-xs",children:o("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:o("draft")})]},e.id))]})})]})}async function G(i,r,l){const n=Y(i),c=await n.load({id:r.id});if(!c)throw new Error(`Page "${r.slug}" no longer exists.`);const u=c.layout??{},s=Array.isArray(u.content)?[...u.content]:[],a=s.findIndex(m=>m?.type===H);s.splice(a===-1?s.length:a,0,l),await n.save(r.id,{layout:{root:{},zones:{},...u,content:s}},{version:c.version,clientId:""})}export{$ as copyForAnotherPage,G as copyNodeToPage,q as default};
1
+ "use client";import{jsx as t,jsxs as x,Fragment as S}from"react/jsx-runtime";import{useCallback as j,useRef as A,useState as p}from"react";import{InspectorIconButton as B}from"efficient-easel/chrome";import{useEasel as O}from"efficient-easel/easel";import{PopupMenu as R,PopupMenuItem as _,PopupMenuLabel as f}from"efficient-shell/ui";import{CopyToPageIcon as L}from"efficient-easel/icons";import{backendOf as E}from"../lib/website-session.js";import{useEaselSession as W}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import{cloneNodeWithFreshIds as z}from"efficient-easel/screen/lib/document/section-doc";import{FOOTER_TYPE as H}from"efficient-easel/draw";import{settlingPages as K}from"../lib/editor-document-adapter.js";import{withoutWebsiteKeys as Y}from"../lib/pinned-chrome-doc.js";function $(i,r,l){const n=z(i,void 0,r);return l?.(n)??n}function q({node:i,currentSlug:r,siteId:l,tokenRef:n,runAuthed:c,onNotify:u}){const[s,a]=p(!1),[m,b]=p(null),d=W(),N=O(e=>e.config.components),[T,g]=p(!1),[h,P]=p(null),w=A(null),[y,v]=p(null),M=j(async()=>{if(d.usesBridgedToken&&!n.current){g(!0);return}try{b(await E(d).pages.list(l?{siteId:l}:void 0))}catch{g(!0)}},[n,l,d]),D=()=>{if(s){a(!1);return}const e=w.current?.getBoundingClientRect();e&&v({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),b(null),g(!1),M(),a(!0)},k=(m??[]).filter(e=>e.slug!==r),F=async e=>{if(h)return;P(e.slug);const I=$(i,N,d.documentHooks?.storedNode),C=await c(()=>G(E(d).pages,e,I));P(null),a(!1),u?.(C?o("Duplicated to “{name}”",{name:e.label}):o("Couldn’t duplicate the section — please retry"),C?"success":"error")};return x(S,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(B,{buttonRef:w,label:o("Duplicate to another page"),hasPopup:"menu",expanded:s,onClick:D,children:t(L,{size:15})})}),s&&y&&t(R,{portal:!0,style:{top:y.top,right:y.right},onClose:()=>a(!1),children:x("div",{role:"menu","aria-label":o("Duplicate to page"),children:[t(f,{children:o("Duplicate to page")}),T?t(f,{children:o("Couldn’t load pages")}):m===null?t(f,{children:o("Loading…")}):k.length===0?t(f,{children:o("No other pages")}):k.map(e=>x(_,{role:"menuitem",disabled:h!==null,onClick:()=>{F(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),h===e.slug?t("span",{className:"shrink-0 text-xs",children:o("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:o("draft")})]},e.id))]})})]})}async function G(i,r,l){const n=K(i),c=await n.load({id:r.id});if(!c)throw new Error(`Page "${r.slug}" no longer exists.`);const u=c.layout??{},s=Array.isArray(u.content)?[...u.content]:[],a=s.findIndex(m=>m?.type===H);s.splice(a===-1?s.length:a,0,Y(l)),await n.save(r.id,{layout:{root:{},zones:{},...u,content:s}},{version:c.version,clientId:""})}export{$ as copyForAnotherPage,G as copyNodeToPage,q as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as u,Fragment as N}from"react/jsx-runtime";import{useCallback as q,useEffect as J,useId as L,useRef as Q,useState as g}from"react";import{useSettledAction as X}from"efficient-easel/easel";import{Avatar as Z,Banner as S,Button as k,ColoredBadge as z,Dialog as _,Drawer as ee,DropdownMenu as ne,FormField as H,iconButtonClasses as te,Inline as E,Input as re,ListRow as oe,Select as se,SortableList as ae,Stack as P}from"efficient-shell/ui";import{EditIcon as ie,EyeIcon as Y,MenuIcon as le,MoreIcon as ce,PageIcon as j,RevertIcon as A,StylesIcon as de}from"efficient-shell/icons/efficient";import{useScreenDocument as M}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as n,sayCount as G}from"../../format/lib/editor-words.js";import{useSiteLiveState as ue}from"../lib/site-live-state.js";import{changeLine as he,closeVersionHistory as ge,HeldEditsNotSaved as pe,changesSummary as me,restoreSiteVersion as fe,useVersionHistoryOpen as ye,versionTitle as we,versionWhen as be}from"../lib/site-versions.js";const ve={page:j,menu:le};function ke(t,o){return t.pages.find(r=>r.id===o)??t.pages[0]??null}function Ce(t,o){const r=window.open("","_blank");if(r)try{r.opener=null}catch{}return t.preview(o).then(({url:a})=>{r&&!r.closed?r.location.href=a:window.open(a,"_blank","noopener,noreferrer")},a=>{throw r?.close(),a})}function Ne({version:t,page:o,waiting:r,busy:a,error:p,onCancel:b,onConfirm:y,onPage:i}){const l=L();if(!t)return null;const m=t.kind==="draft_before_restore",c=t.number,d=me(t),v=m?n("Put your drafts back?"):o?n("Restore {page} from version {n}?",{page:o.name,n:c}):n("Restore version {n}?",{n:c}),f=m?n("Your drafts go back to how they were before the restore."):o?n("{page} goes back to version {n} as a draft. Nothing else on your website changes.",{page:o.name,n:c}):d?n("The whole website goes back to version {n} as a draft: {what}.",{n:c,what:d}):n("The whole website goes back to version {n} as a draft.",{n:c}),h=t.deletedPictures??0;return e(_,{open:!0,onClose:()=>{a||b()},size:"sm",title:v,footer:u(N,{children:[e(k,{variant:"secondary",onClick:b,disabled:a,children:n("Cancel")}),e(k,{onClick:y,loading:a,disabled:a,children:n("Restore as draft")})]}),children:u(P,{gap:4,children:[o&&t.pages.length>1?e(H,{label:n("Page"),htmlFor:l,children:e(se,{id:l,value:o.id,options:t.pages.map(C=>({value:C.id,label:C.name})),onChange:i,disabled:a})}):null,e("p",{children:f}),e("p",{children:n("Your live website does not change until you press Publish.")}),h>0?e(S,{tone:"warning",children:G("{n} picture in this version was deleted from the media library. It stays empty.","{n} pictures in this version were deleted from the media library. They stay empty.",h)}):null,r?e(S,{tone:"info",title:n("Your unpublished changes are kept"),children:n("They are saved in Version history as “Draft before restore”, so you can get them back.")}):null,p?e(S,{tone:"danger",children:p}):null]})})}function Se({version:t,onCancel:o,onSave:r}){const a=L(),[p,b]=g(null),[y,i]=g(""),[l,m]=g(!1),[c,d]=g(null);if(t!==p&&(b(t),i(t?.name??""),d(null)),!t)return null;const v=y.trim()===t.name,f=async()=>{if(!(l||v)){m(!0),d(null);try{await r(y.trim())}catch{d(n("The name was not saved. Try again."))}finally{m(!1)}}};return e(_,{open:!0,onClose:()=>{l||o()},size:"sm",title:n("Name this version"),footer:u(N,{children:[e(k,{variant:"secondary",onClick:o,disabled:l,children:n("Cancel")}),e(k,{onClick:()=>{f()},loading:l,disabled:l||v,children:n("Save")})]}),children:e(H,{label:n("Name"),htmlFor:a,hint:n("Named versions are always kept. Leave it empty to take the name away."),error:c??void 0,children:e(re,{id:a,value:y,invalid:!!c,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&f()}})})})}function Pe({version:t,expanded:o,onToggle:r,onPreview:a,onRestore:p,onRestorePage:b,onName:y}){const i=t.kind==="draft_before_restore",l=!t.live,m=t.changes.length,c=[...i?[]:[{key:"preview",label:n("Preview"),icon:e(Y,{}),onSelect:a}],...l?[{key:"restore",label:i?n("Put these drafts back"):n("Restore whole website"),icon:e(A,{}),onSelect:p}]:[],...l&&!i&&t.pages.length?[{key:"restore-page",label:n("Restore one page only"),icon:e(j,{}),onSelect:b}]:[],...i?[]:[{type:"divider",key:"divider"},{key:"name",label:n("Name this version"),icon:e(ie,{}),onSelect:y}]];return e(oe,{title:u("span",{className:"sf-version-title",children:[e("span",{children:we(t)}),t.live?e(z,{tone:"success",size:"xs",children:n("Live")}):null,t.name?e(z,{tone:"neutral",size:"xs",children:n("Version {n}",{n:t.number})}):null,i?e(z,{tone:"warning",size:"xs",children:n("Not published")}):null]}),expanded:o,onToggle:r,actions:e(ne,{align:"end","aria-label":n("More"),items:c,triggerClassName:te({variant:"ghost",size:"sm"}),trigger:e(ce,{})}),below:u(P,{gap:3,children:[u(E,{gap:2,align:"center",wrap:!0,className:"sf-version-meta",children:[e(Z,{name:t.createdBy,size:"xs"}),e("span",{children:t.createdBy}),e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:be(t.createdAt)}),m?u(N,{children:[e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:G("{n} change","{n} changes",m)})]}):null]}),o?u(P,{gap:3,children:[m?e(P,{gap:2,children:t.changes.map(d=>{const v=ve[d.kind]??de;return u(E,{gap:2,align:"center",children:[e(v,{size:16}),e("span",{children:he(d)})]},`${d.kind}:${d.id}`)})}):null,u(E,{gap:2,children:[i?null:e(k,{variant:"secondary",size:"sm",leftIcon:e(Y,{}),onClick:a,children:n("Preview")}),l?e(k,{variant:"secondary",size:"sm",leftIcon:e(A,{}),onClick:p,children:n("Restore")}):null]})]}):null]})})}function Ie({open:t,onClose:o,access:r,waiting:a}){const{flushSave:p,reloadFromServer:b,docId:y}=M(),[i,l]=g(null),[m,c]=g(!1),[d,v]=g(null),[f,h]=g(null),[C,F]=g(!1),[O,I]=g(null),[B,T]=g(null),[$,V]=g(!1),x=Q(0),R=q(()=>{const s=++x.current;c(!1),r.list().then(w=>{s===x.current&&l(w)},()=>{s===x.current&&c(!0)})},[r]);J(()=>{t&&R()},[t,R]);const K=s=>{V(!1),Ce(r,s.id).catch(()=>V(!0))},U=async()=>{if(!(!f||C)){F(!0),I(null);try{await fe({access:r,version:f.version,page:f.page,flushSave:p,reload:b}),h(null),o()}catch(s){I(s instanceof pe?n("Your last changes did not save, so nothing was restored. Try again."):n("The version was not restored. Nothing changed. Try again."))}finally{F(!1)}}},D=X({onPress:()=>{U()},busy:C});return u(N,{children:[e(ee,{open:t,onClose:o,side:"right",size:"md",title:n("Version history"),description:u(N,{children:[n("Every Publish keeps a copy of the whole website: pages, menus and site styles.")," ",n("Products, prices and forms always show as they are now.")]}),footer:e("span",{className:"sf-version-foot",children:n("The newest 30 are kept. Named versions are always kept.")}),children:u(P,{gap:3,children:[$?e(S,{tone:"danger",onDismiss:()=>V(!1),children:n("The preview did not open. Try again.")}):null,m?e(S,{tone:"danger",action:e(k,{variant:"secondary",size:"sm",onClick:R,children:n("Try again")}),children:n("Version history did not load.")}):i===null?e("p",{className:"sf-version-foot",children:n("Loading versions")}):i.length===0?e("p",{className:"sf-version-foot",children:n("No versions yet. Every Publish from now on keeps one.")}):e(ae,{"aria-label":n("Versions"),spacing:"comfortable",children:i.map(s=>e(Pe,{version:s,expanded:d===s.id,onToggle:()=>v(w=>w===s.id?null:s.id),onPreview:()=>K(s),onRestore:()=>{I(null),h({version:s,page:null})},onRestorePage:()=>{I(null),h({version:s,page:ke(s,y)})},onName:()=>T(s)},s.id))})]})}),e(Ne,{version:f?.version??null,page:f?.page??null,waiting:a,busy:D.busy===!0,error:O,onCancel:()=>h(null),onConfirm:D.onPress,onPage:s=>h(w=>w&&{...w,page:w.version.pages.find(W=>W.id===s)??w.page})}),e(Se,{version:B,onCancel:()=>T(null),onSave:async s=>{await r.name(B.id,s),T(null),R()}})]})}function Le(){const{adapter:t,hasUnsavedEdits:o}=M(),r=t.siteVersions,a=ye(),p=ue();return r?e(Ie,{open:a,onClose:ge,access:r,waiting:o||p?.state==="changed"}):null}export{Ne as RestoreVersionDialog,Le as VersionHistory,Ie as VersionHistoryDrawer};
1
+ "use client";import{jsx as e,jsxs as u,Fragment as N}from"react/jsx-runtime";import{useCallback as q,useEffect as J,useId as D,useRef as Q,useState as p}from"react";import{useSettledAction as X}from"efficient-easel/easel";import{Avatar as Z,Banner as S,Button as k,ColoredBadge as z,Dialog as E,DropdownMenu as ee,FormField as H,iconButtonClasses as ne,Inline as F,Input as te,ListRow as re,Select as oe,SortableList as se,Stack as P}from"efficient-shell/ui";import{EditIcon as ae,EyeIcon as Y,MenuIcon as ie,MoreIcon as le,PageIcon as j,RevertIcon as A,StylesIcon as ce}from"efficient-shell/icons/efficient";import{useScreenDocument as M}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as n,sayCount as G}from"../../format/lib/editor-words.js";import{useSiteLiveState as de}from"../lib/site-live-state.js";import{changeLine as ue,closeVersionHistory as he,HeldEditsNotSaved as pe,changesSummary as ge,restoreSiteVersion as fe,useVersionHistoryOpen as me,versionTitle as ye,versionWhen as we}from"../lib/site-versions.js";const be={page:j,menu:ie};function ve(t,o){return t.pages.find(r=>r.id===o)??t.pages[0]??null}function ke(t,o){const r=window.open("","_blank");if(r)try{r.opener=null}catch{}return t.preview(o).then(({url:a})=>{r&&!r.closed?r.location.href=a:window.open(a,"_blank","noopener,noreferrer")},a=>{throw r?.close(),a})}function Ce({version:t,page:o,waiting:r,busy:a,error:g,onCancel:b,onConfirm:y,onPage:i}){const l=D();if(!t)return null;const f=t.kind==="draft_before_restore",c=t.number,d=ge(t),v=f?n("Put your drafts back?"):o?n("Restore {page} from version {n}?",{page:o.name,n:c}):n("Restore version {n}?",{n:c}),m=f?n("Your drafts go back to how they were before the restore."):o?n("{page} goes back to version {n} as a draft. Nothing else on your website changes.",{page:o.name,n:c}):d?n("The whole website goes back to version {n} as a draft: {what}.",{n:c,what:d}):n("The whole website goes back to version {n} as a draft.",{n:c}),h=t.deletedPictures??0;return e(E,{open:!0,onClose:()=>{a||b()},size:"sm",title:v,footer:u(N,{children:[e(k,{variant:"secondary",onClick:b,disabled:a,children:n("Cancel")}),e(k,{onClick:y,loading:a,disabled:a,children:n("Restore as draft")})]}),children:u(P,{gap:4,children:[o&&t.pages.length>1?e(H,{label:n("Page"),htmlFor:l,children:e(oe,{id:l,value:o.id,options:t.pages.map(C=>({value:C.id,label:C.name})),onChange:i,disabled:a})}):null,e("p",{children:m}),e("p",{children:n("Your live website does not change until you press Publish.")}),h>0?e(S,{tone:"warning",children:G("{n} picture in this version was deleted from the media library. It stays empty.","{n} pictures in this version were deleted from the media library. They stay empty.",h)}):null,r?e(S,{tone:"info",title:n("Your unpublished changes are kept"),children:n("They are saved in Version history as “Draft before restore”, so you can get them back.")}):null,g?e(S,{tone:"danger",children:g}):null]})})}function Ne({version:t,onCancel:o,onSave:r}){const a=D(),[g,b]=p(null),[y,i]=p(""),[l,f]=p(!1),[c,d]=p(null);if(t!==g&&(b(t),i(t?.name??""),d(null)),!t)return null;const v=y.trim()===t.name,m=async()=>{if(!(l||v)){f(!0),d(null);try{await r(y.trim())}catch{d(n("The name was not saved. Try again."))}finally{f(!1)}}};return e(E,{open:!0,onClose:()=>{l||o()},size:"sm",title:n("Name this version"),footer:u(N,{children:[e(k,{variant:"secondary",onClick:o,disabled:l,children:n("Cancel")}),e(k,{onClick:()=>{m()},loading:l,disabled:l||v,children:n("Save")})]}),children:e(H,{label:n("Name"),htmlFor:a,hint:n("Named versions are always kept. Leave it empty to take the name away."),error:c??void 0,children:e(te,{id:a,value:y,invalid:!!c,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&m()}})})})}function Se({version:t,expanded:o,onToggle:r,onPreview:a,onRestore:g,onRestorePage:b,onName:y}){const i=t.kind==="draft_before_restore",l=!t.live,f=t.changes.length,c=[...i?[]:[{key:"preview",label:n("Preview"),icon:e(Y,{}),onSelect:a}],...l?[{key:"restore",label:i?n("Put these drafts back"):n("Restore whole website"),icon:e(A,{}),onSelect:g}]:[],...l&&!i&&t.pages.length?[{key:"restore-page",label:n("Restore one page only"),icon:e(j,{}),onSelect:b}]:[],...i?[]:[{type:"divider",key:"divider"},{key:"name",label:n("Name this version"),icon:e(ae,{}),onSelect:y}]];return e(re,{title:u("span",{className:"sf-version-title",children:[e("span",{children:ye(t)}),t.live?e(z,{tone:"success",size:"xs",children:n("Live")}):null,t.name?e(z,{tone:"neutral",size:"xs",children:n("Version {n}",{n:t.number})}):null,i?e(z,{tone:"warning",size:"xs",children:n("Not published")}):null]}),expanded:o,onToggle:r,actions:e(ee,{align:"end","aria-label":n("More"),items:c,triggerClassName:ne({variant:"ghost",size:"sm"}),trigger:e(le,{})}),below:u(P,{gap:3,children:[u(F,{gap:2,align:"center",wrap:!0,className:"sf-version-meta",children:[e(Z,{name:t.createdBy,size:"xs"}),e("span",{children:t.createdBy}),e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:we(t.createdAt)}),f?u(N,{children:[e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:G("{n} change","{n} changes",f)})]}):null]}),o?u(P,{gap:3,children:[f?e(P,{gap:2,children:t.changes.map(d=>{const v=be[d.kind]??ce;return u(F,{gap:2,align:"center",children:[e(v,{size:16}),e("span",{children:ue(d)})]},`${d.kind}:${d.id}`)})}):null,u(F,{gap:2,children:[i?null:e(k,{variant:"secondary",size:"sm",leftIcon:e(Y,{}),onClick:a,children:n("Preview")}),l?e(k,{variant:"secondary",size:"sm",leftIcon:e(A,{}),onClick:g,children:n("Restore")}):null]})]}):null]})})}function Pe({open:t,onClose:o,access:r,waiting:a}){const{flushSave:g,reloadFromServer:b,docId:y}=M(),[i,l]=p(null),[f,c]=p(!1),[d,v]=p(null),[m,h]=p(null),[C,B]=p(!1),[O,I]=p(null),[L,T]=p(null),[$,V]=p(!1),x=Q(0),R=q(()=>{const s=++x.current;c(!1),r.list().then(w=>{s===x.current&&l(w)},()=>{s===x.current&&c(!0)})},[r]);J(()=>{t&&R()},[t,R]);const K=s=>{V(!1),ke(r,s.id).catch(()=>V(!0))},U=async()=>{if(!(!m||C)){B(!0),I(null);try{await fe({access:r,version:m.version,page:m.page,flushSave:g,reload:b}),h(null),o()}catch(s){I(s instanceof pe?n("Your last changes did not save, so nothing was restored. Try again."):n("The version was not restored. Nothing changed. Try again."))}finally{B(!1)}}},_=X({onPress:()=>{U()},busy:C});return u(N,{children:[e(E,{open:t,onClose:o,size:"xl",title:n("Version history"),description:u(N,{children:[n("Every Publish keeps a copy of the whole website: pages, menus and site styles.")," ",n("Products, prices and forms always show as they are now.")]}),footer:e("span",{className:"sf-version-foot",children:n("The newest 30 are kept. Named versions are always kept.")}),children:u(P,{gap:3,children:[$?e(S,{tone:"danger",onDismiss:()=>V(!1),children:n("The preview did not open. Try again.")}):null,f?e(S,{tone:"danger",action:e(k,{variant:"secondary",size:"sm",onClick:R,children:n("Try again")}),children:n("Version history did not load.")}):i===null?e("p",{className:"sf-version-foot",children:n("Loading versions")}):i.length===0?e("p",{className:"sf-version-foot",children:n("No versions yet. Every Publish from now on keeps one.")}):e(se,{"aria-label":n("Versions"),spacing:"comfortable",children:i.map(s=>e(Se,{version:s,expanded:d===s.id,onToggle:()=>v(w=>w===s.id?null:s.id),onPreview:()=>K(s),onRestore:()=>{I(null),h({version:s,page:null})},onRestorePage:()=>{I(null),h({version:s,page:ve(s,y)})},onName:()=>T(s)},s.id))})]})}),e(Ce,{version:m?.version??null,page:m?.page??null,waiting:a,busy:_.busy===!0,error:O,onCancel:()=>h(null),onConfirm:_.onPress,onPage:s=>h(w=>w&&{...w,page:w.version.pages.find(W=>W.id===s)??w.page})}),e(Ne,{version:L,onCancel:()=>T(null),onSave:async s=>{await r.name(L.id,s),T(null),R()}})]})}function Le(){const{adapter:t,hasUnsavedEdits:o}=M(),r=t.siteVersions,a=me(),g=de();return r?e(Pe,{open:a,onClose:he,access:r,waiting:o||g?.state==="changed"}):null}export{Ce as RestoreVersionDialog,Le as VersionHistory,Pe as VersionHistoryDrawer};
@@ -4080,7 +4080,7 @@ input.sf-list-marking {
4080
4080
  /* Version history (components/VersionHistoryDrawer, 33.0.0): a row's name
4081
4081
  beside its badges, and the drawer's quiet lines (who, when, how much; the
4082
4082
  retention line; loading and empty). Layout and ink only; every part is the
4083
- shell's (Drawer, ListRow, ColoredBadge, Avatar). */
4083
+ shell's (Dialog, ListRow, ColoredBadge, Avatar). */
4084
4084
  .sf-version-title {
4085
4085
  display: inline-flex;
4086
4086
  flex-wrap: wrap;
@@ -31,6 +31,10 @@ export declare const PAGE_STYLE_FIELDS: readonly ["pageBackground", "topSpace",
31
31
  export declare const RECORD_TYPE_LABEL = "Record type";
32
32
  export declare function withRecordTypeRow(fields: Record<string, unknown>, rootProps?: Record<string, unknown> | null): Record<string, unknown>;
33
33
  export declare function withSiteFooterRows(fields: Record<string, unknown>, rootProps?: Record<string, unknown> | null): Record<string, unknown>;
34
+ export declare function withInPlaceFooterRows(fields: Record<string, unknown>): Record<string, unknown>;
35
+ export declare function resolveInPlaceFooterData<D extends {
36
+ props?: Record<string, unknown> | null;
37
+ }>(data: D): D | Promise<D>;
34
38
  export declare function resolveSiteFooterData<D extends {
35
39
  props?: Record<string, unknown> | null;
36
40
  }>(data: D): D | Promise<D>;
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{ListIcon as d,PaddingTopIcon as T,PaddingXIcon as R}from"efficient-easel/icons";import g from"../../components/WidthFollowField.js";import{say as c}from"../../../format/lib/editor-words.js";import{PRODUCT_RECORD_TYPE as w,TEMPLATE_RECORD_TYPE_PROP as a,declaredRecordType as P,recordTypes as u,recordTypesRevision as E}from"../../../format/lib/content/record-types.js";import{CUSTOM_CSS_ROW as h,pageBackgroundField as C,toggle as I}from"./controls.js";import{SITE_FOOTER_KIND as m}from"../../../format/lib/content/footer.js";import{SIDE_SPACE_ONCE_PROP as _}from"../../../format/lib/content/page-width.js";import{SITE_OFFICES_PROP as s}from"../../../format/lib/content/site-offices.js";import{SITE_CSS_KEY as F}from"../../../format/lib/content/site-css.js";import{needsGeocodeWork as y}from"./geocode-resolve.js";import{group as D}from"efficient-easel/screen/lib/document/box-fields";import{FOOTPRINT_OFFICES_FIELD as A,resolveOfficeCoords as k}from"./blocks/general/Footprint/fields.js";import{select as l}from"./box-fields.js";import{isEditorOnDynamicPage as x}from"../../../format/lib/document/editor-page-context.js";import{DEFAULT_TOP_SPACE as W}from"../../../render/lib/document/header-clearance.js";function b(){return{type:"custom",render:({value:e,onChange:t})=>i(g,{value:e==="full"?"full":e==="content"?"content":void 0,resolved:"content",label:"Page width",followsLabel:c("Follows the site"),hint:c("Whether this page sits on the site's content column, or runs edge to edge."),onChange:o=>t(o)})}}const v=[{label:"Auto",value:"auto"},{label:"Shared",value:"shared"},{label:"Its own",value:"own"}],re={pageBackground:C(),topSpace:l("Top space",i(T,{}),v,W),widthChoice:b()},ne=["pageBackground","topSpace","widthChoice"],L="Record type",p=new Map;let f=-1;function N(e){f!==E()&&(p.clear(),f=E());const t=u(),o=t.some(n=>n.key===e)?"":e;let r=p.get(o);return r||(r=l(L,i(d,{}),[...t.map(n=>({label:n.label,value:n.key})),...o?[{label:o,value:o}]:[]],w),p.set(o,r)),r}const S=new WeakMap;function ie(e,t){if(!x()||u().length<2||a in e)return e;const o=N(P(t)),r=S.get(e);if(r&&r.row===o)return r.fields;const n={[a]:o,...e};return S.set(e,{row:o,fields:n}),n}const B="On: the site's Side space is counted once at each edge of every page. Off: as before.",M=I("Count side space once",!1,i(R,{}),B),Y={_gWebsite:D("Website"),[_]:M,[s]:A,[F]:h},O=new WeakMap;function se(e,t){if(t?.kind!==m||_ in e)return e;let o=O.get(e);return o||(o={...e,...Y},O.set(e,o)),o}function pe(e){const t=e?.props;if(t?.kind!==m||!Array.isArray(t[s]))return e;const o=t[s];return y(o)?k(o).then(r=>({...e,props:{...t,[s]:[...r]}})):e}export{re as GENERAL_ROOT_FIELDS,ne as PAGE_STYLE_FIELDS,L as RECORD_TYPE_LABEL,v as TOP_SPACE_OPTIONS,b as pageWidthField,pe as resolveSiteFooterData,ie as withRecordTypeRow,se as withSiteFooterRows};
1
+ import{jsx as i}from"react/jsx-runtime";import{ListIcon as g,PaddingTopIcon as h,PaddingXIcon as I}from"efficient-easel/icons";import d from"../../components/WidthFollowField.js";import{say as u}from"../../../format/lib/editor-words.js";import{PRODUCT_RECORD_TYPE as C,TEMPLATE_RECORD_TYPE_PROP as f,declaredRecordType as F,recordTypes as m,recordTypesRevision as l}from"../../../format/lib/content/record-types.js";import{CUSTOM_CSS_ROW as A,pageBackgroundField as y,toggle as x}from"./controls.js";import{SITE_FOOTER_KIND as E}from"../../../format/lib/content/footer.js";import{SIDE_SPACE_ONCE_PROP as s}from"../../../format/lib/content/page-width.js";import{SITE_OFFICES_PROP as c}from"../../../format/lib/content/site-offices.js";import{SITE_CSS_KEY as D}from"../../../format/lib/content/site-css.js";import{needsGeocodeWork as b}from"./geocode-resolve.js";import{group as k}from"efficient-easel/screen/lib/document/box-fields";import{FOOTPRINT_OFFICES_FIELD as v,resolveOfficeCoords as W}from"./blocks/general/Footprint/fields.js";import{select as _}from"./box-fields.js";import{isEditorOnDynamicPage as L}from"../../../format/lib/document/editor-page-context.js";import{pinnedChromeInPlace as O}from"../../../format/lib/pinned-chrome-lock.js";import{BUCKET_KEY as N}from"efficient-easel/screen/lib/document/field-buckets";import{DEFAULT_TOP_SPACE as B}from"../../../render/lib/document/header-clearance.js";function M(){return{type:"custom",render:({value:e,onChange:t})=>i(d,{value:e==="full"?"full":e==="content"?"content":void 0,resolved:"content",label:"Page width",followsLabel:u("Follows the site"),hint:u("Whether this page sits on the site's content column, or runs edge to edge."),onChange:o=>t(o)})}}const Y=[{label:"Auto",value:"auto"},{label:"Shared",value:"shared"},{label:"Its own",value:"own"}],ue={pageBackground:y(),topSpace:_("Top space",i(h,{}),Y,B),widthChoice:M()},fe=["pageBackground","topSpace","widthChoice"],j="Record type",p=new Map;let T=-1;function K(e){T!==l()&&(p.clear(),T=l());const t=m(),o=t.some(n=>n.key===e)?"":e;let r=p.get(o);return r||(r=_(j,i(g,{}),[...t.map(n=>({label:n.label,value:n.key})),...o?[{label:o,value:o}]:[]],C),p.set(o,r)),r}const S=new WeakMap;function me(e,t){if(!L()||m().length<2||f in e)return e;const o=K(F(t)),r=S.get(e);if(r&&r.row===o)return r.fields;const n={[f]:o,...e};return S.set(e,{row:o,fields:n}),n}const U="On: the site's Side space is counted once at each edge of every page. Off: as before.",G=x("Count side space once",!1,i(I,{}),U),a={_gWebsite:k("Website"),[s]:G,[c]:v,[D]:A},w=new WeakMap;function le(e,t){if(t?.kind!==E||s in e)return e;let o=w.get(e);return o||(o={...e,...a},w.set(e,o)),o}function Ee(e){if(!O()||s in e)return e;let t=P.get(e);if(!t){t={};let o=!1;for(const[r,n]of Object.entries(e))r===H&&!o&&(Object.assign(t,a),o=!0),t[r]=n;o||Object.assign(t,a),P.set(e,t)}return t}const H=N.Animation,P=new WeakMap;function _e(e){return O()?R(e):e}function R(e){const t=e?.props;if(!t||!Array.isArray(t[c]))return e;const o=t[c];return b(o)?W(o).then(r=>({...e,props:{...t,[c]:[...r]}})):e}function Oe(e){return e?.props?.kind===E?R(e):e}export{ue as GENERAL_ROOT_FIELDS,fe as PAGE_STYLE_FIELDS,j as RECORD_TYPE_LABEL,Y as TOP_SPACE_OPTIONS,M as pageWidthField,_e as resolveInPlaceFooterData,Oe as resolveSiteFooterData,Ee as withInPlaceFooterRows,me as withRecordTypeRow,le as withSiteFooterRows};
@@ -24,7 +24,7 @@ export declare function EditorThemedBody({ propsTheme, propsFonts, propsCornerSt
24
24
  overlay?: ReactNode;
25
25
  children?: ReactNode;
26
26
  }): import("react").JSX.Element;
27
- export declare function SiteThemeCarrier({ propsTheme, propsFonts, propsCornerStyle, propsCornerRadiusPx, propsHeadingCompression, propsHeadingTypography, pageBackground, chromeInheritsSiteBackground, onClickCapture, siteFooterRootProps, body, }: {
27
+ export declare function SiteThemeCarrier({ propsTheme, propsFonts, propsCornerStyle, propsCornerRadiusPx, propsHeadingCompression, propsHeadingTypography, pageBackground, chromeInheritsSiteBackground, onClickCapture, siteFooterRootProps, inPlaceFooterProps: footerProps, body, }: {
28
28
  propsTheme?: ThemeValue;
29
29
  propsFonts?: FontsValue;
30
30
  propsCornerStyle?: string;
@@ -35,6 +35,7 @@ export declare function SiteThemeCarrier({ propsTheme, propsFonts, propsCornerSt
35
35
  chromeInheritsSiteBackground?: boolean;
36
36
  onClickCapture?: (e: MouseEvent<HTMLDivElement>) => void;
37
37
  siteFooterRootProps?: Record<string, unknown>;
38
+ inPlaceFooterProps?: Record<string, unknown> | null;
38
39
  body: (contentStyle: CSSProperties) => ReactNode;
39
40
  }): import("react").JSX.Element;
40
41
  export declare const suppressPreviewNav: (e: MouseEvent<HTMLDivElement>) => void;
@@ -1,2 +1,2 @@
1
- import{jsx as t,Fragment as X,jsxs as E}from"react/jsx-runtime";import{Suspense as Y}from"react";import{accentItalicCss as q,storedTextStyles as J,textStylesCss as Q}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as Z,PAGE_WIDTH_ATTR as ee,siteWidthTokens as te,siteGutterTokens as oe,siteGutterPhoneClass as re,siteGutterPhoneTokens as ne,heroBackgroundTokens as ie,SIDE_ONCE_ATTR as se,sideSpaceOnceAttr as ae}from"../../../format/lib/content/page-width.js";import{SITE_FOOTER_KIND as de}from"../../../format/lib/content/footer.js";import{siteBlockGapPhoneClass as ce,siteBlockGapPhoneTokens as pe,siteBlockGapTokens as le}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as he}from"../../../render/components/PreviewHeaderContext.js";import{usePreviewFooter as me}from"../../components/PreviewFooterContext.js";import{SiteRootPropsProvider as fe}from"../../../render/components/SiteRootProps.js";import{SITE_CSS_SCOPE_ATTR as ue,siteCssScopeAttr as Se}from"../../../format/lib/content/site-css.js";import{SitePhotographyProvider as ge}from"../../../render/components/SitePhotographyContext.js";import{ThemeLightInkProvider as Te}from"../../../render/components/ThemeLightInkContext.js";import{CORNER_STYLE_TO_PX as ye,normalizeCornerStyle as xe,normalizeCornerRadius as ke,themeColorStyle as Ce,themeLightInk as Pe,typeSizesStyle as Ee,headingTypographyStyle as _e,normalizeHeadingTypography as Ae,themeAccentStyle as Ge,themeButtonStyle as ve,themePresetAccentVars as Re,themeSurfaceStyle as Ie,siteCornerRadiusTokens as Be,shadowColorTokens as we,headingCompressionAttr as He,cardShadowAttr as We,cardGapAttr as be,hoverEffectAttr as Ne}from"../../../format/lib/theme.js";import{fontRoleStyle as De}from"../../../format/lib/fonts.js";import{wordStyleTokens as Fe}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as Oe,pageHasHeaderSection as _,pageTakesTopSpace as Le,topSpaceMarker as Ue,TOP_SPACE_ATTR as ze,HEADER_CLEARANCE_CLASS as je}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as Ve,HEADER_INK_ATTR as Me}from"../../../render/lib/document/header-ink.js";import{useEasel as A}from"efficient-easel/easel";import{useCardContentSwitchPass as $e}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as Ke}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as Xe}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as Ye}from"../../../render/lib/document/editing-bridges.js";import qe from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as G}from"../../../render/components/PageContentsContext.js";const Je={SectionTextParts:qe};import{PageWidthWrapper as It,PublishedPageFrame as Bt,pageWidthTokens as wt}from"../../../render/lib/document/page-frame.js";const Qe="color-mix(in oklab, var(--bg) 40%, #ffffff)",Ze="12vh";function et({style:r,children:a}){const{appState:d}=A(m=>m),o=d.data.content,n=d.data.root;if(Oe(o))return t("div",{className:"sf-themed-content",style:{...r,background:Qe,minHeight:"100vh",paddingBottom:Ze},children:t("div",{style:{background:"var(--bg)"},children:t(G,{content:o,children:a})})});const c=_(o)&&Le(n,o),p=_(o)?Ue(n,o):null,S=p?{[ze]:p}:null,l=Z(n?.widthChoice),i=l?{[ee]:l}:null,h=c?null:Ve(o),s=h?{[Me]:h}:null;return t("div",{className:`sf-themed-content${c?` ${je}`:""}`,style:r,...s,...S,...i,children:t("div",{style:{background:"var(--bg)",minHeight:"100%"},children:t(G,{content:o,children:a})})})}function At({propsTheme:r,propsFonts:a,propsCornerStyle:d,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:c,pageBackground:p,chromeInheritsSiteBackground:S,suppressPreviewNav:l,footer:i,overlay:h,children:s}){$e();const m=A(g=>g.appState.data.root?.props);return t(tt,{siteFooterRootProps:m?.kind===de?m:void 0,propsTheme:r,propsFonts:a,propsCornerStyle:d,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:c,pageBackground:p,chromeInheritsSiteBackground:S,onClickCapture:l,body:g=>E(X,{children:[t(et,{style:g,children:s}),i,h]})})}function tt({propsTheme:r,propsFonts:a,propsCornerStyle:d,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:c,pageBackground:p,chromeInheritsSiteBackground:S,onClickCapture:l,siteFooterRootProps:i,body:h}){const{chromeRootProps:s}=me(),{theme:m,fonts:g,sizes:v,cornerRadiusPx:R,cardShadow:T,shadowColor:I,cardGap:B,hoverEffect:y,headingCompression:w,siteWidth:H,siteGutter:W,siteGutterPhone:x,blockGap:b,blockGapPhone:k,siteLengthUnits:N,headingTypography:D,heroBackgroundFollowsWidth:F,photographyGrayscale:O,textStyles:L,wordStyles:U,themeFromDocument:e}=he(),f=e?r:m,z=e?a:g,j=e?void 0:v,V=e?o===void 0?ye[xe(d)]:ke(o):R,u=e?{}:N,M=e?n:w,C=e?c:D,P=[Q(J(e?void 0:L)),q(Ae(C).italicStrong)].filter(Boolean).join(`
2
- `),$=Xe(),K={...Ce(f),...Ee(j),..._e(C),...$.style,...S?{}:Ke(p)};return E("div",{className:`sf-theme-surfaces sf-theme-accent ${[re(e?void 0:x),ce(e?void 0:k)].filter(Boolean).join(" ")}`.trim(),style:{...De(z),...Fe(e?null:U),...Ge(f),...ve(f),...Re(f),...Ie(f),...Be(V,u.cornerRadiusUnit),...we(e?void 0:T,e?void 0:I,e?void 0:y),...te(e?void 0:H,u.siteWidthUnit),...oe(e?void 0:W,u.siteGutterUnit),...ne(e?void 0:x,u.siteGutterPhoneUnit),...le(e?void 0:b,u.blockGapUnit),...pe(e?void 0:k,u.blockGapPhoneUnit),...ie(e?void 0:F)},"data-sf-headings":He(M),[se]:ae(i??s),[ue]:Se(i??s),"data-sf-card-shadow":e?void 0:We(T),"data-sf-card-gap":e?void 0:be(B),"data-sf-card-hover":e?void 0:Ne(y),onClickCapture:l,children:[P?t("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:P}}):null,t(ge,{grayscale:e?void 0:O,children:t(Ye,{value:Je,children:t(Te,{ink:Pe(f),children:t(Y,{fallback:null,children:t(fe,{rootProps:i??s,children:h(K)})})})})})]})}const Gt=r=>{r.target?.closest?.("a")&&r.preventDefault()};export{Je as EDITING_BRIDGES,et as EditorPageBody,At as EditorThemedBody,It as PageWidthWrapper,Bt as PublishedPageFrame,Qe as SECTION_PREVIEW_CANVAS,Ze as SECTION_PREVIEW_CANVAS_TAIL,tt as SiteThemeCarrier,wt as pageWidthTokens,Gt as suppressPreviewNav};
1
+ import{jsx as t,Fragment as q,jsxs as A}from"react/jsx-runtime";import{Suspense as J,useMemo as Q}from"react";import{accentItalicCss as Z,storedTextStyles as ee,textStylesCss as te}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as oe,PAGE_WIDTH_ATTR as re,siteWidthTokens as ne,siteGutterTokens as ie,siteGutterPhoneClass as se,siteGutterPhoneTokens as ae,heroBackgroundTokens as de,SIDE_ONCE_ATTR as ce,sideSpaceOnceAttr as pe}from"../../../format/lib/content/page-width.js";import{SITE_FOOTER_KIND as le}from"../../../format/lib/content/footer.js";import{siteBlockGapPhoneClass as he,siteBlockGapPhoneTokens as me,siteBlockGapTokens as fe}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as ue}from"../../../render/components/PreviewHeaderContext.js";import{usePreviewFooter as Se}from"../../components/PreviewFooterContext.js";import{SiteRootPropsProvider as ge}from"../../../render/components/SiteRootProps.js";import{SITE_CSS_SCOPE_ATTR as Te,siteCssScopeAttr as ye}from"../../../format/lib/content/site-css.js";import{SitePhotographyProvider as Pe}from"../../../render/components/SitePhotographyContext.js";import{ThemeLightInkProvider as xe}from"../../../render/components/ThemeLightInkContext.js";import{CORNER_STYLE_TO_PX as ke,normalizeCornerStyle as Ce,normalizeCornerRadius as Ee,themeColorStyle as _e,themeLightInk as Ae,typeSizesStyle as Re,headingTypographyStyle as Ge,normalizeHeadingTypography as ve,themeAccentStyle as Ie,themeButtonStyle as Be,themePresetAccentVars as we,themeSurfaceStyle as We,siteCornerRadiusTokens as He,shadowColorTokens as Fe,headingCompressionAttr as be,cardShadowAttr as Ne,cardGapAttr as De,hoverEffectAttr as Oe}from"../../../format/lib/theme.js";import{fontRoleStyle as Le}from"../../../format/lib/fonts.js";import{wordStyleTokens as Ue}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as ze,pageHasHeaderSection as R,pageTakesTopSpace as je,topSpaceMarker as Ve,TOP_SPACE_ATTR as Me,HEADER_CLEARANCE_CLASS as $e}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as Ke,HEADER_INK_ATTR as Xe}from"../../../render/lib/document/header-ink.js";import{useEasel as y}from"efficient-easel/easel";import{chromeRootWithFooter as Ye,inPlaceFooterProps as qe}from"../pinned-chrome-doc.js";import{useCardContentSwitchPass as Je}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as Qe}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as Ze}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as et}from"../../../render/lib/document/editing-bridges.js";import tt from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as G}from"../../../render/components/PageContentsContext.js";const ot={SectionTextParts:tt};import{PageWidthWrapper as bt,PublishedPageFrame as Nt,pageWidthTokens as Dt}from"../../../render/lib/document/page-frame.js";const rt="color-mix(in oklab, var(--bg) 40%, #ffffff)",nt="12vh";function it({style:r,children:c}){const{appState:p}=y(a=>a),o=p.data.content,n=p.data.root;if(ze(o))return t("div",{className:"sf-themed-content",style:{...r,background:rt,minHeight:"100vh",paddingBottom:nt},children:t("div",{style:{background:"var(--bg)"},children:t(G,{content:o,children:c})})});const l=R(o)&&je(n,o),h=R(o)?Ve(n,o):null,S=h?{[Me]:h}:null,m=oe(n?.widthChoice),i=m?{[re]:m}:null,s=l?null:Ke(o),g=s?{[Xe]:s}:null;return t("div",{className:`sf-themed-content${l?` ${$e}`:""}`,style:r,...g,...S,...i,children:t("div",{style:{background:"var(--bg)",minHeight:"100%"},children:t(G,{content:o,children:c})})})}function wt({propsTheme:r,propsFonts:c,propsCornerStyle:p,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:l,pageBackground:h,chromeInheritsSiteBackground:S,suppressPreviewNav:m,footer:i,overlay:s,children:g}){Je();const a=y(d=>d.appState.data.root?.props),T=y(d=>qe(d.appState.data.content));return t(st,{siteFooterRootProps:a?.kind===le?a:void 0,inPlaceFooterProps:T,propsTheme:r,propsFonts:c,propsCornerStyle:p,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:l,pageBackground:h,chromeInheritsSiteBackground:S,onClickCapture:m,body:d=>A(q,{children:[t(it,{style:d,children:g}),i,s]})})}function st({propsTheme:r,propsFonts:c,propsCornerStyle:p,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:l,pageBackground:h,chromeInheritsSiteBackground:S,onClickCapture:m,siteFooterRootProps:i,inPlaceFooterProps:s,body:g}){const{chromeRootProps:a}=Se(),T=Q(()=>Ye(a,s),[a,s]),{theme:d,fonts:v,sizes:I,cornerRadiusPx:B,cardShadow:P,shadowColor:w,cardGap:W,hoverEffect:x,headingCompression:H,siteWidth:F,siteGutter:b,siteGutterPhone:k,blockGap:N,blockGapPhone:C,siteLengthUnits:D,headingTypography:O,heroBackgroundFollowsWidth:L,photographyGrayscale:U,textStyles:z,wordStyles:j,themeFromDocument:e}=ue(),f=e?r:d,V=e?c:v,M=e?void 0:I,$=e?o===void 0?ke[Ce(p)]:Ee(o):B,u=e?{}:D,K=e?n:H,E=e?l:O,_=[te(ee(e?void 0:z)),Z(ve(E).italicStrong)].filter(Boolean).join(`
2
+ `),X=Ze(),Y={..._e(f),...Re(M),...Ge(E),...X.style,...S?{}:Qe(h)};return A("div",{className:`sf-theme-surfaces sf-theme-accent ${[se(e?void 0:k),he(e?void 0:C)].filter(Boolean).join(" ")}`.trim(),style:{...Le(V),...Ue(e?null:j),...Ie(f),...Be(f),...we(f),...We(f),...He($,u.cornerRadiusUnit),...Fe(e?void 0:P,e?void 0:w,e?void 0:x),...ne(e?void 0:F,u.siteWidthUnit),...ie(e?void 0:b,u.siteGutterUnit),...ae(e?void 0:k,u.siteGutterPhoneUnit),...fe(e?void 0:N,u.blockGapUnit),...me(e?void 0:C,u.blockGapPhoneUnit),...de(e?void 0:L)},"data-sf-headings":be(K),[ce]:pe(i??T),[Te]:ye(i??T),"data-sf-card-shadow":e?void 0:Ne(P),"data-sf-card-gap":e?void 0:De(W),"data-sf-card-hover":e?void 0:Oe(x),onClickCapture:m,children:[_?t("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:_}}):null,t(Pe,{grayscale:e?void 0:U,children:t(et,{value:ot,children:t(xe,{ink:Ae(f),children:t(J,{fallback:null,children:t(ge,{rootProps:i??T,children:g(Y)})})})})})]})}const Wt=r=>{r.target?.closest?.("a")&&r.preventDefault()};export{ot as EDITING_BRIDGES,it as EditorPageBody,wt as EditorThemedBody,bt as PageWidthWrapper,Nt as PublishedPageFrame,rt as SECTION_PREVIEW_CANVAS,nt as SECTION_PREVIEW_CANVAS_TAIL,st as SiteThemeCarrier,Dt as pageWidthTokens,Wt as suppressPreviewNav};
@@ -1 +1 @@
1
- import{resolveSiteFooterData as i,withRecordTypeRow as w,withSiteFooterRows as m}from"./page-root-fields.js";import{dropEmptyHeadings as v}from"./panel-drop-empty-headings.js";import{PASS_INSPECTOR as h}from"./passes/inspector.js";import{finishRenderRegistry as F}from"../../../render/lib/document/render-registry.js";function P(n){const p=F(n,h),c=n.root,f=c.resolveFields,R=n.root?.showWhenFacts??{},s=(e,o,t)=>{const r=o?.props;return v(h.rowsShownForNode(m(w(e,r),r),{props:r},t,R),"page")};c.resolveFields=f?(e,o)=>{const t=f(e,o);return t instanceof Promise?t.then(r=>s(r??o.fields,e,o)):s(t??o.fields,e,o)}:(e,o)=>s(o.fields,e,o);const l=n.root,d=l.resolveData;return l.resolveData=d?(e,o)=>{const t=d(e,o);return t instanceof Promise?t.then(r=>i(r)):i(t)}:e=>i(e),p}export{P as finishRegistry};
1
+ import{resolveInPlaceFooterData as F,resolveSiteFooterData as h,withInPlaceFooterRows as P,withRecordTypeRow as R,withSiteFooterRows as u}from"./page-root-fields.js";import{dropEmptyHeadings as D}from"./panel-drop-empty-headings.js";import{PASS_INSPECTOR as w}from"./passes/inspector.js";import{finishRenderRegistry as a}from"../../../render/lib/document/render-registry.js";import{IN_PLACE_FOOTER_TYPES as S}from"../pinned-chrome-doc.js";function _(n){const d=a(n,w);for(const o of S){const e=n.components[o];e&&m(e)}const f=n.root,i=f.resolveFields,s=n.root?.showWhenFacts??{},t=(o,e,r)=>{const l=e?.props;return D(w.rowsShownForNode(u(R(o,l),l),{props:l},r,s),"page")};f.resolveFields=i?(o,e)=>{const r=i(o,e);return r instanceof Promise?r.then(l=>t(l??e.fields,o,e)):t(r??e.fields,o,e)}:(o,e)=>t(e.fields,o,e);const c=n.root,v=c.resolveData;return c.resolveData=v?(o,e)=>{const r=v(o,e);return r instanceof Promise?r.then(l=>h(l)):h(r)}:o=>h(o),d}function m(n){const d=n.resolveFields;n.resolveFields=(i,s)=>{const t=d?d(i,s):s.fields;return t instanceof Promise?t.then(c=>P(c??s.fields)):P(t??s.fields)};const f=n.resolveData;n.resolveData=(i,s)=>{const t=f?f(i,s):i;return t instanceof Promise?t.then(c=>F(c)):F(t)}}export{_ as finishRegistry};
@@ -1,5 +1,12 @@
1
1
  export type ChromeLayout = Record<string, unknown>;
2
2
  export declare const PINNED_CHROME_TYPES: readonly string[];
3
+ export declare const WEBSITE_KEYS: readonly string[];
4
+ export declare const IN_PLACE_FOOTER_TYPES: readonly string[];
5
+ export declare function withoutWebsiteKeys<T extends {
6
+ props?: Record<string, unknown>;
7
+ }>(n: T): T;
8
+ export declare function inPlaceFooterProps(content: unknown): Record<string, unknown> | null;
9
+ export declare function chromeRootWithFooter(rootProps: Record<string, unknown> | null, footerProps: Record<string, unknown> | null | undefined): Record<string, unknown> | null;
3
10
  export declare function idsNotThePagesOwn(working: ChromeLayout | null | undefined, isShared: (id: string) => boolean): Set<string>;
4
11
  export declare function chromeRootProps(chrome: ChromeLayout | null | undefined): Record<string, unknown> | null;
5
12
  export declare function spliceChrome(page: ChromeLayout, chrome: ChromeLayout | null): ChromeLayout;
@@ -1 +1 @@
1
- import{isSectionGroupType as C,SITE_FOOTER_TYPE as z,SITE_HEADER_TYPE as h,siteFooterDocChrome as k}from"../../format/lib/document/section-groups.js";import{zoneOwner as F}from"../../render/lib/document/selection-parent.js";import{isNode as R}from"efficient-easel/data";const m="Footer",P=[h,m,z],y=e=>{const t=e?.content;return Array.isArray(t)?t:[]},u=e=>{const t=e?.zones;return t&&typeof t=="object"&&!Array.isArray(t)?t:null},a=e=>{const t=e?.props?.id;return typeof t=="string"?t:void 0},_=e=>F(e)?.ownerId??"";function I(e){const t=k(y(e)),n=t.some(r=>r?.type===z);return t.filter(r=>r?.type===h||r?.type===z||r?.type===m&&!n)}function g(e,t){const n=new Set,r=o=>{if(Array.isArray(o)){for(const c of o)r(c);return}if(!(!o||typeof o!="object")){if(R(o)){const c=a(o);c&&n.add(c)}for(const c of Object.values(o))r(c)}};if(r(e),t){let o=!0;const c=new Set;for(;o;){o=!1;for(const[d,p]of Object.entries(t))c.has(d)||!n.has(_(d))||(c.add(d),r(p),o=!0)}}return n}function M(e,t){const n=y(e).filter(r=>{const o=a(r);return typeof r?.type=="string"&&P.includes(r.type)||o!==void 0&&t(o)});return n.length?g(n,u(e)):new Set}function T(e,t){const n={},r={};for(const[o,c]of Object.entries(e??{}))(t.has(_(o))?n:r)[o]=c;return{owned:n,rest:r}}function v(e){const t=e?.root,n=t&&typeof t=="object"?t.props:void 0;return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function G(e,t){if(!t)return e;const n=I(t);if(!n.length)return e;const r=n.filter(p=>p.type===h),o=n.filter(p=>p.type!==h),c={...e,content:[...r,...y(e),...o]},{owned:d}=T(u(t),g(n,u(t)));return Object.keys(d).length&&(c.zones={...u(e)??{},...d}),c}function W(e,t){if(!t)return{page:e,chrome:null};const n=I(t),r=new Set(n.map(a).filter(s=>!!s)),o=[],c=[];for(const s of y(e)){const i=a(s);i&&r.has(i)||C(s?.type)?c.push(s):o.push(s)}const d=new Map(c.map(s=>[a(s),s])),p=new Set;let f=k(y(t)).flatMap(s=>{const i=a(s);if(!i||!r.has(i))return[s];const l=d.get(i);return l?(p.add(l),[l]):[]});for(const s of c)p.has(s)||f.some(i=>i?.type===s.type)||(f=s.type===h?[s,...f]:[...f,s]);f=k(f);const N=f.length===y(t).length&&f.every((s,i)=>s===y(t)[i]),j=u(e),x=g(f,j),{owned:w,rest:A}=T(j,x),S=T(u(t),g(n,u(t))).owned,b={...t,content:N?t.content:[...f]},O=u(t);if(O||Object.keys(w).length){const s={};for(const[i,l]of Object.entries(O??{}))i in S?i in w&&(s[i]=w[i]):s[i]=l;for(const[i,l]of Object.entries(w))i in s||(s[i]=l);b.zones=s,O&&D(b.zones,O)&&(b.zones=O)}const E={...e,content:o};return j&&(Object.keys(A).length||!Object.keys(S).length?E.zones=A:delete E.zones),{page:E,chrome:b}}function D(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((o,c)=>o===r[c]&&e[o]===t[o])}function B(e,t){return n=>e(n)||n!==void 0&&P.includes(n)&&t()}export{P as PINNED_CHROME_TYPES,v as chromeRootProps,M as idsNotThePagesOwn,B as lockedWhileHeld,G as spliceChrome,W as splitChrome};
1
+ import{isSectionGroupType as Z,SITE_FOOTER_TYPE as h,SITE_HEADER_TYPE as S,siteFooterDocChrome as N}from"../../format/lib/document/section-groups.js";import{zoneOwner as v}from"../../render/lib/document/selection-parent.js";import{isNode as H}from"efficient-easel/data";import{SIDE_SPACE_ONCE_PROP as K}from"../../format/lib/content/page-width.js";import{SITE_CSS_KEY as M}from"../../format/lib/content/site-css.js";import{SITE_OFFICES_PROP as B}from"../../format/lib/content/site-offices.js";const x="Footer",R=[S,x,h],b=[K,B,M],G=[h,x],A=n=>G.includes(n?.type??"");function L(n){const t=n?.props;if(!t||!b.some(s=>s in t))return n;const e={};for(const[s,o]of Object.entries(t))b.includes(s)||(e[s]=o);return{...n,props:e}}function V(n,t){const e=b.filter(o=>t&&o in t);if(!e.length)return n;const s={...n.props??{}};for(const o of e)s[o]=t[o];return{...n,props:s}}function st(n){return Array.isArray(n)?n.find(e=>A(e))?.props??null:null}function q(n,t){if(!t)return n;const e=b.filter(o=>o in t&&(!n||JSON.stringify(n[o])!==JSON.stringify(t[o])));if(!e.length)return n;const s={...n??{}};for(const o of e)s[o]=t[o];return s}const d=n=>{const t=n?.content;return Array.isArray(t)?t:[]},y=n=>{const t=n?.zones;return t&&typeof t=="object"&&!Array.isArray(t)?t:null},O=n=>{const t=n?.props?.id;return typeof t=="string"?t:void 0},m=n=>v(n)?.ownerId??"";function Y(n){const t=N(d(n)),e=t.some(s=>s?.type===h);return t.filter(s=>s?.type===S||s?.type===h||s?.type===x&&!e)}function _(n,t){const e=new Set,s=o=>{if(Array.isArray(o)){for(const c of o)s(c);return}if(!(!o||typeof o!="object")){if(H(o)){const c=O(o);c&&e.add(c)}for(const c of Object.values(o))s(c)}};if(s(n),t){let o=!0;const c=new Set;for(;o;){o=!1;for(const[f,a]of Object.entries(t))c.has(f)||!e.has(m(f))||(c.add(f),s(a),o=!0)}}return e}function rt(n,t){const e=d(n).filter(s=>{const o=O(s);return typeof s?.type=="string"&&R.includes(s.type)||o!==void 0&&t(o)});return e.length?_(e,y(n)):new Set}function k(n,t){const e={},s={};for(const[o,c]of Object.entries(n??{}))(t.has(m(o))?e:s)[o]=c;return{owned:e,rest:s}}function W(n){const t=n?.root,e=t&&typeof t=="object"?t.props:void 0;return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function it(n,t){if(!t)return n;const e=Y(t);if(!e.length)return n;const s=e.filter(p=>p.type===S),o=W(t),c=e.filter(p=>p.type!==S).map(p=>A(p)?V(p,o):p),f={...n,content:[...s,...d(n),...c]},{owned:a}=k(y(t),_(e,y(t)));return Object.keys(a).length&&(f.zones={...y(n)??{},...a}),f}function ct(n,t){if(!t)return{page:n,chrome:null};const e=Y(t),s=new Set(e.map(O).filter(r=>!!r)),o=[],c=[];let f=null;for(const r of d(n)){const i=O(r),l=i&&s.has(i)||Z(r?.type);if(l&&A(r)&&!f){f={};for(const I of b)r.props&&I in r.props&&(f[I]=r.props[I])}const P=L(r);l?c.push(P):o.push(P)}const a=new Map(c.map(r=>[O(r),r])),p=new Set;let u=N(d(t)).flatMap(r=>{const i=O(r);if(!i||!s.has(i))return[r];const l=a.get(i);return l?(p.add(l),[l]):[]});for(const r of c)p.has(r)||u.some(i=>i?.type===r.type)||(u=r.type===S?[r,...u]:[...u,r]);u=N(u);const D=u.length===d(t).length&&u.every((r,i)=>r===d(t)[i]||JSON.stringify(r)===JSON.stringify(d(t)[i])),j=y(n),J=_(u,j),{owned:g,rest:z}=k(j,J),F=k(y(t),_(e,y(t))).owned,E={...t,content:D?t.content:[...u]},C=Q(t,f);C!==t.root&&(E.root=C);const w=y(t);if(w||Object.keys(g).length){const r={};for(const[i,l]of Object.entries(w??{}))i in F?i in g&&(r[i]=g[i]):r[i]=l;for(const[i,l]of Object.entries(g))i in r||(r[i]=l);E.zones=r,w&&U(E.zones,w)&&(E.zones=w)}const T={...n,content:o};return j&&(Object.keys(z).length||!Object.keys(F).length?T.zones=z:delete T.zones),{page:T,chrome:E}}function Q(n,t){const e=W(n),s=q(e,t);return s===e?n.root:{...n.root&&typeof n.root=="object"?n.root:{},props:s}}function U(n,t){const e=Object.keys(n),s=Object.keys(t);return e.length===s.length&&e.every((o,c)=>o===s[c]&&n[o]===t[o])}function ft(n,t){return e=>n(e)||e!==void 0&&R.includes(e)&&t()}export{G as IN_PLACE_FOOTER_TYPES,R as PINNED_CHROME_TYPES,b as WEBSITE_KEYS,W as chromeRootProps,q as chromeRootWithFooter,rt as idsNotThePagesOwn,st as inPlaceFooterProps,ft as lockedWhileHeld,it as spliceChrome,ct as splitChrome,L as withoutWebsiteKeys};