efficient-web-builder 37.1.0 → 37.2.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 (29) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/editor/components/AnchorField.d.ts +8 -0
  3. package/dist/editor/components/AnchorField.js +1 -0
  4. package/dist/editor/components/PartSettingsPanel.js +1 -1
  5. package/dist/editor/components/StylesPanel.js +1 -1
  6. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  7. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  8. package/dist/editor/components/storefront-editor.css +27 -4
  9. package/dist/editor/lib/puck/blocks/general/Footprint/fields.d.ts +1 -0
  10. package/dist/editor/lib/puck/blocks/general/Footprint/fields.js +1 -1
  11. package/dist/editor/lib/puck/controls.d.ts +0 -1
  12. package/dist/editor/lib/puck/controls.js +1 -1
  13. package/dist/editor/lib/puck/section-width-fields.js +1 -1
  14. package/dist/format/lib/content/footprint.d.ts +3 -0
  15. package/dist/format/lib/content/footprint.js +1 -1
  16. package/dist/format/lib/content/subscribe.d.ts +2 -18
  17. package/dist/format/lib/content/subscribe.js +2 -2
  18. package/dist/format/lib/editor-words-catalogue.d.ts +9 -9
  19. package/dist/format/lib/editor-words-catalogue.js +4 -4
  20. package/dist/format/lib/popup/behavior.d.ts +43 -0
  21. package/dist/format/lib/popup/behavior.js +1 -0
  22. package/dist/format/lib/popup/look.d.ts +28 -0
  23. package/dist/format/lib/popup/look.js +1 -0
  24. package/dist/format/lib/popup/rules.d.ts +35 -0
  25. package/dist/format/lib/popup/rules.js +1 -0
  26. package/dist/format/lib/source-rules/panel-no-divider-lines.js +1 -1
  27. package/dist/render/components/Footprint.js +1 -1
  28. package/dist/render/lib/puck/blocks/general/Footprint/render.js +2 -2
  29. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 37.2.0 - 2026-10-23
