efficient-web-builder 71.1.0 → 72.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 72.0.0 - 2026-11-18
4
+
5
+ From main at `58477c36`: #794, #795.
6
+
7
+ A major: the `efficient-easel` peer moves to `^36.0.0`; `efficient-shell` stays `^13.17.0`. `SectionEditor`'s `onOpenPageStyles` prop is removed. No stored key or value moves. Carries #794 (left rail host) and #795 (one home for the phone edge).
8
+
9
+ ### BREAKING
10
+
11
+ - **`efficient-easel` peer `^35.1.0` -> `^36.0.0`**: the editor's left rail is the body's first column (Add, Pages, Layers, Styles, Media) in place of the left panel's tab strip and the top bar's rail.
12
+
13
+ **For hosts:**
14
+ - Install `efficient-easel` 36.0.0 or later with this release. The builder's editor entries already load `efficient-easel/rail.css` with `screen.css`.
15
+ - `SectionEditor` (`efficient-web-builder/editor/components/SectionEditor`) no longer takes `onOpenPageStyles`; no consumer passes it.
16
+ - A host test or style that reads the left panel's tab strip, the top bar's Media library button or the Layers head "+" drops it (easel 36.0.0 CHANGELOG).
17
+
18
+ ### Changed
19
+
20
+ - **The desktop view has a floor: the phone edge** (800, `PHONE_EDGE`). The website passes it as the screen's `devices.fluidMin`, so a pane under 800 (a 1440 screen with the rail column gives 772) draws the desktop at 800, scaled to fit, and not the stacked phone layout. At or over 800 nothing changes.
21
+ - **The empty right panel has no Styles button.** The rail's Styles is the one way in to the page's look; the tree's "This page" still opens it.
22
+
23
+ ### Guards
24
+
25
+ - `test-desktop-floor` (new) holds the website's floor input (`fluidMin === PHONE_EDGE`); the floor rule is easel's own tests. New source rule `src/lib/source-rules/no-host-rail.ts` (`test-no-host-rail-css`): no host `.es-rail` rule and no host "Media library" control; blocks and admin run it in their easel ^36 PRs. #795: `test-one-phone-edge` and `source-rules/one-phone-edge.ts`. `test-editor-flat-chrome` and `test-panel-resize-seam` model the rail column in front of the left panel (8 + 44 + 8; the chrome is 668px at the default widths). `test-editor-rail-in-topbar` is deleted (the rail left the top bar). `test-editor-add-panel` drops the top bar's arrow; `test-page-settings-move` holds that the empty panel has no Styles door.
26
+
3
27
  ## 71.1.0 - 2026-11-18
4
28
 
5
29
  From main at `59a4749a`: #789. A minor: no `!`, no export is added, removed or changes its type, the peers stay `efficient-easel` `^35.1.0` and `efficient-shell` `^13.17.0`. No stored key or value moves.
@@ -63,11 +63,10 @@ export type InspectorPanel = {
63
63
  render: (mode: InspectorMode, ctx: PanelContext) => ReactNode;
64
64
  };
65
65
  export declare function resolvePanel(kind: InspectorMode["kind"], capabilities: EditorCapabilities): InspectorPanel | null;
66
- export default function SectionEditor({ mode, onOpenWebsiteSettings, onOpenSiteStyles, onOpenPageStyles, onSelectNode, hideNodeActions, onNotify, onHidePanel, }: {
66
+ export default function SectionEditor({ mode, onOpenWebsiteSettings, onOpenSiteStyles, onSelectNode, hideNodeActions, onNotify, onHidePanel, }: {
67
67
  mode: InspectorMode;
68
68
  onOpenWebsiteSettings: () => void;
69
69
  onOpenSiteStyles?: () => void;
70
- onOpenPageStyles?: () => void;
71
70
  hideNodeActions?: boolean;
72
71
  onNotify?: (msg: string, tone?: "success" | "error") => void;
73
72
  onHidePanel?: () => void;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as m,Fragment as K}from"react/jsx-runtime";import{useEasel as Se,useRootFields as be}from"efficient-easel/easel";import{Button as we,EmptyState as ge}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as W}from"../lib/document/page-root-fields.js";import{rootPanelHead as Ee}from"../../format/lib/document/root-panel.js";import{headWords as z,InspectorHead as ke,InspectorIconButton as j}from"efficient-easel/chrome";import{DuplicateIcon as Pe,TrashIcon as ve}from"efficient-easel/icons";import{panelFieldsOf as Ie}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as G}from"../../render/components/PreviewTickerContext.js";import Le from"./SectionIcon.js";import{PanelHideButton as Y}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as ye}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import Oe,{SITE_STYLES_BASICS_TAB as Te}from"./WebsiteSettingsPanel.js";import Ne from"./ChatSettingsPanel.js";import _e from"./SocialLinksPanel.js";import He from"./TickerSettingsPanel.js";import Re,{PartSourceNote as Ae}from"./PartSettingsPanel.js";import{regionsForSection as De}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Ce}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as Be}from"../../format/lib/sections/text-regions.js";import Fe from"./DuplicateToPageMenu.js";import{usePageRows as xe}from"../lib/page-rows.js";import{useScreenDocument as Me}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as Ke}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as We}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as ze,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as je}from"efficient-easel/draw/client";import{entryPartsOf as Ge,SectionTextEntries as Ye}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ue}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as Xe,ROOT_ZONE as U}from"efficient-easel/draw";import{websiteDuplicateBlocked as Ze}from"../lib/document/every-page.js";import{FOOTER_TYPE as L}from"../lib/document/footer-blocks.js";import $e from"./SwitchToBoxFooter.js";import{SiteFields as X}from"./SiteFields.js";import qe from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as Je,HERO_PART_MODE as Qe,heroPartLabel as Ve}from"../../render/lib/document/hero-media-parts.js";import{HintsToggle as et,SettingsSwitch as tt,hintsFoldClass as nt}from"efficient-easel/panel";import{useHints as ot}from"efficient-easel/screen/lib/hints";import{partRowField as rt}from"../lib/document/part-row-field.js";import{decodePartKey as it,partRowHeadLabel as st}from"../../render/lib/document/part-rows.js";import{encodePartId as at,partHeadLabel as lt,partLabel as ct,sectionTextParts as dt}from"../../render/lib/document/text-parts.js";import{partSourceOf as pt,sourceMenuIdOf as mt,sourceSlugOf as ft}from"../../format/lib/document/source-bound-parts.js";const mn=ze,fn={kind:"header"},un={kind:"website"},hn={kind:"website",tab:Te,revealPageGroup:!0},Sn={kind:"chat"},bn={kind:"social"},w="Part";function ut(e){return n("Part of {name}",{name:n(e)})}function ht(e,o,i){const s=e.describeNode(o);return{name:i,kindLabel:s?ut(s.label):n(w)}}function St(e){switch(e){case"Header":return{title:n("Header settings belong to a website."),own:n("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:n("Appearance settings belong to a website."),own:n("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:n("Live chat settings belong to a website."),own:n("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:n("Social link settings belong to a website."),own:n("Each website created from this template sets its own social link afterwards.")};default:return{title:n("{what} settings belong to a website.",{what:e}),own:n("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function Z({what:e}){const o=St(e);return m("div",{className:"sf-note",children:[r("p",{children:r("strong",{children:o.title})}),m("p",{children:[n("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",o.own]})]})}function y(e){const o=Qe[e];return{name:Je[e],kindLabel:w,icon:o,head:(i,s)=>{if(i.kind!==o)return null;const d=s.describeNode(i.nodeId);if(!d)return null;const h=z({name:n(Ve(e,d.props)),tier:"part",of:n(d.label)},{partOf:({name:p})=>n("Part of {name}",{name:p})});return{name:h.name,kindLabel:h.kind}},render:(i,s)=>i.kind===o?r(qe,{nodeId:i.nodeId,part:e,sectionName:s.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(i.nodeId)}):null}}const bt={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,o)=>{const i=o.hostPanels?.header;return i?r(i,{placeholderMode:o.capabilities.placeholderFrames,tokenRef:o.tokenRef,siteId:o.siteId,websiteName:o.websiteName,onOpenWebsiteSettings:o.onOpenWebsiteSettings,onAuthExpired:()=>o.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,o)=>r(Oe,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!o.capabilities.hasSiteTheme,tokenRef:o.tokenRef,siteId:o.siteId,onNotify:o.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>r(Ne,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>r(_e,{unavailable:r(Z,{what:"Social link"})})},ticker:{name:G,kindLabel:w,icon:"ticker",head:(e,o)=>e.kind==="ticker"?ht(o,e.heroId,n(G)):null,render:e=>r(He,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:y("media"),heroImage:y("image"),heroImage2:y("image2"),part:{name:w,kindLabel:w,icon:"Text",head:(e,o)=>{if(e.kind!=="part")return null;const i=o.describeNode(e.nodeId);if(!i)return null;const{key:s,row:d}=it(e.propKey),h=d?rt(i.fields[s],d):i.fields[s],p=De(i.type),f=p?Be(p,e.propKey):null,u=p&&f?p[f].label:Ce[e.propKey],g=u?n(u):st(n(lt(ct(h??{},s))),d),E=z({name:g,tier:"part",of:n(i.label)},{partOf:({name:k})=>n("Part of {name}",{name:k})});return{name:E.name,kindLabel:E.kind}},render:(e,o)=>e.kind==="part"?r(Re,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>o.onSelectNode(e.nodeId),onEditStyle:o.onOpenSiteStyles}):null}},wt=new Set(["header","website","chat"]);function gt(e,o){if(e==="selection")return null;const i=bt[e];return wt.has(e)&&!o.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>r(Z,{what:i.name})}:i}function Et({mode:e,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:h=!1,onNotify:p,onHidePanel:f}){const{capabilities:u,tokenRef:g,notifyParent:E,currentSlug:k,siteId:O,runAuthed:$,readOnly:q,navigate:kt}=Me(),{rows:J}=xe(),T=J?.find(l=>l.slug===k)??null,Q=be(),N=Object.keys(Q.fields).some(l=>!l.startsWith("_")&&!W.includes(l)),{websiteName:V}=Ke(),P=We({readOnly:q}),{select:ee}=je(),{selectedItem:t,getItemById:te,getSelectorForId:ne,config:S,appState:oe}=Se(l=>l),re=Ie(S,t?{type:t.type,props:t.props}:null),_=t?dt(re??S.components[t.type]?.fields,t.props):[],ie=l=>S.components[l]?.label??l,a=t?ne(t.props.id):void 0,c=gt(e.kind,u),se=ye(),H={capabilities:u,tokenRef:g,hostPanels:se.chrome?.panels,describeNode:l=>{const b=te(l);if(!b)return null;const M=S.components[b.type];return{type:b.type,label:M?.label??b.type,fields:M?.fields??{},props:b.props??{}}},siteId:O,websiteName:V??null,notifyParent:E,onNotify:p,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:d},R=c?.head?.(e,H)??null,A=Ee({kind:T?.kind,pageName:T?.label}),D=R?.name??(c?n(c.name):t?n(ie(t.type)):A.name),ae=R?.kindLabel??(c?n(c.kindLabel):t?a&&a.zone!==U?n("Block"):n("Section"):A.kindLabel),le=c?c.icon:t?t.type:"page",C=I(e)&&t?pt(t.type):null,ce=!!t&&!!a&&a.zone===U&&t.type!==L&&t.type!==Xe,v=Ze(oe?.data,t),de=()=>{v||a&&P.duplicateComponent(a.zone,a.index)},pe=()=>{a&&(P.removeComponent(a.zone,a.index),P.select(null))},me=t?S.components[t.type]?.defaultProps?.previewHover:void 0,B=I(e)&&!!t&&!!a&&me!==void 0,F=B&&t.props.previewHover===!0,fe=()=>{!t||!a||P.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!F}})},{shown:x,setShown:ue}=ot(),he=!!(c||t||N);return m("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right ${nt(x)}`.trim(),children:[r(ke,{icon:r(Le,{type:le,size:15}),name:D,kind:ae,actions:!h&&I(e)&&t&&t.type!==L?m(K,{children:[r(j,{label:n("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:de,children:r(Pe,{size:15})}),ce&&u.hasSiteSettings&&r(Fe,{node:t,currentSlug:k,siteId:O??void 0,tokenRef:g,runAuthed:$,onNotify:p}),r(j,{label:n("Remove section"),danger:!0,onClick:pe,children:r(ve,{size:15})}),f?r(Y,{side:"right",onHide:f,divider:!0}):null]}):f?r(Y,{side:"right",onHide:f}):void 0}),B&&m("div",{className:"sf-preview-pin",children:[m("div",{className:"sf-preview-pin-text",children:[r("span",{className:"sf-preview-pin-label",children:n("Preview hover state")}),r("span",{className:"sf-preview-pin-hint",children:n("not shown live")})]}),r(tt,{checked:F,onChange:fe,ariaLabel:n("Preview hover state")})]}),m("div",{className:"sf-insp-body es-insp-body sf-scroll",children:[c?c.render(e,H):t?m(K,{children:[t.type===L&&u.hasSiteSettings&&r($e,{}),r(Ue,{children:r(X,{entries:r(Ye,{parts:_,heading:!1,onOpen:l=>ee(at(t.props.id,l))}),entryCount:Ge(_).length,itemWord:D})}),C&&r(Ae,{source:C,slug:ft(t?.props),menuId:mt(t?.props)})]}):N?r(X,{omit:W}):r(ge,{variant:"none",icon:!1,message:n("Select a section or block to edit it."),children:s&&r(we,{variant:"secondary",onClick:s,children:n("This page")})}),he&&r(et,{shown:x,onChange:ue,label:n("Show hints")})]})]})}export{Sn as CHAT_MODE,fn as HEADER_MODE,mn as SELECTION_MODE,bn as SOCIAL_MODE,un as WEBSITE_MODE,hn as WEBSITE_PAGE_MODE,Et as default,gt as resolvePanel};
