efficient-web-builder 74.4.0 → 74.5.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 +13 -0
- package/dist/editor/components/DuplicateToPageMenu.js +1 -1
- package/dist/editor/lib/document/page-root-fields.d.ts +4 -0
- package/dist/editor/lib/document/page-root-fields.js +1 -1
- package/dist/editor/lib/document/page-root.d.ts +2 -1
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/document/registry.js +1 -1
- package/dist/editor/lib/pinned-chrome-doc.d.ts +7 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 74.5.0 - 2026-11-22
|
|
4
|
+
|
|
5
|
+
From main at `2a217a08`: #834.
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
**For hosts:**
|
|
10
|
+
- No host step. admin-portal: the admin bump checks the rows in the real editor (preview admin, view only).
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **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)
|
|
15
|
+
|
|
3
16
|
## 74.4.0 - 2026-11-22
|
|
4
17
|
|
|
5
18
|
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
|
|
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};
|
|
@@ -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
|
|
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
|
|
2
|
-
`)
|
|
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
|
|
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
|
|
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};
|