efficient-web-builder 69.5.0 → 70.1.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 (75) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/editor/components/AddPageWindow.d.ts +7 -0
  3. package/dist/editor/components/AddPageWindow.js +1 -0
  4. package/dist/editor/components/PageStarterCard.d.ts +9 -0
  5. package/dist/editor/components/PageStarterCard.js +1 -0
  6. package/dist/editor/components/PagesPanel.js +1 -1
  7. package/dist/editor/components/SiteFields.js +1 -1
  8. package/dist/editor/components/StorefrontEditor.js +1 -1
  9. package/dist/editor/components/storefront-editor.css +71 -0
  10. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/general/ProcessSteps/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/general/Prose/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/general/TimelineTrack/fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  17. package/dist/editor/lib/document/box-footer-rows.js +1 -1
  18. package/dist/editor/lib/document/field-groups.js +1 -1
  19. package/dist/editor/lib/document/host-config.d.ts +2 -0
  20. package/dist/editor/lib/document/host-config.js +1 -0
  21. package/dist/editor/lib/document/overrides.d.ts +1 -0
  22. package/dist/editor/lib/document/overrides.js +1 -1
  23. package/dist/editor/lib/document/page-root.d.ts +12 -0
  24. package/dist/editor/lib/document/page-root.js +2 -2
  25. package/dist/editor/lib/host-document-bridge.js +1 -1
  26. package/dist/format/lib/build/module-specifiers.d.ts +11 -0
  27. package/dist/format/lib/build/module-specifiers.js +1 -1
  28. package/dist/format/lib/content/box-background.d.ts +1 -7
  29. package/dist/format/lib/content/box-background.js +1 -1
  30. package/dist/format/lib/content/box-darken-styles.d.ts +7 -0
  31. package/dist/format/lib/content/box-darken-styles.js +1 -0
  32. package/dist/format/lib/content/card-row-keys.d.ts +10 -0
  33. package/dist/format/lib/content/card-row-keys.js +1 -1
  34. package/dist/format/lib/content/card-template.d.ts +1 -11
  35. package/dist/format/lib/content/card-template.js +1 -1
  36. package/dist/format/lib/content/count-numbers.js +1 -1
  37. package/dist/format/lib/content/site-gutter.js +1 -1
  38. package/dist/format/lib/document/blocks/general/CardList/meta.js +1 -1
  39. package/dist/format/lib/document/blocks/general/Cards/meta.js +1 -1
  40. package/dist/format/lib/document/blocks/general/FAQ/meta.js +1 -1
  41. package/dist/format/lib/document/blocks/general/Flex/meta.js +1 -1
  42. package/dist/format/lib/document/blocks/general/Footprint/meta.js +2 -2
  43. package/dist/format/lib/document/blocks/general/Grid/meta.js +1 -1
  44. package/dist/format/lib/document/blocks/general/Hero/meta.js +1 -1
  45. package/dist/format/lib/document/blocks/general/HeroGroup/meta.d.ts +1 -1
  46. package/dist/format/lib/document/blocks/general/HeroGroup/meta.js +1 -1
  47. package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
  48. package/dist/format/lib/document/blocks/general/HeroSlide/meta.js +1 -1
  49. package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
  50. package/dist/format/lib/document/blocks/general/OrderSummary/meta.js +1 -1
  51. package/dist/format/lib/document/blocks/general/PostCard/meta.js +1 -1
  52. package/dist/format/lib/document/blocks/general/ProcessSteps/column-seed.d.ts +1 -1
  53. package/dist/format/lib/document/blocks/general/ProcessSteps/column-seed.js +1 -1
  54. package/dist/format/lib/document/blocks/general/ProcessSteps/meta.js +1 -1
  55. package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.js +1 -1
  56. package/dist/format/lib/document/blocks/general/slots.d.ts +93 -0
  57. package/dist/format/lib/document/blocks/general/slots.js +1 -0
  58. package/dist/format/lib/document/box-footer.js +1 -1
  59. package/dist/format/lib/document/node-lists.d.ts +4 -0
  60. package/dist/format/lib/document/node-lists.js +1 -1
  61. package/dist/format/lib/document/passes/document-position.js +1 -1
  62. package/dist/format/lib/editor-words-catalogue.d.ts +9 -0
  63. package/dist/format/lib/editor-words-catalogue.js +3 -3
  64. package/dist/format/lib/editor-words-kept.js +1 -1
  65. package/dist/format/lib/page-starters.d.ts +14 -0
  66. package/dist/format/lib/page-starters.js +1 -0
  67. package/dist/format/lib/source-rules/panel-one-arrow.js +1 -1
  68. package/dist/format/lib/source-rules/support/panel-select-cascade.d.ts +1 -1
  69. package/dist/format/lib/source-rules/support/panel-select-cascade.js +1 -1
  70. package/dist/format/lib/web-backend.d.ts +9 -0
  71. package/dist/render/lib/content/page-contents.js +1 -1
  72. package/dist/render/lib/document/slot-counts.js +1 -1
  73. package/package.json +6 -6
  74. package/dist/format/lib/document/panel-bands.d.ts +0 -15
  75. package/dist/format/lib/document/panel-bands.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 70.1.0 - 2026-11-17
