efficient-web-builder 29.0.0 → 30.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 (38) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/editor/components/SectionWidthRows.d.ts +35 -0
  3. package/dist/editor/components/SectionWidthRows.js +1 -0
  4. package/dist/editor/components/StorefrontEditor.js +1 -1
  5. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  6. package/dist/editor/components/WidthFollowField.js +1 -1
  7. package/dist/editor/components/storefront-editor.css +1 -1
  8. package/dist/editor/lib/puck/blocks/general/IntroBleed/fields.js +1 -1
  9. package/dist/editor/lib/puck/controls.d.ts +3 -0
  10. package/dist/editor/lib/puck/controls.js +1 -1
  11. package/dist/editor/lib/puck/overrides.js +1 -1
  12. package/dist/editor/lib/puck/passes/inspector.js +1 -1
  13. package/dist/editor/lib/puck/section-width-fields.d.ts +1 -0
  14. package/dist/editor/lib/puck/section-width-fields.js +1 -0
  15. package/dist/format/lib/content/page-width.js +1 -1
  16. package/dist/format/lib/content/section-width.d.ts +24 -0
  17. package/dist/format/lib/content/section-width.js +1 -1
  18. package/dist/format/lib/editor-words-catalogue.d.ts +5 -2
  19. package/dist/format/lib/editor-words-catalogue.js +4 -4
  20. package/dist/format/lib/puck/passes/types.d.ts +1 -0
  21. package/dist/format/lib/site-theme-row.d.ts +2 -0
  22. package/dist/render/components/HeroSection.js +1 -1
  23. package/dist/render/components/HeroSingle.js +2 -2
  24. package/dist/render/components/HeroSlide.js +1 -1
  25. package/dist/render/components/IntroBleed.js +1 -1
  26. package/dist/render/components/PreviewHeaderContext.d.ts +9 -1
  27. package/dist/render/components/PreviewHeaderContext.js +1 -1
  28. package/dist/render/components/SpecStrip.js +1 -1
  29. package/dist/render/lib/puck/blocks/general/IntroBleed/render.js +2 -2
  30. package/dist/render/lib/puck/page-render.d.ts +2 -1
  31. package/dist/render/lib/puck/page-render.js +1 -1
  32. package/dist/render/lib/puck/passes/section-width.d.ts +7 -1
  33. package/dist/render/lib/puck/passes/section-width.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/editor/components/HeroImageField.d.ts +0 -6
  36. package/dist/editor/components/HeroImageField.js +0 -1
  37. package/dist/editor/components/SiteWidthField.d.ts +0 -7
  38. package/dist/editor/components/SiteWidthField.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,49 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 30.0.0 - 2026-10-21
