efficient-web-builder 71.1.0 → 73.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/editor/components/AddPageWindow.js +1 -1
  3. package/dist/editor/components/MediaUploadField.d.ts +2 -1
  4. package/dist/editor/components/PageStarterCard.js +1 -1
  5. package/dist/editor/components/SectionEditor.d.ts +1 -2
  6. package/dist/editor/components/SectionEditor.js +1 -1
  7. package/dist/editor/components/SideSpaceField.d.ts +3 -0
  8. package/dist/editor/components/SideSpaceField.js +1 -1
  9. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  10. package/dist/editor/components/storefront-editor.css +15 -44
  11. package/dist/editor/lib/content/site-length-rows.js +1 -1
  12. package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
  13. package/dist/editor/lib/document/controls.d.ts +4 -2
  14. package/dist/editor/lib/document/controls.js +1 -1
  15. package/dist/editor/lib/document/shape-picker.d.ts +16 -8
  16. package/dist/editor/lib/document/shape-picker.js +1 -1
  17. package/dist/editor/lib/document/show-when-resolve.js +1 -1
  18. package/dist/editor/lib/source-rules/no-host-rail.d.ts +6 -0
  19. package/dist/editor/lib/source-rules/no-host-rail.js +1 -0
  20. package/dist/format/lib/content/box-shape.d.ts +2 -1
  21. package/dist/format/lib/content/box-shape.js +1 -1
  22. package/dist/format/lib/content/css-length.d.ts +2 -3
  23. package/dist/format/lib/content/css-length.js +1 -1
  24. package/dist/format/lib/content/gallery-card-layout.d.ts +22 -1
  25. package/dist/format/lib/content/gallery-card-layout.js +1 -1
  26. package/dist/format/lib/content/gallery-layout.js +1 -1
  27. package/dist/format/lib/content/grid-span.d.ts +15 -2
  28. package/dist/format/lib/content/grid-span.js +1 -1
  29. package/dist/format/lib/content/image-aspect.d.ts +5 -3
  30. package/dist/format/lib/content/image-aspect.js +1 -1
  31. package/dist/format/lib/content/page-width.d.ts +3 -0
  32. package/dist/format/lib/content/page-width.js +1 -1
  33. package/dist/format/lib/content/section-min-height.js +1 -1
  34. package/dist/format/lib/content/view-hide-class.js +1 -1
  35. package/dist/format/lib/content/view-tier.d.ts +2 -2
  36. package/dist/format/lib/document/style-text.d.ts +1 -0
  37. package/dist/format/lib/document/style-text.js +1 -0
  38. package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
  39. package/dist/format/lib/editor-words-catalogue.js +1 -1
  40. package/dist/format/lib/hero-phone-stack.js +1 -1
  41. package/dist/format/lib/site-twin-row.d.ts +2 -1
  42. package/dist/format/lib/source-rules/one-phone-edge.js +10 -7
  43. package/dist/render/components/Flex.js +1 -1
  44. package/dist/render/components/ImageBlock.js +1 -1
  45. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  46. package/dist/render/lib/content/section-padding.d.ts +2 -1
  47. package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
  48. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  49. package/dist/render/lib/document/custom-css.d.ts +7 -0
  50. package/dist/render/lib/document/custom-css.js +2 -0
  51. package/dist/render/lib/document/part-styles.d.ts +2 -2
  52. package/dist/render/lib/document/passes/cell-width.js +1 -1
  53. package/dist/render/lib/document/render-registry.js +1 -1
  54. package/package.json +9 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # Changelog
2
2
 
