efficient-web-builder 49.1.0 → 50.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/editor/components/EditorPagePathProvider.d.ts +4 -0
  3. package/dist/editor/components/EditorPagePathProvider.js +1 -0
  4. package/dist/editor/components/PagesPanel.js +1 -1
  5. package/dist/editor/components/SourceStatus.d.ts +3 -3
  6. package/dist/editor/components/SourceStatus.js +1 -1
  7. package/dist/editor/components/StorefrontEditor.js +1 -1
  8. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  9. package/dist/editor/lib/document/add-target.js +1 -1
  10. package/dist/editor/lib/document/block-source-fields.d.ts +6 -0
  11. package/dist/editor/lib/document/block-source-fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/general/ContactLocations/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/general/PaymentBadges/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  17. package/dist/editor/lib/document/card-display-chips.d.ts +7 -2
  18. package/dist/editor/lib/document/card-display-chips.js +1 -1
  19. package/dist/editor/lib/document/card-row-fields.js +1 -1
  20. package/dist/editor/lib/document/field-groups.js +1 -1
  21. package/dist/editor/lib/document/slot-new-children.d.ts +2 -0
  22. package/dist/editor/lib/document/slot-new-children.js +1 -0
  23. package/dist/editor/lib/sections/hero-ticker-to-strip.js +1 -1
  24. package/dist/editor/lib/sections/new-section-node.js +1 -1
  25. package/dist/format/lib/content/block-sources.d.ts +11 -0
  26. package/dist/format/lib/content/block-sources.js +1 -1
  27. package/dist/format/lib/content/card-place.d.ts +8 -0
  28. package/dist/format/lib/content/card-place.js +1 -0
  29. package/dist/format/lib/content/card-template.d.ts +14 -2
  30. package/dist/format/lib/content/card-template.js +1 -1
  31. package/dist/format/lib/document/blocks/general/Cards/card-seed.d.ts +15 -0
  32. package/dist/format/lib/document/blocks/general/Cards/card-seed.js +1 -0
  33. package/dist/format/lib/document/blocks/general/Cards/meta.d.ts +6 -0
  34. package/dist/format/lib/document/blocks/general/Cards/meta.js +1 -1
  35. package/dist/format/lib/document/blocks/general/text-part-shapes.json +8 -0
  36. package/dist/format/lib/document/cards-template-on-read.d.ts +4 -0
  37. package/dist/format/lib/document/cards-template-on-read.js +1 -0
  38. package/dist/format/lib/document/editor-page-context.js +1 -1
  39. package/dist/format/lib/document/renamed-props.js +1 -1
  40. package/dist/format/lib/document/section-catalog.js +22 -2
  41. package/dist/format/lib/document/seed-parts.d.ts +18 -0
  42. package/dist/format/lib/document/seed-parts.js +1 -0
  43. package/dist/format/lib/editor-page-rows.d.ts +2 -0
  44. package/dist/format/lib/editor-page-rows.js +1 -1
  45. package/dist/format/lib/editor-words-catalogue.d.ts +12 -4
  46. package/dist/format/lib/editor-words-catalogue.js +3 -3
  47. package/dist/format/lib/hero-ticker.d.ts +4 -0
  48. package/dist/format/lib/hero-ticker.js +1 -1
  49. package/dist/format/lib/page-at-own-slug.d.ts +9 -0
  50. package/dist/format/lib/page-at-own-slug.js +1 -0
  51. package/dist/format/lib/popup/new-popup.js +1 -1
  52. package/dist/render/components/Cards.d.ts +4 -2
  53. package/dist/render/components/Cards.js +1 -1
  54. package/dist/render/components/Flex.js +1 -1
  55. package/dist/render/components/Text.d.ts +2 -1
  56. package/dist/render/components/Text.js +1 -1
  57. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  58. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  59. package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -2
  60. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  61. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -5
  62. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  63. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  64. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  65. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  66. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  67. package/dist/render/lib/sections/section-to-box.d.ts +7 -7
  68. package/dist/render/lib/sections/section-to-box.js +1 -1
  69. package/dist/render/lib/site-runtime.d.ts +2 -0
  70. package/dist/render/lib/site-runtime.js +1 -1
  71. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 50.0.0 - 2026-11-04