6
+
7
+ A MAJOR: two editor components a host could import are gone (`components/SiteWidthField`, `components/HeroImageField`), and `PageRender` takes the site's Width defaults as `metadata`.
8
+
9
+ **A section has two widths: Background and Content** (Lewis, 2026-10-20/21, mockup v6: https://claude.ai/artifact/DSJ1AXfJ2vkEhnVQ46HsA4). Site styles holds the same two rows as the site's defaults, and a section follows them until it sets its own.
10
+
11
+ ### Changed for merchants
12
+
13
+ - **Site styles › Basics › Width**: `Background` (Full width / Content width; new, the band every section draws) and `Content` (Full width / Content width, and at Content width the site's ONE number — the old `Content width` row's, moved, not a second one). `Background` replaces the `Hero image` row; a hero on a site that has not set it still reads the old value, so no hero moves.
14
+ - **Each row is the word choice `Full width / Content width` under its name** (the segmented the old Width row used). Beside the name it would need 287–309px and the name line has 286px at 320, so by R9 it sits under the name at every panel width. Content's number appears only at Content width.
15
+ - **Hero Slideshow, Hero, Scroll-Over Text and the band sections** (Spec Strip, Story Timeline, Locations Map, Editorial Text, Lead Text, Cards, Key Features, Chart, Mockup Card, Testimonials, Call-to-Action Heading, Countdown, Document Header, Document Text, Document Detail Cards) draw the two rows. Content is Full width, or Content width at the site's number or a number of the section's own (400 to 2000 px). The hero's words, buttons and slide picker follow it.
16
+ - **Content can never be wider than the background.** With Background at Content width, Content's Full width is greyed out and its number stops at the band. In the phone view both rows are greyed out: under 800px content fills the screen.
17
+ - **Scroll-Over Text's `Full width` switch is gone**; its stored value is read as Content. A new Scroll-Over Text follows the site's Content.
18
+ - **No published page moves.** Old stored widths are read through one table per section family (`lib/content/section-width.ts`); nothing stored is rewritten. Checked by rendering 11 stored cases (inovit.com's live Hero and Scroll-Over Text, Editorial Text, Spec Strip) on 28.1.0 and on this release: every text box and band box lands on the same pixels at 1920, 1280 and 390 px.
19
+ - `Page settings`, `Header` and `Footer` draw their Width choices Full width first, like every Width row.
20
+
21
+ ### Added
22
+
23
+ - `lib/content/section-width`: `resolveSectionWidth`, `SECTION_WIDTH_FAMILY`, `sectionHasWidthRows`, `FOLLOW_SITE`, `normalizeSiteBackground`, `siteWidthsMetadata`, `siteWidthsOf`, `SITE_WIDTHS_KEY`, and the types `SectionWidths`, `WidthAnswer`, `SiteWidths`.
24
+ - `components/SectionWidthRows` (editor): `BackgroundWidthRow`, `ContentWidthRow` — the one pair of rows for Site styles and every section.
25
+ - `lib/puck/section-width-fields` (editor): a section's `Width` group.
26
+ - The theme row's `section_background_width` and `section_content_width` (efficient-backend `StorefrontThemeSettings`); `siteWidthsMetadata(background, content)` carries both to every section.
27
+
28
+ ### Removed
29
+
30
+ - `components/SiteWidthField`, `components/HeroImageField` (replaced by `components/SectionWidthRows`).
31
+ - The hero's own word cap: `HeroSlide`, `HeroSingle`, the hero's chrome and `SpecStrip` read `--sf-site-width`, not `min(var(--sf-page-cap, site), site)`. `HERO_CAP` is `SITE_WIDTH_CAP`.
32
+
33
+ ### For hosts
34
+
35
+ - **Pass the site's Width defaults to the live render**: `<PageRender config={…} data={…} metadata={siteWidthsMetadata(theme.sectionBackgroundWidth, theme.sectionContentWidth)} />`. Without it every section draws the built-in Full width band and Content width content, as today.
36
+ - The storefront's `/edit/preview-site-styles` harness imports the two removed components; draw `components/SectionWidthRows` there.
37
+
38
+ ### Guards
39
+
40
+ - New `scripts/test-section-width-mapping.ts` (red first): every family × every old stored value → the two rows (786 checks).
41
+ - New `scripts/test-section-width-draw.tsx`: no wrapper where a section follows the site; the old Content-width box byte for byte; the Content override, its clamp and its phone fallback; the site Background through metadata; no `--sf-page-cap` read for words.
42
+ - The Site styles guards read the two rows; the panel's declared saves retire `hero_background_follows_width` and add `section_background_width`.
43
+
44
+ ### Next
45
+
46
+ - The other section families (both, contained, content-only, capped, Product Grid) move onto the two rows in the next release; until then they keep their single `Width` row.
47
+
5
48
  ## 29.0.0 - 2026-10-20
6
49
 
7
50
  **MAJOR: easel peer ^15.** The `efficient-easel` peer range rises from `^14.1.0` to `^15.0.0` (and `efficient-shell` to `^8.10.1`), so a host on easel 14 must upgrade.
@@ -0,0 +1,35 @@
1
+ import { type WidthAnswer } from "../../format/lib/content/section-width.js";
2
+ export declare const WIDTH_GROUP_LABEL = "Width";
3
+ export declare const BACKGROUND_LABEL = "Background";
4
+ export declare const CONTENT_LABEL = "Content";
5
+ export declare const WIDTH_CHOICES: readonly WidthAnswer[];
6
+ export declare const SECTION_CONTENT_MIN = 400;
7
+ export declare const CONTENT_INSIDE_BACKGROUND_HINT = "Content cannot be wider than the background.";
8
+ export declare const SITE_BACKGROUND_HINT = "The width of every section's background, until the section sets its own.";
9
+ export declare const SITE_CONTENT_HINT = "The width of every section's content, until the section sets its own.";
10
+ export declare const WIDTH_PHONE_HINT = "On phones, content always fills the screen.";
11
+ export declare function BackgroundWidthRow({ value, changed, detail, onChange, onReset, disabled, hint, labelId, }: {
12
+ value: WidthAnswer;
13
+ changed: boolean;
14
+ detail: string;
15
+ onChange: (next: WidthAnswer) => void;
16
+ onReset: () => void;
17
+ disabled?: boolean;
18
+ hint?: string;
19
+ labelId?: string;
20
+ }): import("react").JSX.Element;
21
+ export declare function ContentWidthRow({ mode, px, max, min, changed, detail, onMode, onPx, onReset, fullClosed, disabled, hint, labelId, }: {
22
+ mode?: WidthAnswer;
23
+ px: number;
24
+ max?: number;
25
+ min?: number;
26
+ changed: boolean;
27
+ detail: string;
28
+ onMode?: (next: WidthAnswer) => void;
29
+ onPx: (next: number) => void;
30
+ onReset: () => void;
31
+ fullClosed?: boolean;
32
+ disabled?: boolean;
33
+ hint?: string;
34
+ labelId?: string;
35
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e,jsxs as O}from"react/jsx-runtime";import{SettingsDefaultReset as x,SettingsField as I,SettingsSegmented as _}from"efficient-easel/panel";import{BackgroundIcon as w,WidthIcon as H}from"efficient-easel/icons";import{PAGE_WIDTH as N}from"../../format/lib/content/page-width.js";import{WIDTH_CHOICE_LABEL as L}from"../../format/lib/content/section-width.js";import{say as a,editorEaselWords as b}from"../../format/lib/editor-words.js";import{Slider as B}from"../lib/puck/controls.js";const U="Width",D="Background",S="Content",C=["full","content"],E=t=>a(L[t==="content"?"page":"full"]),W=400,K="Content cannot be wider than the background.",P="The width of every section's background, until the section sets its own.",M="The width of every section's content, until the section sets its own.",F="On phones, content always fills the screen.";function q({value:t,changed:l,detail:s,onChange:i,onReset:r,disabled:p=!1,hint:n,labelId:f}){const o=a(D);return e(I,{label:o,labelId:f,icon:e(w,{}),changed:l,hint:n?a(n):void 0,action:e(x,{words:b()?.panel,label:o,changed:l,detail:s,onReset:r}),children:e(_,{options:C.map(c=>({id:c,label:E(c)})),value:t,onChange:i,ariaLabel:o,disabled:p})})}function z({mode:t,px:l,max:s=N.max,min:i=W,changed:r,detail:p,onMode:n,onPx:f,onReset:o,fullClosed:c=!1,disabled:h=!1,hint:m,labelId:g}){const d=a(S),T=t!=="full"?e(B,{min:i,max:s,step:N.step,value:Math.min(Math.max(l,i),s),onChange:f,suffix:"px",ariaLabel:d,disabled:h}):null;return e(I,{label:d,labelId:g,icon:e(H,{}),changed:r,hint:m?a(m):void 0,action:e(x,{words:b()?.panel,label:d,changed:r,detail:p,onReset:o}),children:t===void 0||!n?T:O("div",{className:"flex w-full min-w-0 flex-col gap-2",children:[e(_,{options:C.map(u=>({id:u,label:E(u),disabled:u==="full"&&c})),value:t,onChange:n,ariaLabel:d,disabled:h}),T]})})}export{D as BACKGROUND_LABEL,q as BackgroundWidthRow,K as CONTENT_INSIDE_BACKGROUND_HINT,S as CONTENT_LABEL,z as ContentWidthRow,W as SECTION_CONTENT_MIN,P as SITE_BACKGROUND_HINT,M as SITE_CONTENT_HINT,C as WIDTH_CHOICES,U as WIDTH_GROUP_LABEL,F as WIDTH_PHONE_HINT};
@@ -1 +1 @@
1
- "use client";import{jsx as s,jsxs as dt}from"react/jsx-runtime";import{useCallback as n,useEffect as m,useMemo as R,useRef as S,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as ut}from"../lib/puck/build-config.js";import{ChromeWrap as ht}from"../lib/editor-chrome.js";import{sessionRegistry as lt}from"../../render/lib/editor-session.js";import{refreshSiteLiveState as mt}from"../lib/site-live-state.js";import{holdSiteWrites as pt}from"../../format/lib/site-writes.js";import{backendOf as G,blocksOf as St}from"../lib/website-session.js";import{useEditorSession as ft}from"../lib/editor-session-context.js";import{withSiteBlockGapFields as wt}from"../../format/lib/puck/site-gap-fields.js";import{withTemplateMediaPlaceholders as gt}from"../../format/lib/puck/templateFields.js";import{setEditorPage as ue}from"../../format/lib/puck/editor-page-context.js";import{resolveSiteName as Ct}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Tt,normalizeSiteWidth as yt}from"../../format/lib/content/page-width.js";import{normalizeSiteBlockGap as _t}from"../../format/lib/content/container-gap.js";import Et,{DocumentScreen as Pt}from"./EditorScreenMount.js";import{useStorefrontDocument as vt}from"./StorefrontDocumentContext.js";import{PreviewHeaderProvider as Ht}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as It}from"./PreviewFooterContext.js";import{PreviewChatProvider as Mt,DEFAULT_CHAT_PREVIEW as Rt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Gt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Ft}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Wt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as kt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as At}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Dt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as xt}from"efficient-easel/draw/client";import{PreviewLocationPartProvider as Bt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Nt}from"./PreviewPartStyleContext.js";import{SiteMapsProvider as Ot,readSiteMapsKey as bt,writeSiteMapsKey as he,readSiteMapId as zt,writeSiteMapId as Kt}from"../../render/lib/maps-config.js";import{CORNER_STYLE_TO_PX as Lt,DEFAULT_HEADING_COMPRESSION as Yt,DEFAULT_HEADING_TYPOGRAPHY as Ut,DEFAULT_SWITCH_SHOWN as F,DEFAULT_SIZES as jt,DEFAULT_THEME_MODE as y,normalizeCornerRadius as Vt,normalizeCornerStyle as Xt,normalizeCardShadow as Zt,normalizeCardGap as qt,normalizeHoverEffect as Jt,normalizeShadowColor as Qt,IDENTITY_CARD_GAP as le,IDENTITY_CARD_SHADOW as $t,IDENTITY_HOVER_EFFECT as er,THEME_MODE_KEY as me,THEME_STORAGE_KEY as tr,THEME_SWITCH_HIDE as pe,THEME_SWITCH_KEY as W}from"../../format/lib/theme.js";import{DEFAULT_FONTS as rr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as or}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as nr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as ar}from"../lib/site-text-styles.js";import{wordStylesFromRow as ir}from"../../format/lib/word-styles.js";import{chatPreviewFrom as cr}from"./PreviewChatContext.js";const sr=()=>{if(typeof window>"u")return y;try{const i=window.localStorage.getItem(me);return i==="light"||i==="dark"||i==="auto"?i:y}catch{return y}},Se=i=>{if(!(typeof window>"u"))try{window.localStorage.setItem(me,i)}catch{}},dr=()=>{if(typeof window>"u")return F;try{return window.localStorage.getItem(W)!==pe}catch{return F}},ur=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(tr)}catch{}},fe=i=>{if(!(typeof window>"u"))try{i?window.localStorage.removeItem(W):window.localStorage.setItem(W,pe)}catch{}};function hr(){const{adapter:i,capabilities:d,templateId:k,ready:g,token:l,siteId:c,currentSlug:A,currentKind:D}=vt();m(()=>(ue(A,D),()=>ue(null,null)),[A,D]);const _=d.placeholderFrames,[we,x]=r(null),[ge,B]=r("");m(()=>{const e=i.templateName;if(!g||!k||!e){B("");return}let o=!1;return e().then(u=>!o&&B(u??"")).catch(()=>{}),()=>{o=!0}},[g,l,k,i]);const[Ce,E]=r(y),[Te,P]=r(F),[ye,N]=r({selected:0,themes:[]}),[_e,O]=r(rr),[Ee,b]=r(jt),[Pe,z]=r(null),[ve,K]=r(Yt),[He,L]=r(null),[Ie,Y]=r(null),[Me,U]=r(le),[Re,j]=r(null),[Ge,V]=r(null),[Fe,X]=r(null),[v,Z]=r(null),h=ft(),q=R(()=>ut(lt(h),St(h)),[h]),We=R(()=>wt(gt(q,_),v),[q,_,v]),[ke,J]=r(Ut),[Ae,Q]=r(null),[De,$]=r(null),[xe,ee]=r(null),te=S(null),a=S(!1);m(()=>{E(sr()),P(dr())},[]);const Be=n(e=>{a.current=!0,ur(),Se(e),E(e)},[]),Ne=n(e=>{a.current=!0,fe(e),P(e)},[]),Oe=n(e=>{a.current=!0,N(e)},[]),be=n(e=>{a.current=!0,O(e)},[]),ze=n(e=>{a.current=!0,b(e)},[]),Ke=n(e=>{a.current=!0,z(e)},[]),Le=n(e=>{a.current=!0,K(e)},[]),Ye=n(e=>{a.current=!0,L(e)},[]),Ue=n(e=>{a.current=!0,Y(e)},[]),je=n(e=>{a.current=!0,U(e)},[]),Ve=n(e=>{a.current=!0,j(e)},[]),Xe=n(e=>{a.current=!0,J(e)},[]),[Ze,re]=r(null),[qe,Je]=r(null),Qe=n(e=>{a.current=!0,re(e)},[]),$e=n(e=>{a.current=!0,V(e)},[]),et=n(e=>{a.current=!0,X(e)},[]),tt=n(e=>{a.current=!0,Z(e)},[]),rt=n(e=>{a.current=!0,Q(e)},[]),ot=n(e=>{a.current=!0,$(e)},[]),nt=n(e=>{a.current=!0,ee(e)},[]);m(()=>{const e=G(h).theme;if(!l||!d.hasSiteTheme||!e)return;const o=c??"";te.current!==o&&(te.current=o,a.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||a.current)return;Se(t.default_mode),fe(t.show_theme_switch),E(t.default_mode),P(t.show_theme_switch),N({selected:t.selected_preset,themes:t.theme_presets});const p=ar(t);O(p.fonts),b(p.sizes),z(t.corner_radius_px===void 0?Lt[Xt(t.corner_style)]:Vt(t.corner_radius_px)),K(p.compression),L(t.card_shadow==null?$t:Zt(t.card_shadow)),U(t.card_gap==null?le:qt(t.card_gap)),j(t.hover_effect==null?er:Jt(t.hover_effect)),Y(Qt(t.shadow_color)),V(yt(t.site_width)),X(Tt(t.site_gutter)),Z(_t(t.block_gap)),J(p.typography),re(p.textStyles),Je(ir(t)),Q(t.hero_background_follows_width===!0),$(t.photography_grayscale===!0),ee(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[l,c,d.hasSiteTheme,h]);const at=Ft({token:l,siteId:c,enabled:d.hasSiteSettings}),[it,oe]=r(Rt),ne=S(null),H=S(!1),f=S(null),w=S({}),C=n(async()=>{f.current&&clearTimeout(f.current),f.current=null;const e=w.current;w.current={};try{await G(h).chat?.update(e,c?{siteId:c}:void 0),mt()}catch(o){throw w.current={...e,...w.current},o}},[h,c]);m(()=>pt(()=>f.current||Object.keys(w.current).length>0?C():void 0),[C]);const ct=n(e=>{H.current=!0,oe(o=>({...o,...e})),!(!d.hasSiteSettings||!l)&&(w.current={...w.current,...e},f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,l,C]);m(()=>{if(!l||!d.hasSiteSettings)return;const e=c??"";ne.current!==e&&(ne.current=e,H.current=!1);let o=!1;const u=G(h).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{o||H.current||oe(cr(t))}).catch(()=>{}),()=>{o=!0}},[l,c,d.hasSiteSettings,h]);const[T,I]=r(""),ae=S(null),M=S(!1);m(()=>I(bt()),[]);const ie=n(e=>{const o=e.trim();if(o===T)return;M.current=!0,he(o),I(o);const u=i.updateSite;!d.canEditSiteRecord||!g||!u||u({mapsApiKey:o}).catch(()=>{})},[T,d.canEditSiteRecord,g,i]),[ce,se]=r("");m(()=>se(zt()),[]),m(()=>{const e=i.site;if(!g||!d.hasSiteRecord||!e){x(null);return}const o=c??"";ae.current!==o&&(ae.current=o,M.current=!1);let u=!1;return e().then(t=>{if(u||(x(Ct(t.name)),M.current))return;const p=t.mapsApiKey??"";he(p),I(p);const de=t.mapsMapId??"";Kt(de),se(de)}).catch(()=>{}),()=>{u=!0}},[g,l,d.hasSiteRecord,c,i]);const st=R(()=>({apiKey:T,setApiKey:ie,mapId:ce}),[T,ie,ce]);return s(Pt,{config:We,parts:or,wrap:(e,o)=>s(Ht,{websiteName:we,templateChrome:_,templateName:ge||null,themeMode:Ce,onThemeModeChange:Be,themeSwitchShown:Te,onThemeSwitchShownChange:Ne,theme:ye,onThemeChange:Oe,fonts:_e,onFontsChange:be,cornerRadiusPx:Pe,onCornerRadiusPxChange:Ke,cardShadow:He,onCardShadowChange:Ye,shadowColor:Ie,onShadowColorChange:Ue,cardGap:Me,onCardGapChange:je,hoverEffect:Re,onHoverEffectChange:Ve,headingCompression:ve,onHeadingCompressionChange:Le,headingTypography:ke,onHeadingTypographyChange:Xe,textStyles:Ze,onTextStylesChange:Qe,wordStyles:qe,sizes:Ee,onSizesChange:ze,siteWidth:Ge,onSiteWidthChange:$e,siteGutter:Fe,onSiteGutterChange:et,blockGap:v,onBlockGapChange:tt,heroBackgroundFollowsWidth:Ae,onHeroBackgroundFollowsWidthChange:rt,photographyGrayscale:De,onPhotographyGrayscaleChange:ot,shareButtonOnPosts:xe,onShareButtonOnPostsChange:nt,themeFromDocument:!d.hasSiteTheme,children:s(It,{children:s(ht,{wrap:h.chrome?.wrap,surface:"page",children:s(At,{children:s(Dt,{children:s(xt,{children:s(Bt,{children:s(Nt,{children:dt(Ot,{value:st,children:[s(Mt,{chat:it,onChatChange:ct,children:s(Gt,{value:at,children:s(Wt,{children:e})})}),o]})})})})})})})})})})}function lr({target:i}){return s(Et,{target:i,addressing:kt,onHostMessage:nr,children:s(hr,{})})}export{lr as default};
1
+ "use client";import{jsx as s,jsxs as ft}from"react/jsx-runtime";import{useCallback as o,useEffect as m,useMemo as I,useRef as S,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as gt}from"../lib/puck/build-config.js";import{ChromeWrap as wt}from"../lib/editor-chrome.js";import{sessionRegistry as Ct}from"../../render/lib/editor-session.js";import{refreshSiteLiveState as _t}from"../lib/site-live-state.js";import{holdSiteWrites as Tt}from"../../format/lib/site-writes.js";import{backendOf as M,blocksOf as yt}from"../lib/website-session.js";import{useEditorSession as Et}from"../lib/editor-session-context.js";import{withSiteBlockGapFields as Pt}from"../../format/lib/puck/site-gap-fields.js";import{withTemplateMediaPlaceholders as vt}from"../../format/lib/puck/templateFields.js";import{setEditorPage as le}from"../../format/lib/puck/editor-page-context.js";import{resolveSiteName as Wt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Ht,normalizeSiteWidth as kt}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as me}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as It}from"../../format/lib/content/container-gap.js";import Mt,{DocumentScreen as Rt}from"./EditorScreenMount.js";import{useStorefrontDocument as Gt}from"./StorefrontDocumentContext.js";import{PreviewHeaderProvider as Bt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Ft}from"./PreviewFooterContext.js";import{PreviewChatProvider as At,DEFAULT_CHAT_PREVIEW as Dt}from"./PreviewChatContext.js";import{PreviewSocialProvider as xt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Nt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Ot}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as bt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as zt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Kt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Lt}from"efficient-easel/draw/client";import{PreviewLocationPartProvider as Yt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Ut}from"./PreviewPartStyleContext.js";import{SiteMapsProvider as jt,readSiteMapsKey as Vt,writeSiteMapsKey as pe,readSiteMapId as Xt,writeSiteMapId as Zt}from"../../render/lib/maps-config.js";import{CORNER_STYLE_TO_PX as qt,DEFAULT_HEADING_COMPRESSION as Jt,DEFAULT_HEADING_TYPOGRAPHY as Qt,DEFAULT_SWITCH_SHOWN as R,DEFAULT_SIZES as $t,DEFAULT_THEME_MODE as T,normalizeCornerRadius as er,normalizeCornerStyle as tr,normalizeCardShadow as rr,normalizeCardGap as or,normalizeHoverEffect as nr,normalizeShadowColor as ar,IDENTITY_CARD_GAP as Se,IDENTITY_CARD_SHADOW as ir,IDENTITY_HOVER_EFFECT as cr,THEME_MODE_KEY as fe,THEME_STORAGE_KEY as sr,THEME_SWITCH_HIDE as ge,THEME_SWITCH_KEY as G}from"../../format/lib/theme.js";import{DEFAULT_FONTS as dr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as ur}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as hr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as lr}from"../lib/site-text-styles.js";import{wordStylesFromRow as mr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as pr}from"./PreviewChatContext.js";const Sr=()=>{if(typeof window>"u")return T;try{const i=window.localStorage.getItem(fe);return i==="light"||i==="dark"||i==="auto"?i:T}catch{return T}},we=i=>{if(!(typeof window>"u"))try{window.localStorage.setItem(fe,i)}catch{}},fr=()=>{if(typeof window>"u")return R;try{return window.localStorage.getItem(G)!==ge}catch{return R}},gr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(sr)}catch{}},Ce=i=>{if(!(typeof window>"u"))try{i?window.localStorage.removeItem(G):window.localStorage.setItem(G,ge)}catch{}};function wr(){const{adapter:i,capabilities:d,templateId:B,ready:w,token:l,siteId:c,currentSlug:F,currentKind:A}=Gt();m(()=>(le(F,A),()=>le(null,null)),[F,A]);const y=d.placeholderFrames,[_e,D]=r(null),[Te,x]=r("");m(()=>{const e=i.templateName;if(!w||!B||!e){x("");return}let a=!1;return e().then(u=>!a&&x(u??"")).catch(()=>{}),()=>{a=!0}},[w,l,B,i]);const[ye,E]=r(T),[Ee,P]=r(R),[Pe,N]=r({selected:0,themes:[]}),[ve,O]=r(dr),[We,b]=r($t),[He,z]=r(null),[ke,K]=r(Jt),[Ie,L]=r(null),[Me,Y]=r(null),[Re,U]=r(Se),[Ge,j]=r(null),[Be,V]=r(null),[Fe,X]=r(null),[v,Z]=r(null),h=Et(),q=I(()=>gt(Ct(h),yt(h)),[h]),Ae=I(()=>Pt(vt(q,y),v),[q,y,v]),[De,J]=r(Qt),[xe,Q]=r(null),[Ne,$]=r(null),[Oe,ee]=r(null),[be,te]=r(null),[ze,re]=r(null),oe=S(null),n=S(!1);m(()=>{E(Sr()),P(fr())},[]);const Ke=o(e=>{n.current=!0,gr(),we(e),E(e)},[]),Le=o(e=>{n.current=!0,Ce(e),P(e)},[]),Ye=o(e=>{n.current=!0,N(e)},[]),Ue=o(e=>{n.current=!0,O(e)},[]),je=o(e=>{n.current=!0,b(e)},[]),Ve=o(e=>{n.current=!0,z(e)},[]),Xe=o(e=>{n.current=!0,K(e)},[]),Ze=o(e=>{n.current=!0,L(e)},[]),qe=o(e=>{n.current=!0,Y(e)},[]),Je=o(e=>{n.current=!0,U(e)},[]),Qe=o(e=>{n.current=!0,j(e)},[]),$e=o(e=>{n.current=!0,J(e)},[]),[et,ne]=r(null),[tt,rt]=r(null),ot=o(e=>{n.current=!0,ne(e)},[]),nt=o(e=>{n.current=!0,V(e)},[]),at=o(e=>{n.current=!0,X(e)},[]),it=o(e=>{n.current=!0,Z(e)},[]),ct=o(e=>{n.current=!0,Q(e)},[]),st=o(e=>{n.current=!0,$(e)},[]),dt=o(e=>{n.current=!0,ee(e)},[]),ut=o(e=>{n.current=!0,te(e)},[]),ht=o(e=>{n.current=!0,re(e)},[]);m(()=>{const e=M(h).theme;if(!l||!d.hasSiteTheme||!e)return;const a=c??"";oe.current!==a&&(oe.current=a,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;we(t.default_mode),Ce(t.show_theme_switch),E(t.default_mode),P(t.show_theme_switch),N({selected:t.selected_preset,themes:t.theme_presets});const p=lr(t);O(p.fonts),b(p.sizes),z(t.corner_radius_px===void 0?qt[tr(t.corner_style)]:er(t.corner_radius_px)),K(p.compression),L(t.card_shadow==null?ir:rr(t.card_shadow)),U(t.card_gap==null?Se:or(t.card_gap)),j(t.hover_effect==null?cr:nr(t.hover_effect)),Y(ar(t.shadow_color)),V(kt(t.site_width)),X(Ht(t.site_gutter)),Z(It(t.block_gap)),J(p.typography),ne(p.textStyles),rt(mr(t)),Q(t.hero_background_follows_width===!0),$(me(t.section_background_width)),ee(me(t.section_content_width)),te(t.photography_grayscale===!0),re(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[l,c,d.hasSiteTheme,h]);const lt=Nt({token:l,siteId:c,enabled:d.hasSiteSettings}),[mt,ae]=r(Dt),ie=S(null),W=S(!1),f=S(null),g=S({}),C=o(async()=>{f.current&&clearTimeout(f.current),f.current=null;const e=g.current;g.current={};try{await M(h).chat?.update(e,c?{siteId:c}:void 0),_t()}catch(a){throw g.current={...e,...g.current},a}},[h,c]);m(()=>Tt(()=>f.current||Object.keys(g.current).length>0?C():void 0),[C]);const pt=o(e=>{W.current=!0,ae(a=>({...a,...e})),!(!d.hasSiteSettings||!l)&&(g.current={...g.current,...e},f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,l,C]);m(()=>{if(!l||!d.hasSiteSettings)return;const e=c??"";ie.current!==e&&(ie.current=e,W.current=!1);let a=!1;const u=M(h).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{a||W.current||ae(pr(t))}).catch(()=>{}),()=>{a=!0}},[l,c,d.hasSiteSettings,h]);const[_,H]=r(""),ce=S(null),k=S(!1);m(()=>H(Vt()),[]);const se=o(e=>{const a=e.trim();if(a===_)return;k.current=!0,pe(a),H(a);const u=i.updateSite;!d.canEditSiteRecord||!w||!u||u({mapsApiKey:a}).catch(()=>{})},[_,d.canEditSiteRecord,w,i]),[de,ue]=r("");m(()=>ue(Xt()),[]),m(()=>{const e=i.site;if(!w||!d.hasSiteRecord||!e){D(null);return}const a=c??"";ce.current!==a&&(ce.current=a,k.current=!1);let u=!1;return e().then(t=>{if(u||(D(Wt(t.name)),k.current))return;const p=t.mapsApiKey??"";pe(p),H(p);const he=t.mapsMapId??"";Zt(he),ue(he)}).catch(()=>{}),()=>{u=!0}},[w,l,d.hasSiteRecord,c,i]);const St=I(()=>({apiKey:_,setApiKey:se,mapId:de}),[_,se,de]);return s(Rt,{config:Ae,parts:ur,wrap:(e,a)=>s(Bt,{websiteName:_e,templateChrome:y,templateName:Te||null,themeMode:ye,onThemeModeChange:Ke,themeSwitchShown:Ee,onThemeSwitchShownChange:Le,theme:Pe,onThemeChange:Ye,fonts:ve,onFontsChange:Ue,cornerRadiusPx:He,onCornerRadiusPxChange:Ve,cardShadow:Ie,onCardShadowChange:Ze,shadowColor:Me,onShadowColorChange:qe,cardGap:Re,onCardGapChange:Je,hoverEffect:Ge,onHoverEffectChange:Qe,headingCompression:ke,onHeadingCompressionChange:Xe,headingTypography:De,onHeadingTypographyChange:$e,textStyles:et,onTextStylesChange:ot,wordStyles:tt,sizes:We,onSizesChange:je,siteWidth:Be,onSiteWidthChange:nt,siteGutter:Fe,onSiteGutterChange:at,blockGap:v,onBlockGapChange:it,heroBackgroundFollowsWidth:xe,onHeroBackgroundFollowsWidthChange:ct,sectionBackgroundWidth:Ne,onSectionBackgroundWidthChange:st,sectionContentWidth:Oe,onSectionContentWidthChange:dt,photographyGrayscale:be,onPhotographyGrayscaleChange:ut,shareButtonOnPosts:ze,onShareButtonOnPostsChange:ht,themeFromDocument:!d.hasSiteTheme,children:s(Ft,{children:s(wt,{wrap:h.chrome?.wrap,surface:"page",children:s(zt,{children:s(Kt,{children:s(Lt,{children:s(Yt,{children:s(Ut,{children:ft(jt,{value:St,children:[s(At,{chat:mt,onChatChange:pt,children:s(xt,{value:lt,children:s(Ot,{children:e})})}),a]})})})})})})})})})})}function Cr({target:i}){return s(Mt,{target:i,addressing:bt,onHostMessage:hr,children:s(wr,{})})}export{Cr as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as y,Fragment as _}from"react/jsx-runtime";import{useEasel as F}from"efficient-easel/easel";import{useState as P}from"react";import A from"./ThemeField.js";import B from"./CornersField.js";import L from"./CardShadowField.js";import z from"./ShadowColourField.js";import O from"./BlockGapField.js";import W from"./HoverEffectField.js";import G from"./HeroImageField.js";import Y from"./PhotographyField.js";import j from"./ShareButtonField.js";import X from"./SideSpaceField.js";import U from"./SiteWidthField.js";import q from"./SiteAccentField.js";import K from"./SiteTextStylesField.js";import{usePreviewHeader as p}from"../../render/components/PreviewHeaderContext.js";import{Tabs as M,Tooltip as $,tabButtonId as J,tabPanelId as Q}from"efficient-shell/ui";import{ContrastIcon as V,NoteIcon as Z,SettingsIcon as D,TypeIcon as ee}from"efficient-easel/icons";import{useThemeRowPersist as te}from"../lib/theme-row-persist.js";import{themeSaveNotice as oe}from"../../format/lib/theme-save-message.js";import{say as m}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as ne}from"../../format/lib/content/site-name.js";import{previewFrame as re}from"../lib/puck/preview-dom.js";import{useSiteTextStylesWriter as ie}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as se,normalizeCornerRadius as ae,normalizeCornerStyle as ce,normalizeShadowColor as le,selectedThemeColors as he}from"../../format/lib/theme.js";const R="sf-site-styles",de="sf-site-styles-tabpanel",ue=!1,pe="Show hints";function fe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:y("button",{type:"button","aria-pressed":e,onClick:()=>t(!e),className:`sf-rung sf-hints-toggle${e?" is-active":""}`,children:[o(Z,{size:13}),m(pe)]})})}const gt="text",T=[{id:"basics",label:"Basics",icon:o(D,{})},{id:"theme",label:"Theme",icon:o(V,{})},{id:"text",label:"Text",icon:o(ee,{})}];function ge({themeFromDocument:e,persist:t}){const{appState:n,dispatch:i}=F(d=>d),{theme:l,setTheme:r}=p(),h=n.data,u=h.root?.props??{},a=d=>{if(e){const f={...u,theme:d};i({type:"replaceRoot",root:{...h.root,props:f},recordHistory:!0})}else r(d);t({selected_preset:d.selected,theme_presets:d.themes})};return o(A,{value:e?u.theme:l,onChange:a})}function me({themeFromDocument:e,persist:t}){const[n,i]=P(null),{theme:l,setFonts:r,setSizes:h,setHeadingTypography:u}=p(),a=ie({themeFromDocument:e,persist:t}),{old:d,saved:f,writeRoot:S}=a,C=a.fonts,c=a.sizes,w=a.typography,x=s=>s.values.size??_e(Ce[s.id]??"body")??we[s.kind],b=s=>a.write(s),E=Se(l),I=s=>{const g={...C,accent:s};e?S({fonts:g}):r(g),t({accent_font:s})},N=s=>{h({...c,accent:s}),t({accent_size_px:s})},k=s=>{const g={...w,weightStrong:s};e?S({headingTypography:g}):u(g),t({heading_weight_strong:s})},v=s=>{const g={...w,italicStrong:s};e?S({headingTypography:g}):u(g),t({accent_italic:s})};return y(_,{children:[o(K,{saved:f,old:d,colours:E,sizeOf:x,onChange:b,openId:n===H?null:n,onOpenChange:i,withoutSize:e}),o(q,{font:C.accent,size:c.accent,weight:w.weightStrong,italic:w.italicStrong,headingWeight:w.weight,open:n===H,onOpenChange:s=>i(s?H:null),onChange:s=>{s.key==="font"?I(s.value):s.key==="size"?N(s.value):s.key==="weight"?k(s.value):v(s.value)},withoutSize:e})]})}const H="accent";function Se(e){const t=he(e);return[{key:"accent",name:m("Accent"),value:t.accent},{key:"text",name:m("Text"),value:t.text},{key:"labels",name:m("Labels"),value:t.muted??t.text}]}const Ce={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},we={heading:32,body:14},ye={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function _e(e){if(typeof document>"u")return null;const n=(re()?.contentDocument??document).querySelector(ye[e]);if(!n)return null;const i=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(i)?i:null}function xe({themeFromDocument:e,persist:t,showHint:n}){const{appState:i,dispatch:l}=F(c=>c),{cornerRadiusPx:r,setCornerRadiusPx:h}=p(),u=i.data,a=u.root?.props??{},d=a.cornerRadiusPx===void 0?se[ce(a.cornerStyle)]:ae(a.cornerRadiusPx),f=e?d:r,S=c=>l({type:"replaceRoot",root:{...u.root,props:{...a,...c}},recordHistory:!0});return o(B,{value:f,onChange:c=>{e?S({cornerRadiusPx:c}):h(c),t({corner_radius_px:c})},showHint:n})}function be(e){return{site_width:e}}function Te({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:i}=p();return o(U,{value:n,onChange:r=>{i(r),e(be(r),r===null)},showHint:t})}function Pe(e){return{block_gap:e}}function Re(e){return{site_gutter:e}}function He({persist:e,showHint:t}){const{siteGutter:n,setSiteGutter:i}=p();return o(X,{value:n,onChange:r=>{i(r),e(Re(r),r===null)},showHint:t})}function Fe({persist:e,showHint:t}){const{blockGap:n,setBlockGap:i}=p();return o(O,{value:n,onChange:r=>{i(r),e(Pe(r),r===null)},showHint:t})}function Ee({persist:e,showHint:t}){const{heroBackgroundFollowsWidth:n,setHeroBackgroundFollowsWidth:i}=p();return o(G,{value:n,onChange:r=>{i(r),e({hero_background_follows_width:r},!0)},showHint:t})}function Ie({persist:e,showHint:t=!0}){return y(_,{children:[o(Te,{persist:e,showHint:t}),o(He,{persist:e,showHint:t}),o(Fe,{persist:e,showHint:t}),o(Ee,{persist:e,showHint:t})]})}function Ne(e){return{card_shadow:e}}function ke(e){return e===null?{shadow_color:null}:{shadow_color:le(e)}}function ve(e){return{hover_effect:e}}function Ae({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:i,shadowColor:l,setShadowColor:r,hoverEffect:h,setHoverEffect:u}=p();return y(_,{children:[o(L,{value:n,onChange:a=>{i(a),e(Ne(a),!0)},showHint:t}),o(z,{value:l,onChange:a=>{r(a),e(ke(a),a===null)},showHint:t}),o(W,{value:h,onChange:a=>{u(a),e(ve(a),!0)},showHint:t})]})}function Be(e){return{photography_grayscale:e}}function Le({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:i}=p();return o(Y,{value:n,onChange:r=>{i(r),e(Be(r),!0)},showHint:t})}function ze({persist:e,showHint:t=!0}){return o(_,{children:o(Le,{persist:e,showHint:t})})}function Oe(e){return{share_button_on_posts:e}}function We({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:i}=p();return o(j,{value:n,onChange:r=>{i(r),e(Oe(r),!0)},showHint:t})}function Ge(){const{websiteName:e}=p();return e?.trim()||ne}function mt(){const e=Ge();return o($,{content:m("{name} — renamed in the Console: {place}.",{name:e,place:m("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:o("span",{className:"sf-panel-site",children:e})})}function Ye({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:i,tab:l,onTabChange:r}){const{persist:h}=te({themeFromDocument:e,tokenRef:t,siteId:n,onResult:x=>{const b=oe(x);b&&i?.(b.msg,b.tone)}}),[u,a]=P(T[0].id),d=l!==void 0,f=d?l:u,S=d?r??(()=>{}):a,C=T.find(x=>x.id===f)??T[0],[c,w]=P(ue);return y(_,{children:[o(je,{activeId:C.id,onSelect:S}),y("div",{id:Q(R,C.id),className:de,role:"tabpanel","aria-labelledby":J(R,C.id),children:[f==="basics"&&y(_,{children:[o(xe,{themeFromDocument:e,persist:h,showHint:c}),!e&&o(Ae,{persist:h,showHint:c}),!e&&o(Ie,{persist:h,showHint:c}),!e&&o(ze,{persist:h,showHint:c}),!e&&o(We,{persist:h,showHint:c}),o(fe,{shown:c,onChange:w})]}),f==="theme"&&o(ge,{themeFromDocument:e,persist:h}),f==="text"&&o(me,{themeFromDocument:e,persist:h})]})]})}function je({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(M,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Site styles"),idPrefix:R,value:e,onChange:t,items:T.map(n=>{const i=m(n.label);return{id:n.id,icon:n.icon,label:i}})})})}export{Ae as CardLookFields,fe as HintsToggle,Ie as PageGroupFields,ze as PhotographyGroupFields,ue as SHOW_HINTS_DEFAULT,R as SITE_STYLES_ID_PREFIX,T as SITE_STYLES_TABS,gt as SITE_STYLES_TEXT_TAB,We as ShareButtonRootField,je as SiteStylesTabStrip,de as TABPANEL_CLASS,mt as WebsiteNameReadonly,Pe as blockGapPatch,Ne as cardShadowPatch,Ye as default,ve as hoverEffectPatch,Be as photographyPatch,ke as shadowColourPatch,Oe as shareButtonPatch,Re as siteGutterPatch,be as siteWidthPatch,Ge as useWebsiteName};
1
+ "use client";import{jsx as n,jsxs as _,Fragment as w}from"react/jsx-runtime";import{useEasel as N}from"efficient-easel/easel";import{useState as R}from"react";import k from"./ThemeField.js";import L from"./CornersField.js";import O from"./CardShadowField.js";import G from"./ShadowColourField.js";import v from"./BlockGapField.js";import z from"./HoverEffectField.js";import Y from"./PhotographyField.js";import j from"./ShareButtonField.js";import U from"./SideSpaceField.js";import{BackgroundWidthRow as X,ContentWidthRow as $,SITE_BACKGROUND_HINT as K,SITE_CONTENT_HINT as M,WIDTH_GROUP_LABEL as q}from"./SectionWidthRows.js";import J from"./SiteAccentField.js";import Q from"./SiteTextStylesField.js";import{usePreviewHeader as S}from"../../render/components/PreviewHeaderContext.js";import{Tabs as V,Tooltip as Z,tabButtonId as D,tabPanelId as ee}from"efficient-shell/ui";import{ContrastIcon as te,NoteIcon as ne,SettingsIcon as oe,TypeIcon as ie}from"efficient-easel/icons";import{useThemeRowPersist as re}from"../lib/theme-row-persist.js";import{themeSaveNotice as se}from"../../format/lib/theme-save-message.js";import{say as g}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as ae}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as b}from"../../format/lib/content/page-width.js";import{SettingsGroupSub as ce}from"efficient-easel/panel";import{previewFrame as le}from"../lib/puck/preview-dom.js";import{useSiteTextStylesWriter as de}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as ue,normalizeCornerRadius as he,normalizeCornerStyle as pe,normalizeShadowColor as fe,selectedThemeColors as ge}from"../../format/lib/theme.js";const E="sf-site-styles",me="sf-site-styles-tabpanel",Se=!1,Ce="Show hints";function _e({shown:e,onChange:t}){return n("div",{className:"sf-hints",children:_("button",{type:"button","aria-pressed":e,onClick:()=>t(!e),className:`sf-rung sf-hints-toggle${e?" is-active":""}`,children:[n(ne,{size:13}),g(Ce)]})})}const xt="text",P=[{id:"basics",label:"Basics",icon:n(oe,{})},{id:"theme",label:"Theme",icon:n(te,{})},{id:"text",label:"Text",icon:n(ie,{})}];function xe({themeFromDocument:e,persist:t}){const{appState:o,dispatch:s}=N(h=>h),{theme:d,setTheme:a}=S(),c=o.data,p=c.root?.props??{},r=h=>{if(e){const f={...p,theme:h};s({type:"replaceRoot",root:{...c.root,props:f},recordHistory:!0})}else a(h);t({selected_preset:h.selected,theme_presets:h.themes})};return n(k,{value:e?p.theme:d,onChange:r})}function we({themeFromDocument:e,persist:t}){const[o,s]=R(null),{theme:d,setFonts:a,setSizes:c,setHeadingTypography:p}=S(),r=de({themeFromDocument:e,persist:t}),{old:h,saved:f,writeRoot:m}=r,l=r.fonts,u=r.sizes,x=r.typography,y=i=>i.values.size??Re(Te[i.id]??"body")??be[i.kind],T=i=>r.write(i),F=ye(d),I=i=>{const C={...l,accent:i};e?m({fonts:C}):a(C),t({accent_font:i})},B=i=>{c({...u,accent:i}),t({accent_size_px:i})},A=i=>{const C={...x,weightStrong:i};e?m({headingTypography:C}):p(C),t({heading_weight_strong:i})},W=i=>{const C={...x,italicStrong:i};e?m({headingTypography:C}):p(C),t({accent_italic:i})};return _(w,{children:[n(Q,{saved:f,old:h,colours:F,sizeOf:y,onChange:T,openId:o===H?null:o,onOpenChange:s,withoutSize:e}),n(J,{font:l.accent,size:u.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:o===H,onOpenChange:i=>s(i?H:null),onChange:i=>{i.key==="font"?I(i.value):i.key==="size"?B(i.value):i.key==="weight"?A(i.value):W(i.value)},withoutSize:e})]})}const H="accent";function ye(e){const t=ge(e);return[{key:"accent",name:g("Accent"),value:t.accent},{key:"text",name:g("Text"),value:t.text},{key:"labels",name:g("Labels"),value:t.muted??t.text}]}const Te={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},be={heading:32,body:14},Pe={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Re(e){if(typeof document>"u")return null;const o=(le()?.contentDocument??document).querySelector(Pe[e]);if(!o)return null;const s=parseFloat(getComputedStyle(o).fontSize);return Number.isFinite(s)?s:null}function Ee({themeFromDocument:e,persist:t,showHint:o}){const{appState:s,dispatch:d}=N(u=>u),{cornerRadiusPx:a,setCornerRadiusPx:c}=S(),p=s.data,r=p.root?.props??{},h=r.cornerRadiusPx===void 0?ue[pe(r.cornerStyle)]:he(r.cornerRadiusPx),f=e?h:a,m=u=>d({type:"replaceRoot",root:{...p.root,props:{...r,...u}},recordHistory:!0});return n(L,{value:f,onChange:u=>{e?m({cornerRadiusPx:u}):c(u),t({corner_radius_px:u})},showHint:o})}function He(e){return{site_width:e}}function Ne({persist:e,showHint:t}){const{siteWidth:o,setSiteWidth:s,sectionBackgroundWidth:d,setSectionBackgroundWidth:a,sectionContentWidth:c,setSectionContentWidth:p}=S(),r=typeof o=="number"?o:b.default,h=l=>{s(l),e(He(l),l===null)},f=l=>{a(l),e({section_background_width:l},!0)},m=l=>{p(l),e({section_content_width:l},!0)};return _(w,{children:[n(ce,{title:g(q),level:4}),n(X,{value:d??"full",changed:d!==null,detail:g("Full width"),onChange:f,onReset:()=>f(null),hint:t?K:void 0}),n($,{mode:c??"content",px:r,min:b.min,max:b.max,changed:typeof o=="number"||c!==null,detail:`${g("Content width")} ${b.default}px`,onMode:m,onPx:l=>h(l),onReset:()=>{m(null),h(null)},hint:t?M:void 0})]})}function Fe(e){return{block_gap:e}}function Ie(e){return{site_gutter:e}}function Be({persist:e,showHint:t}){const{siteGutter:o,setSiteGutter:s}=S();return n(U,{value:o,onChange:a=>{s(a),e(Ie(a),a===null)},showHint:t})}function Ae({persist:e,showHint:t}){const{blockGap:o,setBlockGap:s}=S();return n(v,{value:o,onChange:a=>{s(a),e(Fe(a),a===null)},showHint:t})}function We({persist:e,showHint:t=!0}){return _(w,{children:[n(Ne,{persist:e,showHint:t}),n(Be,{persist:e,showHint:t}),n(Ae,{persist:e,showHint:t})]})}function ke(e){return{card_shadow:e}}function Le(e){return e===null?{shadow_color:null}:{shadow_color:fe(e)}}function Oe(e){return{hover_effect:e}}function Ge({persist:e,showHint:t=!0}){const{cardShadow:o,setCardShadow:s,shadowColor:d,setShadowColor:a,hoverEffect:c,setHoverEffect:p}=S();return _(w,{children:[n(O,{value:o,onChange:r=>{s(r),e(ke(r),!0)},showHint:t}),n(G,{value:d,onChange:r=>{a(r),e(Le(r),r===null)},showHint:t}),n(z,{value:c,onChange:r=>{p(r),e(Oe(r),!0)},showHint:t})]})}function ve(e){return{photography_grayscale:e}}function ze({persist:e,showHint:t}){const{photographyGrayscale:o,setPhotographyGrayscale:s}=S();return n(Y,{value:o,onChange:a=>{s(a),e(ve(a),!0)},showHint:t})}function Ye({persist:e,showHint:t=!0}){return n(w,{children:n(ze,{persist:e,showHint:t})})}function je(e){return{share_button_on_posts:e}}function Ue({persist:e,showHint:t=!0}){const{shareButtonOnPosts:o,setShareButtonOnPosts:s}=S();return n(j,{value:o,onChange:a=>{s(a),e(je(a),!0)},showHint:t})}function Xe(){const{websiteName:e}=S();return e?.trim()||ae}function wt(){const e=Xe();return n(Z,{content:g("{name} — renamed in the Console: {place}.",{name:e,place:g("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:n("span",{className:"sf-panel-site",children:e})})}function $e({themeFromDocument:e=!1,tokenRef:t,siteId:o,onNotify:s,tab:d,onTabChange:a}){const{persist:c}=re({themeFromDocument:e,tokenRef:t,siteId:o,onResult:y=>{const T=se(y);T&&s?.(T.msg,T.tone)}}),[p,r]=R(P[0].id),h=d!==void 0,f=h?d:p,m=h?a??(()=>{}):r,l=P.find(y=>y.id===f)??P[0],[u,x]=R(Se);return _(w,{children:[n(Ke,{activeId:l.id,onSelect:m}),_("div",{id:ee(E,l.id),className:me,role:"tabpanel","aria-labelledby":D(E,l.id),children:[f==="basics"&&_(w,{children:[n(Ee,{themeFromDocument:e,persist:c,showHint:u}),!e&&n(Ge,{persist:c,showHint:u}),!e&&n(We,{persist:c,showHint:u}),!e&&n(Ye,{persist:c,showHint:u}),!e&&n(Ue,{persist:c,showHint:u}),n(_e,{shown:u,onChange:x})]}),f==="theme"&&n(xe,{themeFromDocument:e,persist:c}),f==="text"&&n(we,{themeFromDocument:e,persist:c})]})]})}function Ke({activeId:e,onSelect:t}){return n("div",{className:"es-insp-tabs",children:n(V,{variant:"underline",block:!0,labelsFit:!0,"aria-label":g("Site styles"),idPrefix:E,value:e,onChange:t,items:P.map(o=>{const s=g(o.label);return{id:o.id,icon:o.icon,label:s}})})})}export{Ge as CardLookFields,_e as HintsToggle,We as PageGroupFields,Ye as PhotographyGroupFields,Se as SHOW_HINTS_DEFAULT,E as SITE_STYLES_ID_PREFIX,P as SITE_STYLES_TABS,xt as SITE_STYLES_TEXT_TAB,Ue as ShareButtonRootField,Ke as SiteStylesTabStrip,me as TABPANEL_CLASS,wt as WebsiteNameReadonly,Fe as blockGapPatch,ke as cardShadowPatch,$e as default,Oe as hoverEffectPatch,ve as photographyPatch,Le as shadowColourPatch,je as shareButtonPatch,Ie as siteGutterPatch,He as siteWidthPatch,Xe as useWebsiteName};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as u,SettingsField as p,SettingsSegmented as h}from"efficient-easel/panel";import{WidthIcon as g}from"efficient-easel/icons";import{say as o,editorEaselWords as b}from"../../format/lib/editor-words.js";import{WIDTH_CHOICE_LABEL as d}from"../../format/lib/content/section-width.js";function W({value:l,resolved:a,onChange:i,label:s="Width",labelId:r,followsLabel:f,hint:c}){const e=l===void 0,m=e?a:l,n=o(s);return t(p,{label:n,labelId:r,icon:t(g,{}),value:e?f:void 0,changed:!e,action:t(u,{words:b()?.panel,label:n,changed:!e,onReset:()=>i(void 0)}),hint:c,children:t(h,{options:[{label:o(d.page),id:"content"},{label:o(d.full),id:"full"}],value:m,ariaLabel:n,onChange:i})})}export{W as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as u,SettingsField as p,SettingsSegmented as h}from"efficient-easel/panel";import{WidthIcon as g}from"efficient-easel/icons";import{say as o,editorEaselWords as b}from"../../format/lib/editor-words.js";import{WIDTH_CHOICE_LABEL as d}from"../../format/lib/content/section-width.js";function W({value:l,resolved:a,onChange:i,label:s="Width",labelId:r,followsLabel:f,hint:c}){const e=l===void 0,m=e?a:l,n=o(s);return t(p,{label:n,labelId:r,icon:t(g,{}),value:e?f:void 0,changed:!e,action:t(u,{words:b()?.panel,label:n,changed:!e,onReset:()=>i(void 0)}),hint:c,children:t(h,{options:[{label:o(d.full),id:"full"},{label:o(d.page),id:"content"}],value:m,ariaLabel:n,onChange:i})})}export{W as default};
@@ -2974,7 +2974,7 @@
2974
2974
  the day a second thing joined it. Written against `.es-field-ctl` rather than
2975
2975
  against this panel or that one, because the promise being kept is the SHELL's
2976
2976
  and every row it stacks is owed it — `PartSettingsPanel`'s Size / Line
2977
- spacing / Letter spacing and `SiteWidthField`'s Site width are the four this
2977
+ spacing / Letter spacing and the Site styles Content number are the four this
2978
2978
  reaches today. Guarded by `scripts/test-part-slider-fills-row.ts`. */
2979
2979
  .es-field-ctl > .sf-slider {
2980
2980
  flex: 1;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{CaseIcon as c,FullWidthIcon as b,OpacityIcon as u,PlacementIcon as y,StickyIcon as h,TextLinesIcon as a}from"efficient-easel/icons";import{colorInput as s,group as i,select as k,sizeField as l,slider as r,text as _,textarea as p,toggle as d,upload as m}from"../../../controls.js";import{deviceField as e,deviceNote as x}from"../../../device-fields.js";import{DEFAULT_INTRO_BLEED_LAYOUT as T,INTRO_BLEED_COPY_SHARE as t,INTRO_BLEED_LAYOUT_OPTIONS as S}from"../../../../../../format/lib/sections/intro-bleed-layout.js";import{heightField as g,ctaField as f}from"../../shared-fields.js";import{INTRO_PH as n}from"../../../../../../render/lib/puck/blocks/general/IntroBleed/render.js";const F={fields:{_dDevice:x(),_gContent:i("Content"),eyebrow:_("Eyebrow",n.eyebrow),title:p("Heading",n.title),body:p("Subtitle",n.body),uppercase:d("Uppercase heading",!1,o(c,{})),_gBackground:i("Background images"),imageSrc:e("desktop",m("Background image","image/*")),imageSrcMobile:e("mobile",m("Background image","image/*")),_gLayout:i("Layout"),layout:k("Text position",o(y,{}),S,T),heightDesktop:g("desktop"),heightMobile:g("mobile"),copyShareDesktop:e("desktop",r("Text height",o(a,{}),t.min,t.max,t.step,t.desktop,"%")),copyShareMobile:e("mobile",r("Text height",o(a,{}),t.min,t.max,t.step,t.mobile,"%")),sticky:d("Stick to top",!0,o(h,{})),_gWidth:i("Width"),fullWidth:d("Full width",!0,o(b,{})),overlay:r("Overlay",o(u,{}),0,100,5,60,"%"),_gTextDesktop:e("desktop",i("Text style")),titleSizeDesktop:e("desktop",l("Heading font size",32,120,1,96,"heading")),bodySizeDesktop:e("desktop",l("Subtitle font size",12,28,1,17,"body")),_gTextMobile:e("mobile",i("Text style")),titleSizeMobile:e("mobile",l("Heading font size",24,72,1,44,"heading")),bodySizeMobile:e("mobile",l("Subtitle font size",12,22,1,16,"body")),_gButton:i("Button"),...f,buttonColor:s("Button color","#C9A461"),buttonTextColor:s("Button text color","#000000")}};export{F as IntroBleedFields};
1
+ import{jsx as t}from"react/jsx-runtime";import{CaseIcon as g,OpacityIcon as b,PlacementIcon as y,StickyIcon as u,TextLinesIcon as a}from"efficient-easel/icons";import{colorInput as d,group as i,select as k,sizeField as l,slider as r,text as h,textarea as s,toggle as m,upload as p}from"../../../controls.js";import{NoControlMark as _,noControlField as x}from"../../../panel-no-control-mark.js";import{deviceField as e,deviceNote as T}from"../../../device-fields.js";import{DEFAULT_INTRO_BLEED_LAYOUT as f,INTRO_BLEED_COPY_SHARE as o,INTRO_BLEED_LAYOUT_OPTIONS as S}from"../../../../../../format/lib/sections/intro-bleed-layout.js";import{heightField as c,ctaField as B}from"../../shared-fields.js";import{INTRO_PH as n}from"../../../../../../render/lib/puck/blocks/general/IntroBleed/render.js";const M={fields:{_dDevice:T(),_gContent:i("Content"),eyebrow:h("Eyebrow",n.eyebrow),title:s("Heading",n.title),body:s("Subtitle",n.body),uppercase:m("Uppercase heading",!1,t(g,{})),_gBackground:i("Background images"),imageSrc:e("desktop",p("Background image","image/*")),imageSrcMobile:e("mobile",p("Background image","image/*")),_gLayout:i("Layout"),layout:k("Text position",t(y,{}),S,f),heightDesktop:c("desktop"),heightMobile:c("mobile"),copyShareDesktop:e("desktop",r("Text height",t(a,{}),o.min,o.max,o.step,o.desktop,"%")),copyShareMobile:e("mobile",r("Text height",t(a,{}),o.min,o.max,o.step,o.mobile,"%")),sticky:m("Stick to top",!0,t(u,{})),fullWidth:{...x({type:"custom",render:()=>t(_,{})},"always"),reachedBy:"contentWidth"},overlay:r("Overlay",t(b,{}),0,100,5,60,"%"),_gTextDesktop:e("desktop",i("Text style")),titleSizeDesktop:e("desktop",l("Heading font size",32,120,1,96,"heading")),bodySizeDesktop:e("desktop",l("Subtitle font size",12,28,1,17,"body")),_gTextMobile:e("mobile",i("Text style")),titleSizeMobile:e("mobile",l("Heading font size",24,72,1,44,"heading")),bodySizeMobile:e("mobile",l("Subtitle font size",12,22,1,16,"body")),_gButton:i("Button"),...B,buttonColor:d("Button color","#C9A461"),buttonTextColor:d("Button text color","#000000")}};export{M as IntroBleedFields};
@@ -12,6 +12,7 @@ import { type SectionBackground } from "../../../format/lib/content/section-back
12
12
  import { type TypeRole, type TypeSizeValue } from "../../../format/lib/content/section-type-size.js";
13
13
  import { type WidthMode } from "../../../format/lib/content/section-width.js";
14
14
  import type { Bucket, DesignGroup } from "./field-groups.js";
15
+ export declare function sharedStyleKinds<T extends Record<string, unknown>>(fields: T): T;
15
16
  type SelectData = {
16
17
  options: readonly SelectOption[];
17
18
  fallback: string;
@@ -170,6 +171,7 @@ interface CornersRowTier {
170
171
  hint: ReactNode;
171
172
  }
172
173
  export declare function cornersRowField(tier: CornersRowTier): CustomField<number | null>;
174
+ export declare function useSelectedSibling(key: string): [unknown, (next: unknown) => void];
173
175
  export declare function cornerSidesField(): CustomField<string[] | null>;
174
176
  export declare function sectionCornersField(): CustomField<number | null>;
175
177
  export declare const SECTION_BLEEDS_HINT = "This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";
@@ -188,6 +190,7 @@ export declare function boxPhoneRowField(): CustomField<number>;
188
190
  export declare function directionField(container: DirectionContainer): CustomField<string>;
189
191
  export declare function sizeField(label: string, min: number, max: number, step: number, fallback: number, role: TypeRole): CustomField<TypeSizeValue>;
190
192
  export declare function cellWidthFields(): Record<string, unknown>;
193
+ export declare function useSelectedProps(): Record<string, unknown>;
191
194
  export declare function phoneOverrideField(opts: {
192
195
  label: string;
193
196
  desktopKey: string;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as k,Fragment as T}from"react/jsx-runtime";import{cloneElement as pe,useId as ft,useRef as ne,useState as z}from"react";import{useEasel as W,useSelectedFields as fe}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as he,hidableText as me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as V,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as Y,textFieldIdentifier as ht}from"efficient-easel/draw";import mt from"../../components/ApplyCornersToSiblings.js";import gt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as bt,CORNER_RADIUS_MAX as Se,CORNER_RADIUS_MIN as v}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as xt,IMAGE_CORNERS_LABEL as St}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as yt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Ct,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as ye}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as _t,HERO_GROUP_PLACEMENTS as It,HERO_GROUP_PLACEMENT_DEFAULT as Et,normalisePlacement as Tt,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import Rt from"../../components/KeepHint.js";import{AdjustIcon as Ot,AlignLeftIcon as wt,EyeIcon as Pt,AlignSeparateIcon as kt,AnimationIcon as _e,BackgroundIcon as Lt,BorderAllIcon as Nt,BlockSectionIcon as At,CartIcon as vt,ColumnWidthsIcon as Ie,ColumnsIcon as Ft,CornerIcon as Dt,DirectionDownIcon as Bt,DirectionLeftIcon as Ht,DirectionRightIcon as Gt,DirectionUpIcon as Mt,DollarIcon as Kt,FinishIcon as Wt,GapIcon as Ee,GridIcon as Ut,GroundIcon as Xt,HashIcon as Te,HeightIcon as $t,ImageIcon as jt,ListIcon as zt,LocationIcon as oe,PaddingAllIcon as Vt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Yt,PlacementIcon as qt,ProductSizeIcon as Jt,StickyIcon as Zt,RotateIcon as Qt,SquareIcon as en,TypeIcon as tn,WidthIcon as nn,WrapIcon as on}from"efficient-easel/icons";import{FieldGlyph as Le}from"../../components/FieldGlyph.js";import{resolvePageBackground as rn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Ne,CORNER_SIDE_POINTS as ln,hasOwnSectionCorners as an,normalizeCornerSides as Ae}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as sn,SECTION_MOTION_OPTIONS as cn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as ve}from"./enclosing-section.js";import{SettingsDefaultReset as S,SettingsField as h,SettingsGroupHead as dn,SettingsGroupSub as un,SettingsBorder as pn,SettingsSegmented as fn,SettingsSides as hn,SettingsSidesEach as Fe,sidesStartEach as mn,SettingsSwitch as De,borderSides as gn,borderStartEach as bn}from"efficient-easel/panel";import{FieldSelect as xn,ListField as Sn}from"efficient-easel/fields";import{DisplayChips as yn}from"efficient-shell/ui";import{desktopDisplayChanged as Cn,partShownOnDesktop as _n,partShownOnPhone as In,phoneDisplayChanged as En,withDesktopPart as Tn,withPhonePart as Rn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as On,Checkbox as wn,CornersInput as Pn,DateTimePicker as kn,FOCAL_DEFAULT as Ln,PictureTiles as Be,Slider as Nn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as An}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"./device-fields.js";import{NO_CONTROL_FIELD as vn,NoControlMark as re,noControlField as q}from"./panel-no-control-mark.js";import{OWN_BOX_FIELD as Fn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Dn,phoneKey as F,resolvePhoneValue as ie}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Bn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Hn,CARD_OUTLINE_OPTIONS as Gn,DEFAULT_CARD_INDEX_FORMAT as Mn,DEFAULT_CARD_OUTLINE as Kn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Wn,DEFAULT_COVER_INDEX as Un}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Xn}from"efficient-easel/draw";import $n from"../../components/MediaUploadField.js";import jn from"../../components/MultiSelectField.js";import zn from"../../components/SectionThemePicker.js";import Vn from"../../components/SearchSelectField.js";import Yn from"../../components/StorefrontLinkField.js";import{UiIcon as Ke}from"efficient-easel/draw/client";import{SECTION_PADDING as E}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as qn,resolveSectionMinHeight as Jn}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as J,SECTION_STICK_LABEL as le,hasPhoneStick as Zn,resolveSectionStick as Qn}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as eo,SECTION_MIN_HEIGHT_GROUP_LABEL as X,SECTION_SCREEN_PCT as to}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as no,containerDirectionPoints as oo,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as ro,BOX_BLOCK_SPACING_LABEL as io,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as lo,BOX_PHONE_ROW_MAX as ao,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as ae,BOX_WRAP_LABEL as so,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as D}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as co}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as uo,normalizeTheme as po,siteButtonPaint as fo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as se,CONTAINER_GAP_BUILT_IN as ho,GAP_FIELD_CONTAINER as mo,hasOwnContainerGap as go,resolveContainerGap as bo}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as xo,CARD_IMAGE_BG_OFF as So,CARD_IMAGE_BG_SWATCH_NAMES as yo,CARD_IMAGE_BG_SWATCHES as Co,isCardImageBackgroundInheriting as _o,cardImageBackgroundChoice as Io,THEME_CARD_IMAGE_BG as Eo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as To,SECTION_BG_SWATCHES as Ro,SECTION_BG_SWATCH_NAMES as Oo,THEME_SECTION_BG as wo,isSectionBackgroundInheriting as Po}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as ko}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Lo,TYPE_SIZE_INHERIT as No,isTypeSizeInheriting as Ao}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as vo,WIDTH_CHOICE_LABEL as Fo,WIDTH_INHERIT as Do,resolveWidth as Bo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Ho}from"efficient-easel/style-clipboard";function B(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!Y(n)&&Ho(n,`section:${t}`);return e}function Yi({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Go(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function Mo(e){return e.type===qe}function w(e){return Mo(e)?void 0:e}function L(e,t){return l("{value} from {from}",{value:e,from:t})}function Ko(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Bo(t,"full");return n==="page"?L(`${o}px`,l("the page")):n==="contained"?L(l("Contained"),l("the page")):L(l("Full"),l("the page"))}function Wo(){const{blockGap:e}=D();return e===null?l("this container's own spacing"):L(`${e}px`,l("Site styles"))}function Uo({inherited:e,onReset:t,label:n}){return r(S,{words:x()?.panel,label:l(n),changed:!e,detail:Wo(),onReset:t})}function Xo({inherited:e,onReset:t,label:n}){return r(S,{words:x()?.panel,label:l(n),changed:!e,detail:Ko(),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=he(e),f=ne(null),p=ne(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=ft(),_=i?qo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(Rt,{children:l(i)}):void 0,j=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(tn,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:j,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":j,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[s&&r(Me,{target:a?p:f,value:d,onChange:m}),a?r("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)}):r("input",{id:R,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)})]})})}function qi(e,t){return{...e,[xe]:t}}function Ji(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function Zi(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function Qi(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function el(e){return!!e&&typeof e=="object"&&e[Je]===!0}function tl(e){const t=e[I];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[I]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as xa,SCALAR_TEXT_CONTROLS as Sa}from"efficient-easel/draw";function nl(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[vn]:o,...i}=e;return{...i,[Fn]:!0,render:t}}const $o=new Set(Xn),G=(e,t)=>{const n={...t,[I]:e};if(!$o.has(e.control))return n;const o=t.render;return{...q(n,"authored-copy"),render:i=>r(Bn,{name:i.name,children:o(i)})}},ol="Everything else on this block comes from the linked post. Unlink it to edit by hand.",jo={field:"source.slug",set:!0},rl={not:jo},zo="Select a word, then press the highlighter.",Vo="A short name so a link can jump straight to this section, like yoursite.com/page#about.",Yo=new Set([zo]),qo=e=>Yo.has(e);function il(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function ll(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function Jo(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function al(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function sl(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(Yn,{value:me(t),onChange:n,label:e})}}function cl(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const dl={Design:Ot,Animation:_e};function ul(e,t){return e.includes("Design")?t!=="Design":null}function Zo({label:e}){return r(dn,{title:l(e),level:Ye(1)})}function Qo({level:e,label:t}){return e===1?r(Zo,{label:t}):r(nr,{label:t})}function Ze(e,t){return{type:"custom",[V]:{label:e,level:t},render:()=>r(Qo,{level:t,label:e})}}function y(e){return Ze(e,2)}function pl(e){return{type:"custom",render:()=>r(er,{text:e})}}function er({text:e}){return r("p",{className:"sf-note",children:l(e)})}function fl(e){return Ze(e,1)}function hl(e){return Y(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function ml(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[V]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function gl(e){return Y(e)!==null&&e?.designGroup!==void 0}const et=new Map;function bl(e){const t=et.get(e)??{type:"custom",[V]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function tr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function xl(e,t){return tr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function Sl(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(T,{})}}function nr({label:e}){return r(un,{title:l(e),level:Ye(2)})}function tt({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return k("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(He,{content:d,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":d})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function yl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Po(n,t);return r(h,{label:l(e),icon:r(Lt,{}),changed:!i,action:r(S,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(To)}),children:tt({swatches:Ro,current:i?wo:n??t??"",onPick:o,names:Oo})})}}}function or(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=_o(i,t);return r(h,{label:l(e),icon:r(Xt,{}),changed:!a,action:r(S,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(xo)}),children:tt({swatches:Co,current:a?Eo:Io(i,t),onPick:o,names:yo})})}}}function Cl(e=n=>n,t){return B({_gSectionTheme:y(ko),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(zn,{value:e(n),onChange:o,followLabel:t})}})}function M({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:d,disabled:u=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(Nn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:d===void 0?void 0:l(d),disabled:u,size:"sm",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function K(e,t,n,o,i,a,c="",s){return{type:"custom",render:d=>r(h,{label:l(e),icon:w(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:M({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function nt(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return r(h,{label:l(e),icon:u?w(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?pe(d,{changed:!b,onReset:()=>p(null)}):r(S,{words:x()?.panel,label:l(e),changed:!b,onReset:()=>p(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:m,label:e,onChange:p}):M({min:n,max:o,step:i,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function _l(e){const t=K("Gap",r(Ee,{}),se.min,se.max,se.step,ho[e],"px",(n,o)=>r(Uo,{inherited:!go(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[mo]:e,render:n=>t.render({...n,value:bo(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Z="Corners";function ce(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(Z),icon:r(Dt,{}),changed:i,action:pe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(rr,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=fe()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function rr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=Ae(a)??[...Ne];return r(Pn,{label:l(Z),value:s,corners:ln,onChange:d=>{const u=Ae(d)??[];c(u.length===Ne.length?null:u)},radius:t,onRadiusChange:n,radiusMin:v,radiusMax:Se,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return q({type:"custom",render:()=>r(re,{})},"always")}function ir({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=D(),i=typeof o=="number"?`${o}px`:l("not set");return r(S,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):L(i,l("Site styles")),onReset:n})}function lr(){const{cornerRadiusPx:e}=D();return typeof e=="number"?e:v}function ar(){return ce({sidesKey:"sectionCornerSides",useFollowed:lr,useClosedReason:()=>lt()?l(it):null,mark:r(ir,{label:Z}),hint:r(sr,{})})}const it="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function lt(){return Ve(N())}function sr(){return r(T,{children:lt()?it:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function Il(){return B({_gShape:y("Shape"),sectionCorners:ar(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const cr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function dr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ur(){let e;try{const t=po(D().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||uo.line}function pr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=ur(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=z(()=>bn(a,c)),u=cr();return r(h,{label:l("Border"),icon:r(Nt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(pn,{label:l("Border"),value:a,each:s,onChange:f=>t(dr(f)),placeholder:{sides:gn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:co})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(pr,{value:t,onChange:n,tier:e})})}function El(){return{_gMotion:y("Motion"),sectionAnimation:ue("Entrance",r(_e,{}),[...cn],sn)}}function de(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?ve(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=D(),n=de(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=W(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?ve(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return an(a)?a:o}function fr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=de(),i=st(v),a=o?"Site":"Section";return r(S,{words:x()?.panel,label:l(e),changed:t,detail:L(`${i}px`,o?l("Site styles"):l("the section")),onReset:n})}function hr(){return r(T,{children:de()?l("The section is full width, so this card follows Site styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function mr(){return ce({sidesKey:"cardCornerSides",useFollowed:()=>st(v),mark:r(fr,{label:Z}),hint:r(hr,{})})}function gr(){return{type:"custom",render:()=>r(mt,{})}}function Tl(e){return{...e,render:t=>r(gt,{render:e.render,props:t})}}function Rl(){return{_gShape:y("Shape"),cardCorners:mr(),cardCornerSides:rt(),cardCornersApplyAll:gr()}}function Ol(){return P("Justify",r(kt,{}),Xe,Xe[0].value)}function wl(){return P("Item alignment",r(wt,{}),ro,"stretch")}function Pl(){return P(so,r(on,{}),ze,ze[0].value)}function kl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=ae.find(o=>o.value===e)??ae[0];return r(h,{label:l(je),icon:r(Ie,{}),value:l(n.label),children:r(Be,{className:"sf-gallery-layouts",label:l(je),value:n.value,onChange:t,options:ae.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:br(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function br(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Ll(){return P(io,r(Ee,{}),Ue,Ue[0].value)}function Nl(){return K(lo,r(Yt,{}),$e,ao,1,$e)}function Al(e){const t=ue(no,Go("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),oo(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function vl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Le,{noun:a}),action:r(S,{words:x()?.panel,label:l(e),changed:!Ao(c),detail:l("the Text style in Site styles"),onReset:()=>s(No),defaultAction:{onPress:()=>s(Lo),title:l("Keep this section's own built-in size"),icon:r(At,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Fl(){return{_gCellWidth:y("Cell width"),gridSpan:P("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:yt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function N(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function xr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=N()[c],u=ie(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:ie(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function Sr({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=N()[t],c=ie(void 0,a,n);return r(S,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function yr(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(Sr,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(xr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Dl(e){return{type:"custom",render:({value:t,onChange:n})=>r(_r,{...e,value:t,onChange:n})}}function Cr({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(h,{label:l(e),icon:w(t),action:r(S,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:ee({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function _r({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=N()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Cr,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Ir={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Er={Top:Pe,Bottom:Re,Left:Oe,Right:we},Tr=e=>{const t=Er[e];return r(t,{})};function Bl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Ir[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,j,O,te=E)=>g("mobile",yr({label:i(_),icon:Tr(_),desktopKey:j,min:te.min,max:te.max,step:te.step,fallback:O})),s=e.top??E.min,d=e.bottom??E.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??E,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,R=_=>C?g("desktop",_):_;return B({...o?{_gSpacing:y("Padding")}:{},[t]:R(a(s)),...C?{[F(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:R(K(i("Bottom"),r(Re,{}),E.min,E.max,E.step,d,"px")),...C?{[F(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:R(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[F(u)]:c("Left",u,b,p)}:{},[f]:R(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[F(f)]:c("Right",f,b,p)}:{}}:{}})}const $=["top","right","bottom","left"],Rr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function Or(e,t,n){const o={};for(const i of $)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function wr({tier:e,o:t}){let n=null;try{n=fe()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries($.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries($.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=z(()=>mn(a,c));return r(h,{label:l("Padding"),icon:r(Vt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(hn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=Or(i,a,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:l("Padding top"),right:l("Padding right"),bottom:l("Padding bottom"),left:l("Padding left")},vertical:l("Top and bottom"),horizontal:l("Left and right"),unit:"px"}})})}function Hl(e={}){const t={...Rr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries($.map(s=>[s,F(t[s])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,i=s=>{const d={type:"custom",render:()=>r(wr,{tier:s,o:n})};return o?g(s,d):d},a=()=>q({type:"custom",render:()=>r(re,{})},"always"),c=$.filter(s=>s!=="top");return B({...e.group===!1?{}:{_gSpacing:y("Padding")},[n.keys.top]:i("desktop"),...o?{[n.phoneKeys.top]:i("mobile")}:{},...Object.fromEntries(c.map(s=>[n.keys[s],{...a(),reachedBy:n.keys.top}])),...o?Object.fromEntries(c.map(s=>[n.phoneKeys[s],g("mobile",a())])):{}})}const Pr={contained:"Contained",page:"Page",full:"Full"},Q="Width";function Gl(e,t=vo,n=!0){const o=t.map(i=>({label:Fo[i]??Pr[i],value:i}));return B({...n?{_gWidth:y(Q)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(Q),icon:r(nn,{}),action:n?r(Xo,{inherited:a?.inherited??!1,onReset:()=>i(Do),label:Q}):void 0,children:ee({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:Q})})}})}function Ml(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:X,icon:w(r($t,{})),action:o?o(a):void 0,children:ee({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:X})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?to:eo;return r("div",{className:"sf-field",children:M({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:X,onChange:i})})}}),n=()=>ue("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return B({_gHeight:y(X),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(kr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function kr({onClear:e}){const t=N(),n=qn(t),o=Jn(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(S,{words:x()?.panel,label:l(X),changed:n,detail:i,onReset:e})}function Kl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Lr,{value:o,onChange:i,labelId:`${a??c??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>r("div",{className:"sf-field",children:M({min:J.min,max:J.max,step:J.step,value:typeof n=="number"?n:J.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:y(le),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Lr({value:e,onChange:t,labelId:n,phone:o}){const i=N(),a=Qn(i),c=o?a.phone:e===!0;return r(h,{label:l(le),labelId:n,icon:w(r(Zt,{})),action:k(T,{children:[o?r(S,{words:x()?.panel,label:l(le),changed:Zn(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(De,{checked:c,onChange:t,ariaLabelledBy:n})]})})}function Wl(){return{_gAnchor:y("Anchor"),anchor:Jo("Anchor name","e.g. about",Vo)}}function Ul(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(kn,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function A(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(h,{label:l(e),labelId:d,icon:n,action:r(De,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function Xl(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(ke,{}),htmlFor:i,action:r(Ge,{id:i,label:"Background",value:rn(e),onChange:t})})}}}function $l(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(wn,{id:c,checked:a,onChange:o})})}}}const jl={follows:"fill"},zl={follows:"ink"};function Vl(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Nr,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(h,{label:l(e),icon:n,action:Ge({value:o||t,onChange:i,label:e})})}}function Nr({label:e,part:t,icon:n,value:o,onChange:i}){const a=fo(D().theme),c=t==="fill"?a.fill:a.ink;return r(An,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:L(c.toUpperCase(),l("Site styles")),onChange:i,onReset:()=>i("")})}const Ar=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function dt({label:e,value:t,onChange:n,points:o=Ar}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(On,{label:l(e),value:t,points:i,onChange:n})}function Yl(){return q({type:"custom",render:()=>r(re,{})},"always")}const vr=Ce([]);function ql(e,{stacking:t,fallback:n=Et}){return{type:"custom",render:({value:o,onChange:i})=>{const a=It.includes(o)?o:n;return t?r(Fr,{label:e,value:a,onChange:i}):ut({label:e,value:a,onChange:i,points:vr})}}}function Fr({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=W(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?_t(o?.data,a):[];return ut({label:e,value:t,onChange:n,points:Ce(c,a)})}function ut({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(qt,{}),hint:i?.title?l(i.title):void 0,children:dt({label:e,value:Tt(t),onChange:n,points:o})})}const Jl={top:r(Mt,{}),right:r(Gt,{}),bottom:r(Bt,{}),left:r(Ht,{})};function Zl(e,t,n,o,i,a){const c=f=>t.find(p=>p.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return s(`missing-${f}`);const m=a?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[s("corner-top-left"),d("top"),s("corner-top-right"),d("left"),s("centre"),d("right"),s("corner-bottom-left"),d("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:dt({label:e,value:m,onChange:p,points:u})})}}}const Dr="\0note";function P(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const d=s.options??n,u=s.fallback??o,f=d.some(p=>p.value===a)?a:u;return r(h,{label:l(e),icon:w(t),children:r(xn,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Dr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function Ql(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(jn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function ea(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Vn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function ta(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function ee({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(fn,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const na=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ue(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:w(t),children:ee({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function oa(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r($n,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const ra={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ia({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=(s,d)=>t({...o,[s]:d===""?void 0:Number(d)});return k(h,{label:l(n),icon:r(oe,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&k("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:s=>c("lat",s.target.value)})}),r(h,{label:l("Longitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:s=>c("lng",s.target.value)})})]})]})}function Br(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Hr(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function la(e,t){return e===null?null:t>e?e:null}function Gr(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const aa={label:"Ticker items",icon:r(zt,{})};function sa(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r(Mr,{label:e,icon:w(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Mr({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=ne(null),[s,d]=z(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Gr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(Sn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Me,{target:c,value:Br(n,s),onChange:p=>i(Hr(n,s??-1,p)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(p,m,b)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(m)}})})}function ca(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function da(e){return{_gCards:y("Cards"),coverIndex:P("Cover image",r(jt,{}),Wn,String(Un),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:or("Image background",So),cardImage:Wr(),spinOnHover:A("Rotate on hover",e?.spinDefault??!0,r(Qt,{}))}}function ua(){return{outline:P("Card outline",r(en,{}),Gn,Kn),indexBadge:P("Card number",r(Te,{}),Hn,Mn),showBadge:A("Product badge",!0,r(Le,{noun:"tag"}))}}function pa(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:y("Show on a card"),showCardPrice:A("Price",!0,r(Kt,{})),showCardFinishes:A("Finish swatches",!0,r(Wt,{})),showCardSizes:A("Sizes",n.showCardSizes,r(Jt,{})),showCardBuy:A("Buy button",n.showCardBuy,r(vt,{})),showCardPage:A("Page button",n.showCardPage,r(ke,{}))}}function fa(e,t="display"){const n=F(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(pt,{parts:e,changed:Cn(o),shown:a=>_n(o,a),onPress:(a,c)=>i(Tn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(Kr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function pt({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(Pt,{}),changed:t,action:r(S,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(yn,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function Kr({parts:e,desktopKey:t,value:n,onChange:o}){const i=N()[t];return r(pt,{parts:e,changed:En(n),shown:a=>In(i,n,a),onPress:(a,c)=>o(Rn(n,a,c)),onReset:()=>o(Dn),detail:l("the same as Desktop")})}function Wr(){return nt("Card image",{min:v,max:Se,step:bt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function ha(){return ce({sidesKey:"cornerSides",step:xt,useFollowed:()=>v,mark:r(Ur,{label:St}),hint:l("Rounds the picture. Left alone it stays square.")})}function Ur({label:e,changed:t=!1,onReset:n=()=>{}}){return r(S,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function ma(){return{type:"custom",render:({value:e,onChange:t})=>r(Xr,{value:typeof e=="string"?e:"",onChange:t})}}function Xr({value:e,onChange:t}){const[n,o]=z(null),i=ye.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return k(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Ft,{}),children:k("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),Ct.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(Ut,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:ye.length}),children:r(Be,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(U[c].label),picture:r("span",{className:"sf-gallery-pic",children:U[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{Vo as ANCHOR_HINT,jo as BOUND_TO_POST,ol as BOUND_TO_POST_NOTE,dl as BUCKET_ICONS,ra as CUSTOM_FIELD_MEDIA,ia as CoordsField,Jl as EDGE_ARROWS,Ln as FOCAL_DEFAULT,Ar as FOCAL_POINTS,V as FOLD_FIELD_MARKER,jl as FOLLOWS_SITE_BUTTON,zl as FOLLOWS_SITE_BUTTON_INK,dt as FocalPicker,nr as GroupLabel,zo as HIGHLIGHT_HINT,H as HidableTextField,ge as LINK_FIELD_MARKER,Yi as Label,be as MEDIA_FIELD_MARKER,na as MEDIA_TYPE_OPTIONS,rl as NOT_BOUND_TO_POST,er as PanelNoteLine,_r as PhoneChoiceRow,Cr as PhoneChoiceStrip,ut as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Sa as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Rr as SIDE_PAD_KEYS,Zo as SectionHeading,ee as Segmented,Uo as SiteGapDefaultReset,M as Slider,tt as Swatches,xa as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,aa as TICKER_ITEMS_ROW,Mr as TextListField,Xo as WidthDefaultReset,Gr as aimAfterListChange,Wl as anchorFields,L as backTo,yl as backgroundField,wl as boxAlignField,Ll as boxBlockSpacingField,Ol as boxJustifyField,Nl as boxPhoneRowField,kl as boxShareField,Pl as boxWrapField,ml as bucketHeader,mr as cardCornersField,or as cardImageBackgroundField,Wr as cardImageField,da as cardMediaFields,Rl as cardShapeFields,pa as cardShowFields,ua as cardStyleFields,Fl as cellWidthFields,$l as checkbox,Vl as colorInput,al as copyText,rt as cornerSidesField,ce as cornersRowField,Ul as dateTime,bl as designGroupHeader,Al as directionField,fa as displayFields,Zl as edgePad,ul as entriesHiddenForTab,la as focusAfterRemove,Yl as focusKeptField,xl as foldMarker,Y as foldMetaOf,tr as foldTitleOf,ma as galleryLayoutField,_l as gapField,y as group,Ml as heightFields,me as hidableText,qo as hintIsWhileTyping,w as iconOf,ha as imageCornersField,nl as inOwnBox,hl as isBucketHeader,gl as isDesignGroupHeader,Mo as isNoGlyph,sl as linkField,Ql as multiSelect,Go as noGlyph,Xl as pageBackgroundField,pl as panelNote,Dl as phoneChoiceField,yr as phoneOverrideField,ql as placementField,Jo as plainText,cl as plainTextarea,nt as pxField,Sl as quietMarker,he as readHidable,Br as rowText,ea as searchSelect,fl as section,El as sectionAnimationFields,at as sectionBorderField,ar as sectionCornersField,Il as sectionShapeFields,Cl as sectionThemeFields,ue as segmented,P as select,Hr as setRowText,Hl as sidesPaddingFields,Or as sidesPaddingPatch,vl as sizeField,K as slider,ta as sourceField,Bl as spacingFields,Kl as stickFields,Tl as templateField,il as text,ht as textFieldIdentifier,Zi as textFieldOffPage,el as textFieldPanelOnly,sa as textList,ca as textListRowField,ll as textarea,A as toggle,oa as upload,Ko as usePageWidthDetail,Wo as useSiteGapDetail,Gl as widthField,tl as withIdentifier,Ji as withOffPage,Qi as withPanelOnly,qi as withScaffold};
1
+ "use client";import{jsx as r,jsxs as k,Fragment as T}from"react/jsx-runtime";import{cloneElement as pe,useId as ft,useRef as ne,useState as z}from"react";import{useEasel as W,useSelectedFields as fe}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as he,hidableText as me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as V,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as Y,textFieldIdentifier as ht}from"efficient-easel/draw";import mt from"../../components/ApplyCornersToSiblings.js";import gt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as bt,CORNER_RADIUS_MAX as Se,CORNER_RADIUS_MIN as v}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as xt,IMAGE_CORNERS_LABEL as St}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as yt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Ct,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as ye}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as _t,HERO_GROUP_PLACEMENTS as It,HERO_GROUP_PLACEMENT_DEFAULT as Et,normalisePlacement as Tt,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import Rt from"../../components/KeepHint.js";import{AdjustIcon as Ot,AlignLeftIcon as wt,EyeIcon as Pt,AlignSeparateIcon as kt,AnimationIcon as _e,BackgroundIcon as Lt,BorderAllIcon as Nt,BlockSectionIcon as At,CartIcon as vt,ColumnWidthsIcon as Ie,ColumnsIcon as Ft,CornerIcon as Dt,DirectionDownIcon as Bt,DirectionLeftIcon as Ht,DirectionRightIcon as Gt,DirectionUpIcon as Mt,DollarIcon as Kt,FinishIcon as Wt,GapIcon as Ee,GridIcon as Ut,GroundIcon as Xt,HashIcon as Te,HeightIcon as $t,ImageIcon as jt,ListIcon as zt,LocationIcon as oe,PaddingAllIcon as Vt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Yt,PlacementIcon as qt,ProductSizeIcon as Jt,StickyIcon as Zt,RotateIcon as Qt,SquareIcon as en,TypeIcon as tn,WidthIcon as nn,WrapIcon as on}from"efficient-easel/icons";import{FieldGlyph as Le}from"../../components/FieldGlyph.js";import{resolvePageBackground as rn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Ne,CORNER_SIDE_POINTS as ln,hasOwnSectionCorners as an,normalizeCornerSides as Ae}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as sn,SECTION_MOTION_OPTIONS as cn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as ve}from"./enclosing-section.js";import{SettingsDefaultReset as S,SettingsField as h,SettingsGroupHead as dn,SettingsGroupSub as un,SettingsBorder as pn,SettingsSegmented as fn,SettingsSides as hn,SettingsSidesEach as Fe,sidesStartEach as mn,SettingsSwitch as De,borderSides as gn,borderStartEach as bn}from"efficient-easel/panel";import{FieldSelect as xn,ListField as Sn}from"efficient-easel/fields";import{DisplayChips as yn}from"efficient-shell/ui";import{desktopDisplayChanged as Cn,partShownOnDesktop as _n,partShownOnPhone as In,phoneDisplayChanged as En,withDesktopPart as Tn,withPhonePart as Rn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as On,Checkbox as wn,CornersInput as Pn,DateTimePicker as kn,FOCAL_DEFAULT as Ln,PictureTiles as Be,Slider as Nn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as An}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"./device-fields.js";import{NO_CONTROL_FIELD as vn,NoControlMark as re,noControlField as q}from"./panel-no-control-mark.js";import{OWN_BOX_FIELD as Fn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Dn,phoneKey as F,resolvePhoneValue as ie}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Bn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Hn,CARD_OUTLINE_OPTIONS as Gn,DEFAULT_CARD_INDEX_FORMAT as Mn,DEFAULT_CARD_OUTLINE as Kn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Wn,DEFAULT_COVER_INDEX as Un}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Xn}from"efficient-easel/draw";import $n from"../../components/MediaUploadField.js";import jn from"../../components/MultiSelectField.js";import zn from"../../components/SectionThemePicker.js";import Vn from"../../components/SearchSelectField.js";import Yn from"../../components/StorefrontLinkField.js";import{UiIcon as Ke}from"efficient-easel/draw/client";import{SECTION_PADDING as E}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as qn,resolveSectionMinHeight as Jn}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as J,SECTION_STICK_LABEL as le,hasPhoneStick as Zn,resolveSectionStick as Qn}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as eo,SECTION_MIN_HEIGHT_GROUP_LABEL as X,SECTION_SCREEN_PCT as to}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as no,containerDirectionPoints as oo,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as ro,BOX_BLOCK_SPACING_LABEL as io,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as lo,BOX_PHONE_ROW_MAX as ao,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as ae,BOX_WRAP_LABEL as so,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as D}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as co}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as uo,normalizeTheme as po,siteButtonPaint as fo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as se,CONTAINER_GAP_BUILT_IN as ho,GAP_FIELD_CONTAINER as mo,hasOwnContainerGap as go,resolveContainerGap as bo}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as xo,CARD_IMAGE_BG_OFF as So,CARD_IMAGE_BG_SWATCH_NAMES as yo,CARD_IMAGE_BG_SWATCHES as Co,isCardImageBackgroundInheriting as _o,cardImageBackgroundChoice as Io,THEME_CARD_IMAGE_BG as Eo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as To,SECTION_BG_SWATCHES as Ro,SECTION_BG_SWATCH_NAMES as Oo,THEME_SECTION_BG as wo,isSectionBackgroundInheriting as Po}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as ko}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Lo,TYPE_SIZE_INHERIT as No,isTypeSizeInheriting as Ao}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as vo,WIDTH_CHOICE_LABEL as Fo,WIDTH_INHERIT as Do,resolveWidth as Bo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Ho}from"efficient-easel/style-clipboard";function B(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!Y(n)&&Ho(n,`section:${t}`);return e}function Yi({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Go(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function Mo(e){return e.type===qe}function w(e){return Mo(e)?void 0:e}function L(e,t){return l("{value} from {from}",{value:e,from:t})}function Ko(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Bo(t,"full");return n==="page"?L(`${o}px`,l("the page")):n==="contained"?L(l("Contained"),l("the page")):L(l("Full"),l("the page"))}function Wo(){const{blockGap:e}=D();return e===null?l("this container's own spacing"):L(`${e}px`,l("Site styles"))}function Uo({inherited:e,onReset:t,label:n}){return r(S,{words:x()?.panel,label:l(n),changed:!e,detail:Wo(),onReset:t})}function Xo({inherited:e,onReset:t,label:n}){return r(S,{words:x()?.panel,label:l(n),changed:!e,detail:Ko(),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=he(e),f=ne(null),p=ne(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=ft(),_=i?qo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(Rt,{children:l(i)}):void 0,j=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(tn,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:j,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":j,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[s&&r(Me,{target:a?p:f,value:d,onChange:m}),a?r("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)}):r("input",{id:R,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)})]})})}function qi(e,t){return{...e,[xe]:t}}function Ji(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function Zi(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function Qi(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function el(e){return!!e&&typeof e=="object"&&e[Je]===!0}function tl(e){const t=e[I];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[I]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as xa,SCALAR_TEXT_CONTROLS as Sa}from"efficient-easel/draw";function nl(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[vn]:o,...i}=e;return{...i,[Fn]:!0,render:t}}const $o=new Set(Xn),G=(e,t)=>{const n={...t,[I]:e};if(!$o.has(e.control))return n;const o=t.render;return{...q(n,"authored-copy"),render:i=>r(Bn,{name:i.name,children:o(i)})}},ol="Everything else on this block comes from the linked post. Unlink it to edit by hand.",jo={field:"source.slug",set:!0},rl={not:jo},zo="Select a word, then press the highlighter.",Vo="A short name so a link can jump straight to this section, like yoursite.com/page#about.",Yo=new Set([zo]),qo=e=>Yo.has(e);function il(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function ll(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function Jo(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function al(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function sl(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(Yn,{value:me(t),onChange:n,label:e})}}function cl(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const dl={Design:Ot,Animation:_e};function ul(e,t){return e.includes("Design")?t!=="Design":null}function Zo({label:e}){return r(dn,{title:l(e),level:Ye(1)})}function Qo({level:e,label:t}){return e===1?r(Zo,{label:t}):r(nr,{label:t})}function Ze(e,t){return{type:"custom",[V]:{label:e,level:t},render:()=>r(Qo,{level:t,label:e})}}function y(e){return Ze(e,2)}function pl(e){return{type:"custom",render:()=>r(er,{text:e})}}function er({text:e}){return r("p",{className:"sf-note",children:l(e)})}function fl(e){return Ze(e,1)}function hl(e){return Y(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function ml(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[V]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function gl(e){return Y(e)!==null&&e?.designGroup!==void 0}const et=new Map;function bl(e){const t=et.get(e)??{type:"custom",[V]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function tr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function xl(e,t){return tr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function Sl(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(T,{})}}function nr({label:e}){return r(un,{title:l(e),level:Ye(2)})}function tt({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return k("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(He,{content:d,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":d})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function yl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Po(n,t);return r(h,{label:l(e),icon:r(Lt,{}),changed:!i,action:r(S,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(To)}),children:tt({swatches:Ro,current:i?wo:n??t??"",onPick:o,names:Oo})})}}}function or(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=_o(i,t);return r(h,{label:l(e),icon:r(Xt,{}),changed:!a,action:r(S,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(xo)}),children:tt({swatches:Co,current:a?Eo:Io(i,t),onPick:o,names:yo})})}}}function Cl(e=n=>n,t){return B({_gSectionTheme:y(ko),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(zn,{value:e(n),onChange:o,followLabel:t})}})}function M({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:d,disabled:u=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(Nn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:d===void 0?void 0:l(d),disabled:u,size:"sm",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function K(e,t,n,o,i,a,c="",s){return{type:"custom",render:d=>r(h,{label:l(e),icon:w(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:M({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function nt(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return r(h,{label:l(e),icon:u?w(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?pe(d,{changed:!b,onReset:()=>p(null)}):r(S,{words:x()?.panel,label:l(e),changed:!b,onReset:()=>p(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:m,label:e,onChange:p}):M({min:n,max:o,step:i,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function _l(e){const t=K("Gap",r(Ee,{}),se.min,se.max,se.step,ho[e],"px",(n,o)=>r(Uo,{inherited:!go(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[mo]:e,render:n=>t.render({...n,value:bo(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Z="Corners";function ce(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(Z),icon:r(Dt,{}),changed:i,action:pe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(rr,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=fe()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function rr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=Ae(a)??[...Ne];return r(Pn,{label:l(Z),value:s,corners:ln,onChange:d=>{const u=Ae(d)??[];c(u.length===Ne.length?null:u)},radius:t,onRadiusChange:n,radiusMin:v,radiusMax:Se,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return q({type:"custom",render:()=>r(re,{})},"always")}function ir({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=D(),i=typeof o=="number"?`${o}px`:l("not set");return r(S,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):L(i,l("Site styles")),onReset:n})}function lr(){const{cornerRadiusPx:e}=D();return typeof e=="number"?e:v}function ar(){return ce({sidesKey:"sectionCornerSides",useFollowed:lr,useClosedReason:()=>lt()?l(it):null,mark:r(ir,{label:Z}),hint:r(sr,{})})}const it="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function lt(){return Ve(N())}function sr(){return r(T,{children:lt()?it:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function Il(){return B({_gShape:y("Shape"),sectionCorners:ar(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const cr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function dr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ur(){let e;try{const t=po(D().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||uo.line}function pr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=ur(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=z(()=>bn(a,c)),u=cr();return r(h,{label:l("Border"),icon:r(Nt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(pn,{label:l("Border"),value:a,each:s,onChange:f=>t(dr(f)),placeholder:{sides:gn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:co})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(pr,{value:t,onChange:n,tier:e})})}function El(){return{_gMotion:y("Motion"),sectionAnimation:ue("Entrance",r(_e,{}),[...cn],sn)}}function de(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?ve(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=D(),n=de(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=W(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?ve(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return an(a)?a:o}function fr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=de(),i=st(v),a=o?"Site":"Section";return r(S,{words:x()?.panel,label:l(e),changed:t,detail:L(`${i}px`,o?l("Site styles"):l("the section")),onReset:n})}function hr(){return r(T,{children:de()?l("The section is full width, so this card follows Site styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function mr(){return ce({sidesKey:"cardCornerSides",useFollowed:()=>st(v),mark:r(fr,{label:Z}),hint:r(hr,{})})}function gr(){return{type:"custom",render:()=>r(mt,{})}}function Tl(e){return{...e,render:t=>r(gt,{render:e.render,props:t})}}function Rl(){return{_gShape:y("Shape"),cardCorners:mr(),cardCornerSides:rt(),cardCornersApplyAll:gr()}}function Ol(){return P("Justify",r(kt,{}),Xe,Xe[0].value)}function wl(){return P("Item alignment",r(wt,{}),ro,"stretch")}function Pl(){return P(so,r(on,{}),ze,ze[0].value)}function kl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=ae.find(o=>o.value===e)??ae[0];return r(h,{label:l(je),icon:r(Ie,{}),value:l(n.label),children:r(Be,{className:"sf-gallery-layouts",label:l(je),value:n.value,onChange:t,options:ae.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:br(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function br(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Ll(){return P(io,r(Ee,{}),Ue,Ue[0].value)}function Nl(){return K(lo,r(Yt,{}),$e,ao,1,$e)}function Al(e){const t=ue(no,Go("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),oo(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function vl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Le,{noun:a}),action:r(S,{words:x()?.panel,label:l(e),changed:!Ao(c),detail:l("the Text style in Site styles"),onReset:()=>s(No),defaultAction:{onPress:()=>s(Lo),title:l("Keep this section's own built-in size"),icon:r(At,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Fl(){return{_gCellWidth:y("Cell width"),gridSpan:P("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:yt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function N(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function xr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=N()[c],u=ie(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:ie(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function Sr({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=N()[t],c=ie(void 0,a,n);return r(S,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function yr(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(Sr,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(xr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Dl(e){return{type:"custom",render:({value:t,onChange:n})=>r(_r,{...e,value:t,onChange:n})}}function Cr({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(h,{label:l(e),icon:w(t),action:r(S,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:ee({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function _r({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=N()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Cr,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Ir={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Er={Top:Pe,Bottom:Re,Left:Oe,Right:we},Tr=e=>{const t=Er[e];return r(t,{})};function Bl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Ir[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,j,O,te=E)=>g("mobile",yr({label:i(_),icon:Tr(_),desktopKey:j,min:te.min,max:te.max,step:te.step,fallback:O})),s=e.top??E.min,d=e.bottom??E.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??E,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,R=_=>C?g("desktop",_):_;return B({...o?{_gSpacing:y("Padding")}:{},[t]:R(a(s)),...C?{[F(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:R(K(i("Bottom"),r(Re,{}),E.min,E.max,E.step,d,"px")),...C?{[F(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:R(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[F(u)]:c("Left",u,b,p)}:{},[f]:R(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[F(f)]:c("Right",f,b,p)}:{}}:{}})}const $=["top","right","bottom","left"],Rr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function Or(e,t,n){const o={};for(const i of $)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function wr({tier:e,o:t}){let n=null;try{n=fe()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries($.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries($.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=z(()=>mn(a,c));return r(h,{label:l("Padding"),icon:r(Vt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(hn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=Or(i,a,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:l("Padding top"),right:l("Padding right"),bottom:l("Padding bottom"),left:l("Padding left")},vertical:l("Top and bottom"),horizontal:l("Left and right"),unit:"px"}})})}function Hl(e={}){const t={...Rr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries($.map(s=>[s,F(t[s])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,i=s=>{const d={type:"custom",render:()=>r(wr,{tier:s,o:n})};return o?g(s,d):d},a=()=>q({type:"custom",render:()=>r(re,{})},"always"),c=$.filter(s=>s!=="top");return B({...e.group===!1?{}:{_gSpacing:y("Padding")},[n.keys.top]:i("desktop"),...o?{[n.phoneKeys.top]:i("mobile")}:{},...Object.fromEntries(c.map(s=>[n.keys[s],{...a(),reachedBy:n.keys.top}])),...o?Object.fromEntries(c.map(s=>[n.phoneKeys[s],g("mobile",a())])):{}})}const Pr={contained:"Contained",page:"Page",full:"Full"},Q="Width";function Gl(e,t=vo,n=!0){const o=t.map(i=>({label:Fo[i]??Pr[i],value:i}));return B({...n?{_gWidth:y(Q)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(Q),icon:r(nn,{}),action:n?r(Xo,{inherited:a?.inherited??!1,onReset:()=>i(Do),label:Q}):void 0,children:ee({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:Q})})}})}function Ml(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:X,icon:w(r($t,{})),action:o?o(a):void 0,children:ee({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:X})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?to:eo;return r("div",{className:"sf-field",children:M({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:X,onChange:i})})}}),n=()=>ue("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return B({_gHeight:y(X),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(kr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function kr({onClear:e}){const t=N(),n=qn(t),o=Jn(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(S,{words:x()?.panel,label:l(X),changed:n,detail:i,onReset:e})}function Kl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Lr,{value:o,onChange:i,labelId:`${a??c??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>r("div",{className:"sf-field",children:M({min:J.min,max:J.max,step:J.step,value:typeof n=="number"?n:J.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:y(le),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Lr({value:e,onChange:t,labelId:n,phone:o}){const i=N(),a=Qn(i),c=o?a.phone:e===!0;return r(h,{label:l(le),labelId:n,icon:w(r(Zt,{})),action:k(T,{children:[o?r(S,{words:x()?.panel,label:l(le),changed:Zn(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(De,{checked:c,onChange:t,ariaLabelledBy:n})]})})}function Wl(){return{_gAnchor:y("Anchor"),anchor:Jo("Anchor name","e.g. about",Vo)}}function Ul(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(kn,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function A(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(h,{label:l(e),labelId:d,icon:n,action:r(De,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function Xl(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(ke,{}),htmlFor:i,action:r(Ge,{id:i,label:"Background",value:rn(e),onChange:t})})}}}function $l(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(wn,{id:c,checked:a,onChange:o})})}}}const jl={follows:"fill"},zl={follows:"ink"};function Vl(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Nr,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(h,{label:l(e),icon:n,action:Ge({value:o||t,onChange:i,label:e})})}}function Nr({label:e,part:t,icon:n,value:o,onChange:i}){const a=fo(D().theme),c=t==="fill"?a.fill:a.ink;return r(An,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:L(c.toUpperCase(),l("Site styles")),onChange:i,onReset:()=>i("")})}const Ar=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function dt({label:e,value:t,onChange:n,points:o=Ar}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(On,{label:l(e),value:t,points:i,onChange:n})}function Yl(){return q({type:"custom",render:()=>r(re,{})},"always")}const vr=Ce([]);function ql(e,{stacking:t,fallback:n=Et}){return{type:"custom",render:({value:o,onChange:i})=>{const a=It.includes(o)?o:n;return t?r(Fr,{label:e,value:a,onChange:i}):ut({label:e,value:a,onChange:i,points:vr})}}}function Fr({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=W(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?_t(o?.data,a):[];return ut({label:e,value:t,onChange:n,points:Ce(c,a)})}function ut({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(qt,{}),hint:i?.title?l(i.title):void 0,children:dt({label:e,value:Tt(t),onChange:n,points:o})})}const Jl={top:r(Mt,{}),right:r(Gt,{}),bottom:r(Bt,{}),left:r(Ht,{})};function Zl(e,t,n,o,i,a){const c=f=>t.find(p=>p.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return s(`missing-${f}`);const m=a?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[s("corner-top-left"),d("top"),s("corner-top-right"),d("left"),s("centre"),d("right"),s("corner-bottom-left"),d("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:dt({label:e,value:m,onChange:p,points:u})})}}}const Dr="\0note";function P(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const d=s.options??n,u=s.fallback??o,f=d.some(p=>p.value===a)?a:u;return r(h,{label:l(e),icon:w(t),children:r(xn,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Dr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function Ql(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(jn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function ea(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Vn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function ta(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function ee({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(fn,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const na=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ue(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:w(t),children:ee({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function oa(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r($n,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const ra={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ia({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=(s,d)=>t({...o,[s]:d===""?void 0:Number(d)});return k(h,{label:l(n),icon:r(oe,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&k("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:s=>c("lat",s.target.value)})}),r(h,{label:l("Longitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:s=>c("lng",s.target.value)})})]})]})}function Br(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Hr(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function la(e,t){return e===null?null:t>e?e:null}function Gr(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const aa={label:"Ticker items",icon:r(zt,{})};function sa(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r(Mr,{label:e,icon:w(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Mr({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=ne(null),[s,d]=z(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Gr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(Sn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Me,{target:c,value:Br(n,s),onChange:p=>i(Hr(n,s??-1,p)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(p,m,b)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(m)}})})}function ca(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function da(e){return{_gCards:y("Cards"),coverIndex:P("Cover image",r(jt,{}),Wn,String(Un),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:or("Image background",So),cardImage:Wr(),spinOnHover:A("Rotate on hover",e?.spinDefault??!0,r(Qt,{}))}}function ua(){return{outline:P("Card outline",r(en,{}),Gn,Kn),indexBadge:P("Card number",r(Te,{}),Hn,Mn),showBadge:A("Product badge",!0,r(Le,{noun:"tag"}))}}function pa(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:y("Show on a card"),showCardPrice:A("Price",!0,r(Kt,{})),showCardFinishes:A("Finish swatches",!0,r(Wt,{})),showCardSizes:A("Sizes",n.showCardSizes,r(Jt,{})),showCardBuy:A("Buy button",n.showCardBuy,r(vt,{})),showCardPage:A("Page button",n.showCardPage,r(ke,{}))}}function fa(e,t="display"){const n=F(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(pt,{parts:e,changed:Cn(o),shown:a=>_n(o,a),onPress:(a,c)=>i(Tn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(Kr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function pt({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(Pt,{}),changed:t,action:r(S,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(yn,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function Kr({parts:e,desktopKey:t,value:n,onChange:o}){const i=N()[t];return r(pt,{parts:e,changed:En(n),shown:a=>In(i,n,a),onPress:(a,c)=>o(Rn(n,a,c)),onReset:()=>o(Dn),detail:l("the same as Desktop")})}function Wr(){return nt("Card image",{min:v,max:Se,step:bt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function ha(){return ce({sidesKey:"cornerSides",step:xt,useFollowed:()=>v,mark:r(Ur,{label:St}),hint:l("Rounds the picture. Left alone it stays square.")})}function Ur({label:e,changed:t=!1,onReset:n=()=>{}}){return r(S,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function ma(){return{type:"custom",render:({value:e,onChange:t})=>r(Xr,{value:typeof e=="string"?e:"",onChange:t})}}function Xr({value:e,onChange:t}){const[n,o]=z(null),i=ye.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return k(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Ft,{}),children:k("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),Ct.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(Ut,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:ye.length}),children:r(Be,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(U[c].label),picture:r("span",{className:"sf-gallery-pic",children:U[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{Vo as ANCHOR_HINT,jo as BOUND_TO_POST,ol as BOUND_TO_POST_NOTE,dl as BUCKET_ICONS,ra as CUSTOM_FIELD_MEDIA,ia as CoordsField,Jl as EDGE_ARROWS,Ln as FOCAL_DEFAULT,Ar as FOCAL_POINTS,V as FOLD_FIELD_MARKER,jl as FOLLOWS_SITE_BUTTON,zl as FOLLOWS_SITE_BUTTON_INK,dt as FocalPicker,nr as GroupLabel,zo as HIGHLIGHT_HINT,H as HidableTextField,ge as LINK_FIELD_MARKER,Yi as Label,be as MEDIA_FIELD_MARKER,na as MEDIA_TYPE_OPTIONS,rl as NOT_BOUND_TO_POST,er as PanelNoteLine,_r as PhoneChoiceRow,Cr as PhoneChoiceStrip,ut as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Sa as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Rr as SIDE_PAD_KEYS,Zo as SectionHeading,ee as Segmented,Uo as SiteGapDefaultReset,M as Slider,tt as Swatches,xa as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,aa as TICKER_ITEMS_ROW,Mr as TextListField,Xo as WidthDefaultReset,Gr as aimAfterListChange,Wl as anchorFields,L as backTo,yl as backgroundField,wl as boxAlignField,Ll as boxBlockSpacingField,Ol as boxJustifyField,Nl as boxPhoneRowField,kl as boxShareField,Pl as boxWrapField,ml as bucketHeader,mr as cardCornersField,or as cardImageBackgroundField,Wr as cardImageField,da as cardMediaFields,Rl as cardShapeFields,pa as cardShowFields,ua as cardStyleFields,Fl as cellWidthFields,$l as checkbox,Vl as colorInput,al as copyText,rt as cornerSidesField,ce as cornersRowField,Ul as dateTime,bl as designGroupHeader,Al as directionField,fa as displayFields,Zl as edgePad,ul as entriesHiddenForTab,la as focusAfterRemove,Yl as focusKeptField,xl as foldMarker,Y as foldMetaOf,tr as foldTitleOf,ma as galleryLayoutField,_l as gapField,y as group,Ml as heightFields,me as hidableText,qo as hintIsWhileTyping,w as iconOf,ha as imageCornersField,nl as inOwnBox,hl as isBucketHeader,gl as isDesignGroupHeader,Mo as isNoGlyph,sl as linkField,Ql as multiSelect,Go as noGlyph,Xl as pageBackgroundField,pl as panelNote,Dl as phoneChoiceField,yr as phoneOverrideField,ql as placementField,Jo as plainText,cl as plainTextarea,nt as pxField,Sl as quietMarker,he as readHidable,Br as rowText,ea as searchSelect,fl as section,El as sectionAnimationFields,at as sectionBorderField,ar as sectionCornersField,Il as sectionShapeFields,Cl as sectionThemeFields,ue as segmented,P as select,Hr as setRowText,B as sharedStyleKinds,Hl as sidesPaddingFields,Or as sidesPaddingPatch,vl as sizeField,K as slider,ta as sourceField,Bl as spacingFields,Kl as stickFields,Tl as templateField,il as text,ht as textFieldIdentifier,Zi as textFieldOffPage,el as textFieldPanelOnly,sa as textList,ca as textListRowField,ll as textarea,A as toggle,oa as upload,Ko as usePageWidthDetail,N as useSelectedProps,ot as useSelectedSibling,Wo as useSiteGapDetail,Gl as widthField,tl as withIdentifier,Ji as withOffPage,Qi as withPanelOnly,qi as withScaffold};
@@ -1 +1 @@
1
- "use client";import{Fragment as f,jsx as m,jsxs as S}from"react/jsx-runtime";import{useMemo as h,useRef as y}from"react";import{EaselCanvas as C,useEaselApi as P}from"efficient-easel/easel";import T from"../../components/PreviewThemeFrame.js";import{OpenDocumentChromeLoadNotice as w}from"../../components/PinnedChromeLoadNotice.js";import{usePreviewParts as v}from"efficient-easel/draw/client";import{partElement as A,partTypingTarget as F,setCanvasTypingPart as I}from"./canvas-typing.js";import{partThemeColors as x,readInks as D}from"../../../format/lib/puck/part-inks.js";import{partOpenOn as O,PART_ATTR as u}from"../../../render/lib/puck/text-parts.js";import{useSectionOps as j}from"./use-section-ops.js";import{useBlockMetadata as E}from"../editor-block-metadata.js";import{useEditorCanvasStyles as _}from"../editor-canvas-styles.js";function b({children:n,componentId:o}){const{selectedPartId:a}=v();return O(a,o)?m(f,{}):m(f,{children:n})}function K(n){const{mirrorHostStyles:o}=_(),a=E(),l=y(null),s=B(l),{onDocument:p}=n,c=e=>{l.current=e,p?.(e)};return S(f,{children:[m(w,{}),m(C,{...n,onDocument:c,typing:s,metadata:n.metadata??a,height:"fill",mirrorStyles:o,frameWrapper:T,overlay:b})]})}function B(n){const o=P(),a=j(),l=v(),s=y({ops:a,parts:l});return s.current={ops:a,parts:l},h(()=>{const p={getItemById:e=>o.getState().getItemById(e),getSelectorForId:e=>o.getState().getSelectorForId(e),get components(){return o.getState().config.components},replace:(e,t,r)=>s.current.ops.replaceComponent(e,t,r)},c=(e,t)=>{const r=F(e,p);if(!r)return null;let i=t;const d=()=>(i=A(i,i?.ownerDocument??n.current,e),i),g=d();return g?{element:d,value:r.value,rules:r.rules,multiline:r.multiline,write:r.write,toolbar:{offered:r.offered,colors:r.offered.length>0?x(D(g)):void 0}}:null};return{at:e=>{const t=e.closest(`[${u}]`),r=t?.getAttribute(u);return t&&r?c(r,t):null},atSelection:()=>{const e=s.current.parts.selectedPartId;return e?c(e,null):null},onChange:e=>{if(!e.typing){I(null);return}const t=e.element.closest(`[${u}]`)?.getAttribute(u)??null;I(t),t&&s.current.parts.selectedPartId!==t&&s.current.parts.select(t)}}},[o,n])}export{K as SiteCanvas};
1
+ "use client";import{Fragment as f,jsx as p,jsxs as I}from"react/jsx-runtime";import{useMemo as h,useRef as v}from"react";import{EaselCanvas as S,useEaselApi as P}from"efficient-easel/easel";import T from"../../components/PreviewThemeFrame.js";import{OpenDocumentChromeLoadNotice as w}from"../../components/PinnedChromeLoadNotice.js";import{usePreviewParts as y}from"efficient-easel/draw/client";import{partElement as F,partTypingTarget as A,setCanvasTypingPart as C}from"./canvas-typing.js";import{partThemeColors as D,readInks as x}from"../../../format/lib/puck/part-inks.js";import{partOpenOn as O,PART_ATTR as d}from"../../../render/lib/puck/text-parts.js";import{useSectionOps as j}from"./use-section-ops.js";import{useBlockMetadata as B}from"../editor-block-metadata.js";import{usePreviewHeader as E}from"../../../render/components/PreviewHeaderContext.js";import{siteWidthsMetadata as M}from"../../../format/lib/content/section-width.js";import{useEditorCanvasStyles as W}from"../editor-canvas-styles.js";function _({children:n,componentId:o}){const{selectedPartId:s}=y();return O(s,o)?p(f,{}):p(f,{children:n})}function X(n){const{mirrorHostStyles:o}=W(),s=B(),{sectionBackgroundWidth:l,sectionContentWidth:a,themeFromDocument:m}=E(),u=h(()=>({...n.metadata??s??{},...M(m?null:l,m?null:a)}),[n.metadata,s,l,a,m]),t=v(null),e=b(t),{onDocument:r}=n,i=c=>{t.current=c,r?.(c)};return I(f,{children:[p(w,{}),p(S,{...n,onDocument:i,typing:e,metadata:u,height:"fill",mirrorStyles:o,frameWrapper:T,overlay:_})]})}function b(n){const o=P(),s=j(),l=y(),a=v({ops:s,parts:l});return a.current={ops:s,parts:l},h(()=>{const m={getItemById:t=>o.getState().getItemById(t),getSelectorForId:t=>o.getState().getSelectorForId(t),get components(){return o.getState().config.components},replace:(t,e,r)=>a.current.ops.replaceComponent(t,e,r)},u=(t,e)=>{const r=A(t,m);if(!r)return null;let i=e;const c=()=>(i=F(i,i?.ownerDocument??n.current,t),i),g=c();return g?{element:c,value:r.value,rules:r.rules,multiline:r.multiline,write:r.write,toolbar:{offered:r.offered,colors:r.offered.length>0?D(x(g)):void 0}}:null};return{at:t=>{const e=t.closest(`[${d}]`),r=e?.getAttribute(d);return e&&r?u(r,e):null},atSelection:()=>{const t=a.current.parts.selectedPartId;return t?u(t,null):null},onChange:t=>{if(!t.typing){C(null);return}const e=t.element.closest(`[${d}]`)?.getAttribute(d)??null;C(e),e&&a.current.parts.selectedPartId!==e&&a.current.parts.select(e)}}},[o,n])}export{X as SiteCanvas};
@@ -1 +1 @@
1
- import{WidthIcon as i}from"efficient-easel/icons";import o from"../../../components/PreviewPartAnchors.js";import{BLOCK_THEME_FOLLOW_LABEL as e,SECTION_THEME_FOLLOW_LABEL as r}from"../../../components/SectionThemePicker.js";import{anchorFields as s,cardShapeFields as d,cellWidthFields as t,heightFields as m,sectionAnimationFields as n,sectionShapeFields as l,sectionThemeFields as p,slider as F,spacingFields as c,sidesPaddingFields as h,stickFields as a,widthField as E}from"../controls.js";import{assignSectionGroups as L}from"../field-groups.js";import{dropEmptyHeadings as S}from"../panel-drop-empty-headings.js";import{rowsShownForNode as f}from"../show-when-resolve.js";const W={spacingFields:c,sidesPaddingFields:h,sectionShapeFields:l,cardShapeFields:d,cellWidthFields:t,widthField:E,heightFields:m,anchorFields:s,stickFields:a,sectionThemeFields:p,sectionAnimationFields:n,slider:F,WidthIcon:i,assignSectionGroups:L,dropEmptyHeadings:S,rowsShownForNode:f,SECTION_THEME_FOLLOW_LABEL:r,BLOCK_THEME_FOLLOW_LABEL:e,PartAnchors:o};export{W as PASS_INSPECTOR};
1
+ import{WidthIcon as i}from"efficient-easel/icons";import o from"../../../components/PreviewPartAnchors.js";import{BLOCK_THEME_FOLLOW_LABEL as e,SECTION_THEME_FOLLOW_LABEL as r}from"../../../components/SectionThemePicker.js";import{anchorFields as s,cardShapeFields as t,cellWidthFields as d,heightFields as m,sectionAnimationFields as n,sectionShapeFields as l,sectionThemeFields as p,slider as F,spacingFields as c,sidesPaddingFields as h,stickFields as a,widthField as E}from"../controls.js";import{assignSectionGroups as L}from"../field-groups.js";import{sectionWidthFields as f}from"../section-width-fields.js";import{dropEmptyHeadings as S}from"../panel-drop-empty-headings.js";import{rowsShownForNode as O}from"../show-when-resolve.js";const C={spacingFields:c,sidesPaddingFields:h,sectionShapeFields:l,cardShapeFields:t,cellWidthFields:d,widthField:E,sectionWidthFields:f,heightFields:m,anchorFields:s,stickFields:a,sectionThemeFields:p,sectionAnimationFields:n,slider:F,WidthIcon:i,assignSectionGroups:L,dropEmptyHeadings:S,rowsShownForNode:O,SECTION_THEME_FOLLOW_LABEL:r,BLOCK_THEME_FOLLOW_LABEL:e,PartAnchors:o};export{C as PASS_INSPECTOR};
@@ -0,0 +1 @@
1
+ export declare function sectionWidthFields(type: string): Record<string, unknown>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as c}from"react/jsx-runtime";import{usePreviewDevice as y}from"efficient-easel/draw/client";import{usePreviewHeader as _}from"../../../render/components/PreviewHeaderContext.js";import{BackgroundWidthRow as S,CONTENT_INSIDE_BACKGROUND_HINT as C,ContentWidthRow as I,WIDTH_GROUP_LABEL as H,WIDTH_PHONE_HINT as T}from"../../components/SectionWidthRows.js";import{PAGE_WIDTH as p}from"../../../format/lib/content/page-width.js";import{FOLLOW_SITE as m,WIDTH_CHOICE_LABEL as B,resolveSectionWidth as f}from"../../../format/lib/content/section-width.js";import{say as h}from"../../../format/lib/editor-words.js";import{group as E,sharedStyleKinds as N,useSelectedProps as g,useSelectedSibling as P}from"./controls.js";import{NoControlMark as W,noControlField as b}from"./panel-no-control-mark.js";const l=t=>h(B[t==="content"?"page":"full"]),x=t=>`${t} ${h("from Site styles")}`;function k(){const{siteWidth:t,sectionBackgroundWidth:n,sectionContentWidth:i}=_();return{px:typeof t=="number"?t:p.default,background:n??"full",content:i??"content"}}function w(){try{return y()==="mobile"}catch{return!1}}function R({type:t,onChange:n}){const i=g(),e=k(),o=w(),d=f(t,i).background;return c(S,{value:d??e.background,changed:d!==null,detail:x(l(e.background)),onChange:r=>n(r),onReset:()=>n(m),disabled:o})}function D({type:t,onChange:n}){const i=g(),[,e]=P("contentMax"),o=k(),d=w(),r=f(t,i),u=(r.background??o.background)==="content",a=r.content??o.content;return c(I,{mode:u&&a==="full"?"content":a,px:r.contentMax??o.px,max:u?o.px:p.max,changed:r.content!==null,detail:x(o.content==="full"?l("full"):`${l("content")} ${o.px}px`),fullClosed:u,disabled:d,hint:d?T:u?C:void 0,onMode:s=>{n(s),s==="full"&&e(null)},onPx:s=>{n("content"),e(s===o.px?null:s)},onReset:()=>{n(m),e(null)}})}function U(t){return N({_gWidth:E(H),backgroundWidth:{type:"custom",render:({onChange:n})=>c(R,{type:t,onChange:n})},contentWidth:{type:"custom",render:({onChange:n})=>c(D,{type:t,onChange:n})},contentMax:{...b({type:"custom",render:()=>c(W,{})},"always"),reachedBy:"contentWidth"},widthMode:{...b({type:"custom",render:()=>c(W,{})},"always"),reachedBy:"backgroundWidth"}})}export{U as sectionWidthFields};