1
+ "use client";import{jsx as r,jsxs as m,Fragment as M}from"react/jsx-runtime";import{useEasel as he,useRootFields as Se}from"efficient-easel/easel";import{EmptyState as be}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as K}from"../lib/document/page-root-fields.js";import{rootPanelHead as we}from"../../format/lib/document/root-panel.js";import{headWords as W,InspectorHead as ge,InspectorIconButton as z}from"efficient-easel/chrome";import{DuplicateIcon as Ee,TrashIcon as ke}from"efficient-easel/icons";import{panelFieldsOf as Pe}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as j}from"../../render/components/PreviewTickerContext.js";import ve from"./SectionIcon.js";import{PanelHideButton as G}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as Ie}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import Le,{SITE_STYLES_BASICS_TAB as ye}from"./WebsiteSettingsPanel.js";import Oe from"./ChatSettingsPanel.js";import Te from"./SocialLinksPanel.js";import Ne from"./TickerSettingsPanel.js";import _e,{PartSourceNote as He}from"./PartSettingsPanel.js";import{regionsForSection as Re}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Ae}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as De}from"../../format/lib/sections/text-regions.js";import Ce from"./DuplicateToPageMenu.js";import{usePageRows as Be}from"../lib/page-rows.js";import{useScreenDocument as Fe}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as xe}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as Me}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as Ke,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as We}from"efficient-easel/draw/client";import{entryPartsOf as ze,SectionTextEntries as je}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ge}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as Ye,ROOT_ZONE as Y}from"efficient-easel/draw";import{websiteDuplicateBlocked as Ue}from"../lib/document/every-page.js";import{FOOTER_TYPE as L}from"../lib/document/footer-blocks.js";import Xe from"./SwitchToBoxFooter.js";import{SiteFields as U}from"./SiteFields.js";import Ze from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as $e,HERO_PART_MODE as qe,heroPartLabel as Je}from"../../render/lib/document/hero-media-parts.js";import{HintsToggle as Qe,SettingsSwitch as Ve,hintsFoldClass as et}from"efficient-easel/panel";import{useHints as tt}from"efficient-easel/screen/lib/hints";import{partRowField as nt}from"../lib/document/part-row-field.js";import{decodePartKey as ot,partRowHeadLabel as rt}from"../../render/lib/document/part-rows.js";import{encodePartId as it,partHeadLabel as st,partLabel as at,sectionTextParts as lt}from"../../render/lib/document/text-parts.js";import{partSourceOf as ct,sourceMenuIdOf as pt,sourceSlugOf as dt}from"../../format/lib/document/source-bound-parts.js";const pn=Ke,dn={kind:"header"},mn={kind:"website"},fn={kind:"website",tab:ye,revealPageGroup:!0},un={kind:"chat"},hn={kind:"social"},g="Part";function mt(e){return n("Part of {name}",{name:n(e)})}function ft(e,o,i){const a=e.describeNode(o);return{name:i,kindLabel:a?mt(a.label):n(g)}}function ut(e){switch(e){case"Header":return{title:n("Header settings belong to a website."),own:n("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:n("Appearance settings belong to a website."),own:n("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:n("Live chat settings belong to a website."),own:n("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:n("Social link settings belong to a website."),own:n("Each website created from this template sets its own social link afterwards.")};default:return{title:n("{what} settings belong to a website.",{what:e}),own:n("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function X({what:e}){const o=ut(e);return m("div",{className:"sf-note",children:[r("p",{children:r("strong",{children:o.title})}),m("p",{children:[n("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",o.own]})]})}function y(e){const o=qe[e];return{name:$e[e],kindLabel:g,icon:o,head:(i,a)=>{if(i.kind!==o)return null;const d=a.describeNode(i.nodeId);if(!d)return null;const f=W({name:n(Je(e,d.props)),tier:"part",of:n(d.label)},{partOf:({name:c})=>n("Part of {name}",{name:c})});return{name:f.name,kindLabel:f.kind}},render:(i,a)=>i.kind===o?r(Ze,{nodeId:i.nodeId,part:e,sectionName:a.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>a.onSelectNode(i.nodeId)}):null}}const ht={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,o)=>{const i=o.hostPanels?.header;return i?r(i,{placeholderMode:o.capabilities.placeholderFrames,tokenRef:o.tokenRef,siteId:o.siteId,websiteName:o.websiteName,onOpenWebsiteSettings:o.onOpenWebsiteSettings,onAuthExpired:()=>o.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,o)=>r(Le,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!o.capabilities.hasSiteTheme,tokenRef:o.tokenRef,siteId:o.siteId,onNotify:o.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>r(Oe,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>r(Te,{unavailable:r(X,{what:"Social link"})})},ticker:{name:j,kindLabel:g,icon:"ticker",head:(e,o)=>e.kind==="ticker"?ft(o,e.heroId,n(j)):null,render:e=>r(Ne,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:y("media"),heroImage:y("image"),heroImage2:y("image2"),part:{name:g,kindLabel:g,icon:"Text",head:(e,o)=>{if(e.kind!=="part")return null;const i=o.describeNode(e.nodeId);if(!i)return null;const{key:a,row:d}=ot(e.propKey),f=d?nt(i.fields[a],d):i.fields[a],c=Re(i.type),u=c?De(c,e.propKey):null,h=c&&u?c[u].label:Ae[e.propKey],P=h?n(h):rt(n(st(at(f??{},a))),d),S=W({name:P,tier:"part",of:n(i.label)},{partOf:({name:E})=>n("Part of {name}",{name:E})});return{name:S.name,kindLabel:S.kind}},render:(e,o)=>e.kind==="part"?r(_e,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>o.onSelectNode(e.nodeId),onEditStyle:o.onOpenSiteStyles}):null}},St=new Set(["header","website","chat"]);function bt(e,o){if(e==="selection")return null;const i=ht[e];return St.has(e)&&!o.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>r(X,{what:i.name})}:i}function wt({mode:e,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:a,hideNodeActions:d=!1,onNotify:f,onHidePanel:c}){const{capabilities:u,tokenRef:h,notifyParent:P,currentSlug:S,siteId:E,runAuthed:Z,readOnly:$,navigate:gt}=Fe(),{rows:q}=Be(),O=q?.find(l=>l.slug===S)??null,J=Se(),T=Object.keys(J.fields).some(l=>!l.startsWith("_")&&!K.includes(l)),{websiteName:Q}=xe(),k=Me({readOnly:$}),{select:V}=We(),{selectedItem:t,getItemById:ee,getSelectorForId:te,config:b,appState:ne}=he(l=>l),oe=Pe(b,t?{type:t.type,props:t.props}:null),N=t?lt(oe??b.components[t.type]?.fields,t.props):[],re=l=>b.components[l]?.label??l,s=t?te(t.props.id):void 0,p=bt(e.kind,u),ie=Ie(),_={capabilities:u,tokenRef:h,hostPanels:ie.chrome?.panels,describeNode:l=>{const w=ee(l);if(!w)return null;const x=b.components[w.type];return{type:w.type,label:x?.label??w.type,fields:x?.fields??{},props:w.props??{}}},siteId:E,websiteName:Q??null,notifyParent:P,onNotify:f,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:a},H=p?.head?.(e,_)??null,R=we({kind:O?.kind,pageName:O?.label}),A=H?.name??(p?n(p.name):t?n(re(t.type)):R.name),se=H?.kindLabel??(p?n(p.kindLabel):t?s&&s.zone!==Y?n("Block"):n("Section"):R.kindLabel),ae=p?p.icon:t?t.type:"page",D=I(e)&&t?ct(t.type):null,le=!!t&&!!s&&s.zone===Y&&t.type!==L&&t.type!==Ye,v=Ue(ne?.data,t),ce=()=>{v||s&&k.duplicateComponent(s.zone,s.index)},pe=()=>{s&&(k.removeComponent(s.zone,s.index),k.select(null))},de=t?b.components[t.type]?.defaultProps?.previewHover:void 0,C=I(e)&&!!t&&!!s&&de!==void 0,B=C&&t.props.previewHover===!0,me=()=>{!t||!s||k.replaceComponent(s.zone,s.index,{...t,props:{...t.props,previewHover:!B}})},{shown:F,setShown:fe}=tt(),ue=!!(p||t||T);return m("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right ${et(F)}`.trim(),children:[r(ge,{icon:r(ve,{type:ae,size:15}),name:A,kind:se,actions:!d&&I(e)&&t&&t.type!==L?m(M,{children:[r(z,{label:n("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:ce,children:r(Ee,{size:15})}),le&&u.hasSiteSettings&&r(Ce,{node:t,currentSlug:S,siteId:E??void 0,tokenRef:h,runAuthed:Z,onNotify:f}),r(z,{label:n("Remove section"),danger:!0,onClick:pe,children:r(ke,{size:15})}),c?r(G,{side:"right",onHide:c,divider:!0}):null]}):c?r(G,{side:"right",onHide:c}):void 0}),C&&m("div",{className:"sf-preview-pin",children:[m("div",{className:"sf-preview-pin-text",children:[r("span",{className:"sf-preview-pin-label",children:n("Preview hover state")}),r("span",{className:"sf-preview-pin-hint",children:n("not shown live")})]}),r(Ve,{checked:B,onChange:me,ariaLabel:n("Preview hover state")})]}),m("div",{className:"sf-insp-body es-insp-body sf-scroll",children:[p?p.render(e,_):t?m(M,{children:[t.type===L&&u.hasSiteSettings&&r(Xe,{}),r(Ge,{children:r(U,{entries:r(je,{parts:N,heading:!1,onOpen:l=>V(it(t.props.id,l))}),entryCount:ze(N).length,itemWord:A})}),D&&r(He,{source:D,slug:dt(t?.props),menuId:pt(t?.props)})]}):T?r(U,{omit:K}):r(be,{variant:"none",icon:!1,message:n("Select a section or block to edit it.")}),ue&&r(Qe,{shown:F,onChange:fe,label:n("Show hints")})]})]})}export{un as CHAT_MODE,dn as HEADER_MODE,pn as SELECTION_MODE,hn as SOCIAL_MODE,mn as WEBSITE_MODE,fn as WEBSITE_PAGE_MODE,wt as default,bt as resolvePanel};
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as y,jsxs as C}from"react/jsx-runtime";import{useCallback as v,useEffect as g,useRef as te,useState as B}from"react";import{SettingsSwitch as oe}from"efficient-easel/panel";import{PagesIcon as re,StylesIcon as ne}from"efficient-easel/rail";import{PaletteIcon as ie}from"efficient-shell/icons/efficient";import{Subtree as se,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{toItemSelector as ae}from"efficient-easel/node-ops";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ce}from"./LocationsTreeContext.js";import{usePartTypingDeps as de}from"./usePartTypingDeps.js";import{copyItemWrite as le}from"../lib/document/card-copy-rows.js";import pe from"./PagesPanel.js";import{useShowPagesForAddPage as me}from"./AddPageOnOpen.js";import{usePreviewChat as ue}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as fe}from"./preview-devices.js";import{PreviewDeviceContext as Se}from"efficient-easel/draw/client";import{usePreviewSocial as Ee}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as he,usePreviewTicker as Te}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as we}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as ge}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ie,HERO_PART_MODE as W,heroMediaRows as be,heroPartId as V,readHeroPartId as ve}from"../../render/lib/document/hero-media-parts.js";import _e,{CHAT_MODE as ke,HEADER_MODE as Ce,SOCIAL_MODE as Re,WEBSITE_MODE as M,WEBSITE_PAGE_MODE as Le}from"./SectionEditor.js";import R from"./SectionIcon.js";import Oe from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import Ae from"./StylesPanel.js";import{LOCATIONS_TYPE as ye,useLocationsTree as Be}from"./useLocationsTree.js";import{usePinnedChromeSeed as De}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ne}from"./useHostDocumentBridge.js";import{usePreviewHref as He}from"./usePreviewHref.js";import{WebsitePreviewButton as We}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Ve,SITE_STYLES_TABS as Me,SITE_STYLES_TEXT_TAB as xe,useWebsiteName as Ge}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Ye}from"./useWebsiteMainAction.js";import{VersionHistory as Fe}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as ze}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ke,heroGroupNestDepth as je}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ue}from"../../format/lib/markup.js";import{categoryShortLabel as Ze,PINNED_SECTION_TYPE as qe}from"../lib/document/add-palette.js";import{canAddTo as Xe}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Je}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as Qe}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as $e,setBookingPreview as et}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as tt}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as ot}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as rt,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as nt,readLeftView as it,resolveLeftView as st,writeLeftView as at}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as ct}from"../lib/document/locked-blocks.js";import{everyPageNotice as dt,noOwnTab as lt,pinnedReach as Y,websiteDuplicateBlocked as pt}from"../lib/document/every-page.js";import{sharedSectionReach as mt,WEBSITE_SHARED_SECTIONS as ut}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as ft}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as St,scrollPreviewToTop as z}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as Et}from"../lib/document/overrides.js";import{labelAtLevel as Pt}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as ht}from"../../format/lib/document/media-drop.js";import{editorWords as Tt,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as wt}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as gt,isSectionGroupType as It,sectionGroupZone as bt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as vt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as _t}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as kt,SAVE_AS_TEMPLATE_EVENT as Ct}from"../../format/lib/save-as-template-action.js";import{menuPresets as Rt}from"../lib/sections/menu-presets.js";import{newSectionNode as Lt}from"../lib/sections/new-section-node.js";import{useHostProducts as Ot}from"../lib/use-host-products.js";import{backendOf as At}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=Te(),c=H().tree,d=e,n=d.kind==="ticker"?d.heroId:null,s=v(i=>{if(!i)return;t({kind:"ticker",heroId:i}),St(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const S=String(i.props.id);return i.type==="Hero"&&we(i.props)&&a(D,{icon:a(R,{type:"ticker",size:13}),name:f(he),onSelect:()=>s(S),selected:n===S,rowProps:{onClick:m(()=>s(S))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=ge(),c=H().tree,{appState:d,config:n}=N(p=>p),s=te({data:d.data,config:n});s.current={data:d.data,config:n};const i=e,m=Ie.find(p=>W[p]===i.kind),S=m&&"nodeId"in i?V(String(i.nodeId),m):null,P=v(p=>{const l=ve(p);if(!l)return;const{data:T,config:h}=s.current,u=ae(T,h,{kind:"node",id:l.nodeId});if(!u)return;const I={kind:W[l.part],nodeId:l.nodeId};t({index:u.index,zone:u.zone},I)},[t]);return g(()=>{o(S)},[S,o]),g(()=>{r(P)},[r,P]),{partRows:(p,{rowClick:l})=>{const T=String(p.props.id),h=be(p);if(h.length===0)return null;const u=E=>{const w=V(T,E.part);return a(D,{icon:a(R,{type:E.part==="media"?"heroMedia":"heroImage",size:13}),name:f(E.label),onSelect:()=>P(w),selected:S===w,rowProps:{onClick:l(()=>P(w))},words:c},w)},[I,...b]=h;return C(y,{children:[u(I),b.length>0&&a(se,{children:b.map(u)})]})}}}function Z(e,t){return{partRows:(o,r)=>C(y,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function yt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=L(),{hasPreviewLink:S}=o,P=At(x()).preview?.draftLink,p=Ye(e.data),l=kt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),T=v(()=>{!c||!r||i(Ct,{siteId:c,slug:r})},[i,c,r]),h=He({pageSlug:r,siteId:c,token:m}),u=t.previewHref?.(r)??h;return{barLead:()=>l.visible&&a(_t,{enabled:l.enabled,reason:l.enabled?"":l.disabledReason,onSaved:T}),barView:()=>S&&r&&a(We,{liveHref:u,pageId:d??null,draftLink:P}),mainAction:p}}function Bt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=E=>t.setView(E),[S,P]=B(Me[0].id),[p,l]=B(!1),{surface:T,setSurface:h}=Pe(),u=()=>{if(s){m("styles"),t.reveal(),z();return}e.show(M),e.reveal(),z()},I={id:"pages",label:f("Pages"),icon:a(re,{}),panel:({onHide:E})=>a(pe,{activeSurface:T,onPreviewSurface:h,onNavigate:w=>{h(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:E})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(ie,{}),active:e.kind==="website",onSelect:u}),s&&b.push({id:"styles",label:f("Styles"),icon:a(ne,{}),panel:({onHide:E,notify:w})=>a(Ae,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:w,tab:S,onTabChange:P,revealPageGroup:p,onPageGroupRevealed:()=>l(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:E=>st(E,s),openSettings:u,openStyles:()=>{P(xe),m("styles")},openPageStyles:s?()=>{P(Ve),l(!0),m("styles"),t.reveal()}:i?()=>{e.show(Le),e.reveal()}:void 0}}function Dt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=N(n=>n.config),d=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=O();if(!n||!r)return;let s=!1;return ft(d).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,d])}function q(){const e=de();return v(t=>{le(t,e)},[e])}function Nt(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:s}=t;g(()=>{et(n?.type==="BookingBox"&&n.props.region==="confirm"?$e(s(String(n.props.id))):null)},[n?.props.id]);const i=Be(e,t),{capabilities:{hasSiteSettings:m}}=L();Dt();const{chat:S,setChat:P,setSelected:p,setSelectHandler:l}=ue(),T=v(()=>d(ke),[d]),h=c==="chat";g(()=>{p(h)},[h,p]),g(()=>{l(T)},[l,T]);const{setOpenHandler:u}=Ee(),I=v(()=>d(Re),[d]);g(()=>{u(I)},[u,I]);const b=Z(j(e),U(e)),E=yt(t),w=Bt(e,r);me(r);const Q=o.device,$=q();return{...b,...E,...w,hasOwnRows:k=>k.type===ye,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,onCopyItem:$,wrap:k=>a(ce.Provider,{value:!0,children:C(Se.Provider,{value:Q,children:[k,a(Fe,{})]})}),addPanelRow:k=>m?C("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(R,{type:"chat",size:16})}),C("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),T()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(oe,{checked:S.enabled,onChange:ee=>P({enabled:ee}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let X=null,A=new WeakMap;function Ht(e){const t=Tt();if(!e||!t)return e;X!==t&&(X=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:f(r.label)})):null,spec:e.spec?{...e.spec,addLabel:f(e.spec.addLabel),...e.spec.childLabel?{childLabel:f(e.spec.childLabel)}:{}}:null},A.set(e,o)),o}const Wt={isLockedBlock:(e,t)=>ct(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:pt,nestDepth:(e,t,o)=>t===Ke?je(e,o):0,newSectionNode:Lt,canAddTo:(e,t,o,r)=>Ht(Xe(e,t,r,o)),blockIsOffered:Qe,slotsOf:Je,resolveOnInsert:!0},Vt=new Proxy(wt,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),Mt={labelAtLevel:(e,t,o)=>f(Pt(e,t,o)),descriptions:Vt,categoryLabel:e=>{const t=Ze(e);return t===void 0?void 0:f(t)},firstSection:qe,blockRowName:tt,rowName:ot,plainText:Ue,Icon:R,Thumbnail:Oe,useProducts:Ot,presets:Rt()},xt={desktop:2e3,tablet:800,mobile:390},J="desktop",Gt={options:fe,initial:J,fluid:J,widths:xt,hidesPerView:!0},Yt={read:it,write:e=>at(e),forSelection:(e,t)=>nt(e,t)},Ft={first:G,last:rt,firstGroup:vt,lastGroup:K,isSectionGroup:It,sectionGroupZone:bt,panelOf:e=>e===G?Ce:null,get sharedReach(){return _()?Kt:void 0},get shared(){return O()?ut:void 0},get groupTab(){return _()?lt:void 0},get groupBadge(){return _()?Y({type:K})??void 0:void 0},get changeNotice(){return _()?dt():void 0},get band(){return _()?zt:void 0},get groupAccepts(){return _()?gt:void 0}},zt={foldable:!0},Kt=e=>Y(e)??mt(e);function jt(e){return{...Z(j(e),U(e)),onCopyItem:q(),openSettings:()=>e.show(M)}}function Ut(e,t){De(e,t),Ne()}const dr={useOwnerName:Ge,useDocumentLabel:ze,useBridges:Nt,useStandaloneBridges:jt,useDocumentPass:Ut,blockRules:Wt,blockLook:Mt,devices:Gt,leftView:Yt,pinned:Ft,Canvas:Et,canvasDrag:{media:ht},Inspector:_e};export{dr as WEBSITE_SCREEN};
1
+ "use client";import{jsx as a,Fragment as y,jsxs as C}from"react/jsx-runtime";import{useCallback as v,useEffect as g,useRef as te,useState as B}from"react";import{SettingsSwitch as oe}from"efficient-easel/panel";import{PagesIcon as re,StylesIcon as ne}from"efficient-easel/rail";import{PaletteIcon as ie}from"efficient-shell/icons/efficient";import{Subtree as se,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{toItemSelector as ae}from"efficient-easel/node-ops";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ce}from"./LocationsTreeContext.js";import{usePartTypingDeps as de}from"./usePartTypingDeps.js";import{copyItemWrite as le}from"../lib/document/card-copy-rows.js";import pe from"./PagesPanel.js";import{useShowPagesForAddPage as me}from"./AddPageOnOpen.js";import{usePreviewChat as ue}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as fe}from"./preview-devices.js";import{PHONE_EDGE as Se}from"../../format/lib/content/view-lines.js";import{PreviewDeviceContext as Ee}from"efficient-easel/draw/client";import{usePreviewSocial as Pe}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as he}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Te,usePreviewTicker as we}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as ge}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as Ie}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as be,HERO_PART_MODE as W,heroMediaRows as ve,heroPartId as M,readHeroPartId as _e}from"../../render/lib/document/hero-media-parts.js";import ke,{CHAT_MODE as Ce,HEADER_MODE as Re,SOCIAL_MODE as Le,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as Oe}from"./SectionEditor.js";import R from"./SectionIcon.js";import Ae from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import ye from"./StylesPanel.js";import{LOCATIONS_TYPE as Be,useLocationsTree as De}from"./useLocationsTree.js";import{usePinnedChromeSeed as Ne}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as He}from"./useHostDocumentBridge.js";import{usePreviewHref as We}from"./usePreviewHref.js";import{WebsitePreviewButton as Me}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Ve,SITE_STYLES_TABS as xe,SITE_STYLES_TEXT_TAB as Ge,useWebsiteName as Ye}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Fe}from"./useWebsiteMainAction.js";import{VersionHistory as ze}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Ke}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as je,heroGroupNestDepth as Ue}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ze}from"../../format/lib/markup.js";import{categoryShortLabel as qe,PINNED_SECTION_TYPE as Xe}from"../lib/document/add-palette.js";import{canAddTo as Je}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Qe}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as $e}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as et,setBookingPreview as tt}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as ot}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as rt}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as nt,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as it,readLeftView as st,resolveLeftView as at,writeLeftView as ct}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as dt}from"../lib/document/locked-blocks.js";import{everyPageNotice as lt,noOwnTab as pt,pinnedReach as Y,websiteDuplicateBlocked as mt}from"../lib/document/every-page.js";import{sharedSectionReach as ut,WEBSITE_SHARED_SECTIONS as ft}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as St}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as Et,scrollPreviewToTop as z}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as Pt}from"../lib/document/overrides.js";import{labelAtLevel as ht}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as Tt}from"../../format/lib/document/media-drop.js";import{editorWords as wt,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as gt}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as It,isSectionGroupType as bt,sectionGroupZone as vt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as _t}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as kt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as Ct,SAVE_AS_TEMPLATE_EVENT as Rt}from"../../format/lib/save-as-template-action.js";import{menuPresets as Lt}from"../lib/sections/menu-presets.js";import{newSectionNode as Ot}from"../lib/sections/new-section-node.js";import{useHostProducts as At}from"../lib/use-host-products.js";import{backendOf as yt}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=we(),c=H().tree,d=e,n=d.kind==="ticker"?d.heroId:null,s=v(i=>{if(!i)return;t({kind:"ticker",heroId:i}),Et(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const S=String(i.props.id);return i.type==="Hero"&&ge(i.props)&&a(D,{icon:a(R,{type:"ticker",size:13}),name:f(Te),onSelect:()=>s(S),selected:n===S,rowProps:{onClick:m(()=>s(S))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Ie(),c=H().tree,{appState:d,config:n}=N(p=>p),s=te({data:d.data,config:n});s.current={data:d.data,config:n};const i=e,m=be.find(p=>W[p]===i.kind),S=m&&"nodeId"in i?M(String(i.nodeId),m):null,P=v(p=>{const l=_e(p);if(!l)return;const{data:T,config:h}=s.current,u=ae(T,h,{kind:"node",id:l.nodeId});if(!u)return;const I={kind:W[l.part],nodeId:l.nodeId};t({index:u.index,zone:u.zone},I)},[t]);return g(()=>{o(S)},[S,o]),g(()=>{r(P)},[r,P]),{partRows:(p,{rowClick:l})=>{const T=String(p.props.id),h=ve(p);if(h.length===0)return null;const u=E=>{const w=M(T,E.part);return a(D,{icon:a(R,{type:E.part==="media"?"heroMedia":"heroImage",size:13}),name:f(E.label),onSelect:()=>P(w),selected:S===w,rowProps:{onClick:l(()=>P(w))},words:c},w)},[I,...b]=h;return C(y,{children:[u(I),b.length>0&&a(se,{children:b.map(u)})]})}}}function Z(e,t){return{partRows:(o,r)=>C(y,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Bt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=L(),{hasPreviewLink:S}=o,P=yt(x()).preview?.draftLink,p=Fe(e.data),l=Ct({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),T=v(()=>{!c||!r||i(Rt,{siteId:c,slug:r})},[i,c,r]),h=We({pageSlug:r,siteId:c,token:m}),u=t.previewHref?.(r)??h;return{barLead:()=>l.visible&&a(kt,{enabled:l.enabled,reason:l.enabled?"":l.disabledReason,onSaved:T}),barView:()=>S&&r&&a(Me,{liveHref:u,pageId:d??null,draftLink:P}),mainAction:p}}function Dt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=E=>t.setView(E),[S,P]=B(xe[0].id),[p,l]=B(!1),{surface:T,setSurface:h}=he(),u=()=>{if(s){m("styles"),t.reveal(),z();return}e.show(V),e.reveal(),z()},I={id:"pages",label:f("Pages"),icon:a(re,{}),panel:({onHide:E})=>a(pe,{activeSurface:T,onPreviewSurface:h,onNavigate:w=>{h(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:E})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(ie,{}),active:e.kind==="website",onSelect:u}),s&&b.push({id:"styles",label:f("Styles"),icon:a(ne,{}),panel:({onHide:E,notify:w})=>a(ye,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:w,tab:S,onTabChange:P,revealPageGroup:p,onPageGroupRevealed:()=>l(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:E=>at(E,s),openSettings:u,openStyles:()=>{P(Ge),m("styles")},openPageStyles:s?()=>{P(Ve),l(!0),m("styles"),t.reveal()}:i?()=>{e.show(Oe),e.reveal()}:void 0}}function Nt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=N(n=>n.config),d=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=O();if(!n||!r)return;let s=!1;return St(d).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,d])}function q(){const e=de();return v(t=>{le(t,e)},[e])}function Ht(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:s}=t;g(()=>{tt(n?.type==="BookingBox"&&n.props.region==="confirm"?et(s(String(n.props.id))):null)},[n?.props.id]);const i=De(e,t),{capabilities:{hasSiteSettings:m}}=L();Nt();const{chat:S,setChat:P,setSelected:p,setSelectHandler:l}=ue(),T=v(()=>d(Ce),[d]),h=c==="chat";g(()=>{p(h)},[h,p]),g(()=>{l(T)},[l,T]);const{setOpenHandler:u}=Pe(),I=v(()=>d(Le),[d]);g(()=>{u(I)},[u,I]);const b=Z(j(e),U(e)),E=Bt(t),w=Dt(e,r);me(r);const Q=o.device,$=q();return{...b,...E,...w,hasOwnRows:k=>k.type===Be,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,onCopyItem:$,wrap:k=>a(ce.Provider,{value:!0,children:C(Ee.Provider,{value:Q,children:[k,a(ze,{})]})}),addPanelRow:k=>m?C("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(R,{type:"chat",size:16})}),C("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),T()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(oe,{checked:S.enabled,onChange:ee=>P({enabled:ee}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let X=null,A=new WeakMap;function Wt(e){const t=wt();if(!e||!t)return e;X!==t&&(X=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:f(r.label)})):null,spec:e.spec?{...e.spec,addLabel:f(e.spec.addLabel),...e.spec.childLabel?{childLabel:f(e.spec.childLabel)}:{}}:null},A.set(e,o)),o}const Mt={isLockedBlock:(e,t)=>dt(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:mt,nestDepth:(e,t,o)=>t===je?Ue(e,o):0,newSectionNode:Ot,canAddTo:(e,t,o,r)=>Wt(Je(e,t,r,o)),blockIsOffered:$e,slotsOf:Qe,resolveOnInsert:!0},Vt=new Proxy(gt,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),xt={labelAtLevel:(e,t,o)=>f(ht(e,t,o)),descriptions:Vt,categoryLabel:e=>{const t=qe(e);return t===void 0?void 0:f(t)},firstSection:Xe,blockRowName:ot,rowName:rt,plainText:Ze,Icon:R,Thumbnail:Ae,useProducts:At,presets:Lt()},Gt={desktop:2e3,tablet:800,mobile:390},J="desktop",Yt={options:fe,initial:J,fluid:J,fluidMin:Se,widths:Gt,hidesPerView:!0},Ft={read:st,write:e=>ct(e),forSelection:(e,t)=>it(e,t)},zt={first:G,last:nt,firstGroup:_t,lastGroup:K,isSectionGroup:bt,sectionGroupZone:vt,panelOf:e=>e===G?Re:null,get sharedReach(){return _()?jt:void 0},get shared(){return O()?ft:void 0},get groupTab(){return _()?pt:void 0},get groupBadge(){return _()?Y({type:K})??void 0:void 0},get changeNotice(){return _()?lt():void 0},get band(){return _()?Kt:void 0},get groupAccepts(){return _()?It:void 0}},Kt={foldable:!0},jt=e=>Y(e)??ut(e);function Ut(e){return{...Z(j(e),U(e)),onCopyItem:q(),openSettings:()=>e.show(V)}}function Zt(e,t){Ne(e,t),He()}const pr={useOwnerName:Ye,useDocumentLabel:Ke,useBridges:Ht,useStandaloneBridges:Ut,useDocumentPass:Zt,blockRules:Mt,blockLook:xt,devices:Yt,leftView:Ft,pinned:zt,Canvas:Pt,canvasDrag:{media:Tt},Inspector:ke};export{pr as WEBSITE_SCREEN};
@@ -1627,31 +1627,12 @@
1627
1627
  display: none;
1628
1628
  }
1629
1629
 
1630
- /* ── The icon rail: the shared editor-shell EaselRail (`.es-rail`) ───────────
1631
- The rail markup + base styles live in the `efficient-easel` package (imported via
1632
- `efficient-easel/rail.css`); the storefront no longer hand-rolls `.sf-rail`.
1633
- editor-shell ships its own defaults, so we remap the themeable `--es-rail-*`
1634
- custom properties onto the storefront's own `--sf-*` tokens, which is what
1635
- keeps the shared rail reading as this editor's chrome rather than as the
1636
- package's. (One mode only — the editor is deliberately light-only; see the
1637
- note at the top of this file.)
1638
- Scoped `.sf-editor .es-rail` (specificity 0,2,0) so it always beats rail.css's
1639
- base `.es-rail` (0,1,0) whatever order the two stylesheets load in.
1640
-
1641
- THREE TOKENS ARE DELIBERATELY NOT REMAPPED HERE, and each absence is load-
1642
- bearing since card 66198 laid the rail into the top bar as a row:
1643
-
1644
- --es-rail-w only the COLUMN reads it (`.es-rail { width:
1645
- var(--es-rail-w) }`); the row is `width: auto` and sizes
1646
- to its buttons, so a remap would be config nothing reads.
1647
- --es-rail-bg the row variant re-points these to transparent / none / 0
1648
- --es-rail-shadow ON PURPOSE: the bar already has its own surface, and a
1649
- --es-rail-radius second white card floating inside it is the bug. This
1650
- rule ties with `.es-rail.es-rail-row` on specificity
1651
- (0,2,0 both), so setting them here would silently WIN
1652
- and put that card back. The rail's surface is the bar's.
1653
-
1654
- Everything left below is colour the row variant does not touch. */
1630
+ /* ── The icon rail: efficient-easel's EaselRail (`.es-rail`) ────────────────
1631
+ Since efficient-easel 36 the rail is `.sf-body`'s first column (Add, Pages,
1632
+ Layers, Styles, Media). Its markup, size (44 = 4 + 36 + 4, gap 8, inset 8)
1633
+ and colours are the package's, from `efficient-easel/rail.css` on the
1634
+ shell's tokens; the website adds NO `.es-rail` rule
1635
+ (scripts/test-no-host-rail-css.ts). */
1655
1636
 
1656
1637
  /* ── Left panel: Pages view (the page list) ─────────────────────────────── */
1657
1638
  .sf-pages {
@@ -0,0 +1,6 @@
1
+ import { type RuleReport, type SourceFile } from "../../../format/lib/source-rules/rule.js";
2
+ export type NoHostRailOptions = {
3
+ readonly exempt?: Readonly<Record<string, string>>;
4
+ readonly minFiles: number;
5
+ };
6
+ export declare function noHostRail(files: readonly SourceFile[], options: NoHostRailOptions): RuleReport;
@@ -0,0 +1 @@
1
+ import{DEFAULT_EASEL_STRINGS as d}from"efficient-easel/strings";import{ruleChecks as m}from"../../../format/lib/source-rules/rule.js";const a=s=>s.replace(/\/\*[\s\S]*?\*\//g,""),i=/(^|[^\w-])\.es-rail(?![\w-])[^{}]*\{/m,c=d.chrome.mediaLibrary,h=new RegExp(`["'\`]${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`);function R(s,r){const t=m("no-host-rail: a host draws no rail of its own (efficient-easel 36)"),l=r.exempt??{};t.check("self-test: a `.es-rail` rule is found",i.test(a(".sf-editor .es-rail { width: 46px }"))),t.check("self-test: a `.es-rail-btn` rule is found too",i.test(a(".x .es-rail .es-rail-btn{color:red}"))),t.check("self-test: a comment is not a rule",!i.test(a("/* .es-rail { is easel's } */"))),t.check("self-test: a different class is not the rail",!i.test(a(".es-railway { color: red }"))),t.check("self-test: a quoted Media library is found",h.test(`label="${c}"`)),t.check(`at least ${r.minFiles} files read`,s.length>=r.minFiles,`read ${s.length}`);const o=[];for(const e of s)(e.path.endsWith(".css")?i.test(a(e.text)):/\.(tsx?|jsx?)$/.test(e.path)&&h.test(e.text))&&!(e.path in l)&&o.push(e.path);t.check('no host `.es-rail` rule and no host "Media library" control',o.length===0,`${o.join(", ")}: the rail's look is efficient-easel/rail.css's, and the rail's Media is the one way to the media library`);const f=new Set(s.map(e=>e.path)),n=Object.keys(l).filter(e=>!f.has(e));return t.check("every exemption names a file that is there",n.length===0,`stale: ${n.join(", ")}`),t.report()}export{R as noHostRail};
@@ -1 +1 @@
1
- import{hasOwnEntry as $}from"../own-entry.js";import{SHAPE_TABLE as x}from"./gallery-card-layout.js";const b=12,P=6,A=800,u={twoAcross:{label:"Two across",across:2,acrossPhone:2,desktop:[[6,1],[6,1]],phone:[[3,1],[3,1]]},zigzag:{label:"Zigzag",across:2,acrossPhone:2,desktop:[[8,1],[4,1],[4,1],[8,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},brick:{label:"Brick",across:2,acrossPhone:2,desktop:[[5,1],[7,1],[7,1],[5,1]],phone:[[2,1],[4,1],[4,1],[2,1]]},twoTall:{label:"Two tall",across:2,acrossPhone:2,desktop:[[6,2],[6,2]],phone:[[3,2],[3,2]]},offsetTall:{label:"Offset tall",across:2,acrossPhone:2,desktop:[[5,2],[7,1],[3,1],[4,1]],phone:[[3,2],[3,1],[3,1]]},ladder:{label:"Ladder",across:2,acrossPhone:2,desktop:[[3,2],[9,1],[5,1],[4,1]],phone:[[2,2],[4,1],[2,1],[2,1]]},threeAcross:{label:"Three across",across:3,acrossPhone:3,desktop:[[4,1],[4,1],[4,1]],phone:[[2,1],[2,1],[2,1]]},bigLeft:{label:"Big left",across:3,acrossPhone:3,desktop:[[6,1],[3,1],[3,1]],phone:[[4,1],[1,1],[1,1]]},bigRight:{label:"Big right",across:3,acrossPhone:3,desktop:[[3,1],[3,1],[6,1]],phone:[[1,1],[1,1],[4,1]]},threeStagger:{label:"Three stagger",across:3,acrossPhone:3,desktop:[[5,1],[4,1],[3,1],[3,1],[4,1],[5,1]],phone:[[3,1],[2,1],[1,1],[1,1],[2,1],[3,1]]},threeLadder:{label:"Three ladder",across:3,acrossPhone:3,desktop:[[3,1],[4,1],[5,1],[5,1],[4,1],[3,1]],phone:[[1,1],[2,1],[3,1],[3,1],[2,1],[1,1]]},tallMiddle:{label:"Tall middle",across:3,acrossPhone:3,desktop:[[4,1],[4,2],[4,1],[4,1],[4,1]],phone:[[2,1],[2,2],[2,1],[2,1],[2,1]]},fourAcross:{label:"Four across",across:4,acrossPhone:2,desktop:[[3,1],[3,1],[3,1],[3,1]],phone:[[3,1],[3,1]]},bigFirst:{label:"Big first",across:4,acrossPhone:2,desktop:[[6,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},fourStagger:{label:"Four stagger",across:4,acrossPhone:2,desktop:[[4,1],[3,1],[2,1],[3,1],[2,1],[3,1],[4,1],[3,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},tallFirst:{label:"Tall first",across:4,acrossPhone:2,desktop:[[3,2],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[3,2],[3,1],[3,1]]},oneThenFour:{label:"One then four",across:4,acrossPhone:2,desktop:[[12,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},sixAcross:{label:"Six across",across:6,acrossPhone:3,desktop:[[2,1],[2,1],[2,1],[2,1],[2,1],[2,1]],phone:[[2,1],[2,1],[2,1]]},sixStagger:{label:"Six stagger",across:6,acrossPhone:6,desktop:[[3,1],[2,1],[1,1],[2,1],[1,1],[3,1],[1,1],[3,1],[2,1],[2,1],[1,1],[3,1]],phone:[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]]},twoThenThrees:{label:"Two, then threes",across:3,acrossPhone:3,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],leadPhone:[[3,1],[3,1]],phone:[[2,1],[2,1],[2,1]]},twoThenThreesPhoto:{label:"Two, then threes · photo",across:3,acrossPhone:1,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],phone:[[6,1]],ratio:"landscape"}},k=["phone","acrossPhone","leadPhone"],O=!0,S=new Set(k),_=Object.fromEntries(Object.entries(u).map(([e,o])=>[e,Object.fromEntries(Object.entries(o).filter(([s])=>!S.has(s)))])),w=Object.keys(u),j=[2,3,4,6];function B(e,o){return w.filter(s=>s===o||e===null||_[s].across===e)}function E(e){const o=e.layout;return typeof o=="string"&&$(u,o)?o:null}function Y(e){const o=E(e);return o?G(o,e.layoutPhone):null}const T={oneAcross:{label:"One across",phone:[[P,2]],acrossPhone:1}};function m(e){return typeof e=="string"&&$(T,e)?e:null}function y(e,o){return o?P/e.acrossPhone:b/e.across}function R(e){return e.ratio?x.find(o=>o.shape===e.ratio)?.ratio??null:null}function H(e){return[...e.lead??[],...e.desktop]}function G(e,o){const s=u[e],t=m(o);if(!t)return s;const{phone:p,acrossPhone:i}=T[t],c=Object.fromEntries(k.map(r=>[r,void 0]));return{...s,...c,phone:p,acrossPhone:i}}const C="sf-wall--";function F(e){const o=E(e);if(!o)return"";const s=m(e.layoutPhone);return`${C}${o}${s?`--${s}`:""}`}function v(e){const o=Y(e);if(!o)return"";const s=`.${F(e)}`,t=[],p=(r,h,a)=>`${s}:has(> :nth-child(${r}n+${h+a}):last-child) > :nth-last-child(-n+${a})`,i=(r,h,a=[])=>{const n=[],d=r.length,L=a.length;a.forEach(([l,g],f)=>{n.push(`${s} > :nth-child(${f+1}){grid-column:span ${l};grid-row:span ${g}}`)}),r.forEach(([l,g],f)=>{n.push(`${s} > :nth-child(${d}n+${L+f+1}){grid-column:span ${l};grid-row:span ${g}}`)});for(let l=1;l<d;l+=1)n.push(`${p(d,L,l)}{grid-column:span ${h};grid-row:span 1}`);return n};t.push(`${s}{grid-template-columns:repeat(${b},minmax(0,1fr))}`);const c=R(o);if(c&&(t.push(`${s}${s}{grid-auto-rows:auto}`),t.push(`${s}${s} > *{aspect-ratio:${c[0]}/${c[1]};height:auto}`)),t.push(...i(o.desktop,y(o,!1),o.lead)),t.push(`@media (max-width:${A}px){`),t.push(`${s}{grid-template-columns:repeat(${P},minmax(0,1fr))}`),t.push(...i(o.phone,y(o,!0),o.leadPhone)),o.phone.length===1&&!o.leadPhone?.length){const[r,h]=o.phone[0],a=o.lead?.length??0;for(let n=1;n<o.desktop.length;n+=1)t.push(`${p(o.desktop.length,a,n)}{grid-column:span ${r};grid-row:span ${h}}`)}return t.push("}"),t.join("")}export{j as GALLERY_ACROSS_BUCKETS,b as GALLERY_COLUMNS,P as GALLERY_COLUMNS_PHONE,_ as GALLERY_LAYOUTS,C as GALLERY_LAYOUT_CLASS_PREFIX,w as GALLERY_LAYOUT_KEYS,A as GALLERY_PHONE_BREAKPOINT,T as GALLERY_PHONE_LAYOUTS,B as galleryChoices,F as galleryLayoutClass,v as galleryLayoutCss,R as galleryLayoutRatio,H as galleryPictureCells,y as galleryTailSpan,Y as resolveGalleryLayout,m as resolveGalleryPhoneLayout};
1
+ import{PHONE_EDGE as O}from"./view-lines.js";import{hasOwnEntry as $}from"../own-entry.js";import{SHAPE_TABLE as x}from"./gallery-card-layout.js";const b=12,P=6,A=O,u={twoAcross:{label:"Two across",across:2,acrossPhone:2,desktop:[[6,1],[6,1]],phone:[[3,1],[3,1]]},zigzag:{label:"Zigzag",across:2,acrossPhone:2,desktop:[[8,1],[4,1],[4,1],[8,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},brick:{label:"Brick",across:2,acrossPhone:2,desktop:[[5,1],[7,1],[7,1],[5,1]],phone:[[2,1],[4,1],[4,1],[2,1]]},twoTall:{label:"Two tall",across:2,acrossPhone:2,desktop:[[6,2],[6,2]],phone:[[3,2],[3,2]]},offsetTall:{label:"Offset tall",across:2,acrossPhone:2,desktop:[[5,2],[7,1],[3,1],[4,1]],phone:[[3,2],[3,1],[3,1]]},ladder:{label:"Ladder",across:2,acrossPhone:2,desktop:[[3,2],[9,1],[5,1],[4,1]],phone:[[2,2],[4,1],[2,1],[2,1]]},threeAcross:{label:"Three across",across:3,acrossPhone:3,desktop:[[4,1],[4,1],[4,1]],phone:[[2,1],[2,1],[2,1]]},bigLeft:{label:"Big left",across:3,acrossPhone:3,desktop:[[6,1],[3,1],[3,1]],phone:[[4,1],[1,1],[1,1]]},bigRight:{label:"Big right",across:3,acrossPhone:3,desktop:[[3,1],[3,1],[6,1]],phone:[[1,1],[1,1],[4,1]]},threeStagger:{label:"Three stagger",across:3,acrossPhone:3,desktop:[[5,1],[4,1],[3,1],[3,1],[4,1],[5,1]],phone:[[3,1],[2,1],[1,1],[1,1],[2,1],[3,1]]},threeLadder:{label:"Three ladder",across:3,acrossPhone:3,desktop:[[3,1],[4,1],[5,1],[5,1],[4,1],[3,1]],phone:[[1,1],[2,1],[3,1],[3,1],[2,1],[1,1]]},tallMiddle:{label:"Tall middle",across:3,acrossPhone:3,desktop:[[4,1],[4,2],[4,1],[4,1],[4,1]],phone:[[2,1],[2,2],[2,1],[2,1],[2,1]]},fourAcross:{label:"Four across",across:4,acrossPhone:2,desktop:[[3,1],[3,1],[3,1],[3,1]],phone:[[3,1],[3,1]]},bigFirst:{label:"Big first",across:4,acrossPhone:2,desktop:[[6,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},fourStagger:{label:"Four stagger",across:4,acrossPhone:2,desktop:[[4,1],[3,1],[2,1],[3,1],[2,1],[3,1],[4,1],[3,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},tallFirst:{label:"Tall first",across:4,acrossPhone:2,desktop:[[3,2],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[3,2],[3,1],[3,1]]},oneThenFour:{label:"One then four",across:4,acrossPhone:2,desktop:[[12,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},sixAcross:{label:"Six across",across:6,acrossPhone:3,desktop:[[2,1],[2,1],[2,1],[2,1],[2,1],[2,1]],phone:[[2,1],[2,1],[2,1]]},sixStagger:{label:"Six stagger",across:6,acrossPhone:6,desktop:[[3,1],[2,1],[1,1],[2,1],[1,1],[3,1],[1,1],[3,1],[2,1],[2,1],[1,1],[3,1]],phone:[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]]},twoThenThrees:{label:"Two, then threes",across:3,acrossPhone:3,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],leadPhone:[[3,1],[3,1]],phone:[[2,1],[2,1],[2,1]]},twoThenThreesPhoto:{label:"Two, then threes · photo",across:3,acrossPhone:1,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],phone:[[6,1]],ratio:"landscape"}},E=["phone","acrossPhone","leadPhone"],S=!0,_=new Set(E),w=Object.fromEntries(Object.entries(u).map(([e,o])=>[e,Object.fromEntries(Object.entries(o).filter(([s])=>!_.has(s)))])),Y=Object.keys(u),H=[2,3,4,6];function v(e,o){return Y.filter(s=>s===o||e===null||w[s].across===e)}function k(e){const o=e.layout;return typeof o=="string"&&$(u,o)?o:null}function R(e){const o=k(e);return o?C(o,e.layoutPhone):null}const m={oneAcross:{label:"One across",phone:[[P,2]],acrossPhone:1}};function T(e){return typeof e=="string"&&$(m,e)?e:null}function y(e,o){return o?P/e.acrossPhone:b/e.across}function G(e){return e.ratio?x.find(o=>o.shape===e.ratio)?.ratio??null:null}function I(e){return[...e.lead??[],...e.desktop]}function C(e,o){const s=u[e],t=T(o);if(!t)return s;const{phone:p,acrossPhone:i}=m[t],c=Object.fromEntries(E.map(r=>[r,void 0]));return{...s,...c,phone:p,acrossPhone:i}}const F="sf-wall--";function N(e){const o=k(e);if(!o)return"";const s=T(e.layoutPhone);return`${F}${o}${s?`--${s}`:""}`}function K(e){const o=R(e);if(!o)return"";const s=`.${N(e)}`,t=[],p=(r,h,a)=>`${s}:has(> :nth-child(${r}n+${h+a}):last-child) > :nth-last-child(-n+${a})`,i=(r,h,a=[])=>{const n=[],d=r.length,L=a.length;a.forEach(([l,g],f)=>{n.push(`${s} > :nth-child(${f+1}){grid-column:span ${l};grid-row:span ${g}}`)}),r.forEach(([l,g],f)=>{n.push(`${s} > :nth-child(${d}n+${L+f+1}){grid-column:span ${l};grid-row:span ${g}}`)});for(let l=1;l<d;l+=1)n.push(`${p(d,L,l)}{grid-column:span ${h};grid-row:span 1}`);return n};t.push(`${s}{grid-template-columns:repeat(${b},minmax(0,1fr))}`);const c=G(o);if(c&&(t.push(`${s}${s}{grid-auto-rows:auto}`),t.push(`${s}${s} > *{aspect-ratio:${c[0]}/${c[1]};height:auto}`)),t.push(...i(o.desktop,y(o,!1),o.lead)),t.push(`@media (max-width:${A}px){`),t.push(`${s}{grid-template-columns:repeat(${P},minmax(0,1fr))}`),t.push(...i(o.phone,y(o,!0),o.leadPhone)),o.phone.length===1&&!o.leadPhone?.length){const[r,h]=o.phone[0],a=o.lead?.length??0;for(let n=1;n<o.desktop.length;n+=1)t.push(`${p(o.desktop.length,a,n)}{grid-column:span ${r};grid-row:span ${h}}`)}return t.push("}"),t.join("")}export{H as GALLERY_ACROSS_BUCKETS,b as GALLERY_COLUMNS,P as GALLERY_COLUMNS_PHONE,w as GALLERY_LAYOUTS,F as GALLERY_LAYOUT_CLASS_PREFIX,Y as GALLERY_LAYOUT_KEYS,A as GALLERY_PHONE_BREAKPOINT,m as GALLERY_PHONE_LAYOUTS,v as galleryChoices,N as galleryLayoutClass,K as galleryLayoutCss,G as galleryLayoutRatio,I as galleryPictureCells,y as galleryTailSpan,R as resolveGalleryLayout,T as resolveGalleryPhoneLayout};
@@ -1 +1 @@
1
- import{resolveGalleryLayout as i}from"./gallery-layout.js";const u=12,s=1,l=3,a=800,p=3;function e(r,t,n){const o=typeof r=="number"?r:Number.parseInt(String(r??""),10);return Number.isFinite(o)?Math.min(n,Math.max(t,Math.trunc(o))):null}function f(r){return e(r,1,u)??p}function x(r,t){const n=e(r,s,l);return n??(f(t)===4?2:s)}function G(r){return r==null||r===""?null:e(r,1,u)}const R="data-sf-span",c=4;function I(r){return r==null||r===""?null:e(r,1,c)}const M="data-sf-row-span",S=["gridSpan","gridRowSpan"];function N(r){if(!r)return!1;if(r.type==="Grid")return!0;if(r.type==="GalleryB"){if(i(r.props??{}))return!1;const t=r.props?.columns;return t!=null&&t!==""}return!1}export{S as CELL_SPAN_KEYS,p as GRID_COLUMNS_FALLBACK,u as GRID_MAX_COLUMNS,c as GRID_MAX_ROW_SPAN,l as GRID_MOBILE_MAX_COLUMNS,s as GRID_MOBILE_MIN_COLUMNS,a as GRID_PHONE_BREAKPOINT,M as GRID_ROW_SPAN_ATTR,R as GRID_SPAN_ATTR,N as containerOffersPositions,f as resolveGridColumns,x as resolveGridMobileColumns,I as resolveGridRowSpan,G as resolveGridSpan};
1
+ import{resolveGalleryLayout as s}from"./gallery-layout.js";import{PHONE_EDGE as l}from"./view-lines.js";const u=12,i=1,p=3,x=l,f=3;function o(r,t,n){const e=typeof r=="number"?r:Number.parseInt(String(r??""),10);return Number.isFinite(e)?Math.min(n,Math.max(t,Math.trunc(e))):null}function _(r){return o(r,1,u)??f}function R(r,t){const n=o(r,i,p);return n??(_(t)===4?2:i)}function I(r){return r==null||r===""?null:o(r,1,u)}const M="data-sf-span",c=4;function N(r){return r==null||r===""?null:o(r,1,c)}const S="data-sf-row-span",m=["gridSpan","gridRowSpan"];function A(r){if(!r)return!1;if(r.type==="Grid")return!0;if(r.type==="GalleryB"){if(s(r.props??{}))return!1;const t=r.props?.columns;return t!=null&&t!==""}return!1}export{m as CELL_SPAN_KEYS,f as GRID_COLUMNS_FALLBACK,u as GRID_MAX_COLUMNS,c as GRID_MAX_ROW_SPAN,p as GRID_MOBILE_MAX_COLUMNS,i as GRID_MOBILE_MIN_COLUMNS,x as GRID_PHONE_BREAKPOINT,S as GRID_ROW_SPAN_ATTR,M as GRID_SPAN_ATTR,A as containerOffersPositions,_ as resolveGridColumns,R as resolveGridMobileColumns,N as resolveGridRowSpan,I as resolveGridSpan};
@@ -1 +1 @@
1
- const f=800,r=["top","middle","bottom"],E=["left","center","right"],_="bottom",O="left",s={top:"Top",middle:"Middle",bottom:"Bottom"},c={left:"Left",center:"Center",right:"Right"},l="Up and down",d="Sideways",H={top:"flex-start",middle:"center",bottom:"flex-end"},P={left:"flex-start",center:"center",right:"flex-end"},i="--sf-hero-phone-y",x="--sf-hero-phone-x";function N(t){return r.includes(t)?t:_}function S(t){return E.includes(t)?t:O}function R(t,p){const e=N(t),n=S(p),o={};return e!==_&&(o[i]=H[e]),n!==O&&(o[x]=P[n]),o}function D(){return r.map(t=>({label:s[t],value:t}))}function A(){return E.map(t=>({label:c[t],value:t}))}export{f as HERO_PHONE_BREAKPOINT,E as HERO_PHONE_SIDEWAYS,O as HERO_PHONE_SIDEWAYS_DEFAULT,P as HERO_PHONE_SIDEWAYS_FLEX,d as HERO_PHONE_SIDEWAYS_LABEL,c as HERO_PHONE_SIDEWAYS_LABELS,x as HERO_PHONE_SIDEWAYS_VAR,r as HERO_PHONE_UPDOWN,_ as HERO_PHONE_UPDOWN_DEFAULT,H as HERO_PHONE_UPDOWN_FLEX,l as HERO_PHONE_UPDOWN_LABEL,s as HERO_PHONE_UPDOWN_LABELS,i as HERO_PHONE_UPDOWN_VAR,R as heroPhoneStackStyle,S as normalisePhoneSideways,N as normalisePhoneUpDown,A as phoneSidewaysPoints,D as phoneUpDownPoints};
1
+ import{PHONE_EDGE as s}from"./content/view-lines.js";const d=s,r=["top","middle","bottom"],E=["left","center","right"],_="bottom",O="left",c={top:"Top",middle:"Middle",bottom:"Bottom"},H={left:"Left",center:"Center",right:"Right"},D="Up and down",R="Sideways",P={top:"flex-start",middle:"center",bottom:"flex-end"},i={left:"flex-start",center:"center",right:"flex-end"},x="--sf-hero-phone-y",N="--sf-hero-phone-x";function f(t){return r.includes(t)?t:_}function S(t){return E.includes(t)?t:O}function A(t,p){const e=f(t),n=S(p),o={};return e!==_&&(o[x]=P[e]),n!==O&&(o[N]=i[n]),o}function h(){return r.map(t=>({label:c[t],value:t}))}function m(){return E.map(t=>({label:H[t],value:t}))}export{d as HERO_PHONE_BREAKPOINT,E as HERO_PHONE_SIDEWAYS,O as HERO_PHONE_SIDEWAYS_DEFAULT,i as HERO_PHONE_SIDEWAYS_FLEX,R as HERO_PHONE_SIDEWAYS_LABEL,H as HERO_PHONE_SIDEWAYS_LABELS,N as HERO_PHONE_SIDEWAYS_VAR,r as HERO_PHONE_UPDOWN,_ as HERO_PHONE_UPDOWN_DEFAULT,P as HERO_PHONE_UPDOWN_FLEX,D as HERO_PHONE_UPDOWN_LABEL,c as HERO_PHONE_UPDOWN_LABELS,x as HERO_PHONE_UPDOWN_VAR,A as heroPhoneStackStyle,S as normalisePhoneSideways,f as normalisePhoneUpDown,m as phoneSidewaysPoints,h as phoneUpDownPoints};
@@ -1,8 +1,11 @@
1
- import{failedChecks as x,reportLines as c,ruleChecks as m}from"./rule.js";const E=new RegExp([String.raw`(?<![\w@-])(?:max-)?view-tablet:`,String.raw`\bVIEW_TABLET_MIN\b`,String.raw`\[\s*["'\x60]view-tablet["'\x60]\s*\]`,String.raw`(?<![\w$])(?:TABLET|PHONE)_MEDIA\b`,String.raw`\bBOX_PHONE_PAD_LINE\b`,String.raw`719\.98px`,String.raw`max-width: ?719px`,String.raw`(?:max|min)-\[(?:719(?:\.98)?|720)px\]:`,String.raw`min-width: ?720px`,String.raw`width\s*<\s*720px`,String.raw`720px\s*<=?\s*width`,String.raw`width\s*>=\s*720px`].join("|"),"g"),f="lib/content/view-lines.ts",g=n=>n.split(`
2
- `).filter(i=>!/^\s*(\*(\s|\/|$)|\/\/|\/\*)/.test(i)).join(`
3
- `),o=n=>g(n).match(E)?.length??0;function u(n,i){const{check:a,report:p}=m("one phone edge");{const e=['"max-view-tablet:px-4 view-tablet:max-view-desktop:grow max-view-wide:px-5 @max-view-tablet:hidden"','import { VIEW_TABLET_MIN } from "efficient-easel/draw"; const NOT_VIEW_TABLET_MINIMUM = 1;',"`@media (max-width: 719.98px)` `(min-width: 720px)` `(min-width: 800px)`",'import { PHONE_MEDIA, TABLET_MEDIA, EDGE_PHONE_MEDIA, EDGE_TABLET_MEDIA } from "x"; BOX_PHONE_PAD_LINE; VIEW_LINE_PX["view-tablet"];',"@media (width < 720px) {} @media (720px <= width < 1100px) {} @media (width < 800px) {}"," *:has(> [data-x]) { max-view-tablet:hidden }","`max-[720px]:px-2 min-[720px]:grow @media (max-width: 719px)` `max-[800px]:px-2`"," * a comment that says max-view-tablet: is not code"].join(`
4
- `);a("the reader finds the 15 second-edge values and nothing else",o(e)===15,`found ${o(e)}`)}const r=n.filter(e=>/\.(tsx?|css)$/.test(e.path));a(`read the source (${r.length} TS/TSX/CSS files, at least ${i.minFiles})`,r.length>=i.minFiles,"fewer means the walk broke, and the check below is vacuous");const d=[],w=[];for(const e of r){if(e.path.endsWith(f))continue;const t=o(e.text),s=i.keep[e.path];s===void 0?t>0&&d.push(`${e.path}: ${t}`):t>s.lines&&w.push(`${e.path}: ${t}, kept ${s.lines}`)}a("no second phone edge: read PHONE_EDGE, or name it as view-wide / max-view-wide",d.length===0,`a 720 line outside the kept files:
1
+ import{failedChecks as _,reportLines as f,ruleChecks as g}from"./rule.js";const N=new RegExp([String.raw`(?<![\w@-])(?:max-)?view-tablet:`,String.raw`\bVIEW_TABLET_MIN\b`,String.raw`\[\s*["'\x60]view-tablet["'\x60]\s*\]`,String.raw`(?<![\w$])(?:TABLET|PHONE)_MEDIA\b`,String.raw`\bBOX_PHONE_PAD_LINE\b`,String.raw`719\.98px`,String.raw`max-width: ?719px`,String.raw`(?:max|min)-\[(?:719(?:\.98)?|720)px\]:`,String.raw`min-width: ?720px`,String.raw`width\s*<\s*720px`,String.raw`720px\s*<=?\s*width`,String.raw`width\s*>=\s*720px`].join("|"),"g"),p="lib/content/view-lines.ts",w=s=>s.split(`
2
+ `).filter(n=>!/^\s*(\*(\s|\/|$)|\/\/|\/\*)/.test(n)).join(`
3
+ `),r=s=>w(s).match(N)?.length??0,O=/\b(?:const|let)\s+([A-Z][A-Z0-9_]*)\s*(?::\s*number\s*)?=\s*800\s*(?:;|,|$)/gm,I=/PHONE|EDGE|BREAKPOINT|MOBILE|VIEW|LINE|CAP|WIDTH/,m=s=>[...w(s).matchAll(O)].map(n=>n[1]).filter(n=>I.test(n));function A(s,n){const{check:a,report:x}=g("one phone edge");{const e=['"max-view-tablet:px-4 view-tablet:max-view-desktop:grow max-view-wide:px-5 @max-view-tablet:hidden"','import { VIEW_TABLET_MIN } from "efficient-easel/draw"; const NOT_VIEW_TABLET_MINIMUM = 1;',"`@media (max-width: 719.98px)` `(min-width: 720px)` `(min-width: 800px)`",'import { PHONE_MEDIA, TABLET_MEDIA, EDGE_PHONE_MEDIA, EDGE_TABLET_MEDIA } from "x"; BOX_PHONE_PAD_LINE; VIEW_LINE_PX["view-tablet"];',"@media (width < 720px) {} @media (720px <= width < 1100px) {} @media (width < 800px) {}"," *:has(> [data-x]) { max-view-tablet:hidden }","`max-[720px]:px-2 min-[720px]:grow @media (max-width: 719px)` `max-[800px]:px-2`"," * a comment that says max-view-tablet: is not code"].join(`
4
+ `);a("the reader finds the 15 second-edge values and nothing else",r(e)===15,`found ${r(e)}`);const t=["export const GRID_PHONE_BREAKPOINT = 800;","const NO_CAP_ON_PHONE = 800;","export const PHONE_LINE: number = 800;","export const HERO_PHONE_BREAKPOINT = PHONE_EDGE;","const weight = 800; const FONT_HEAVY = 800; const GAP_LINE = 8000;"," * const OLD_PHONE_LINE = 800; in a comment"].join(`
5
+ `),i=m(t);a("the reader finds the 3 named 800 copies and nothing else",i.length===3,`found ${i.join(", ")}`)}const o=s.filter(e=>/\.(tsx?|css)$/.test(e.path));a(`read the source (${o.length} TS/TSX/CSS files, at least ${n.minFiles})`,o.length>=n.minFiles,"fewer means the walk broke, and the check below is vacuous");const d=[],E=[];for(const e of o){if(e.path.endsWith(p))continue;const t=r(e.text),i=n.keep[e.path];i===void 0?t>0&&d.push(`${e.path}: ${t}`):t>i.lines&&E.push(`${e.path}: ${t}, kept ${i.lines}`)}a("no second phone edge: read PHONE_EDGE, or name it as view-wide / max-view-wide",d.length===0,`a 720 line outside the kept files:
5
6
  ${d.join(`
6
- `)}`),a("no kept file gains a 720 line (its count is a ceiling)",w.length===0,`a kept file grew:
7
- ${w.join(`
8
- `)}`);const l=Object.keys(i.keep).filter(e=>{const t=r.find(s=>s.path===e);return t===void 0||o(t.text)===0});a("every kept file is in the tree and still keeps a 720 line (else drop it from the list)",l.length===0,l.join(", "));const h=p();return{...h,ok:x(h).length===0,lines:c(h)}}export{u as onePhoneEdge};
7
+ `)}`),a("no kept file gains a 720 line (its count is a ceiling)",E.length===0,`a kept file grew:
8
+ ${E.join(`
9
+ `)}`);const c=o.filter(e=>!e.path.endsWith(p)).flatMap(e=>m(e.text).map(t=>`${e.path}: ${t}`));a("the edge's value has one home: a named screen line reads PHONE_EDGE, never its own 800",c.length===0,`a second named 800:
10
+ ${c.join(`
11
+ `)}`);const l=Object.keys(n.keep).filter(e=>{const t=o.find(i=>i.path===e);return t===void 0||r(t.text)===0});a("every kept file is in the tree and still keeps a 720 line (else drop it from the list)",l.length===0,l.join(", "));const h=x();return{...h,ok:_(h).length===0,lines:f(h)}}export{A as onePhoneEdge};
@@ -1,2 +1,2 @@
1
- import{SPLITTABLE_SECTIONS as P}from"../../../../../format/lib/sections/section-head-placement.js";import{AUTO_COLUMN as A,BUTTON as M,DIM as W,INNER_BOX as r,SH_LINK as C,TEXT as h,smallText as R}from"./section-to-box-row-parts.js";import{labelTextSeed as D}from"../../../../../format/lib/document/text-seeds.js";import{labelStyle as x,token as a}from"../../../../../format/lib/document/seed-parts.js";import{tabletKey as w}from"efficient-easel/draw";import{BOX_DESKTOP_LINE as H,STACK_BELOW_PROP as F}from"../../../content/box-stack-line.js";import{ownEntry as u}from"../../../../../format/lib/own-entry.js";function b(e){if(e==="ProductGrid")return"shelf";const t=u(P,e)?.headStyle;return t==="editorial"||t==="simple"||t==="essay"?t:"standard"}const ne={standard:64,editorial:60,simple:36,essay:28,shelf:20},K={SectionHeader:"accent",FAQ:"accent",FitmentFinder:"accent",FitmentTable:"accent",SpecTable:"accent",RelatedProducts:"accent",Collections:"accentNum"};function z(e){if(e==="SectionHeader")return{num:"num",title:"title",description:"description",link:!0};const t=u(P,e);if(!t)throw new Error(`section-head-looks: "${e}" has no head row in SPLITTABLE_SECTIONS`);return{num:t.num,title:t.title,description:t.description,link:t.headRows.includes("linkText")&&t.headRows.includes("linkHref")}}function ie(e,t,n){const i=`editorial:${e}|${t}|${n}`,o=p.get(i);if(o)return o;const l=L({num:e,title:t,description:n,link:!1});return p.set(i,l),l}const E={[F]:H},m={top:0,right:0,bottom:1,left:0};import{token as le}from"../../../../../format/lib/document/seed-parts.js";const _=(e,t,n,i)=>({sizeToken:{step:e,px:i,fluid:{minPx:t,vw:n}}}),c=(e,t,n={})=>R(e,{...a("label",t),...n}),d=(e,t)=>({kind:"text",key:e,role:"heading",props:h,style:{textStyle:"heading-2",...t}}),f=800,U=H,T=(e,t,n,i,o={})=>({kind:"text",key:e,props:{...W,align:"right",alignPhone:"left",...n?{maxWidth:n,maxWidthPhone:f}:{},...o},style:{textStyle:"body-5",fontRole:"heading",alignPhone:"left",...a("body",t),...i,...o}}),N={...M,align:"right",alignPhone:"left",...C},S=e=>({kind:"button",key:"linkText",href:"linkHref",variant:"ghost",props:N,style:{...x(e),color:"labels"}}),O=(e,t,n)=>{const i=n.role==="heading"?{tag:"h2"}:{};return{kind:"block",type:"Text",when:o=>o[e]===void 0,props:{...h,...i,...n.props,text:t,_partStyles:{text:{...n.role==="eyebrow"?j(D()):{},...n.style}}}}},j=e=>e._partStyles.text??{},s={widthFitPhone:"fill"};function $(e){if(e.kind!=="group")return e;if(e.name==="Words"){const t=e.props;return{...e,props:typeof t=="function"?(n,i)=>({...t(n,i),...s}):{...t,...s}}}return{...e,parts:e.parts.map($)}}function v(e,t){const n=u(K,e),i=n==="accent",o=c(t.num,14,{color:i?"accent":"labels"}),l=n==="accentNum"&&o.kind==="text"?{...o,mark:"accentLead"}:o,k=d(t.title,i?{..._("headingMedium",36,5,64),case:"upper",lineHeight:.95,letterSpacing:-.025}:{...a("headingMedium",56,36),case:"none",lineHeight:1,letterSpacing:-.03}),g=e==="Collections";return{kind:"group",name:"Header",props:{...r,direction:"row",align:"end",justify:"between",gap:40,gapPhone:12,share:"content",sectionBorder:m,sectionPaddingBottom:24,sectionPaddingBottomPhone:20},parts:[{kind:"group",name:"Title",props:{...r,...s,direction:"row",align:"end",gap:40,gapPhone:12,share:"content"},parts:[{kind:"group",name:"Number",props:{...r,...s,align:"start",gap:12},parts:[{kind:"image",key:"logoSrc",alt:"logoAlt",props:{aspect:"auto",contained:!1}},l,...g?[O(t.num,"==01== / Collections",l)]:[]]},{kind:"group",name:"Heading",props:{...r,...s},parts:[k,...g?[O(t.title,`Three ranges,
2
- one standard.`,k)]:[]]}]},{kind:"group",name:"Words",props:{...r,...s,gap:12,maxWidth:340,maxWidthPhone:f},parts:[...t.description?[T(t.description,14,void 0,{lineHeight:1.5})]:[],...t.link?[S(14)]:[],...g?[{kind:"block",type:"ButtonBlock",props:{...N,variant:"ghost",label:"View all",href:"/wheels",_partStyles:{label:S(14).style}}}]:[]]}]}}function y(e,t){return e.kind==="text"?t.includes(e.key)?{...e,mark:"accentItalic"}:e:e.kind==="group"?{...e,parts:e.parts.map(n=>y(n,t))}:e}function L(e){const t=d(e.title,{..._("headingMedium",40,5.5,80),case:"upper",weight:500,lineHeight:1,letterSpacing:-.03});return{kind:"group",name:"Header",props:{...r,direction:"row",align:"end",justify:"between",gap:40,gapPhone:14,share:"content",sectionBorder:m,sectionPaddingBottom:32,...E},parts:[{kind:"group",name:"Title",props:{...r,direction:"row",align:"end",gap:40,gapPhone:14,share:"content",...E},parts:[{kind:"group",name:"Number",props:{...r,sectionPaddingBottom:8},parts:[{...c(e.num,13),props:{...h,...A}}]},y(t,[e.title])]},{kind:"group",name:"Words",props:{...r,sectionPaddingBottom:4,maxWidth:360,[w("maxWidth")]:U,maxWidthPhone:f},parts:e.description?[T(e.description,14,void 0,{lineHeight:1.5},{[w("align")]:"left"})]:[]}]}}function B(e,t){return{kind:"group",name:"Header",props:{...r,gap:16,gapPhone:16},parts:[c(e.num,13),d(e.title,t)]}}const I=[["para",{...x(13),weight:400,lineHeight:1,letterSpacing:.22}],["sm",{...a("headingMedium",40,28),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["md",{...a("headingMedium",48,32),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["lg",{...a("headingMedium",56,36),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["xl",{...a("headingMedium",64,40),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}]],X=e=>I.some(([t])=>t===e.titleSize)?e.titleSize:"lg";function G(e){return{kind:"group",name:"Header",props:{...r,direction:"row",align:"center",justify:"between",gap:16,share:"content",stickTop:!0,sectionBorder:m,sectionPaddingTop:12,sectionPaddingBottom:12},parts:[{kind:"group",name:"Title",props:{...r,direction:"row",align:"end",gap:24,share:"content"},parts:[c(e.num,13,{color:"labels",letterSpacing:.22,lineHeight:1}),...I.map(([t,n])=>({...d(e.title,n),when:i=>X(i)===t}))]},{kind:"group",name:"Words",props:{...r,direction:"row",align:"center",justify:"end",gap:20,share:"content"},parts:[...e.description?[T(e.description,13,340,{lineHeight:1.4})]:[],...e.link?[S(13)]:[]]}]}}function oe(e){return b(e)==="shelf"?{titleSize:"the Header Box's title Text part: its size, as the old shelf title drew it (lib/document/blocks/general/section-head-looks)"}:{}}const p=new Map,Q={...a("headingMedium",44,32),case:"upper",weight:500,lineHeight:1,letterSpacing:-.02};function re(e){const t=p.get(e);if(t)return t;const n=z(e),i=b(e),o=i==="editorial"?L(n):i==="simple"?B(n,Q):i==="essay"?B(n,{...a("headingMedium",38,28,"headingSmall"),case:"upper",lineHeight:1,letterSpacing:-.02}):i==="shelf"?G(n):v(e,n);return p.set(e,o),o}export{E as EDITORIAL_LINE,ne as HEAD_BELOW,Q as SIMPLE_HEADING_LOOK,ie as editorialHeadTree,_ as fluidToken,b as headLookOf,oe as headReads,re as headTree,$ as headWordsOnPhoneLine,le as token,y as withAccentItalic};
1
+ import{SPLITTABLE_SECTIONS as P}from"../../../../../format/lib/sections/section-head-placement.js";import{AUTO_COLUMN as A,BUTTON as M,DIM as W,INNER_BOX as r,SH_LINK as C,TEXT as h,smallText as R}from"./section-to-box-row-parts.js";import{labelTextSeed as D}from"../../../../../format/lib/document/text-seeds.js";import{labelStyle as x,token as a}from"../../../../../format/lib/document/seed-parts.js";import{tabletKey as H}from"efficient-easel/draw";import{BOX_DESKTOP_LINE as w,STACK_BELOW_PROP as F}from"../../../content/box-stack-line.js";import{PHONE_EDGE as K}from"../../../../../format/lib/content/view-lines.js";import{ownEntry as u}from"../../../../../format/lib/own-entry.js";function E(e){if(e==="ProductGrid")return"shelf";const t=u(P,e)?.headStyle;return t==="editorial"||t==="simple"||t==="essay"?t:"standard"}const oe={standard:64,editorial:60,simple:36,essay:28,shelf:20},z={SectionHeader:"accent",FAQ:"accent",FitmentFinder:"accent",FitmentTable:"accent",SpecTable:"accent",RelatedProducts:"accent",Collections:"accentNum"};function U(e){if(e==="SectionHeader")return{num:"num",title:"title",description:"description",link:!0};const t=u(P,e);if(!t)throw new Error(`section-head-looks: "${e}" has no head row in SPLITTABLE_SECTIONS`);return{num:t.num,title:t.title,description:t.description,link:t.headRows.includes("linkText")&&t.headRows.includes("linkHref")}}function re(e,t,n){const i=`editorial:${e}|${t}|${n}`,o=p.get(i);if(o)return o;const l=L({num:e,title:t,description:n,link:!1});return p.set(i,l),l}const b={[F]:w},m={top:0,right:0,bottom:1,left:0};import{token as de}from"../../../../../format/lib/document/seed-parts.js";const _=(e,t,n,i)=>({sizeToken:{step:e,px:i,fluid:{minPx:t,vw:n}}}),c=(e,t,n={})=>R(e,{...a("label",t),...n}),d=(e,t)=>({kind:"text",key:e,role:"heading",props:h,style:{textStyle:"heading-2",...t}}),f=K,j=w,T=(e,t,n,i,o={})=>({kind:"text",key:e,props:{...W,align:"right",alignPhone:"left",...n?{maxWidth:n,maxWidthPhone:f}:{},...o},style:{textStyle:"body-5",fontRole:"heading",alignPhone:"left",...a("body",t),...i,...o}}),N={...M,align:"right",alignPhone:"left",...C},S=e=>({kind:"button",key:"linkText",href:"linkHref",variant:"ghost",props:N,style:{...x(e),color:"labels"}}),O=(e,t,n)=>{const i=n.role==="heading"?{tag:"h2"}:{};return{kind:"block",type:"Text",when:o=>o[e]===void 0,props:{...h,...i,...n.props,text:t,_partStyles:{text:{...n.role==="eyebrow"?$(D()):{},...n.style}}}}},$=e=>e._partStyles.text??{},s={widthFitPhone:"fill"};function v(e){if(e.kind!=="group")return e;if(e.name==="Words"){const t=e.props;return{...e,props:typeof t=="function"?(n,i)=>({...t(n,i),...s}):{...t,...s}}}return{...e,parts:e.parts.map(v)}}function G(e,t){const n=u(z,e),i=n==="accent",o=c(t.num,14,{color:i?"accent":"labels"}),l=n==="accentNum"&&o.kind==="text"?{...o,mark:"accentLead"}:o,k=d(t.title,i?{..._("headingMedium",36,5,64),case:"upper",lineHeight:.95,letterSpacing:-.025}:{...a("headingMedium",56,36),case:"none",lineHeight:1,letterSpacing:-.03}),g=e==="Collections";return{kind:"group",name:"Header",props:{...r,direction:"row",align:"end",justify:"between",gap:40,gapPhone:12,share:"content",sectionBorder:m,sectionPaddingBottom:24,sectionPaddingBottomPhone:20},parts:[{kind:"group",name:"Title",props:{...r,...s,direction:"row",align:"end",gap:40,gapPhone:12,share:"content"},parts:[{kind:"group",name:"Number",props:{...r,...s,align:"start",gap:12},parts:[{kind:"image",key:"logoSrc",alt:"logoAlt",props:{aspect:"auto",contained:!1}},l,...g?[O(t.num,"==01== / Collections",l)]:[]]},{kind:"group",name:"Heading",props:{...r,...s},parts:[k,...g?[O(t.title,`Three ranges,
2
+ one standard.`,k)]:[]]}]},{kind:"group",name:"Words",props:{...r,...s,gap:12,maxWidth:340,maxWidthPhone:f},parts:[...t.description?[T(t.description,14,void 0,{lineHeight:1.5})]:[],...t.link?[S(14)]:[],...g?[{kind:"block",type:"ButtonBlock",props:{...N,variant:"ghost",label:"View all",href:"/wheels",_partStyles:{label:S(14).style}}}]:[]]}]}}function y(e,t){return e.kind==="text"?t.includes(e.key)?{...e,mark:"accentItalic"}:e:e.kind==="group"?{...e,parts:e.parts.map(n=>y(n,t))}:e}function L(e){const t=d(e.title,{..._("headingMedium",40,5.5,80),case:"upper",weight:500,lineHeight:1,letterSpacing:-.03});return{kind:"group",name:"Header",props:{...r,direction:"row",align:"end",justify:"between",gap:40,gapPhone:14,share:"content",sectionBorder:m,sectionPaddingBottom:32,...b},parts:[{kind:"group",name:"Title",props:{...r,direction:"row",align:"end",gap:40,gapPhone:14,share:"content",...b},parts:[{kind:"group",name:"Number",props:{...r,sectionPaddingBottom:8},parts:[{...c(e.num,13),props:{...h,...A}}]},y(t,[e.title])]},{kind:"group",name:"Words",props:{...r,sectionPaddingBottom:4,maxWidth:360,[H("maxWidth")]:j,maxWidthPhone:f},parts:e.description?[T(e.description,14,void 0,{lineHeight:1.5},{[H("align")]:"left"})]:[]}]}}function B(e,t){return{kind:"group",name:"Header",props:{...r,gap:16,gapPhone:16},parts:[c(e.num,13),d(e.title,t)]}}const I=[["para",{...x(13),weight:400,lineHeight:1,letterSpacing:.22}],["sm",{...a("headingMedium",40,28),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["md",{...a("headingMedium",48,32),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["lg",{...a("headingMedium",56,36),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["xl",{...a("headingMedium",64,40),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}]],X=e=>I.some(([t])=>t===e.titleSize)?e.titleSize:"lg";function Q(e){return{kind:"group",name:"Header",props:{...r,direction:"row",align:"center",justify:"between",gap:16,share:"content",stickTop:!0,sectionBorder:m,sectionPaddingTop:12,sectionPaddingBottom:12},parts:[{kind:"group",name:"Title",props:{...r,direction:"row",align:"end",gap:24,share:"content"},parts:[c(e.num,13,{color:"labels",letterSpacing:.22,lineHeight:1}),...I.map(([t,n])=>({...d(e.title,n),when:i=>X(i)===t}))]},{kind:"group",name:"Words",props:{...r,direction:"row",align:"center",justify:"end",gap:20,share:"content"},parts:[...e.description?[T(e.description,13,340,{lineHeight:1.4})]:[],...e.link?[S(13)]:[]]}]}}function ae(e){return E(e)==="shelf"?{titleSize:"the Header Box's title Text part: its size, as the old shelf title drew it (lib/document/blocks/general/section-head-looks)"}:{}}const p=new Map,V={...a("headingMedium",44,32),case:"upper",weight:500,lineHeight:1,letterSpacing:-.02};function se(e){const t=p.get(e);if(t)return t;const n=U(e),i=E(e),o=i==="editorial"?L(n):i==="simple"?B(n,V):i==="essay"?B(n,{...a("headingMedium",38,28,"headingSmall"),case:"upper",lineHeight:1,letterSpacing:-.02}):i==="shelf"?Q(n):G(e,n);return p.set(e,o),o}export{b as EDITORIAL_LINE,oe as HEAD_BELOW,V as SIMPLE_HEADING_LOOK,re as editorialHeadTree,_ as fluidToken,E as headLookOf,ae as headReads,se as headTree,v as headWordsOnPhoneLine,de as token,y as withAccentItalic};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "71.1.0",
3
+ "version": "72.0.0",
4
4
  "description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@tabler/icons-react": "^3.46.0",
57
- "efficient-easel": "^35.1.0",
57
+ "efficient-easel": "^36.0.0",
58
58
  "efficient-shell": "^13.17.0",
59
59
  "isomorphic-dompurify": "^3.18.0",
60
60
  "next": ">=16",
@@ -73,7 +73,7 @@
73
73
  "@types/node": "^20",
74
74
  "@types/react": "^19",
75
75
  "@types/react-dom": "^19",
76
- "efficient-easel": "^35.1.0",
76
+ "efficient-easel": "^36.0.0",
77
77
  "efficient-shell": "^13.17.0",
78
78
  "efficient-shell-checker": "npm:efficient-shell@13.17.0",
79
79
  "esbuild": "^0.28.0",