4
+
5
+ From main at `7bcd4d2a`: #481, #489, #490, #491. A major because of #481: `components/Cards` loses `items` as a drawing path and its built-in card. No declared export is removed (39 added), and the peers are unchanged (`efficient-easel` `^27.0.0`, `efficient-shell` `^11.8.0`). No stored page needs a data move: a stored Cards with no card template is given one on read and saved only with a merchant's edit (1 live node, hartesmetal.com /warranty).
6
+
7
+ **BREAKING for hosts (#481):** Delivery Options, Recurring Columns (`Series`) and Document Detail Cards (`DocMetaCards`) are merged into **Cards**, one data block with one card template (`template` slot). `components/Cards` draws the head and the template copies only: a caller that passed `items` to draw fixed cards draws none. Change every outside caller of `items` in the same bump (storefront `probe-eyebrow-fill`, storefront-blocks `test-section-head-style`). Look: from 700 to 719px the cards stand in one column (was three); from 720 to 799px the card padding is 32px (was 28).
8
+
9
+ ### Added
10
+
11
+ - **One Cards block with one card template** (#481). A new Cards is laid down with its template; a stored Cards with no template is given it on read (`lib/document/cards-template-on-read`, from `migrateRenamedProps`). Content rows say "<thing> content" with the first answer "Manual" (Card content, Payment content, Location content); the keys do not change. The template's Text "Shows" row offers the source's fields (`BlockSourceSpec.fields`), or the Cards' own under Manual. The template copies stand in the section's column (`InsideSiteColumn`).
12
+ - **A host block's card template is seeded on read** (#491). `CardTemplateSpec.seed` (optional) and `templateOnRead(type, props)` in `lib/content/card-template`; `migrateRenamedProps` calls it, so the page render, the editor load and a host's published header and footer seed every block whose entry has a seed. A host declares a block once, with `registerCardTemplates`.
13
+ - **A drawn block can read the current page path** (#489). Optional `pagePath` on `SiteRuntime` and the hook `useCurrentPagePath()`; the editor fills it with `components/EditorPagePathProvider`. `lib/page-at-own-slug`: `pageAnswersAtOwnSlug` (moved here from storefront-blocks) and `servedAtOwnSlug`. `lib/editor-page-rows`: `POPUP_PAGE_ROW_KIND`, `isPopupPageRow`.
14
+ - **The Hero strip's Add lays down the whole Scrolling Bar Box** (#490): `heroStripBox` (`lib/document/slot-new-children`) and `STRIP_ON_MEDIA` (`lib/hero-ticker`), the one strip-on-media pair. It needs easel 27.2.0 (`SlotSectionSpec.newChild`); an older easel lays down one empty Box, as before.
15
+
3
16
  ## 49.1.0 - 2026-11-04
4
17
 
5
18
  From main at `83fe5162`: #471, #476, #477, #486, #488. A minor: exports are added, no export is removed, and the peers are unchanged (`efficient-easel` `^27.0.0`, `efficient-shell` `^11.8.0`). No stored page changes: Row columns (`sharedColumns`) and Mirror cards (`mirrorCards`) are new settings, and nothing seeds them; a sized text region stores under the existing `_partStyles` keys.
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from "react";
2
+ export declare function EditorPagePathProvider({ children }: {
3
+ children: ReactNode;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as m}from"react/jsx-runtime";import{useMemo as s}from"react";import{useScreenDocument as a}from"efficient-easel/screen/components/ScreenDocumentContext";import{pagePath as c}from"../../format/lib/links/page-link-rules.js";import{servedAtOwnSlug as l}from"../../format/lib/page-at-own-slug.js";import{SiteRuntimeProvider as p,useSiteRuntime as d}from"../../render/lib/site-runtime.js";function x({children:n}){const{currentSlug:t,currentKind:u,data:r}=a(),e=d(),o=!!t&&!!r&&l({slug:t,kind:u,layout:r})?c(t):null,i=s(()=>({...e,pagePath:o}),[e,o]);return m(p,{runtime:i,children:n})}export{x as EditorPagePathProvider};
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as te,jsxs as C}from"react/jsx-runtime";import{Fragment as Re,useEffect as De,useId as xe,useMemo as oe,useRef as Ne,useState as c}from"react";import{useScreenDocument as ae}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as j}from"efficient-easel/draw/client";import ve from"efficient-easel/screen/components/SidePanelHead";import{useWebsiteName as Ee}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as Le}from"efficient-easel/chrome";import{Button as se,Dialog as Oe,FormField as Be,Input as le,PopupMenu as Fe,PopupMenuItem as ie,toast as re}from"efficient-shell/ui";import{LayersTree as Me,TreeGroupLabel as _e,TreeRow as de,TreeRowAction as L}from"efficient-easel/tree";import{AddIcon as ze,DuplicateIcon as Ge,PageIcon as He,SettingsIcon as Ue}from"efficient-easel/icons";import{PagesIcon as Te}from"efficient-easel/rail";import{useEaselHost as We}from"efficient-easel/screen/lib/host";import{bucketEditorPageRows as je,DYNAMIC_PAGES_GROUP_KEY as qe,isDynamicPageRow as Ke,MAIN_PAGES_GROUP as Ye}from"../../format/lib/editor-page-rows.js";import{useEaselSession as ce}from"efficient-easel/screen/lib/session-context";import{holdPageRow as q,usePageRows as Je}from"../lib/page-rows.js";import{say as n,sayCount as Qe}from"../../format/lib/editor-words.js";import{canDuplicatePage as Ve,DuplicatePageDialog as Xe,uniqueSlug as ue}from"efficient-easel/page-copy";import{backendOf as Ze}from"../lib/website-session.js";import{shopRouteBase as $e}from"../../format/lib/web-runtime.js";import{newPopupPage as en}from"../../format/lib/popup/new-popup.js";const pe="sf-editor-pages-collapsed-groups";function nn(){const s=ce(),{siteId:O,templateId:S}=ae(),I=Ze(s).pages;if(!(!I.duplicate||S))return(p,A)=>I.duplicate(p.id,{...A,...O?{siteId:O}:{}})}function tn(){try{const s=$e()||(typeof window>"u"?"":window.location.origin);return s?new URL(s).host:""}catch{return""}}function on({onNavigate:s,onClose:O,activeSurface:S,onPreviewSurface:I}){const p=ce().chrome?.pageRows,A=We(),{adapter:m,capabilities:g,ready:B,currentSlug:K}=ae(),me=Ee(),{rows:u,reload:F,setRows:Y,getRows:ge}=Je(),[M,fe]=c(""),[r,R]=c(!1),[D,f]=c(null),[J,x]=c(!1),[h,_]=c(""),Q=xe(),z=nn(),[b,G]=c(null),[H,he]=c(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(pe);return new Set(e?JSON.parse(e):[])}catch{return new Set}});De(()=>{try{window.localStorage.setItem(pe,JSON.stringify([...H]))}catch{}},[H]);const be=e=>he(a=>{const o=new Set(a);return o.has(e)?o.delete(e):o.add(e),o}),Pe=oe(()=>je(u??[]),[u]),U=M.trim().toLowerCase(),V=e=>!U||e.toLowerCase().includes(U),ye=e=>U?!0:!H.has(e),N=oe(()=>new Set((u??[]).map(e=>e.slug)),[u]),X=()=>{if(g.pageCreationInAdminForm){A.send("storefront-editor:new-page");return}_(""),f(null),x(!0)},Z=async()=>{const e=h.trim();if(!(!e||!B||r||!m.createPage)){R(!0),f(null);try{const a=await m.createPage({slug:ue(e,N),title:e,layout:{}});await F(),x(!1),_(""),s(a.slug)}catch{f(n("Couldn’t add the page — please retry."))}finally{R(!1)}}},v=g.hasSiteSettings&&!!m.createPage,we=async()=>{if(!(!B||r||!m.createPage)){R(!0),f(null);try{const e=await m.createPage(en(n("New popup"),N));await F(),s(e.slug)}catch{f(n("Couldn’t add the popup — please retry."))}finally{R(!1)}}},$=Ne(null),[P,y]=c(null),ke=()=>{if(!v)return X();if(P)return y(null);const e=$.current?.getBoundingClientRect();e&&y({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)})},Ce=e=>{const a=u??[],o=m.deletePage;if(!B||r||!o||a.length<=1)return;const i=a.findIndex(l=>l.id===e.id),d=a.filter(l=>l.id!==e.id),w=e.slug===K;q(e.id,!0),Y(d),f(null),w&&d[0]&&s(d[0].slug);const E=()=>{q(e.id,!1);const l=ge()??[];if(l.some(Ae=>Ae.id===e.id))return;const k=[...l];k.splice(Math.max(0,Math.min(i,k.length)),0,e),Y(k)};re.undoable(n("Deleted “{name}”",{name:e.label}),{actionLabel:n("Undo"),commit:async l=>{await o(e.id,l),q(e.id,!1)},undo:()=>{E(),w&&s(e.slug)},onFail:()=>{E(),re.error(n("Couldn’t delete the page — please retry."))}})},Se=e=>A.send("storefront-editor:open-page",{slug:e}),Ie=e=>{if(!V(e.label))return null;const a=!S&&e.slug===K,o=g.canDeletePagesInline&&(u??[]).length>1,i=Ke(e),d=e.kind==="lightbox",w=[...i?[{label:n("Dynamic"),tone:"info"}]:[],...d?[{label:n("Lightbox"),tone:"success"}]:[],...e.draft?[{label:n("draft"),tone:"draft"}]:[]],E=w.length>0?w:void 0,l=!!z&&Ve(e),k=l||g.pageCreationInAdminForm||o?C(te,{children:[l&&t(L,{kind:"plain",label:n("Duplicate “{name}”",{name:e.label}),disabled:r,onClick:()=>G(e),children:t(Ge,{size:13})}),g.pageCreationInAdminForm&&t(L,{kind:"plain",label:n("Page settings for “{name}”",{name:e.label}),onClick:()=>Se(e.slug),children:t(Ue,{size:13})}),o&&t(L,{kind:"delete",label:n("Delete “{name}”",{name:e.label}),disabled:r,onClick:()=>Ce(e),children:t(j,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]}):void 0;return t(de,{icon:t(He,{size:14}),name:e.label,selected:a,onSelect:()=>s(e.slug),badge:E,actions:k,rowProps:{"data-page-slug":e.slug}},e.id)},T=(e,a,o)=>{const i=o.filter(Boolean);if(i.length===0)return null;const d=ye(e);return C(Re,{children:[t(_e,{count:i.length,countLabel:Qe("{n} page","{n} pages",i.length),expanded:d,onToggle:()=>be(e),children:a}),d&&i]},e)},ee=(p?.rows??[]).filter(e=>V(e.label)).map(e=>{const a=S===e.key;return t(de,{icon:e.icon,name:e.label,selected:a,onSelect:()=>I(e.key),badge:{label:n("Preview"),tone:"warning"},actions:t(L,{kind:"plain",label:n("Open the {name} in a new tab",{name:e.label}),onClick:()=>window.open(e.href,"_blank","noopener,noreferrer"),children:t(j,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})}),rowProps:{"data-shop-surface":e.key}},e.key)}),ne=g.hasSiteSettings&&!!p,W=(()=>{if(u===null)return null;const e=[];let a=!1;for(const o of Pe){ne&&!a&&o.key.startsWith("system:")&&(e.push(T("shop",p.title,ee)),a=!0);const i=o.key===qe||o.label===Ye?n(o.label):o.label;e.push(T(o.key,i,o.rows.map(Ie)))}return ne&&!a&&e.push(T("shop",p.title,ee)),e})();return C("div",{className:"sf-pages",children:[t(ve,{icon:t(Te,{}),title:n("Pages"),context:me,actions:t(Le,{buttonRef:$,label:v?n("Add"):n("New page"),hasPopup:v?"menu":void 0,expanded:v?P!==null:void 0,onClick:ke,children:t(ze,{size:15})})}),P&&t(Fe,{portal:!0,style:{top:P.top,right:P.right},onClose:()=>y(null),children:C("div",{role:"menu","aria-label":n("Add"),children:[t(ie,{role:"menuitem",onClick:()=>{y(null),X()},children:n("Page")}),t(ie,{role:"menuitem",disabled:r,onClick:()=>{y(null),we()},children:n("Popup")})]})}),t("div",{className:"sf-pages-find",children:t(le,{type:"search",leftIcon:t(j,{name:"search",size:14,rounded:!0}),placeholder:n("Search all pages…"),value:M,onChange:e=>fe(e.target.value),"aria-label":n("Search all pages")})}),D&&!J&&t("div",{className:"sf-note sf-note--error",role:"alert",children:D}),W===null?t("div",{className:"sf-note",children:n("Loading…")}):W.some(Boolean)?t(Me,{ariaLabel:n("Pages"),className:"sf-scroll",children:W}):t("div",{className:"sf-note",children:M.trim()?n("No pages match your search"):n("No pages yet. Add one with + above.")}),z&&b&&t(Xe,{source:{title:b.label,slug:b.slug},taken:N,host:tn(),duplicate:e=>z(b,e),onClose:()=>G(null),onDuplicated:e=>{G(null),F(),s(e.slug)}},b.id),t(Oe,{open:J,onClose:()=>x(!1),size:"sm",title:n("Add a page"),description:n("Give the new template page a name. It starts blank — add sections once it opens."),footer:C(te,{children:[t(se,{variant:"secondary",onClick:()=>x(!1),children:n("Cancel")}),t(se,{onClick:()=>{Z()},disabled:r||!h.trim(),loading:r,children:n("Add page")})]}),children:t(Be,{label:n("Page name"),htmlFor:Q,hint:h.trim()?n("URL: /{slug}",{slug:ue(h,N)}):void 0,error:D??void 0,children:t(le,{id:Q,value:h,invalid:!!D,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key==="Enter"&&Z()},placeholder:n("e.g. About")})})})]})}export{on as default};
1
+ "use client";import{jsx as t,Fragment as te,jsxs as S}from"react/jsx-runtime";import{Fragment as Re,useEffect as De,useId as xe,useMemo as oe,useRef as Ne,useState as c}from"react";import{useScreenDocument as ae}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as j}from"efficient-easel/draw/client";import ve from"efficient-easel/screen/components/SidePanelHead";import{useWebsiteName as Ee}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as Le}from"efficient-easel/chrome";import{Button as se,Dialog as Oe,FormField as Be,Input as le,PopupMenu as Fe,PopupMenuItem as ie,toast as re}from"efficient-shell/ui";import{LayersTree as Me,TreeGroupLabel as _e,TreeRow as de,TreeRowAction as L}from"efficient-easel/tree";import{AddIcon as ze,DuplicateIcon as Ge,PageIcon as He,SettingsIcon as Ue}from"efficient-easel/icons";import{PagesIcon as Te}from"efficient-easel/rail";import{useEaselHost as We}from"efficient-easel/screen/lib/host";import{bucketEditorPageRows as je,DYNAMIC_PAGES_GROUP_KEY as qe,isDynamicPageRow as Ke,isPopupPageRow as Ye,MAIN_PAGES_GROUP as Je}from"../../format/lib/editor-page-rows.js";import{useEaselSession as ce}from"efficient-easel/screen/lib/session-context";import{holdPageRow as q,usePageRows as Qe}from"../lib/page-rows.js";import{say as n,sayCount as Ve}from"../../format/lib/editor-words.js";import{canDuplicatePage as Xe,DuplicatePageDialog as Ze,uniqueSlug as ue}from"efficient-easel/page-copy";import{backendOf as $e}from"../lib/website-session.js";import{shopRouteBase as en}from"../../format/lib/web-runtime.js";import{newPopupPage as nn}from"../../format/lib/popup/new-popup.js";const pe="sf-editor-pages-collapsed-groups";function tn(){const s=ce(),{siteId:O,templateId:k}=ae(),I=$e(s).pages;if(!(!I.duplicate||k))return(p,A)=>I.duplicate(p.id,{...A,...O?{siteId:O}:{}})}function on(){try{const s=en()||(typeof window>"u"?"":window.location.origin);return s?new URL(s).host:""}catch{return""}}function an({onNavigate:s,onClose:O,activeSurface:k,onPreviewSurface:I}){const p=ce().chrome?.pageRows,A=We(),{adapter:m,capabilities:g,ready:B,currentSlug:K}=ae(),me=Ee(),{rows:u,reload:F,setRows:Y,getRows:ge}=Qe(),[M,fe]=c(""),[r,R]=c(!1),[D,f]=c(null),[J,x]=c(!1),[h,_]=c(""),Q=xe(),z=tn(),[b,G]=c(null),[H,he]=c(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(pe);return new Set(e?JSON.parse(e):[])}catch{return new Set}});De(()=>{try{window.localStorage.setItem(pe,JSON.stringify([...H]))}catch{}},[H]);const be=e=>he(a=>{const o=new Set(a);return o.has(e)?o.delete(e):o.add(e),o}),Pe=oe(()=>je(u??[]),[u]),U=M.trim().toLowerCase(),V=e=>!U||e.toLowerCase().includes(U),ye=e=>U?!0:!H.has(e),N=oe(()=>new Set((u??[]).map(e=>e.slug)),[u]),X=()=>{if(g.pageCreationInAdminForm){A.send("storefront-editor:new-page");return}_(""),f(null),x(!0)},Z=async()=>{const e=h.trim();if(!(!e||!B||r||!m.createPage)){R(!0),f(null);try{const a=await m.createPage({slug:ue(e,N),title:e,layout:{}});await F(),x(!1),_(""),s(a.slug)}catch{f(n("Couldn’t add the page — please retry."))}finally{R(!1)}}},v=g.hasSiteSettings&&!!m.createPage,we=async()=>{if(!(!B||r||!m.createPage)){R(!0),f(null);try{const e=await m.createPage(nn(n("New popup"),N));await F(),s(e.slug)}catch{f(n("Couldn’t add the popup — please retry."))}finally{R(!1)}}},$=Ne(null),[P,y]=c(null),Ce=()=>{if(!v)return X();if(P)return y(null);const e=$.current?.getBoundingClientRect();e&&y({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)})},Se=e=>{const a=u??[],o=m.deletePage;if(!B||r||!o||a.length<=1)return;const i=a.findIndex(l=>l.id===e.id),d=a.filter(l=>l.id!==e.id),w=e.slug===K;q(e.id,!0),Y(d),f(null),w&&d[0]&&s(d[0].slug);const E=()=>{q(e.id,!1);const l=ge()??[];if(l.some(Ae=>Ae.id===e.id))return;const C=[...l];C.splice(Math.max(0,Math.min(i,C.length)),0,e),Y(C)};re.undoable(n("Deleted “{name}”",{name:e.label}),{actionLabel:n("Undo"),commit:async l=>{await o(e.id,l),q(e.id,!1)},undo:()=>{E(),w&&s(e.slug)},onFail:()=>{E(),re.error(n("Couldn’t delete the page — please retry."))}})},ke=e=>A.send("storefront-editor:open-page",{slug:e}),Ie=e=>{if(!V(e.label))return null;const a=!k&&e.slug===K,o=g.canDeletePagesInline&&(u??[]).length>1,i=Ke(e),d=Ye(e),w=[...i?[{label:n("Dynamic"),tone:"info"}]:[],...d?[{label:n("Lightbox"),tone:"success"}]:[],...e.draft?[{label:n("draft"),tone:"draft"}]:[]],E=w.length>0?w:void 0,l=!!z&&Xe(e),C=l||g.pageCreationInAdminForm||o?S(te,{children:[l&&t(L,{kind:"plain",label:n("Duplicate “{name}”",{name:e.label}),disabled:r,onClick:()=>G(e),children:t(Ge,{size:13})}),g.pageCreationInAdminForm&&t(L,{kind:"plain",label:n("Page settings for “{name}”",{name:e.label}),onClick:()=>ke(e.slug),children:t(Ue,{size:13})}),o&&t(L,{kind:"delete",label:n("Delete “{name}”",{name:e.label}),disabled:r,onClick:()=>Se(e),children:t(j,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]}):void 0;return t(de,{icon:t(He,{size:14}),name:e.label,selected:a,onSelect:()=>s(e.slug),badge:E,actions:C,rowProps:{"data-page-slug":e.slug}},e.id)},T=(e,a,o)=>{const i=o.filter(Boolean);if(i.length===0)return null;const d=ye(e);return S(Re,{children:[t(_e,{count:i.length,countLabel:Ve("{n} page","{n} pages",i.length),expanded:d,onToggle:()=>be(e),children:a}),d&&i]},e)},ee=(p?.rows??[]).filter(e=>V(e.label)).map(e=>{const a=k===e.key;return t(de,{icon:e.icon,name:e.label,selected:a,onSelect:()=>I(e.key),badge:{label:n("Preview"),tone:"warning"},actions:t(L,{kind:"plain",label:n("Open the {name} in a new tab",{name:e.label}),onClick:()=>window.open(e.href,"_blank","noopener,noreferrer"),children:t(j,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})}),rowProps:{"data-shop-surface":e.key}},e.key)}),ne=g.hasSiteSettings&&!!p,W=(()=>{if(u===null)return null;const e=[];let a=!1;for(const o of Pe){ne&&!a&&o.key.startsWith("system:")&&(e.push(T("shop",p.title,ee)),a=!0);const i=o.key===qe||o.label===Je?n(o.label):o.label;e.push(T(o.key,i,o.rows.map(Ie)))}return ne&&!a&&e.push(T("shop",p.title,ee)),e})();return S("div",{className:"sf-pages",children:[t(ve,{icon:t(Te,{}),title:n("Pages"),context:me,actions:t(Le,{buttonRef:$,label:v?n("Add"):n("New page"),hasPopup:v?"menu":void 0,expanded:v?P!==null:void 0,onClick:Ce,children:t(ze,{size:15})})}),P&&t(Fe,{portal:!0,style:{top:P.top,right:P.right},onClose:()=>y(null),children:S("div",{role:"menu","aria-label":n("Add"),children:[t(ie,{role:"menuitem",onClick:()=>{y(null),X()},children:n("Page")}),t(ie,{role:"menuitem",disabled:r,onClick:()=>{y(null),we()},children:n("Popup")})]})}),t("div",{className:"sf-pages-find",children:t(le,{type:"search",leftIcon:t(j,{name:"search",size:14,rounded:!0}),placeholder:n("Search all pages…"),value:M,onChange:e=>fe(e.target.value),"aria-label":n("Search all pages")})}),D&&!J&&t("div",{className:"sf-note sf-note--error",role:"alert",children:D}),W===null?t("div",{className:"sf-note",children:n("Loading…")}):W.some(Boolean)?t(Me,{ariaLabel:n("Pages"),className:"sf-scroll",children:W}):t("div",{className:"sf-note",children:M.trim()?n("No pages match your search"):n("No pages yet. Add one with + above.")}),z&&b&&t(Ze,{source:{title:b.label,slug:b.slug},taken:N,host:on(),duplicate:e=>z(b,e),onClose:()=>G(null),onDuplicated:e=>{G(null),F(),s(e.slug)}},b.id),t(Oe,{open:J,onClose:()=>x(!1),size:"sm",title:n("Add a page"),description:n("Give the new template page a name. It starts blank — add sections once it opens."),footer:S(te,{children:[t(se,{variant:"secondary",onClick:()=>x(!1),children:n("Cancel")}),t(se,{onClick:()=>{Z()},disabled:r||!h.trim(),loading:r,children:n("Add page")})]}),children:t(Be,{label:n("Page name"),htmlFor:Q,hint:h.trim()?n("URL: /{slug}",{slug:ue(h,N)}):void 0,error:D??void 0,children:t(le,{id:Q,value:h,invalid:!!D,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key==="Enter"&&Z()},placeholder:n("e.g. About")})})})]})}export{an as default};
@@ -1,8 +1,8 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  export interface SourceStatusProps {
3
3
  status: string;
4
- statusText: ReactNode;
5
- onRefresh: () => void;
4
+ statusText?: ReactNode;
5
+ onRefresh?: () => void;
6
6
  busy?: boolean;
7
7
  edit?: {
8
8
  label: string;
@@ -1 +1 @@
1
- "use client";import{jsx as s,Fragment as d,jsxs as a}from"react/jsx-runtime";import{Button as l,Tooltip as u}from"efficient-shell/ui";import{say as f}from"../../format/lib/editor-words.js";function g({status:n,statusText:o,onRefresh:c,busy:r=!1,edit:e,hint:i,spaced:t=!0,compact:m=!1}){return m?s("div",{className:"sf-blogsource sf-blogsource--compact",style:t?{marginTop:8}:void 0,children:s(u,{content:i,children:a("p",{className:"sf-blogsource-status","data-state":n,children:[o," · ",s(l,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:c,disabled:r,children:f("Refresh now")}),e?a(d,{children:[" · ",s(l,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:e.onClick,children:e.label})]}):null]})})}):a("div",{className:"sf-blogsource",style:t?{marginTop:9}:void 0,children:[s("p",{className:"sf-blogsource-status","data-state":n,children:o}),s(l,{variant:"secondary",className:"sf-blogsource-action",onClick:c,disabled:r,children:f("Refresh now")}),e?s(l,{variant:"secondary",className:"sf-blogsource-action",onClick:e.onClick,children:e.label}):null,s("p",{className:"es-field-hint sf-hint-keep",children:i})]})}export{g as default};
1
+ "use client";import{jsx as l,jsxs as d}from"react/jsx-runtime";import{Fragment as b}from"react";import{Button as a,Tooltip as g}from"efficient-shell/ui";import{say as f}from"../../format/lib/editor-words.js";function h({status:o,statusText:n,onRefresh:e,busy:r=!1,edit:s,hint:c,spaced:i=!0,compact:u=!1}){return u?l("div",{className:"sf-blogsource sf-blogsource--compact",style:i?{marginTop:8}:void 0,children:l(g,{content:c,children:l("p",{className:"sf-blogsource-status","data-state":o,children:[n?l(b,{children:n},"status"):null,e?l(a,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:e,disabled:r,children:f("Refresh now")},"refresh"):null,s?l(a,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:s.onClick,children:s.label},"edit"):null].filter(Boolean).flatMap((t,m)=>m?[" · ",t]:[t])})})}):d("div",{className:"sf-blogsource",style:i?{marginTop:9}:void 0,children:[l("p",{className:"sf-blogsource-status","data-state":o,children:n}),e?l(a,{variant:"secondary",className:"sf-blogsource-action",onClick:e,disabled:r,children:f("Refresh now")}):null,s?l(a,{variant:"secondary",className:"sf-blogsource-action",onClick:s.onClick,children:s.label}):null,l("p",{className:"es-field-hint sf-hint-keep",children:c})]})}export{h as default};
@@ -1 +1 @@
1
- "use client";import{jsx as s,jsxs as pt}from"react/jsx-runtime";import{useCallback as n,useEffect as S,useMemo as ce,useRef as f,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as St}from"../lib/document/build-config.js";import{ChromeWrap as ft}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as gt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as wt}from"../lib/site-live-state.js";import{holdSiteWrites as Ct}from"../../format/lib/site-writes.js";import{backendOf as k,blocksOf as _t}from"../lib/website-session.js";import{useEaselSession as Tt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Et}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Pt}from"../../format/lib/document/templateFields.js";import{setEditorPage as se}from"../../format/lib/document/editor-page-context.js";import{resolveSiteName as yt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Gt,normalizeSiteGutterPhone as vt,normalizeSiteWidth as kt}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as de}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as ue}from"../../format/lib/content/container-gap.js";import Ht,{DocumentScreen as Wt}from"efficient-easel/screen/components/ScreenMount";import{useScreenDocument as Bt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Rt,siteThemeRow as Ft,themeEdited as It,themeSeeded as Dt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Mt}from"./PreviewFooterContext.js";import{PreviewChatProvider as bt,DEFAULT_CHAT_PREVIEW as xt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Nt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Ot}from"./useSocialSettings.js";import{PreviewSurfaceProvider as zt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as At}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Lt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Yt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Ut}from"efficient-easel/draw/client";import{CanvasPartsBridge as jt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as Kt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Vt}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as Xt,DEFAULT_HEADING_COMPRESSION as Zt,DEFAULT_HEADING_TYPOGRAPHY as qt,DEFAULT_SWITCH_SHOWN as H,DEFAULT_SIZES as Jt,DEFAULT_THEME_MODE as _,normalizeCornerRadius as Qt,normalizeCornerStyle as $t,normalizeCardShadow as er,normalizeCardGap as tr,normalizeHoverEffect as rr,normalizeShadowColor as or,IDENTITY_CARD_GAP as he,IDENTITY_CARD_SHADOW as nr,IDENTITY_HOVER_EFFECT as ar,THEME_MODE_KEY as le,THEME_STORAGE_KEY as ir,THEME_SWITCH_HIDE as me,THEME_SWITCH_KEY as W}from"../../format/lib/theme.js";import{DEFAULT_FONTS as cr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as dr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as ur}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as hr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as lr}from"./PreviewChatContext.js";const mr=()=>{if(typeof window>"u")return _;try{const c=window.localStorage.getItem(le);return c==="light"||c==="dark"||c==="auto"?c:_}catch{return _}},pe=c=>{if(!(typeof window>"u"))try{window.localStorage.setItem(le,c)}catch{}},pr=()=>{if(typeof window>"u")return H;try{return window.localStorage.getItem(W)!==me}catch{return H}},Sr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(ir)}catch{}},Se=c=>{if(!(typeof window>"u"))try{c?window.localStorage.removeItem(W):window.localStorage.setItem(W,me)}catch{}};function fr(){const{adapter:c,capabilities:d,templateId:B,ready:w,token:h,siteId:i,currentSlug:R,currentKind:F}=Bt();S(()=>(se(R,F),()=>se(null,null)),[R,F]);const T=d.placeholderFrames,[fe,I]=r(null),[ge,D]=r("");S(()=>{const e=c.templateName;if(!w||!B||!e){D("");return}let a=!1;return e().then(l=>!a&&D(l??"")).catch(()=>{}),()=>{a=!0}},[w,h,B,c]);const[we,E]=r(_),[Ce,P]=r(H),[M,b]=r({value:{selected:0,themes:[]},readFor:null}),_e=M.value,[Te,x]=r(cr),[Ee,N]=r(Jt),[Pe,O]=r(null),[ye,z]=r(Zt),[Ge,A]=r(null),[ve,L]=r(null),[ke,Y]=r(he),[He,U]=r(null),[We,j]=r(null),[Be,K]=r(null),[Re,V]=r(null),[y,X]=r(null),[G,Z]=r(null),u=Tt(),q=ce(()=>St(gt(u),_t(u)),[u]),Fe=ce(()=>Et(Pt(q,T),y,G),[q,T,y,G]),[Ie,J]=r(qt),[De,Q]=r(null),[Me,$]=r(null),[be,ee]=r(null),[xe,te]=r(null),[Ne,re]=r(null),oe=f(null),o=f(!1);S(()=>{E(mr()),P(pr())},[]);const Oe=n(e=>{o.current=!0,Sr(),pe(e),E(e)},[]),ze=n(e=>{o.current=!0,Se(e),P(e)},[]),Ae=n(e=>{o.current=!0,b(a=>It(a,e,i??""))},[i]),Le=n(e=>{o.current=!0,x(e)},[]),Ye=n(e=>{o.current=!0,N(e)},[]),Ue=n(e=>{o.current=!0,O(e)},[]),je=n(e=>{o.current=!0,z(e)},[]),Ke=n(e=>{o.current=!0,A(e)},[]),Ve=n(e=>{o.current=!0,L(e)},[]),Xe=n(e=>{o.current=!0,Y(e)},[]),Ze=n(e=>{o.current=!0,U(e)},[]),qe=n(e=>{o.current=!0,J(e)},[]),[Je,ne]=r(null),[Qe,$e]=r(null),et=n(e=>{o.current=!0,ne(e)},[]),tt=n(e=>{o.current=!0,j(e)},[]),rt=n(e=>{o.current=!0,K(e)},[]),ot=n(e=>{o.current=!0,V(e)},[]),nt=n(e=>{o.current=!0,X(e)},[]),at=n(e=>{o.current=!0,Z(e)},[]),it=n(e=>{o.current=!0,Q(e)},[]),ct=n(e=>{o.current=!0,$(e)},[]),st=n(e=>{o.current=!0,ee(e)},[]),dt=n(e=>{o.current=!0,te(e)},[]),ut=n(e=>{o.current=!0,re(e)},[]);S(()=>{const e=k(u).theme;if(!h||!d.hasSiteTheme||!e)return;const a=i??"";oe.current!==a&&(oe.current=a,o.current=!1);let l=!1;return e.get(i?{siteId:i}:void 0).then(t=>{if(l||o.current)return;pe(t.default_mode),Se(t.show_theme_switch),E(t.default_mode),P(t.show_theme_switch),b(Dt({selected:t.selected_preset,themes:t.theme_presets},a));const g=ur(t);x(g.fonts),N(g.sizes),O(t.corner_radius_px===void 0?Xt[$t(t.corner_style)]:Qt(t.corner_radius_px)),z(g.compression),A(t.card_shadow==null?nr:er(t.card_shadow)),Y(t.card_gap==null?he:tr(t.card_gap)),U(t.hover_effect==null?ar:rr(t.hover_effect)),L(or(t.shadow_color)),j(kt(t.site_width)),K(Gt(t.site_gutter)),V(vt(t.site_gutter_phone)),X(ue(t.block_gap)),Z(ue(t.block_gap_phone)),J(g.typography),ne(g.textStyles),$e(hr(t)),Q(t.hero_background_follows_width===!0),$(de(t.section_background_width)),ee(de(t.section_content_width)),te(t.photography_grayscale===!0),re(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,i,d.hasSiteTheme,u]);const ht=Ot({token:h,siteId:i,enabled:d.hasSiteSettings}),[lt,ae]=r(xt),ie=f(null),v=f(!1),m=f(null),p=f({}),C=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(u).chat?.update(e,i?{siteId:i}:void 0),wt()}catch(a){throw p.current={...e,...p.current},a}},[u,i]);S(()=>Ct(()=>m.current||Object.keys(p.current).length>0?C():void 0),[C]);const mt=n(e=>{v.current=!0,ae(a=>({...a,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,h,C]);return S(()=>{if(!h||!d.hasSiteSettings)return;const e=i??"";ie.current!==e&&(ie.current=e,v.current=!1);let a=!1;const l=k(u).chat;if(l)return l.get(i?{siteId:i}:void 0).then(t=>{a||v.current||ae(lr(t))}).catch(()=>{}),()=>{a=!0}},[h,i,d.hasSiteSettings,u]),S(()=>{const e=c.site;if(!w||!d.hasSiteRecord||!e){I(null);return}let a=!1;return e().then(l=>{a||I(yt(l.name))}).catch(()=>{}),()=>{a=!0}},[w,h,d.hasSiteRecord,i,c]),s(Wt,{config:Fe,parts:sr,wrap:(e,a)=>s(Rt,{websiteName:fe,templateChrome:T,templateName:ge||null,themeMode:we,onThemeModeChange:Oe,themeSwitchShown:Ce,onThemeSwitchShownChange:ze,theme:_e,themeRow:Ft(d.hasSiteTheme,M.readFor,i??""),onThemeChange:Ae,fonts:Te,onFontsChange:Le,cornerRadiusPx:Pe,onCornerRadiusPxChange:Ue,cardShadow:Ge,onCardShadowChange:Ke,shadowColor:ve,onShadowColorChange:Ve,cardGap:ke,onCardGapChange:Xe,hoverEffect:He,onHoverEffectChange:Ze,headingCompression:ye,onHeadingCompressionChange:je,headingTypography:Ie,onHeadingTypographyChange:qe,textStyles:Je,onTextStylesChange:et,wordStyles:Qe,sizes:Ee,onSizesChange:Ye,siteWidth:We,onSiteWidthChange:tt,siteGutter:Be,onSiteGutterChange:rt,siteGutterPhone:Re,onSiteGutterPhoneChange:ot,blockGap:y,onBlockGapChange:nt,blockGapPhone:G,onBlockGapPhoneChange:at,heroBackgroundFollowsWidth:De,onHeroBackgroundFollowsWidthChange:it,sectionBackgroundWidth:Me,onSectionBackgroundWidthChange:ct,sectionContentWidth:be,onSectionContentWidthChange:st,photographyGrayscale:xe,onPhotographyGrayscaleChange:dt,shareButtonOnPosts:Ne,onShareButtonOnPostsChange:ut,themeFromDocument:!d.hasSiteTheme,children:s(Mt,{children:s(ft,{wrap:u.chrome?.wrap,surface:"page",children:s(Lt,{children:s(Yt,{children:s(Ut,{children:s(Kt,{children:s(jt,{children:pt(Vt,{children:[s(bt,{chat:lt,onChatChange:mt,children:s(Nt,{value:ht,children:s(zt,{children:e})})}),a]})})})})})})})})})})}function gr({target:c}){return s(Ht,{target:c,addressing:At,onHostMessage:dr,children:s(fr,{})})}export{gr as default};
1
+ "use client";import{jsx as s,jsxs as pt}from"react/jsx-runtime";import{useCallback as n,useEffect as S,useMemo as ce,useRef as f,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as St}from"../lib/document/build-config.js";import{ChromeWrap as ft}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as gt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as wt}from"../lib/site-live-state.js";import{holdSiteWrites as Ct}from"../../format/lib/site-writes.js";import{backendOf as k,blocksOf as _t}from"../lib/website-session.js";import{useEaselSession as Tt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Et}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Pt}from"../../format/lib/document/templateFields.js";import{setEditorPage as se}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as yt}from"./EditorPagePathProvider.js";import{resolveSiteName as Gt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as vt,normalizeSiteGutterPhone as kt,normalizeSiteWidth as Ht}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as de}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as ue}from"../../format/lib/content/container-gap.js";import Wt,{DocumentScreen as Bt}from"efficient-easel/screen/components/ScreenMount";import{useScreenDocument as Rt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Ft,siteThemeRow as It,themeEdited as Dt,themeSeeded as Mt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as bt}from"./PreviewFooterContext.js";import{PreviewChatProvider as xt,DEFAULT_CHAT_PREVIEW as Nt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Ot}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as zt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as At}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Lt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Yt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Ut}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as jt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Kt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as Vt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Xt}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as Zt,DEFAULT_HEADING_COMPRESSION as qt,DEFAULT_HEADING_TYPOGRAPHY as Jt,DEFAULT_SWITCH_SHOWN as H,DEFAULT_SIZES as Qt,DEFAULT_THEME_MODE as _,normalizeCornerRadius as $t,normalizeCornerStyle as er,normalizeCardShadow as tr,normalizeCardGap as rr,normalizeHoverEffect as or,normalizeShadowColor as nr,IDENTITY_CARD_GAP as he,IDENTITY_CARD_SHADOW as ar,IDENTITY_HOVER_EFFECT as ir,THEME_MODE_KEY as le,THEME_STORAGE_KEY as cr,THEME_SWITCH_HIDE as me,THEME_SWITCH_KEY as W}from"../../format/lib/theme.js";import{DEFAULT_FONTS as sr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as dr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as ur}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as hr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as lr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as mr}from"./PreviewChatContext.js";const pr=()=>{if(typeof window>"u")return _;try{const c=window.localStorage.getItem(le);return c==="light"||c==="dark"||c==="auto"?c:_}catch{return _}},pe=c=>{if(!(typeof window>"u"))try{window.localStorage.setItem(le,c)}catch{}},Sr=()=>{if(typeof window>"u")return H;try{return window.localStorage.getItem(W)!==me}catch{return H}},fr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(cr)}catch{}},Se=c=>{if(!(typeof window>"u"))try{c?window.localStorage.removeItem(W):window.localStorage.setItem(W,me)}catch{}};function gr(){const{adapter:c,capabilities:d,templateId:B,ready:w,token:h,siteId:i,currentSlug:R,currentKind:F}=Rt();S(()=>(se(R,F),()=>se(null,null)),[R,F]);const T=d.placeholderFrames,[fe,I]=r(null),[ge,D]=r("");S(()=>{const e=c.templateName;if(!w||!B||!e){D("");return}let a=!1;return e().then(l=>!a&&D(l??"")).catch(()=>{}),()=>{a=!0}},[w,h,B,c]);const[we,E]=r(_),[Ce,P]=r(H),[M,b]=r({value:{selected:0,themes:[]},readFor:null}),_e=M.value,[Te,x]=r(sr),[Ee,N]=r(Qt),[Pe,O]=r(null),[ye,z]=r(qt),[Ge,A]=r(null),[ve,L]=r(null),[ke,Y]=r(he),[He,U]=r(null),[We,j]=r(null),[Be,K]=r(null),[Re,V]=r(null),[y,X]=r(null),[G,Z]=r(null),u=Tt(),q=ce(()=>St(gt(u),_t(u)),[u]),Fe=ce(()=>Et(Pt(q,T),y,G),[q,T,y,G]),[Ie,J]=r(Jt),[De,Q]=r(null),[Me,$]=r(null),[be,ee]=r(null),[xe,te]=r(null),[Ne,re]=r(null),oe=f(null),o=f(!1);S(()=>{E(pr()),P(Sr())},[]);const Oe=n(e=>{o.current=!0,fr(),pe(e),E(e)},[]),ze=n(e=>{o.current=!0,Se(e),P(e)},[]),Ae=n(e=>{o.current=!0,b(a=>Dt(a,e,i??""))},[i]),Le=n(e=>{o.current=!0,x(e)},[]),Ye=n(e=>{o.current=!0,N(e)},[]),Ue=n(e=>{o.current=!0,O(e)},[]),je=n(e=>{o.current=!0,z(e)},[]),Ke=n(e=>{o.current=!0,A(e)},[]),Ve=n(e=>{o.current=!0,L(e)},[]),Xe=n(e=>{o.current=!0,Y(e)},[]),Ze=n(e=>{o.current=!0,U(e)},[]),qe=n(e=>{o.current=!0,J(e)},[]),[Je,ne]=r(null),[Qe,$e]=r(null),et=n(e=>{o.current=!0,ne(e)},[]),tt=n(e=>{o.current=!0,j(e)},[]),rt=n(e=>{o.current=!0,K(e)},[]),ot=n(e=>{o.current=!0,V(e)},[]),nt=n(e=>{o.current=!0,X(e)},[]),at=n(e=>{o.current=!0,Z(e)},[]),it=n(e=>{o.current=!0,Q(e)},[]),ct=n(e=>{o.current=!0,$(e)},[]),st=n(e=>{o.current=!0,ee(e)},[]),dt=n(e=>{o.current=!0,te(e)},[]),ut=n(e=>{o.current=!0,re(e)},[]);S(()=>{const e=k(u).theme;if(!h||!d.hasSiteTheme||!e)return;const a=i??"";oe.current!==a&&(oe.current=a,o.current=!1);let l=!1;return e.get(i?{siteId:i}:void 0).then(t=>{if(l||o.current)return;pe(t.default_mode),Se(t.show_theme_switch),E(t.default_mode),P(t.show_theme_switch),b(Mt({selected:t.selected_preset,themes:t.theme_presets},a));const g=hr(t);x(g.fonts),N(g.sizes),O(t.corner_radius_px===void 0?Zt[er(t.corner_style)]:$t(t.corner_radius_px)),z(g.compression),A(t.card_shadow==null?ar:tr(t.card_shadow)),Y(t.card_gap==null?he:rr(t.card_gap)),U(t.hover_effect==null?ir:or(t.hover_effect)),L(nr(t.shadow_color)),j(Ht(t.site_width)),K(vt(t.site_gutter)),V(kt(t.site_gutter_phone)),X(ue(t.block_gap)),Z(ue(t.block_gap_phone)),J(g.typography),ne(g.textStyles),$e(lr(t)),Q(t.hero_background_follows_width===!0),$(de(t.section_background_width)),ee(de(t.section_content_width)),te(t.photography_grayscale===!0),re(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,i,d.hasSiteTheme,u]);const ht=zt({token:h,siteId:i,enabled:d.hasSiteSettings}),[lt,ae]=r(Nt),ie=f(null),v=f(!1),m=f(null),p=f({}),C=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(u).chat?.update(e,i?{siteId:i}:void 0),wt()}catch(a){throw p.current={...e,...p.current},a}},[u,i]);S(()=>Ct(()=>m.current||Object.keys(p.current).length>0?C():void 0),[C]);const mt=n(e=>{v.current=!0,ae(a=>({...a,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,h,C]);return S(()=>{if(!h||!d.hasSiteSettings)return;const e=i??"";ie.current!==e&&(ie.current=e,v.current=!1);let a=!1;const l=k(u).chat;if(l)return l.get(i?{siteId:i}:void 0).then(t=>{a||v.current||ae(mr(t))}).catch(()=>{}),()=>{a=!0}},[h,i,d.hasSiteSettings,u]),S(()=>{const e=c.site;if(!w||!d.hasSiteRecord||!e){I(null);return}let a=!1;return e().then(l=>{a||I(Gt(l.name))}).catch(()=>{}),()=>{a=!0}},[w,h,d.hasSiteRecord,i,c]),s(Bt,{config:Fe,parts:dr,wrap:(e,a)=>s(Ft,{websiteName:fe,templateChrome:T,templateName:ge||null,themeMode:we,onThemeModeChange:Oe,themeSwitchShown:Ce,onThemeSwitchShownChange:ze,theme:_e,themeRow:It(d.hasSiteTheme,M.readFor,i??""),onThemeChange:Ae,fonts:Te,onFontsChange:Le,cornerRadiusPx:Pe,onCornerRadiusPxChange:Ue,cardShadow:Ge,onCardShadowChange:Ke,shadowColor:ve,onShadowColorChange:Ve,cardGap:ke,onCardGapChange:Xe,hoverEffect:He,onHoverEffectChange:Ze,headingCompression:ye,onHeadingCompressionChange:je,headingTypography:Ie,onHeadingTypographyChange:qe,textStyles:Je,onTextStylesChange:et,wordStyles:Qe,sizes:Ee,onSizesChange:Ye,siteWidth:We,onSiteWidthChange:tt,siteGutter:Be,onSiteGutterChange:rt,siteGutterPhone:Re,onSiteGutterPhoneChange:ot,blockGap:y,onBlockGapChange:nt,blockGapPhone:G,onBlockGapPhoneChange:at,heroBackgroundFollowsWidth:De,onHeroBackgroundFollowsWidthChange:it,sectionBackgroundWidth:Me,onSectionBackgroundWidthChange:ct,sectionContentWidth:be,onSectionContentWidthChange:st,photographyGrayscale:xe,onPhotographyGrayscaleChange:dt,shareButtonOnPosts:Ne,onShareButtonOnPostsChange:ut,themeFromDocument:!d.hasSiteTheme,children:s(bt,{children:s(ft,{wrap:u.chrome?.wrap,surface:"page",children:s(Yt,{children:s(Ut,{children:s(jt,{children:s(Vt,{children:s(Kt,{children:pt(Xt,{children:[s(xt,{chat:lt,onChatChange:mt,children:s(Ot,{value:ht,children:s(At,{children:s(yt,{children:e})})})}),a]})})})})})})})})})})}function wr({target:c}){return s(Wt,{target:c,addressing:Lt,onHostMessage:ur,children:s(gr,{})})}export{wr as default};
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as B,jsxs as k}from"react/jsx-runtime";import{useCallback as R,useEffect as g,useRef as $,useState as y}from"react";import{SettingsSwitch as ee}from"efficient-easel/panel";import{PagesIcon as te,StylesIcon as oe}from"efficient-easel/rail";import{PaletteIcon as re}from"efficient-shell/icons/efficient";import{Subtree as ne,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ie}from"./LocationsTreeContext.js";import se from"./PagesPanel.js";import{usePreviewChat as ae}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as ce}from"./preview-devices.js";import{PreviewDeviceContext as de}from"efficient-easel/draw/client";import{usePreviewSocial as le}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as me,usePreviewTicker as fe}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as ue}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as Se}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ee,HERO_PART_MODE as W,heroMediaRows as Pe,heroPartId as M,readHeroPartId as Te}from"../../render/lib/document/hero-media-parts.js";import he,{CHAT_MODE as we,HEADER_MODE as ge,SOCIAL_MODE as Ie,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as be}from"./SectionEditor.js";import C from"./SectionIcon.js";import ve from"./SectionThumbnail.js";import{useScreenDocument as O}from"efficient-easel/screen/components/ScreenDocumentContext";import _e from"./StylesPanel.js";import{LOCATIONS_TYPE as ke,useLocationsTree as Re}from"./useLocationsTree.js";import{usePinnedChromeSeed as Ce}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Oe}from"./useHostDocumentBridge.js";import{usePreviewHref as Le}from"./usePreviewHref.js";import{WebsitePreviewButton as Ae}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Be,SITE_STYLES_TABS as ye,SITE_STYLES_TEXT_TAB as De,useWebsiteName as Ne}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as He}from"./useWebsiteMainAction.js";import{VersionHistory as We}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Me}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ve,heroGroupNestDepth as xe}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ge}from"../../format/lib/markup.js";import{categoryShortLabel as Ye,PINNED_SECTION_TYPE as Fe}from"../lib/document/add-palette.js";import{canAddTo as Ke}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as je}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as ze}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as Ue,setBookingPreview as Ze}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as qe}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as Xe}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as Je,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as Qe,readLeftView as $e,resolveLeftView as et,writeLeftView as tt}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as ot}from"../lib/document/locked-blocks.js";import{everyPageNotice as rt,noOwnTab as nt,pinnedReach as Y,websiteDuplicateBlocked as it}from"../lib/document/every-page.js";import{sharedSectionReach as st,WEBSITE_SHARED_SECTIONS as at}from"../lib/shared-sections-layer.js";import{activeSharedSections as L,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as ct}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as dt,scrollPreviewToTop as K}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as lt}from"../lib/document/overrides.js";import{labelAtLevel as pt}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as mt}from"../../format/lib/document/media-drop.js";import{editorWords as ft,say as S}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ut}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as St,isSectionGroupType as Et,sectionGroupZone as Pt,SITE_FOOTER_TYPE as j,SITE_HEADER_TYPE as Tt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as ht}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as wt,SAVE_AS_TEMPLATE_EVENT as gt}from"../../format/lib/save-as-template-action.js";import{cityPalettePresets as It}from"../lib/sections/city-presets.js";import{newSectionNode as bt}from"../lib/sections/new-section-node.js";import{useHostProducts as vt}from"../lib/use-host-products.js";import{backendOf as _t}from"../lib/website-session.js";function z({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=fe(),c=H().tree,l=e,n=l.kind==="ticker"?l.heroId:null,s=R(i=>{if(!i)return;t({kind:"ticker",heroId:i}),dt(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const f=String(i.props.id);return i.type==="Hero"&&ue(i.props)&&a(D,{icon:a(C,{type:"ticker",size:13}),name:S(me),onSelect:()=>s(f),selected:n===f,rowProps:{onClick:m(()=>s(f))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Se(),c=H().tree,{appState:l}=N(p=>p),n=l.data.content??[],s=$(n);s.current=n;const i=e,m=Ee.find(p=>W[p]===i.kind),f=m&&"nodeId"in i?M(String(i.nodeId),m):null,E=R(p=>{const d=Te(p);if(!d)return;const P=s.current.findIndex(h=>String(h.props.id)===d.nodeId);if(P<0)return;const T={kind:W[d.part],nodeId:d.nodeId};t({index:P},T)},[t]);return g(()=>{o(f)},[f,o]),g(()=>{r(E)},[r,E]),{partRows:(p,{rowClick:d})=>{const P=String(p.props.id),T=Pe(p);if(T.length===0)return null;const h=u=>{const w=M(P,u.part);return a(D,{icon:a(C,{type:u.part==="media"?"heroMedia":"heroImage",size:13}),name:S(u.label),onSelect:()=>E(w),selected:f===w,rowProps:{onClick:d(()=>E(w))},words:c},w)},[b,...I]=T;return k(B,{children:[h(b),I.length>0&&a(ne,{children:I.map(h)})]})}}}function Z(e,t){return{partRows:(o,r)=>k(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function kt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:l,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=O(),{hasPreviewLink:f}=o,E=_t(x()).preview?.draftLink,p=He(e.data),d=wt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),P=R(()=>{!c||!r||i(gt,{siteId:c,slug:r})},[i,c,r]),T=Le({pageSlug:r,siteId:c,token:m}),h=t.previewHref?.(r)??T;return{barLead:()=>d.visible&&a(ht,{enabled:d.enabled,reason:d.enabled?"":d.disabledReason,onSaved:P}),barView:()=>f&&r&&a(Ae,{liveHref:h,pageId:l??null,draftLink:E}),mainAction:p}}function Rt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:l,navigate:n}=O(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=u=>t.setView(u),[f,E]=y(ye[0].id),[p,d]=y(!1),{surface:P,setSurface:T}=pe(),h=()=>{if(s){m("styles"),t.reveal(),K();return}e.show(V),e.reveal(),K()},b={id:"pages",label:S("Pages"),icon:a(te,{}),panel:({onHide:u})=>a(se,{activeSurface:P,onPreviewSurface:T,onNavigate:w=>{T(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:u})},I=[];return!s&&i&&I.push({id:"appearance",label:S("Appearance"),icon:a(re,{}),active:e.kind==="website",onSelect:h}),s&&I.push({id:"styles",label:S("Styles"),icon:a(oe,{}),panel:({onHide:u,notify:w})=>a(_e,{tokenRef:l,siteId:c??void 0,onClose:u,onNotify:w,tab:f,onTabChange:E,revealPageGroup:p,onPageGroupRevealed:()=>d(!1)})}),{railLead:[b],railTrail:I,resolveLeftView:u=>et(u,s),openSettings:h,openStyles:()=>{E(De),m("styles")},openPageStyles:s?()=>{E(Be),d(!0),m("styles"),t.reveal()}:i?()=>{e.show(be),e.reveal()}:void 0}}function Ct(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=O(),c=N(n=>n.config),l=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=L();if(!n||!r)return;let s=!1;return ct(l).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,l])}function Ot(e,t,o,r){const{kind:c,open:l}=e,{selected:n,zoneOf:s}=t;g(()=>{Ze(n?.type==="BookingBox"&&n.props.region==="confirm"?Ue(s(String(n.props.id))):null)},[n?.props.id]);const i=Re(e,t),{capabilities:{hasSiteSettings:m}}=O();Ct();const{chat:f,setChat:E,setSelected:p,setSelectHandler:d}=ae(),P=R(()=>l(we),[l]),T=c==="chat";g(()=>{p(T)},[T,p]),g(()=>{d(P)},[d,P]);const{setOpenHandler:h}=le(),b=R(()=>l(Ie),[l]);g(()=>{h(b)},[h,b]);const I=Z(z(e),U(e)),u=kt(t),w=Rt(e,r),J=o.device;return{...I,...u,...w,hasOwnRows:_=>_.type===ke,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:_=>a(ie.Provider,{value:!0,children:k(de.Provider,{value:J,children:[_,a(We,{})]})}),addPanelRow:_=>m?k("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(C,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{_(),P()},children:[S("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:S("A chat bubble on every page")})]}),a(ee,{checked:f.enabled,onChange:Q=>E({enabled:Q}),ariaLabel:S("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function Lt(e){const t=ft();if(!e||!t)return e;q!==t&&(q=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:S(r.label)})):null,spec:e.spec?{...e.spec,addLabel:S(e.spec.addLabel)}:null},A.set(e,o)),o}const At={isLockedBlock:(e,t)=>ot(e,t)||!!(t&&L()?.heldElsewhere(t.props.id)),duplicateBlocked:it,nestDepth:(e,t,o)=>t===Ve?xe(e,o):0,newSectionNode:bt,canAddTo:(e,t,o,r)=>Lt(Ke(e,t,r,o)),blockIsOffered:ze,slotsOf:je},Bt=new Proxy(ut,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?S(o):o}}),yt={labelAtLevel:(e,t,o)=>S(pt(e,t,o)),descriptions:Bt,categoryLabel:e=>{const t=Ye(e);return t===void 0?void 0:S(t)},firstSection:Fe,blockRowName:qe,rowName:Xe,plainText:Ge,Icon:C,Thumbnail:ve,useProducts:vt,presets:It()},Dt={desktop:2e3,tablet:800,mobile:390},X="desktop",Nt={options:ce,initial:X,fluid:X,widths:Dt},Ht={read:$e,write:e=>tt(e),forSelection:(e,t)=>Qe(e,t)},Wt={first:G,last:Je,firstGroup:Tt,lastGroup:j,isSectionGroup:Et,sectionGroupZone:Pt,panelOf:e=>e===G?ge:null,get sharedReach(){return v()?Vt:void 0},get shared(){return L()?at:void 0},get groupTab(){return v()?nt:void 0},get groupBadge(){return v()?Y({type:j})??void 0:void 0},get changeNotice(){return v()?rt():void 0},get band(){return v()?Mt:void 0},get groupAccepts(){return v()?St:void 0}},Mt={foldable:!0},Vt=e=>Y(e)??st(e);function xt(e){return{...Z(z(e),U(e)),openSettings:()=>e.show(V)}}function Gt(e,t){Ce(e,t),Oe()}const $o={useOwnerName:Ne,useDocumentLabel:Me,useBridges:Ot,useStandaloneBridges:xt,useDocumentPass:Gt,blockRules:At,blockLook:yt,devices:Nt,leftView:Ht,pinned:Wt,Canvas:lt,canvasDrag:{media:mt},Inspector:he};export{$o as WEBSITE_SCREEN};
1
+ "use client";import{jsx as a,Fragment as B,jsxs as k}from"react/jsx-runtime";import{useCallback as R,useEffect as g,useRef as $,useState as y}from"react";import{SettingsSwitch as ee}from"efficient-easel/panel";import{PagesIcon as te,StylesIcon as oe}from"efficient-easel/rail";import{PaletteIcon as re}from"efficient-shell/icons/efficient";import{Subtree as ne,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ie}from"./LocationsTreeContext.js";import se from"./PagesPanel.js";import{usePreviewChat as ae}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as ce}from"./preview-devices.js";import{PreviewDeviceContext as de}from"efficient-easel/draw/client";import{usePreviewSocial as le}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as me,usePreviewTicker as fe}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as ue}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as Se}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ee,HERO_PART_MODE as W,heroMediaRows as he,heroPartId as M,readHeroPartId as Pe}from"../../render/lib/document/hero-media-parts.js";import Te,{CHAT_MODE as we,HEADER_MODE as ge,SOCIAL_MODE as be,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as Ie}from"./SectionEditor.js";import L from"./SectionIcon.js";import ve from"./SectionThumbnail.js";import{useScreenDocument as C}from"efficient-easel/screen/components/ScreenDocumentContext";import _e from"./StylesPanel.js";import{LOCATIONS_TYPE as ke,useLocationsTree as Re}from"./useLocationsTree.js";import{usePinnedChromeSeed as Le}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ce}from"./useHostDocumentBridge.js";import{usePreviewHref as Oe}from"./usePreviewHref.js";import{WebsitePreviewButton as Ae}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Be,SITE_STYLES_TABS as ye,SITE_STYLES_TEXT_TAB as De,useWebsiteName as Ne}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as He}from"./useWebsiteMainAction.js";import{VersionHistory as We}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Me}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ve,heroGroupNestDepth as xe}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ge}from"../../format/lib/markup.js";import{categoryShortLabel as Ye,PINNED_SECTION_TYPE as Fe}from"../lib/document/add-palette.js";import{canAddTo as Ke}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as je}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as ze}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as Ue,setBookingPreview as Ze}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as qe}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as Xe}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as Je,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as Qe,readLeftView as $e,resolveLeftView as et,writeLeftView as tt}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as ot}from"../lib/document/locked-blocks.js";import{everyPageNotice as rt,noOwnTab as nt,pinnedReach as Y,websiteDuplicateBlocked as it}from"../lib/document/every-page.js";import{sharedSectionReach as st,WEBSITE_SHARED_SECTIONS as at}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as ct}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as dt,scrollPreviewToTop as K}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as lt}from"../lib/document/overrides.js";import{labelAtLevel as pt}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as mt}from"../../format/lib/document/media-drop.js";import{editorWords as ft,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ut}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as St,isSectionGroupType as Et,sectionGroupZone as ht,SITE_FOOTER_TYPE as j,SITE_HEADER_TYPE as Pt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as Tt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as wt,SAVE_AS_TEMPLATE_EVENT as gt}from"../../format/lib/save-as-template-action.js";import{cityPalettePresets as bt}from"../lib/sections/city-presets.js";import{newSectionNode as It}from"../lib/sections/new-section-node.js";import{useHostProducts as vt}from"../lib/use-host-products.js";import{backendOf as _t}from"../lib/website-session.js";function z({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=fe(),c=H().tree,l=e,n=l.kind==="ticker"?l.heroId:null,s=R(i=>{if(!i)return;t({kind:"ticker",heroId:i}),dt(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const u=String(i.props.id);return i.type==="Hero"&&ue(i.props)&&a(D,{icon:a(L,{type:"ticker",size:13}),name:f(me),onSelect:()=>s(u),selected:n===u,rowProps:{onClick:m(()=>s(u))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Se(),c=H().tree,{appState:l}=N(p=>p),n=l.data.content??[],s=$(n);s.current=n;const i=e,m=Ee.find(p=>W[p]===i.kind),u=m&&"nodeId"in i?M(String(i.nodeId),m):null,E=R(p=>{const d=Pe(p);if(!d)return;const h=s.current.findIndex(T=>String(T.props.id)===d.nodeId);if(h<0)return;const P={kind:W[d.part],nodeId:d.nodeId};t({index:h},P)},[t]);return g(()=>{o(u)},[u,o]),g(()=>{r(E)},[r,E]),{partRows:(p,{rowClick:d})=>{const h=String(p.props.id),P=he(p);if(P.length===0)return null;const T=S=>{const w=M(h,S.part);return a(D,{icon:a(L,{type:S.part==="media"?"heroMedia":"heroImage",size:13}),name:f(S.label),onSelect:()=>E(w),selected:u===w,rowProps:{onClick:d(()=>E(w))},words:c},w)},[I,...b]=P;return k(B,{children:[T(I),b.length>0&&a(ne,{children:b.map(T)})]})}}}function Z(e,t){return{partRows:(o,r)=>k(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function kt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:l,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=C(),{hasPreviewLink:u}=o,E=_t(x()).preview?.draftLink,p=He(e.data),d=wt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),h=R(()=>{!c||!r||i(gt,{siteId:c,slug:r})},[i,c,r]),P=Oe({pageSlug:r,siteId:c,token:m}),T=t.previewHref?.(r)??P;return{barLead:()=>d.visible&&a(Tt,{enabled:d.enabled,reason:d.enabled?"":d.disabledReason,onSaved:h}),barView:()=>u&&r&&a(Ae,{liveHref:T,pageId:l??null,draftLink:E}),mainAction:p}}function Rt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:l,navigate:n}=C(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=S=>t.setView(S),[u,E]=y(ye[0].id),[p,d]=y(!1),{surface:h,setSurface:P}=pe(),T=()=>{if(s){m("styles"),t.reveal(),K();return}e.show(V),e.reveal(),K()},I={id:"pages",label:f("Pages"),icon:a(te,{}),panel:({onHide:S})=>a(se,{activeSurface:h,onPreviewSurface:P,onNavigate:w=>{P(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:S})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(re,{}),active:e.kind==="website",onSelect:T}),s&&b.push({id:"styles",label:f("Styles"),icon:a(oe,{}),panel:({onHide:S,notify:w})=>a(_e,{tokenRef:l,siteId:c??void 0,onClose:S,onNotify:w,tab:u,onTabChange:E,revealPageGroup:p,onPageGroupRevealed:()=>d(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:S=>et(S,s),openSettings:T,openStyles:()=>{E(De),m("styles")},openPageStyles:s?()=>{E(Be),d(!0),m("styles"),t.reveal()}:i?()=>{e.show(Ie),e.reveal()}:void 0}}function Lt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=C(),c=N(n=>n.config),l=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 ct(l).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,l])}function Ct(e,t,o,r){const{kind:c,open:l}=e,{selected:n,zoneOf:s}=t;g(()=>{Ze(n?.type==="BookingBox"&&n.props.region==="confirm"?Ue(s(String(n.props.id))):null)},[n?.props.id]);const i=Re(e,t),{capabilities:{hasSiteSettings:m}}=C();Lt();const{chat:u,setChat:E,setSelected:p,setSelectHandler:d}=ae(),h=R(()=>l(we),[l]),P=c==="chat";g(()=>{p(P)},[P,p]),g(()=>{d(h)},[d,h]);const{setOpenHandler:T}=le(),I=R(()=>l(be),[l]);g(()=>{T(I)},[T,I]);const b=Z(z(e),U(e)),S=kt(t),w=Rt(e,r),J=o.device;return{...b,...S,...w,hasOwnRows:_=>_.type===ke,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:_=>a(ie.Provider,{value:!0,children:k(de.Provider,{value:J,children:[_,a(We,{})]})}),addPanelRow:_=>m?k("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(L,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{_(),h()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(ee,{checked:u.enabled,onChange:Q=>E({enabled:Q}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function Ot(e){const t=ft();if(!e||!t)return e;q!==t&&(q=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 At={isLockedBlock:(e,t)=>ot(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:it,nestDepth:(e,t,o)=>t===Ve?xe(e,o):0,newSectionNode:It,canAddTo:(e,t,o,r)=>Ot(Ke(e,t,r,o)),blockIsOffered:ze,slotsOf:je},Bt=new Proxy(ut,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),yt={labelAtLevel:(e,t,o)=>f(pt(e,t,o)),descriptions:Bt,categoryLabel:e=>{const t=Ye(e);return t===void 0?void 0:f(t)},firstSection:Fe,blockRowName:qe,rowName:Xe,plainText:Ge,Icon:L,Thumbnail:ve,useProducts:vt,presets:bt()},Dt={desktop:2e3,tablet:800,mobile:390},X="desktop",Nt={options:ce,initial:X,fluid:X,widths:Dt},Ht={read:$e,write:e=>tt(e),forSelection:(e,t)=>Qe(e,t)},Wt={first:G,last:Je,firstGroup:Pt,lastGroup:j,isSectionGroup:Et,sectionGroupZone:ht,panelOf:e=>e===G?ge:null,get sharedReach(){return v()?Vt:void 0},get shared(){return O()?at:void 0},get groupTab(){return v()?nt:void 0},get groupBadge(){return v()?Y({type:j})??void 0:void 0},get changeNotice(){return v()?rt():void 0},get band(){return v()?Mt:void 0},get groupAccepts(){return v()?St:void 0}},Mt={foldable:!0},Vt=e=>Y(e)??st(e);function xt(e){return{...Z(z(e),U(e)),openSettings:()=>e.show(V)}}function Gt(e,t){Le(e,t),Ce()}const $o={useOwnerName:Ne,useDocumentLabel:Me,useBridges:Ct,useStandaloneBridges:xt,useDocumentPass:Gt,blockRules:At,blockLook:yt,devices:Nt,leftView:Ht,pinned:Wt,Canvas:lt,canvasDrag:{media:mt},Inspector:Te};export{$o as WEBSITE_SCREEN};
@@ -1 +1 @@
1
- import{cardTemplateBlocks as i,cardTemplateOwner as f,cardTemplatesNameBlocks as u}from"../../../format/lib/content/card-template.js";import{blockOfferOf as p}from"./block-offer.js";import{containerBlocksFor as h}from"../../../format/lib/document/container-blocks.js";import{blockChoicesFor as m,FOOTER_BLOCKS_SLOT as a}from"./footer-blocks.js";import{SLOT_SECTION_EXTRA_SPECS as d,SLOT_SECTION_SPECS as O}from"../../../render/lib/document/slot-specs.js";function w(o,n=0,r,c){const e=S(C(o,n,c),r),t=e?p():null;return e&&t?T(e,t):e}function T(o,n){if(o.spec)return n.offers(o.spec.childType)?o:null;const r=o.choices??[],c=r.filter(e=>n.offers(e.type));return c.length===r.length?o:c.length>0?{...o,choices:c}:null}function S(o,n){if(!o||o.source!=="container"||!n||!u())return o;const r=f({data:n.data},n.id),c=typeof r?.type=="string"?i(r.type):[],e=o.choices??[],t=c.filter(s=>!e.some(l=>l.type===s.type));return t.length?{...o,choices:[...e,...t.map(s=>({type:s.type,label:s.label}))]}:o}function C(o,n,r){const c=r?d[o]?.[r]:void 0;if(c)return{source:"section",slot:c.slot,choices:null,spec:c};const e=O[o];if(e)return{source:"section",slot:e.slot,choices:null,spec:e};const t=h(o,n);if(t)return{source:"container",slot:t.slot,choices:t.choices,spec:null};const s=m(o);return s?{source:"footer",slot:a,choices:s,spec:null}:null}export{w as canAddTo};
1
+ import{cardTemplateBlocks as i,cardTemplateOwner as f,cardTemplatesNameBlocks as u}from"../../../format/lib/content/card-template.js";import{blockOfferOf as p}from"./block-offer.js";import{containerBlocksFor as m}from"../../../format/lib/document/container-blocks.js";import{blockChoicesFor as h,FOOTER_BLOCKS_SLOT as a}from"./footer-blocks.js";import{EDITOR_SLOT_EXTRA_SPECS as d}from"./slot-new-children.js";import{SLOT_SECTION_SPECS as O}from"../../../render/lib/document/slot-specs.js";function L(o,r=0,n,c){const e=S(y(o,r,c),n),t=e?p():null;return e&&t?T(e,t):e}function T(o,r){if(o.spec)return r.offers(o.spec.childType)?o:null;const n=o.choices??[],c=n.filter(e=>r.offers(e.type));return c.length===n.length?o:c.length>0?{...o,choices:c}:null}function S(o,r){if(!o||o.source!=="container"||!r||!u())return o;const n=f({data:r.data},r.id),c=typeof n?.type=="string"?i(n.type):[],e=o.choices??[],t=c.filter(s=>!e.some(l=>l.type===s.type));return t.length?{...o,choices:[...e,...t.map(s=>({type:s.type,label:s.label}))]}:o}function y(o,r,n){const c=n?d[o]?.[n]:void 0;if(c)return{source:"section",slot:c.slot,choices:null,spec:c};const e=O[o];if(e)return{source:"section",slot:e.slot,choices:null,spec:e};const t=m(o,r);if(t)return{source:"container",slot:t.slot,choices:t.choices,spec:null};const s=h(o);return s?{source:"footer",slot:a,choices:s,spec:null}:null}export{L as canAddTo};
@@ -1,6 +1,12 @@
1
+ import type { ReactElement } from "react";
1
2
  import { type SelectField } from "efficient-easel/screen/lib/document/box-fields";
2
3
  import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
3
4
  export declare function blockSourceField(label: string, own: string): SelectField;
5
+ export declare const BLOCK_SOURCE_EDIT_PROP = "_sourceEdit";
6
+ export declare function blockSourceEditField(): {
7
+ type: "custom";
8
+ render: () => ReactElement;
9
+ };
4
10
  export declare const NO_BLOCK_SOURCE: ShowWhenRule;
5
11
  export declare function blockSourceFields<Fields extends Record<string, unknown>>(block: string, fields: Fields, props: Record<string, unknown> | null | undefined, options?: {
6
12
  hides?: readonly string[];
@@ -1 +1 @@
1
- import{jsx as x}from"react/jsx-runtime";import{ListIcon as y}from"efficient-easel/icons";import{BLOCK_SOURCE_PROP as p,blockSources as S,blockSourcesRevision as w,declaredBlockSource as $}from"../../../format/lib/content/block-sources.js";import{select as j}from"./box-fields.js";import{withShowWhen as M}from"../../../render/lib/document/show-when.js";function E(s,e){return j(s,x(y,{}),[{label:e,value:""}],"")}const b=new WeakMap;let h=-1,m={};const g=new WeakMap;function _(s,e,i){h!==w()&&(h=w(),m={});let t=b.get(e);(!t||g.get(t)!==m)&&(t=new Map,g.set(t,m),b.set(e,t));const c=S(s),n=i&&!c.some(o=>o.key===i)?i:"",l=`${s}\0${n}`;let r=t.get(l);return r||(r={...e,options:[...e.options,...c.map(o=>({label:o.label,value:o.key})),...n?[{label:n,value:n}]:[]]},t.set(l,r)),r}const O=new WeakMap,C={not:{field:p,set:!0}};function F(s,e,i,t={}){const c=e[p];if(!c)return e;const n=$(i),l=S(s).length>0||n!=="",r=l?_(s,c,n):null;let o=O.get(e);o||O.set(e,o=new Map);const k=`${w()}\0${l?"1":"0"}\0${n}\0${(t.hides??[]).join(",")}`,v=o.get(k);if(v)return v;const R=new Set(t.hides??[]),a={};for(const[u,f]of Object.entries(e))u===p?r&&(a[u]=r):a[u]=R.has(u)&&f&&typeof f=="object"?M(f,C):f;return o.set(k,a),a}export{C as NO_BLOCK_SOURCE,E as blockSourceField,F as blockSourceFields};
1
+ import{jsx as p}from"react/jsx-runtime";import{ListIcon as g}from"efficient-easel/icons";import x from"../../components/SourceStatus.js";import{say as $}from"../../../format/lib/editor-words.js";import{NoControlMark as M,noControlField as E}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BLOCK_SOURCE_PROP as m,blockSourceSpec as j,blockSources as h,blockSourcesRevision as w,declaredBlockSource as W}from"../../../format/lib/content/block-sources.js";import{select as B}from"./box-fields.js";import{withShowWhen as F}from"../../../render/lib/document/show-when.js";function H(t,e){return B(t,p(g,{}),[{label:e,value:""}],"")}const K="_sourceEdit";function J(){return E({type:"custom",render:()=>p(M,{})},"always")}const y=new Map;function L(t){const e=`${t.label}\0${t.href}`;let o=y.get(e);return o||(o={type:"custom",render:()=>p(x,{compact:!0,status:"ok",hint:$("Where this content is edited."),edit:{label:t.label,onClick:()=>window.open(t.href,"_blank","noopener")}})},y.set(e,o)),o}const R=new WeakMap;let v=-1,d={};const O=new WeakMap;function P(t,e,o){v!==w()&&(v=w(),d={});let n=R.get(e);(!n||O.get(n)!==d)&&(n=new Map,O.set(n,d),R.set(e,n));const l=h(t),r=o&&!l.some(s=>s.key===o)?o:"",u=`${t}\0${r}`;let i=n.get(u);return i||(i={...e,options:[...e.options,...l.map(s=>({label:s.label,value:s.key})),...r?[{label:r,value:r}]:[]]},n.set(u,i)),i}const _=new WeakMap,U={not:{field:m,set:!0}};function Q(t,e,o,n={}){const l=e[m];if(!l)return e;const r=W(o),u=h(t).length>0||r!=="",i=u?P(t,l,r):null;let s=_.get(e);s||_.set(e,s=new Map);const S=`${w()}\0${u?"1":"0"}\0${r}\0${(n.hides??[]).join(",")}`,b=s.get(S);if(b)return b;const C=new Set(n.hides??[]),k=r?j(r)?.edit:void 0,a={};for(const[c,f]of Object.entries(e))c===m?i&&(a[c]=i):c===K?k&&(a[c]=L(k)):a[c]=C.has(c)&&f&&typeof f=="object"?F(f,U):f;return s.set(S,a),a}export{K as BLOCK_SOURCE_EDIT_PROP,U as NO_BLOCK_SOURCE,J as blockSourceEditField,H as blockSourceField,Q as blockSourceFields};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ColumnsIcon as b,StylesIcon as a}from"efficient-easel/icons";import{copyText as s,plainText as p,plainTextarea as c,text as f,textarea as C,withOffPage as u}from"../../../controls.js";import{group as i}from"efficient-easel/screen/lib/document/box-fields";import{select as d,slider as S}from"../../../box-fields.js";import{SPLITTABLE_SECTIONS as w,headFieldsForPlacement as F}from"../../../../../../format/lib/sections/section-head-placement.js";import{SECTION_EYEBROW_LOOK_OPTIONS as L,eyebrowLookFor as m}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{blockSourceField as k,blockSourceFields as T}from"../../../block-source-fields.js";import{CARDS_PH as y}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const N={fields:{_gContent:i("Content"),eyebrow:f("Eyebrow",y.eyebrow),eyebrowLook:d("Eyebrow style",o(a,{}),[...L],m("Cards")),title:C("Heading",y.title),dataSource:k("Cards from","Typed here"),items:{type:"array",label:"Cards",arrayFields:{title:s("Card title"),body:c("Card body")},defaultItemProps:{title:"",body:""},getItemSummary:e=>e?.title||e?.body||"Card"},_gStyle:i("Style"),cardStyle:d("Card style",o(a,{}),[{label:"Cards",value:"cards"},{label:"Label only",value:"label-only"}],"cards"),columns:S("Columns",o(b,{}),2,4,1,3)},resolveFields:(e,{fields:n})=>{const r=F(T("Cards",n,e.props,{hides:["items"]}),e.props.headPlacement,w.Cards.headRows);if(e.props.cardStyle!=="label-only")return r;const t=r.items,l=r.eyebrowLook;return{...r,...t?{items:{...t,arrayFields:{title:s("Feature label"),href:u(p("Link"))}}}:{},...l?{eyebrowLook:{...l,fallback:m("KeyFeatures")}}:{}}}};export{N as CardsFields};
1
+ import{jsx as c}from"react/jsx-runtime";import{AccentIcon as v,ColumnsIcon as x,StylesIcon as f}from"efficient-easel/icons";import{copyText as b,plainText as C,plainTextarea as B,text as w,textarea as M,withOffPage as S}from"../../../controls.js";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import{select as y,slider as A}from"../../../box-fields.js";import{SPLITTABLE_SECTIONS as H,headFieldsForPlacement as N}from"../../../../../../format/lib/sections/section-head-placement.js";import{SECTION_EYEBROW_LOOK_OPTIONS as D,eyebrowLookFor as k}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{BLOCK_SOURCE_EDIT_PROP as K,blockSourceEditField as W,blockSourceField as J,blockSourceFields as U}from"../../../block-source-fields.js";import{declaredBlockSource as E,sourceChoices as Y}from"../../../../../../format/lib/content/block-sources.js";import{cardKeyOf as q,cardRow as z,cardTemplateFields as O}from"../../../../../../format/lib/content/card-template.js";import{isNodeList as G,newId as I}from"efficient-easel/data";import{say as Q}from"../../../../../../format/lib/editor-words.js";import{withCardsTemplate as V}from"../../../../../../format/lib/document/cards-template-on-read.js";import{CARDS_PH as F,CardsSlots as X}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const Z=e=>G(e.template)&&e.template.length>0;function $(e){const r=E(e);return r?Y(r).map(t=>({label:t.label,value:t.key})):(Array.isArray(e.items)?e.items:[]).map((t,l)=>({label:typeof t?.title=="string"&&t.title.trim()||Q("Card {n}",{n:l+1}),value:q(z(t),l)}))}const ee=e=>Object.defineProperty({...e},"key",{get:()=>I("card"),enumerable:!0});function te(e,r){const o=Z(r)&&r.cardStyle!=="label-only"&&!!e.highlightedCard;return Object.fromEntries(Object.entries(e).flatMap(([t,l])=>t==="highlightedCard"?o?[[t,re(l,$(r))]]:[]:t==="highlightBadge"?o?[[t,l]]:[]:t==="items"&&o&&l?[[t,ae(l)]]:[[t,l]]))}const L=new WeakMap;function re(e,r){let o=L.get(e);o||L.set(e,o=new Map);const t=JSON.stringify(r);let l=o.get(t);return l||o.set(t,l={...e,options:[...e.options,...r]}),l}const T=e=>e.kind==="link"?S(C(e.label)):e.multiline?B(e.label):b(e.label),oe=Object.fromEntries(O("Cards").filter(e=>!e.everySource).map(e=>[e.key,T(e)])),le=Object.fromEntries(O("Cards").filter(e=>e.key==="title"||e.key==="body").map(e=>[e.key,T(e)])),_=new WeakMap;function ae(e){let r=_.get(e);return r||_.set(e,r={...e,arrayFields:oe}),r}const we={fields:{_gSource:p("Source"),dataSource:J("Card content","Manual"),[K]:W(),_gContent:p("Content"),eyebrow:w("Eyebrow",F.eyebrow),eyebrowLook:y("Eyebrow style",c(f,{}),[...D],k("Cards")),title:M("Heading",F.title),items:{type:"array",label:"Cards",arrayFields:le,defaultItemProps:ee({title:"",body:""}),getItemSummary:e=>e?.title||e?.body||"Card"},...X,highlightedCard:y("Highlighted card",c(v,{}),[{label:"None",value:""}],""),highlightBadge:w("Highlight badge","Most popular"),_gStyle:p("Style"),cardStyle:y("Card style",c(f,{}),[{label:"Cards",value:"cards"},{label:"Label only",value:"label-only"}],"cards"),columns:A("Columns",c(x,{}),2,4,1,3)},resolveData:e=>{const r=V("Cards",e.props),o=r===e.props?e:{...e,props:r},t=o.props;if(!Array.isArray(t.items)||E(t))return o;const l=t.items,s=typeof t.highlightedCard=="string"?t.highlightedCard.trim():"",i=a=>a&&typeof a=="object"&&typeof a.key=="string"?a.key:"",P=!!s&&!l.some(a=>i(a)===s),d=new Set;let u=t.highlightedCard,h=!1;const R=l.map((a,j)=>{if(!a||typeof a!="object")return a;const n=i(a);if(n&&!d.has(n))return d.add(n),a;const g=!n&&P&&s===String(j+1);if(n||g){const m=I("card");return d.add(m),h=!0,g&&(u=m),{...a,key:m}}return a});return h?{...o,props:{...t,items:R,highlightedCard:u}}:o},resolveFields:(e,{fields:r})=>{const o=N(U("Cards",r,e.props,{hides:["items"]}),e.props.headPlacement,H.Cards.headRows),t=e.props,l=te(o,t);if(t.cardStyle!=="label-only")return l;const s=o.items,i=o.eyebrowLook;return{...l,...s?{items:{...s,arrayFields:{title:b("Feature label"),href:S(C("Link"))}}}:{},...i?{eyebrowLook:{...i,fallback:k("KeyFeatures")}}:{}}}};export{we as CardsFields};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import p from"../../../../../components/LocationsGroupedField.js";import{splitLegacyRegion as m}from"../../../../../../format/lib/content/contact.js";import{BLOCK_SOURCE_ROWS_PROP as l}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as d,blockSourceFields as u}from"../../../block-source-fields.js";import{needsGeocodeWork as f,resolveGeocodeRows as g}from"../../../geocode-resolve.js";const _={fields:{dataSource:d("Locations from","Typed here"),locations:{type:"custom",render:({value:o,onChange:r})=>a(p,{value:o,onChange:r})}},resolveData:async o=>{const r=o.props,t=r.locations??[];if(!f(t))return o;const n=await g(t,e=>{const s=m(e.region);return[String(e.address??"").replace(/\s*\n+\s*/g,", "),e.name,String(e.state??"").trim()||s.state,String(e.country??"").trim()||s.country].map(c=>String(c??"").trim()).filter(Boolean).join(", ")}),{[l]:S,...i}=r;return{...o,props:{...i,locations:n}}},resolveFields:(o,{fields:r})=>u("ContactLocations",r,o.props)};export{_ as ContactLocationsFields};
1
+ import{jsx as a}from"react/jsx-runtime";import p from"../../../../../components/LocationsGroupedField.js";import{splitLegacyRegion as m}from"../../../../../../format/lib/content/contact.js";import{BLOCK_SOURCE_ROWS_PROP as l}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as d,blockSourceFields as u}from"../../../block-source-fields.js";import{needsGeocodeWork as g,resolveGeocodeRows as f}from"../../../geocode-resolve.js";const _={fields:{dataSource:d("Location content","Manual"),locations:{type:"custom",render:({value:o,onChange:r})=>a(p,{value:o,onChange:r})}},resolveData:async o=>{const r=o.props,e=r.locations??[];if(!g(e))return o;const n=await f(e,t=>{const s=m(t.region);return[String(t.address??"").replace(/\s*\n+\s*/g,", "),t.name,String(t.state??"").trim()||s.state,String(t.country??"").trim()||s.country].map(c=>String(c??"").trim()).filter(Boolean).join(", ")}),{[l]:S,...i}=r;return{...o,props:{...i,locations:n}}},resolveFields:(o,{fields:r})=>u("ContactLocations",r,o.props)};export{_ as ContactLocationsFields};
@@ -1 +1 @@
1
- import{blockSourceField as o,blockSourceFields as s}from"../../../block-source-fields.js";import{copyText as a,text as d,upload as l}from"../../../controls.js";import{group as r}from"efficient-easel/screen/lib/document/box-fields";import{PAYMENT_PH as m}from"../../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";const p={fields:{_gContent:r("Content"),heading:d("Heading",m.heading),dataSource:o("Methods from","Typed here"),badges:{type:"array",label:"Payment methods",arrayFields:{label:a("Name"),src:l("Logo","image/*")},getItemSummary:e=>e.label||e.src||"Method"},assurances:{type:"array",label:"Reassurance lines",arrayFields:{text:a("Line")},getItemSummary:e=>e.text||"Line"},_gLayout:r("Layout")},resolveFields:(e,{fields:t})=>s("PaymentBadges",t,e.props,{hides:["badges"]})};export{p as PaymentBadgesFields};
1
+ import{blockSourceField as r,blockSourceFields as s}from"../../../block-source-fields.js";import{copyText as a,text as l,upload as m}from"../../../controls.js";import{group as t}from"efficient-easel/screen/lib/document/box-fields";import{PAYMENT_PH as n}from"../../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";const c={fields:{_gContent:t("Content"),heading:l("Heading",n.heading),dataSource:r("Payment content","Manual"),badges:{type:"array",label:"Payment methods",arrayFields:{label:a("Name"),src:m("Logo","image/*")},getItemSummary:e=>e.label||e.src||"Method"},assurances:{type:"array",label:"Reassurance lines",arrayFields:{text:a("Line")},getItemSummary:e=>e.text||"Line"},_gLayout:t("Layout")},resolveFields:(e,{fields:o})=>s("PaymentBadges",o,e.props,{hides:["badges"]})};export{c as PaymentBadgesFields};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{FieldGlyph as i}from"../../../../../components/FieldGlyph.js";import{COUNT_KEY_PROP as n}from"../../../../../../format/lib/content/block-sources.js";import{CARD_ROW_FACTS as s,cardRowField as m,cardRowFields as p}from"../../../card-row-fields.js";import{textarea as a}from"../../../controls.js";import{group as h}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as f}from"efficient-easel/screen/lib/document/style-fields";import{select as d}from"../../../box-fields.js";import{PH as g}from"../../../../../../format/lib/document/blocks/placeholders.js";import{toneField as u}from"../../shared-fields.js";import{blockAlignmentFields as x}from"../../../box-fields.js";import{consentWordsKept as c,withConsentWordsRow as w}from"../../../consent-words-field.js";import{withLiveNumberRow as b}from"../../../live-number-field.js";function F(e,o){const t=o?.textStyle;if(typeof t!="string"||!t.startsWith("heading-"))return e;const{align:v,alignPhone:H,...r}=e;return r}const K={fields:{text:a("Body",g.body),consentWords:c("text"),[n]:f("text"),...x(),tone:u(),_gText:h("Text"),rowField:m("Shows","text"),tag:d("HTML tag",l(i,{noun:"heading"}),[{label:"Paragraph",value:"p"},{label:"H1",value:"h1"},{label:"H2",value:"h2"},{label:"H3",value:"h3"},{label:"H4",value:"h4"},{label:"H5",value:"h5"},{label:"H6",value:"h6"}],"p")},resolveFields:(e,o)=>F(b(w(p(o.fields,e,o),e.props,"text"),e.props),e.props),showWhenFacts:s};export{K as TextFields};
1
+ import{jsx as r}from"react/jsx-runtime";import{BlockBadgeIcon as n,BorderTopIcon as p,MediaLayoutInsetIcon as a}from"efficient-easel/icons";import{FieldGlyph as m}from"../../../../../components/FieldGlyph.js";import{COUNT_KEY_PROP as s}from"../../../../../../format/lib/content/block-sources.js";import{CARD_PLACE_PROP as d,OUTSIDE_FRAMED_CARD as l,framesItsCards as f}from"../../../../../../format/lib/content/card-place.js";import{cardTemplateOwner as h}from"../../../../../../format/lib/content/card-template.js";import{CARD_ROW_FACTS as c,cardRowField as u,cardRowFields as g}from"../../../card-row-fields.js";import{textarea as w}from"../../../controls.js";import{group as x}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as b}from"efficient-easel/screen/lib/document/style-fields";import{segmented as R,select as _}from"../../../box-fields.js";import{withShowWhen as v}from"../../../../../../format/lib/document/show-when-attach.js";import{PH as F}from"../../../../../../format/lib/document/blocks/placeholders.js";import{toneField as P}from"../../shared-fields.js";import{blockAlignmentFields as y}from"../../../box-fields.js";import{consentWordsKept as H,withConsentWordsRow as T}from"../../../consent-words-field.js";import{withLiveNumberRow as A}from"../../../live-number-field.js";function C(e,o){const t=o?.textStyle;if(typeof t!="string"||!t.startsWith("heading-"))return e;const{align:O,alignPhone:I,...i}=e;return i}const Q={fields:{text:w("Body",F.body),consentWords:H("text"),[s]:b("text"),...y(),tone:P(),_gText:x("Text"),rowField:u("Shows","text"),[d]:v(R("Place",r(n,{}),[{label:"In the card",value:"",picture:r(a,{})},{label:"On the top line",value:"top-line",picture:r(p,{})}],""),{not:{context:l,is:!0}}),tag:_("HTML tag",r(m,{noun:"heading"}),[{label:"Paragraph",value:"p"},{label:"H1",value:"h1"},{label:"H2",value:"h2"},{label:"H3",value:"h3"},{label:"H4",value:"h4"},{label:"H5",value:"h5"},{label:"H6",value:"h6"}],"p")},resolveFields:(e,o)=>C(A(T(g(o.fields,e,o),e.props,"text"),e.props),e.props),showWhenFacts:{...c,[l]:(e,o)=>{const t=h(o.appState,e.props?.id);return t===void 0?void 0:!f(t?.type)}}};export{Q as TextFields};
@@ -1,2 +1,2 @@
1
- export declare const assembleGeneralBlocks: () => Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Series" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "DocMetaCards" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
2
- export declare const generalBlocks: Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Series" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "DocMetaCards" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
1
+ export declare const assembleGeneralBlocks: () => Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
2
+ export declare const generalBlocks: Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
@@ -17,10 +17,15 @@ export declare function cardDisplayItems(card: Card, label: (child: Child) => st
17
17
  shown: boolean;
18
18
  }[];
19
19
  export declare function withChildShown<C extends Card>(card: C, id: string, shown: boolean): C;
20
- export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string): string;
21
- export declare function CardDisplayChips({ card, ownerType, labelOf, write, readOnly, }: {
20
+ type ChipOwner = {
21
+ type?: unknown;
22
+ props?: Record<string, unknown>;
23
+ } | null | undefined;
24
+ export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string, owner?: ChipOwner): string;
25
+ export declare function CardDisplayChips({ card, ownerType, owner, labelOf, write, readOnly, }: {
22
26
  card: Card;
23
27
  ownerType: string | undefined;
28
+ owner?: ChipOwner;
24
29
  labelOf: (type: string) => string;
25
30
  write: (next: (latest: Card) => Card) => void;
26
31
  readOnly?: boolean;
@@ -1 +1 @@
1
- "use client";import{jsx as f}from"react/jsx-runtime";import{isNodeList as R}from"efficient-easel/data";import{useEasel as N}from"efficient-easel/easel";import{slotChildName as O,slotChildRowName as g}from"efficient-easel/draw";import{cardTemplateCardOwner as y,cardTemplateField as h,namedRowField as D}from"../../../format/lib/content/card-template.js";import{DisplayRow as _,useSelectedPatch as S}from"./controls.js";import{websiteNodeIsLocked as T}from"./locked-blocks.js";import{stripMarkup as b}from"../../../format/lib/markup.js";import{sourceRowName as A}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as E}from"../../../format/lib/document/show-when-attach.js";import{deviceField as F}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as L}from"efficient-easel/screen/lib/document/panel-no-control-mark";const C="notCardOfTemplate",M={not:{context:C,is:!0}},V={[C]:(e,n)=>{const t=y(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function d(e){const n=e.props?.content;return R(n)?n:[]}const m=e=>!!e.props?._hidden;function x(e,n=()=>!1){return d(e).flatMap(t=>typeof t?.props?.id!="string"?[]:d(t).length&&!m(t)?x(t,n):n(t)?[]:[t])}function P(e,n,t){const i=x(e,t).map(r=>({child:r,name:n(r)})),s=new Set(i.map(r=>r.name)),u=new Set;return i.map(({child:r,name:p})=>{let o=p;if(u.has(p)){let a=2;for(;s.has(`${p} ${a}`);)a+=1;o=`${p} ${a}`,s.add(o)}return u.add(p),{id:r.props.id,label:o,shown:!m(r)}})}function l(e,n){return d(e).flatMap(t=>m(t)?n(t)?[]:[t,...l(t,n)]:l(t,n))}function w(e,n,t){const i=d(e);let s=!1;const u=i.map(r=>{if(s)return r;let p;if(r?.props?.id===n){if(t?!("_hidden"in r.props):m(r))return r;const{_hidden:o,...a}=r.props;p={...r,props:t?a:{...a,_hidden:!0}}}else p=w(r,n,t);return s=p!==r,p});return s?{...e,props:{...e.props,content:u}}:e}function k(e,n,t){return O(e).trim()?t(e):h(n,D(e.props))?.label??t(e)}const $="This page is read-only.";function B({card:e,ownerType:n,labelOf:t,write:i,readOnly:s}){const u=o=>g(o,t,b,void 0,A),r=o=>T(o.type,o),p=P(e,o=>k(o,n,u),r);return p.length?f(_,{parts:p,changed:p.some(o=>!o.shown),shown:o=>p.find(a=>a.id===o)?.shown??!0,disabledReason:s?$:void 0,onPress:(o,a)=>i(c=>w(c,o,a)),onReset:()=>i(o=>l(o,r).reduce((a,c)=>w(a,String(c.props.id),!0),o))}):f(L,{})}function I(){try{const e=N(s=>s),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const i=y(e.appState,t.props?.id);return{labelOf:s=>n[s]?.label??s,card:t,ownerType:typeof i?.type=="string"?i.type:void 0}}catch{return null}}function j({readOnly:e}){const n=I(),t=S();return n?f(B,{...n,readOnly:e,write:i=>{e||t(s=>{const u={...n.card,props:s},r=i(u);return r===u?null:{content:r.props.content}})}}):f(_,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function Z(){return E(F("desktop",{type:"custom",render:({readOnly:e})=>f(j,{readOnly:e})}),M)}export{V as CARD_BOX_FACTS,B as CardDisplayChips,C as NOT_CARD_OF_TEMPLATE,M as ON_A_CARD,k as cardChipLabel,Z as cardDisplayField,P as cardDisplayItems,x as cardDisplayParts,w as withChildShown};
1
+ "use client";import{jsx as d}from"react/jsx-runtime";import{isNodeList as N}from"efficient-easel/data";import{useEasel as O}from"efficient-easel/easel";import{slotChildName as g,slotChildRowName as h}from"efficient-easel/draw";import{cardTemplateCardOwner as _,cardTemplateField as D,namedRowField as S}from"../../../format/lib/content/card-template.js";import{DisplayRow as C,useSelectedPatch as T}from"./controls.js";import{websiteNodeIsLocked as b}from"./locked-blocks.js";import{stripMarkup as A}from"../../../format/lib/markup.js";import{sourceRowName as E}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as F}from"../../../format/lib/document/show-when-attach.js";import{deviceField as L}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as M}from"efficient-easel/screen/lib/document/panel-no-control-mark";const x="notCardOfTemplate",P={not:{context:x,is:!0}},Z={[x]:(e,n)=>{const t=_(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function m(e){const n=e.props?.content;return N(n)?n:[]}const c=e=>!!e.props?._hidden;function R(e,n=()=>!1){return m(e).flatMap(t=>typeof t?.props?.id!="string"?[]:m(t).length&&!c(t)?R(t,n):n(t)?[]:[t])}function k(e,n,t){const p=R(e,t).map(r=>({child:r,name:n(r)})),s=new Set(p.map(r=>r.name)),a=new Set;return p.map(({child:r,name:i})=>{let u=i;if(a.has(i)){let o=2;for(;s.has(`${i} ${o}`);)o+=1;u=`${i} ${o}`,s.add(u)}return a.add(i),{id:r.props.id,label:u,shown:!c(r)}})}function w(e,n){return m(e).flatMap(t=>c(t)?n(t)?[]:[t,...w(t,n)]:w(t,n))}function y(e,n,t){const p=m(e);let s=!1;const a=p.map(r=>{if(s)return r;let i;if(r?.props?.id===n){if(t?!("_hidden"in r.props):c(r))return r;const{_hidden:u,...o}=r.props;i={...r,props:t?o:{...o,_hidden:!0}}}else i=y(r,n,t);return s=i!==r,i});return s?{...e,props:{...e.props,content:a}}:e}function $(e,n,t,p){return g(e).trim()?t(e):D(n,S(e.props),p)?.label??t(e)}const B="This page is read-only.";function I({card:e,ownerType:n,owner:t,labelOf:p,write:s,readOnly:a}){const r=o=>h(o,p,A,void 0,E),i=o=>b(o.type,o),u=k(e,o=>$(o,n,r,t),i);return u.length?d(C,{parts:u,changed:u.some(o=>!o.shown),shown:o=>u.find(f=>f.id===o)?.shown??!0,disabledReason:a?B:void 0,onPress:(o,f)=>s(l=>y(l,o,f)),onReset:()=>s(o=>w(o,i).reduce((f,l)=>y(f,String(l.props.id),!0),o))}):d(M,{})}function j(){try{const e=O(s=>s),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const p=_(e.appState,t.props?.id);return{labelOf:s=>n[s]?.label??s,card:t,ownerType:typeof p?.type=="string"?p.type:void 0,owner:p}}catch{return null}}function v({readOnly:e}){const n=j(),t=T();return n?d(I,{...n,readOnly:e,write:p=>{e||t(s=>{const a={...n.card,props:s},r=p(a);return r===a?null:{content:r.props.content}})}}):d(C,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function ee(){return F(L("desktop",{type:"custom",render:({readOnly:e})=>d(v,{readOnly:e})}),P)}export{Z as CARD_BOX_FACTS,I as CardDisplayChips,x as NOT_CARD_OF_TEMPLATE,P as ON_A_CARD,$ as cardChipLabel,ee as cardDisplayField,k as cardDisplayItems,R as cardDisplayParts,y as withChildShown};
@@ -1 +1 @@
1
- import{jsx as R}from"react/jsx-runtime";import{ListIcon as _}from"efficient-easel/icons";import{FieldGlyph as k}from"../../components/FieldGlyph.js";import{cardTemplateFields as A,cardTemplateOwner as x}from"../../../format/lib/content/card-template.js";import{select as C}from"./box-fields.js";import{withShowWhen as E}from"../../../format/lib/document/show-when-attach.js";const b="outsideCardTemplate",S={not:{context:b,is:!0}},I={[b]:(t,e)=>{const n=x(e.appState,t.props?.id);return n===void 0?void 0:n===null}};function K(t,e){const n=e==="link"?R(k,{noun:"link"}):R(_,{}),r={...C(t,n,[{label:"Typed here",value:""}],""),cardRowKind:e};return E(r,S)}function g(t){return!!(t&&typeof t=="object"&&"cardRowKind"in t)}const h=new WeakMap;function L(t,e,n){const r=Object.keys(t).filter(o=>g(t[o]));if(!r.length)return t;const a=e.props??{},w=x(n.appState,a.id),i=typeof w?.type=="string"?w.type:"",p=r.map(o=>typeof a[o]=="string"?a[o].trim():""),f=`${i}\0${p.join("\0")}`;let s=h.get(t);s||h.set(t,s=new Map);const y=s.get(f);if(y)return y;const l={...t};return r.forEach((o,u)=>{const d=t[o],T=i?A(i,d.cardRowKind):[],m=p[u]&&!T.some(c=>c.key===p[u])?p[u]:"";l[o]={...d,options:[...d.options,...T.map(c=>({label:c.label,value:c.key})),...m?[{label:m,value:m}]:[]]}}),s.set(f,l),l}export{I as CARD_ROW_FACTS,S as IN_CARD_TEMPLATE,b as OUTSIDE_CARD_TEMPLATE,K as cardRowField,L as cardRowFields};
1
+ import{jsx as T}from"react/jsx-runtime";import{ListIcon as h}from"efficient-easel/icons";import{FieldGlyph as _}from"../../components/FieldGlyph.js";import{cardTemplateFieldsOf as A,cardTemplateOwner as x}from"../../../format/lib/content/card-template.js";import{blockSourcesRevision as C,declaredBlockSource as E}from"../../../format/lib/content/block-sources.js";import{select as g}from"./box-fields.js";import{withShowWhen as j}from"../../../format/lib/document/show-when-attach.js";const b="outsideCardTemplate",F={not:{context:b,is:!0}},W={[b]:(o,e)=>{const n=x(e.appState,o.props?.id);return n===void 0?void 0:n===null}};function B(o,e){const n=e==="link"?T(_,{noun:"link"}):T(h,{}),r={...g(o,n,[{label:"Typed here",value:""}],""),cardRowKind:e};return j(r,F)}function O(o){return!!(o&&typeof o=="object"&&"cardRowKind"in o)}const k=new WeakMap;function P(o,e,n){const r=Object.keys(o).filter(t=>O(o[t]));if(!r.length)return o;const i=e.props??{},c=x(n.appState,i.id),w=typeof c?.type=="string"?c.type:"",p=r.map(t=>typeof i[t]=="string"?i[t].trim():""),S=E(c?.props),f=`${w}\0${S}\0${C()}\0${p.join("\0")}`;let s=k.get(o);s||k.set(o,s=new Map);const y=s.get(f);if(y)return y;const l={...o};return r.forEach((t,u)=>{const d=o[t],R=w?A(c,d.cardRowKind):[],m=p[u]&&!R.some(a=>a.key===p[u])?p[u]:"";l[t]={...d,options:[...d.options,...R.map(a=>({label:a.label,value:a.key})),...m?[{label:m,value:m}]:[]]}}),s.set(f,l),l}export{W as CARD_ROW_FACTS,F as IN_CARD_TEMPLATE,b as OUTSIDE_CARD_TEMPLATE,B as cardRowField,P as cardRowFields};
@@ -1 +1 @@
1
- import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},G={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return G[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function H(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of H(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...H(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.has(n))throw new Error(`${t}.${n}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ae.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(n===d.Design||n===d.Animation)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",G],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{G as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,H as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
1
+ import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},G={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return G[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function H(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of H(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...H(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.has(n))throw new Error(`${t}.${n}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ae.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(n===d.Design||n===d.Animation)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",G],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{G as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,H as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
@@ -0,0 +1,2 @@
1
+ import type { SlotSectionSpec } from "efficient-easel/screen/lib/document/slot-section-spec";
2
+ export declare const EDITOR_SLOT_EXTRA_SPECS: Record<string, Record<string, SlotSectionSpec>>;
@@ -0,0 +1 @@
1
+ import{SECTION_LABELS as i}from"../../../format/lib/document/section-catalog.js";import{SLOT_SECTION_EXTRA_SPECS as E}from"../../../render/lib/document/slot-specs.js";import{HERO_STRIP_SLOT as S,STRIP_ON_MEDIA as n}from"../../../format/lib/hero-ticker.js";import{SECTION_PRESETS as s}from"../../../format/lib/sections/section-presets.js";function T(o){const e=s.Ticker(o.nodeDefaults,o.newNodeId),{sectionBorder:r,...t}=e.props,c=n.line?{sectionBorder:r}:{};return{...e,props:{...t,...c,sectionAccent:n.sectionAccent}}}const O={Hero:{[S]:{newChild:T,childLabel:i.Ticker}}},f=Object.fromEntries(Object.entries(E).map(([o,e])=>[o,Object.fromEntries(Object.entries(e).map(([r,t])=>[r,{...t,...O[o]?.[r]}]))]));export{f as EDITOR_SLOT_EXTRA_SPECS};
@@ -1 +1 @@
1
- import{readPartMotions as _}from"../../../render/lib/animation/part-motion.js";import{STRIP_SECTION_TO_BOX as I}from"../../../render/lib/document/blocks/general/section-to-box-rows-strip.js";import{SECTION_ACCENT_INHERIT as g}from"../../../format/lib/content/section-surface.js";import{HERO_STRIP_SLOT as m,legacyTickerWords as l,TICKER_MOTION_PART as i}from"../../../format/lib/hero-ticker.js";import{nonEmptyString as u}from"../../../format/lib/non-empty-string.js";import{convertSection as O}from"../../../render/lib/sections/section-to-box.js";function M(t){const{showTicker:n,tickerItems:d,...k}=t.props,y=u(t.props.id)??"Hero",r=[],o=[],e={...k},s=l({tickerItems:d}),p=n!==!1&&s.length>0,c=_(t.props),h=c[i];if(h){const{[i]:a,...w}=c;Object.keys(w).length?e._partMotion=w:delete e._partMotion,r.push({key:"_partMotion",home:p?`${i} → the strip Box's own Entrance`:`${i} → nothing: no strip is drawn`})}if(!p)return e[m]=[],"showTicker"in t.props&&o.push({key:"showTicker",why:n===!1?"switched off: an empty strip draws nothing, the same as today":"no words: the strip drew nothing published, so the strip stays empty"}),"tickerItems"in t.props&&o.push({key:"tickerItems",why:s.length?"switched off: the words were not drawn, and an empty strip draws nothing":"no row has words: an empty row draws nothing published"}),{node:{type:t.type,props:e},carried:r,dropped:o};const T={type:"Ticker",props:{id:`${y}~strip`,items:s.map(a=>({text:a})),tone:"plain",sectionAccent:g,borders:!1,...h??{}}},f=O(T,I.Ticker);return e[m]=[f.node],"showTicker"in t.props&&o.push({key:"showTicker",why:"on: the strip Box is the switch now (delete or hide it like any block)"}),r.push({key:"tickerItems",home:`the strip Box: one Text block per row with words (${s.length}), in order`}),{node:{type:t.type,props:e},carried:r,dropped:o}}export{M as heroTickerToStrip};
1
+ import{readPartMotions as g}from"../../../render/lib/animation/part-motion.js";import{STRIP_SECTION_TO_BOX as I}from"../../../render/lib/document/blocks/general/section-to-box-rows-strip.js";import{HERO_STRIP_SLOT as d,legacyTickerWords as l,STRIP_ON_MEDIA as m,TICKER_MOTION_PART as n}from"../../../format/lib/hero-ticker.js";import{nonEmptyString as u}from"../../../format/lib/non-empty-string.js";import{convertSection as O}from"../../../render/lib/sections/section-to-box.js";function x(e){const{showTicker:i,tickerItems:k,...y}=e.props,T=u(e.props.id)??"Hero",r=[],o=[],t={...y},s=l({tickerItems:k}),p=i!==!1&&s.length>0,c=g(e.props),h=c[n];if(h){const{[n]:w,...a}=c;Object.keys(a).length?t._partMotion=a:delete t._partMotion,r.push({key:"_partMotion",home:p?`${n} → the strip Box's own Entrance`:`${n} → nothing: no strip is drawn`})}if(!p)return t[d]=[],"showTicker"in e.props&&o.push({key:"showTicker",why:i===!1?"switched off: an empty strip draws nothing, the same as today":"no words: the strip drew nothing published, so the strip stays empty"}),"tickerItems"in e.props&&o.push({key:"tickerItems",why:s.length?"switched off: the words were not drawn, and an empty strip draws nothing":"no row has words: an empty row draws nothing published"}),{node:{type:e.type,props:t},carried:r,dropped:o};const f={type:"Ticker",props:{id:`${T}~strip`,items:s.map(w=>({text:w})),tone:"plain",sectionAccent:m.sectionAccent,borders:m.line,...h??{}}},_=O(f,I.Ticker);return t[d]=[_.node],"showTicker"in e.props&&o.push({key:"showTicker",why:"on: the strip Box is the switch now (delete or hide it like any block)"}),r.push({key:"tickerItems",home:`the strip Box: one Text block per row with words (${s.length}), in order`}),{node:{type:e.type,props:t},carried:r,dropped:o}}export{x as heroTickerToStrip};
@@ -1 +1 @@
1
- import{BOX_TYPE as a}from"../../../format/lib/document/container-blocks.js";import{SLOT_SECTION_SPECS as h}from"../../../render/lib/document/slot-specs.js";import{eyebrowLookFor as m}from"../../../format/lib/sections/section-eyebrow-look.js";import{SECTION_HEAD_TYPE as n,SPLITTABLE_SECTIONS as r,canSplitHead as s}from"../../../format/lib/sections/section-head-placement.js";import{layoutPresetFor as E}from"./text-layouts.js";function _(o,{nodeDefaults:i,newNodeId:S,sectionLabel:e,blockIsOffered:t}){const c=E(o);return c?c(i,S):s(o)&&t(a)&&t(n)?{type:a,props:{...i(a),id:S(a),direction:"column",name:`${e(o)} section`,content:[{type:n,props:{...i(n),id:S(n),...r[o]?.headStyle?{headStyle:r[o].headStyle}:{},...r[o]?.headRowGap?{rowGap:r[o].headRowGap}:{},...r[o]?.headDescriptionSize?{descriptionSize:r[o].headDescriptionSize}:{},...m(o)!==m(n)?{eyebrowLook:m(o)}:{}}},{type:o,props:{...i(o),id:S(o),headPlacement:"own-box"}}]}}:h[o]?.fixed===!0?{type:o,props:{...i(o),id:S(o),layout:"boxes"}}:null}export{_ as newSectionNode};
1
+ import{BOX_TYPE as m}from"../../../format/lib/document/container-blocks.js";import{cardsTemplateNodes as h}from"../../../format/lib/document/blocks/general/Cards/card-seed.js";import{SLOT_SECTION_SPECS as T}from"../../../render/lib/document/slot-specs.js";import{eyebrowLookFor as a}from"../../../format/lib/sections/section-eyebrow-look.js";import{SECTION_HEAD_TYPE as t,SPLITTABLE_SECTIONS as S,canSplitHead as E}from"../../../format/lib/sections/section-head-placement.js";import{layoutPresetFor as d}from"./text-layouts.js";function L(r,{nodeDefaults:i,newNodeId:o,sectionLabel:l,blockIsOffered:c}){const n=d(r);if(n)return n(i,o);if(E(r)&&c(m)&&c(t))return{type:m,props:{...i(m),id:o(m),direction:"column",name:`${l(r)} section`,content:[{type:t,props:{...i(t),id:o(t),...S[r]?.headStyle?{headStyle:S[r].headStyle}:{},...S[r]?.headRowGap?{rowGap:S[r].headRowGap}:{},...S[r]?.headDescriptionSize?{descriptionSize:S[r].headDescriptionSize}:{},...a(r)!==a(t)?{eyebrowLook:a(r)}:{}}},{type:r,props:{...i(r),id:o(r),headPlacement:"own-box",...e(r,o)}}]}};if(T[r]?.fixed===!0)return{type:r,props:{...i(r),id:o(r),layout:"boxes"}};const s=e(r,o);return Object.keys(s).length?{type:r,props:{...i(r),id:o(r),...s}}:null}function e(r,i){return r==="Cards"?{template:h(o=>i(o))}:{}}export{L as newSectionNode};