3
+ ## 73.0.0 - 2026-11-19
4
+
5
+ From main at `e3945738`: #792, #793, #798, #800, #801, #802, #803.
6
+
7
+ A major: the `efficient-easel` peer moves to `^37.0.0` and `efficient-shell` to `^13.24.1`; two new peers, `postcss` and `postcss-selector-parser`; a Custom HTML section's own `<style>` is limited to that section. No stored key or value moves.
8
+
9
+ ### BREAKING
10
+
11
+ - **`efficient-easel` peer `^36.0.0` -> `^37.0.0`**: the left panel's toggle is back in the top bar (left of Undo); `AddSidePanel` loses `onHide`; the rail's geometry is shell tokens (`railTokens.railWidth` is a `calc()` of `--row-height-menu` and `--space-4`). (#803)
12
+ - **`efficient-shell` peer `^13.17.0` -> `^13.24.1`**: easel 37 needs the shell's `IconRail` 8px gap (13.23.1+); 13.24.1 carries the popup close-cross fix. (#803)
13
+ - **New peers `postcss ^8.5.33` and `postcss-selector-parser ^7.2.1`**: the Custom HTML section limits its CSS with them. (#793)
14
+ - **A Custom HTML section's `<style>` is limited to the section.** Every selector is prefixed with the block's own scope `[data-sf-custom-html="<block id>"]`; a leading `html`, `body`, `:root` or `*` becomes the section root; a rule that would reach past the section is dropped; nested style rules are dropped; `@keyframes` names take the block id. Live check before release: 0 Custom HTML sections with `<style>` on the US sites (1378 blocks, draft and published). (#793)
15
+
16
+ **For hosts:**
17
+ - Install `efficient-easel` 37.0.0, `efficient-shell` 13.24.1 or later, `postcss` and `postcss-selector-parser` with this release.
18
+ - efficient-storefront-blocks: raise its `efficient-web-builder` range to `^73.0.0` and add `postcss` and `postcss-selector-parser` as dev dependencies with the peer ranges. efficient-storefront: declare both (it already has `postcss` through Tailwind).
19
+ - Drop any host code that passes `onHide` to `AddSidePanel`.
20
+
21
+ ### Added
22
+
23
+ - **A host slot offers positions to its tiles.** A host block names a slot in its meta (`positionSlots`); a Box in that slot is a cell of the host's grid with span rows, an "At card" place (`--sf-tile-at`) and its own phone Positions and Rows tall. Nothing stored draws different bytes. (#792)
24
+ - **Custom W:H in the one shape table.** Box shape, Image aspect ratio and Hero height take a custom ratio stored as text (`"45/28"`) in the key each row already writes; a ratio equal to a table line stores that line's value. (#801)
25
+ - **Site styles Side space in px has no upper limit.** The slider track still ends at 80 px; a typed number goes past it. A px side space past the track draws as `min(<value>px, 25vw)`. Saves past 80 need efficient-backend#5030; until then the backend refuses them as before. (#802)
26
+
27
+ ### Fixed
28
+
29
+ - **The Add page window draws with the shell's parts** (`Title`, `Paragraph`, `LoadingSpinner`, `Card`, `Text`, `--motion-fast`). No words change. (#800)
30
+ - **The view tier names come from easel** (`ViewTier`, `VIEW_TIERS`) in place of local copies; `SiteRowView`, `PartScreen` and `ViewTierName` stay as aliases. A new guard refuses a restated tier list. (#798)
31
+
32
+ ## 72.0.0 - 2026-11-18
33
+
34
+ From main at `58477c36`: #794, #795.
35
+
36
+ A major: the `efficient-easel` peer moves to `^36.0.0`; `efficient-shell` stays `^13.17.0`. `SectionEditor`'s `onOpenPageStyles` prop is removed. No stored key or value moves. Carries #794 (left rail host) and #795 (one home for the phone edge).
37
+
38
+ ### BREAKING
39
+
40
+ - **`efficient-easel` peer `^35.1.0` -> `^36.0.0`**: the editor's left rail is the body's first column (Add, Pages, Layers, Styles, Media) in place of the left panel's tab strip and the top bar's rail.
41
+
42
+ **For hosts:**
43
+ - Install `efficient-easel` 36.0.0 or later with this release. The builder's editor entries already load `efficient-easel/rail.css` with `screen.css`.
44
+ - `SectionEditor` (`efficient-web-builder/editor/components/SectionEditor`) no longer takes `onOpenPageStyles`; no consumer passes it.
45
+ - A host test or style that reads the left panel's tab strip, the top bar's Media library button or the Layers head "+" drops it (easel 36.0.0 CHANGELOG).
46
+
47
+ ### Changed
48
+
49
+ - **The desktop view has a floor: the phone edge** (800, `PHONE_EDGE`). The website passes it as the screen's `devices.fluidMin`, so a pane under 800 (a 1440 screen with the rail column gives 772) draws the desktop at 800, scaled to fit, and not the stacked phone layout. At or over 800 nothing changes.
50
+ - **The empty right panel has no Styles button.** The rail's Styles is the one way in to the page's look; the tree's "This page" still opens it.
51
+
52
+ ### Guards
53
+
54
+ - `test-desktop-floor` (new) holds the website's floor input (`fluidMin === PHONE_EDGE`); the floor rule is easel's own tests. New source rule `src/lib/source-rules/no-host-rail.ts` (`test-no-host-rail-css`): no host `.es-rail` rule and no host "Media library" control; blocks and admin run it in their easel ^36 PRs. #795: `test-one-phone-edge` and `source-rules/one-phone-edge.ts`. `test-editor-flat-chrome` and `test-panel-resize-seam` model the rail column in front of the left panel (8 + 44 + 8; the chrome is 668px at the default widths). `test-editor-rail-in-topbar` is deleted (the rail left the top bar). `test-editor-add-panel` drops the top bar's arrow; `test-page-settings-move` holds that the empty panel has no Styles door.
55
+
3
56
  ## 71.1.0 - 2026-11-18
4
57
 
5
58
  From main at `59a4749a`: #789. A minor: no `!`, no export is added, removed or changes its type, the peers stay `efficient-easel` `^35.1.0` and `efficient-shell` `^13.17.0`. No stored key or value moves.
@@ -1 +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};
1
+ "use client";import{jsx as a,jsxs as g}from"react/jsx-runtime";import{useEffect as G,useId as W,useMemo as q,useRef as z,useState as h}from"react";import{useScreenDocument as H}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as O}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as I}from"efficient-easel/page-copy";import{AddIcon as V}from"efficient-easel/icons";import{Dialog as J,EmptyState as K,Grid as Q,LoadingSpinner as U,Paragraph as X,SidebarActionButton as Y,SidebarLayout as Z,SidebarNavItem as S,Title as $,toast as T}from"efficient-shell/ui";import ee from"./PageStarterCard.js";import{useHostConfig as te}from"../lib/document/host-config.js";import{useSiteWidthsMetadata as ae}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 re,startersIn as se,templateStarters as oe}from"../../format/lib/page-starters.js";import{backendOf as ne}from"../lib/website-session.js";function ie({open:l,onClose:x,takenSlugs:b,onCreated:L}){const N=O(),{adapter:d,siteId:c,templateId:R}=H(),r=ne(N).pages,y=!R&&!!(r.starters&&r.createFromStarter),u=q(()=>c?{siteId:c}:{},[c]),j=te(),B=ae(),[k,s]=h(null),[o,n]=h(i),[m,v]=h(null),C=z(null),A=W();G(()=>{if(!l)return;if(n(i),!y){s([]);return}let e=!0;return s(null),r.starters(u).then(f=>e&&s(f),()=>{e&&(s([]),T.error(t("Couldn’t load the pages — please retry.")))}),()=>{e=!1}},[l,y,r,u]);const P=async(e,f)=>{if(!m){v(e);try{L(await f())}catch{T.error(t("Couldn’t add the page — please retry."))}finally{v(null)}}},F=()=>{if(!d.createPage)return;const e=t("New page");P("blank",()=>d.createPage({slug:I(e,b),title:e,layout:{}}))},M=e=>{P(e.id,()=>r.createFromStarter(e.id,{title:e.title,slug:I(e.slug,b),...u}))},p=k??[],_=re(p),E=se(o,p),D=g("nav",{"aria-label":t("Pages"),className:"sf-add-page-nav",children:[a(S,{label:t("All pages"),active:o===i,onClick:()=>n(i)}),_.map(e=>a(S,{label:t(e.label),active:o===e.key,onClick:()=>n(e.key)},e.key)),oe(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(J,{open:l,onClose:x,size:"full",title:t("Add page"),initialFocus:C,children:a(Z,{sidebarTop:g(Y,{onClick:F,disabled:!d.createPage||m!==null,children:[a(V,{"aria-hidden":!0}),t("Blank page")]}),sidebar:D,children:g("div",{ref:C,tabIndex:-1,role:"region","aria-labelledby":A,className:"sf-add-page",children:[a($,{id:A,level:2,as:"h3",children:t("Pages for your site")}),a(X,{tone:"default",className:"sf-add-page-sub",children:t("Choose a page and change the text, images and more.")}),k===null?a(U,{label:t("Loading…")}):E.length===0?a(K,{title:t("No pages to start from"),description:t("Start with a blank page, then add sections.")}):a(Q,{cols:1,smCols:2,lgCols:3,gap:8,children:E.map(e=>a(ee,{starter:e,config:j,metadata:B,busy:m===e.id,onAdd:M},e.id))})]})})})}export{ie as default};
@@ -1,3 +1,4 @@
1
+ import { type ViewTier } from "efficient-easel/draw";
1
2
  import { usePreviewDevice } from "efficient-easel/draw/client";
2
3
  import { type MediaValue } from "../../format/lib/media-value.js";
3
4
  interface Props {
@@ -7,7 +8,7 @@ interface Props {
7
8
  accept: string;
8
9
  placeholder?: string;
9
10
  focusKey?: string;
10
- focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;
11
+ focusWhen?: (props: Record<string, unknown>, view: ViewTier) => boolean;
11
12
  frameKey?: string;
12
13
  fieldKey?: string;
13
14
  }
@@ -1 +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
+ "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 g}from"efficient-easel/easel";import{Button as v,Card as y,FitFrame as C,Text as S}from"efficient-shell/ui";import x from"./PreviewThemeFrame.js";import D from"../../render/lib/document/page-render.js";import{SiteThemeCarrier as N,suppressPreviewNav as F}from"../lib/document/page-root.js";import{useEditorCanvasStyles as T}from"../lib/editor-canvas-styles.js";import{say as i}from"../../format/lib/editor-words.js";import{firstSectionOf as b}from"../../format/lib/page-starters.js";const j=1440,z=1080;function A({starter:t,config:a,metadata:n,busy:s,onAdd:d}){const{mirrorHostStyles:m}=T(),[l,c]=h(null),f=p(()=>{const r=b(t.layout),u=t.layout.zones;return{root:{props:{}},content:r?[r]:[],zones:u??{}}},[t.layout]);return o("div",{className:"sf-starter",children:[o(y,{padding:"none",className:"sf-starter-picture",children:[e("div",{inert:!0,className:"sf-starter-frame",children:e(C,{width:j,height:z,children:e(g,{id:`page-starter-${t.id}`,title:t.title,mirrorStyles:m,onDocument:c,height:"fill",children:e(x,{document:l??void 0,children:e(N,{onClickCapture:F,body:r=>e("div",{className:"sf-themed-content",style:r,children:e("div",{style:{background:"var(--bg)"},children:e(D,{config:a,data:f,metadata:n})})})})})})})}),e("div",{className:"sf-starter-add",children:e(v,{onClick:()=>d(t),loading:s,"aria-label":i("Add “{name}”",{name:t.title}),children:i("Add page")})})]}),e(S,{size:"sm",children:t.title})]})}export{A as default};
@@ -63,11 +63,10 @@ export type InspectorPanel = {
63
63
  render: (mode: InspectorMode, ctx: PanelContext) => ReactNode;
64
64
  };
65
65
  export declare function resolvePanel(kind: InspectorMode["kind"], capabilities: EditorCapabilities): InspectorPanel | null;
66
- export default function SectionEditor({ mode, onOpenWebsiteSettings, onOpenSiteStyles, onOpenPageStyles, onSelectNode, hideNodeActions, onNotify, onHidePanel, }: {
66
+ export default function SectionEditor({ mode, onOpenWebsiteSettings, onOpenSiteStyles, onSelectNode, hideNodeActions, onNotify, onHidePanel, }: {
67
67
  mode: InspectorMode;
68
68
  onOpenWebsiteSettings: () => void;
69
69
  onOpenSiteStyles?: () => void;
70
- onOpenPageStyles?: () => void;
71
70
  hideNodeActions?: boolean;
72
71
  onNotify?: (msg: string, tone?: "success" | "error") => void;
73
72
  onHidePanel?: () => void;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as m,Fragment as K}from"react/jsx-runtime";import{useEasel as Se,useRootFields as be}from"efficient-easel/easel";import{Button as we,EmptyState as ge}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as W}from"../lib/document/page-root-fields.js";import{rootPanelHead as Ee}from"../../format/lib/document/root-panel.js";import{headWords as z,InspectorHead as ke,InspectorIconButton as j}from"efficient-easel/chrome";import{DuplicateIcon as Pe,TrashIcon as ve}from"efficient-easel/icons";import{panelFieldsOf as Ie}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as G}from"../../render/components/PreviewTickerContext.js";import Le from"./SectionIcon.js";import{PanelHideButton as Y}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as ye}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import Oe,{SITE_STYLES_BASICS_TAB as Te}from"./WebsiteSettingsPanel.js";import Ne from"./ChatSettingsPanel.js";import _e from"./SocialLinksPanel.js";import He from"./TickerSettingsPanel.js";import Re,{PartSourceNote as Ae}from"./PartSettingsPanel.js";import{regionsForSection as De}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Ce}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as Be}from"../../format/lib/sections/text-regions.js";import Fe from"./DuplicateToPageMenu.js";import{usePageRows as xe}from"../lib/page-rows.js";import{useScreenDocument as Me}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as Ke}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as We}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as ze,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as je}from"efficient-easel/draw/client";import{entryPartsOf as Ge,SectionTextEntries as Ye}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ue}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as Xe,ROOT_ZONE as U}from"efficient-easel/draw";import{websiteDuplicateBlocked as Ze}from"../lib/document/every-page.js";import{FOOTER_TYPE as L}from"../lib/document/footer-blocks.js";import $e from"./SwitchToBoxFooter.js";import{SiteFields as X}from"./SiteFields.js";import qe from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as Je,HERO_PART_MODE as Qe,heroPartLabel as Ve}from"../../render/lib/document/hero-media-parts.js";import{HintsToggle as et,SettingsSwitch as tt,hintsFoldClass as nt}from"efficient-easel/panel";import{useHints as ot}from"efficient-easel/screen/lib/hints";import{partRowField as rt}from"../lib/document/part-row-field.js";import{decodePartKey as it,partRowHeadLabel as st}from"../../render/lib/document/part-rows.js";import{encodePartId as at,partHeadLabel as lt,partLabel as ct,sectionTextParts as dt}from"../../render/lib/document/text-parts.js";import{partSourceOf as pt,sourceMenuIdOf as mt,sourceSlugOf as ft}from"../../format/lib/document/source-bound-parts.js";const mn=ze,fn={kind:"header"},un={kind:"website"},hn={kind:"website",tab:Te,revealPageGroup:!0},Sn={kind:"chat"},bn={kind:"social"},w="Part";function ut(e){return n("Part of {name}",{name:n(e)})}function ht(e,o,i){const s=e.describeNode(o);return{name:i,kindLabel:s?ut(s.label):n(w)}}function St(e){switch(e){case"Header":return{title:n("Header settings belong to a website."),own:n("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:n("Appearance settings belong to a website."),own:n("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:n("Live chat settings belong to a website."),own:n("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:n("Social link settings belong to a website."),own:n("Each website created from this template sets its own social link afterwards.")};default:return{title:n("{what} settings belong to a website.",{what:e}),own:n("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function Z({what:e}){const o=St(e);return m("div",{className:"sf-note",children:[r("p",{children:r("strong",{children:o.title})}),m("p",{children:[n("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",o.own]})]})}function y(e){const o=Qe[e];return{name:Je[e],kindLabel:w,icon:o,head:(i,s)=>{if(i.kind!==o)return null;const d=s.describeNode(i.nodeId);if(!d)return null;const h=z({name:n(Ve(e,d.props)),tier:"part",of:n(d.label)},{partOf:({name:p})=>n("Part of {name}",{name:p})});return{name:h.name,kindLabel:h.kind}},render:(i,s)=>i.kind===o?r(qe,{nodeId:i.nodeId,part:e,sectionName:s.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(i.nodeId)}):null}}const bt={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,o)=>{const i=o.hostPanels?.header;return i?r(i,{placeholderMode:o.capabilities.placeholderFrames,tokenRef:o.tokenRef,siteId:o.siteId,websiteName:o.websiteName,onOpenWebsiteSettings:o.onOpenWebsiteSettings,onAuthExpired:()=>o.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,o)=>r(Oe,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!o.capabilities.hasSiteTheme,tokenRef:o.tokenRef,siteId:o.siteId,onNotify:o.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>r(Ne,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>r(_e,{unavailable:r(Z,{what:"Social link"})})},ticker:{name:G,kindLabel:w,icon:"ticker",head:(e,o)=>e.kind==="ticker"?ht(o,e.heroId,n(G)):null,render:e=>r(He,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:y("media"),heroImage:y("image"),heroImage2:y("image2"),part:{name:w,kindLabel:w,icon:"Text",head:(e,o)=>{if(e.kind!=="part")return null;const i=o.describeNode(e.nodeId);if(!i)return null;const{key:s,row:d}=it(e.propKey),h=d?rt(i.fields[s],d):i.fields[s],p=De(i.type),f=p?Be(p,e.propKey):null,u=p&&f?p[f].label:Ce[e.propKey],g=u?n(u):st(n(lt(ct(h??{},s))),d),E=z({name:g,tier:"part",of:n(i.label)},{partOf:({name:k})=>n("Part of {name}",{name:k})});return{name:E.name,kindLabel:E.kind}},render:(e,o)=>e.kind==="part"?r(Re,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>o.onSelectNode(e.nodeId),onEditStyle:o.onOpenSiteStyles}):null}},wt=new Set(["header","website","chat"]);function gt(e,o){if(e==="selection")return null;const i=bt[e];return wt.has(e)&&!o.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>r(Z,{what:i.name})}:i}function Et({mode:e,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:h=!1,onNotify:p,onHidePanel:f}){const{capabilities:u,tokenRef:g,notifyParent:E,currentSlug:k,siteId:O,runAuthed:$,readOnly:q,navigate:kt}=Me(),{rows:J}=xe(),T=J?.find(l=>l.slug===k)??null,Q=be(),N=Object.keys(Q.fields).some(l=>!l.startsWith("_")&&!W.includes(l)),{websiteName:V}=Ke(),P=We({readOnly:q}),{select:ee}=je(),{selectedItem:t,getItemById:te,getSelectorForId:ne,config:S,appState:oe}=Se(l=>l),re=Ie(S,t?{type:t.type,props:t.props}:null),_=t?dt(re??S.components[t.type]?.fields,t.props):[],ie=l=>S.components[l]?.label??l,a=t?ne(t.props.id):void 0,c=gt(e.kind,u),se=ye(),H={capabilities:u,tokenRef:g,hostPanels:se.chrome?.panels,describeNode:l=>{const b=te(l);if(!b)return null;const M=S.components[b.type];return{type:b.type,label:M?.label??b.type,fields:M?.fields??{},props:b.props??{}}},siteId:O,websiteName:V??null,notifyParent:E,onNotify:p,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:d},R=c?.head?.(e,H)??null,A=Ee({kind:T?.kind,pageName:T?.label}),D=R?.name??(c?n(c.name):t?n(ie(t.type)):A.name),ae=R?.kindLabel??(c?n(c.kindLabel):t?a&&a.zone!==U?n("Block"):n("Section"):A.kindLabel),le=c?c.icon:t?t.type:"page",C=I(e)&&t?pt(t.type):null,ce=!!t&&!!a&&a.zone===U&&t.type!==L&&t.type!==Xe,v=Ze(oe?.data,t),de=()=>{v||a&&P.duplicateComponent(a.zone,a.index)},pe=()=>{a&&(P.removeComponent(a.zone,a.index),P.select(null))},me=t?S.components[t.type]?.defaultProps?.previewHover:void 0,B=I(e)&&!!t&&!!a&&me!==void 0,F=B&&t.props.previewHover===!0,fe=()=>{!t||!a||P.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!F}})},{shown:x,setShown:ue}=ot(),he=!!(c||t||N);return m("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right ${nt(x)}`.trim(),children:[r(ke,{icon:r(Le,{type:le,size:15}),name:D,kind:ae,actions:!h&&I(e)&&t&&t.type!==L?m(K,{children:[r(j,{label:n("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:de,children:r(Pe,{size:15})}),ce&&u.hasSiteSettings&&r(Fe,{node:t,currentSlug:k,siteId:O??void 0,tokenRef:g,runAuthed:$,onNotify:p}),r(j,{label:n("Remove section"),danger:!0,onClick:pe,children:r(ve,{size:15})}),f?r(Y,{side:"right",onHide:f,divider:!0}):null]}):f?r(Y,{side:"right",onHide:f}):void 0}),B&&m("div",{className:"sf-preview-pin",children:[m("div",{className:"sf-preview-pin-text",children:[r("span",{className:"sf-preview-pin-label",children:n("Preview hover state")}),r("span",{className:"sf-preview-pin-hint",children:n("not shown live")})]}),r(tt,{checked:F,onChange:fe,ariaLabel:n("Preview hover state")})]}),m("div",{className:"sf-insp-body es-insp-body sf-scroll",children:[c?c.render(e,H):t?m(K,{children:[t.type===L&&u.hasSiteSettings&&r($e,{}),r(Ue,{children:r(X,{entries:r(Ye,{parts:_,heading:!1,onOpen:l=>ee(at(t.props.id,l))}),entryCount:Ge(_).length,itemWord:D})}),C&&r(Ae,{source:C,slug:ft(t?.props),menuId:mt(t?.props)})]}):N?r(X,{omit:W}):r(ge,{variant:"none",icon:!1,message:n("Select a section or block to edit it."),children:s&&r(we,{variant:"secondary",onClick:s,children:n("This page")})}),he&&r(et,{shown:x,onChange:ue,label:n("Show hints")})]})]})}export{Sn as CHAT_MODE,fn as HEADER_MODE,mn as SELECTION_MODE,bn as SOCIAL_MODE,un as WEBSITE_MODE,hn as WEBSITE_PAGE_MODE,Et as default,gt as resolvePanel};