4
+
5
+ From main at `74cb8eb0`: #776, #777, #778. A minor: no `!`, no export is removed, no export changes its type, the peers stay `efficient-easel` `^35.0.0` and `efficient-shell` `^13.17.0`. New exports only. No stored key or value moves.
6
+
7
+ **For hosts:**
8
+ - efficient-storefront-blocks adds `general/slots.js` and `content/card-row-keys.js` to its `links` entry sources (eff-erp/efficient-storefront-blocks#591 does it): a page walk no longer loads every general block meta.
9
+ - The Add page window reads the new optional backend members `WebsitePages.starters` and `createFromStarter`. A host that does not pass them gets the window with **+ Blank page** only. No step is required.
10
+
11
+ ### Added
12
+
13
+ - **The Add page window** (#776): the Pages panel's **+** opens one window (the shell `Dialog`, size `full`). **+ Blank page** makes an empty draft page at a free URL handle. A list on the left (All pages, About, Contact, FAQ, Gallery, Store locator, Policies, and From your template when the site's template has pages) filters cards that draw each starter page's first section live at 1440 x 1080 in the site's theme, scaled by the shell `FitFrame`. **Add page** copies the starter into a new draft page. New `AddPageWindow`, `PageStarterCard`, `PageStarter`, `StarterGroup`, `PAGE_LIBRARY_GROUPS`, `ALL_STARTERS`, `TEMPLATE_STARTERS`, `libraryStarters`, `templateStarters`, `shownLibraryGroups`, `startersIn`, `firstSectionOf`, `useHostConfig`, `useSiteWidthsMetadata` and `SiteThemeCarrier`.
14
+ - **The general slot table** (#778): new `lib/document/blocks/general/slots` (`GENERAL_SLOTS`, the 13 general blocks' slot declarations in declaration order; it imports only `lib/content/card-row-keys`). `PROCESS_COLUMNS_SLOT` moves there; `ProcessSteps/column-seed` still exports it. Every `XSlots` export stays on its meta, read from the table. `lib/document/node-lists` builds its slots from the table and no longer imports the metas.
15
+
16
+ ### Changed
17
+
18
+ - **LongRead's link rows are in the Link group** (#777): Button, Link, Image and Image label move from the top of the Design tab into the Link group, just before Anchor, where the Box's "Link to" stands.
19
+
20
+ ## 70.0.0 - 2026-11-17
21
+
22
+ From main at `1d0a2e1c`: #767, #771, #774. A major: #767 and #771 are `!`. The peers rise to `efficient-easel` `^35.0.0` and `efficient-shell` `^13.17.0`. The module `lib/document/panel-bands` is removed. No stored key or value moves.
23
+
24
+ **For hosts:**
25
+ - Install efficient-easel 35.0.0 or later and efficient-shell 13.17.0 or later with this release.
26
+ - A host that imports `efficient-web-builder/format/lib/document/panel-bands` (`bandIsDropped`, `droppedBands`, `loneDesignBand`, `withoutBands`, `sameKeys`, `BandRow`, `DrawnBand`, `TEXT_BAND_KEY`, `TEXT_BAND_TITLE`) stops compiling. The one-row band rule is efficient-easel 35's Inspector; the text box band key is `LEAD_BAND_KEY` from `efficient-easel/fields`. efficient-storefront-blocks `scripts/test-single-row-group-headings.tsx` imports `bandIsDropped` and is re-pointed in its bump (eff-erp/efficient-storefront-blocks#591).
27
+
28
+ ### Added
29
+
30
+ - **One import reader** (#774; it merged before the 70.0.0 release PR and was first left out of this section): new `importsOf(ts, fileName, text)`, `importIsTypeOnly`, `exportIsTypeOnly` and `packageNameOf` in `format/lib/build/module-specifiers`. `importsOf(ts, file)` in `lib/source-rules/support/panel-select-cascade` stays as a `@deprecated` call to it (delete by 2026-12-18). No export removed.
31
+
32
+ ### Changed
33
+
34
+ - **BREAKING: walks over a node's lists read the declared slot order** (#767). A node's declared slots come first, in draw order, then any other node list in efficient-easel `storedKeyOrder`, so the editor and the shop give the same answer (before, the editor read insertion order and the shop jsonb order). One helper in `lib/document/node-lists`. `CARD_TEMPLATE_BLOCKS`, `cardTemplateSlot`, `CARD_LIST_ITEM_BLOCKS` and `cardListItemSlot` move to the leaf `lib/content/card-row-keys`, and `BOX_DARKEN_STYLES` to the new leaf `lib/content/box-darken-styles`; `card-template` and `box-background` still export them.
35
+ - **BREAKING: the Box's "Link to" row is in its own Link group, just before Anchor** (#771). `DESIGN_GROUPS`, `DesignGroup` and `DESIGN_GROUP_KEY` are efficient-easel's again (`lib/document/field-groups`), so their type gains `'Link'`; a host `Record<DesignGroup, X>` adds a `Link` entry. `PLACE_WORDS` gains `Link`. The website's copy of the one-row band rule (`lib/document/panel-bands`) is deleted; `SiteFields` passes only the text box band.
36
+
3
37
  ## 69.5.0 - 2026-11-17
4
38
 
5
39
  From main at `e660b33f`: #768, #769, #770, #772. A minor: no `!`, no export is removed, no export changes its type, the peers stay `efficient-easel` `^34.3.0` and `efficient-shell` `^13.3.0`. New exports only. No stored key or value moves: stored Contact / Locations, Hero Single and Scroll-Over Text nodes still draw the old sections. `forMediaType`, the `marked` prop of `HeroPickArea` / `HeroTwoPictures` and the phrase "Tint opacity" are deprecated (delete by 2026-12-18, in a major).
@@ -0,0 +1,7 @@
1
+ import type { EditorPageRow } from "../lib/editor-document-adapter.js";
2
+ export default function AddPageWindow({ open, onClose, takenSlugs, onCreated, }: {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ takenSlugs: ReadonlySet<string>;
6
+ onCreated: (row: EditorPageRow) => void;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as a,jsxs as g}from"react/jsx-runtime";import{useEffect as D,useMemo as G,useRef as W,useState as h}from"react";import{useScreenDocument as q}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as z}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as E}from"efficient-easel/page-copy";import{AddIcon as H}from"efficient-easel/icons";import{Dialog as O,EmptyState as V,Grid as J,SidebarActionButton as K,SidebarLayout as Q,SidebarNavItem as S,toast as P}from"efficient-shell/ui";import U from"./PageStarterCard.js";import{useHostConfig as X}from"../lib/document/host-config.js";import{useSiteWidthsMetadata as Y}from"../lib/document/overrides.js";import{say as t}from"../../format/lib/editor-words.js";import{ALL_STARTERS as i,TEMPLATE_STARTERS as w,shownLibraryGroups as Z,startersIn as $,templateStarters as ee}from"../../format/lib/page-starters.js";import{backendOf as te}from"../lib/website-session.js";function ae({open:l,onClose:x,takenSlugs:b,onCreated:T}){const I=z(),{adapter:d,siteId:c,templateId:L}=q(),r=te(I).pages,y=!L&&!!(r.starters&&r.createFromStarter),m=G(()=>c?{siteId:c}:{},[c]),R=X(),j=Y(),[k,s]=h(null),[o,n]=h(i),[u,v]=h(null),C=W(null);D(()=>{if(!l)return;if(n(i),!y){s([]);return}let e=!0;return s(null),r.starters(m).then(f=>e&&s(f),()=>{e&&(s([]),P.error(t("Couldn’t load the pages — please retry.")))}),()=>{e=!1}},[l,y,r,m]);const A=async(e,f)=>{if(!u){v(e);try{T(await f())}catch{P.error(t("Couldn’t add the page — please retry."))}finally{v(null)}}},B=()=>{if(!d.createPage)return;const e=t("New page");A("blank",()=>d.createPage({slug:E(e,b),title:e,layout:{}}))},F=e=>{A(e.id,()=>r.createFromStarter(e.id,{title:e.title,slug:E(e.slug,b),...m}))},p=k??[],M=Z(p),N=$(o,p),_=g("nav",{"aria-label":t("Pages"),className:"sf-add-page-nav",children:[a(S,{label:t("All pages"),active:o===i,onClick:()=>n(i)}),M.map(e=>a(S,{label:t(e.label),active:o===e.key,onClick:()=>n(e.key)},e.key)),ee(p).length>0?a("div",{className:"sf-add-page-group",children:a(S,{label:t("From your template"),active:o===w,onClick:()=>n(w)})}):null]});return a(O,{open:l,onClose:x,size:"full",title:t("Add page"),initialFocus:C,children:a(Q,{sidebarTop:g(K,{onClick:B,disabled:!d.createPage||u!==null,children:[a(H,{"aria-hidden":!0}),t("Blank page")]}),sidebar:_,children:g("div",{className:"sf-add-page",children:[a("h3",{ref:C,tabIndex:-1,className:"sf-add-page-title",children:t("Pages for your site")}),a("p",{className:"sf-add-page-sub",children:t("Choose a page and change the text, images and more.")}),k===null?a("p",{className:"sf-add-page-sub",children:t("Loading…")}):N.length===0?a(V,{title:t("No pages to start from"),description:t("Start with a blank page, then add sections.")}):a(J,{cols:1,smCols:2,lgCols:3,gap:8,children:N.map(e=>a(U,{starter:e,config:R,metadata:j,busy:u===e.id,onAdd:F},e.id))})]})})})}export{ae as default};
@@ -0,0 +1,9 @@
1
+ import type { Config } from "efficient-easel/blocks";
2
+ import type { PageStarter } from "../../format/lib/web-backend.js";
3
+ export default function PageStarterCard({ starter, config, metadata, busy, onAdd, }: {
4
+ starter: PageStarter;
5
+ config: Config;
6
+ metadata: Record<string, unknown>;
7
+ busy: boolean;
8
+ onAdd: (starter: PageStarter) => void;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useMemo as p,useState as h}from"react";import{CanvasFrame as v}from"efficient-easel/easel";import{Button as g,FitFrame as y}from"efficient-shell/ui";import C from"./PreviewThemeFrame.js";import N from"../../render/lib/document/page-render.js";import{SiteThemeCarrier as S,suppressPreviewNav as D}from"../lib/document/page-root.js";import{useEditorCanvasStyles as x}from"../lib/editor-canvas-styles.js";import{say as i}from"../../format/lib/editor-words.js";import{firstSectionOf as F}from"../../format/lib/page-starters.js";const b=1440,j=1080;function A({starter:t,config:a,metadata:s,busy:n,onAdd:m}){const{mirrorHostStyles:d}=x(),[l,c]=h(null),f=p(()=>{const r=F(t.layout),u=t.layout.zones;return{root:{props:{}},content:r?[r]:[],zones:u??{}}},[t.layout]);return o("div",{className:"sf-starter",children:[o("div",{className:"sf-starter-picture",children:[e("div",{inert:!0,className:"sf-starter-frame",children:e(y,{width:b,height:j,children:e(v,{id:`page-starter-${t.id}`,title:t.title,mirrorStyles:d,onDocument:c,height:"fill",children:e(C,{document:l??void 0,children:e(S,{onClickCapture:D,body:r=>e("div",{className:"sf-themed-content",style:r,children:e("div",{style:{background:"var(--bg)"},children:e(N,{config:a,data:f,metadata:s})})})})})})})}),e("div",{className:"sf-starter-add",children:e(g,{onClick:()=>m(t),loading:n,"aria-label":i("Add “{name}”",{name:t.title}),children:i("Add page")})})]}),e("span",{className:"sf-starter-name",children:t.title})]})}export{A as default};
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as ne,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 Oe}from"efficient-easel/chrome";import{Button as se,Dialog as Le,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 O}from"efficient-easel/tree";import{AddIcon as ze,DuplicateIcon as Ge,PageIcon as He,SettingsIcon as Te}from"efficient-easel/icons";import{PagesIcon as Ue}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 t,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{shopHost as et}from"../../format/lib/web-runtime.js";import{newPopupPage as tt}from"../../format/lib/popup/new-popup.js";const pe="sf-editor-pages-collapsed-groups";function nt(){const i=ce(),{siteId:L,templateId:k}=ae(),I=$e(i).pages;if(!(!I.duplicate||k))return(p,A)=>I.duplicate(p.id,{...A,...L?{siteId:L}:{}})}function ot({onNavigate:i,onClose:L,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=nt(),[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]),T=M.trim().toLowerCase(),V=e=>!T||e.toLowerCase().includes(T),ye=e=>T?!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),_(""),i(a.slug)}catch{f(t("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(tt(t("New popup"),N));await F(),i(e.slug)}catch{f(t("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 l=a.findIndex(s=>s.id===e.id),d=a.filter(s=>s.id!==e.id),w=e.slug===K;q(e.id,!0),Y(d),f(null),w&&d[0]&&i(d[0].slug);const E=()=>{q(e.id,!1);const s=ge()??[];if(s.some(Ae=>Ae.id===e.id))return;const C=[...s];C.splice(Math.max(0,Math.min(l,C.length)),0,e),Y(C)};re.undoable(t("Deleted “{name}”",{name:e.label}),{actionLabel:t("Undo"),commit:async s=>{await o(e.id,s),q(e.id,!1)},undo:()=>{E(),w&&i(e.slug)},onFail:()=>{E(),re.error(t("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,l=Ke(e),d=Ye(e),w=[...l?[{label:t("Dynamic"),tone:"info"}]:[],...d?[{label:t("Lightbox"),tone:"success"}]:[],...e.draft?[{label:t("draft"),tone:"draft"}]:[]],E=w.length>0?w:void 0,s=!!z&&Xe(e),C=s||g.pageCreationInAdminForm||o?S(ne,{children:[s&&n(O,{kind:"plain",label:t("Duplicate “{name}”",{name:e.label}),disabled:r,onClick:()=>G(e),children:n(Ge,{size:13})}),g.pageCreationInAdminForm&&n(O,{kind:"plain",label:t("Page settings for “{name}”",{name:e.label}),onClick:()=>ke(e.slug),children:n(Te,{size:13})}),o&&n(O,{kind:"delete",label:t("Delete “{name}”",{name:e.label}),disabled:r,onClick:()=>Se(e),children:n(j,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]}):void 0;return n(de,{icon:n(He,{size:14}),name:e.label,selected:a,onSelect:()=>i(e.slug),badge:E,actions:C,rowProps:{"data-page-slug":e.slug}},e.id)},U=(e,a,o)=>{const l=o.filter(Boolean);if(l.length===0)return null;const d=ye(e);return S(Re,{children:[n(_e,{count:l.length,countLabel:Ve("{n} page","{n} pages",l.length),expanded:d,onToggle:()=>be(e),children:a}),d&&l]},e)},ee=(p?.rows??[]).filter(e=>V(e.label)).map(e=>{const a=k===e.key;return n(de,{icon:e.icon,name:e.label,selected:a,onSelect:()=>I(e.key),badge:{label:t("Preview"),tone:"warning"},actions:n(O,{kind:"plain",label:t("Open the {name} in a new tab",{name:e.label}),onClick:()=>window.open(e.href,"_blank","noopener,noreferrer"),children:n(j,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})}),rowProps:{"data-shop-surface":e.key}},e.key)}),te=g.hasSiteSettings&&!!p,W=(()=>{if(u===null)return null;const e=[];let a=!1;for(const o of Pe){te&&!a&&o.key.startsWith("system:")&&(e.push(U("shop",p.title,ee)),a=!0);const l=o.key===qe||o.label===Je?t(o.label):o.label;e.push(U(o.key,l,o.rows.map(Ie)))}return te&&!a&&e.push(U("shop",p.title,ee)),e})();return S("div",{className:"sf-pages",children:[n(ve,{icon:n(Ue,{}),title:t("Pages"),context:me,actions:n(Oe,{buttonRef:$,label:v?t("Add"):t("New page"),hasPopup:v?"menu":void 0,expanded:v?P!==null:void 0,onClick:Ce,children:n(ze,{size:15})})}),P&&n(Fe,{portal:!0,style:{top:P.top,right:P.right},onClose:()=>y(null),children:S("div",{role:"menu","aria-label":t("Add"),children:[n(ie,{role:"menuitem",onClick:()=>{y(null),X()},children:t("Page")}),n(ie,{role:"menuitem",disabled:r,onClick:()=>{y(null),we()},children:t("Popup")})]})}),n("div",{className:"sf-pages-find",children:n(le,{type:"search",leftIcon:n(j,{name:"search",size:14,rounded:!0}),placeholder:t("Search all pages…"),value:M,onChange:e=>fe(e.target.value),"aria-label":t("Search all pages")})}),D&&!J&&n("div",{className:"sf-note sf-note--error",role:"alert",children:D}),W===null?n("div",{className:"sf-note",children:t("Loading…")}):W.some(Boolean)?n(Me,{ariaLabel:t("Pages"),className:"sf-scroll",children:W}):n("div",{className:"sf-note",children:M.trim()?t("No pages match your search"):t("No pages yet. Add one with + above.")}),z&&b&&n(Ze,{source:{title:b.label,slug:b.slug},taken:N,host:et(),duplicate:e=>z(b,e),onClose:()=>G(null),onDuplicated:e=>{G(null),F(),i(e.slug)}},b.id),n(Le,{open:J,onClose:()=>x(!1),size:"sm",title:t("Add a page"),description:t("Give the new template page a name. It starts blank — add sections once it opens."),footer:S(ne,{children:[n(se,{variant:"secondary",onClick:()=>x(!1),children:t("Cancel")}),n(se,{onClick:()=>{Z()},disabled:r||!h.trim(),loading:r,children:t("Add page")})]}),children:n(Be,{label:t("Page name"),htmlFor:Q,hint:h.trim()?t("URL: /{slug}",{slug:ue(h,N)}):void 0,error:D??void 0,children:n(le,{id:Q,value:h,invalid:!!D,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key==="Enter"&&Z()},placeholder:t("e.g. About")})})})]})}export{ot as default};
1
+ "use client";import{jsx as t,Fragment as we,jsxs as A}from"react/jsx-runtime";import{Fragment as ye,useEffect as ke,useMemo as $,useRef as Ce,useState as d}from"react";import{useScreenDocument as ee}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as G}from"efficient-easel/draw/client";import Ie from"efficient-easel/screen/components/SidePanelHead";import{useWebsiteName as Re}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as Ae}from"efficient-easel/chrome";import{Input as De,PopupMenu as xe,PopupMenuItem as te,toast as ne}from"efficient-shell/ui";import{LayersTree as Oe,TreeGroupLabel as Ee,TreeRow as oe,TreeRowAction as D}from"efficient-easel/tree";import{AddIcon as Ne,DuplicateIcon as Le,PageIcon as Be,SettingsIcon as Me}from"efficient-easel/icons";import{PagesIcon as _e}from"efficient-easel/rail";import{useEaselHost as Fe}from"efficient-easel/screen/lib/host";import{bucketEditorPageRows as ve,DYNAMIC_PAGES_GROUP_KEY as ze,isDynamicPageRow as Ge,isPopupPageRow as He,MAIN_PAGES_GROUP as We}from"../../format/lib/editor-page-rows.js";import{useEaselSession as H}from"efficient-easel/screen/lib/session-context";import{holdPageRow as W,usePageRows as Te}from"../lib/page-rows.js";import{say as n,sayCount as je}from"../../format/lib/editor-words.js";import{canDuplicatePage as Ue,DuplicatePageDialog as Ye}from"efficient-easel/page-copy";import qe from"./AddPageWindow.js";import{backendOf as se}from"../lib/website-session.js";import{shopHost as Je}from"../../format/lib/web-runtime.js";import{newPopupPage as Ke}from"../../format/lib/popup/new-popup.js";const ae="sf-editor-pages-collapsed-groups";function Qe(){const r=H(),{siteId:x,templateId:S}=ee(),w=se(r).pages;if(!(!w.duplicate||S))return(u,y)=>w.duplicate(u.id,{...y,...x?{siteId:x}:{}})}function Ve({onNavigate:r,onClose:x,activeSurface:S,onPreviewSurface:w}){const u=H().chrome?.pageRows,y=Fe(),{adapter:k,capabilities:p,ready:T,currentSlug:j}=ee(),le=Re(),{rows:c,reload:O,setRows:U,getRows:re}=Te(),[E,ie]=d(""),[m,Y]=d(!1),[q,C]=d(null),[J,N]=d(!1),ce=!!se(H()).pages.createFromStarter,L=Qe(),[g,B]=d(null),[M,de]=d(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(ae);return new Set(e?JSON.parse(e):[])}catch{return new Set}});ke(()=>{try{window.localStorage.setItem(ae,JSON.stringify([...M]))}catch{}},[M]);const ue=e=>de(s=>{const o=new Set(s);return o.has(e)?o.delete(e):o.add(e),o}),pe=$(()=>ve(c??[]),[c]),_=E.trim().toLowerCase(),K=e=>!_||e.toLowerCase().includes(_),me=e=>_?!0:!M.has(e),F=$(()=>new Set((c??[]).map(e=>e.slug)),[c]),Q=()=>{if(p.pageCreationInAdminForm&&!ce){y.send("storefront-editor:new-page");return}C(null),N(!0)},I=p.hasSiteSettings&&!!k.createPage,ge=async()=>{if(!(!T||m||!k.createPage)){Y(!0),C(null);try{const e=await k.createPage(Ke(n("New popup"),F));await O(),r(e.slug)}catch{C(n("Couldn’t add the popup — please retry."))}finally{Y(!1)}}},V=Ce(null),[f,h]=d(null),fe=()=>{if(!I)return Q();if(f)return h(null);const e=V.current?.getBoundingClientRect();e&&h({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)})},he=e=>{const s=c??[],o=k.deletePage;if(!T||m||!o||s.length<=1)return;const l=s.findIndex(a=>a.id===e.id),i=s.filter(a=>a.id!==e.id),b=e.slug===j;W(e.id,!0),U(i),C(null),b&&i[0]&&r(i[0].slug);const R=()=>{W(e.id,!1);const a=re()??[];if(a.some(Se=>Se.id===e.id))return;const P=[...a];P.splice(Math.max(0,Math.min(l,P.length)),0,e),U(P)};ne.undoable(n("Deleted “{name}”",{name:e.label}),{actionLabel:n("Undo"),commit:async a=>{await o(e.id,a),W(e.id,!1)},undo:()=>{R(),b&&r(e.slug)},onFail:()=>{R(),ne.error(n("Couldn’t delete the page — please retry."))}})},be=e=>y.send("storefront-editor:open-page",{slug:e}),Pe=e=>{if(!K(e.label))return null;const s=!S&&e.slug===j,o=p.canDeletePagesInline&&(c??[]).length>1,l=Ge(e),i=He(e),b=[...l?[{label:n("Dynamic"),tone:"info"}]:[],...i?[{label:n("Lightbox"),tone:"success"}]:[],...e.draft?[{label:n("draft"),tone:"draft"}]:[]],R=b.length>0?b:void 0,a=!!L&&Ue(e),P=a||p.pageCreationInAdminForm||o?A(we,{children:[a&&t(D,{kind:"plain",label:n("Duplicate “{name}”",{name:e.label}),disabled:m,onClick:()=>B(e),children:t(Le,{size:13})}),p.pageCreationInAdminForm&&t(D,{kind:"plain",label:n("Page settings for “{name}”",{name:e.label}),onClick:()=>be(e.slug),children:t(Me,{size:13})}),o&&t(D,{kind:"delete",label:n("Delete “{name}”",{name:e.label}),disabled:m,onClick:()=>he(e),children:t(G,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]}):void 0;return t(oe,{icon:t(Be,{size:14}),name:e.label,selected:s,onSelect:()=>r(e.slug),badge:R,actions:P,rowProps:{"data-page-slug":e.slug}},e.id)},v=(e,s,o)=>{const l=o.filter(Boolean);if(l.length===0)return null;const i=me(e);return A(ye,{children:[t(Ee,{count:l.length,countLabel:je("{n} page","{n} pages",l.length),expanded:i,onToggle:()=>ue(e),children:s}),i&&l]},e)},X=(u?.rows??[]).filter(e=>K(e.label)).map(e=>{const s=S===e.key;return t(oe,{icon:e.icon,name:e.label,selected:s,onSelect:()=>w(e.key),badge:{label:n("Preview"),tone:"warning"},actions:t(D,{kind:"plain",label:n("Open the {name} in a new tab",{name:e.label}),onClick:()=>window.open(e.href,"_blank","noopener,noreferrer"),children:t(G,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})}),rowProps:{"data-shop-surface":e.key}},e.key)}),Z=p.hasSiteSettings&&!!u,z=(()=>{if(c===null)return null;const e=[];let s=!1;for(const o of pe){Z&&!s&&o.key.startsWith("system:")&&(e.push(v("shop",u.title,X)),s=!0);const l=o.key===ze||o.label===We?n(o.label):o.label;e.push(v(o.key,l,o.rows.map(Pe)))}return Z&&!s&&e.push(v("shop",u.title,X)),e})();return A("div",{className:"sf-pages",children:[t(Ie,{icon:t(_e,{}),title:n("Pages"),context:le,actions:t(Ae,{buttonRef:V,label:I?n("Add"):n("New page"),hasPopup:I?"menu":void 0,expanded:I?f!==null:void 0,onClick:fe,children:t(Ne,{size:15})})}),f&&t(xe,{portal:!0,style:{top:f.top,right:f.right},onClose:()=>h(null),children:A("div",{role:"menu","aria-label":n("Add"),children:[t(te,{role:"menuitem",onClick:()=>{h(null),Q()},children:n("Page")}),t(te,{role:"menuitem",disabled:m,onClick:()=>{h(null),ge()},children:n("Popup")})]})}),t("div",{className:"sf-pages-find",children:t(De,{type:"search",leftIcon:t(G,{name:"search",size:14,rounded:!0}),placeholder:n("Search all pages…"),value:E,onChange:e=>ie(e.target.value),"aria-label":n("Search all pages")})}),q&&!J&&t("div",{className:"sf-note sf-note--error",role:"alert",children:q}),z===null?t("div",{className:"sf-note",children:n("Loading…")}):z.some(Boolean)?t(Oe,{ariaLabel:n("Pages"),className:"sf-scroll",children:z}):t("div",{className:"sf-note",children:E.trim()?n("No pages match your search"):n("No pages yet. Add one with + above.")}),L&&g&&t(Ye,{source:{title:g.label,slug:g.slug},taken:F,host:Je(),duplicate:e=>L(g,e),onClose:()=>B(null),onDuplicated:e=>{B(null),O(),r(e.slug)}},g.id),J?t(qe,{open:!0,onClose:()=>N(!1),takenSlugs:F,onCreated:e=>{N(!1),O(),r(e.slug)}}):null]})}export{Ve as default};
@@ -1 +1 @@
1
- "use client";import{jsx as d,Fragment as de,jsxs as ie}from"react/jsx-runtime";import{createContext as ue,useContext as fe,useLayoutEffect as V,useMemo as g,useRef as W,useState as F}from"react";import{useEasel as q,useSelectedFields as pe}from"efficient-easel/easel";import{fieldShownInView as me,Inspector as we,planFields as P}from"efficient-easel/fields";import{BUCKET_ICONS as he,RowPropsContext as be}from"../lib/document/controls.js";import{panelTab as ge}from"../../format/lib/document/panel-tabs.js";import{BUCKETS as ye}from"../lib/document/field-groups.js";import{say as xe}from"../../format/lib/editor-words.js";import{SameInEveryViewNote as Se}from"./SameInEveryViewNote.js";import{usePreviewDevice as ve}from"efficient-easel/draw/client";import{deviceField as Be}from"efficient-easel/screen/lib/document/device-fields";import{showWhenContext as Ce,visibleFields as U}from"../../render/lib/document/show-when.js";import{fieldsOfPart as Te}from"../../render/lib/document/hero-media-parts.js";import{bandIsDropped as ke,droppedBands as Ee,loneDesignBand as De,sameKeys as _e,TEXT_BAND_KEY as O,TEXT_BAND_TITLE as Fe,withoutBands as Pe}from"../../format/lib/document/panel-bands.js";const I=new Map,y=new Set;function X(o,r){const p=new Map;for(const t of o.querySelectorAll(".es-insp-row[data-field]"))p.set(t.getAttribute("data-field")??"",t);const i=[];for(const[t,h]of r)i.push({key:t,rows:h.map(x=>{const l=p.get(x),b=!!l&&[...l.children].some(S=>!S.hidden),m=l?.querySelector(".es-field-label, .es-list-label")?.textContent?.trim();return{shown:b,labelled:b&&!!m}})});return i}const Oe=Object.fromEntries(ye.map(o=>{const r=he[o];return[o,d(r,{},o)]})),Y=ue(null),Ie={_partBody:Be("each",{type:"custom",render:()=>d(Re,{})})};function Re(){return d(de,{children:fe(Y)})}function He({entries:o,entryCount:r=0,part:p=null,omit:i,motion:t,body:h,itemWord:x}){const{id:l,fields:b,values:m,readOnly:S,onChange:G}=pe(),a=g(()=>t?{...m,...t.values}:m,[m,t?.values]),H=(e,n)=>t?.keys.has(e)?t.onChange(e,n):G(e,n),v=ve(),{appState:R,config:z}=q(e=>e),B=Ce(v,z,R.data.content??[],R.ui.itemSelector),C=h===void 0?Te(b,p):Ie,j=g(()=>{const e=i?.length?Object.fromEntries(Object.entries(C).filter(([n])=>!i.includes(n))):C;return t?{...e,...t.fields}:e},[C,i,t?.fields]),w=U(j,a,B),[J,Q]=F(()=>new Set(y)),[T,Z]=F(()=>new Set),A=W(null),{bandRows:ee,designBands:te,looseRows:ne}=g(()=>{const e=new Map,n=new Set,f=[];for(const s of P(w).rows){if(!s.fold){s.bucket==="Design"&&f.push(s.name);continue}const c=e.get(s.fold.key)??[];c.push(s.name),e.set(s.fold.key,c),s.bucket==="Design"&&n.add(s.fold.key)}return{bandRows:e,designBands:n,looseRows:new Map([["",f]])}},[w]),k=me({},v),M={key:O,rows:Array.from({length:k?r:0},()=>({shown:!0,labelled:!0}))};V(()=>{const e=A.current?.parentElement;if(!e)return;const n=X(e,ee),f=new Set(Ee(n)),s=De([M,...n.filter(c=>te.has(c.key))],X(e,ne)[0].rows);s&&f.add(s),Z(c=>_e(c,f)?c:f)});const se=g(()=>Pe(w,T),[w,T]),oe=!ke(M)&&!T.has(O)?{key:O,title:Fe}:void 0,K=q(e=>e.selectedItem)!==null,N=t?.part??p??"",E=`${l}:${N}:${String(v)}`,[re,le]=F(()=>({tab:I.get(E)})),$=`${l}:${N}`,D=W(null),_={...B,node:a},L=P(w,{values:a,context:_}).buckets,u=ge({allTabs:K,remembered:I.get(E),inherited:D.current?.panel===$?D.current.tab:re.tab,buckets:L,hasText:k&&r>0}),ae=!k&&!L.includes(u)&&(P(U(j,a,{...B,device:"desktop"}),{values:a,context:{..._,device:"desktop"}}).buckets.includes(u)||u==="Design"&&r>0);V(()=>{D.current={panel:$,tab:u}});const ce=u==="Design";return d(Y.Provider,{value:h??null,children:d(be.Provider,{value:t?a:null,children:ie(we,{fields:se,values:a,onChange:H,readOnly:S,allTabs:K,showWhenContext:_,context:{itemWord:x},tab:u,onTab:e=>{I.set(E,e),le({tab:e})},tabIcons:Oe,idPrefix:l,ariaLabel:xe("Section settings"),lead:ce?o:null,leadFold:oe,closedFolds:J,onFold:(e,n)=>{n?y.delete(e):y.add(e),Q(new Set(y))},children:[d("span",{ref:A,hidden:!0}),ae&&d(Se,{})]})})})}export{He as SiteFields,Oe as TAB_ICONS};
1
+ "use client";import{jsx as s,Fragment as X}from"react/jsx-runtime";import{createContext as q,useContext as z,useLayoutEffect as J,useMemo as B,useRef as Q,useState as O}from"react";import{useEasel as D,useSelectedFields as Z}from"efficient-easel/easel";import{fieldShownInView as ee,Inspector as te,LEAD_BAND_KEY as ne,planFields as I}from"efficient-easel/fields";import{BUCKET_ICONS as se,RowPropsContext as oe}from"../lib/document/controls.js";import{panelTab as re}from"../../format/lib/document/panel-tabs.js";import{BUCKETS as le}from"../lib/document/field-groups.js";import{say as ce}from"../../format/lib/editor-words.js";import{SameInEveryViewNote as ae}from"./SameInEveryViewNote.js";import{usePreviewDevice as de}from"efficient-easel/draw/client";import{deviceField as ie}from"efficient-easel/screen/lib/document/device-fields";import{showWhenContext as ue,visibleFields as k}from"../../render/lib/document/show-when.js";import{fieldsOfPart as fe}from"../../render/lib/document/hero-media-parts.js";const pe="Text",x=new Map,a=new Set,me=Object.fromEntries(le.map(l=>{const c=se[l];return[l,s(c,{},l)]})),j=q(null),he={_partBody:ie("each",{type:"custom",render:()=>s(be,{})})};function be(){return s(X,{children:z(j)})}function Oe({entries:l,entryCount:c=0,part:w=null,omit:d,motion:t,body:C,itemWord:A}){const{id:i,fields:K,values:u,readOnly:N,onChange:$}=Z(),n=B(()=>t?{...u,...t.values}:u,[u,t?.values]),L=(e,r)=>t?.keys.has(e)?t.onChange(e,r):$(e,r),f=de(),{appState:g,config:M}=D(e=>e),p=ue(f,M,g.data.content??[],g.ui.itemSelector),m=C===void 0?fe(K,w):he,y=B(()=>{const e=d?.length?Object.fromEntries(Object.entries(m).filter(([r])=>!d.includes(r))):m;return t?{...e,...t.fields}:e},[m,d,t?.fields]),S=k(y,n,p),[R,V]=O(()=>new Set(a)),T=ee({},f),W={key:ne,title:pe},E=D(e=>e.selectedItem)!==null,F=t?.part??w??"",h=`${i}:${F}:${String(f)}`,[U,Y]=O(()=>({tab:x.get(h)})),P=`${i}:${F}`,b=Q(null),v={...p,node:n},_=I(S,{values:n,context:v}).buckets,o=re({allTabs:E,remembered:x.get(h),inherited:b.current?.panel===P?b.current.tab:U.tab,buckets:_,hasText:T&&c>0}),G=!T&&!_.includes(o)&&(I(k(y,n,{...p,device:"desktop"}),{values:n,context:{...v,device:"desktop"}}).buckets.includes(o)||o==="Design"&&c>0);J(()=>{b.current={panel:P,tab:o}});const H=o==="Design";return s(j.Provider,{value:C??null,children:s(oe.Provider,{value:t?n:null,children:s(te,{fields:S,values:n,onChange:L,readOnly:N,allTabs:E,showWhenContext:v,context:{itemWord:A},tab:o,onTab:e=>{x.set(h,e),Y({tab:e})},tabIcons:me,idPrefix:i,ariaLabel:ce("Section settings"),lead:H?l:null,leadFold:W,closedFolds:R,onFold:(e,r)=>{r?a.delete(e):a.add(e),V(new Set(a))},children:G&&s(ae,{})})})})}export{Oe as SiteFields,me as TAB_ICONS};
@@ -1 +1 @@
1
- "use client";import{jsx as c,jsxs as Ct}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as he,useRef as g,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 _t}from"../lib/document/build-config.js";import{ChromeWrap as Pt}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as Tt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as Et}from"../lib/site-live-state.js";import{holdSiteWrites as yt}from"../../format/lib/site-writes.js";import{backendOf as H,blocksOf as Gt}from"../lib/website-session.js";import{useEaselSession as vt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as kt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Wt}from"../../format/lib/document/templateFields.js";import{setEditorPage as ue}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Ht}from"./EditorPagePathProvider.js";import{resolveSiteName as Rt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Ft,normalizeSiteWidth as It}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as bt}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as le}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as me}from"../../format/lib/content/container-gap.js";import Dt,{DocumentScreen as Mt}from"efficient-easel/screen/components/ScreenMount";import Nt from"./WebsiteHintsProvider.js";import{useScreenDocument as Ot}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as xt,siteThemeRow as Ut,themeEdited as At,themeSeeded as Lt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as zt}from"./PreviewFooterContext.js";import{PreviewChatProvider as Yt,DEFAULT_CHAT_PREVIEW as jt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Kt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Vt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Xt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Zt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as qt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Jt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Qt}from"efficient-easel/draw/client";import{CanvasPartsBridge as $t}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as er}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as tr}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as rr,DEFAULT_HEADING_COMPRESSION as or,DEFAULT_HEADING_TYPOGRAPHY as nr,DEFAULT_SWITCH_SHOWN as R,DEFAULT_SIZES as ir,DEFAULT_THEME_MODE as T,normalizeCornerRadius as ar,normalizeCornerStyle as cr,normalizeCardShadow as sr,normalizeCardGap as dr,normalizeHoverEffect as hr,IDENTITY_CARD_GAP as pe,IDENTITY_CARD_SHADOW as ur,IDENTITY_HOVER_EFFECT as lr,THEME_MODE_KEY as Se,THEME_STORAGE_KEY as mr,THEME_SWITCH_HIDE as fe,THEME_SWITCH_KEY as B}from"../../format/lib/theme.js";import{pictureShadowColor as pr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as Sr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as fr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as gr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as wr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as Cr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as _r}from"./PreviewChatContext.js";const Pr=()=>{if(typeof window>"u")return T;try{const s=window.localStorage.getItem(Se);return s==="light"||s==="dark"||s==="auto"?s:T}catch{return T}},ge=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Se,s)}catch{}},Tr=()=>{if(typeof window>"u")return R;try{return window.localStorage.getItem(B)!==fe}catch{return R}},Er=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(mr)}catch{}},we=s=>{if(!(typeof window>"u"))try{s?window.localStorage.removeItem(B):window.localStorage.setItem(B,fe)}catch{}};function yr(){const{adapter:s,capabilities:d,templateId:F,ready:_,token:u,siteId:a,currentSlug:I,currentKind:b}=Ot();f(()=>(ue(I,b),()=>ue(null,null)),[I,b]);const E=d.placeholderFrames,[Ce,D]=r(null),[_e,M]=r("");f(()=>{const e=s.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(l=>!i&&M(l??"")).catch(()=>{}),()=>{i=!0}},[_,u,F,s]);const[Pe,y]=r(T),[Te,G]=r(R),[N,O]=r({value:{selected:0,themes:[]},readFor:null}),Ee=N.value,[ye,x]=r(Sr),[Ge,U]=r(ir),[ve,A]=r(null),[ke,L]=r(or),[We,z]=r(null),[He,Y]=r(null),[Re,j]=r(pe),[Be,K]=r(null),[Fe,V]=r(null),[Ie,X]=r(null),[be,Z]=r(null),[v,q]=r(null),[k,J]=r(null),[De,Q]=r({}),Me=o(e=>Q(i=>({...i,...e})),[]),h=vt(),$=he(()=>_t(Tt(h),Gt(h)),[h]),Ne=he(()=>kt(Wt($,E),v,k),[$,E,v,k]),[Oe,ee]=r(nr),[xe,te]=r(null),[Ue,re]=r(null),[Ae,oe]=r(null),[Le,ne]=r(null),[ze,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(Pr()),G(Tr())},[]);const Ye=o(e=>{n.current=!0,Er(),ge(e),y(e)},[]),je=o(e=>{n.current=!0,we(e),G(e)},[]),Ke=o(e=>{n.current=!0,O(i=>At(i,e,a??""))},[a]),Ve=o(e=>{n.current=!0,x(e)},[]),Xe=o(e=>{n.current=!0,U(e)},[]),Ze=o(e=>{n.current=!0,A(e)},[]),qe=o(e=>{n.current=!0,L(e)},[]),Je=o(e=>{n.current=!0,z(e)},[]),Qe=o(e=>{n.current=!0,Y(e)},[]),$e=o(e=>{n.current=!0,j(e)},[]),et=o(e=>{n.current=!0,K(e)},[]),tt=o(e=>{n.current=!0,ee(e)},[]),[rt,ce]=r(null),[ot,nt]=r(null),it=o(e=>{n.current=!0,ce(e)},[]),at=o(e=>{n.current=!0,V(e)},[]),ct=o(e=>{n.current=!0,X(e)},[]),st=o(e=>{n.current=!0,Z(e)},[]),dt=o(e=>{n.current=!0,q(e)},[]),ht=o(e=>{n.current=!0,J(e)},[]),ut=o(e=>{n.current=!0,te(e)},[]),lt=o(e=>{n.current=!0,re(e)},[]),mt=o(e=>{n.current=!0,oe(e)},[]),pt=o(e=>{n.current=!0,ne(e)},[]),St=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=H(h).theme;if(!u||!d.hasSiteTheme||!e)return;const i=a??"";ae.current!==i&&(ae.current=i,n.current=!1);let l=!1;return e.get(a?{siteId:a}:void 0).then(t=>{if(l||n.current)return;ge(t.default_mode),we(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),O(Lt({selected:t.selected_preset,themes:t.theme_presets},i));const C=wr(t);x(C.fonts),U(C.sizes);const S=bt(t);Q(S),A(t.corner_radius_px===void 0?rr[cr(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,ar)),L(C.compression),z(t.card_shadow==null?ur:sr(t.card_shadow)),j(t.card_gap==null?pe:dr(t.card_gap)),K(t.hover_effect==null?lr:hr(t.hover_effect)),Y(pr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,It)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Ft)),q(w(t.block_gap,S.blockGapUnit,me)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,me)),ee(C.typography),ce(C.textStyles),nt(Cr(t)),te(t.hero_background_follows_width===!0),re(le(t.section_background_width)),oe(le(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[u,a,d.hasSiteTheme,h]);const ft=Vt({token:u,siteId:a,enabled:d.hasSiteSettings}),[gt,se]=r(jt),de=g(null),W=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await H(h).chat?.update(e,a?{siteId:a}:void 0),Et()}catch(i){throw p.current={...e,...p.current},i}},[h,a]);f(()=>yt(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const wt=o(e=>{W.current=!0,se(i=>({...i,...e})),!(!d.hasSiteSettings||!u)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[d.hasSiteSettings,u,P]);return f(()=>{if(!u||!d.hasSiteSettings)return;const e=a??"";de.current!==e&&(de.current=e,W.current=!1);let i=!1;const l=H(h).chat;if(l)return l.get(a?{siteId:a}:void 0).then(t=>{i||W.current||se(_r(t))}).catch(()=>{}),()=>{i=!0}},[u,a,d.hasSiteSettings,h]),f(()=>{const e=s.site;if(!_||!d.hasSiteRecord||!e){D(null);return}let i=!1;return e().then(l=>{i||D(Rt(l.name))}).catch(()=>{}),()=>{i=!0}},[_,u,d.hasSiteRecord,a,s]),c(Mt,{config:Ne,parts:fr,wrap:(e,i)=>c(xt,{websiteName:Ce,templateChrome:E,templateName:_e||null,themeMode:Pe,onThemeModeChange:Ye,themeSwitchShown:Te,onThemeSwitchShownChange:je,theme:Ee,themeRow:Ut(d.hasSiteTheme,N.readFor,a??""),onThemeChange:Ke,fonts:ye,onFontsChange:Ve,cornerRadiusPx:ve,onCornerRadiusPxChange:Ze,cardShadow:We,onCardShadowChange:Je,shadowColor:He,onShadowColorChange:Qe,cardGap:Re,onCardGapChange:$e,hoverEffect:Be,onHoverEffectChange:et,headingCompression:ke,onHeadingCompressionChange:qe,headingTypography:Oe,onHeadingTypographyChange:tt,textStyles:rt,onTextStylesChange:it,wordStyles:ot,sizes:Ge,onSizesChange:Xe,siteWidth:Fe,onSiteWidthChange:at,siteGutter:Ie,onSiteGutterChange:ct,siteGutterPhone:be,onSiteGutterPhoneChange:st,blockGap:v,onBlockGapChange:dt,blockGapPhone:k,onBlockGapPhoneChange:ht,siteLengthUnits:De,onSiteLengthUnitsChange:Me,heroBackgroundFollowsWidth:xe,onHeroBackgroundFollowsWidthChange:ut,sectionBackgroundWidth:Ue,onSectionBackgroundWidthChange:lt,sectionContentWidth:Ae,onSectionContentWidthChange:mt,photographyGrayscale:Le,onPhotographyGrayscaleChange:pt,shareButtonOnPosts:ze,onShareButtonOnPostsChange:St,themeFromDocument:!d.hasSiteTheme,children:c(zt,{children:c(Pt,{wrap:h.chrome?.wrap,surface:"page",children:c(qt,{children:c(Jt,{children:c(Qt,{children:c(er,{children:c($t,{children:Ct(tr,{children:[c(Yt,{chat:gt,onChatChange:wt,children:c(Kt,{value:ft,children:c(Xt,{children:c(Ht,{children:c(Nt,{children:e})})})})}),i]})})})})})})})})})})}function Gr({target:s}){return c(Dt,{target:s,addressing:Zt,onHostMessage:gr,children:c(yr,{})})}export{Gr as default};
1
+ "use client";import{jsx as c,jsxs as wt}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as Ct,useRef as g,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{useHostConfig as _t}from"../lib/document/host-config.js";import{ChromeWrap as Pt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Tt}from"../lib/site-live-state.js";import{holdSiteWrites as Et}from"../../format/lib/site-writes.js";import{backendOf as W}from"../lib/website-session.js";import{useEaselSession as yt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Gt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as vt}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as kt}from"./EditorPagePathProvider.js";import{resolveSiteName as Ht}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Wt,normalizeSiteGutterPhone as Bt,normalizeSiteWidth as Rt}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as Ft}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import It,{DocumentScreen as Dt}from"efficient-easel/screen/components/ScreenMount";import bt from"./WebsiteHintsProvider.js";import{useScreenDocument as Mt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Nt,siteThemeRow as xt,themeEdited as Ot,themeSeeded as Ut}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as At}from"./PreviewFooterContext.js";import{PreviewChatProvider as Lt,DEFAULT_CHAT_PREVIEW as zt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Yt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as jt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Kt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Vt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Xt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Zt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as qt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Jt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as Qt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as $t}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as er,DEFAULT_HEADING_COMPRESSION as tr,DEFAULT_HEADING_TYPOGRAPHY as rr,DEFAULT_SWITCH_SHOWN as B,DEFAULT_SIZES as or,DEFAULT_THEME_MODE as T,normalizeCornerRadius as nr,normalizeCornerStyle as ir,normalizeCardShadow as ar,normalizeCardGap as cr,normalizeHoverEffect as sr,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as dr,IDENTITY_HOVER_EFFECT as hr,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as ur,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as R}from"../../format/lib/theme.js";import{pictureShadowColor as lr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as mr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as pr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as Sr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as fr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as gr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as wr}from"./PreviewChatContext.js";const Cr=()=>{if(typeof window>"u")return T;try{const s=window.localStorage.getItem(pe);return s==="light"||s==="dark"||s==="auto"?s:T}catch{return T}},fe=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,s)}catch{}},_r=()=>{if(typeof window>"u")return B;try{return window.localStorage.getItem(R)!==Se}catch{return B}},Pr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(ur)}catch{}},ge=s=>{if(!(typeof window>"u"))try{s?window.localStorage.removeItem(R):window.localStorage.setItem(R,Se)}catch{}};function Tr(){const{adapter:s,capabilities:d,templateId:F,ready:_,token:h,siteId:a,currentSlug:I,currentKind:D}=Mt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const E=d.placeholderFrames,[we,b]=r(null),[Ce,M]=r("");f(()=>{const e=s.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(u=>!i&&M(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,s]);const[_e,y]=r(T),[Pe,G]=r(B),[N,x]=r({value:{selected:0,themes:[]},readFor:null}),Te=N.value,[Ee,O]=r(mr),[ye,U]=r(or),[Ge,A]=r(null),[ve,L]=r(tr),[ke,z]=r(null),[He,Y]=r(null),[We,j]=r(me),[Be,K]=r(null),[Re,V]=r(null),[Fe,X]=r(null),[Ie,Z]=r(null),[v,q]=r(null),[k,J]=r(null),[De,Q]=r({}),be=o(e=>Q(i=>({...i,...e})),[]),l=yt(),$=_t(),Me=Ct(()=>Gt(vt($,E),v,k),[$,E,v,k]),[Ne,ee]=r(rr),[xe,te]=r(null),[Oe,re]=r(null),[Ue,oe]=r(null),[Ae,ne]=r(null),[Le,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(Cr()),G(_r())},[]);const ze=o(e=>{n.current=!0,Pr(),fe(e),y(e)},[]),Ye=o(e=>{n.current=!0,ge(e),G(e)},[]),je=o(e=>{n.current=!0,x(i=>Ot(i,e,a??""))},[a]),Ke=o(e=>{n.current=!0,O(e)},[]),Ve=o(e=>{n.current=!0,U(e)},[]),Xe=o(e=>{n.current=!0,A(e)},[]),Ze=o(e=>{n.current=!0,L(e)},[]),qe=o(e=>{n.current=!0,z(e)},[]),Je=o(e=>{n.current=!0,Y(e)},[]),Qe=o(e=>{n.current=!0,j(e)},[]),$e=o(e=>{n.current=!0,K(e)},[]),et=o(e=>{n.current=!0,ee(e)},[]),[tt,ce]=r(null),[rt,ot]=r(null),nt=o(e=>{n.current=!0,ce(e)},[]),it=o(e=>{n.current=!0,V(e)},[]),at=o(e=>{n.current=!0,X(e)},[]),ct=o(e=>{n.current=!0,Z(e)},[]),st=o(e=>{n.current=!0,q(e)},[]),dt=o(e=>{n.current=!0,J(e)},[]),ht=o(e=>{n.current=!0,te(e)},[]),ut=o(e=>{n.current=!0,re(e)},[]),lt=o(e=>{n.current=!0,oe(e)},[]),mt=o(e=>{n.current=!0,ne(e)},[]),pt=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=W(l).theme;if(!h||!d.hasSiteTheme||!e)return;const i=a??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(a?{siteId:a}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),x(Ut({selected:t.selected_preset,themes:t.theme_presets},i));const C=fr(t);O(C.fonts),U(C.sizes);const S=Ft(t);Q(S),A(t.corner_radius_px===void 0?er[ir(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,nr)),L(C.compression),z(t.card_shadow==null?dr:ar(t.card_shadow)),j(t.card_gap==null?me:cr(t.card_gap)),K(t.hover_effect==null?hr:sr(t.hover_effect)),Y(lr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,Rt)),X(w(t.site_gutter,S.siteGutterUnit,Wt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Bt)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),ot(gr(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,a,d.hasSiteTheme,l]);const St=jt({token:h,siteId:a,enabled:d.hasSiteSettings}),[ft,se]=r(zt),de=g(null),H=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await W(l).chat?.update(e,a?{siteId:a}:void 0),Tt()}catch(i){throw p.current={...e,...p.current},i}},[l,a]);f(()=>Et(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const gt=o(e=>{H.current=!0,se(i=>({...i,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[d.hasSiteSettings,h,P]);return f(()=>{if(!h||!d.hasSiteSettings)return;const e=a??"";de.current!==e&&(de.current=e,H.current=!1);let i=!1;const u=W(l).chat;if(u)return u.get(a?{siteId:a}:void 0).then(t=>{i||H.current||se(wr(t))}).catch(()=>{}),()=>{i=!0}},[h,a,d.hasSiteSettings,l]),f(()=>{const e=s.site;if(!_||!d.hasSiteRecord||!e){b(null);return}let i=!1;return e().then(u=>{i||b(Ht(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,d.hasSiteRecord,a,s]),c(Dt,{config:Me,parts:pr,wrap:(e,i)=>c(Nt,{websiteName:we,templateChrome:E,templateName:Ce||null,themeMode:_e,onThemeModeChange:ze,themeSwitchShown:Pe,onThemeSwitchShownChange:Ye,theme:Te,themeRow:xt(d.hasSiteTheme,N.readFor,a??""),onThemeChange:je,fonts:Ee,onFontsChange:Ke,cornerRadiusPx:Ge,onCornerRadiusPxChange:Xe,cardShadow:ke,onCardShadowChange:qe,shadowColor:He,onShadowColorChange:Je,cardGap:We,onCardGapChange:Qe,hoverEffect:Be,onHoverEffectChange:$e,headingCompression:ve,onHeadingCompressionChange:Ze,headingTypography:Ne,onHeadingTypographyChange:et,textStyles:tt,onTextStylesChange:nt,wordStyles:rt,sizes:ye,onSizesChange:Ve,siteWidth:Re,onSiteWidthChange:it,siteGutter:Fe,onSiteGutterChange:at,siteGutterPhone:Ie,onSiteGutterPhoneChange:ct,blockGap:v,onBlockGapChange:st,blockGapPhone:k,onBlockGapPhoneChange:dt,siteLengthUnits:De,onSiteLengthUnitsChange:be,heroBackgroundFollowsWidth:xe,onHeroBackgroundFollowsWidthChange:ht,sectionBackgroundWidth:Oe,onSectionBackgroundWidthChange:ut,sectionContentWidth:Ue,onSectionContentWidthChange:lt,photographyGrayscale:Ae,onPhotographyGrayscaleChange:mt,shareButtonOnPosts:Le,onShareButtonOnPostsChange:pt,themeFromDocument:!d.hasSiteTheme,children:c(At,{children:c(Pt,{wrap:l.chrome?.wrap,surface:"page",children:c(Xt,{children:c(Zt,{children:c(qt,{children:c(Qt,{children:c(Jt,{children:wt($t,{children:[c(Lt,{chat:ft,onChatChange:gt,children:c(Yt,{value:St,children:c(Kt,{children:c(kt,{children:c(bt,{children:e})})})})}),i]})})})})})})})})})})}function Er({target:s}){return c(It,{target:s,addressing:Vt,onHostMessage:Sr,children:c(Tr,{})})}export{Er as default};
@@ -1685,6 +1685,77 @@
1685
1685
  .sf-pages > .sf-note--error {
1686
1686
  margin-top: var(--space-4);
1687
1687
  }
1688
+ /* ── The Add page window (components/AddPageWindow) ─────────────────────────
1689
+ The window, its head, the list down the left and the grid are the shell's
1690
+ (Dialog `full`, SidebarLayout, Grid); what is left is the main area's inset,
1691
+ its two lines of words, the gap above "From your template", and the card.
1692
+ The window is portalled to <body>, outside the screen's `.sf-editor` scope,
1693
+ so it reads the shell's own root tokens (`--ink*`, `--line`). */
1694
+ .sf-add-page {
1695
+ padding: var(--space-32) var(--space-48);
1696
+ }
1697
+ .sf-add-page-title {
1698
+ margin: 0;
1699
+ font-size: var(--text-xl);
1700
+ font-weight: 600;
1701
+ color: var(--ink-strongest);
1702
+ }
1703
+ /* The heading takes the window's first focus (initialFocus), so a mouse open
1704
+ draws no ring on "+ Blank page". It is not a control: no ring of its own. */
1705
+ .sf-add-page-title:focus {
1706
+ outline: none;
1707
+ }
1708
+ /* The list's rows on the same side gutter as "+ Blank page" above them, so the
1709
+ selected row's fill and the button line up. */
1710
+ .sf-add-page-nav {
1711
+ padding: 0 var(--space-8);
1712
+ }
1713
+ .sf-add-page-sub {
1714
+ margin: var(--space-8) 0 var(--space-32);
1715
+ font-size: var(--text-sm);
1716
+ color: var(--ink);
1717
+ }
1718
+ .sf-add-page-group {
1719
+ margin-top: var(--space-32);
1720
+ }
1721
+ /* One card: the picture, then its name. The picture is a live drawing in its
1722
+ own frame, inert; "Add page" lies over it on hover or keyboard focus. */
1723
+ .sf-starter {
1724
+ display: flex;
1725
+ flex-direction: column;
1726
+ gap: var(--space-12);
1727
+ }
1728
+ .sf-starter-picture {
1729
+ position: relative;
1730
+ overflow: hidden;
1731
+ border: 1px solid var(--line);
1732
+ border-radius: var(--radius-sm);
1733
+ }
1734
+ .sf-starter-frame {
1735
+ pointer-events: none;
1736
+ }
1737
+ /* The card's frame is a picture inside a bordered card: no floating shadow of
1738
+ the canvas's own (efficient-easel `.es-canvas-frame`). */
1739
+ .sf-starter-frame .es-canvas-frame {
1740
+ box-shadow: none;
1741
+ }
1742
+ .sf-starter-add {
1743
+ position: absolute;
1744
+ inset: 0;
1745
+ display: flex;
1746
+ align-items: center;
1747
+ justify-content: center;
1748
+ opacity: 0;
1749
+ transition: opacity 0.12s;
1750
+ }
1751
+ .sf-starter:hover .sf-starter-add,
1752
+ .sf-starter:focus-within .sf-starter-add {
1753
+ opacity: 1;
1754
+ }
1755
+ .sf-starter-name {
1756
+ font-size: var(--text-sm);
1757
+ color: var(--ink-strongest);
1758
+ }
1688
1759
  /* `.sf-pgroup*` and `.sf-prow` WERE HERE: the Pages headings are the shell's
1689
1760
  `TreeGroupLabel` (its count pill and fold), its rows the shell's `TreeRow`. */
1690
1761
  /* `.sf-page-draft`, `.sf-badge-dynamic` and `.sf-badge-lightbox` WERE HERE: a
@@ -1 +1 @@
1
- import{jsx as t,jsxs as S}from"react/jsx-runtime";import{ButtonIcon as B,ButtonIconIcon as C,IconAfterTextIcon as _,IconBeforeTextIcon as w}from"efficient-easel/icons";import{SettingsField as O}from"efficient-easel/panel";import{useSelectedFields as m}from"efficient-easel/easel";import{buttonFieldSet as k}from"efficient-easel/screen/lib/document/button-fields";import{VIEW_KEY_ACCESS as F}from"efficient-easel/screen/lib/document/box-fields";import{IconPicker as v,Segmented as N}from"efficient-shell/ui";import{shellGlyphOf as R}from"../../../shell-glyph.js";import{StorefrontTextLinkField as P}from"../../../../../components/StorefrontLinkField.js";import{usePreviewHeader as a}from"../../../../../../render/components/PreviewHeaderContext.js";import{BUTTON_ICONS as W,buttonIconChoice as L,buttonIconSide as E,buttonWidth as A}from"../../../../../../format/lib/content/button-icon.js";import{BUTTON_PAD_BUILT_IN as j,buttonLook as u}from"../../../../../../render/lib/content/button-look.js";import{nonEmptyString as U}from"../../../../../../format/lib/non-empty-string.js";import{selectedThemeColors as z,siteButtonPaint as p,siteButtonRadiusPx as D}from"../../../../../../format/lib/theme.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{backTo as K,buttonWordsEntryField as G,hidableText as H,inOwnBox as V,linkField as Y,plainText as q,useSelectedSibling as f}from"../../../controls.js";import{useThemePresets as J}from"../../../ColourControl.js";import{keptByRow as c}from"efficient-easel/screen/lib/document/style-fields";import{group as h}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as M,pickerNoneIcon as Q,rowSay as X,ShellIconWord as b}from"../../../box-fields.js";import{CARD_ROW_FACTS as Z,cardRowField as $,cardRowFields as ee,cardRowLinkField as oe,typedLinkField as te}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as ne}from"../../../../../../format/lib/content/card-template.js";import{consentWordsKept as ie,withConsentWordsRow as re}from"../../../consent-words-field.js";const d=e=>R(e==="none"?"no-symbol":e),se=W.map(e=>({value:e,icon:e==="none"?Q(d(e),t(b,{value:e})):d(e)})),I=q("Button");function le({value:e,onChange:n}){const o=m(),i=o.values.href,s=typeof e=="string"?e:e&&typeof e=="object"&&"text"in e?String(e.text??""):"";return o.fields&&"href"in o.fields?t(P,{label:"Button",icon:t(B,{size:18}),text:s,onTextChange:n,link:typeof i=="string"?i:"",onLinkChange:l=>o.onChange("href",l)}):I.render({value:s,field:{label:"Button"},onChange:l=>n(H(l))})}function ce({value:e,onChange:n}){const o=m(),i=L(e,o.values.arrow),s=E(o.values.iconPosition),l=A(o.values.widthFit)==="fill",g=d("icon-at-end");return t(O,{label:r("Icon"),icon:t(C,{size:18}),value:i==="none"?void 0:t(b,{value:i}),children:S("div",{className:"flex items-center gap-2",children:[t(v,{label:r("Icon"),value:i,options:se,onChange:n}),i!=="none"&&t(N,{size:"sm",block:!0,label:r("Icon position"),value:s==="end"&&!l?"after":s,onChange:y=>o.onChange("iconPosition",y),options:[{value:"before",icon:t(w,{size:16}),label:t("span",{className:"sr-only",children:r("Icon before text")}),title:r("Icon before text")},{value:"after",icon:t(_,{size:16}),label:t("span",{className:"sr-only",children:r("Icon after text")}),title:r("Icon after text")},...l?[{value:"end",icon:g,label:t("span",{className:"sr-only",children:r("Icon at the far end")}),title:r("Icon at the far end")}]:[]]})]})})}const x=()=>p(a().theme),T=k({lengthUnits:M,follows:{useFill:()=>x().fill,useText:()=>x().ink,useBorder:()=>{const[e]=f("variant"),[n]=f("buttonColor"),{theme:o}=a(),i=u({variant:e,buttonColor:n}).border.width,s=U(n)??(e==="ghost"?z(o).text:p(o).fill);return{width:i,color:s}},useCorners:()=>D(a().cornerRadiusPx),useFillOpacity:()=>u({variant:f("variant")[0]}).fillOpacity},usePresets:J,resetTo:e=>K(e,r("Styles")),padding:{fallback:j,tablet:!0},phone:F,say:X});function ae(e,n){const o=Object.keys(e);return Object.fromEntries(o.slice(0,o.indexOf(n)+1).map(i=>[i,e[i]]))}const Pe={fields:{label:V(I,e=>t(le,{value:e.value,onChange:e.onChange})),labelText:G("label"),href:te({...Y("Button link"),...c("label")}),consentWords:ie("label"),_gButton:h("Button"),rowField:$("Shows","text"),[ne]:oe(),...ae(T,"_dDesign"),_gStyle:h("Style"),variant:c("buttonColor"),icon:{type:"custom",render:e=>t(ce,{value:e.value,onChange:e.onChange})},iconPosition:c("icon"),arrow:c("icon"),...T},resolveFields:(e,n)=>re(ee(n.fields,e,n),e.props,"label",["href"]),showWhenFacts:Z};export{Pe as ButtonBlockFields};
1
+ import{jsx as t,jsxs as y}from"react/jsx-runtime";import{ButtonIcon as B,ButtonIconIcon as C,IconAfterTextIcon as _,IconBeforeTextIcon as O}from"efficient-easel/icons";import{SettingsField as w}from"efficient-easel/panel";import{useSelectedFields as d}from"efficient-easel/easel";import{buttonFieldSet as k}from"efficient-easel/screen/lib/document/button-fields";import{VIEW_KEY_ACCESS as F}from"efficient-easel/screen/lib/document/box-fields";import{IconPicker as v,Segmented as N}from"efficient-shell/ui";import{shellGlyphOf as R}from"../../../shell-glyph.js";import{StorefrontTextLinkField as P}from"../../../../../components/StorefrontLinkField.js";import{usePreviewHeader as a}from"../../../../../../render/components/PreviewHeaderContext.js";import{BUTTON_ICONS as E,buttonIconChoice as W,buttonIconSide as L,buttonWidth as A}from"../../../../../../format/lib/content/button-icon.js";import{BUTTON_PAD_BUILT_IN as j,buttonLook as u}from"../../../../../../render/lib/content/button-look.js";import{nonEmptyString as U}from"../../../../../../format/lib/non-empty-string.js";import{selectedThemeColors as D,siteButtonPaint as p,siteButtonRadiusPx as z}from"../../../../../../format/lib/theme.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{backTo as G,buttonWordsEntryField as K,hidableText as H,inOwnBox as Y,linkField as V,plainText as q,useSelectedSibling as f}from"../../../controls.js";import{useThemePresets as J}from"../../../ColourControl.js";import{keptByRow as c}from"efficient-easel/screen/lib/document/style-fields";import{group as h}from"efficient-easel/screen/lib/document/box-fields";import{DESIGN_GROUP_KEY as M}from"efficient-easel/screen/lib/document/field-buckets";import{LENGTH_UNITS_TABLE as Q,pickerNoneIcon as X,rowSay as Z,ShellIconWord as b}from"../../../box-fields.js";import{CARD_ROW_FACTS as $,cardRowField as oo,cardRowFields as eo,cardRowLinkField as to,typedLinkField as no}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as io}from"../../../../../../format/lib/content/card-template.js";import{consentWordsKept as ro,withConsentWordsRow as so}from"../../../consent-words-field.js";const m=o=>R(o==="none"?"no-symbol":o),lo=E.map(o=>({value:o,icon:o==="none"?X(m(o),t(b,{value:o})):m(o)})),I=q("Button");function co({value:o,onChange:n}){const e=d(),i=e.values.href,s=typeof o=="string"?o:o&&typeof o=="object"&&"text"in o?String(o.text??""):"";return e.fields&&"href"in e.fields?t(P,{label:"Button",icon:t(B,{size:18}),text:s,onTextChange:n,link:typeof i=="string"?i:"",onLinkChange:l=>e.onChange("href",l)}):I.render({value:s,field:{label:"Button"},onChange:l=>n(H(l))})}function ao({value:o,onChange:n}){const e=d(),i=W(o,e.values.arrow),s=L(e.values.iconPosition),l=A(e.values.widthFit)==="fill",T=m("icon-at-end");return t(w,{label:r("Icon"),icon:t(C,{size:18}),value:i==="none"?void 0:t(b,{value:i}),children:y("div",{className:"flex items-center gap-2",children:[t(v,{label:r("Icon"),value:i,options:lo,onChange:n}),i!=="none"&&t(N,{size:"sm",block:!0,label:r("Icon position"),value:s==="end"&&!l?"after":s,onChange:g=>e.onChange("iconPosition",g),options:[{value:"before",icon:t(O,{size:16}),label:t("span",{className:"sr-only",children:r("Icon before text")}),title:r("Icon before text")},{value:"after",icon:t(_,{size:16}),label:t("span",{className:"sr-only",children:r("Icon after text")}),title:r("Icon after text")},...l?[{value:"end",icon:T,label:t("span",{className:"sr-only",children:r("Icon at the far end")}),title:r("Icon at the far end")}]:[]]})]})})}const x=()=>p(a().theme),S=k({lengthUnits:Q,follows:{useFill:()=>x().fill,useText:()=>x().ink,useBorder:()=>{const[o]=f("variant"),[n]=f("buttonColor"),{theme:e}=a(),i=u({variant:o,buttonColor:n}).border.width,s=U(n)??(o==="ghost"?D(e).text:p(e).fill);return{width:i,color:s}},useCorners:()=>z(a().cornerRadiusPx),useFillOpacity:()=>u({variant:f("variant")[0]}).fillOpacity},usePresets:J,resetTo:o=>G(o,r("Styles")),padding:{fallback:j,tablet:!0},phone:F,say:Z});function fo(o,n){const e=Object.keys(o);return Object.fromEntries(e.slice(0,e.indexOf(n)+1).map(i=>[i,o[i]]))}const Lo={fields:{label:Y(I,o=>t(co,{value:o.value,onChange:o.onChange})),labelText:K("label"),href:no({...V("Button link"),...c("label")}),consentWords:ro("label"),_gButton:h("Button"),rowField:oo("Shows","text"),[io]:to(),...fo(S,M.Design),_gStyle:h("Style"),variant:c("buttonColor"),icon:{type:"custom",render:o=>t(ao,{value:o.value,onChange:o.onChange})},iconPosition:c("icon"),arrow:c("icon"),...S},resolveFields:(o,n)=>so(eo(n.fields,o,n),o.props,"label",["href"]),showWhenFacts:$};export{Lo as ButtonBlockFields};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{phoneKey as i,tabletKey as l}from"efficient-easel/draw";import{keptByRow as ko}from"efficient-easel/screen/lib/document/style-fields";import{BOX_CARD_PAD as E,BOX_FILL_FADE_PROP as Fo,BOX_SWATCH_PROP as Ho,boxCardProps as Wo,boxIsCard as I}from"../../../../../../format/lib/content/box-background.js";import{BOX_IS_CARD_RULE as yo,BOX_IS_NOT_CARD_RULE as Bo,BOX_ROW_IMAGE_PROP as xo}from"../../../../../../format/lib/content/box-card-rule.js";import{CARD_ROW_FACTS as Uo,cardRowField as M,cardRowFields as Mo,cardRowLinkField as Ko,typedLinkField as Xo}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as Go,cardCopyPlace as K,cardTemplateCardOwner as Yo}from"../../../../../../format/lib/content/card-template.js";import{BOX_SHOW_KEY as vo,HOVER_GROUP_KEY as jo,HOVER_KEY as T}from"../../../../../../format/lib/animation/hover.js";import{BOX_HIGHLIGHT_ROW as Vo,BOX_NEXT_PICTURE_ROW as Jo}from"../../../../animation/hover-fields.js";import{darkenFields as zo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as qo,REEL_SHAPE_LABELS as Qo}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as X,CARD_LIST_STYLE_PICTURES as Zo,TAB_SHAPE_PICTURES as $o}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as A,CARD_STYLE_POINTS as oe,applyCardStyle as ee,isCardStyle as ne}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as te,ClockIcon as re,CropIcon as G,GapIcon as ie,MediaLayoutStackedIcon as Y,LineBetweenIcon as le,LineSolidIcon as ae,ListIcon as se,NumberedListIcon as v,ShadowIcon as de,StylesIcon as j,TableIcon as V,TargetIcon as ce,WrapIcon as J}from"efficient-easel/icons";import{boxBlockSpacingField as _e,boxFillField as pe,boxColumnsFields as Oe,boxShareField as Se,boxSharePhoneField as me,boxShareTabletField as fe,containerDirectionField as Re,containerGapRows as he,linkField as ue,plainText as Ce,swapPadding as z,toggle as c,upload as q,withPanelOnly as Ae}from"../../../controls.js";import{BOX_STACK_LINE as g,BOX_STACK_RANGE as R,STACK_BELOW_PROP as N}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as Q,boxShapeOf as we}from"../../../../../../format/lib/content/box-shape.js";import{BOX_ANGLE_PROP as Ee}from"../../../../../../format/lib/content/box-angle.js";import{shapeLines as Z}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as $}from"../../../shape-picker.js";import{ACCORDION_COLUMN_COUNTS as Te,ACCORDION_PHONE_COLUMN_COUNTS as Ne,BOX_COLUMNS_MAX as P,BOX_COLUMNS_MIN as b,boxPhoneRowOneLine as De,boxWrapWordOf as oo}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as eo}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as no,VIEW_KEY_ACCESS as s,group as h,phoneTwinFields as d}from"efficient-easel/screen/lib/document/box-fields";import{angleRow as Le,boxAlignField as Ie,boxJustifyField as ge,boxWrapField as D,iconPickerRow as k,placementField as Pe,select as F,sidesPaddingFields as to,slider as ro}from"../../../box-fields.js";import{withRowRules as be,withShowWhen as H}from"../../../../../../render/lib/document/show-when.js";import{separatorField as ke}from"../../../separator-field.js";import{LOOP_SCROLLS as Fe}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as He,TICKER_JOIN_OPTIONS as We}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as io}from"../../../../../../format/lib/document/passes/document-position.js";import{BOX_SIDE_SPACE_PROP as lo}from"../../../../../../format/lib/content/box-side-space.js";import{boxSideSpaceField as ye}from"../../../box-side-space-field.js";import{accordionOnSet as Be}from"../../../box-accordion-seed.js";import{ACCORDION_ROW_STYLE_POINTS as xe,ACCORDION_ROW_STYLE_PROP as L}from"../../../../../../format/lib/content/accordion-row-style.js";import{FlexSlots as ao}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as Ue,CONTAINER_BLOCKS_SLOT as Me}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as Ke}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as Xe,ON_A_CARD as so,ON_A_PICTURE_OR_CARD as Ge,cardDisplayField as W}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Ye,MIRROR_CARDS_MIRRORS as ve,mirrorCardsField as je}from"../../../mirror-cards-field.js";import{handedRowOf as co}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as Ve,showForField as Je,showForFields as ze}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as u,SHARED_COLUMNS_LABEL as _o,SHARED_COLUMNS_OFF as po,sharedColumnsDrawn as Oo,sharedColumnsFits as So,SHARED_COLUMNS_PHONE_POINTS as qe,SHARED_COLUMNS_POINTS as Qe,sharedRowsDrawn as Ze}from"../../../../../../render/lib/content/box-shared-columns.js";const mo=yo,fo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},$e={field:"direction",is:"tabs"},on={field:"line",in:[!0,!1]},en={field:"anchor",set:!0},y=["fixed","screen","fill"],nn={not:{any:[{field:"sectionHeightMode",in:y},{field:"sectionHeightModeTablet",in:y},{field:"sectionHeightModePhone",in:y}]}},tn={context:"parent.line",is:!0},_={not:{field:"direction",is:"accordion"}},Ro={field:"direction",is:"accordion"},ho={any:[_,{not:{field:L,in:["numbered","chevron"]}},{field:"columns",in:[...Te]},{field:"phoneRow",in:[...Ne]}]},uo="notAccordionRow",rn={not:{context:uo,is:!0}},ln={[uo]:(o,e)=>e.parent?.props?.direction!=="accordion"},B={field:"direction",is:"row",default:"row"},p={not:Fe},O={all:[B,p,{not:{field:"separator",in:eo.map(o=>o.value)}},{not:{field:"line",is:!0}}]},an={field:"direction",is:"column"},Co={all:[O,...["columns",l("columns")].map(o=>({not:{field:o,in:Array.from({length:P},(e,n)=>n+b)}}))]},sn={all:[p,{not:{all:[B,{field:"separator",in:eo.map(o=>o.value)}]}}]},x={not:{all:[O,{field:"columns",in:Array.from({length:P},(o,e)=>e+b)}]}},dn="sharedColumnsFits",Ao="sharedColumnsMisfit",wo="sharedColumnsDraws",Eo="sharedColumnsPhoneDraws";function S(o,e){return Wo(o.props??{},K(e.appState,o.props?.id)?.inCopy!==!1)}const cn={[dn]:(o,e)=>So(S(o,e)),[Ao]:(o,e)=>!So(S(o,e)),[wo]:(o,e)=>Oo(S(o,e)).desktop,[Eo]:(o,e)=>Oo(S(o,e)).phone};function To(o){return{all:[{not:{context:Ao,is:!0}},{any:[so,{field:o,set:!0}]}]}}const m={not:{context:wo,is:!0}},C={not:{context:Eo,is:!0}},No="sharedRowsDraws",_n={[No]:(o,e)=>Ze(S(o,e))&&co(e.appState,o.props?.id)?.row===void 0},w={not:{context:No,is:!0}},pn={any:[m,C]},U=Bo,On={not:{context:ve,is:!0}},Do="rowHanded",Sn={not:{context:Do,is:!0}},mn={[Do]:(o,e)=>{const n=co(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},Lo={all:[_,U,m,C,On]},fn={field:"direction",is:"row"},Rn={field:"align",in:["start","center","end"]},hn={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function un(){const{darken:o,darkenStyle:e}=zo();return{...d("darken",o,s),...d("darkenStyle",e,s)}}const Io={not:{all:[O,{field:l("columns"),in:Array.from({length:P},(o,e)=>e+b)}]}};function Cn(){const o=c(no,!1,r(J,{})),e=n=>{const t=oo(n);return t===void 0?void 0:t==="wrap"};return{...D(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:t=>n.onChange(t===void 0?void 0:t?"wrap":"nowrap")})}}function An(){const o=c(no,!0,r(J,{})),e=n=>{const t=oo(n);return t===void 0?void 0:t==="wrap"};return{...D(),render:n=>{const t=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!De(void 0,t?n.follows:void 0),followsNoView:!t,onChange:f=>n.onChange(f===void 0?void 0:f?"wrap":"nowrap")})}}}const go={hint:g},Po={all:[U,{any:[an,{all:[O,Io,{not:{all:[Co,{field:l("share"),set:!0}]}}]}]}]},wn=H(a("desktop",ro("Narrows below",r(Y,{}),R.min,R.max,R.step,g,{kind:"breakpoint"},{clear:go,hint:"Under this screen width the side space narrows and the Phone Padding is used."})),Po);function En(o,e){const n=o;return!(N in n)||e.direction!=="column"?o:{...n,[N]:wn}}const Rt={fields:be({_gContent:h("Content"),rowTitle:ao.rowTitle,content:ao.content,_gCardDisplay:h("Display"),cardDisplay:W("desktop"),cardDisplayTablet:W("tablet"),cardDisplayPhone:W("mobile"),showFor:Je(),_gLayout:h("Layout"),direction:Re("Flex"),tabShape:k("Tab shape",r(j,{}),qo.map(o=>({label:Qo[o],value:o,picture:$o[o]})),"tabs",{columns:2,cell:X}),mirrorCards:je(),[N]:a("desktop",ro("Stacks below",r(Y,{}),R.min,R.max,R.step,g,{kind:"breakpoint"},{clear:go,hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),[lo]:ye(),startsOpen:a("desktop",c("Starts open",!1,r(te,{}))),[L]:a("desktop",k("Row style",r(v,{}),xe.map(o=>({...o,picture:o.value==="numbered"?r(v,{}):r(se,{})})),"plain",{columns:2})),label:Ae(Ce("Tab name")),...he("Flex"),...d("justify",ge(),s),...d("align",Ie(),s),...(()=>{const o=d("wrap",D(),s,{phoneRow:An()}),e=d("wrap",D(),s,{phoneRow:Cn()});return{wrap:e.wrap,[l("wrap")]:e[l("wrap")],[i("wrap")]:o[i("wrap")]}})(),[i("order")]:Ke(),...d("boxShape",$("Box shape",r(G,{}),Z(Q),"shape","auto"),s,{phoneRow:$("Box shape",r(G,{}),Z(Q),"shape","auto",{phoneRest:o=>we(o)})}),[Ee]:a("desktop",Le(0,{clear:{hint:0},hint:"Turns the box. 0° is straight."})),separator:ke(r(le,{size:18}),"none"),[A]:a("desktop",k("Card style",r(j,{}),oe.map(o=>({...o,picture:Zo[o.value]})),"table",{columns:2,cell:X})),share:a("desktop",Se()),[l("share")]:fe(),[i("share")]:me(),[u]:a("desktop",F(_o,r(V,{}),[...Qe],po)),[i(u)]:a("mobile",F(_o,r(V,{}),[...qe],po)),...Oe(),...d("blockSpacing",_e(),s),line:c("Line",!1,r(ae,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,r(re,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:F("Join",r(ie,{}),We,He),_gShadow:h("Shadow"),...d("shadow",c("Shadow",!1,r(de,{})),s),...d("fillColor",pe(),s),[Ho]:M("Fill content","colour"),[Fo]:ko("fillColor"),_gBackground:h("Background image"),bgImage:a("desktop",q("Image","image/*")),bgImagePhone:a("mobile",q("Image","image/*")),[xo]:M("Image content","image",{content:!0}),...un(),placement:Pe("Content position"),_gLink:h("Link"),link:Xo(ue("Link to")),[Go]:Ko(),jumpHighlight:c("Highlight when a link jumps here",!1,r(ce,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],mo],[[i("share")],{all:[fo,C]}],[[u],To(u)],[[i(u)],To(i(u))],[[i("wrap")],{all:[fo,p,C,w]}],[[i("order")],{all:[O,C,m]}],[["phoneRow"],C],[[L],{all:[Ro,{not:{field:L,is:"chevron"}}]}],[["tabShape"],$e],[["rowTitle","startsOpen"],rn],[["align","blockSpacing",l("blockSpacing"),i("blockSpacing")],_],[[l("justify"),i("justify")],{all:[p,Lo,w]}],[[l("align"),i("align")],{all:[fn,Rn,Lo]}],[[l("wrap")],{all:[p,x,Io,m,_,w]}],[[l("shadow"),i("shadow")],U],[[l("darken"),i("darken"),l("darkenStyle"),i("darkenStyle")],{all:[mo,hn]}],[["separator"],B],[[A],{field:A,set:!0}],[["columns"],{any:[O,Ro]}],[[l("columns")],O],[[N],Po],[[l("gap")],{all:[sn,ho]}],[["gap",i("gap")],ho],[["justify"],{all:[p,pn,_,w]}],[["wrap"],{all:[p,x,m,_,w]}],[["share"],{all:[x,m,_]}],[[l("share")],{all:[Co,m]}],[["line"],on],[["upcoming"],tn],[["jumpHighlight"],en],[["boxShape",l("boxShape"),i("boxShape")],nn],[["direction","share",i("order")],Sn],[["join"],io],[[lo],io]]),resolveData:(o,e)=>{const n=o.props,t=n[A];return e.changed?.[A]===!0&&ne(t)?{...o,props:ee(n,t,Ue,Me)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:Be(n)}:o},resolveFields:(o,e)=>{const n=K(e.appState,o.props?.id)?.inCopy===!0,t=n&&Yo(e.appState,o.props?.id)===null;return En(Dn(Ln(ze(In(o,{...e,fields:Mo(e.fields,o,e)}),o.props),S(o,e),n),t),o.props)},showWhenFacts:{...Uo,...Xe,...Ye,...mn,...cn,..._n,...Ve,...ln}},Tn=H(Vo,so),Nn=["darken","darkenStyle",jo,vo];function Dn(o,e){if(!e)return o;const n={...o};for(const t of Nn){if(!(t in n))continue;const{showWhen:f,...bo}=n[t];n[t]=bo}return n}function Ln(o,e,n=!1){const t=o;return T in t&&I(e)&&n?{...t,[T]:H(Jo,Ge)}:!(T in t)||I(e)?o:{...t,[T]:Tn}}function In(...[o,e]){const{fields:n}=e;{if(I(S(o,e))){const f=to({fallback:{top:E.desktop,bottom:E.desktop,left:E.side,right:E.side},tablet:!0,siteSide:!0});return z(n,f)}return o.props.padV2!==!0?z(n,to({fallback:{top:24,bottom:24},tablet:!0,siteSide:!0})):n}}export{Rt as FlexFields};
1
+ import{jsx as r}from"react/jsx-runtime";import{phoneKey as i,tabletKey as l}from"efficient-easel/draw";import{keptByRow as ko}from"efficient-easel/screen/lib/document/style-fields";import{BOX_CARD_PAD as E,BOX_FILL_FADE_PROP as Fo,BOX_SWATCH_PROP as Ho,boxCardProps as Wo,boxIsCard as I}from"../../../../../../format/lib/content/box-background.js";import{BOX_IS_CARD_RULE as yo,BOX_IS_NOT_CARD_RULE as Bo,BOX_ROW_IMAGE_PROP as xo}from"../../../../../../format/lib/content/box-card-rule.js";import{CARD_ROW_FACTS as Uo,cardRowField as M,cardRowFields as Mo,cardRowLinkField as Ko,typedLinkField as Xo}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as Go,cardCopyPlace as K,cardTemplateCardOwner as Yo}from"../../../../../../format/lib/content/card-template.js";import{BOX_SHOW_KEY as vo,HOVER_GROUP_KEY as jo,HOVER_KEY as T}from"../../../../../../format/lib/animation/hover.js";import{BOX_HIGHLIGHT_ROW as Vo,BOX_NEXT_PICTURE_ROW as Jo}from"../../../../animation/hover-fields.js";import{darkenFields as zo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as qo,REEL_SHAPE_LABELS as Qo}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as X,CARD_LIST_STYLE_PICTURES as Zo,TAB_SHAPE_PICTURES as $o}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as A,CARD_STYLE_POINTS as oe,applyCardStyle as ee,isCardStyle as ne}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as te,ClockIcon as re,CropIcon as G,GapIcon as ie,MediaLayoutStackedIcon as Y,LineBetweenIcon as le,LineSolidIcon as ae,ListIcon as se,NumberedListIcon as v,ShadowIcon as de,StylesIcon as j,TableIcon as V,TargetIcon as ce,WrapIcon as J}from"efficient-easel/icons";import{boxBlockSpacingField as _e,boxFillField as pe,boxColumnsFields as Oe,boxShareField as Se,boxSharePhoneField as me,boxShareTabletField as fe,containerDirectionField as Re,containerGapRows as he,linkField as ue,plainText as Ce,swapPadding as z,toggle as c,upload as q,withPanelOnly as Ae}from"../../../controls.js";import{BOX_STACK_LINE as g,BOX_STACK_RANGE as h,STACK_BELOW_PROP as N}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as Q,boxShapeOf as we}from"../../../../../../format/lib/content/box-shape.js";import{BOX_ANGLE_PROP as Ee}from"../../../../../../format/lib/content/box-angle.js";import{shapeLines as Z}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as $}from"../../../shape-picker.js";import{ACCORDION_COLUMN_COUNTS as Te,ACCORDION_PHONE_COLUMN_COUNTS as Ne,BOX_COLUMNS_MAX as P,BOX_COLUMNS_MIN as b,boxPhoneRowOneLine as De,boxWrapWordOf as oo}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as eo}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as no,VIEW_KEY_ACCESS as s,group as _,phoneTwinFields as d}from"efficient-easel/screen/lib/document/box-fields";import{angleRow as Le,boxAlignField as Ie,boxJustifyField as ge,boxWrapField as D,iconPickerRow as k,placementField as Pe,select as F,sidesPaddingFields as to,slider as ro}from"../../../box-fields.js";import{withRowRules as be,withShowWhen as H}from"../../../../../../render/lib/document/show-when.js";import{separatorField as ke}from"../../../separator-field.js";import{LOOP_SCROLLS as Fe}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as He,TICKER_JOIN_OPTIONS as We}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as io}from"../../../../../../format/lib/document/passes/document-position.js";import{BOX_SIDE_SPACE_PROP as lo}from"../../../../../../format/lib/content/box-side-space.js";import{boxSideSpaceField as ye}from"../../../box-side-space-field.js";import{accordionOnSet as Be}from"../../../box-accordion-seed.js";import{ACCORDION_ROW_STYLE_POINTS as xe,ACCORDION_ROW_STYLE_PROP as L}from"../../../../../../format/lib/content/accordion-row-style.js";import{FlexSlots as ao}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as Ue,CONTAINER_BLOCKS_SLOT as Me}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as Ke}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as Xe,ON_A_CARD as so,ON_A_PICTURE_OR_CARD as Ge,cardDisplayField as W}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Ye,MIRROR_CARDS_MIRRORS as ve,mirrorCardsField as je}from"../../../mirror-cards-field.js";import{handedRowOf as co}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as Ve,showForField as Je,showForFields as ze}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as u,SHARED_COLUMNS_LABEL as _o,SHARED_COLUMNS_OFF as po,sharedColumnsDrawn as Oo,sharedColumnsFits as So,SHARED_COLUMNS_PHONE_POINTS as qe,SHARED_COLUMNS_POINTS as Qe,sharedRowsDrawn as Ze}from"../../../../../../render/lib/content/box-shared-columns.js";const mo=yo,fo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},$e={field:"direction",is:"tabs"},on={field:"line",in:[!0,!1]},en={field:"anchor",set:!0},y=["fixed","screen","fill"],nn={not:{any:[{field:"sectionHeightMode",in:y},{field:"sectionHeightModeTablet",in:y},{field:"sectionHeightModePhone",in:y}]}},tn={context:"parent.line",is:!0},p={not:{field:"direction",is:"accordion"}},Ro={field:"direction",is:"accordion"},ho={any:[p,{not:{field:L,in:["numbered","chevron"]}},{field:"columns",in:[...Te]},{field:"phoneRow",in:[...Ne]}]},uo="notAccordionRow",rn={not:{context:uo,is:!0}},ln={[uo]:(o,e)=>e.parent?.props?.direction!=="accordion"},B={field:"direction",is:"row",default:"row"},O={not:Fe},S={all:[B,O,{not:{field:"separator",in:eo.map(o=>o.value)}},{not:{field:"line",is:!0}}]},an={field:"direction",is:"column"},Co={all:[S,...["columns",l("columns")].map(o=>({not:{field:o,in:Array.from({length:P},(e,n)=>n+b)}}))]},sn={all:[O,{not:{all:[B,{field:"separator",in:eo.map(o=>o.value)}]}}]},x={not:{all:[S,{field:"columns",in:Array.from({length:P},(o,e)=>e+b)}]}},dn="sharedColumnsFits",Ao="sharedColumnsMisfit",wo="sharedColumnsDraws",Eo="sharedColumnsPhoneDraws";function m(o,e){return Wo(o.props??{},K(e.appState,o.props?.id)?.inCopy!==!1)}const cn={[dn]:(o,e)=>So(m(o,e)),[Ao]:(o,e)=>!So(m(o,e)),[wo]:(o,e)=>Oo(m(o,e)).desktop,[Eo]:(o,e)=>Oo(m(o,e)).phone};function To(o){return{all:[{not:{context:Ao,is:!0}},{any:[so,{field:o,set:!0}]}]}}const f={not:{context:wo,is:!0}},C={not:{context:Eo,is:!0}},No="sharedRowsDraws",_n={[No]:(o,e)=>Ze(m(o,e))&&co(e.appState,o.props?.id)?.row===void 0},w={not:{context:No,is:!0}},pn={any:[f,C]},U=Bo,On={not:{context:ve,is:!0}},Do="rowHanded",Sn={not:{context:Do,is:!0}},mn={[Do]:(o,e)=>{const n=co(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},Lo={all:[p,U,f,C,On]},fn={field:"direction",is:"row"},Rn={field:"align",in:["start","center","end"]},hn={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function un(){const{darken:o,darkenStyle:e}=zo();return{...d("darken",o,s),...d("darkenStyle",e,s)}}const Io={not:{all:[S,{field:l("columns"),in:Array.from({length:P},(o,e)=>e+b)}]}};function Cn(){const o=c(no,!1,r(J,{})),e=n=>{const t=oo(n);return t===void 0?void 0:t==="wrap"};return{...D(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:t=>n.onChange(t===void 0?void 0:t?"wrap":"nowrap")})}}function An(){const o=c(no,!0,r(J,{})),e=n=>{const t=oo(n);return t===void 0?void 0:t==="wrap"};return{...D(),render:n=>{const t=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!De(void 0,t?n.follows:void 0),followsNoView:!t,onChange:R=>n.onChange(R===void 0?void 0:R?"wrap":"nowrap")})}}}const go={hint:g},Po={all:[U,{any:[an,{all:[S,Io,{not:{all:[Co,{field:l("share"),set:!0}]}}]}]}]},wn=H(a("desktop",ro("Narrows below",r(Y,{}),h.min,h.max,h.step,g,{kind:"breakpoint"},{clear:go,hint:"Under this screen width the side space narrows and the Phone Padding is used."})),Po);function En(o,e){const n=o;return!(N in n)||e.direction!=="column"?o:{...n,[N]:wn}}const Rt={fields:be({_gContent:_("Content"),rowTitle:ao.rowTitle,content:ao.content,_gCardDisplay:_("Display"),cardDisplay:W("desktop"),cardDisplayTablet:W("tablet"),cardDisplayPhone:W("mobile"),showFor:Je(),_gLayout:_("Layout"),direction:Re("Flex"),tabShape:k("Tab shape",r(j,{}),qo.map(o=>({label:Qo[o],value:o,picture:$o[o]})),"tabs",{columns:2,cell:X}),mirrorCards:je(),[N]:a("desktop",ro("Stacks below",r(Y,{}),h.min,h.max,h.step,g,{kind:"breakpoint"},{clear:go,hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),[lo]:ye(),startsOpen:a("desktop",c("Starts open",!1,r(te,{}))),[L]:a("desktop",k("Row style",r(v,{}),xe.map(o=>({...o,picture:o.value==="numbered"?r(v,{}):r(se,{})})),"plain",{columns:2})),label:Ae(Ce("Tab name")),...he("Flex"),...d("justify",ge(),s),...d("align",Ie(),s),...(()=>{const o=d("wrap",D(),s,{phoneRow:An()}),e=d("wrap",D(),s,{phoneRow:Cn()});return{wrap:e.wrap,[l("wrap")]:e[l("wrap")],[i("wrap")]:o[i("wrap")]}})(),[i("order")]:Ke(),...d("boxShape",$("Box shape",r(G,{}),Z(Q),"shape","auto"),s,{phoneRow:$("Box shape",r(G,{}),Z(Q),"shape","auto",{phoneRest:o=>we(o)})}),[Ee]:a("desktop",Le(0,{clear:{hint:0},hint:"Turns the box. 0° is straight."})),separator:ke(r(le,{size:18}),"none"),[A]:a("desktop",k("Card style",r(j,{}),oe.map(o=>({...o,picture:Zo[o.value]})),"table",{columns:2,cell:X})),share:a("desktop",Se()),[l("share")]:fe(),[i("share")]:me(),[u]:a("desktop",F(_o,r(V,{}),[...Qe],po)),[i(u)]:a("mobile",F(_o,r(V,{}),[...qe],po)),...Oe(),...d("blockSpacing",_e(),s),line:c("Line",!1,r(ae,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,r(re,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:F("Join",r(ie,{}),We,He),_gShadow:_("Shadow"),...d("shadow",c("Shadow",!1,r(de,{})),s),...d("fillColor",pe(),s),[Ho]:M("Fill content","colour"),[Fo]:ko("fillColor"),_gBackground:_("Background image"),bgImage:a("desktop",q("Image","image/*")),bgImagePhone:a("mobile",q("Image","image/*")),[xo]:M("Image content","image",{content:!0}),...un(),placement:Pe("Content position"),_gLink:_("Link"),link:Xo(ue("Link to")),[Go]:Ko(),_gJump:_("Anchor"),jumpHighlight:c("Highlight when a link jumps here",!1,r(ce,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],mo],[[i("share")],{all:[fo,C]}],[[u],To(u)],[[i(u)],To(i(u))],[[i("wrap")],{all:[fo,O,C,w]}],[[i("order")],{all:[S,C,f]}],[["phoneRow"],C],[[L],{all:[Ro,{not:{field:L,is:"chevron"}}]}],[["tabShape"],$e],[["rowTitle","startsOpen"],rn],[["align","blockSpacing",l("blockSpacing"),i("blockSpacing")],p],[[l("justify"),i("justify")],{all:[O,Lo,w]}],[[l("align"),i("align")],{all:[fn,Rn,Lo]}],[[l("wrap")],{all:[O,x,Io,f,p,w]}],[[l("shadow"),i("shadow")],U],[[l("darken"),i("darken"),l("darkenStyle"),i("darkenStyle")],{all:[mo,hn]}],[["separator"],B],[[A],{field:A,set:!0}],[["columns"],{any:[S,Ro]}],[[l("columns")],S],[[N],Po],[[l("gap")],{all:[sn,ho]}],[["gap",i("gap")],ho],[["justify"],{all:[O,pn,p,w]}],[["wrap"],{all:[O,x,f,p,w]}],[["share"],{all:[x,f,p]}],[[l("share")],{all:[Co,f]}],[["line"],on],[["upcoming"],tn],[["jumpHighlight"],en],[["boxShape",l("boxShape"),i("boxShape")],nn],[["direction","share",i("order")],Sn],[["join"],io],[[lo],io]]),resolveData:(o,e)=>{const n=o.props,t=n[A];return e.changed?.[A]===!0&&ne(t)?{...o,props:ee(n,t,Ue,Me)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:Be(n)}:o},resolveFields:(o,e)=>{const n=K(e.appState,o.props?.id)?.inCopy===!0,t=n&&Yo(e.appState,o.props?.id)===null;return En(Dn(Ln(ze(In(o,{...e,fields:Mo(e.fields,o,e)}),o.props),m(o,e),n),t),o.props)},showWhenFacts:{...Uo,...Xe,...Ye,...mn,...cn,..._n,...Ve,...ln}},Tn=H(Vo,so),Nn=["darken","darkenStyle",jo,vo];function Dn(o,e){if(!e)return o;const n={...o};for(const t of Nn){if(!(t in n))continue;const{showWhen:R,...bo}=n[t];n[t]=bo}return n}function Ln(o,e,n=!1){const t=o;return T in t&&I(e)&&n?{...t,[T]:H(Jo,Ge)}:!(T in t)||I(e)?o:{...t,[T]:Tn}}function In(...[o,e]){const{fields:n}=e;{if(I(m(o,e))){const R=to({fallback:{top:E.desktop,bottom:E.desktop,left:E.side,right:E.side},tablet:!0,siteSide:!0});return z(n,R)}return o.props.padV2!==!0?z(n,to({fallback:{top:24,bottom:24},tablet:!0,siteSide:!0})):n}}export{Rt as FlexFields};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{ColumnWidthsIcon as T,ColumnsIcon as E,LayoutIcon as P,MediaLayoutStackedIcon as O,PlacementIcon as b}from"efficient-easel/icons";import{deviceField as g}from"efficient-easel/screen/lib/document/device-fields";import{cardImageFields as I,text as s,textarea as R}from"../../../controls.js";import{group as n,section as m}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as h,segmented as i,slider as C}from"../../../box-fields.js";import{IMAGE_TEXT_ARRANGEMENT_PICTURES as A,LAYOUT_CELL as L}from"../../../choice-pictures.js";import{BLOCK_SOURCE_EDIT_PROP as x,blockSourceEditField as N,blockSourceField as w,blockSourceFields as v}from"../../../block-source-fields.js";import{declaredBlockSource as a}from"../../../../../../format/lib/content/block-sources.js";import{ARRANGEMENT_OPTIONS as F,IMAGE_WIDTH_OPTIONS as D,PHONE_ORDER_OPTIONS as G}from"../../../../../../format/lib/content/image-text-rows.js";import{PROCESS_STEPS_TYPE as c,imageTextRowTemplate as H}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/row-seed.js";import{CARD_TEMPLATE_SLOT as l}from"../../../../../../format/lib/content/card-row-keys.js";import{SPLITTABLE_SECTIONS as M,headFieldsForPlacement as W}from"../../../../../../format/lib/sections/section-head-placement.js";import{PH as k}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as y}from"../../../../../../render/lib/document/show-when.js";import{isNodeList as p}from"efficient-easel/data";import{seedNodeId as B}from"../../../../../../format/lib/document/seed-parts.js";import{PROCESS_PH as u,ProcessStepsSlots as d}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/meta.js";const S={field:"arrangement",in:["rows-left","rows-right"]},_="drawsLegacySteps",f={not:{context:_,is:!0}},Y={[_]:e=>{const o=e.props??{};return!a(o)&&!p(o.boxes)}},U=e=>e?.data?.root?.props??null,me={fields:y({_gSource:n("Source"),dataSource:w("Item content","Manual"),[x]:N(),_sHeader:m("Header"),_gContent:n("Content"),num:s("Number",u.num),title:s("Heading",u.title),description:R("Body",k.body),boxes:d.boxes,[l]:d[l],_dDesign:m("Design"),arrangement:h("Arrangement",r(P,{}),F.map(e=>({label:e.label,hint:e.hint,value:e.value,picture:A[e.value]})),"columns",{columns:3,cell:L}),imageWidth:i("Image width",r(T,{}),D.map(e=>({label:e.label,value:e.value})),"half"),phoneOrder:g("mobile",i("Order",r(O,{}),G.map(e=>({label:e.label,value:e.value})),"picture")),columns:C("Columns",r(E,{}),2,4,1,3),...I(),cardText:i("Text position",r(b,{}),[{label:"Below picture",value:"below"},{label:"On picture",value:"on-image"}],"below")},[[["cardText"],{not:{field:"boxes",set:!0}}],[["arrangement"],f],[["imageWidth","phoneOrder"],{all:[S,f]}],[["columns"],{not:S}]]),showWhenFacts:Y,resolveFields:(e,o)=>v(c,W(o.fields,e.props.headPlacement,M.ProcessSteps.headRows),e.props,{root:U(o.appState)}),resolveData:(e,o)=>{const t=e.props;return o?.changed?.dataSource!==!0||!a(t)||p(t[l])?e:{...e,props:{...t,[l]:H(B(t,c))}}}};export{me as ProcessStepsFields};
1
+ import{jsx as r}from"react/jsx-runtime";import{ColumnWidthsIcon as E,ColumnsIcon as T,LayoutIcon as P,MediaLayoutStackedIcon as O,PlacementIcon as I}from"efficient-easel/icons";import{deviceField as b}from"efficient-easel/screen/lib/document/device-fields";import{cardImageFields as g,text as s,textarea as R}from"../../../controls.js";import{group as m,section as n}from"efficient-easel/screen/lib/document/box-fields";import{DESIGN_GROUP_KEY as h}from"efficient-easel/screen/lib/document/field-buckets";import{iconPickerRow as C,segmented as i,slider as A}from"../../../box-fields.js";import{IMAGE_TEXT_ARRANGEMENT_PICTURES as L,LAYOUT_CELL as N}from"../../../choice-pictures.js";import{BLOCK_SOURCE_EDIT_PROP as x,blockSourceEditField as w,blockSourceField as v,blockSourceFields as F}from"../../../block-source-fields.js";import{declaredBlockSource as a}from"../../../../../../format/lib/content/block-sources.js";import{ARRANGEMENT_OPTIONS as D,IMAGE_WIDTH_OPTIONS as G,PHONE_ORDER_OPTIONS as H}from"../../../../../../format/lib/content/image-text-rows.js";import{PROCESS_STEPS_TYPE as c,imageTextRowTemplate as M}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/row-seed.js";import{CARD_TEMPLATE_SLOT as l}from"../../../../../../format/lib/content/card-row-keys.js";import{SPLITTABLE_SECTIONS as W,headFieldsForPlacement as k}from"../../../../../../format/lib/sections/section-head-placement.js";import{PH as Y}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as y}from"../../../../../../render/lib/document/show-when.js";import{isNodeList as p}from"efficient-easel/data";import{seedNodeId as B}from"../../../../../../format/lib/document/seed-parts.js";import{PROCESS_PH as u,ProcessStepsSlots as d}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/meta.js";const S={field:"arrangement",in:["rows-left","rows-right"]},_="drawsLegacySteps",f={not:{context:_,is:!0}},U={[_]:e=>{const o=e.props??{};return!a(o)&&!p(o.boxes)}},j=e=>e?.data?.root?.props??null,ce={fields:y({_gSource:m("Source"),dataSource:v("Item content","Manual"),[x]:w(),_sHeader:n("Header"),_gContent:m("Content"),num:s("Number",u.num),title:s("Heading",u.title),description:R("Body",Y.body),boxes:d.boxes,[l]:d[l],[h.Design]:n("Design"),arrangement:C("Arrangement",r(P,{}),D.map(e=>({label:e.label,hint:e.hint,value:e.value,picture:L[e.value]})),"columns",{columns:3,cell:N}),imageWidth:i("Image width",r(E,{}),G.map(e=>({label:e.label,value:e.value})),"half"),phoneOrder:b("mobile",i("Order",r(O,{}),H.map(e=>({label:e.label,value:e.value})),"picture")),columns:A("Columns",r(T,{}),2,4,1,3),...g(),cardText:i("Text position",r(I,{}),[{label:"Below picture",value:"below"},{label:"On picture",value:"on-image"}],"below")},[[["cardText"],{not:{field:"boxes",set:!0}}],[["arrangement"],f],[["imageWidth","phoneOrder"],{all:[S,f]}],[["columns"],{not:S}]]),showWhenFacts:U,resolveFields:(e,o)=>F(c,k(o.fields,e.props.headPlacement,W.ProcessSteps.headRows),e.props,{root:j(o.appState)}),resolveData:(e,o)=>{const t=e.props;return o?.changed?.dataSource!==!0||!a(t)||p(t[l])?e:{...e,props:{...t,[l]:M(B(t,c))}}}};export{ce as ProcessStepsFields};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{SquareIcon as s}from"efficient-easel/icons";import{text as d,textarea as o,toggle as m}from"../../../controls.js";import{group as n,section as p}from"efficient-easel/screen/lib/document/box-fields";import{SPLITTABLE_SECTIONS as l,headFieldsForPlacement as a}from"../../../../../../format/lib/sections/section-head-placement.js";import{PROSE_PH as e}from"../../../../../../format/lib/document/blocks/general/Prose/meta.js";const x={fields:{_gContent:n("Content"),eyebrow:d("Eyebrow",e.eyebrow),title:o("Heading",e.title),body:o("Body",e.body),_dDesign:p("Design"),topBorder:m("Top border",!0,i(s,{}))},resolveFields:(r,{fields:t})=>a(t,r.props.headPlacement,l.Prose.headRows)};export{x as ProseFields};
1
+ import{jsx as i}from"react/jsx-runtime";import{SquareIcon as s}from"efficient-easel/icons";import{text as m,textarea as o,toggle as d}from"../../../controls.js";import{group as p,section as n}from"efficient-easel/screen/lib/document/box-fields";import{DESIGN_GROUP_KEY as l}from"efficient-easel/screen/lib/document/field-buckets";import{SPLITTABLE_SECTIONS as a,headFieldsForPlacement as f}from"../../../../../../format/lib/sections/section-head-placement.js";import{PROSE_PH as e}from"../../../../../../format/lib/document/blocks/general/Prose/meta.js";const c={fields:{_gContent:p("Content"),eyebrow:m("Eyebrow",e.eyebrow),title:o("Heading",e.title),body:o("Body",e.body),[l.Design]:n("Design"),topBorder:d("Top border",!0,i(s,{}))},resolveFields:(r,{fields:t})=>f(t,r.props.headPlacement,a.Prose.headRows)};export{c as ProseFields};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{ClockIcon as g,EyeIcon as u}from"efficient-easel/icons";import{backgroundField as d,copyText as y,plainTextarea as m,text as o,textarea as p,toggle as T,upload as I}from"../../../controls.js";import{group as s,section as i}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as b}from"../../../box-fields.js";import{LAYOUT_CELL as f,TIMELINE_PICTURES as r}from"../../../choice-pictures.js";import{ctaField as _}from"../../shared-fields.js";import{SECTION_BG_BUILT_IN as k}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{withRowRules as E}from"../../../../../../render/lib/document/show-when.js";import{TIMELINE_PH as e}from"../../../../../../format/lib/document/blocks/general/Timeline/meta.js";const c={field:"layout",is:"track"},C={not:c},M={fields:E({_dLayout:i("Layout"),layout:b("Display",l(u,{}),[{label:"Split",hint:"Split (editorial aside)",value:"split",picture:r.split},{label:"Spine",hint:"Spine (single rail)",value:"spine",picture:r.spine},{label:"Alternating",hint:"Alternating (zig-zag)",value:"alternating",picture:r.alternating},{label:"Track",hint:"Track (year rail)",value:"track",picture:r.track}],"split",{columns:2,cell:f}),_dDesign:i("Design"),background:d("Background color",k.TimelineTrack),_sHeader:i("Header"),_gContent:s("Content"),eyebrow:o("Eyebrow",e.eyebrow),title:p("Heading",e.title),intro:p("Intro",e.intro),imageSrc:I("Image","image/*"),imageCaption:o("Image caption",e.imageCaption),imageMeta:o("Image meta",e.imageMeta),_gButton:s("Button"),..._,_sEntries:i("Timeline entries"),entries:{type:"array",label:"Entries",arrayFields:{date:y("Sub-title"),title:m("Title"),body:m("Body")},defaultItemProps:{date:"",title:"",body:""},getItemSummary:t=>t?.date||t?.title||"Entry"}},[[["imageSrc","imageCaption","imageMeta"],C],[["background"],c]]),resolveFields:(t,{fields:a})=>{if(t.props.layout!=="track")return a;const n=a.entries;return{...a,entries:{...n,arrayFields:{...n?.arrayFields,future:T("Upcoming",!1,l(g,{}))}}}}};export{M as TimelineFields};
1
+ import{jsx as l}from"react/jsx-runtime";import{ClockIcon as u,EyeIcon as d}from"efficient-easel/icons";import{backgroundField as y,copyText as T,plainTextarea as m,text as o,textarea as p,toggle as I,upload as f}from"../../../controls.js";import{group as s,section as i}from"efficient-easel/screen/lib/document/box-fields";import{DESIGN_GROUP_KEY as c}from"efficient-easel/screen/lib/document/field-buckets";import{iconPickerRow as b}from"../../../box-fields.js";import{LAYOUT_CELL as E,TIMELINE_PICTURES as r}from"../../../choice-pictures.js";import{ctaField as _}from"../../shared-fields.js";import{SECTION_BG_BUILT_IN as k}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{withRowRules as C}from"../../../../../../render/lib/document/show-when.js";import{TIMELINE_PH as e}from"../../../../../../format/lib/document/blocks/general/Timeline/meta.js";const g={field:"layout",is:"track"},S={not:g},P={fields:C({[c.Layout]:i("Layout"),layout:b("Display",l(d,{}),[{label:"Split",hint:"Split (editorial aside)",value:"split",picture:r.split},{label:"Spine",hint:"Spine (single rail)",value:"spine",picture:r.spine},{label:"Alternating",hint:"Alternating (zig-zag)",value:"alternating",picture:r.alternating},{label:"Track",hint:"Track (year rail)",value:"track",picture:r.track}],"split",{columns:2,cell:E}),[c.Design]:i("Design"),background:y("Background color",k.TimelineTrack),_sHeader:i("Header"),_gContent:s("Content"),eyebrow:o("Eyebrow",e.eyebrow),title:p("Heading",e.title),intro:p("Intro",e.intro),imageSrc:f("Image","image/*"),imageCaption:o("Image caption",e.imageCaption),imageMeta:o("Image meta",e.imageMeta),_gButton:s("Button"),..._,_sEntries:i("Timeline entries"),entries:{type:"array",label:"Entries",arrayFields:{date:T("Sub-title"),title:m("Title"),body:m("Body")},defaultItemProps:{date:"",title:"",body:""},getItemSummary:t=>t?.date||t?.title||"Entry"}},[[["imageSrc","imageCaption","imageMeta"],S],[["background"],g]]),resolveFields:(t,{fields:a})=>{if(t.props.layout!=="track")return a;const n=a.entries;return{...a,entries:{...n,arrayFields:{...n?.arrayFields,future:I("Upcoming",!1,l(u,{}))}}}}};export{P as TimelineFields};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{ClockIcon as s}from"efficient-easel/icons";import{backgroundField as n,plainText as d,plainTextarea as o,text as m,textarea as i,toggle as p}from"../../../controls.js";import{section as e}from"efficient-easel/screen/lib/document/box-fields";import{SPLITTABLE_SECTIONS as T,headFieldsForPlacement as c}from"../../../../../../format/lib/sections/section-head-placement.js";import{ctaField as f}from"../../shared-fields.js";import{SECTION_BG_BUILT_IN as u}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{TIMELINE_TRACK_PH as r}from"../../../../../../format/lib/document/blocks/general/TimelineTrack/meta.js";const E={fields:{_sHeader:e("Header"),eyebrow:m("Eyebrow",r.eyebrow),title:i("Heading",r.title),intro:i("Body",r.intro),_sEntries:e("Milestones"),entries:{type:"array",label:"Milestones",arrayFields:{date:d("Year"),title:o("Title"),blurb:o("Body"),future:p("Upcoming",!1,l(s,{}))},defaultItemProps:{date:"",title:"",blurb:"",future:!1},getItemSummary:t=>t?.date||t?.title||"Milestone"},_sButton:e("Button"),...f,_dDesign:e("Design"),background:n("Background color",u.TimelineTrack),_dLayout:e("Layout")},resolveFields:(t,{fields:a})=>c(a,t.props.headPlacement,T.TimelineTrack.headRows)};export{E as TimelineTrackFields};
1
+ import{jsx as s}from"react/jsx-runtime";import{ClockIcon as m}from"efficient-easel/icons";import{backgroundField as n,plainText as d,plainTextarea as o,text as p,textarea as i,toggle as f}from"../../../controls.js";import{section as e}from"efficient-easel/screen/lib/document/box-fields";import{DESIGN_GROUP_KEY as a}from"efficient-easel/screen/lib/document/field-buckets";import{SPLITTABLE_SECTIONS as T,headFieldsForPlacement as c}from"../../../../../../format/lib/sections/section-head-placement.js";import{ctaField as u}from"../../shared-fields.js";import{SECTION_BG_BUILT_IN as _}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{TIMELINE_TRACK_PH as r}from"../../../../../../format/lib/document/blocks/general/TimelineTrack/meta.js";const L={fields:{_sHeader:e("Header"),eyebrow:p("Eyebrow",r.eyebrow),title:i("Heading",r.title),intro:i("Body",r.intro),_sEntries:e("Milestones"),entries:{type:"array",label:"Milestones",arrayFields:{date:d("Year"),title:o("Title"),blurb:o("Body"),future:f("Upcoming",!1,s(m,{}))},defaultItemProps:{date:"",title:"",blurb:"",future:!1},getItemSummary:t=>t?.date||t?.title||"Milestone"},_sButton:e("Button"),...u,[a.Design]:e("Design"),background:n("Background color",_.TimelineTrack),[a.Layout]:e("Layout")},resolveFields:(t,{fields:l})=>c(l,t.props.headPlacement,T.TimelineTrack.headRows)};export{L as TimelineTrackFields};
@@ -1,2 +1,2 @@
1
- export declare const assembleGeneralBlocks: () => Record<"Hero" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "Footprint" | "Cards" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Logos" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Grid" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "HeroSingle" | "ContactLocations" | "PaymentBadges" | "Heading" | "Text" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ListSearch" | "ButtonBlock" | "CardList" | "HostPart" | "PostCard" | "HeroSlide" | "HeroGroup", 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<"Hero" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "Footprint" | "Cards" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Logos" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Grid" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "HeroSingle" | "ContactLocations" | "PaymentBadges" | "Heading" | "Text" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ListSearch" | "ButtonBlock" | "CardList" | "HostPart" | "PostCard" | "HeroSlide" | "HeroGroup", 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<"CardList" | "Text" | "ImageBlock" | "ButtonBlock" | "Flex" | "Cards" | "FAQ" | "Footprint" | "Grid" | "Hero" | "HeroGroup" | "HeroSingle" | "HeroSlide" | "Logos" | "LogoBlock" | "OrderSummary" | "ProcessSteps" | "IntroBleed" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "SectionHeader" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "ContactLocations" | "PaymentBadges" | "Heading" | "Eyebrow" | "LocationMap" | "Contents" | "ListSearch" | "HostPart" | "PostCard", 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<"CardList" | "Text" | "ImageBlock" | "ButtonBlock" | "Flex" | "Cards" | "FAQ" | "Footprint" | "Grid" | "Hero" | "HeroGroup" | "HeroSingle" | "HeroSlide" | "Logos" | "LogoBlock" | "OrderSummary" | "ProcessSteps" | "IntroBleed" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "SectionHeader" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "ContactLocations" | "PaymentBadges" | "Heading" | "Eyebrow" | "LocationMap" | "Contents" | "ListSearch" | "HostPart" | "PostCard", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
@@ -1 +1 @@
1
- import{isNodeList as c}from"efficient-easel/data";import{registerGeneralSectionRows as f}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{convertSection as m,sectionToBoxRow as u}from"../../../render/lib/sections/section-to-box.js";const l=["FooterPayment"];function n(o,r){const{id:e,...t}=o.props;for(const[i,p]of Object.entries(t))c(p)&&(t[i]=p.map(s=>n(s,r)));return r(o.type,t)}const R=(o,r)=>{if(!l.includes(o.type))return null;f();const e=u(o.type);return e?m({type:o.type,props:{...o.props}},e).nodes.map(t=>n(t,r)):null};export{l as FOOTER_ROW_TYPES,R as convertFooterBlock};
1
+ import{nodeListKeys as i}from"../../../format/lib/document/node-lists.js";import{registerGeneralSectionRows as c}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{convertSection as m,sectionToBoxRow as f}from"../../../render/lib/sections/section-to-box.js";const u=["FooterPayment"];function n(o,t){const{id:e,...r}=o.props;for(const p of i(o))r[p]=r[p].map(s=>n(s,t));return t(o.type,r)}const R=(o,t)=>{if(!u.includes(o.type))return null;c();const e=f(o.type);return e?m({type:o.type,props:{...o.props}},e).nodes.map(r=>n(r,t)):null};export{u as FOOTER_ROW_TYPES,R as convertFooterBlock};