6
+
7
+ A MINOR: the group office list on the Locations Map (#254), a full-bleed group band lane (#256), Styles naming and the anchor switch (#258), guard moves (#255, #259) and per-popup rules (#261). `ANCHOR_HINT` is removed; no host imported it.
8
+
9
+ ### Added
10
+
11
+ - **The Locations Map reads the group's office list** (Hartes office list, option A, Lewis 2026-10-23). A host that declares a block source for the `Footprint` (the EFFICIENT backend's `group-offices`) adds it to the section's own **Source** row, after "Typed in" and "Dealers": one row, no second row for where the offices come from. The pick is kept in `dataSource` (`resolveData`), where the backend reads it, and "Typed in" or "Dealers" clears it. A published section draws the rows it was served, in the backend's order (the website's own country first); the editor draws two sample offices. **A section never goes blank because the list is empty** (GG 2026-10-23): a source that sends no office (a branch that has not imported the brand yet) leaves the section's own typed offices on the page. A host that declares no source sees the Source row it always saw, and a typed section draws byte for byte what it drew.
12
+ - **An office can link to its country's website.** `FootprintOffice.href` / `linkLabel`, filled only from a served row (`footprintOfficeOfRow`, `lib/content/footprint`; a link that is not an http(s) address is dropped). The tile draws one line "→ Visit the Australia site" in the contact page's accent link style, as a real link laid over the tile's foot, not inside its button. An office with no link draws nothing for it: no "This site", no "No site yet".
13
+ - **Popup rules, one set per popup** (merchant-designed popups, design final 2026-10-23; plan PR 4). `format/lib/popup/behavior`: `resolvePopupBehavior(rootProps)` reads one popup's behaviour from its page's root props, with the stored keys the site popup already uses, and four new ones: `devices` (`all` · `desktop` · `phone`), `afterSubmit` (`stop` · `continue`), `startDate` / `endDate` (`YYYY-MM-DD`). Two answers join existing lists: `showOn: "except"` (Excluded pages) and `hideAfter: "once"` (Once). The default is Every X days, 7, and Stop after a sent form. `format/lib/popup/rules`: `mayAutoOpen`, `pickAutoPopup` (at most ONE popup opens by itself on a page: the first in the list), `markPopupClosed`, `markPopupSent`, the page / device / schedule rules, and per-popup browser keys (`popupStorageKeys`), so closing one popup never hides another. The site popup keeps the keys its visitors already have. Pure, no React. `format/lib/popup/look`: `resolvePopupLook(rootProps)` reads a popup page's frame (`placement`, the Hero's nine anchors; `fullWidth`; `width`; `height` `auto` · `full`; `tintColor` / `tintOpacity`; `outsideClick`; `closeButton` `inside` · `outside` · `none`), and `POPUP_PAGE_KIND = "popup"` marks a popup page a merchant added.
14
+
15
+ ### Changed
16
+
17
+ - **The settings body's end inset is named `--es-insp-pad-end`** (was `--sf-insp-pad-end`; same value: the panel inset less the scrollbar lane). efficient-easel's group band (Lewis 2026-10-14 and 2026-10-23: square, edge to edge) reads this name to reach the panel's right edge without running into the lane. No change on screen until the easel release that reads it; with it, the band stops at the lane, 8px from the right edge, and never makes the body scroll sideways.
18
+ - **The left rail's "Site styles" is now "Styles"** (Lewis 2026-10-13, decisions.md A2c). The rail item, the panel's title and every sentence that points a merchant to it (`Follows Styles ▸ Basics ▸ Corners…`, `from Styles`, `the Text style in Styles`) say one word. Hosts that translate the editor: the catalogue keys with "Site styles" in them are renamed (`Site styles` → `Styles`, and six sentences).
19
+ - **A section's anchor is a switch, a name and a link** (Lewis 2026-10-09, settings item 12). The Anchor band holds `Add an anchor` (a switch); while it is on, a `Name` box and, under it, the section's live link (the site's address, the page, `#name`) on the shell's `Snippet` with its copy button. The always-on sentence under the old `Anchor name` box is gone: the link says what the name is for. Stored data does not change: the switch is on when `anchor` holds a name, and turning it off clears the name. `components/AnchorField`. A template draws no link (it has no page address).
20
+ - `lib/content/subscribe` reads its behaviour through `resolvePopupBehavior`: one reader for every popup. Its `POPUP_TRIGGERS`, `POPUP_SHOW_ON`, `POPUP_HIDE_AFTER` and the ranges are re-exported from `lib/popup/behavior`, so every importer keeps its path. `POPUP_SHOW_ON` gains `except` and `POPUP_HIDE_AFTER` gains `once`; a stored value reads as before.
21
+
22
+ ### Removed
23
+
24
+ - `ANCHOR_HINT` (`lib/puck/controls`): no row draws the sentence now. Nothing outside this package imported it.
25
+
26
+ ### Guards
27
+
28
+ - **`scripts/test-panel-strip-width-stable.ts` no longer reads efficient-easel's tab tiers** (SSOT follow-up to efficient-easel#327, which deletes `SettingsTabs` and its `@container` tiers from `panel.css`). The guard read those tiers to decide which widths change the tabs; with none left it would fail ("declares no `@container` query") as soon as this repo takes that easel release. The strips here are efficient-shell's `Tabs` (`labelsFit` measures the room in the browser), so there is no step width in a sheet to read. The guard now holds the invariant itself: at every saved panel width from 220 to 560px the strip is one width whether the bucket scrolls or not, and the same sweep is red at every width with `scrollbar-gutter: stable` taken out (checked by hand on the real sheet: 2 of 9 tests fail). Removed with the tiers: `readTierThresholds`, `tierOf`, `divergences`, the five sampled band widths and the test that the padding moves those bands. No CSS, no page and no panel changes.
29
+ - New `scripts/test-styles-name-and-anchor.tsx` (red first on main: the rail and panel said `Site styles`, the catalogue held seven `Site styles` phrases, and the anchor was one `Anchor name` box with its hint).
30
+ - New `scripts/test-footprint-group-offices.tsx` (red first: `footprintOfficeOfRow` did not exist on 37.1.0).
31
+ - New `scripts/test-card-style-settings.tsx`: the builder's half of efficient-storefront's guard of the same name, which tested builder code through the compiled package. It holds the card look the builder owns: no round control wears `sf-card`, Corners never publishes `--radius-full`, an untouched site publishes no card attribute or shadow token, each card-look row patches its snake_case key (the shadow colour normalised), the three rows in order with their glyphs and the shadow row's swatch, a 24px corner's card radius, the blog card (`PostCard`) wears `sf-card`, `sf-card-fill` and names `--card-bg`, and six builder card sections wear the surface but not the fill modifier. No source changes. Red check: `sf-card-fill` taken off `PostCard` fails §8b.
32
+ - New `scripts/test-popup-rules.ts`, 19 tests on a fake clock and memory stores (red first: `lib/popup/behavior` did not exist).
33
+
5
34
  ## 37.1.0 - 2026-10-23
6
35
 
7
36
  A MINOR: the website backend carries its shared sections (#251), the site text styles move to the render side (#252), and a Site styles theme card opens and closes with one arrow (#230). Nothing is removed.
@@ -0,0 +1,8 @@
1
+ import { type HidableValue } from "efficient-easel/draw";
2
+ type Props = {
3
+ value: HidableValue;
4
+ onChange: (v: HidableValue) => void;
5
+ nameBox: (value: HidableValue, onChange: (v: HidableValue) => void) => React.ReactNode;
6
+ };
7
+ export default function AnchorField({ value, onChange, nameBox }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ "use client";import{jsx as n,Fragment as f,jsxs as m}from"react/jsx-runtime";import{useContext as p,useEffect as u,useId as g,useState as h}from"react";import{SettingsField as x,SettingsSwitch as S}from"efficient-easel/panel";import{AnchorIcon as k}from"efficient-easel/icons";import{ScreenDocumentContext as b}from"efficient-easel/screen/components/ScreenDocumentContext";import{Snippet as I}from"efficient-shell/ui";import{say as d}from"../../format/lib/editor-words.js";import{anchorPath as A,slugifyAnchor as j}from"../../format/lib/links/page-link-rules.js";import{shopRouteBase as w}from"../../format/lib/web-runtime.js";import{readHidable as F}from"efficient-easel/draw";function N({value:i,onChange:o,nameBox:c}){const s=F(i).text,[l,a]=h(!1),e=l||s.trim()!=="",t=g();return m(f,{children:[n(x,{label:d("Add an anchor"),labelId:t,icon:n(k,{}),action:n(S,{checked:e,ariaLabelledBy:t,onChange:r=>{a(r),!r&&s!==""&&o("")}})}),e&&c(i,o),e&&n(y,{name:s})]})}function y({name:i}){const o=p(b),c=o?.templateId?"":o?.currentSlug??"",[s,l]=h("");u(()=>l(w()||window.location.origin),[]);const a=j(i);if(!a||!c)return null;const e=`${s}${A(c,a)}`,t=e.replace(/^https?:\/\//,""),r=t.lastIndexOf("#");return n("div",{className:"sf-anchor-link",children:n(I,{value:e,label:d("link"),size:"sm",children:m("span",{className:"sf-anchor-link-text",children:[n("span",{className:"sf-anchor-link-path",children:t.slice(0,r)}),n("span",{className:"sf-anchor-link-hash",children:t.slice(r)})]})})})}export{N as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as ne,jsxs as h}from"react/jsx-runtime";import{useContext as qe,useEffect as oe,useRef as Je,useState as Te}from"react";import{PartResetDot as Qe}from"./PartResetDot.js";import{FieldSelect as Ze,InspectorField as et}from"efficient-easel/fields";import{SettingsField as tt}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as nt,TypeIcon as ot}from"efficient-easel/icons";import{useEasel as lt}from"efficient-easel/easel";import{TextPartPanel as st}from"efficient-easel/copy";import{Tooltip as rt}from"efficient-shell/ui";import{PartTextBox as it,partTextCells as at}from"./PartTextBox.js";import{UiIcon as Ne}from"efficient-easel/draw/client";import{usePreviewHeader as ct}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as dt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as ut}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as ft,partStyleToTextStyleValues as pt,pushIntoStyle as mt,resolveTextStyles as ht,styleIdOfRole as yt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as St}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as gt}from"../lib/theme-row-persist.js";import{usePreviewDevice as xt}from"efficient-easel/draw/client";import{usePartStyle as bt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as U,textFieldOffPage as Pt,textFieldPanelOnly as wt}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as vt}from"efficient-easel/draw";import{useSectionOps as Tt}from"efficient-easel/screen/lib/puck/use-section-ops";import{FONT_OPTIONS as Nt,FONT_ROLES as Ce,FONT_ROLE_LABELS as ke,fontOption as le}from"../../format/lib/fonts.js";import{isMultilineKind as Ct,partPlaceholder as kt,typeInPlaceKind as Ot}from"../../render/lib/puck/part-text.js";import{partRowField as Rt}from"../lib/puck/part-row-field.js";import{decodePartKey as It,partPropsWithRowValue as Et,partRowValue as Ft}from"../../render/lib/puck/part-rows.js";import{PART_WIDTH_MAX as _t,followedStyleOf as zt,propsWithPartStyleValue as E,propsWithoutPartStyle as At,readPartStyle as Oe}from"../../render/lib/puck/part-styles.js";import{partThemeColors as Vt}from"../../format/lib/puck/part-inks.js";import{styleKeyForPart as Lt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as Kt}from"../lib/puck/part-typing.js";import{keysOnCanvas as Ut,useCanvasTypingPart as Bt}from"../lib/puck/canvas-typing.js";import{useEaselHost as Dt}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as Wt,SOURCE_ACTIONS as Mt,SOURCE_ACTION_LABEL as jt,partSourceNoteFor as Gt,partSourceOf as Ht,sourceMenuIdOf as $t,sourceSlugOf as Re}from"../../format/lib/puck/source-bound-parts.js";import{encodePartId as Xt,holdsAuthoredText as Yt}from"../../render/lib/puck/text-parts.js";import{regionsForSection as qt}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as Jt}from"../../format/lib/sections/text-regions.js";function se(n){return n?l(n):null}function Ie(n){return n.kind==="role"?ke[n.role]:n.kind==="custom"?"Custom":null}function Qt(n){const o=n.role;return o&&Ce.includes(o)?{kind:"role",role:o}:null}function Zt(n,o){if(!n)return{kind:"unread"};const{faceRole:s,base:i}=n;if(o[s]===i.fontKey)return{kind:"role",role:s};const c=Object.keys(o).filter(r=>o[r]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function re(n,o,s,i){return Qt(Oe(n,o))??Zt(s,i)}function en(n,o){if(!n.length)return null;const s=o(n[0]);return n.every(i=>o(i)===s)?s:null}const B="";function tn({face:n,base:o,onPick:s}){const i=n.kind==="role"?n.role:B,c=[{label:l("No style"),value:B},...Ce.map(r=>({label:l(ke[r]),value:r}))];return t(Ze,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:r=>s(r===B?null:r),renderOption:r=>r.value===B?h(ne,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${le(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:se(Ie(n))}),valueText:r=>se(Ie(n))??r?.label??""})}function nn({sectionName:n,onBack:o,textEditor:s,styleRow:i,children:c}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:l(n),onSelect:o}),s,i,c]})}function Ee({source:n,slug:o,menuId:s}){const i=Dt(),c=Mt[n],r=!c.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[l(Wt[n]),r?h(ne,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:s??null}):o&&i.send(c.type,{slug:o})},children:l(jt)})]}):null]})})}const Fe=4,on=120;function ln({region:n,sizePx:o,face:s,base:i,onFollowStyle:c,source:r,slug:D,onBack:v}){const F=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l(n.label)})}),t("p",{children:o?l("Its size follows Site styles ▸ {follows} — {px}px right now.",{follows:l(F),px:Math.round(o)}):l("Its size follows Site styles ▸ {follows}.",{follows:l(F)})}),c?t(ne,{children:t(tt,{label:l("Style"),icon:t(nt,{}),hint:l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(n.label).toLowerCase()}),children:t(tn,{face:s,base:i,onPick:c})})}):t("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r?t(Ee,{source:r,slug:D}):null,t(K,{inline:!0,name:l("Page"),onSelect:v})]})}function sn({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part is no longer here.")})}),t("p",{children:l("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:l("Page"),onSelect:n})]})}function rn({onBack:n,partId:o,why:s}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part's settings did not open.")})}),t("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",s]})}),t(K,{inline:!0,name:l("Page"),onSelect:n})]})}function an({nodeId:n,propKey:o,onBack:s,onEditStyle:i}){const{getItemById:c,getSelectorForId:r,config:D}=lt(e=>e),v=Tt(),F=Bt(),{partStyle:_}=bt(),{fonts:W,textStyles:_e}=ct(),M=qe(ut),ie=!M?.capabilities?.hasSiteTheme,{persist:ze}=gt({themeFromDocument:ie,tokenRef:M?.tokenRef,siteId:M?.siteId??null}),R=St({themeFromDocument:ie,persist:ze}),[Ae,j]=Te(!1),Ve=xt()==="mobile",ae=Je(null),d=c(n),m=r(n),ce=d?D.components[d.type]:void 0,{key:S,row:g}=It(o),de=ce?.fields?.[S],y=g?Rt(de,g):de,T=Xt(n,o),p=d?.props??{},x=Ot(y),ue=Pt(y),fe=Yt(y),Le=d?Ht(d.type):null,pe=d?Gt(d.type,S):null,G=g?Ft(p[S],g):p[S],me=!!g&&!(Array.isArray(p[S])&&g.index<p[S].length);oe(()=>{if(Ut(document))return;ae.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[T]);const[H,he]=Te(0);oe(()=>he(0),[T]);const $=!!d&&!me&&(!m||!y);oe(()=>{if(!$||H>=Fe)return;const e=setTimeout(()=>he(a=>a+1),on);return()=>clearTimeout(e)},[$,H]);const Ke=$&&H<Fe;if(!d||me)return t(sn,{onBack:s});const z=qt(d.type),ye=z?Jt(z,o):null;if(z&&ye){const e=_?.partId===T?_:null,a=z[ye],f=a.writable===!0&&!!m,b=te=>{m&&v.replaceComponent(m.zone,m.index,{...d,props:E(p,o,"role",te)})};return t(ln,{region:a,sizePx:e?.base.sizePx??null,face:re(p,o,e,W),base:e?.base??null,onFollowStyle:f?b:void 0,source:Le,slug:Re(p),onBack:s})}if(!m||!y)return Ke?t("div",{className:"sf-note","aria-busy":"true"}):t(rn,{onBack:s,partId:T,why:m?"no field":"no selector"});const Se=e=>{v.replaceComponent(m.zone,m.index,{...d,props:e})},X=e=>{if(U(e).hidden!==U(G).hidden||!x){const f=g?Et(p,S,g,e):{...p,[S]:e};f&&Se(f);return}Kt({node:d,propKey:o,kind:x,zone:m.zone,index:m.index},U(e).text,v.replaceComponent)},Ue=G,N=_?.partId===T?_:null,C=N?.styleOwner,A=C?c(C.owner):null,Y=C&&A?r(C.owner):null,q=!!(C&&A&&Y),k=q?A.props??{}:p,J=q?e=>v.replaceComponent(Y.zone,Y.index,{...A,props:e}):Se,V=q?C.kind:Lt(d?.type,o),P=Oe(k,V),u=[{partKey:V,face:re(k,V,N,W),sizeGroup:N?.sizeGroup??null,base:N?.base??dn,style:P}],Be=en(u,e=>e.sizeGroup),De=Vt(N?.inks),I=(e,a)=>{let f=k;for(const b of u)f=E(f,b.partKey,e,a);J(f)},We=e=>e?I("textStyle",e):Q({textStyle:null,role:null}),Q=e=>{let a=k;for(const f of u)for(const[b,te]of Object.entries(e))a=E(a,f.partKey,b,te??null);J(a)},Z=x==="text"||x==="textarea",{text:ge,hidden:O}=U(G),L=y?.[vt]?.label??o,xe=O?l("Show {label} on the slide",{label:l(L)}):l("Hide {label} on the slide",{label:l(L)}),be=h("div",{className:"sf-field-head",children:[t(ot,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:l(L)}),Z&&t(rt,{content:xe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":O,"aria-label":xe,onClick:()=>X({text:ge,hidden:!O}),children:O?t(Ne,{name:"eye-off",size:14}):t(Ne,{name:"eye",size:14})})})]}),Pe=!ue&&fe,Me=!!x&&(wt(y)||ue||O||!fe),we=re(k,V,N,W),je=we.kind==="role"?we.role:null,ee=zt(P)??yt(je),ve=ht(R.saved,R.old),Ge=Object.entries(P).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,He=()=>{let e=k;for(const a of u){const{role:f,textStyle:b}=a.style;e=At(e,a.partKey),f&&(e=E(e,a.partKey,"role",f)),b&&(e=E(e,a.partKey,"textStyle",b))}J(e)},w=ee,$e=ft(u[0].style),Xe=w?ve.find(e=>e.id===w)?.name??w:"",Ye=()=>{j(!1),w&&(R.write(mt({saved:R.saved,old:R.old,styleId:w,values:pt(u[0].style)}),!0),He())};return h(nn,{sectionName:ce?.label??d.type,onBack:s,textEditor:t("div",{ref:ae,className:"sf-part-text",children:Me?t(it,{text:ge,onTextChange:e=>X(Z?{text:e,hidden:O}:e),multiline:Ct(x),markup:x!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:Q,colors:De,placeholder:se(kt(y))??void 0,ariaLabel:l(L),head:be,typedOnCanvas:F===T}):x?Z?be:null:t(et,{field:y,name:o,value:Ue,onChange:X,id:`sf-part-${n}-${o}`})}),children:[pe&&t(Ee,{source:pe,slug:Re(p),menuId:$t(p)}),Pe&&t(st,{style:{value:ee??"",options:[{value:"",label:l("No style"),description:l("Section’s own")},...ve.map(e=>({value:e.id,label:e.name,description:e.values.font?le(e.values.font)?.label:void 0}))],onChange:e=>We(e||null),changed:Ge>0,onEditStyles:i,onUpdateStyle:w&&$e?()=>j(!0):void 0},font:{value:P.font??"",styleValue:le(u[0].base.fontKey)?.label,options:Nt.map(e=>({label:e.label,value:e.key})),onChange:e=>I("font",e||null)},italic:{value:P.italic,styleValue:cn(_e,ee),onChange:e=>I("italic",e??null)},cells:at(u[0].style,u[0].base,Q,{phone:Ve}),align:{value:P.align??"",styleValue:u[0].base.align,onChange:e=>I("align",e||null)},letterCase:{value:P.case??"",styleValue:u[0].base.case,onChange:e=>I("case",e||null)}}),Ae&&w&&t(dt,{styleName:Xe,onCancel:()=>j(!1),onConfirm:Ye}),Pe&&Be===null&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function cn(n,o){return!o||!Array.isArray(n)?!1:n.find(i=>i?.id===o)?.values?.italic===!0}const dn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:_t};export{nn as PartPanelBody,Qe as PartResetDot,Ee as PartSourceNote,tn as PartStyleSelect,an as default,re as partFace};
1
+ "use client";import{jsx as t,Fragment as ne,jsxs as h}from"react/jsx-runtime";import{useContext as qe,useEffect as oe,useRef as Je,useState as Te}from"react";import{PartResetDot as Qe}from"./PartResetDot.js";import{FieldSelect as Ze,InspectorField as et}from"efficient-easel/fields";import{SettingsField as tt}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as nt,TypeIcon as ot}from"efficient-easel/icons";import{useEasel as lt}from"efficient-easel/easel";import{TextPartPanel as st}from"efficient-easel/copy";import{Tooltip as rt}from"efficient-shell/ui";import{PartTextBox as it,partTextCells as at}from"./PartTextBox.js";import{UiIcon as Ne}from"efficient-easel/draw/client";import{usePreviewHeader as ct}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as dt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as ut}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as ft,partStyleToTextStyleValues as pt,pushIntoStyle as mt,resolveTextStyles as ht,styleIdOfRole as yt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as St}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as gt}from"../lib/theme-row-persist.js";import{usePreviewDevice as xt}from"efficient-easel/draw/client";import{usePartStyle as bt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as U,textFieldOffPage as Pt,textFieldPanelOnly as wt}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as vt}from"efficient-easel/draw";import{useSectionOps as Tt}from"efficient-easel/screen/lib/puck/use-section-ops";import{FONT_OPTIONS as Nt,FONT_ROLES as Ce,FONT_ROLE_LABELS as ke,fontOption as le}from"../../format/lib/fonts.js";import{isMultilineKind as Ct,partPlaceholder as kt,typeInPlaceKind as Ot}from"../../render/lib/puck/part-text.js";import{partRowField as Rt}from"../lib/puck/part-row-field.js";import{decodePartKey as It,partPropsWithRowValue as Et,partRowValue as Ft}from"../../render/lib/puck/part-rows.js";import{PART_WIDTH_MAX as _t,followedStyleOf as zt,propsWithPartStyleValue as E,propsWithoutPartStyle as At,readPartStyle as Oe}from"../../render/lib/puck/part-styles.js";import{partThemeColors as Vt}from"../../format/lib/puck/part-inks.js";import{styleKeyForPart as Lt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as Kt}from"../lib/puck/part-typing.js";import{keysOnCanvas as Ut,useCanvasTypingPart as Bt}from"../lib/puck/canvas-typing.js";import{useEaselHost as Dt}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as Wt,SOURCE_ACTIONS as Mt,SOURCE_ACTION_LABEL as jt,partSourceNoteFor as Gt,partSourceOf as Ht,sourceMenuIdOf as $t,sourceSlugOf as Re}from"../../format/lib/puck/source-bound-parts.js";import{encodePartId as Xt,holdsAuthoredText as Yt}from"../../render/lib/puck/text-parts.js";import{regionsForSection as qt}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as Jt}from"../../format/lib/sections/text-regions.js";function se(n){return n?l(n):null}function Ie(n){return n.kind==="role"?ke[n.role]:n.kind==="custom"?"Custom":null}function Qt(n){const o=n.role;return o&&Ce.includes(o)?{kind:"role",role:o}:null}function Zt(n,o){if(!n)return{kind:"unread"};const{faceRole:s,base:i}=n;if(o[s]===i.fontKey)return{kind:"role",role:s};const c=Object.keys(o).filter(r=>o[r]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function re(n,o,s,i){return Qt(Oe(n,o))??Zt(s,i)}function en(n,o){if(!n.length)return null;const s=o(n[0]);return n.every(i=>o(i)===s)?s:null}const B="";function tn({face:n,base:o,onPick:s}){const i=n.kind==="role"?n.role:B,c=[{label:l("No style"),value:B},...Ce.map(r=>({label:l(ke[r]),value:r}))];return t(Ze,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:r=>s(r===B?null:r),renderOption:r=>r.value===B?h(ne,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${le(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:se(Ie(n))}),valueText:r=>se(Ie(n))??r?.label??""})}function nn({sectionName:n,onBack:o,textEditor:s,styleRow:i,children:c}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:l(n),onSelect:o}),s,i,c]})}function Ee({source:n,slug:o,menuId:s}){const i=Dt(),c=Mt[n],r=!c.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[l(Wt[n]),r?h(ne,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:s??null}):o&&i.send(c.type,{slug:o})},children:l(jt)})]}):null]})})}const Fe=4,on=120;function ln({region:n,sizePx:o,face:s,base:i,onFollowStyle:c,source:r,slug:D,onBack:v}){const F=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l(n.label)})}),t("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(F),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(F)})}),c?t(ne,{children:t(tt,{label:l("Style"),icon:t(nt,{}),hint:l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(n.label).toLowerCase()}),children:t(tn,{face:s,base:i,onPick:c})})}):t("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r?t(Ee,{source:r,slug:D}):null,t(K,{inline:!0,name:l("Page"),onSelect:v})]})}function sn({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part is no longer here.")})}),t("p",{children:l("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:l("Page"),onSelect:n})]})}function rn({onBack:n,partId:o,why:s}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part's settings did not open.")})}),t("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",s]})}),t(K,{inline:!0,name:l("Page"),onSelect:n})]})}function an({nodeId:n,propKey:o,onBack:s,onEditStyle:i}){const{getItemById:c,getSelectorForId:r,config:D}=lt(e=>e),v=Tt(),F=Bt(),{partStyle:_}=bt(),{fonts:W,textStyles:_e}=ct(),M=qe(ut),ie=!M?.capabilities?.hasSiteTheme,{persist:ze}=gt({themeFromDocument:ie,tokenRef:M?.tokenRef,siteId:M?.siteId??null}),R=St({themeFromDocument:ie,persist:ze}),[Ae,j]=Te(!1),Ve=xt()==="mobile",ae=Je(null),d=c(n),m=r(n),ce=d?D.components[d.type]:void 0,{key:S,row:g}=It(o),de=ce?.fields?.[S],y=g?Rt(de,g):de,T=Xt(n,o),p=d?.props??{},x=Ot(y),ue=Pt(y),fe=Yt(y),Le=d?Ht(d.type):null,pe=d?Gt(d.type,S):null,G=g?Ft(p[S],g):p[S],me=!!g&&!(Array.isArray(p[S])&&g.index<p[S].length);oe(()=>{if(Ut(document))return;ae.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[T]);const[H,he]=Te(0);oe(()=>he(0),[T]);const $=!!d&&!me&&(!m||!y);oe(()=>{if(!$||H>=Fe)return;const e=setTimeout(()=>he(a=>a+1),on);return()=>clearTimeout(e)},[$,H]);const Ke=$&&H<Fe;if(!d||me)return t(sn,{onBack:s});const z=qt(d.type),ye=z?Jt(z,o):null;if(z&&ye){const e=_?.partId===T?_:null,a=z[ye],f=a.writable===!0&&!!m,b=te=>{m&&v.replaceComponent(m.zone,m.index,{...d,props:E(p,o,"role",te)})};return t(ln,{region:a,sizePx:e?.base.sizePx??null,face:re(p,o,e,W),base:e?.base??null,onFollowStyle:f?b:void 0,source:Le,slug:Re(p),onBack:s})}if(!m||!y)return Ke?t("div",{className:"sf-note","aria-busy":"true"}):t(rn,{onBack:s,partId:T,why:m?"no field":"no selector"});const Se=e=>{v.replaceComponent(m.zone,m.index,{...d,props:e})},X=e=>{if(U(e).hidden!==U(G).hidden||!x){const f=g?Et(p,S,g,e):{...p,[S]:e};f&&Se(f);return}Kt({node:d,propKey:o,kind:x,zone:m.zone,index:m.index},U(e).text,v.replaceComponent)},Ue=G,N=_?.partId===T?_:null,C=N?.styleOwner,A=C?c(C.owner):null,Y=C&&A?r(C.owner):null,q=!!(C&&A&&Y),k=q?A.props??{}:p,J=q?e=>v.replaceComponent(Y.zone,Y.index,{...A,props:e}):Se,V=q?C.kind:Lt(d?.type,o),P=Oe(k,V),u=[{partKey:V,face:re(k,V,N,W),sizeGroup:N?.sizeGroup??null,base:N?.base??dn,style:P}],Be=en(u,e=>e.sizeGroup),De=Vt(N?.inks),I=(e,a)=>{let f=k;for(const b of u)f=E(f,b.partKey,e,a);J(f)},We=e=>e?I("textStyle",e):Q({textStyle:null,role:null}),Q=e=>{let a=k;for(const f of u)for(const[b,te]of Object.entries(e))a=E(a,f.partKey,b,te??null);J(a)},Z=x==="text"||x==="textarea",{text:ge,hidden:O}=U(G),L=y?.[vt]?.label??o,xe=O?l("Show {label} on the slide",{label:l(L)}):l("Hide {label} on the slide",{label:l(L)}),be=h("div",{className:"sf-field-head",children:[t(ot,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:l(L)}),Z&&t(rt,{content:xe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":O,"aria-label":xe,onClick:()=>X({text:ge,hidden:!O}),children:O?t(Ne,{name:"eye-off",size:14}):t(Ne,{name:"eye",size:14})})})]}),Pe=!ue&&fe,Me=!!x&&(wt(y)||ue||O||!fe),we=re(k,V,N,W),je=we.kind==="role"?we.role:null,ee=zt(P)??yt(je),ve=ht(R.saved,R.old),Ge=Object.entries(P).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,He=()=>{let e=k;for(const a of u){const{role:f,textStyle:b}=a.style;e=At(e,a.partKey),f&&(e=E(e,a.partKey,"role",f)),b&&(e=E(e,a.partKey,"textStyle",b))}J(e)},w=ee,$e=ft(u[0].style),Xe=w?ve.find(e=>e.id===w)?.name??w:"",Ye=()=>{j(!1),w&&(R.write(mt({saved:R.saved,old:R.old,styleId:w,values:pt(u[0].style)}),!0),He())};return h(nn,{sectionName:ce?.label??d.type,onBack:s,textEditor:t("div",{ref:ae,className:"sf-part-text",children:Me?t(it,{text:ge,onTextChange:e=>X(Z?{text:e,hidden:O}:e),multiline:Ct(x),markup:x!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:Q,colors:De,placeholder:se(kt(y))??void 0,ariaLabel:l(L),head:be,typedOnCanvas:F===T}):x?Z?be:null:t(et,{field:y,name:o,value:Ue,onChange:X,id:`sf-part-${n}-${o}`})}),children:[pe&&t(Ee,{source:pe,slug:Re(p),menuId:$t(p)}),Pe&&t(st,{style:{value:ee??"",options:[{value:"",label:l("No style"),description:l("Section’s own")},...ve.map(e=>({value:e.id,label:e.name,description:e.values.font?le(e.values.font)?.label:void 0}))],onChange:e=>We(e||null),changed:Ge>0,onEditStyles:i,onUpdateStyle:w&&$e?()=>j(!0):void 0},font:{value:P.font??"",styleValue:le(u[0].base.fontKey)?.label,options:Nt.map(e=>({label:e.label,value:e.key})),onChange:e=>I("font",e||null)},italic:{value:P.italic,styleValue:cn(_e,ee),onChange:e=>I("italic",e??null)},cells:at(u[0].style,u[0].base,Q,{phone:Ve}),align:{value:P.align??"",styleValue:u[0].base.align,onChange:e=>I("align",e||null)},letterCase:{value:P.case??"",styleValue:u[0].base.case,onChange:e=>I("case",e||null)}}),Ae&&w&&t(dt,{styleName:Xe,onCancel:()=>j(!1),onConfirm:Ye}),Pe&&Be===null&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function cn(n,o){return!o||!Array.isArray(n)?!1:n.find(i=>i?.id===o)?.values?.italic===!0}const dn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:_t};export{nn as PartPanelBody,Qe as PartResetDot,Ee as PartSourceNote,tn as PartStyleSelect,an as default,re as partFace};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import c,{useWebsiteName as f}from"./WebsiteSettingsPanel.js";import d from"efficient-easel/screen/components/SidePanelHead";import{say as s}from"../../format/lib/editor-words.js";import{StylesIcon as p}from"efficient-easel/rail";import{Tooltip as y}from"efficient-shell/ui";function S({tokenRef:n,siteId:o,onClose:i,onNotify:a,tab:l,onTabChange:m}){const t=f();return r("div",{className:"sf-styles",children:[e(d,{icon:e(p,{}),title:s("Site styles"),context:e(y,{content:s("{name} — renamed in the Console: {place}.",{name:t,place:s("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:e("span",{className:"sf-name-text",children:t})}),onHide:i}),e("div",{className:"sf-insp-body es-insp-body sf-scroll",children:e(c,{tokenRef:n,siteId:o,onNotify:a,tab:l,onTabChange:m})})]})}export{S as default};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import c,{useWebsiteName as f}from"./WebsiteSettingsPanel.js";import d from"efficient-easel/screen/components/SidePanelHead";import{say as s}from"../../format/lib/editor-words.js";import{StylesIcon as p}from"efficient-easel/rail";import{Tooltip as y}from"efficient-shell/ui";function S({tokenRef:n,siteId:o,onClose:i,onNotify:a,tab:l,onTabChange:m}){const t=f();return r("div",{className:"sf-styles",children:[e(d,{icon:e(p,{}),title:s("Styles"),context:e(y,{content:s("{name} — renamed in the Console: {place}.",{name:t,place:s("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:e("span",{className:"sf-name-text",children:t})}),onHide:i}),e("div",{className:"sf-insp-body es-insp-body sf-scroll",children:e(c,{tokenRef:n,siteId:o,onNotify:a,tab:l,onTabChange:m})})]})}export{S as default};
@@ -1 +1 @@
1
- "use client";import{jsx as i,Fragment as B,jsxs as _}from"react/jsx-runtime";import{useCallback as C,useEffect as P,useRef as oe,useState as re}from"react";import{Button as ne,Tooltip as ie}from"efficient-shell/ui";import{SettingsSwitch as se}from"efficient-easel/panel";import{PagesIcon as ae,StylesIcon as ce}from"efficient-easel/rail";import{PaletteIcon as de}from"efficient-shell/icons/efficient";import{TemplateIcon as le}from"efficient-easel/icons";import{Subtree as pe,TreeRow as y}from"efficient-easel/tree";import{useEasel as H}from"efficient-easel/easel";import{useEaselStrings as N}from"efficient-easel/strings";import{LocationsTreeContext as me}from"./LocationsTreeContext.js";import fe from"./PagesPanel.js";import{usePreviewChat as ue}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as Se}from"./preview-devices.js";import{PreviewDeviceContext as he}from"efficient-easel/draw/client";import{usePreviewHeader as Ee}from"../../render/components/PreviewHeaderContext.js";import{usePreviewSocial as we}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Te}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Pe,usePreviewTicker as be}from"../../render/components/PreviewTickerContext.js";import{usePreviewHeroPart as ge}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ie,HERO_PART_MODE as D,heroMediaRows as ve,heroPartId as W,readHeroPartId as ke}from"../../render/lib/puck/hero-media-parts.js";import _e,{CHAT_MODE as Ce,HEADER_MODE as V,SOCIAL_MODE as Re,WEBSITE_MODE as M}from"./SectionEditor.js";import R from"./SectionIcon.js";import Le from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import Oe from"./StylesPanel.js";import{LOCATIONS_TYPE as Ae,useLocationsTree as Be}from"./useLocationsTree.js";import{usePinnedChromeSeed as ye}from"./usePinnedChromeSeed.js";import{usePreviewHref as He}from"./usePreviewHref.js";import{WebsitePreviewButton as Ne}from"./WebsitePreviewButton.js";import{SITE_STYLES_TABS as De,SITE_STYLES_TEXT_TAB as We,useWebsiteName as Ve}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Me}from"./useWebsiteMainAction.js";import{VersionHistory as xe}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Ye}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Fe,heroGroupNestDepth as Ge}from"../../format/lib/hero-group-placement.js";import{stripMarkup as ze}from"../../format/lib/markup.js";import{categoryShortLabel as Ke,PINNED_SECTION_TYPE as je}from"../lib/puck/add-palette.js";import{canAddTo as Ue}from"../lib/puck/add-target.js";import{blockIsOffered as Ze}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as qe,setBookingPreview as Xe}from"../../render/lib/puck/booking-preview.js";import{footerBlockRowName as Je}from"../../format/lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as Qe,HEADER_TYPE as Y}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as $e,readLeftView as et,resolveLeftView as tt,writeLeftView as ot}from"../../format/lib/puck/left-view.js";import{websiteIsLockedBlock as rt}from"../lib/puck/locked-blocks.js";import{everyPageNotice as nt,noOwnTab as it,pinnedReach as F,websiteDuplicateBlocked as st}from"../lib/puck/every-page.js";import{sharedSectionReach as at,WEBSITE_SHARED_SECTIONS as ct}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as G}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as dt}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as lt,scrollPreviewToTop as z}from"efficient-easel/screen/lib/puck/preview-dom";import{SiteCanvas as pt}from"../lib/puck/overrides.js";import{labelAtLevel as mt}from"../../format/lib/puck/section-catalog.js";import{editorWords as ft,say as p}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ut}from"../../format/lib/puck/section-descriptions.js";import{groupAccepts as St,isSectionGroupType as ht,sectionGroupZone as Et,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as wt}from"../../format/lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as Tt,SAVE_AS_TEMPLATE_EVENT as Pt}from"../../format/lib/save-as-template-action.js";import{newSectionNode as bt}from"../lib/sections/new-section-node.js";import{useHostProducts as gt}from"../lib/use-host-products.js";import{backendOf as It}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=be(),c=N().tree,d=e,n=d.kind==="ticker"?d.heroId:null,a=C(s=>{if(!s)return;t({kind:"ticker",heroId:s}),lt(s)},[t]);return P(()=>{o(n)},[n,o]),P(()=>{r(a)},[r,a]),{partRows:(s,{rowClick:u})=>{const m=String(s.props.id);return s.type==="Hero"&&i(y,{icon:i(R,{type:"ticker",size:13}),name:p(Pe),onSelect:()=>a(m),selected:n===m,rowProps:{onClick:u(()=>a(m))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=ge(),c=N().tree,{appState:d}=H(f=>f),n=d.data.content??[],a=oe(n);a.current=n;const s=e,u=Ie.find(f=>D[f]===s.kind),m=u&&"nodeId"in s?W(String(s.nodeId),u):null,E=C(f=>{const l=ke(f);if(!l)return;const w=a.current.findIndex(S=>String(S.props.id)===l.nodeId);if(w<0)return;const b={kind:D[l.part],nodeId:l.nodeId};t({index:w},b)},[t]);return P(()=>{o(m)},[m,o]),P(()=>{r(E)},[r,E]),{partRows:(f,{rowClick:l})=>{const w=String(f.props.id),b=ve(f);if(b.length===0)return null;const S=I=>{const g=W(w,I.part);return i(y,{icon:i(R,{type:I.part==="media"?"heroMedia":"heroImage",size:13}),name:p(I.label),onSelect:()=>E(g),selected:m===g,rowProps:{onClick:l(()=>E(g))},words:c},g)},[h,...T]=b;return _(B,{children:[S(h),T.length>0&&i(pe,{children:T.map(S)})]})}}}function Z(e,t){return{partRows:(o,r)=>_(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function vt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:a,notifyParent:s,token:u}=L(),{hasPreviewLink:m}=o,E=It(x()).preview?.draftLink,f=Me(e.data),l=Tt({hasTrustedConsole:!!u,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),w=C(()=>{!c||!r||s(Pt,{siteId:c,slug:r})},[s,c,r]),b=He({pageSlug:r,siteId:c,token:u}),S=t.previewHref?.(r)??b;return{barLead:()=>l.visible&&i(ie,{side:"bottom",content:l.enabled?p("Save this website as a platform template"):p(l.disabledReason),children:i("span",{className:"sf-tip-disabled",tabIndex:l.enabled?void 0:0,children:i(ne,{variant:"secondary",disabled:!l.enabled,onClick:w,rightIcon:i(le,{size:15}),children:p("Save as Template")})})}),barTrail:()=>m&&r&&i(Ne,{liveHref:S,pageId:d??null,draftLink:E}),mainAction:f}}function kt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:a,explainsSiteSettings:s}=o,u=h=>t.setView(h),[m,E]=re(De[0].id),{surface:f,setSurface:l}=Te(),w=()=>{if(a){u("styles"),t.reveal(),z();return}e.show(M),e.reveal(),z()},b={id:"pages",label:p("Pages"),icon:i(ae,{}),panel:({onHide:h})=>i(fe,{activeSurface:f,onPreviewSurface:l,onNavigate:T=>{l(null),n(r?{kind:"template",id:r,pageSlug:T}:{kind:"page",slug:T,siteId:c??void 0})},onClose:h})},S=[];return!a&&s&&S.push({id:"appearance",label:p("Appearance"),icon:i(de,{}),active:e.kind==="website",onSelect:w}),a&&S.push({id:"styles",label:p("Site styles"),icon:i(ce,{}),panel:({onHide:h,notify:T})=>i(Oe,{tokenRef:d,siteId:c??void 0,onClose:h,onNotify:T,tab:m,onTabChange:E})}),{railLead:[b],railTrail:S,resolveLeftView:(h,T)=>tt(h,a,T),openSettings:w,openStyles:()=>{E(We),u("styles")}}}function _t(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=H(n=>n.config),d=x();P(()=>(G({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>G(null)),[e,t,o,c]),P(()=>{const n=O();if(!n||!r)return;let a=!1;return dt(d).list().then(s=>{a||n.learn(s)}).catch(()=>{}),()=>{a=!0}},[r,d])}function Ct(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:a}=t;P(()=>{Xe(n?.type==="BookingBox"&&n.props.region==="confirm"?qe(a(String(n.props.id))):null)},[n?.props.id]);const s=Be(e,t),{capabilities:{hasSiteSettings:u}}=L();_t();const{setSelected:m,setSelectHandler:E}=Ee(),{chat:f,setChat:l,setSelected:w,setSelectHandler:b}=ue(),S=c==="header";P(()=>{m(S)},[S,m]),P(()=>{E(()=>d(V))},[E,d]);const h=C(()=>d(Ce),[d]),T=c==="chat";P(()=>{w(T)},[T,w]),P(()=>{b(h)},[b,h]);const{setOpenHandler:I}=we(),g=C(()=>d(Re),[d]);P(()=>{I(g)},[I,g]);const J=Z(j(e),U(e)),Q=vt(t),$=kt(e,r),ee=o.device;return{...J,...Q,...$,hasOwnRows:k=>k.type===Ae,ownRows:s.renderLocationTree,sectionPressed:s.sectionPressed,wrap:k=>i(me.Provider,{value:!0,children:_(he.Provider,{value:ee,children:[k,i(xe,{})]})}),addPanelRow:k=>u?_("div",{className:"sf-addside-sitewide",children:[i("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:i(R,{type:"chat",size:16})}),_("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),h()},children:[p("Live chat"),i("span",{className:"sf-addside-sitewide-desc",children:p("A chat bubble on every page")})]}),i(se,{checked:f.enabled,onChange:te=>l({enabled:te}),ariaLabel:p("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function Rt(e){const t=ft();if(!e||!t)return e;q!==t&&(q=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:p(r.label)})):null,spec:e.spec?{...e.spec,addLabel:p(e.spec.addLabel)}:null},A.set(e,o)),o}const Lt={isLockedBlock:(e,t)=>rt(e)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:st,nestDepth:(e,t,o)=>t===Fe?Ge(e,o):0,newSectionNode:bt,canAddTo:(e,t)=>Rt(Ue(e,t)),blockIsOffered:Ze},Ot=new Proxy(ut,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?p(o):o}}),At={labelAtLevel:(e,t,o)=>p(mt(e,t,o)),descriptions:Ot,categoryLabel:e=>{const t=Ke(e);return t===void 0?void 0:p(t)},firstSection:je,blockRowName:Je,plainText:ze,Icon:R,Thumbnail:Le,useProducts:gt},Bt={desktop:2e3,tablet:800,mobile:390},X="desktop",yt={options:Se,initial:X,fluid:X,widths:Bt},Ht={read:et,write:e=>ot(e),forSelection:(e,t)=>$e(e,t)},Nt={first:Y,last:Qe,firstGroup:wt,lastGroup:K,isSectionGroup:ht,sectionGroupZone:Et,panelOf:e=>e===Y?V:null,get sharedReach(){return v()?Wt:void 0},get shared(){return O()?ct:void 0},get groupTab(){return v()?it:void 0},get groupBadge(){return v()?F({type:K})??void 0:void 0},get changeNotice(){return v()?nt():void 0},get band(){return v()?Dt:void 0},get groupAccepts(){return v()?St:void 0}},Dt={foldable:!0},Wt=e=>F(e)??at(e);function Vt(e){return{...Z(j(e),U(e)),openSettings:()=>e.show(M)}}const jo={useOwnerName:Ve,useDocumentLabel:Ye,useBridges:Ct,useStandaloneBridges:Vt,useDocumentPass:ye,blockRules:Lt,blockLook:At,devices:yt,leftView:Ht,pinned:Nt,Canvas:pt,Inspector:_e};export{jo as WEBSITE_SCREEN};
1
+ "use client";import{jsx as i,Fragment as B,jsxs as _}from"react/jsx-runtime";import{useCallback as C,useEffect as P,useRef as oe,useState as re}from"react";import{Button as ne,Tooltip as ie}from"efficient-shell/ui";import{SettingsSwitch as se}from"efficient-easel/panel";import{PagesIcon as ae,StylesIcon as ce}from"efficient-easel/rail";import{PaletteIcon as de}from"efficient-shell/icons/efficient";import{TemplateIcon as le}from"efficient-easel/icons";import{Subtree as pe,TreeRow as y}from"efficient-easel/tree";import{useEasel as H}from"efficient-easel/easel";import{useEaselStrings as N}from"efficient-easel/strings";import{LocationsTreeContext as me}from"./LocationsTreeContext.js";import fe from"./PagesPanel.js";import{usePreviewChat as ue}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as Se}from"./preview-devices.js";import{PreviewDeviceContext as he}from"efficient-easel/draw/client";import{usePreviewHeader as Ee}from"../../render/components/PreviewHeaderContext.js";import{usePreviewSocial as we}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Te}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Pe,usePreviewTicker as be}from"../../render/components/PreviewTickerContext.js";import{usePreviewHeroPart as ge}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ie,HERO_PART_MODE as D,heroMediaRows as ve,heroPartId as W,readHeroPartId as ke}from"../../render/lib/puck/hero-media-parts.js";import _e,{CHAT_MODE as Ce,HEADER_MODE as V,SOCIAL_MODE as Re,WEBSITE_MODE as M}from"./SectionEditor.js";import R from"./SectionIcon.js";import Le from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import Oe from"./StylesPanel.js";import{LOCATIONS_TYPE as Ae,useLocationsTree as Be}from"./useLocationsTree.js";import{usePinnedChromeSeed as ye}from"./usePinnedChromeSeed.js";import{usePreviewHref as He}from"./usePreviewHref.js";import{WebsitePreviewButton as Ne}from"./WebsitePreviewButton.js";import{SITE_STYLES_TABS as De,SITE_STYLES_TEXT_TAB as We,useWebsiteName as Ve}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Me}from"./useWebsiteMainAction.js";import{VersionHistory as xe}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Ye}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Fe,heroGroupNestDepth as Ge}from"../../format/lib/hero-group-placement.js";import{stripMarkup as ze}from"../../format/lib/markup.js";import{categoryShortLabel as Ke,PINNED_SECTION_TYPE as je}from"../lib/puck/add-palette.js";import{canAddTo as Ue}from"../lib/puck/add-target.js";import{blockIsOffered as Ze}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as qe,setBookingPreview as Xe}from"../../render/lib/puck/booking-preview.js";import{footerBlockRowName as Je}from"../../format/lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as Qe,HEADER_TYPE as Y}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as $e,readLeftView as et,resolveLeftView as tt,writeLeftView as ot}from"../../format/lib/puck/left-view.js";import{websiteIsLockedBlock as rt}from"../lib/puck/locked-blocks.js";import{everyPageNotice as nt,noOwnTab as it,pinnedReach as F,websiteDuplicateBlocked as st}from"../lib/puck/every-page.js";import{sharedSectionReach as at,WEBSITE_SHARED_SECTIONS as ct}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as G}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as dt}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as lt,scrollPreviewToTop as z}from"efficient-easel/screen/lib/puck/preview-dom";import{SiteCanvas as pt}from"../lib/puck/overrides.js";import{labelAtLevel as mt}from"../../format/lib/puck/section-catalog.js";import{editorWords as ft,say as p}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ut}from"../../format/lib/puck/section-descriptions.js";import{groupAccepts as St,isSectionGroupType as ht,sectionGroupZone as Et,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as wt}from"../../format/lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as Tt,SAVE_AS_TEMPLATE_EVENT as Pt}from"../../format/lib/save-as-template-action.js";import{newSectionNode as bt}from"../lib/sections/new-section-node.js";import{useHostProducts as gt}from"../lib/use-host-products.js";import{backendOf as It}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=be(),c=N().tree,d=e,n=d.kind==="ticker"?d.heroId:null,a=C(s=>{if(!s)return;t({kind:"ticker",heroId:s}),lt(s)},[t]);return P(()=>{o(n)},[n,o]),P(()=>{r(a)},[r,a]),{partRows:(s,{rowClick:u})=>{const m=String(s.props.id);return s.type==="Hero"&&i(y,{icon:i(R,{type:"ticker",size:13}),name:p(Pe),onSelect:()=>a(m),selected:n===m,rowProps:{onClick:u(()=>a(m))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=ge(),c=N().tree,{appState:d}=H(f=>f),n=d.data.content??[],a=oe(n);a.current=n;const s=e,u=Ie.find(f=>D[f]===s.kind),m=u&&"nodeId"in s?W(String(s.nodeId),u):null,E=C(f=>{const l=ke(f);if(!l)return;const w=a.current.findIndex(S=>String(S.props.id)===l.nodeId);if(w<0)return;const b={kind:D[l.part],nodeId:l.nodeId};t({index:w},b)},[t]);return P(()=>{o(m)},[m,o]),P(()=>{r(E)},[r,E]),{partRows:(f,{rowClick:l})=>{const w=String(f.props.id),b=ve(f);if(b.length===0)return null;const S=I=>{const g=W(w,I.part);return i(y,{icon:i(R,{type:I.part==="media"?"heroMedia":"heroImage",size:13}),name:p(I.label),onSelect:()=>E(g),selected:m===g,rowProps:{onClick:l(()=>E(g))},words:c},g)},[h,...T]=b;return _(B,{children:[S(h),T.length>0&&i(pe,{children:T.map(S)})]})}}}function Z(e,t){return{partRows:(o,r)=>_(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function vt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:a,notifyParent:s,token:u}=L(),{hasPreviewLink:m}=o,E=It(x()).preview?.draftLink,f=Me(e.data),l=Tt({hasTrustedConsole:!!u,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),w=C(()=>{!c||!r||s(Pt,{siteId:c,slug:r})},[s,c,r]),b=He({pageSlug:r,siteId:c,token:u}),S=t.previewHref?.(r)??b;return{barLead:()=>l.visible&&i(ie,{side:"bottom",content:l.enabled?p("Save this website as a platform template"):p(l.disabledReason),children:i("span",{className:"sf-tip-disabled",tabIndex:l.enabled?void 0:0,children:i(ne,{variant:"secondary",disabled:!l.enabled,onClick:w,rightIcon:i(le,{size:15}),children:p("Save as Template")})})}),barTrail:()=>m&&r&&i(Ne,{liveHref:S,pageId:d??null,draftLink:E}),mainAction:f}}function kt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:a,explainsSiteSettings:s}=o,u=h=>t.setView(h),[m,E]=re(De[0].id),{surface:f,setSurface:l}=Te(),w=()=>{if(a){u("styles"),t.reveal(),z();return}e.show(M),e.reveal(),z()},b={id:"pages",label:p("Pages"),icon:i(ae,{}),panel:({onHide:h})=>i(fe,{activeSurface:f,onPreviewSurface:l,onNavigate:T=>{l(null),n(r?{kind:"template",id:r,pageSlug:T}:{kind:"page",slug:T,siteId:c??void 0})},onClose:h})},S=[];return!a&&s&&S.push({id:"appearance",label:p("Appearance"),icon:i(de,{}),active:e.kind==="website",onSelect:w}),a&&S.push({id:"styles",label:p("Styles"),icon:i(ce,{}),panel:({onHide:h,notify:T})=>i(Oe,{tokenRef:d,siteId:c??void 0,onClose:h,onNotify:T,tab:m,onTabChange:E})}),{railLead:[b],railTrail:S,resolveLeftView:(h,T)=>tt(h,a,T),openSettings:w,openStyles:()=>{E(We),u("styles")}}}function _t(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=H(n=>n.config),d=x();P(()=>(G({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>G(null)),[e,t,o,c]),P(()=>{const n=O();if(!n||!r)return;let a=!1;return dt(d).list().then(s=>{a||n.learn(s)}).catch(()=>{}),()=>{a=!0}},[r,d])}function Ct(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:a}=t;P(()=>{Xe(n?.type==="BookingBox"&&n.props.region==="confirm"?qe(a(String(n.props.id))):null)},[n?.props.id]);const s=Be(e,t),{capabilities:{hasSiteSettings:u}}=L();_t();const{setSelected:m,setSelectHandler:E}=Ee(),{chat:f,setChat:l,setSelected:w,setSelectHandler:b}=ue(),S=c==="header";P(()=>{m(S)},[S,m]),P(()=>{E(()=>d(V))},[E,d]);const h=C(()=>d(Ce),[d]),T=c==="chat";P(()=>{w(T)},[T,w]),P(()=>{b(h)},[b,h]);const{setOpenHandler:I}=we(),g=C(()=>d(Re),[d]);P(()=>{I(g)},[I,g]);const J=Z(j(e),U(e)),Q=vt(t),$=kt(e,r),ee=o.device;return{...J,...Q,...$,hasOwnRows:k=>k.type===Ae,ownRows:s.renderLocationTree,sectionPressed:s.sectionPressed,wrap:k=>i(me.Provider,{value:!0,children:_(he.Provider,{value:ee,children:[k,i(xe,{})]})}),addPanelRow:k=>u?_("div",{className:"sf-addside-sitewide",children:[i("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:i(R,{type:"chat",size:16})}),_("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),h()},children:[p("Live chat"),i("span",{className:"sf-addside-sitewide-desc",children:p("A chat bubble on every page")})]}),i(se,{checked:f.enabled,onChange:te=>l({enabled:te}),ariaLabel:p("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function Rt(e){const t=ft();if(!e||!t)return e;q!==t&&(q=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:p(r.label)})):null,spec:e.spec?{...e.spec,addLabel:p(e.spec.addLabel)}:null},A.set(e,o)),o}const Lt={isLockedBlock:(e,t)=>rt(e)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:st,nestDepth:(e,t,o)=>t===Fe?Ge(e,o):0,newSectionNode:bt,canAddTo:(e,t)=>Rt(Ue(e,t)),blockIsOffered:Ze},Ot=new Proxy(ut,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?p(o):o}}),At={labelAtLevel:(e,t,o)=>p(mt(e,t,o)),descriptions:Ot,categoryLabel:e=>{const t=Ke(e);return t===void 0?void 0:p(t)},firstSection:je,blockRowName:Je,plainText:ze,Icon:R,Thumbnail:Le,useProducts:gt},Bt={desktop:2e3,tablet:800,mobile:390},X="desktop",yt={options:Se,initial:X,fluid:X,widths:Bt},Ht={read:et,write:e=>ot(e),forSelection:(e,t)=>$e(e,t)},Nt={first:Y,last:Qe,firstGroup:wt,lastGroup:K,isSectionGroup:ht,sectionGroupZone:Et,panelOf:e=>e===Y?V:null,get sharedReach(){return v()?Wt:void 0},get shared(){return O()?ct:void 0},get groupTab(){return v()?it:void 0},get groupBadge(){return v()?F({type:K})??void 0:void 0},get changeNotice(){return v()?nt():void 0},get band(){return v()?Dt:void 0},get groupAccepts(){return v()?St:void 0}},Dt={foldable:!0},Wt=e=>F(e)??at(e);function Vt(e){return{...Z(j(e),U(e)),openSettings:()=>e.show(M)}}const jo={useOwnerName:Ve,useDocumentLabel:Ye,useBridges:Ct,useStandaloneBridges:Vt,useDocumentPass:ye,blockRules:Lt,blockLook:At,devices:yt,leftView:Ht,pinned:Nt,Canvas:pt,Inspector:_e};export{jo as WEBSITE_SCREEN};
@@ -1 +1 @@
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"efficient-easel/screen/lib/puck/preview-dom";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
+ "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"efficient-easel/screen/lib/puck/preview-dom";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("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};
@@ -904,8 +904,8 @@
904
904
  inset must hold all of it (`@supports` below). A browser that draws its
905
905
  own scrollbar (Firefox) keeps a 0px lane here and the full inset. */
906
906
  --sf-insp-bar-w: 0px;
907
- --sf-insp-pad-end: calc(var(--es-insp-pad-x) - var(--sf-insp-bar-w));
908
- padding-inline-end: var(--sf-insp-pad-end);
907
+ --es-insp-pad-end: calc(var(--es-insp-pad-x) - var(--sf-insp-bar-w));
908
+ padding-inline-end: var(--es-insp-pad-end);
909
909
 
910
910
  /* THE DROPDOWN ARROW, WRITTEN ONCE — card 66399.c.
911
911
  Read by `.sf-insp-body select` at rest AND by the hover rule beside it. The
@@ -1801,9 +1801,9 @@
1801
1801
  6px OUTSIDE the panel at every width under 280, where card 66212 narrows
1802
1802
  the padding to 8 — measured at 260 and at 220 before this was a `var()`. */
1803
1803
  margin-left: calc(var(--es-insp-pad-x) * -1);
1804
- margin-right: calc(var(--sf-insp-pad-end) * -1);
1804
+ margin-right: calc(var(--es-insp-pad-end) * -1);
1805
1805
  padding-left: var(--es-insp-pad-x);
1806
- padding-right: var(--sf-insp-pad-end);
1806
+ padding-right: var(--es-insp-pad-end);
1807
1807
  }
1808
1808
  /* The heading's own top margin is the wrapper's job now. */
1809
1809
  .sf-insp-body .es-insp-row:has(.es-group-sub) .es-group-sub {
@@ -4146,3 +4146,26 @@ input.sf-list-marking {
4146
4146
  font-size: var(--text-xs);
4147
4147
  color: var(--sf-muted);
4148
4148
  }
4149
+
4150
+ /* The anchor's live link (components/AnchorField, the Wix anchor row): the
4151
+ shell's Snippet under the Name box, the label-to-box gap above it, the full
4152
+ row wide. The page path gives way to the ellipsis; the `#name` never does,
4153
+ because the hash is the part the merchant just typed. */
4154
+ .sf-anchor-link {
4155
+ margin-top: var(--space-4);
4156
+ }
4157
+ .sf-anchor-link > * {
4158
+ width: 100%;
4159
+ }
4160
+ .sf-anchor-link-text {
4161
+ display: flex;
4162
+ min-width: 0;
4163
+ }
4164
+ .sf-anchor-link-path {
4165
+ min-width: 0;
4166
+ overflow: hidden;
4167
+ text-overflow: ellipsis;
4168
+ }
4169
+ .sf-anchor-link-hash {
4170
+ flex: none;
4171
+ }
@@ -1,2 +1,3 @@
1
1
  import type { BlockFields } from "../../../../../../format/lib/puck/blocks/block-types.js";
2
+ export declare function footprintBlockSource(value: unknown): string;
2
3
  export declare const FootprintFields: BlockFields;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as g}from"../../../../../../format/lib/content/footprint.js";import{HeadquartersIcon as S,LayoutIcon as T,LocationIcon as b,SearchIcon as F,StoreIcon as I,ThemeIcon as L}from"efficient-easel/icons";import{CoordsField as v,copyText as _,group as i,plainText as s,section as w,segmented as c,sourceField as D,text as d,textarea as u,toggle as p}from"../../../controls.js";import{withShowWhen as t}from"../../../../../../render/lib/puck/show-when.js";import{needsGeocodeWork as P,resolveGeocodeRows as R}from"../../../geocode-resolve.js";import{SPLITTABLE_SECTIONS as E,headFieldsForPlacement as O,widthFieldsForParent as x}from"../../../../../../format/lib/sections/section-head-placement.js";import{innerSpacingFields as C,WIDTH_ROW_KEYS as H}from"../../shared-fields.js";import{FOOTPRINT_PH as f}from"../../../../../../render/lib/puck/blocks/general/Footprint/render.js";const A={field:"source",is:"typed",default:"typed"},l={field:"source",is:"dealers",default:"typed"},m={all:[l,{field:"search",is:!0,default:!1}]},K={fields:{_gContent:i("Section"),sectionNumber:d("Section number",f.sectionNumber),heading:u("Heading",f.heading),tagline:u("Body",f.tagline),_gOffices:i("Offices"),source:c("Source",o(I,{}),[{label:"Typed in",value:"typed"},{label:"Dealers",value:"dealers"}],"typed"),offices:t({type:"array",label:"Offices",arrayFields:{role:s("Role"),city:s("City"),country:s("Region · country"),address:_("Address"),group:s("Group"),hq:p("HQ",!1,o(S,{})),geocode:D(v,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},A),mapTheme:c("Map theme",o(L,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],g.mapTheme),_gSearch:i("Search"),search:t(p("Show",!1,o(F,{})),l),searchHint:t(d("Hint","Type a postcode or address"),m),noMatchText:t(d("No match","No place found. Try another postcode."),m),_gList:i("List"),listPosition:t(c("Position",o(T,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),l),showDistance:t(p("Distance",!0,o(b,{})),l),_dLayout:w("Layout"),...C("Footprint")},resolveData:async e=>{const r=e.props,a=r.offices??[];if(!P(a))return e;const h=await R(a,n=>[n.address,n.city,n.country].map(y=>String(y??"").replace(/\*/g,"").trim()).filter(Boolean).join(", "));return{...e,props:{...r,offices:h}}},resolveFields:(e,{fields:r,parent:a})=>O(x(r,a,H),e.props.headPlacement,E.Footprint.headRows)};export{K as FootprintFields};
1
+ import{jsx as i}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as _}from"../../../../../../format/lib/content/footprint.js";import{HeadquartersIcon as L,LayoutIcon as E,LocationIcon as I,SearchIcon as P,StoreIcon as k,ThemeIcon as C}from"efficient-easel/icons";import{CoordsField as D,copyText as x,group as l,plainText as a,section as N,segmented as u,sourceField as A,text as f,textarea as S,toggle as d}from"../../../controls.js";import{withShowWhen as n}from"../../../../../../render/lib/puck/show-when.js";import{needsGeocodeWork as H,resolveGeocodeRows as W}from"../../../geocode-resolve.js";import{SPLITTABLE_SECTIONS as B,headFieldsForPlacement as M,widthFieldsForParent as U}from"../../../../../../format/lib/sections/section-head-placement.js";import{innerSpacingFields as j,WIDTH_ROW_KEYS as q}from"../../shared-fields.js";import{BLOCK_SOURCE_PROP as g,blockSources as z,blockSourcesRevision as w}from"../../../../../../format/lib/content/block-sources.js";import{FOOTPRINT_PH as m}from"../../../../../../render/lib/puck/blocks/general/Footprint/render.js";const G={field:"source",is:"typed",default:"typed"},c={field:"source",is:"dealers",default:"typed"},b={all:[c,{field:"search",is:!0,default:!1}]},y=[{label:"Typed in",value:"typed"},{label:"Dealers",value:"dealers"}],K=new Set(y.map(e=>e.value)),R=e=>u("Source",i(k,{}),e,"typed");function v(e){const t=typeof e=="string"?e.trim():"";return t&&!K.has(t)&&/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(t)?t:""}const h=new Map;let F=-1;function Y(e){const t=z("Footprint"),o=e&&!t.some(s=>s.key===e)?e:"";if(!t.length&&!o)return null;F!==w()&&(F=w(),h.clear());let r=h.get(o);return r||(r=R([...y,...t.map(s=>({label:s.label,value:s.key})),...o?[{label:o,value:o}]:[]]),h.set(o,r)),r}const T=new WeakMap;function Q(e,t){const o=Y(t);if(!o)return e;let r=T.get(e);r||T.set(e,r=new Map);let s=r.get(o);return s||(s={...e,source:o},r.set(o,s)),s}const ie={fields:{_gContent:l("Section"),sectionNumber:f("Section number",m.sectionNumber),heading:S("Heading",m.heading),tagline:S("Body",m.tagline),_gOffices:l("Offices"),source:R(y),offices:n({type:"array",label:"Offices",arrayFields:{role:a("Role"),city:a("City"),country:a("Region · country"),address:x("Address"),group:a("Group"),hq:d("HQ",!1,i(L,{})),geocode:A(D,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},G),mapTheme:u("Map theme",i(C,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],_.mapTheme),_gSearch:l("Search"),search:n(d("Show",!1,i(P,{})),c),searchHint:n(f("Hint","Type a postcode or address"),b),noMatchText:n(f("No match","No place found. Try another postcode."),b),_gList:l("List"),listPosition:n(u("Position",i(E,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),c),showDistance:n(d("Distance",!0,i(I,{})),c),_dLayout:N("Layout"),...j("Footprint")},resolveData:async e=>{const t=v(e.props.source);(e.props[g]??"")!==t&&(e={...e,props:{...e.props,[g]:t}});const o=e.props,r=o.offices??[];if(!H(r))return e;const s=await W(r,p=>[p.address,p.city,p.country].map(O=>String(O??"").replace(/\*/g,"").trim()).filter(Boolean).join(", "));return{...e,props:{...o,offices:s}}},resolveFields:(e,{fields:t,parent:o})=>M(U(Q(t,v(e.props.source)),o,q),e.props.headPlacement,B.Footprint.headRows)};export{ie as FootprintFields,v as footprintBlockSource};
@@ -92,7 +92,6 @@ export declare const BOUND_TO_POST_NOTE = "Everything else on this block comes f
92
92
  export declare const BOUND_TO_POST: ShowWhenRule;
93
93
  export declare const NOT_BOUND_TO_POST: ShowWhenRule;
94
94
  export declare const HIGHLIGHT_HINT = "Select a word, then press the highlighter.";
95
- export declare const ANCHOR_HINT = "A short name so a link can jump straight to this section, like yoursite.com/page#about.";
96
95
  export declare const hintIsWhileTyping: (hint: string) => boolean;
97
96
  export declare function text(label: string, placeholder?: string, hint?: string): CustomField<HidableValue>;
98
97
  export declare function textarea(label: string, placeholder?: string, hint?: string): CustomField<HidableValue>;
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as w,Fragment as T}from"react/jsx-runtime";import{cloneElement as fe,useId as ht,useRef as oe,useState as V}from"react";import{useEasel as W,useSelectedFields as re}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 Y,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as q,textFieldIdentifier as mt}from"efficient-easel/draw";import gt from"../../components/ApplyCornersToSiblings.js";import bt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as xt,CORNER_RADIUS_MAX as ye,CORNER_RADIUS_MIN as A}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as yt,IMAGE_CORNERS_LABEL as St}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Ct}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as _t,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as Se}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as It,HERO_GROUP_PLACEMENTS as Et,HERO_GROUP_PLACEMENT_DEFAULT as Tt,normalisePlacement as Rt,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import Ot from"../../components/KeepHint.js";import{AdjustIcon as wt,AlignLeftIcon as Pt,EyeIcon as kt,AlignSeparateIcon as Nt,AnimationIcon as _e,BackgroundIcon as Lt,BorderAllIcon as vt,BlockSectionIcon as At,CartIcon as Ft,ColumnWidthsIcon as Ie,ColumnsIcon as Dt,CornerIcon as Bt,DirectionDownIcon as Ht,DirectionLeftIcon as Gt,DirectionRightIcon as Mt,DirectionUpIcon as Kt,DollarIcon as Wt,FinishIcon as Ut,GapIcon as Ee,GridIcon as Xt,GroundIcon as $t,HashIcon as Te,HeightIcon as jt,ImageIcon as zt,ListIcon as Vt,LocationIcon as ie,NudgeIcon as Yt,PaddingAllIcon as qt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Jt,PlacementIcon as Zt,ProductSizeIcon as Qt,StickyIcon as en,RotateIcon as tn,SquareIcon as nn,TypeIcon as on,WidthIcon as rn,WrapIcon as ln}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as an}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Le,CORNER_SIDE_POINTS as sn,hasOwnSectionCorners as cn,normalizeCornerSides as ve}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as dn,SECTION_MOTION_OPTIONS as un}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Ae}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as h,SettingsGroupHead as pn,SettingsGroupSub as fn,SettingsBorder as hn,SettingsSegmented as mn,SettingsSides as gn,SettingsSidesEach as Fe,sidesStartEach as bn,SettingsSwitch as De,borderSides as xn,borderStartEach as yn}from"efficient-easel/panel";import{FieldSelect as Sn,ListField as Cn}from"efficient-easel/fields";import{DisplayChips as _n}from"efficient-shell/ui";import{desktopDisplayChanged as In,partShownOnDesktop as En,partShownOnPhone as Tn,phoneDisplayChanged as Rn,withDesktopPart as On,withPhonePart as wn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Pn,Checkbox as kn,CornersInput as Nn,DateTimePicker as Ln,FOCAL_DEFAULT as vn,PictureTiles as Be,PositionInput as An,Slider as Fn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as Dn}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as Bn,NoControlMark as J,noControlField as X}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Hn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Gn,phoneKey as F,resolvePhoneValue as le}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Mn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Kn,CARD_OUTLINE_OPTIONS as Wn,DEFAULT_CARD_INDEX_FORMAT as Un,DEFAULT_CARD_OUTLINE as Xn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as $n,DEFAULT_COVER_INDEX as jn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as zn}from"efficient-easel/draw";import Vn from"../../components/MediaUploadField.js";import Yn from"../../components/MultiSelectField.js";import qn from"../../components/SectionThemePicker.js";import Jn from"../../components/SearchSelectField.js";import Zn 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 eo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as ae,hasPhoneStick as to,resolveSectionStick as no}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as oo,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as ro}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as io,containerDirectionPoints as lo,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as ao,BOX_BLOCK_SPACING_LABEL as so,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as co,BOX_PHONE_ROW_MAX as uo,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as se,BOX_WRAP_LABEL as po,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 fo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as ho,normalizeTheme as mo,siteButtonPaint as go}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ce,CONTAINER_GAP_BUILT_IN as bo,GAP_FIELD_CONTAINER as xo,hasOwnContainerGap as yo,resolveContainerGap as So}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Co,CARD_IMAGE_BG_OFF as _o,CARD_IMAGE_BG_SWATCH_NAMES as Io,CARD_IMAGE_BG_SWATCHES as Eo,isCardImageBackgroundInheriting as To,cardImageBackgroundChoice as Ro,THEME_CARD_IMAGE_BG as Oo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as wo,SECTION_BG_SWATCHES as Po,SECTION_BG_SWATCH_NAMES as ko,THEME_SECTION_BG as No,isSectionBackgroundInheriting as Lo}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as vo}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Ao,TYPE_SIZE_INHERIT as Fo,isTypeSizeInheriting as Do}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Bo,WIDTH_CHOICE_LABEL as Ho,WIDTH_INHERIT as Go,resolveWidth as Mo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Ko}from"efficient-easel/style-clipboard";function B(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!q(n)&&Ko(n,`section:${t}`);return e}function el({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Wo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function Uo(e){return e.type===qe}function P(e){return Uo(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function Xo(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Mo(t,"full");return n==="page"?N(`${o}px`,l("the page")):n==="contained"?N(l("Contained"),l("the page")):N(l("Full"),l("the page"))}function $o(){const{blockGap:e}=D();return e===null?l("this container's own spacing"):N(`${e}px`,l("Site styles"))}function jo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:$o(),onReset:t})}function zo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Xo(),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=oe(null),p=oe(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=ht(),_=i?Qo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(Ot,{children:l(i)}):void 0,z=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(on,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:z,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":z,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:w("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 tl(e,t){return{...e,[xe]:t}}function nl(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function ol(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function rl(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function il(e){return!!e&&typeof e=="object"&&e[Je]===!0}function ll(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 Ea,SCALAR_TEXT_CONTROLS as Ta}from"efficient-easel/draw";function al(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[Bn]:o,...i}=e;return{...i,[Hn]:!0,render:t}}const Vo=new Set(zn),G=(e,t)=>{const n={...t,[I]:e};if(!Vo.has(e.control))return n;const o=t.render;return{...X(n,"authored-copy"),render:i=>r(Mn,{name:i.name,children:o(i)})}},sl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Yo={field:"source.slug",set:!0},cl={not:Yo},qo="Select a word, then press the highlighter.",Jo="A short name so a link can jump straight to this section, like yoursite.com/page#about.",Zo=new Set([qo]),Qo=e=>Zo.has(e);function dl(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 ul(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 er(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 pl(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 fl(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(Zn,{value:me(t),onChange:n,label:e})}}function hl(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 ml={Design:wt,Animation:_e};function gl(e,t){return e.includes("Design")?t!=="Design":null}function tr({label:e}){return r(pn,{title:l(e),level:Ye(1)})}function nr({level:e,label:t}){return e===1?r(tr,{label:t}):r(ir,{label:t})}function Ze(e,t){return{type:"custom",[Y]:{label:e,level:t},render:()=>r(nr,{level:t,label:e})}}function S(e){return Ze(e,2)}function bl(e){return{type:"custom",render:()=>r(or,{text:e})}}function or({text:e}){return r("p",{className:"sf-note",children:l(e)})}function xl(e){return Ze(e,1)}function yl(e){return q(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function Sl(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[Y]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function Cl(e){return q(e)!==null&&e?.designGroup!==void 0}const et=new Map;function _l(e){const t=et.get(e)??{type:"custom",[Y]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function rr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Il(e,t){return rr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function El(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 ir({label:e}){return r(fn,{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 w("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 Tl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Lo(n,t);return r(h,{label:l(e),icon:r(Lt,{}),changed:!i,action:r(y,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(wo)}),children:tt({swatches:Po,current:i?No:n??t??"",onPick:o,names:ko})})}}}function lr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=To(i,t);return r(h,{label:l(e),icon:r($t,{}),changed:!a,action:r(y,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Co)}),children:tt({swatches:Eo,current:a?Oo:Ro(i,t),onPick:o,names:Io})})}}}function Rl(e=n=>n,t){return B({_gSectionTheme:S(vo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(qn,{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(Fn,{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:P(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?P(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?fe(d,{changed:!b,onReset:()=>p(null)}):r(y,{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 Ol(e){const t=K("Gap",r(Ee,{}),ce.min,ce.max,ce.step,bo[e],"px",(n,o)=>r(jo,{inherited:!yo(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[xo]:e,render:n=>t.render({...n,value:So(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Q="Corners";function de(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(Q),icon:r(Bt,{}),changed:i,action:fe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(ar,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=re()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function ar({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=ve(a)??[...Le];return r(Nn,{label:l(Q),value:s,corners:sn,onChange:d=>{const u=ve(d)??[];c(u.length===Le.length?null:u)},radius:t,onRadiusChange:n,radiusMin:A,radiusMax:ye,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return X({type:"custom",render:()=>r(J,{})},"always")}function sr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=D(),i=typeof o=="number"?`${o}px`:l("not set");return r(y,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(i,l("Site styles")),onReset:n})}function cr(){const{cornerRadiusPx:e}=D();return typeof e=="number"?e:A}function dr(){return de({sidesKey:"sectionCornerSides",useFollowed:cr,useClosedReason:()=>lt()?l(it):null,mark:r(sr,{label:Q}),hint:r(ur,{})})}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(L())}function ur(){return r(T,{children:lt()?it:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function wl(){return B({_gShape:S("Shape"),sectionCorners:dr(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const pr=()=>({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 fr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function hr(){let e;try{const t=mo(D().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||ho.line}function mr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=hr(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=V(()=>yn(a,c)),u=pr();return r(h,{label:l("Border"),icon:r(vt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(hn,{label:l("Border"),value:a,each:s,onChange:f=>t(fr(f)),placeholder:{sides:xn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:fo})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(mr,{value:t,onChange:n,tier:e})})}function Pl(){return{_gMotion:S("Motion"),sectionAnimation:pe("Entrance",r(_e,{}),[...un],dn)}}function ue(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Ae(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=D(),n=ue(),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?Ae(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return cn(a)?a:o}function gr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=ue(),i=st(A),a=o?"Site":"Section";return r(y,{words:x()?.panel,label:l(e),changed:t,detail:N(`${i}px`,o?l("Site styles"):l("the section")),onReset:n})}function br(){return r(T,{children:ue()?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 xr(){return de({sidesKey:"cardCornerSides",useFollowed:()=>st(A),mark:r(gr,{label:Q}),hint:r(br,{})})}function yr(){return{type:"custom",render:()=>r(gt,{})}}function kl(e){return{...e,render:t=>r(bt,{render:e.render,props:t})}}function Nl(){return{_gShape:S("Shape"),cardCorners:xr(),cardCornerSides:rt(),cardCornersApplyAll:yr()}}function Ll(){return k("Justify",r(Nt,{}),Xe,Xe[0].value)}function vl(){return k("Item alignment",r(Pt,{}),ao,"stretch")}function Al(){return k(po,r(ln,{}),ze,ze[0].value)}function Fl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=se.find(o=>o.value===e)??se[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:se.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:Sr(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function Sr(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 Dl(){return k(so,r(Ee,{}),Ue,Ue[0].value)}function Bl(){return K(co,r(Jt,{}),$e,uo,1,$e)}function Hl(e){const t=pe(io,Wo("`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)."),lo(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function Gl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Ne,{noun:a}),action:r(y,{words:x()?.panel,label:l(e),changed:!Do(c),detail:l("the Text style in Site styles"),onReset:()=>s(Fo),defaultAction:{onPress:()=>s(Ao),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 Ml(){return{_gCellWidth:S("Cell width"),gridSpan:k("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:Ct},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Cr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=L()[c],u=le(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:le(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function _r({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=L()[t],c=le(void 0,a,n);return r(y,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function Ir(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(_r,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Cr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Kl(e){return{type:"custom",render:({value:t,onChange:n})=>r(Tr,{...e,value:t,onChange:n})}}function Er({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:P(t),action:r(y,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:te({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function Tr({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=L()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Er,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Rr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Or={Top:Pe,Bottom:Re,Left:Oe,Right:we},wr=e=>{const t=Or[e];return r(t,{})};function Wl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Rr[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,z,O,ne=E)=>g("mobile",Ir({label:i(_),icon:wr(_),desktopKey:z,min:ne.min,max:ne.max,step:ne.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:S("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 j=["top","right","bottom","left"],Pr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function kr(e,t,n){const o={};for(const i of j)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function Nr({tier:e,o:t}){let n=null;try{n=re()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries(j.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries(j.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=V(()=>bn(a,c));return r(h,{label:l("Padding"),icon:r(qt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(gn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=kr(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 Ul(e={}){const t={...Pr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(j.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(Nr,{tier:s,o:n})};return o?g(s,d):d},a=()=>X({type:"custom",render:()=>r(J,{})},"always"),c=j.filter(s=>s!=="top");return B({...e.group===!1?{}:{_gSpacing:S("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 dt=e=>typeof e=="number"?e:null;function Lr(e,t,n){const o={};for(const i of["x","y"])n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function vr({o:e}){let t=null;try{t=re()}catch{t=null}const n=t?.values??{},o={x:dt(n[e.keys.x]),y:dt(n[e.keys.y])},i=l(e.label??"Position"),a=!!(o.x||o.y),c=u=>{const f=Lr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},s=r(An,{label:i,value:o,onChange:c,words:{x:l("Left and right"),y:l("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=r(y,{words:x()?.panel,label:i,changed:a,detail:"0 px, 0 px",onReset:()=>c({x:null,y:null})});return e.label===null?w("div",{className:"sf-position-line",children:[s,d]}):r(h,{label:i,icon:r(Yt,{}),changed:a,action:d,children:s})}function Xl(e){return{[e.keys.x]:{type:"custom",render:()=>r(vr,{o:e})},[e.keys.y]:{...X({type:"custom",render:()=>r(J,{})},"always"),reachedBy:e.keys.x}}}const Ar={contained:"Contained",page:"Page",full:"Full"},ee="Width";function $l(e,t=Bo,n=!0){const o=t.map(i=>({label:Ho[i]??Ar[i],value:i}));return B({...n?{_gWidth:S(ee)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(ee),icon:r(rn,{}),action:n?r(zo,{inherited:a?.inherited??!1,onReset:()=>i(Go),label:ee}):void 0,children:te({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ee})})}})}function jl(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:$,icon:P(r(jt,{})),action:o?o(a):void 0,children:te({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:$})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?ro:oo;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:$,onChange:i})})}}),n=()=>pe("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return B({_gHeight:S($),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(Fr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Fr({onClear:e}){const t=L(),n=Qn(t),o=eo(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(y,{words:x()?.panel,label:l($),changed:n,detail:i,onReset:e})}function zl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Dr,{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:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:S(ae),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Dr({value:e,onChange:t,labelId:n,phone:o}){const i=L(),a=no(i),c=o?a.phone:e===!0;return r(h,{label:l(ae),labelId:n,icon:P(r(en,{})),action:w(T,{children:[o?r(y,{words:x()?.panel,label:l(ae),changed:to(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 Vl(){return{_gAnchor:S("Anchor"),anchor:er("Anchor name","e.g. about",Jo)}}function Yl(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(Ln,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function v(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 ql(){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:an(e),onChange:t})})}}}function Jl(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(kn,{id:c,checked:a,onChange:o})})}}}const Zl={follows:"fill"},Ql={follows:"ink"};function ea(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Br,{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 Br({label:e,part:t,icon:n,value:o,onChange:i}){const a=go(D().theme),c=t==="fill"?a.fill:a.ink;return r(Dn,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),l("Site styles")),onChange:i,onReset:()=>i("")})}const Hr=[{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 ut({label:e,value:t,onChange:n,points:o=Hr}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(Pn,{label:l(e),value:t,points:i,onChange:n})}function ta(){return X({type:"custom",render:()=>r(J,{})},"always")}const Gr=Ce([]);function na(e,{stacking:t,fallback:n=Tt}){return{type:"custom",render:({value:o,onChange:i})=>{const a=Et.includes(o)?o:n;return t?r(Mr,{label:e,value:a,onChange:i}):pt({label:e,value:a,onChange:i,points:Gr})}}}function Mr({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?It(o?.data,a):[];return pt({label:e,value:t,onChange:n,points:Ce(c,a)})}function pt({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(Zt,{}),hint:i?.title?l(i.title):void 0,children:ut({label:e,value:Rt(t),onChange:n,points:o})})}const oa={top:r(Kt,{}),right:r(Mt,{}),bottom:r(Ht,{}),left:r(Gt,{})};function ra(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:ut({label:e,value:m,onChange:p,points:u})})}}}const Kr="\0note";function k(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:P(t),children:r(Sn,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Kr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function ia(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(Yn,{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 la(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Jn,{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 aa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function te({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(mn,{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 sa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function pe(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:P(t),children:te({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function ca(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r(Vn,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const da={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ua({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 w(h,{label:l(n),icon:r(ie,{}),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&&w("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(ie,{}),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(ie,{}),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 Wr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Ur(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 pa(e,t){return e===null?null:t>e?e:null}function Xr(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 fa={label:"Ticker items",icon:r(Vt,{})};function ha(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r($r,{label:e,icon:P(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function $r({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=oe(null),[s,d]=V(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Xr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(Cn,{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:Wr(n,s),onChange:p=>i(Ur(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 ma(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 ga(e){return{_gCards:S("Cards"),coverIndex:k("Cover image",r(zt,{}),$n,String(jn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:lr("Image background",_o),cardImage:zr(),spinOnHover:v("Rotate on hover",e?.spinDefault??!0,r(tn,{}))}}function ba(){return{outline:k("Card outline",r(nn,{}),Wn,Xn),indexBadge:k("Card number",r(Te,{}),Kn,Un),showBadge:v("Product badge",!0,r(Ne,{noun:"tag"}))}}function xa(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:S("Show on a card"),showCardPrice:v("Price",!0,r(Wt,{})),showCardFinishes:v("Finish swatches",!0,r(Ut,{})),showCardSizes:v("Sizes",n.showCardSizes,r(Qt,{})),showCardBuy:v("Buy button",n.showCardBuy,r(Ft,{})),showCardPage:v("Page button",n.showCardPage,r(ke,{}))}}function ya(e,t="display"){const n=F(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(ft,{parts:e,changed:In(o),shown:a=>En(o,a),onPress:(a,c)=>i(On(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(jr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function ft({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(kt,{}),changed:t,action:r(y,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(_n,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function jr({parts:e,desktopKey:t,value:n,onChange:o}){const i=L()[t];return r(ft,{parts:e,changed:Rn(n),shown:a=>Tn(i,n,a),onPress:(a,c)=>o(wn(n,a,c)),onReset:()=>o(Gn),detail:l("the same as Desktop")})}function zr(){return nt("Card image",{min:A,max:ye,step:xt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function Sa(){return de({sidesKey:"cornerSides",step:yt,useFollowed:()=>A,mark:r(Vr,{label:St}),hint:l("Rounds the picture. Left alone it stays square.")})}function Vr({label:e,changed:t=!1,onReset:n=()=>{}}){return r(y,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Ca(){return{type:"custom",render:({value:e,onChange:t})=>r(Yr,{value:typeof e=="string"?e:"",onChange:t})}}function Yr({value:e,onChange:t}){const[n,o]=V(null),i=Se.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return w(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Dt,{}),children:w("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),_t.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(Xt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Se.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{Jo as ANCHOR_HINT,Yo as BOUND_TO_POST,sl as BOUND_TO_POST_NOTE,ml as BUCKET_ICONS,da as CUSTOM_FIELD_MEDIA,ua as CoordsField,oa as EDGE_ARROWS,vn as FOCAL_DEFAULT,Hr as FOCAL_POINTS,Y as FOLD_FIELD_MARKER,Zl as FOLLOWS_SITE_BUTTON,Ql as FOLLOWS_SITE_BUTTON_INK,ut as FocalPicker,ir as GroupLabel,qo as HIGHLIGHT_HINT,H as HidableTextField,ge as LINK_FIELD_MARKER,el as Label,be as MEDIA_FIELD_MARKER,sa as MEDIA_TYPE_OPTIONS,cl as NOT_BOUND_TO_POST,or as PanelNoteLine,Tr as PhoneChoiceRow,Er as PhoneChoiceStrip,pt as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Ta as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Pr as SIDE_PAD_KEYS,tr as SectionHeading,te as Segmented,jo as SiteGapDefaultReset,M as Slider,tt as Swatches,Ea as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,fa as TICKER_ITEMS_ROW,$r as TextListField,zo as WidthDefaultReset,Xr as aimAfterListChange,Vl as anchorFields,N as backTo,Tl as backgroundField,vl as boxAlignField,Dl as boxBlockSpacingField,Ll as boxJustifyField,Bl as boxPhoneRowField,Fl as boxShareField,Al as boxWrapField,Sl as bucketHeader,xr as cardCornersField,lr as cardImageBackgroundField,zr as cardImageField,ga as cardMediaFields,Nl as cardShapeFields,xa as cardShowFields,ba as cardStyleFields,Ml as cellWidthFields,Jl as checkbox,ea as colorInput,pl as copyText,rt as cornerSidesField,de as cornersRowField,Yl as dateTime,_l as designGroupHeader,Hl as directionField,ya as displayFields,ra as edgePad,gl as entriesHiddenForTab,pa as focusAfterRemove,ta as focusKeptField,Il as foldMarker,q as foldMetaOf,rr as foldTitleOf,Ca as galleryLayoutField,Ol as gapField,S as group,jl as heightFields,me as hidableText,Qo as hintIsWhileTyping,P as iconOf,Sa as imageCornersField,al as inOwnBox,yl as isBucketHeader,Cl as isDesignGroupHeader,Uo as isNoGlyph,fl as linkField,ia as multiSelect,Wo as noGlyph,ql as pageBackgroundField,bl as panelNote,Kl as phoneChoiceField,Ir as phoneOverrideField,na as placementField,er as plainText,hl as plainTextarea,Xl as positionFields,Lr as positionPatch,nt as pxField,El as quietMarker,he as readHidable,Wr as rowText,la as searchSelect,xl as section,Pl as sectionAnimationFields,at as sectionBorderField,dr as sectionCornersField,wl as sectionShapeFields,Rl as sectionThemeFields,pe as segmented,k as select,Ur as setRowText,B as sharedStyleKinds,Ul as sidesPaddingFields,kr as sidesPaddingPatch,Gl as sizeField,K as slider,aa as sourceField,Wl as spacingFields,zl as stickFields,kl as templateField,dl as text,mt as textFieldIdentifier,ol as textFieldOffPage,il as textFieldPanelOnly,ha as textList,ma as textListRowField,ul as textarea,v as toggle,ca as upload,Xo as usePageWidthDetail,L as useSelectedProps,ot as useSelectedSibling,$o as useSiteGapDetail,$l as widthField,ll as withIdentifier,nl as withOffPage,rl as withPanelOnly,tl as withScaffold};
1
+ "use client";import{jsx as r,jsxs as w,Fragment as T}from"react/jsx-runtime";import{cloneElement as fe,useId as mt,useRef as oe,useState as V}from"react";import{useEasel as W,useSelectedFields as re}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 Y,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as q,textFieldIdentifier as gt}from"efficient-easel/draw";import bt from"../../components/ApplyCornersToSiblings.js";import xt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as yt,CORNER_RADIUS_MAX as ye,CORNER_RADIUS_MIN as D}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as St,IMAGE_CORNERS_LABEL as Ct}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as _t}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as It,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as Se}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as Et,HERO_GROUP_PLACEMENTS as Tt,HERO_GROUP_PLACEMENT_DEFAULT as Rt,normalisePlacement as Ot,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import wt from"../../components/KeepHint.js";import Pt from"../../components/AnchorField.js";import{AdjustIcon as kt,AlignLeftIcon as Nt,EyeIcon as Lt,AlignSeparateIcon as vt,AnimationIcon as _e,BackgroundIcon as At,BorderAllIcon as Ft,BlockSectionIcon as Dt,CartIcon as Bt,ColumnWidthsIcon as Ie,ColumnsIcon as Ht,CornerIcon as Gt,DirectionDownIcon as Mt,DirectionLeftIcon as Kt,DirectionRightIcon as Wt,DirectionUpIcon as Ut,DollarIcon as Xt,FinishIcon as $t,GapIcon as Ee,GridIcon as jt,GroundIcon as zt,HashIcon as Te,HeightIcon as Vt,ImageIcon as Yt,ListIcon as qt,LocationIcon as ie,NudgeIcon as Jt,PaddingAllIcon as Zt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Qt,PlacementIcon as en,ProductSizeIcon as tn,StickyIcon as nn,RotateIcon as on,SquareIcon as rn,TypeIcon as ln,WidthIcon as an,WrapIcon as sn}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as cn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Le,CORNER_SIDE_POINTS as dn,hasOwnSectionCorners as un,normalizeCornerSides as ve}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as pn,SECTION_MOTION_OPTIONS as fn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Ae}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as h,SettingsGroupHead as hn,SettingsGroupSub as mn,SettingsBorder as gn,SettingsSegmented as bn,SettingsSides as xn,SettingsSidesEach as Fe,sidesStartEach as yn,SettingsSwitch as De,borderSides as Sn,borderStartEach as Cn}from"efficient-easel/panel";import{FieldSelect as _n,ListField as In}from"efficient-easel/fields";import{DisplayChips as En}from"efficient-shell/ui";import{desktopDisplayChanged as Tn,partShownOnDesktop as Rn,partShownOnPhone as On,phoneDisplayChanged as wn,withDesktopPart as Pn,withPhonePart as kn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Nn,Checkbox as Ln,CornersInput as vn,DateTimePicker as An,FOCAL_DEFAULT as Fn,PictureTiles as Be,PositionInput as Dn,Slider as Bn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as Hn}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as Gn,NoControlMark as J,noControlField as X}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Mn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Kn,phoneKey as B,resolvePhoneValue as le}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Wn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Un,CARD_OUTLINE_OPTIONS as Xn,DEFAULT_CARD_INDEX_FORMAT as $n,DEFAULT_CARD_OUTLINE as jn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as zn,DEFAULT_COVER_INDEX as Vn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Yn}from"efficient-easel/draw";import qn from"../../components/MediaUploadField.js";import Jn from"../../components/MultiSelectField.js";import Zn from"../../components/SectionThemePicker.js";import Qn from"../../components/SearchSelectField.js";import eo 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 to,resolveSectionMinHeight as no}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as ae,hasPhoneStick as oo,resolveSectionStick as ro}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as io,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as lo}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as ao,containerDirectionPoints as so,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as co,BOX_BLOCK_SPACING_LABEL as uo,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as po,BOX_PHONE_ROW_MAX as fo,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as se,BOX_WRAP_LABEL as ho,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as H}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as mo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as go,normalizeTheme as bo,siteButtonPaint as xo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ce,CONTAINER_GAP_BUILT_IN as yo,GAP_FIELD_CONTAINER as So,hasOwnContainerGap as Co,resolveContainerGap as _o}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Io,CARD_IMAGE_BG_OFF as Eo,CARD_IMAGE_BG_SWATCH_NAMES as To,CARD_IMAGE_BG_SWATCHES as Ro,isCardImageBackgroundInheriting as Oo,cardImageBackgroundChoice as wo,THEME_CARD_IMAGE_BG as Po}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ko,SECTION_BG_SWATCHES as No,SECTION_BG_SWATCH_NAMES as Lo,THEME_SECTION_BG as vo,isSectionBackgroundInheriting as Ao}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Fo}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Do,TYPE_SIZE_INHERIT as Bo,isTypeSizeInheriting as Ho}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Go,WIDTH_CHOICE_LABEL as Mo,WIDTH_INHERIT as Ko,resolveWidth as Wo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Uo}from"efficient-easel/style-clipboard";function G(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!q(n)&&Uo(n,`section:${t}`);return e}function tl({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Xo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function $o(e){return e.type===qe}function P(e){return $o(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function jo(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Wo(t,"full");return n==="page"?N(`${o}px`,l("the page")):n==="contained"?N(l("Contained"),l("the page")):N(l("Full"),l("the page"))}function zo(){const{blockGap:e}=H();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function Vo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:zo(),onReset:t})}function Yo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:jo(),onReset:t})}function L({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=oe(null),p=oe(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=mt(),_=i?er(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(wt,{children:l(i)}):void 0,z=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(ln,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:z,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":z,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:w("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 nl(e,t){return{...e,[xe]:t}}function ol(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function rl(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function il(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function ll(e){return!!e&&typeof e=="object"&&e[Je]===!0}function al(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 Ra,SCALAR_TEXT_CONTROLS as Oa}from"efficient-easel/draw";function sl(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[Gn]:o,...i}=e;return{...i,[Mn]:!0,render:t}}const qo=new Set(Yn),v=(e,t)=>{const n={...t,[I]:e};if(!qo.has(e.control))return n;const o=t.render;return{...X(n,"authored-copy"),render:i=>r(Wn,{name:i.name,children:o(i)})}},cl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Jo={field:"source.slug",set:!0},dl={not:Jo},Zo="Select a word, then press the highlighter.",Qo=new Set([Zo]),er=e=>Qo.has(e);function ul(e,t,n){return v({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function pl(e,t,n){return v({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function fl(e,t,n){return v({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function hl(e,t,n){return v({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function ml(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(eo,{value:me(t),onChange:n,label:e})}}function gl(e,t,n){return v({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const bl={Design:kt,Animation:_e};function xl(e,t){return e.includes("Design")?t!=="Design":null}function tr({label:e}){return r(hn,{title:l(e),level:Ye(1)})}function nr({level:e,label:t}){return e===1?r(tr,{label:t}):r(ir,{label:t})}function Ze(e,t){return{type:"custom",[Y]:{label:e,level:t},render:()=>r(nr,{level:t,label:e})}}function S(e){return Ze(e,2)}function yl(e){return{type:"custom",render:()=>r(or,{text:e})}}function or({text:e}){return r("p",{className:"sf-note",children:l(e)})}function Sl(e){return Ze(e,1)}function Cl(e){return q(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function _l(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[Y]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function Il(e){return q(e)!==null&&e?.designGroup!==void 0}const et=new Map;function El(e){const t=et.get(e)??{type:"custom",[Y]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function rr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Tl(e,t){return rr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function Rl(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 ir({label:e}){return r(mn,{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 w("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 Ol(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Ao(n,t);return r(h,{label:l(e),icon:r(At,{}),changed:!i,action:r(y,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(ko)}),children:tt({swatches:No,current:i?vo:n??t??"",onPick:o,names:Lo})})}}}function lr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=Oo(i,t);return r(h,{label:l(e),icon:r(zt,{}),changed:!a,action:r(y,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Io)}),children:tt({swatches:Ro,current:a?Po:wo(i,t),onPick:o,names:To})})}}}function wl(e=n=>n,t){return G({_gSectionTheme:S(Fo),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(Bn,{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:P(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?P(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?fe(d,{changed:!b,onReset:()=>p(null)}):r(y,{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 Pl(e){const t=K("Gap",r(Ee,{}),ce.min,ce.max,ce.step,yo[e],"px",(n,o)=>r(Vo,{inherited:!Co(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[So]:e,render:n=>t.render({...n,value:_o(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Q="Corners";function de(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(Q),icon:r(Gt,{}),changed:i,action:fe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(ar,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=re()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function ar({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=ve(a)??[...Le];return r(vn,{label:l(Q),value:s,corners:dn,onChange:d=>{const u=ve(d)??[];c(u.length===Le.length?null:u)},radius:t,onRadiusChange:n,radiusMin:D,radiusMax:ye,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return X({type:"custom",render:()=>r(J,{})},"always")}function sr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=H(),i=typeof o=="number"?`${o}px`:l("not set");return r(y,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(i,l("Styles")),onReset:n})}function cr(){const{cornerRadiusPx:e}=H();return typeof e=="number"?e:D}function dr(){return de({sidesKey:"sectionCornerSides",useFollowed:cr,useClosedReason:()=>lt()?l(it):null,mark:r(sr,{label:Q}),hint:r(ur,{})})}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(A())}function ur(){return r(T,{children:lt()?it:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function kl(){return G({_gShape:S("Shape"),sectionCorners:dr(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const pr=()=>({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 fr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function hr(){let e;try{const t=bo(H().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||go.line}function mr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=hr(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=V(()=>Cn(a,c)),u=pr();return r(h,{label:l("Border"),icon:r(Ft,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(gn,{label:l("Border"),value:a,each:s,onChange:f=>t(fr(f)),placeholder:{sides:Sn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:mo})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(mr,{value:t,onChange:n,tier:e})})}function Nl(){return{_gMotion:S("Motion"),sectionAnimation:pe("Entrance",r(_e,{}),[...fn],pn)}}function ue(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Ae(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=H(),n=ue(),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?Ae(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return un(a)?a:o}function gr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=ue(),i=st(D),a=o?"Site":"Section";return r(y,{words:x()?.panel,label:l(e),changed:t,detail:N(`${i}px`,o?l("Styles"):l("the section")),onReset:n})}function br(){return r(T,{children:ue()?l("The section is full width, so this card follows Styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function xr(){return de({sidesKey:"cardCornerSides",useFollowed:()=>st(D),mark:r(gr,{label:Q}),hint:r(br,{})})}function yr(){return{type:"custom",render:()=>r(bt,{})}}function Ll(e){return{...e,render:t=>r(xt,{render:e.render,props:t})}}function vl(){return{_gShape:S("Shape"),cardCorners:xr(),cardCornerSides:rt(),cardCornersApplyAll:yr()}}function Al(){return k("Justify",r(vt,{}),Xe,Xe[0].value)}function Fl(){return k("Item alignment",r(Nt,{}),co,"stretch")}function Dl(){return k(ho,r(sn,{}),ze,ze[0].value)}function Bl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=se.find(o=>o.value===e)??se[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:se.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:Sr(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function Sr(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 Hl(){return k(uo,r(Ee,{}),Ue,Ue[0].value)}function Gl(){return K(po,r(Qt,{}),$e,fo,1,$e)}function Ml(e){const t=pe(ao,Xo("`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)."),so(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function Kl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Ne,{noun:a}),action:r(y,{words:x()?.panel,label:l(e),changed:!Ho(c),detail:l("the Text style in Styles"),onReset:()=>s(Bo),defaultAction:{onPress:()=>s(Do),title:l("Keep this section's own built-in size"),icon:r(Dt,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Wl(){return{_gCellWidth:S("Cell width"),gridSpan:k("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:_t},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function A(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Cr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=A()[c],u=le(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:le(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function _r({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=A()[t],c=le(void 0,a,n);return r(y,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function Ir(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(_r,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Cr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Ul(e){return{type:"custom",render:({value:t,onChange:n})=>r(Tr,{...e,value:t,onChange:n})}}function Er({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:P(t),action:r(y,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:te({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function Tr({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=A()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Er,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Rr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Or={Top:Pe,Bottom:Re,Left:Oe,Right:we},wr=e=>{const t=Or[e];return r(t,{})};function Xl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Rr[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,z,O,ne=E)=>g("mobile",Ir({label:i(_),icon:wr(_),desktopKey:z,min:ne.min,max:ne.max,step:ne.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 G({...o?{_gSpacing:S("Padding")}:{},[t]:R(a(s)),...C?{[B(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:R(K(i("Bottom"),r(Re,{}),E.min,E.max,E.step,d,"px")),...C?{[B(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:R(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[B(u)]:c("Left",u,b,p)}:{},[f]:R(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[B(f)]:c("Right",f,b,p)}:{}}:{}})}const j=["top","right","bottom","left"],Pr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function kr(e,t,n){const o={};for(const i of j)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function Nr({tier:e,o:t}){let n=null;try{n=re()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries(j.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries(j.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=V(()=>yn(a,c));return r(h,{label:l("Padding"),icon:r(Zt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(xn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=kr(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 $l(e={}){const t={...Pr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(j.map(s=>[s,B(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(Nr,{tier:s,o:n})};return o?g(s,d):d},a=()=>X({type:"custom",render:()=>r(J,{})},"always"),c=j.filter(s=>s!=="top");return G({...e.group===!1?{}:{_gSpacing:S("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 dt=e=>typeof e=="number"?e:null;function Lr(e,t,n){const o={};for(const i of["x","y"])n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function vr({o:e}){let t=null;try{t=re()}catch{t=null}const n=t?.values??{},o={x:dt(n[e.keys.x]),y:dt(n[e.keys.y])},i=l(e.label??"Position"),a=!!(o.x||o.y),c=u=>{const f=Lr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},s=r(Dn,{label:i,value:o,onChange:c,words:{x:l("Left and right"),y:l("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=r(y,{words:x()?.panel,label:i,changed:a,detail:"0 px, 0 px",onReset:()=>c({x:null,y:null})});return e.label===null?w("div",{className:"sf-position-line",children:[s,d]}):r(h,{label:i,icon:r(Jt,{}),changed:a,action:d,children:s})}function jl(e){return{[e.keys.x]:{type:"custom",render:()=>r(vr,{o:e})},[e.keys.y]:{...X({type:"custom",render:()=>r(J,{})},"always"),reachedBy:e.keys.x}}}const Ar={contained:"Contained",page:"Page",full:"Full"},ee="Width";function zl(e,t=Go,n=!0){const o=t.map(i=>({label:Mo[i]??Ar[i],value:i}));return G({...n?{_gWidth:S(ee)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(ee),icon:r(an,{}),action:n?r(Yo,{inherited:a?.inherited??!1,onReset:()=>i(Ko),label:ee}):void 0,children:te({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ee})})}})}function Vl(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:$,icon:P(r(Vt,{})),action:o?o(a):void 0,children:te({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:$})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?lo:io;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:$,onChange:i})})}}),n=()=>pe("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return G({_gHeight:S($),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(Fr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Fr({onClear:e}){const t=A(),n=to(t),o=no(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(y,{words:x()?.panel,label:l($),changed:n,detail:i,onReset:e})}function Yl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Dr,{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:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:S(ae),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Dr({value:e,onChange:t,labelId:n,phone:o}){const i=A(),a=ro(i),c=o?a.phone:e===!0;return r(h,{label:l(ae),labelId:n,icon:P(r(nn,{})),action:w(T,{children:[o?r(y,{words:x()?.panel,label:l(ae),changed:oo(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})]})})}const ut="e.g. about";function ql(){return{_gAnchor:S("Anchor"),anchor:v({control:"plainText",label:"Name",placeholder:ut},{type:"custom",render:({value:e,onChange:t})=>r(Pt,{value:e,onChange:t,nameBox:(n,o)=>r(L,{value:n,onChange:o,label:"Name",placeholder:ut,hideable:!1,markup:!1})})})}}function Jl(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(An,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function F(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 Zl(){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:cn(e),onChange:t})})}}}function Ql(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(Ln,{id:c,checked:a,onChange:o})})}}}const ea={follows:"fill"},ta={follows:"ink"};function na(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Br,{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 Br({label:e,part:t,icon:n,value:o,onChange:i}){const a=xo(H().theme),c=t==="fill"?a.fill:a.ink;return r(Hn,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),l("Styles")),onChange:i,onReset:()=>i("")})}const Hr=[{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 pt({label:e,value:t,onChange:n,points:o=Hr}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(Nn,{label:l(e),value:t,points:i,onChange:n})}function oa(){return X({type:"custom",render:()=>r(J,{})},"always")}const Gr=Ce([]);function ra(e,{stacking:t,fallback:n=Rt}){return{type:"custom",render:({value:o,onChange:i})=>{const a=Tt.includes(o)?o:n;return t?r(Mr,{label:e,value:a,onChange:i}):ft({label:e,value:a,onChange:i,points:Gr})}}}function Mr({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?Et(o?.data,a):[];return ft({label:e,value:t,onChange:n,points:Ce(c,a)})}function ft({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(en,{}),hint:i?.title?l(i.title):void 0,children:pt({label:e,value:Ot(t),onChange:n,points:o})})}const ia={top:r(Ut,{}),right:r(Wt,{}),bottom:r(Mt,{}),left:r(Kt,{})};function la(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:pt({label:e,value:m,onChange:p,points:u})})}}}const Kr="\0note";function k(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:P(t),children:r(_n,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Kr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function aa(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 sa(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Qn,{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 ca(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function te({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(bn,{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 da=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function pe(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:P(t),children:te({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function ua(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r(qn,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const pa={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function fa({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 w(h,{label:l(n),icon:r(ie,{}),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&&w("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(ie,{}),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(ie,{}),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 Wr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Ur(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 ha(e,t){return e===null?null:t>e?e:null}function Xr(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 ma={label:"Ticker items",icon:r(qt,{})};function ga(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r($r,{label:e,icon:P(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function $r({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=oe(null),[s,d]=V(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Xr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(In,{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:Wr(n,s),onChange:p=>i(Ur(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 ba(e,t){const n=`${e.label} — row ${t+1}`;return v({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(L,{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 xa(e){return{_gCards:S("Cards"),coverIndex:k("Cover image",r(Yt,{}),zn,String(Vn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:lr("Image background",Eo),cardImage:zr(),spinOnHover:F("Rotate on hover",e?.spinDefault??!0,r(on,{}))}}function ya(){return{outline:k("Card outline",r(rn,{}),Xn,jn),indexBadge:k("Card number",r(Te,{}),Un,$n),showBadge:F("Product badge",!0,r(Ne,{noun:"tag"}))}}function Sa(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:S("Show on a card"),showCardPrice:F("Price",!0,r(Xt,{})),showCardFinishes:F("Finish swatches",!0,r($t,{})),showCardSizes:F("Sizes",n.showCardSizes,r(tn,{})),showCardBuy:F("Buy button",n.showCardBuy,r(Bt,{})),showCardPage:F("Page button",n.showCardPage,r(ke,{}))}}function Ca(e,t="display"){const n=B(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(ht,{parts:e,changed:Tn(o),shown:a=>Rn(o,a),onPress:(a,c)=>i(Pn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(jr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function ht({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(Lt,{}),changed:t,action:r(y,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(En,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function jr({parts:e,desktopKey:t,value:n,onChange:o}){const i=A()[t];return r(ht,{parts:e,changed:wn(n),shown:a=>On(i,n,a),onPress:(a,c)=>o(kn(n,a,c)),onReset:()=>o(Kn),detail:l("the same as Desktop")})}function zr(){return nt("Card image",{min:D,max:ye,step:yt,hint:"Rounds the picture. The card's own corner is in Styles."})}function _a(){return de({sidesKey:"cornerSides",step:St,useFollowed:()=>D,mark:r(Vr,{label:Ct}),hint:l("Rounds the picture. Left alone it stays square.")})}function Vr({label:e,changed:t=!1,onReset:n=()=>{}}){return r(y,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Ia(){return{type:"custom",render:({value:e,onChange:t})=>r(Yr,{value:typeof e=="string"?e:"",onChange:t})}}function Yr({value:e,onChange:t}){const[n,o]=V(null),i=Se.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return w(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Ht,{}),children:w("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),It.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(jt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Se.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{Jo as BOUND_TO_POST,cl as BOUND_TO_POST_NOTE,bl as BUCKET_ICONS,pa as CUSTOM_FIELD_MEDIA,fa as CoordsField,ia as EDGE_ARROWS,Fn as FOCAL_DEFAULT,Hr as FOCAL_POINTS,Y as FOLD_FIELD_MARKER,ea as FOLLOWS_SITE_BUTTON,ta as FOLLOWS_SITE_BUTTON_INK,pt as FocalPicker,ir as GroupLabel,Zo as HIGHLIGHT_HINT,L as HidableTextField,ge as LINK_FIELD_MARKER,tl as Label,be as MEDIA_FIELD_MARKER,da as MEDIA_TYPE_OPTIONS,dl as NOT_BOUND_TO_POST,or as PanelNoteLine,Tr as PhoneChoiceRow,Er as PhoneChoiceStrip,ft as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Oa as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Pr as SIDE_PAD_KEYS,tr as SectionHeading,te as Segmented,Vo as SiteGapDefaultReset,M as Slider,tt as Swatches,Ra as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,ma as TICKER_ITEMS_ROW,$r as TextListField,Yo as WidthDefaultReset,Xr as aimAfterListChange,ql as anchorFields,N as backTo,Ol as backgroundField,Fl as boxAlignField,Hl as boxBlockSpacingField,Al as boxJustifyField,Gl as boxPhoneRowField,Bl as boxShareField,Dl as boxWrapField,_l as bucketHeader,xr as cardCornersField,lr as cardImageBackgroundField,zr as cardImageField,xa as cardMediaFields,vl as cardShapeFields,Sa as cardShowFields,ya as cardStyleFields,Wl as cellWidthFields,Ql as checkbox,na as colorInput,hl as copyText,rt as cornerSidesField,de as cornersRowField,Jl as dateTime,El as designGroupHeader,Ml as directionField,Ca as displayFields,la as edgePad,xl as entriesHiddenForTab,ha as focusAfterRemove,oa as focusKeptField,Tl as foldMarker,q as foldMetaOf,rr as foldTitleOf,Ia as galleryLayoutField,Pl as gapField,S as group,Vl as heightFields,me as hidableText,er as hintIsWhileTyping,P as iconOf,_a as imageCornersField,sl as inOwnBox,Cl as isBucketHeader,Il as isDesignGroupHeader,$o as isNoGlyph,ml as linkField,aa as multiSelect,Xo as noGlyph,Zl as pageBackgroundField,yl as panelNote,Ul as phoneChoiceField,Ir as phoneOverrideField,ra as placementField,fl as plainText,gl as plainTextarea,jl as positionFields,Lr as positionPatch,nt as pxField,Rl as quietMarker,he as readHidable,Wr as rowText,sa as searchSelect,Sl as section,Nl as sectionAnimationFields,at as sectionBorderField,dr as sectionCornersField,kl as sectionShapeFields,wl as sectionThemeFields,pe as segmented,k as select,Ur as setRowText,G as sharedStyleKinds,$l as sidesPaddingFields,kr as sidesPaddingPatch,Kl as sizeField,K as slider,ca as sourceField,Xl as spacingFields,Yl as stickFields,Ll as templateField,ul as text,gt as textFieldIdentifier,rl as textFieldOffPage,ll as textFieldPanelOnly,ga as textList,ba as textListRowField,pl as textarea,F as toggle,ua as upload,jo as usePageWidthDetail,A as useSelectedProps,ot as useSelectedSibling,zo as useSiteGapDetail,zl as widthField,al as withIdentifier,ol as withOffPage,il as withPanelOnly,nl as withScaffold};