1
+ "use client";import{jsx as r,jsxs as m,Fragment as M}from"react/jsx-runtime";import{useEasel as he,useRootFields as Se}from"efficient-easel/easel";import{EmptyState as be}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as K}from"../lib/document/page-root-fields.js";import{rootPanelHead as we}from"../../format/lib/document/root-panel.js";import{headWords as W,InspectorHead as ge,InspectorIconButton as z}from"efficient-easel/chrome";import{DuplicateIcon as Ee,TrashIcon as ke}from"efficient-easel/icons";import{panelFieldsOf as Pe}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as j}from"../../render/components/PreviewTickerContext.js";import ve from"./SectionIcon.js";import{PanelHideButton as G}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as Ie}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import Le,{SITE_STYLES_BASICS_TAB as ye}from"./WebsiteSettingsPanel.js";import Oe from"./ChatSettingsPanel.js";import Te from"./SocialLinksPanel.js";import Ne from"./TickerSettingsPanel.js";import _e,{PartSourceNote as He}from"./PartSettingsPanel.js";import{regionsForSection as Re}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Ae}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as De}from"../../format/lib/sections/text-regions.js";import Ce from"./DuplicateToPageMenu.js";import{usePageRows as Be}from"../lib/page-rows.js";import{useScreenDocument as Fe}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as xe}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as Me}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as Ke,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as We}from"efficient-easel/draw/client";import{entryPartsOf as ze,SectionTextEntries as je}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ge}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as Ye,ROOT_ZONE as Y}from"efficient-easel/draw";import{websiteDuplicateBlocked as Ue}from"../lib/document/every-page.js";import{FOOTER_TYPE as L}from"../lib/document/footer-blocks.js";import Xe from"./SwitchToBoxFooter.js";import{SiteFields as U}from"./SiteFields.js";import Ze from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as $e,HERO_PART_MODE as qe,heroPartLabel as Je}from"../../render/lib/document/hero-media-parts.js";import{HintsToggle as Qe,SettingsSwitch as Ve,hintsFoldClass as et}from"efficient-easel/panel";import{useHints as tt}from"efficient-easel/screen/lib/hints";import{partRowField as nt}from"../lib/document/part-row-field.js";import{decodePartKey as ot,partRowHeadLabel as rt}from"../../render/lib/document/part-rows.js";import{encodePartId as it,partHeadLabel as st,partLabel as at,sectionTextParts as lt}from"../../render/lib/document/text-parts.js";import{partSourceOf as ct,sourceMenuIdOf as pt,sourceSlugOf as dt}from"../../format/lib/document/source-bound-parts.js";const pn=Ke,dn={kind:"header"},mn={kind:"website"},fn={kind:"website",tab:ye,revealPageGroup:!0},un={kind:"chat"},hn={kind:"social"},g="Part";function mt(e){return n("Part of {name}",{name:n(e)})}function ft(e,o,i){const a=e.describeNode(o);return{name:i,kindLabel:a?mt(a.label):n(g)}}function ut(e){switch(e){case"Header":return{title:n("Header settings belong to a website."),own:n("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:n("Appearance settings belong to a website."),own:n("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:n("Live chat settings belong to a website."),own:n("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:n("Social link settings belong to a website."),own:n("Each website created from this template sets its own social link afterwards.")};default:return{title:n("{what} settings belong to a website.",{what:e}),own:n("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function X({what:e}){const o=ut(e);return m("div",{className:"sf-note",children:[r("p",{children:r("strong",{children:o.title})}),m("p",{children:[n("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",o.own]})]})}function y(e){const o=qe[e];return{name:$e[e],kindLabel:g,icon:o,head:(i,a)=>{if(i.kind!==o)return null;const d=a.describeNode(i.nodeId);if(!d)return null;const f=W({name:n(Je(e,d.props)),tier:"part",of:n(d.label)},{partOf:({name:c})=>n("Part of {name}",{name:c})});return{name:f.name,kindLabel:f.kind}},render:(i,a)=>i.kind===o?r(Ze,{nodeId:i.nodeId,part:e,sectionName:a.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>a.onSelectNode(i.nodeId)}):null}}const ht={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,o)=>{const i=o.hostPanels?.header;return i?r(i,{placeholderMode:o.capabilities.placeholderFrames,tokenRef:o.tokenRef,siteId:o.siteId,websiteName:o.websiteName,onOpenWebsiteSettings:o.onOpenWebsiteSettings,onAuthExpired:()=>o.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,o)=>r(Le,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!o.capabilities.hasSiteTheme,tokenRef:o.tokenRef,siteId:o.siteId,onNotify:o.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>r(Oe,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>r(Te,{unavailable:r(X,{what:"Social link"})})},ticker:{name:j,kindLabel:g,icon:"ticker",head:(e,o)=>e.kind==="ticker"?ft(o,e.heroId,n(j)):null,render:e=>r(Ne,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:y("media"),heroImage:y("image"),heroImage2:y("image2"),part:{name:g,kindLabel:g,icon:"Text",head:(e,o)=>{if(e.kind!=="part")return null;const i=o.describeNode(e.nodeId);if(!i)return null;const{key:a,row:d}=ot(e.propKey),f=d?nt(i.fields[a],d):i.fields[a],c=Re(i.type),u=c?De(c,e.propKey):null,h=c&&u?c[u].label:Ae[e.propKey],P=h?n(h):rt(n(st(at(f??{},a))),d),S=W({name:P,tier:"part",of:n(i.label)},{partOf:({name:E})=>n("Part of {name}",{name:E})});return{name:S.name,kindLabel:S.kind}},render:(e,o)=>e.kind==="part"?r(_e,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>o.onSelectNode(e.nodeId),onEditStyle:o.onOpenSiteStyles}):null}},St=new Set(["header","website","chat"]);function bt(e,o){if(e==="selection")return null;const i=ht[e];return St.has(e)&&!o.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>r(X,{what:i.name})}:i}function wt({mode:e,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:a,hideNodeActions:d=!1,onNotify:f,onHidePanel:c}){const{capabilities:u,tokenRef:h,notifyParent:P,currentSlug:S,siteId:E,runAuthed:Z,readOnly:$,navigate:gt}=Fe(),{rows:q}=Be(),O=q?.find(l=>l.slug===S)??null,J=Se(),T=Object.keys(J.fields).some(l=>!l.startsWith("_")&&!K.includes(l)),{websiteName:Q}=xe(),k=Me({readOnly:$}),{select:V}=We(),{selectedItem:t,getItemById:ee,getSelectorForId:te,config:b,appState:ne}=he(l=>l),oe=Pe(b,t?{type:t.type,props:t.props}:null),N=t?lt(oe??b.components[t.type]?.fields,t.props):[],re=l=>b.components[l]?.label??l,s=t?te(t.props.id):void 0,p=bt(e.kind,u),ie=Ie(),_={capabilities:u,tokenRef:h,hostPanels:ie.chrome?.panels,describeNode:l=>{const w=ee(l);if(!w)return null;const x=b.components[w.type];return{type:w.type,label:x?.label??w.type,fields:x?.fields??{},props:w.props??{}}},siteId:E,websiteName:Q??null,notifyParent:P,onNotify:f,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:a},H=p?.head?.(e,_)??null,R=we({kind:O?.kind,pageName:O?.label}),A=H?.name??(p?n(p.name):t?n(re(t.type)):R.name),se=H?.kindLabel??(p?n(p.kindLabel):t?s&&s.zone!==Y?n("Block"):n("Section"):R.kindLabel),ae=p?p.icon:t?t.type:"page",D=I(e)&&t?ct(t.type):null,le=!!t&&!!s&&s.zone===Y&&t.type!==L&&t.type!==Ye,v=Ue(ne?.data,t),ce=()=>{v||s&&k.duplicateComponent(s.zone,s.index)},pe=()=>{s&&(k.removeComponent(s.zone,s.index),k.select(null))},de=t?b.components[t.type]?.defaultProps?.previewHover:void 0,C=I(e)&&!!t&&!!s&&de!==void 0,B=C&&t.props.previewHover===!0,me=()=>{!t||!s||k.replaceComponent(s.zone,s.index,{...t,props:{...t.props,previewHover:!B}})},{shown:F,setShown:fe}=tt(),ue=!!(p||t||T);return m("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right ${et(F)}`.trim(),children:[r(ge,{icon:r(ve,{type:ae,size:15}),name:A,kind:se,actions:!d&&I(e)&&t&&t.type!==L?m(M,{children:[r(z,{label:n("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:ce,children:r(Ee,{size:15})}),le&&u.hasSiteSettings&&r(Ce,{node:t,currentSlug:S,siteId:E??void 0,tokenRef:h,runAuthed:Z,onNotify:f}),r(z,{label:n("Remove section"),danger:!0,onClick:pe,children:r(ke,{size:15})}),c?r(G,{side:"right",onHide:c,divider:!0}):null]}):c?r(G,{side:"right",onHide:c}):void 0}),C&&m("div",{className:"sf-preview-pin",children:[m("div",{className:"sf-preview-pin-text",children:[r("span",{className:"sf-preview-pin-label",children:n("Preview hover state")}),r("span",{className:"sf-preview-pin-hint",children:n("not shown live")})]}),r(Ve,{checked:B,onChange:me,ariaLabel:n("Preview hover state")})]}),m("div",{className:"sf-insp-body es-insp-body sf-scroll",children:[p?p.render(e,_):t?m(M,{children:[t.type===L&&u.hasSiteSettings&&r(Xe,{}),r(Ge,{children:r(U,{entries:r(je,{parts:N,heading:!1,onOpen:l=>V(it(t.props.id,l))}),entryCount:ze(N).length,itemWord:A})}),D&&r(He,{source:D,slug:dt(t?.props),menuId:pt(t?.props)})]}):T?r(U,{omit:K}):r(be,{variant:"none",icon:!1,message:n("Select a section or block to edit it.")}),ue&&r(Qe,{shown:F,onChange:fe,label:n("Show hints")})]})]})}export{un as CHAT_MODE,dn as HEADER_MODE,pn as SELECTION_MODE,hn as SOCIAL_MODE,mn as WEBSITE_MODE,fn as WEBSITE_PAGE_MODE,wt as default,bt as resolvePanel};
@@ -15,6 +15,7 @@ export declare function sideSpaceRow(device: SiteRowView, site: {
15
15
  readonly max: 80;
16
16
  readonly step: 4;
17
17
  readonly default: 40;
18
+ readonly typedMax: number;
18
19
  };
19
20
  } | {
20
21
  key: "site_gutter_phone";
@@ -24,6 +25,7 @@ export declare function sideSpaceRow(device: SiteRowView, site: {
24
25
  readonly min: 0;
25
26
  readonly max: 24;
26
27
  readonly step: 4;
28
+ readonly typedMax: number;
27
29
  };
28
30
  } | null;
29
31
  export default function SideSpaceField({ value, onChange, unsetPx, bounds, length, restsOn, }: {
@@ -34,6 +36,7 @@ export default function SideSpaceField({ value, onChange, unsetPx, bounds, lengt
34
36
  readonly min: number;
35
37
  readonly max: number;
36
38
  readonly step: number;
39
+ readonly typedMax?: number;
37
40
  };
38
41
  length?: SiteRowLength;
39
42
  restsOn?: number;
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{SettingsDefaultReset as m,SettingsField as c}from"efficient-easel/panel";import{PaddingXIcon as f}from"efficient-easel/icons";import{SITE_GUTTER as s,SITE_GUTTER_PHONE as S,siteGutterPhoneFollows as _}from"../../format/lib/content/page-width.js";import{say as i,editorEaselWords as x}from"../../format/lib/editor-words.js";import{Slider as E}from"../lib/document/controls.js";import{siteTwinRow as g}from"../../format/lib/site-twin-row.js";const a="Side space",p=s.default,T="The room left at the left and right edge of every page.";function U(o,e){return g(o,{desktop:{key:"site_gutter",value:e.gutter,unsetPx:p,bounds:s},phone:{key:"site_gutter_phone",value:e.phone,unsetPx:_(e.gutter,e.gutterUnit),bounds:S}})}function I({value:o,onChange:e,unsetPx:l=p,bounds:n=s,length:t,restsOn:u=l}){const d=o===null;return r(c,{label:i(a),labelId:"sf-side-space",icon:r(f,{}),changed:!d,action:r(m,{words:x()?.panel,label:i(a),changed:!d,detail:`${l}px`,onReset:()=>e(null)}),hint:i(T),children:r(E,{min:(t?.grid??n).min,max:(t?.grid??n).max,step:(t?.grid??n).step,value:o,suffix:t?.unit??"px",...t?{units:t.units}:{},placeholder:u,onClear:()=>e(null),ariaLabel:i(a),onChange:e})})}export{T as SIDE_SPACE_HINT,a as SIDE_SPACE_LABEL,I as default,U as sideSpaceRow};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{SettingsDefaultReset as f,SettingsField as m}from"efficient-easel/panel";import{PaddingXIcon as c}from"efficient-easel/icons";import{SITE_GUTTER as a,SITE_GUTTER_PHONE as x,siteGutterPhoneFollows as S}from"../../format/lib/content/page-width.js";import{say as n,editorEaselWords as _}from"../../format/lib/editor-words.js";import{Slider as E}from"../lib/document/controls.js";import{siteTwinRow as T}from"../../format/lib/site-twin-row.js";const p="Side space",l=a.default,g="The room left at the left and right edge of every page.";function k(o,e){return T(o,{desktop:{key:"site_gutter",value:e.gutter,unsetPx:l,bounds:a},phone:{key:"site_gutter_phone",value:e.phone,unsetPx:S(e.gutter,e.gutterUnit),bounds:x}})}function I({value:o,onChange:e,unsetPx:s=l,bounds:i=a,length:t,restsOn:u=s}){const d=o===null;return r(m,{label:n(p),labelId:"sf-side-space",icon:r(c,{}),changed:!d,action:r(f,{words:_()?.panel,label:n(p),changed:!d,detail:`${s}px`,onReset:()=>e(null)}),hint:n(g),children:r(E,{min:(t?.grid??i).min,max:(t?.grid??i).max,step:(t?.grid??i).step,value:o,suffix:t?.unit??"px",...t?{units:t.units}:{},...i.typedMax!==void 0&&(t?.unit??"px")==="px"?{inputMax:i.typedMax}:{},placeholder:u,onClear:()=>e(null),ariaLabel:n(p),onChange:e})})}export{g as SIDE_SPACE_HINT,p as SIDE_SPACE_LABEL,I as default,k as sideSpaceRow};
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as y,jsxs as C}from"react/jsx-runtime";import{useCallback as v,useEffect as g,useRef as te,useState as B}from"react";import{SettingsSwitch as oe}from"efficient-easel/panel";import{PagesIcon as re,StylesIcon as ne}from"efficient-easel/rail";import{PaletteIcon as ie}from"efficient-shell/icons/efficient";import{Subtree as se,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{toItemSelector as ae}from"efficient-easel/node-ops";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ce}from"./LocationsTreeContext.js";import{usePartTypingDeps as de}from"./usePartTypingDeps.js";import{copyItemWrite as le}from"../lib/document/card-copy-rows.js";import pe from"./PagesPanel.js";import{useShowPagesForAddPage as me}from"./AddPageOnOpen.js";import{usePreviewChat as ue}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as fe}from"./preview-devices.js";import{PreviewDeviceContext as Se}from"efficient-easel/draw/client";import{usePreviewSocial as Ee}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as he,usePreviewTicker as Te}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as we}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as ge}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ie,HERO_PART_MODE as W,heroMediaRows as be,heroPartId as V,readHeroPartId as ve}from"../../render/lib/document/hero-media-parts.js";import _e,{CHAT_MODE as ke,HEADER_MODE as Ce,SOCIAL_MODE as Re,WEBSITE_MODE as M,WEBSITE_PAGE_MODE as Le}from"./SectionEditor.js";import R from"./SectionIcon.js";import Oe from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import Ae from"./StylesPanel.js";import{LOCATIONS_TYPE as ye,useLocationsTree as Be}from"./useLocationsTree.js";import{usePinnedChromeSeed as De}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ne}from"./useHostDocumentBridge.js";import{usePreviewHref as He}from"./usePreviewHref.js";import{WebsitePreviewButton as We}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Ve,SITE_STYLES_TABS as Me,SITE_STYLES_TEXT_TAB as xe,useWebsiteName as Ge}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Ye}from"./useWebsiteMainAction.js";import{VersionHistory as Fe}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as ze}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ke,heroGroupNestDepth as je}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ue}from"../../format/lib/markup.js";import{categoryShortLabel as Ze,PINNED_SECTION_TYPE as qe}from"../lib/document/add-palette.js";import{canAddTo as Xe}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Je}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as Qe}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as $e,setBookingPreview as et}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as tt}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as ot}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as rt,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as nt,readLeftView as it,resolveLeftView as st,writeLeftView as at}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as ct}from"../lib/document/locked-blocks.js";import{everyPageNotice as dt,noOwnTab as lt,pinnedReach as Y,websiteDuplicateBlocked as pt}from"../lib/document/every-page.js";import{sharedSectionReach as mt,WEBSITE_SHARED_SECTIONS as ut}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as ft}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as St,scrollPreviewToTop as z}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as Et}from"../lib/document/overrides.js";import{labelAtLevel as Pt}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as ht}from"../../format/lib/document/media-drop.js";import{editorWords as Tt,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as wt}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as gt,isSectionGroupType as It,sectionGroupZone as bt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as vt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as _t}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as kt,SAVE_AS_TEMPLATE_EVENT as Ct}from"../../format/lib/save-as-template-action.js";import{menuPresets as Rt}from"../lib/sections/menu-presets.js";import{newSectionNode as Lt}from"../lib/sections/new-section-node.js";import{useHostProducts as Ot}from"../lib/use-host-products.js";import{backendOf as At}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=Te(),c=H().tree,d=e,n=d.kind==="ticker"?d.heroId:null,s=v(i=>{if(!i)return;t({kind:"ticker",heroId:i}),St(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const S=String(i.props.id);return i.type==="Hero"&&we(i.props)&&a(D,{icon:a(R,{type:"ticker",size:13}),name:f(he),onSelect:()=>s(S),selected:n===S,rowProps:{onClick:m(()=>s(S))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=ge(),c=H().tree,{appState:d,config:n}=N(p=>p),s=te({data:d.data,config:n});s.current={data:d.data,config:n};const i=e,m=Ie.find(p=>W[p]===i.kind),S=m&&"nodeId"in i?V(String(i.nodeId),m):null,P=v(p=>{const l=ve(p);if(!l)return;const{data:T,config:h}=s.current,u=ae(T,h,{kind:"node",id:l.nodeId});if(!u)return;const I={kind:W[l.part],nodeId:l.nodeId};t({index:u.index,zone:u.zone},I)},[t]);return g(()=>{o(S)},[S,o]),g(()=>{r(P)},[r,P]),{partRows:(p,{rowClick:l})=>{const T=String(p.props.id),h=be(p);if(h.length===0)return null;const u=E=>{const w=V(T,E.part);return a(D,{icon:a(R,{type:E.part==="media"?"heroMedia":"heroImage",size:13}),name:f(E.label),onSelect:()=>P(w),selected:S===w,rowProps:{onClick:l(()=>P(w))},words:c},w)},[I,...b]=h;return C(y,{children:[u(I),b.length>0&&a(se,{children:b.map(u)})]})}}}function Z(e,t){return{partRows:(o,r)=>C(y,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function yt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=L(),{hasPreviewLink:S}=o,P=At(x()).preview?.draftLink,p=Ye(e.data),l=kt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),T=v(()=>{!c||!r||i(Ct,{siteId:c,slug:r})},[i,c,r]),h=He({pageSlug:r,siteId:c,token:m}),u=t.previewHref?.(r)??h;return{barLead:()=>l.visible&&a(_t,{enabled:l.enabled,reason:l.enabled?"":l.disabledReason,onSaved:T}),barView:()=>S&&r&&a(We,{liveHref:u,pageId:d??null,draftLink:P}),mainAction:p}}function Bt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=E=>t.setView(E),[S,P]=B(Me[0].id),[p,l]=B(!1),{surface:T,setSurface:h}=Pe(),u=()=>{if(s){m("styles"),t.reveal(),z();return}e.show(M),e.reveal(),z()},I={id:"pages",label:f("Pages"),icon:a(re,{}),panel:({onHide:E})=>a(pe,{activeSurface:T,onPreviewSurface:h,onNavigate:w=>{h(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:E})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(ie,{}),active:e.kind==="website",onSelect:u}),s&&b.push({id:"styles",label:f("Styles"),icon:a(ne,{}),panel:({onHide:E,notify:w})=>a(Ae,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:w,tab:S,onTabChange:P,revealPageGroup:p,onPageGroupRevealed:()=>l(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:E=>st(E,s),openSettings:u,openStyles:()=>{P(xe),m("styles")},openPageStyles:s?()=>{P(Ve),l(!0),m("styles"),t.reveal()}:i?()=>{e.show(Le),e.reveal()}:void 0}}function Dt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=N(n=>n.config),d=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=O();if(!n||!r)return;let s=!1;return ft(d).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,d])}function q(){const e=de();return v(t=>{le(t,e)},[e])}function Nt(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:s}=t;g(()=>{et(n?.type==="BookingBox"&&n.props.region==="confirm"?$e(s(String(n.props.id))):null)},[n?.props.id]);const i=Be(e,t),{capabilities:{hasSiteSettings:m}}=L();Dt();const{chat:S,setChat:P,setSelected:p,setSelectHandler:l}=ue(),T=v(()=>d(ke),[d]),h=c==="chat";g(()=>{p(h)},[h,p]),g(()=>{l(T)},[l,T]);const{setOpenHandler:u}=Ee(),I=v(()=>d(Re),[d]);g(()=>{u(I)},[u,I]);const b=Z(j(e),U(e)),E=yt(t),w=Bt(e,r);me(r);const Q=o.device,$=q();return{...b,...E,...w,hasOwnRows:k=>k.type===ye,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,onCopyItem:$,wrap:k=>a(ce.Provider,{value:!0,children:C(Se.Provider,{value:Q,children:[k,a(Fe,{})]})}),addPanelRow:k=>m?C("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(R,{type:"chat",size:16})}),C("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),T()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(oe,{checked:S.enabled,onChange:ee=>P({enabled:ee}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let X=null,A=new WeakMap;function Ht(e){const t=Tt();if(!e||!t)return e;X!==t&&(X=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:f(r.label)})):null,spec:e.spec?{...e.spec,addLabel:f(e.spec.addLabel),...e.spec.childLabel?{childLabel:f(e.spec.childLabel)}:{}}:null},A.set(e,o)),o}const Wt={isLockedBlock:(e,t)=>ct(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:pt,nestDepth:(e,t,o)=>t===Ke?je(e,o):0,newSectionNode:Lt,canAddTo:(e,t,o,r)=>Ht(Xe(e,t,r,o)),blockIsOffered:Qe,slotsOf:Je,resolveOnInsert:!0},Vt=new Proxy(wt,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),Mt={labelAtLevel:(e,t,o)=>f(Pt(e,t,o)),descriptions:Vt,categoryLabel:e=>{const t=Ze(e);return t===void 0?void 0:f(t)},firstSection:qe,blockRowName:tt,rowName:ot,plainText:Ue,Icon:R,Thumbnail:Oe,useProducts:Ot,presets:Rt()},xt={desktop:2e3,tablet:800,mobile:390},J="desktop",Gt={options:fe,initial:J,fluid:J,widths:xt,hidesPerView:!0},Yt={read:it,write:e=>at(e),forSelection:(e,t)=>nt(e,t)},Ft={first:G,last:rt,firstGroup:vt,lastGroup:K,isSectionGroup:It,sectionGroupZone:bt,panelOf:e=>e===G?Ce:null,get sharedReach(){return _()?Kt:void 0},get shared(){return O()?ut:void 0},get groupTab(){return _()?lt:void 0},get groupBadge(){return _()?Y({type:K})??void 0:void 0},get changeNotice(){return _()?dt():void 0},get band(){return _()?zt:void 0},get groupAccepts(){return _()?gt:void 0}},zt={foldable:!0},Kt=e=>Y(e)??mt(e);function jt(e){return{...Z(j(e),U(e)),onCopyItem:q(),openSettings:()=>e.show(M)}}function Ut(e,t){De(e,t),Ne()}const dr={useOwnerName:Ge,useDocumentLabel:ze,useBridges:Nt,useStandaloneBridges:jt,useDocumentPass:Ut,blockRules:Wt,blockLook:Mt,devices:Gt,leftView:Yt,pinned:Ft,Canvas:Et,canvasDrag:{media:ht},Inspector:_e};export{dr as WEBSITE_SCREEN};
1
+ "use client";import{jsx as a,Fragment as y,jsxs as C}from"react/jsx-runtime";import{useCallback as v,useEffect as g,useRef as te,useState as B}from"react";import{SettingsSwitch as oe}from"efficient-easel/panel";import{PagesIcon as re,StylesIcon as ne}from"efficient-easel/rail";import{PaletteIcon as ie}from"efficient-shell/icons/efficient";import{Subtree as se,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{toItemSelector as ae}from"efficient-easel/node-ops";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ce}from"./LocationsTreeContext.js";import{usePartTypingDeps as de}from"./usePartTypingDeps.js";import{copyItemWrite as le}from"../lib/document/card-copy-rows.js";import pe from"./PagesPanel.js";import{useShowPagesForAddPage as me}from"./AddPageOnOpen.js";import{usePreviewChat as ue}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as fe}from"./preview-devices.js";import{PHONE_EDGE as Se}from"../../format/lib/content/view-lines.js";import{PreviewDeviceContext as Ee}from"efficient-easel/draw/client";import{usePreviewSocial as Pe}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as he}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Te,usePreviewTicker as we}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as ge}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as Ie}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as be,HERO_PART_MODE as W,heroMediaRows as ve,heroPartId as M,readHeroPartId as _e}from"../../render/lib/document/hero-media-parts.js";import ke,{CHAT_MODE as Ce,HEADER_MODE as Re,SOCIAL_MODE as Le,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as Oe}from"./SectionEditor.js";import R from"./SectionIcon.js";import Ae from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import ye from"./StylesPanel.js";import{LOCATIONS_TYPE as Be,useLocationsTree as De}from"./useLocationsTree.js";import{usePinnedChromeSeed as Ne}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as He}from"./useHostDocumentBridge.js";import{usePreviewHref as We}from"./usePreviewHref.js";import{WebsitePreviewButton as Me}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Ve,SITE_STYLES_TABS as xe,SITE_STYLES_TEXT_TAB as Ge,useWebsiteName as Ye}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Fe}from"./useWebsiteMainAction.js";import{VersionHistory as ze}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Ke}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as je,heroGroupNestDepth as Ue}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ze}from"../../format/lib/markup.js";import{categoryShortLabel as qe,PINNED_SECTION_TYPE as Xe}from"../lib/document/add-palette.js";import{canAddTo as Je}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Qe}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as $e}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as et,setBookingPreview as tt}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as ot}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as rt}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as nt,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as it,readLeftView as st,resolveLeftView as at,writeLeftView as ct}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as dt}from"../lib/document/locked-blocks.js";import{everyPageNotice as lt,noOwnTab as pt,pinnedReach as Y,websiteDuplicateBlocked as mt}from"../lib/document/every-page.js";import{sharedSectionReach as ut,WEBSITE_SHARED_SECTIONS as ft}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as St}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as Et,scrollPreviewToTop as z}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as Pt}from"../lib/document/overrides.js";import{labelAtLevel as ht}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as Tt}from"../../format/lib/document/media-drop.js";import{editorWords as wt,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as gt}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as It,isSectionGroupType as bt,sectionGroupZone as vt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as _t}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as kt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as Ct,SAVE_AS_TEMPLATE_EVENT as Rt}from"../../format/lib/save-as-template-action.js";import{menuPresets as Lt}from"../lib/sections/menu-presets.js";import{newSectionNode as Ot}from"../lib/sections/new-section-node.js";import{useHostProducts as At}from"../lib/use-host-products.js";import{backendOf as yt}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=we(),c=H().tree,d=e,n=d.kind==="ticker"?d.heroId:null,s=v(i=>{if(!i)return;t({kind:"ticker",heroId:i}),Et(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const S=String(i.props.id);return i.type==="Hero"&&ge(i.props)&&a(D,{icon:a(R,{type:"ticker",size:13}),name:f(Te),onSelect:()=>s(S),selected:n===S,rowProps:{onClick:m(()=>s(S))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Ie(),c=H().tree,{appState:d,config:n}=N(p=>p),s=te({data:d.data,config:n});s.current={data:d.data,config:n};const i=e,m=be.find(p=>W[p]===i.kind),S=m&&"nodeId"in i?M(String(i.nodeId),m):null,P=v(p=>{const l=_e(p);if(!l)return;const{data:T,config:h}=s.current,u=ae(T,h,{kind:"node",id:l.nodeId});if(!u)return;const I={kind:W[l.part],nodeId:l.nodeId};t({index:u.index,zone:u.zone},I)},[t]);return g(()=>{o(S)},[S,o]),g(()=>{r(P)},[r,P]),{partRows:(p,{rowClick:l})=>{const T=String(p.props.id),h=ve(p);if(h.length===0)return null;const u=E=>{const w=M(T,E.part);return a(D,{icon:a(R,{type:E.part==="media"?"heroMedia":"heroImage",size:13}),name:f(E.label),onSelect:()=>P(w),selected:S===w,rowProps:{onClick:l(()=>P(w))},words:c},w)},[I,...b]=h;return C(y,{children:[u(I),b.length>0&&a(se,{children:b.map(u)})]})}}}function Z(e,t){return{partRows:(o,r)=>C(y,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Bt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=L(),{hasPreviewLink:S}=o,P=yt(x()).preview?.draftLink,p=Fe(e.data),l=Ct({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),T=v(()=>{!c||!r||i(Rt,{siteId:c,slug:r})},[i,c,r]),h=We({pageSlug:r,siteId:c,token:m}),u=t.previewHref?.(r)??h;return{barLead:()=>l.visible&&a(kt,{enabled:l.enabled,reason:l.enabled?"":l.disabledReason,onSaved:T}),barView:()=>S&&r&&a(Me,{liveHref:u,pageId:d??null,draftLink:P}),mainAction:p}}function Dt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=E=>t.setView(E),[S,P]=B(xe[0].id),[p,l]=B(!1),{surface:T,setSurface:h}=he(),u=()=>{if(s){m("styles"),t.reveal(),z();return}e.show(V),e.reveal(),z()},I={id:"pages",label:f("Pages"),icon:a(re,{}),panel:({onHide:E})=>a(pe,{activeSurface:T,onPreviewSurface:h,onNavigate:w=>{h(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:E})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(ie,{}),active:e.kind==="website",onSelect:u}),s&&b.push({id:"styles",label:f("Styles"),icon:a(ne,{}),panel:({onHide:E,notify:w})=>a(ye,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:w,tab:S,onTabChange:P,revealPageGroup:p,onPageGroupRevealed:()=>l(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:E=>at(E,s),openSettings:u,openStyles:()=>{P(Ge),m("styles")},openPageStyles:s?()=>{P(Ve),l(!0),m("styles"),t.reveal()}:i?()=>{e.show(Oe),e.reveal()}:void 0}}function Nt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=N(n=>n.config),d=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=O();if(!n||!r)return;let s=!1;return St(d).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,d])}function q(){const e=de();return v(t=>{le(t,e)},[e])}function Ht(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:s}=t;g(()=>{tt(n?.type==="BookingBox"&&n.props.region==="confirm"?et(s(String(n.props.id))):null)},[n?.props.id]);const i=De(e,t),{capabilities:{hasSiteSettings:m}}=L();Nt();const{chat:S,setChat:P,setSelected:p,setSelectHandler:l}=ue(),T=v(()=>d(Ce),[d]),h=c==="chat";g(()=>{p(h)},[h,p]),g(()=>{l(T)},[l,T]);const{setOpenHandler:u}=Pe(),I=v(()=>d(Le),[d]);g(()=>{u(I)},[u,I]);const b=Z(j(e),U(e)),E=Bt(t),w=Dt(e,r);me(r);const Q=o.device,$=q();return{...b,...E,...w,hasOwnRows:k=>k.type===Be,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,onCopyItem:$,wrap:k=>a(ce.Provider,{value:!0,children:C(Ee.Provider,{value:Q,children:[k,a(ze,{})]})}),addPanelRow:k=>m?C("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(R,{type:"chat",size:16})}),C("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),T()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(oe,{checked:S.enabled,onChange:ee=>P({enabled:ee}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let X=null,A=new WeakMap;function Wt(e){const t=wt();if(!e||!t)return e;X!==t&&(X=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:f(r.label)})):null,spec:e.spec?{...e.spec,addLabel:f(e.spec.addLabel),...e.spec.childLabel?{childLabel:f(e.spec.childLabel)}:{}}:null},A.set(e,o)),o}const Mt={isLockedBlock:(e,t)=>dt(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:mt,nestDepth:(e,t,o)=>t===je?Ue(e,o):0,newSectionNode:Ot,canAddTo:(e,t,o,r)=>Wt(Je(e,t,r,o)),blockIsOffered:$e,slotsOf:Qe,resolveOnInsert:!0},Vt=new Proxy(gt,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),xt={labelAtLevel:(e,t,o)=>f(ht(e,t,o)),descriptions:Vt,categoryLabel:e=>{const t=qe(e);return t===void 0?void 0:f(t)},firstSection:Xe,blockRowName:ot,rowName:rt,plainText:Ze,Icon:R,Thumbnail:Ae,useProducts:At,presets:Lt()},Gt={desktop:2e3,tablet:800,mobile:390},J="desktop",Yt={options:fe,initial:J,fluid:J,fluidMin:Se,widths:Gt,hidesPerView:!0},Ft={read:st,write:e=>ct(e),forSelection:(e,t)=>it(e,t)},zt={first:G,last:nt,firstGroup:_t,lastGroup:K,isSectionGroup:bt,sectionGroupZone:vt,panelOf:e=>e===G?Re:null,get sharedReach(){return _()?jt:void 0},get shared(){return O()?ft:void 0},get groupTab(){return _()?pt:void 0},get groupBadge(){return _()?Y({type:K})??void 0:void 0},get changeNotice(){return _()?lt():void 0},get band(){return _()?Kt:void 0},get groupAccepts(){return _()?It:void 0}},Kt={foldable:!0},jt=e=>Y(e)??ut(e);function Ut(e){return{...Z(j(e),U(e)),onCopyItem:q(),openSettings:()=>e.show(V)}}function Zt(e,t){Ne(e,t),He()}const pr={useOwnerName:Ye,useDocumentLabel:Ke,useBridges:Ht,useStandaloneBridges:Ut,useDocumentPass:Zt,blockRules:Mt,blockLook:xt,devices:Yt,leftView:Ft,pinned:zt,Canvas:Pt,canvasDrag:{media:Tt},Inspector:ke};export{pr as WEBSITE_SCREEN};
@@ -202,7 +202,7 @@
202
202
  border-radius: calc(var(--radius-sm) / 2);
203
203
  background: var(--sf-accent);
204
204
  opacity: 0;
205
- transition: opacity 0.12s;
205
+ transition: opacity var(--motion-fast);
206
206
  }
207
207
  .sf-gap-plus {
208
208
  position: absolute;
@@ -1627,31 +1627,12 @@
1627
1627
  display: none;
1628
1628
  }
1629
1629
 
1630
- /* ── The icon rail: the shared editor-shell EaselRail (`.es-rail`) ───────────
1631
- The rail markup + base styles live in the `efficient-easel` package (imported via
1632
- `efficient-easel/rail.css`); the storefront no longer hand-rolls `.sf-rail`.
1633
- editor-shell ships its own defaults, so we remap the themeable `--es-rail-*`
1634
- custom properties onto the storefront's own `--sf-*` tokens, which is what
1635
- keeps the shared rail reading as this editor's chrome rather than as the
1636
- package's. (One mode only — the editor is deliberately light-only; see the
1637
- note at the top of this file.)
1638
- Scoped `.sf-editor .es-rail` (specificity 0,2,0) so it always beats rail.css's
1639
- base `.es-rail` (0,1,0) whatever order the two stylesheets load in.
1640
-
1641
- THREE TOKENS ARE DELIBERATELY NOT REMAPPED HERE, and each absence is load-
1642
- bearing since card 66198 laid the rail into the top bar as a row:
1643
-
1644
- --es-rail-w only the COLUMN reads it (`.es-rail { width:
1645
- var(--es-rail-w) }`); the row is `width: auto` and sizes
1646
- to its buttons, so a remap would be config nothing reads.
1647
- --es-rail-bg the row variant re-points these to transparent / none / 0
1648
- --es-rail-shadow ON PURPOSE: the bar already has its own surface, and a
1649
- --es-rail-radius second white card floating inside it is the bug. This
1650
- rule ties with `.es-rail.es-rail-row` on specificity
1651
- (0,2,0 both), so setting them here would silently WIN
1652
- and put that card back. The rail's surface is the bar's.
1653
-
1654
- Everything left below is colour the row variant does not touch. */
1630
+ /* ── The icon rail: efficient-easel's EaselRail (`.es-rail`) ────────────────
1631
+ Since efficient-easel 36 the rail is `.sf-body`'s first column (Add, Pages,
1632
+ Layers, Styles, Media). Its markup, size (44 = 4 + 36 + 4, gap 8, inset 8)
1633
+ and colours are the package's, from `efficient-easel/rail.css` on the
1634
+ shell's tokens; the website adds NO `.es-rail` rule
1635
+ (scripts/test-no-host-rail-css.ts). */
1655
1636
 
1656
1637
  /* ── Left panel: Pages view (the page list) ─────────────────────────────── */
1657
1638
  .sf-pages {
@@ -1694,15 +1675,11 @@
1694
1675
  .sf-add-page {
1695
1676
  padding: var(--space-32) var(--space-48);
1696
1677
  }
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 {
1678
+ /* The main area takes the window's first focus (initialFocus), so a mouse
1679
+ open draws no ring on "+ Blank page". It is not a control: no ring of its
1680
+ own. Its title, sub line and Loading are the shell's Title, Paragraph and
1681
+ LoadingSpinner. */
1682
+ .sf-add-page:focus {
1706
1683
  outline: none;
1707
1684
  }
1708
1685
  /* The list's rows on the same side gutter as "+ Blank page" above them, so the
@@ -1712,8 +1689,6 @@
1712
1689
  }
1713
1690
  .sf-add-page-sub {
1714
1691
  margin: var(--space-8) 0 var(--space-32);
1715
- font-size: var(--text-sm);
1716
- color: var(--ink);
1717
1692
  }
1718
1693
  .sf-add-page-group {
1719
1694
  margin-top: var(--space-32);
@@ -1725,11 +1700,11 @@
1725
1700
  flex-direction: column;
1726
1701
  gap: var(--space-12);
1727
1702
  }
1703
+ /* The picture's frame is the shell's Card (its border, radius and surface);
1704
+ this only holds the hover button over it and clips the drawing. */
1728
1705
  .sf-starter-picture {
1729
1706
  position: relative;
1730
1707
  overflow: hidden;
1731
- border: 1px solid var(--line);
1732
- border-radius: var(--radius-sm);
1733
1708
  }
1734
1709
  .sf-starter-frame {
1735
1710
  pointer-events: none;
@@ -1746,16 +1721,12 @@
1746
1721
  align-items: center;
1747
1722
  justify-content: center;
1748
1723
  opacity: 0;
1749
- transition: opacity 0.12s;
1724
+ transition: opacity var(--motion-fast);
1750
1725
  }
1751
1726
  .sf-starter:hover .sf-starter-add,
1752
1727
  .sf-starter:focus-within .sf-starter-add {
1753
1728
  opacity: 1;
1754
1729
  }
1755
- .sf-starter-name {
1756
- font-size: var(--text-sm);
1757
- color: var(--ink-strongest);
1758
- }
1759
1730
  /* `.sf-pgroup*` and `.sf-prow` WERE HERE: the Pages headings are the shell's
1760
1731
  `TreeGroupLabel` (its count pill and fold), its rows the shell's `TreeRow`. */
1761
1732
  /* `.sf-page-draft`, `.sf-badge-dynamic` and `.sf-badge-lightbox` WERE HERE: a
@@ -1 +1 @@
1
- import{convertRowLength as _,rowUnits as k,unitPickPatch as h}from"efficient-easel/screen/lib/content/length-units";import{viewKeyAt as b}from"efficient-easel/draw";import{SITE_LENGTH_UNIT_COLUMNS as G,siteLengthTrack as T,storedUnit as s}from"../../../format/lib/content/css-length.js";import{SITE_BLOCK_GAP as m}from"../../../format/lib/content/container-gap.js";import{PAGE_WIDTH as a,SITE_GUTTER as l,SITE_GUTTER_PHONE as E}from"../../../format/lib/content/page-width.js";import{LENGTH_UNITS_TABLE as f}from"../document/box-fields.js";import{CORNER_RADIUS_GRID as L}from"../../../format/lib/theme.js";const P=["cornerRadius","siteWidth","siteGutter","siteGutterPhone","blockGap","blockGapPhone"],p={cornerRadius:{number:"corner_radius_px",kind:"radius",grid:L,tier:"desktop"},siteWidth:{number:"site_width",kind:"size",grid:a,tier:"desktop"},siteGutter:{number:"site_gutter",kind:"spacing",grid:l,tier:"desktop"},siteGutterPhone:{number:"site_gutter_phone",kind:"spacing",grid:E,tier:"mobile"},blockGap:{number:"block_gap",kind:"gap",grid:m,tier:"desktop"},blockGapPhone:{number:"block_gap_phone",kind:"gap",grid:m,tier:"mobile"}};function g(t){return{number:p[t].number,unit:G[`${t}Unit`]}}function C(t,n,e){const i=s(e),{number:r,unit:o}=g(t);return{[r]:n,[o]:n===null||i==="px"?null:i}}function R(t,n,e,i){const{kind:r,grid:o,tier:u}=p[t],c=s(e),d=s(i);return c===d?n:_(n,c,d,u,{kind:r},o)}function O(t,n,e,i){const{number:r,unit:o}=g(t),u=h({[r]:n},c=>R(t,c,e,i),o,s(i),"px");return{[r]:u[r],[o]:u[o]??null}}function H(t,n){const{kind:e,grid:i}=p[t];return T(e,s(n),i)}function W(t){return k({kind:p[t].kind},f)}function D(t,n){const e=b(t,n);if(!P.includes(e))throw new Error(`no site length row ${e}`);return e}export{P as SITE_LENGTH_ROWS,g as siteLengthColumns,R as siteLengthConvert,H as siteLengthGrid,C as siteLengthPatch,D as siteLengthRowAt,O as siteLengthUnitPick,W as siteLengthUnits};
1
+ import{convertRowLength as h,rowUnits as b,unitPickPatch as a}from"efficient-easel/screen/lib/content/length-units";import{viewKeyAt as G}from"efficient-easel/draw";import{SITE_LENGTH_UNIT_COLUMNS as T,siteLengthTrack as f,storedUnit as s}from"../../../format/lib/content/css-length.js";import{SITE_BLOCK_GAP as g}from"../../../format/lib/content/container-gap.js";import{PAGE_WIDTH as l,SITE_GUTTER as E,SITE_GUTTER_PHONE as x}from"../../../format/lib/content/page-width.js";import{LENGTH_UNITS_TABLE as L}from"../document/box-fields.js";import{CORNER_RADIUS_GRID as P}from"../../../format/lib/theme.js";const R=["cornerRadius","siteWidth","siteGutter","siteGutterPhone","blockGap","blockGapPhone"],p={cornerRadius:{number:"corner_radius_px",kind:"radius",grid:P,tier:"desktop"},siteWidth:{number:"site_width",kind:"size",grid:l,tier:"desktop"},siteGutter:{number:"site_gutter",kind:"spacing",grid:E,tier:"desktop"},siteGutterPhone:{number:"site_gutter_phone",kind:"spacing",grid:x,tier:"mobile"},blockGap:{number:"block_gap",kind:"gap",grid:g,tier:"desktop"},blockGapPhone:{number:"block_gap_phone",kind:"gap",grid:g,tier:"mobile"}};function _(t){return{number:p[t].number,unit:T[`${t}Unit`]}}function H(t,n,e){const i=s(e),{number:o,unit:r}=_(t);return{[o]:n,[r]:n===null||i==="px"?null:i}}function U(t,n,e,i){const{kind:o,grid:r,tier:u}=p[t],c=s(e),d=s(i),m=r.typedMax,k=m!==void 0&&d==="px"?{...r,max:m}:r;return c===d?n:h(n,c,d,u,{kind:o},k)}function W(t,n,e,i){const{number:o,unit:r}=_(t),u=a({[o]:n},c=>U(t,c,e,i),r,s(i),"px");return{[o]:u[o],[r]:u[r]??null}}function D(t,n){const{kind:e,grid:i}=p[t];return f(e,s(n),i)}function y(t){return b({kind:p[t].kind},L)}function B(t,n){const e=G(t,n);if(!R.includes(e))throw new Error(`no site length row ${e}`);return e}export{R as SITE_LENGTH_ROWS,_ as siteLengthColumns,U as siteLengthConvert,D as siteLengthGrid,H as siteLengthPatch,B as siteLengthRowAt,W as siteLengthUnitPick,y as siteLengthUnits};
@@ -1 +1 @@
1
- import{jsx as i,jsxs as $,Fragment as X}from"react/jsx-runtime";import{HeightIcon as q,ImageIcon as z,ImagesIcon as J,OpacityIcon as Q,MediaLayoutSideBySideIcon as Z,MediaLayoutStackedIcon as ee,PlacementIcon as H,PlayIcon as oe,UploadIcon as te}from"efficient-easel/icons";import{viewFocusKeys as w}from"../../../../format/lib/content/picture-focus-rows.js";import{HERO_FOCUS as p,MEDIA_LAYOUT_DEFAULT as ie,MEDIA_LAYOUT_LABELS as ne,MEDIA_LAYOUTS as re,resolvePhoneLayout as le}from"../../../../format/lib/hero-media-layout.js";import{useEasel as ae,useSelectedHost as de}from"efficient-easel/easel";import{SettingsDefaultReset as se,SettingsField as ue,SettingsSegmented as he}from"efficient-easel/panel";import{describedAs as ce,FLAT_ACCESS as pe,iconOf as me,onDesktopWords as fe,phoneTwinFields as E,useAccessPatch as ge}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as _}from"efficient-easel/screen/lib/document/style-fields";import{colorInput as C,edgePad as F,focusKeptField as Oe,plainText as be,Slider as D,upload as Ee,useSelectedSibling as x}from"../controls.js";import{ColourRow as _e,InheritedColourRow as xe}from"../ColourControl.js";import{rowSay as ye,segmented as y,slider as ve}from"../box-fields.js";import{SHAPE_TABLE as Se}from"../../../../format/lib/content/gallery-card-layout.js";import{ShapePicker as Te}from"../shape-picker.js";import{HERO_FIXED_DEFAULT as Re,HERO_HEIGHT_PX as v,readHeroFixedHeight as Le,SECTION_HEIGHT as h}from"../../../../format/lib/content/section-height.js";import{DEFAULT_TINT as S}from"../../../../format/lib/content/tint.js";import{editorEaselWords as Ae,say as a}from"../../../../format/lib/editor-words.js";import{nonEmptyString as T}from"../../../../format/lib/non-empty-string.js";import{findParentNode as Ie}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as P,OVERLAY_POSITION_OPTIONS as k,slideOverlayState as U}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as He,VIDEO_PLAYBACK_LABELS as we,VIDEO_PLAYBACKS as Ce,VIDEO_SOURCE_DEFAULT as Fe,VIDEO_SOURCE_LABELS as De,VIDEO_SOURCES as Pe}from"../../../../format/lib/hero-video.js";function ke(){return Se.filter(e=>e.ratio!==null)}const R={desktop:{number:"heightDesktop",fixed:"heightFixed"},tablet:{number:"heightTablet",fixed:"heightFixedTablet"},mobile:{number:"heightMobile",fixed:"heightFixedMobile"}},M={read:e=>e.heightMobile,write:(e,o,t)=>({heightMobile:t}),fieldKey:()=>"heightMobile",ownField:!0,tablet:{read:e=>e.heightTablet,write:(e,o,t)=>({heightTablet:t}),fieldKey:()=>"heightTablet",ownField:!0}};function Y(e,{number:o,fixed:t}){const r=o===void 0?void 0:e[o];return Le(e[t])??(typeof r=="number"?{unit:"vh",vh:r}:null)}const Ue="On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";function Me({view:e,keys:o,props:t}){const r=de(),d=ge(pe),{number:s}=o,m={...r?.values??{},...s?{[s]:t.value}:{}},O=Y(m,o),n=e==="tablet"?Y(m,R.desktop):null,u=O??n??{unit:"vh",vh:h.fallback},c=t.readOnly===!0,L=ke(),G=l=>{if(l===u.unit)return;if(l!=="vh"){d([[o.fixed,n?.unit===l?n.value:Re[l]]]);return}const N=s!==void 0&&typeof m[s]!="number"&&n!==null&&n.unit!=="vh";d([[o.fixed,void 0],...N?[[s,h.fallback]]:[]])},f=O===null&&e!=="desktop",b=s===void 0,A=b&&n!==null&&n.unit!=="vh",I=n===null?`${h.fallback} ${h.unit}`:n.unit==="vh"?`${n.vh} ${h.unit}`:n.unit==="px"?n.value:L.find(l=>l.image===n.value)?.label??n.value;return i(ue,{label:a("Height"),icon:me(i(q,{})),hint:b&&(u.unit==="vh"||A)?a(Ue):void 0,action:e==="desktop"?void 0:i(se,{words:Ae()?.panel,label:a("Height"),changed:O!==null||!!m[o.fixed],detail:e==="tablet"?fe(ye,I):I,disabled:c,onReset:()=>d([...s?[[s,void 0]]:[],[o.fixed,void 0]])}),children:$("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-8)",flex:"1 1 auto",minWidth:0},children:[i(he,{options:[{id:"vh",label:a("vh"),disabled:A},{id:"ratio",label:a("Ratio")},{id:"px",label:a("px")}],value:u.unit,onChange:G,ariaLabel:a("Unit"),disabled:c}),u.unit==="ratio"?i(Te,{label:"Height",lines:L,column:"image",value:u.value,disabled:c,onChange:l=>d([[o.fixed,l]])}):u.unit==="px"?D({...v,value:f?null:u.px,...f?{placeholder:u.px}:{},suffix:v.unit,ariaLabel:"Height",disabled:c,onChange:l=>d([[o.fixed,`${l}${v.unit}`]])}):D({min:h.min,max:h.max,step:h.step,value:f?null:u.vh,...f?{placeholder:u.vh}:{},suffix:h.unit,ariaLabel:"Height",disabled:c||b,onChange:l=>t.onChange(l)})]})})}const g=(e,o=R[e])=>({type:"custom",...ce({},{type:"number",label:"Height"}),render:t=>i(Me,{view:e,keys:o,props:t})}),Ye={read:e=>e.heightFixedTablet,write:(e,o,t)=>({heightFixedTablet:t}),fieldKey:()=>"heightFixedTablet",ownField:!0};function _o({tabletNumber:e=!0}={}){const o=e?M:{...M,tablet:Ye},t=g("tablet",e?void 0:{fixed:R.tablet.fixed}),r=E("heightDesktop",g("desktop"),o,{phoneRow:t}),d=E("heightDesktop",g("desktop"),o,{phoneRow:g("mobile")});return{heightDesktop:r.heightDesktop,...e?{heightTablet:r.heightTablet,heightFixedTablet:_("heightTablet")}:{heightFixedTablet:r.heightFixedTablet},heightMobile:d.heightMobile,heightFixed:_("heightDesktop"),heightFixedMobile:_("heightMobile")}}const xo={overlayColor:C("Overlay color",S),overlayPosition:F("Overlay position",k,P,"A corner would need a diagonal ramp, which this overlay does not draw.",i(H,{}))},W="Texture",B=e=>F("Overlay position",k,e,"A corner would need a diagonal ramp, which this overlay does not draw.",i(H,{}),void 0,W);function We(){try{const{appState:e,selectedItem:o}=ae(t=>t);return Be(e,o?.props?.id)}catch{return}}function Be(e,o){return T(Ie(e,o)?.props?.textureColor)}function Ve({value:e,onChange:o}){const[t]=x("overlayPosition"),r=We(),d=T(e)??"",s=U({overlayColor:d,overlayPosition:t},r);return i(xe,{label:a("Overlay color"),value:d,inherited:s.color,resetTo:a(W),onChange:o,onReset:()=>o("")})}const Ke=B(P),je=B("");function Ge(e){const[o]=x("overlayColor"),t=U({overlayColor:o,overlayPosition:e.value}).own?Ke:je;return i(X,{children:t.render(e)})}function Ne(e){if(!Array.isArray(e))return;const o=e.flatMap((t,r)=>T(t?.props?.overlayColor)?[r+1]:[]);if(o.length!==0)return o.length===1?a("Slide {n}: own Overlay color.",{n:o[0]}):a("Slides {n}: own Overlay color.",{n:o.join(", ")})}function $e({value:e,onChange:o}){const[t]=x("slides");return i(_e,{label:a("Texture color"),value:e||S,onChange:o,hint:Ne(t)})}const yo={type:"custom",render:({value:e,onChange:o})=>i($e,{value:e,onChange:o})},vo={overlayColor:{type:"custom",render:({value:e,onChange:o})=>i(Ve,{value:e,onChange:o})},overlayPosition:{type:"custom",render:({value:e,onChange:o})=>i(Ge,{value:e,onChange:o})}},Xe={one:i(z,{}),side:i(Z,{}),stacked:i(ee,{})},V=e=>y("Layout",i(J,{}),re.map(o=>({label:ne[o],value:o,picture:Xe[o]})),ie,e?{phoneRest:o=>le(void 0,o)}:void 0),qe={mediaLayout:V(),mediaLayoutPhone:E("mediaLayout",V(!0)).mediaLayoutPhone},ze=()=>ve("Tint",i(Q,{}),0,100,5,0,"%"),K=e=>Object.fromEntries(w(e).map(o=>[o,Oe()])),j=e=>Ee("Background image","image/*","Upload a background image",{focus:e}),Je=()=>C("Tint color",S),So={mediaImage:j(p.image),...K(p.image)},Qe={mediaImage2:j(p.image2),...K(p.image2),tintColor2:Je(),tintOpacity2:ze()},To=Object.keys(qe),Ro=Object.keys(Qe),Lo=["mediaImage",...w(p.image)],Ao=e=>({mediaLayout:{all:[e,{not:{context:"device",is:"mobile"}}]},mediaLayoutPhone:{all:[e,{context:"device",is:"mobile"}]}}),Io={videoSource:y("Source",i(te,{}),Pe.map(e=>({label:De[e],value:e})),Fe),youtubeUrl:be("YouTube link","https://youtu.be/…"),videoPlayback:y("Playback",i(oe,{}),Ce.map(e=>({label:we[e],value:e})),He)};export{Ro as HERO_IMAGE2_KEYS,Qe as HERO_IMAGE2_ROWS,Lo as HERO_IMAGE_KEYS,So as HERO_IMAGE_ROWS,To as HERO_LAYOUT_KEYS,qe as HERO_LAYOUT_ROWS,xo as HERO_OVERLAY_ROWS,vo as HERO_SLIDE_OVERLAY_ROWS,Ue as HERO_TABLET_VH_HINT,yo as HERO_TEXTURE_COLOR_ROW,Io as HERO_VIDEO_ROWS,_o as heroHeightFields,Ao as heroLayoutRules,ke as heroRatioLines,Je as heroTintColorRow,ze as heroTintRow,Ne as textureColorHint,Be as textureColorOfSlide};
1
+ import{jsx as i,jsxs as $,Fragment as X}from"react/jsx-runtime";import{HeightIcon as q,ImageIcon as z,ImagesIcon as J,OpacityIcon as Q,MediaLayoutSideBySideIcon as Z,MediaLayoutStackedIcon as ee,PlacementIcon as H,PlayIcon as oe,UploadIcon as te}from"efficient-easel/icons";import{viewFocusKeys as C}from"../../../../format/lib/content/picture-focus-rows.js";import{HERO_FOCUS as p,MEDIA_LAYOUT_DEFAULT as ie,MEDIA_LAYOUT_LABELS as ne,MEDIA_LAYOUTS as re,resolvePhoneLayout as le}from"../../../../format/lib/hero-media-layout.js";import{useEasel as ae,useSelectedHost as de}from"efficient-easel/easel";import{SettingsDefaultReset as se,SettingsField as ue,SettingsSegmented as he}from"efficient-easel/panel";import{describedAs as ce,FLAT_ACCESS as pe,iconOf as me,onDesktopWords as fe,phoneTwinFields as b,useAccessPatch as ge}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as _}from"efficient-easel/screen/lib/document/style-fields";import{colorInput as w,edgePad as F,focusKeptField as Oe,plainText as Ee,Slider as D,upload as be,useSelectedSibling as x}from"../controls.js";import{ColourRow as _e,InheritedColourRow as xe}from"../ColourControl.js";import{rowSay as ye,segmented as y,slider as Se}from"../box-fields.js";import{CUSTOM_SHAPE as ve,SHAPE_TABLE as Te}from"../../../../format/lib/content/gallery-card-layout.js";import{ShapePicker as Re}from"../shape-picker.js";import{HERO_FIXED_DEFAULT as Ae,HERO_HEIGHT_PX as S,readHeroFixedHeight as Le,SECTION_HEIGHT as h}from"../../../../format/lib/content/section-height.js";import{DEFAULT_TINT as v}from"../../../../format/lib/content/tint.js";import{editorEaselWords as Ie,say as a}from"../../../../format/lib/editor-words.js";import{nonEmptyString as T}from"../../../../format/lib/non-empty-string.js";import{findParentNode as He}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as P,OVERLAY_POSITION_OPTIONS as k,slideOverlayState as U}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as Ce,VIDEO_PLAYBACK_LABELS as we,VIDEO_PLAYBACKS as Fe,VIDEO_SOURCE_DEFAULT as De,VIDEO_SOURCE_LABELS as Pe,VIDEO_SOURCES as ke}from"../../../../format/lib/hero-video.js";function Ue(){return Te.filter(e=>e.ratio!==null||e.shape===ve)}const R={desktop:{number:"heightDesktop",fixed:"heightFixed"},tablet:{number:"heightTablet",fixed:"heightFixedTablet"},mobile:{number:"heightMobile",fixed:"heightFixedMobile"}},M={read:e=>e.heightMobile,write:(e,o,t)=>({heightMobile:t}),fieldKey:()=>"heightMobile",ownField:!0,tablet:{read:e=>e.heightTablet,write:(e,o,t)=>({heightTablet:t}),fieldKey:()=>"heightTablet",ownField:!0}};function Y(e,{number:o,fixed:t}){const r=o===void 0?void 0:e[o];return Le(e[t])??(typeof r=="number"?{unit:"vh",vh:r}:null)}const Me="On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";function Ye({view:e,keys:o,props:t}){const r=de(),d=ge(pe),{number:s}=o,m={...r?.values??{},...s?{[s]:t.value}:{}},O=Y(m,o),n=e==="tablet"?Y(m,R.desktop):null,u=O??n??{unit:"vh",vh:h.fallback},c=t.readOnly===!0,A=Ue(),G=l=>{if(l===u.unit)return;if(l!=="vh"){d([[o.fixed,n?.unit===l?n.value:Ae[l]]]);return}const N=s!==void 0&&typeof m[s]!="number"&&n!==null&&n.unit!=="vh";d([[o.fixed,void 0],...N?[[s,h.fallback]]:[]])},f=O===null&&e!=="desktop",E=s===void 0,L=E&&n!==null&&n.unit!=="vh",I=n===null?`${h.fallback} ${h.unit}`:n.unit==="vh"?`${n.vh} ${h.unit}`:n.unit==="px"?n.value:A.find(l=>l.image===n.value)?.label??n.value;return i(ue,{label:a("Height"),icon:me(i(q,{})),hint:E&&(u.unit==="vh"||L)?a(Me):void 0,action:e==="desktop"?void 0:i(se,{words:Ie()?.panel,label:a("Height"),changed:O!==null||!!m[o.fixed],detail:e==="tablet"?fe(ye,I):I,disabled:c,onReset:()=>d([...s?[[s,void 0]]:[],[o.fixed,void 0]])}),children:$("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-8)",flex:"1 1 auto",minWidth:0},children:[i(he,{options:[{id:"vh",label:a("vh"),disabled:L},{id:"ratio",label:a("Ratio")},{id:"px",label:a("px")}],value:u.unit,onChange:G,ariaLabel:a("Unit"),disabled:c}),u.unit==="ratio"?i(Re,{label:"Height",lines:A,column:"image",value:u.value,disabled:c,onChange:l=>d([[o.fixed,l]])}):u.unit==="px"?D({...S,value:f?null:u.px,...f?{placeholder:u.px}:{},suffix:S.unit,ariaLabel:"Height",disabled:c,onChange:l=>d([[o.fixed,`${l}${S.unit}`]])}):D({min:h.min,max:h.max,step:h.step,value:f?null:u.vh,...f?{placeholder:u.vh}:{},suffix:h.unit,ariaLabel:"Height",disabled:c||E,onChange:l=>t.onChange(l)})]})})}const g=(e,o=R[e])=>({type:"custom",...ce({},{type:"number",label:"Height"}),render:t=>i(Ye,{view:e,keys:o,props:t})}),We={read:e=>e.heightFixedTablet,write:(e,o,t)=>({heightFixedTablet:t}),fieldKey:()=>"heightFixedTablet",ownField:!0};function xo({tabletNumber:e=!0}={}){const o=e?M:{...M,tablet:We},t=g("tablet",e?void 0:{fixed:R.tablet.fixed}),r=b("heightDesktop",g("desktop"),o,{phoneRow:t}),d=b("heightDesktop",g("desktop"),o,{phoneRow:g("mobile")});return{heightDesktop:r.heightDesktop,...e?{heightTablet:r.heightTablet,heightFixedTablet:_("heightTablet")}:{heightFixedTablet:r.heightFixedTablet},heightMobile:d.heightMobile,heightFixed:_("heightDesktop"),heightFixedMobile:_("heightMobile")}}const yo={overlayColor:w("Overlay color",v),overlayPosition:F("Overlay position",k,P,"A corner would need a diagonal ramp, which this overlay does not draw.",i(H,{}))},W="Texture",B=e=>F("Overlay position",k,e,"A corner would need a diagonal ramp, which this overlay does not draw.",i(H,{}),void 0,W);function Be(){try{const{appState:e,selectedItem:o}=ae(t=>t);return Ve(e,o?.props?.id)}catch{return}}function Ve(e,o){return T(He(e,o)?.props?.textureColor)}function Ke({value:e,onChange:o}){const[t]=x("overlayPosition"),r=Be(),d=T(e)??"",s=U({overlayColor:d,overlayPosition:t},r);return i(xe,{label:a("Overlay color"),value:d,inherited:s.color,resetTo:a(W),onChange:o,onReset:()=>o("")})}const je=B(P),Ge=B("");function Ne(e){const[o]=x("overlayColor"),t=U({overlayColor:o,overlayPosition:e.value}).own?je:Ge;return i(X,{children:t.render(e)})}function $e(e){if(!Array.isArray(e))return;const o=e.flatMap((t,r)=>T(t?.props?.overlayColor)?[r+1]:[]);if(o.length!==0)return o.length===1?a("Slide {n}: own Overlay color.",{n:o[0]}):a("Slides {n}: own Overlay color.",{n:o.join(", ")})}function Xe({value:e,onChange:o}){const[t]=x("slides");return i(_e,{label:a("Texture color"),value:e||v,onChange:o,hint:$e(t)})}const So={type:"custom",render:({value:e,onChange:o})=>i(Xe,{value:e,onChange:o})},vo={overlayColor:{type:"custom",render:({value:e,onChange:o})=>i(Ke,{value:e,onChange:o})},overlayPosition:{type:"custom",render:({value:e,onChange:o})=>i(Ne,{value:e,onChange:o})}},qe={one:i(z,{}),side:i(Z,{}),stacked:i(ee,{})},V=e=>y("Layout",i(J,{}),re.map(o=>({label:ne[o],value:o,picture:qe[o]})),ie,e?{phoneRest:o=>le(void 0,o)}:void 0),ze={mediaLayout:V(),mediaLayoutPhone:b("mediaLayout",V(!0)).mediaLayoutPhone},Je=()=>Se("Tint",i(Q,{}),0,100,5,0,"%"),K=e=>Object.fromEntries(C(e).map(o=>[o,Oe()])),j=e=>be("Background image","image/*","Upload a background image",{focus:e}),Qe=()=>w("Tint color",v),To={mediaImage:j(p.image),...K(p.image)},Ze={mediaImage2:j(p.image2),...K(p.image2),tintColor2:Qe(),tintOpacity2:Je()},Ro=Object.keys(ze),Ao=Object.keys(Ze),Lo=["mediaImage",...C(p.image)],Io=e=>({mediaLayout:{all:[e,{not:{context:"device",is:"mobile"}}]},mediaLayoutPhone:{all:[e,{context:"device",is:"mobile"}]}}),Ho={videoSource:y("Source",i(te,{}),ke.map(e=>({label:Pe[e],value:e})),De),youtubeUrl:Ee("YouTube link","https://youtu.be/…"),videoPlayback:y("Playback",i(oe,{}),Fe.map(e=>({label:we[e],value:e})),Ce)};export{Ao as HERO_IMAGE2_KEYS,Ze as HERO_IMAGE2_ROWS,Lo as HERO_IMAGE_KEYS,To as HERO_IMAGE_ROWS,Ro as HERO_LAYOUT_KEYS,ze as HERO_LAYOUT_ROWS,yo as HERO_OVERLAY_ROWS,vo as HERO_SLIDE_OVERLAY_ROWS,Me as HERO_TABLET_VH_HINT,So as HERO_TEXTURE_COLOR_ROW,Ho as HERO_VIDEO_ROWS,xo as heroHeightFields,Io as heroLayoutRules,Ue as heroRatioLines,Qe as heroTintColorRow,Je as heroTintRow,$e as textureColorHint,Ve as textureColorOfSlide};
@@ -11,6 +11,7 @@ import { CARD_IMAGE_RADIUS_ROW } from "../../../format/lib/content/card-image-sh
11
11
  import { FOCAL_DEFAULT, type UnitChoice as ShellUnitChoice } from "efficient-shell/ui";
12
12
  import { type ColourChoice } from "./ColourControl.js";
13
13
  import { type DeviceTier } from "efficient-easel/screen/lib/document/device-fields";
14
+ import { type ViewTier } from "efficient-easel/draw";
14
15
  import type { GeocodeState } from "../../../format/lib/content/contact.js";
15
16
  import { SECTION_PIN_SCREENS_KEY } from "../../../format/lib/content/section-sticky.js";
16
17
  import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
@@ -159,7 +160,7 @@ export declare function useLengthRow(o: {
159
160
  convertTo?: (convert: (value: number) => number) => Record<string, unknown>;
160
161
  followsView?: DeviceTier;
161
162
  }): LengthUnitState | undefined;
162
- export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, placeholderWord, onClear, units, }: {
163
+ export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, placeholderWord, onClear, units, inputMax, }: {
163
164
  min: number;
164
165
  max: number;
165
166
  step: number;
@@ -174,6 +175,7 @@ export declare function Slider({ min, max, step, value, onChange, suffix, readou
174
175
  placeholderWord?: string;
175
176
  onClear?: () => void;
176
177
  units?: ShellUnitChoice;
178
+ inputMax?: number;
177
179
  }): import("react").JSX.Element;
178
180
  export declare function pxField(label: string, opts: {
179
181
  min: number;
@@ -338,7 +340,7 @@ export declare function loadingShowsField(label: string, icon: ReactElement, pic
338
340
  export declare function loadingRowHint(values: Readonly<Record<string, unknown>>, frames: Readonly<Record<string, KnownVideoFrame>> | undefined, hasUnsavedEdits: boolean): string | undefined;
339
341
  export declare function upload(label: string, accept: string, placeholder?: string, opts?: {
340
342
  focus?: string;
341
- focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;
343
+ focusWhen?: (props: Record<string, unknown>, view: ViewTier) => boolean;
342
344
  frame?: string;
343
345
  }): CustomField<MediaValue>;
344
346
  export declare function mediaFieldPaths(fields: Readonly<Record<string, unknown>> | undefined): string[];