efficient-web-builder 39.0.0 → 40.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/editor/components/PagesPanel.js +1 -1
- package/dist/editor/components/StylesPanel.js +1 -1
- package/dist/editor/components/WebsitePreviewButton.js +1 -1
- package/dist/editor/components/WebsiteScreenParts.js +1 -1
- package/dist/editor/lib/puck/controls.js +1 -1
- package/dist/format/lib/host-document-bridge.d.ts +3 -1
- package/dist/format/lib/host-document-bridge.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 40.0.0 - 2026-10-25
|
|
4
|
+
|
|
5
|
+
**MAJOR for hosts:** peer and dev `efficient-easel` are `^20.2.0` (a peer range narrowed, harness CI-3; 20.2.0 is the first easel with `barView`, the slot the website's Preview icon now stands in).
|
|
6
|
+
|
|
7
|
+
### Changed (Preview is an icon after Refresh)
|
|
8
|
+
|
|
9
|
+
- **The website's Preview is an icon right after Refresh** (owner 2026-10-25: "next to the refresh button, lose the text"). It is the layer's `barView` (efficient-easel 20.2), drawn as the bar's own icons are (`EaselIconButton`; on the live-site link, the shell's `iconButtonClasses` at the bar's glyph size), its words in the Tooltip and its name: "Preview your saved draft in a new tab", or the live site's. It leaves `barTrail`.
|
|
10
|
+
- **The Pages and Site styles heads draw no Hide panel**: since efficient-easel 20.2 the left panel hides from the first control of its tab row, on every view.
|
|
11
|
+
- Guards follow: `test-editor-rail-in-topbar` prices the tab row's Hide panel and divider (read from easel's `screen.css`) and counts no Media tab; `test-publish-main-action` holds that Preview is named, not worded; `test-save-as-template-action` ends its slice at `barView`.
|
|
12
|
+
- **Peer and dev `efficient-easel` are `^20.2.0`** (were `^20.0.0`): 20.2.0 is the first easel with `barView` (efficient-easel#357). `test-two-ways-to-add` holds the new range.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Changed (a host is told what each custom row stores)
|
|
16
|
+
|
|
17
|
+
- **`describeBlocks` describes a custom settings row by the kind of value it stores** (JARVIS in the Storefront editor; a browser run on 2026-10-25 read every HeroSlide row as `type: "custom"`, so the backend could check a change by its size alone). A builder declares what its control writes, as plain JSON under `FIELD_DESCRIPTION_MARKER` (`describedAs`, `lib/host-document-bridge`): `plainText`, `copyText` and `linkField` are `text`, `plainTextarea` is `textarea`; `text` and `textarea`, the rows with an eye, are an `object` of `text` and `hidden`, because that is what they write; `textList` is an `array` of `{ text }`; `select` and `searchSelect` are `select` with the options on the field; `segmented` is `radio` with its options; `toggle` and `checkbox` are `radio` of `true` and `false` (no words: a host reads the values); `slider` is `number`. Each carries its label. A row drawn by a control of its own (a media picker, a colour, a focus point, a size or a gap) declares nothing and stays `custom`. The shape is easel's `EaselFieldDescription` as it is; nothing new is sent unless a host asks for the block types.
|
|
18
|
+
- Guards: `scripts/test-host-document-bridge.ts` describes the real HeroSlide rows: `name` is `text`, `process` the `{ text, hidden }` object, `mediaType` a `radio`, `videoSpeed` and `overlay` `number`, the uploads, focus points and tint colour `custom`, all plain JSON.
|
|
19
|
+
|
|
3
20
|
## 39.0.0 - 2026-10-24
|
|
4
21
|
|
|
5
22
|
**MAJOR for hosts:** `components/floating-editor/tokens` (`tk`) is deleted; the canvas accent is `CANVAS_ACCENT` (`format/lib/canvas-accent`) (#269). A settings panel has one kind of group heading, the folding band; "Surfaces" and "Ticker" leave the label catalogue (#272). Peer and dev `efficient-easel` are `^20.0.0` (a peer range narrowed; easel 20 carries the host messages for page edits, #301).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as $,jsxs as w}from"react/jsx-runtime";import{Fragment as
|
|
1
|
+
"use client";import{jsx as t,Fragment as $,jsxs as w}from"react/jsx-runtime";import{Fragment as Se,useEffect as Ae,useId as Ie,useMemo as ee,useRef as Re,useState as d}from"react";import{useScreenDocument as De}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as x}from"efficient-easel/draw/client";import xe from"efficient-easel/screen/components/SidePanelHead";import{useWebsiteName as Ne}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as ve}from"efficient-easel/chrome";import{Button as ne,Dialog as Ee,FormField as Oe,Input as te,PopupMenu as Le,PopupMenuItem as oe,toast as ae}from"efficient-shell/ui";import{LayersTree as Be,TreeGroupLabel as Fe,TreeRow as le,TreeRowAction as N}from"efficient-easel/tree";import{AddIcon as Me,DuplicateIcon as _e,PageIcon as ze}from"efficient-easel/icons";import{PagesIcon as Ge}from"efficient-easel/rail";import{useEaselHost as We}from"efficient-easel/screen/lib/host";import{bucketEditorPageRows as He,DYNAMIC_PAGES_GROUP_KEY as Te,isDynamicPageRow as Ue,MAIN_PAGES_GROUP as je}from"../../format/lib/editor-page-rows.js";import{useEaselSession as qe}from"efficient-easel/screen/lib/session-context";import{holdPageRow as W,usePageRows as Ke}from"../lib/page-rows.js";import{say as n}from"../../format/lib/editor-words.js";import{canDuplicatePage as Ye,uniqueSlug as se,usePageDuplicate as Je}from"../lib/page-copy.js";import Qe from"./DuplicatePageDialog.js";import{newPopupPage as Ve}from"../../format/lib/popup/new-popup.js";const ie="sf-editor-pages-collapsed-groups";function Xe({onNavigate:u,onClose:Ze,activeSurface:H,onPreviewSurface:re}){const k=qe().chrome?.pageRows,T=We(),{adapter:p,capabilities:m,ready:v,currentSlug:U}=De(),de=Ne(),{rows:c,reload:E,setRows:j,getRows:ce}=Ke(),[O,ue]=d(""),[i,C]=d(!1),[S,g]=d(null),[q,A]=d(!1),[f,L]=d(""),K=Ie(),B=Je(),[pe,F]=d(null),[M,me]=d(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(ie);return new Set(e?JSON.parse(e):[])}catch{return new Set}});Ae(()=>{try{window.localStorage.setItem(ie,JSON.stringify([...M]))}catch{}},[M]);const ge=e=>me(a=>{const o=new Set(a);return o.has(e)?o.delete(e):o.add(e),o}),fe=ee(()=>He(c??[]),[c]),_=O.trim().toLowerCase(),Y=e=>!_||e.toLowerCase().includes(_),he=e=>_?!0:!M.has(e),I=ee(()=>new Set((c??[]).map(e=>e.slug)),[c]),J=()=>{if(m.pageCreationInAdminForm){T.send("storefront-editor:new-page");return}L(""),g(null),A(!0)},Q=async()=>{const e=f.trim();if(!(!e||!v||i||!p.createPage)){C(!0),g(null);try{const a=await p.createPage({slug:se(e,I),title:e,layout:{}});await E(),A(!1),L(""),u(a.slug)}catch{g(n("Couldn’t add the page — please retry."))}finally{C(!1)}}},R=m.hasSiteSettings&&!!p.createPage,be=async()=>{if(!(!v||i||!p.createPage)){C(!0),g(null);try{const e=await p.createPage(Ve(n("New popup"),I));await E(),u(e.slug)}catch{g(n("Couldn’t add the popup — please retry."))}finally{C(!1)}}},V=Re(null),[h,b]=d(null),Pe=()=>{if(!R)return J();if(h)return b(null);const e=V.current?.getBoundingClientRect();e&&b({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)})},ye=e=>{const a=c??[],o=p.deletePage;if(!v||i||!o||a.length<=1)return;const s=a.findIndex(l=>l.id===e.id),r=a.filter(l=>l.id!==e.id),P=e.slug===U;W(e.id,!0),j(r),g(null),P&&r[0]&&u(r[0].slug);const D=()=>{W(e.id,!1);const l=ce()??[];if(l.some(Ce=>Ce.id===e.id))return;const y=[...l];y.splice(Math.max(0,Math.min(s,y.length)),0,e),j(y)};ae.undoable(n("Deleted “{name}”",{name:e.label}),{actionLabel:n("Undo"),commit:async l=>{await o(e.id,l),W(e.id,!1)},undo:()=>{D(),P&&u(e.slug)},onFail:()=>{D(),ae.error(n("Couldn’t delete the page — please retry."))}})},we=e=>T.send("storefront-editor:open-page",{slug:e}),ke=e=>{if(!Y(e.label))return null;const a=!H&&e.slug===U,o=m.canDeletePagesInline&&(c??[]).length>1,s=Ue(e),r=e.kind==="lightbox",P=[...s?[{label:n("Dynamic"),tone:"info"}]:[],...r?[{label:n("Lightbox"),tone:"success"}]:[],...e.draft?[{label:n("draft"),tone:"draft"}]:[]],D=P.length>0?P:void 0,l=!!B&&Ye(e),y=l||m.pageCreationInAdminForm||o?w($,{children:[l&&t(N,{kind:"plain",label:n("Duplicate “{name}”",{name:e.label}),disabled:i,onClick:()=>F(e),children:t(_e,{size:13})}),m.pageCreationInAdminForm&&t(N,{kind:"plain",label:n("Edit “{name}” in {place}",{name:e.label,place:n("the admin")}),onClick:()=>we(e.slug),children:t(x,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})}),o&&t(N,{kind:"delete",label:n("Delete “{name}”",{name:e.label}),disabled:i,onClick:()=>ye(e),children:t(x,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]}):void 0;return t(le,{icon:t(ze,{size:14}),name:e.label,selected:a,onSelect:()=>u(e.slug),badge:D,actions:y,rowProps:{"data-page-slug":e.slug}},e.id)},z=(e,a,o)=>{const s=o.filter(Boolean);if(s.length===0)return null;const r=he(e);return w(Se,{children:[t(Fe,{count:s.length,expanded:r,onToggle:()=>ge(e),children:a}),r&&s]},e)},X=(k?.rows??[]).filter(e=>Y(e.label)).map(e=>{const a=H===e.key;return t(le,{icon:e.icon,name:e.label,selected:a,onSelect:()=>re(e.key),badge:{label:n("Preview"),tone:"warning"},actions:t(N,{kind:"plain",label:n("Open the {name} in a new tab",{name:e.label}),onClick:()=>window.open(e.href,"_blank","noopener,noreferrer"),children:t(x,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})}),rowProps:{"data-shop-surface":e.key}},e.key)}),Z=m.hasSiteSettings&&!!k,G=(()=>{if(c===null)return null;const e=[];let a=!1;for(const o of fe){Z&&!a&&o.key.startsWith("system:")&&(e.push(z("shop",k.title,X)),a=!0);const s=o.key===Te||o.label===je?n(o.label):o.label;e.push(z(o.key,s,o.rows.map(ke)))}return Z&&!a&&e.push(z("shop",k.title,X)),e})();return w("div",{className:"sf-pages",children:[t(xe,{icon:t(Ge,{}),title:n("Pages"),context:de,actions:t(ve,{buttonRef:V,label:R?n("Add"):n("New page"),hasPopup:R?"menu":void 0,expanded:R?h!==null:void 0,onClick:Pe,children:t(Me,{size:15})})}),h&&t(Le,{portal:!0,style:{top:h.top,right:h.right},onClose:()=>b(null),children:w("div",{role:"menu","aria-label":n("Add"),children:[t(oe,{role:"menuitem",onClick:()=>{b(null),J()},children:n("Page")}),t(oe,{role:"menuitem",disabled:i,onClick:()=>{b(null),be()},children:n("Popup")})]})}),t("div",{className:"sf-pages-find",children:t(te,{type:"search",leftIcon:t(x,{name:"search",size:14,rounded:!0}),placeholder:n("Search all pages…"),value:O,onChange:e=>ue(e.target.value),"aria-label":n("Search all pages")})}),S&&!q&&t("div",{className:"sf-note sf-note--error",role:"alert",children:S}),G===null?t("div",{className:"sf-note",children:n("Loading…")}):G.some(Boolean)?t(Be,{ariaLabel:n("Pages"),className:"sf-scroll",children:G}):t("div",{className:"sf-note",children:O.trim()?n("No pages match your search"):n("No pages yet. Add one with + above.")}),B&&t(Qe,{source:pe,taken:I,duplicate:B,onClose:()=>F(null),onDuplicated:e=>{F(null),E(),u(e.slug)}}),t(Ee,{open:q,onClose:()=>A(!1),size:"sm",title:n("Add a page"),description:n("Give the new template page a name. It starts blank — add sections once it opens."),footer:w($,{children:[t(ne,{variant:"secondary",onClick:()=>A(!1),children:n("Cancel")}),t(ne,{onClick:()=>{Q()},disabled:i||!f.trim(),loading:i,children:n("Add page")})]}),children:t(Oe,{label:n("Page name"),htmlFor:K,hint:f.trim()?n("URL: /{slug}",{slug:se(f,I)}):void 0,error:S??void 0,children:t(te,{id:K,value:f,invalid:!!S,onChange:e=>L(e.target.value),onKeyDown:e=>{e.key==="Enter"&&Q()},placeholder:n("e.g. About")})})})]})}export{Xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as m}from"react/jsx-runtime";import r,{useWebsiteName as c}from"./WebsiteSettingsPanel.js";import f 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 d}from"efficient-shell/ui";function y({tokenRef:n,siteId:o,onClose:S,onNotify:i,tab:a,onTabChange:l}){const t=c();return m("div",{className:"sf-styles",children:[e(f,{icon:e(p,{}),title:s("Styles"),context:e(d,{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})})}),e("div",{className:"sf-insp-body es-insp-body sf-scroll",children:e(r,{tokenRef:n,siteId:o,onNotify:i,tab:a,onTabChange:l})})]})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{ExternalIcon as c}from"efficient-easel/icons";import{EaselIconButton as p}from"efficient-easel/chrome";import{Tooltip as f,iconButtonClasses as b}from"efficient-shell/ui";import{say as a}from"../../format/lib/editor-words.js";function m({pageId:t,liveHref:e,draftLink:r,win:s=window}){const n=s.open("","_blank");if(n)try{n.opener=null}catch{}const l=i=>{n&&!n.closed?n.location.href=i:s.open(i,"_blank","noopener,noreferrer")};return r(t).then(i=>l(i.url??e),()=>l(e))}function x({liveHref:t,pageId:e,draftLink:r}){return r&&e?o(p,{label:a("Preview your saved draft in a new tab"),tip:a("Open your saved draft in a new tab. Visitors don't see it."),onClick:()=>{m({pageId:e,liveHref:t,draftLink:r})},children:o(c,{})}):o(f,{content:a("Preview the live site (opens in a new tab)"),side:"bottom",children:o("a",{className:b({className:"es-iconbtn"}),href:t,target:"_blank",rel:"noopener noreferrer","aria-label":a("Preview the live site in a new tab"),children:o(c,{})})})}export{x as WebsitePreviewButton,m as openDraftPreview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,Fragment as B,jsxs as _}from"react/jsx-runtime";import{useCallback as R,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 D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as y}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 Ee}from"efficient-easel/draw/client";import{usePreviewHeader as he}from"../../render/components/PreviewHeaderContext.js";import{usePreviewSocial as we}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Te,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 H,heroMediaRows as ve,heroPartId as W,readHeroPartId as ke}from"../../render/lib/puck/hero-media-parts.js";import _e,{CHAT_MODE as Re,HEADER_MODE as M,SOCIAL_MODE as Ce,WEBSITE_MODE as V}from"./SectionEditor.js";import C from"./SectionIcon.js";import Oe from"./SectionThumbnail.js";import{useScreenDocument as O}from"efficient-easel/screen/components/ScreenDocumentContext";import Le from"./StylesPanel.js";import{LOCATIONS_TYPE as Ae,useLocationsTree as Be}from"./useLocationsTree.js";import{usePinnedChromeSeed as De}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ne}from"./useHostDocumentBridge.js";import{usePreviewHref as ye}from"./usePreviewHref.js";import{WebsitePreviewButton as He}from"./WebsitePreviewButton.js";import{SITE_STYLES_TABS as We,SITE_STYLES_TEXT_TAB as Me,useWebsiteName as Ve}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as xe}from"./useWebsiteMainAction.js";import{VersionHistory as Ye}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Fe}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ge,heroGroupNestDepth as ze}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ke}from"../../format/lib/markup.js";import{categoryShortLabel as je,PINNED_SECTION_TYPE as Ue}from"../lib/puck/add-palette.js";import{canAddTo as Ze}from"../lib/puck/add-target.js";import{blockIsOffered as qe}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Xe,setBookingPreview as Je}from"../../render/lib/puck/booking-preview.js";import{footerBlockRowName as Qe}from"../../format/lib/puck/footer-block-row-name.js";import{sourceRowName as $e}from"../../format/lib/puck/source-row-name.js";import{FOOTER_TYPE as et,HEADER_TYPE as Y}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as tt,readLeftView as ot,resolveLeftView as rt,writeLeftView as nt}from"../../format/lib/puck/left-view.js";import{websiteIsLockedBlock as it}from"../lib/puck/locked-blocks.js";import{everyPageNotice as st,noOwnTab as at,pinnedReach as F,websiteDuplicateBlocked as ct}from"../lib/puck/every-page.js";import{sharedSectionReach as dt,WEBSITE_SHARED_SECTIONS as lt}from"../lib/shared-sections-layer.js";import{activeSharedSections as L,setSharedEditor as G}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as pt}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as mt,scrollPreviewToTop as z}from"efficient-easel/screen/lib/puck/preview-dom";import{SiteCanvas as ft}from"../lib/puck/overrides.js";import{labelAtLevel as ut}from"../../format/lib/puck/section-catalog.js";import{WEBSITE_MEDIA_DROP as St}from"../../format/lib/puck/media-drop.js";import{editorWords as Et,say as p}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ht}from"../../format/lib/puck/section-descriptions.js";import{groupAccepts as wt,isSectionGroupType as Pt,sectionGroupZone as Tt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as bt}from"../../format/lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as gt,SAVE_AS_TEMPLATE_EVENT as It}from"../../format/lib/save-as-template-action.js";import{newSectionNode as vt}from"../lib/sections/new-section-node.js";import{useHostProducts as kt}from"../lib/use-host-products.js";import{backendOf as _t}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=be(),c=y().tree,d=e,n=d.kind==="ticker"?d.heroId:null,a=R(s=>{if(!s)return;t({kind:"ticker",heroId:s}),mt(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(D,{icon:i(C,{type:"ticker",size:13}),name:p(Te),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=y().tree,{appState:d}=N(f=>f),n=d.data.content??[],a=oe(n);a.current=n;const s=e,u=Ie.find(f=>H[f]===s.kind),m=u&&"nodeId"in s?W(String(s.nodeId),u):null,h=R(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 T={kind:H[l.part],nodeId:l.nodeId};t({index:w},T)},[t]);return P(()=>{o(m)},[m,o]),P(()=>{r(h)},[r,h]),{partRows:(f,{rowClick:l})=>{const w=String(f.props.id),T=ve(f);if(T.length===0)return null;const S=I=>{const g=W(w,I.part);return i(D,{icon:i(C,{type:I.part==="media"?"heroMedia":"heroImage",size:13}),name:p(I.label),onSelect:()=>h(g),selected:m===g,rowProps:{onClick:l(()=>h(g))},words:c},g)},[E,...b]=T;return _(B,{children:[S(E),b.length>0&&i(pe,{children:b.map(S)})]})}}}function Z(e,t){return{partRows:(o,r)=>_(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Rt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:a,notifyParent:s,token:u}=O(),{hasPreviewLink:m}=o,h=_t(x()).preview?.draftLink,f=xe(e.data),l=gt({hasTrustedConsole:!!u,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),w=R(()=>{!c||!r||s(It,{siteId:c,slug:r})},[s,c,r]),T=ye({pageSlug:r,siteId:c,token:u}),S=t.previewHref?.(r)??T;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(He,{liveHref:S,pageId:d??null,draftLink:h}),mainAction:f}}function Ct(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=O(),{hasSiteTheme:a,explainsSiteSettings:s}=o,u=E=>t.setView(E),[m,h]=re(We[0].id),{surface:f,setSurface:l}=Pe(),w=()=>{if(a){u("styles"),t.reveal(),z();return}e.show(V),e.reveal(),z()},T={id:"pages",label:p("Pages"),icon:i(ae,{}),panel:({onHide:E})=>i(fe,{activeSurface:f,onPreviewSurface:l,onNavigate:b=>{l(null),n(r?{kind:"template",id:r,pageSlug:b}:{kind:"page",slug:b,siteId:c??void 0})},onClose:E})},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:E,notify:b})=>i(Le,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:b,tab:m,onTabChange:h})}),{railLead:[T],railTrail:S,resolveLeftView:E=>rt(E,a),openSettings:w,openStyles:()=>{h(Me),u("styles")}}}function Ot(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=O(),c=N(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=L();if(!n||!r)return;let a=!1;return pt(d).list().then(s=>{a||n.learn(s)}).catch(()=>{}),()=>{a=!0}},[r,d])}function Lt(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:a}=t;P(()=>{Je(n?.type==="BookingBox"&&n.props.region==="confirm"?Xe(a(String(n.props.id))):null)},[n?.props.id]);const s=Be(e,t),{capabilities:{hasSiteSettings:u}}=O();Ot();const{setSelected:m,setSelectHandler:h}=he(),{chat:f,setChat:l,setSelected:w,setSelectHandler:T}=ue(),S=c==="header";P(()=>{m(S)},[S,m]),P(()=>{h(()=>d(M))},[h,d]);const E=R(()=>d(Re),[d]),b=c==="chat";P(()=>{w(b)},[b,w]),P(()=>{T(E)},[T,E]);const{setOpenHandler:I}=we(),g=R(()=>d(Ce),[d]);P(()=>{I(g)},[I,g]);const J=Z(j(e),U(e)),Q=Rt(t),$=Ct(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:_(Ee.Provider,{value:ee,children:[k,i(Ye,{})]})}),addPanelRow:k=>u?_("div",{className:"sf-addside-sitewide",children:[i("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:i(C,{type:"chat",size:16})}),_("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),E()},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 At(e){const t=Et();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 Bt={isLockedBlock:(e,t)=>it(e)||!!(t&&L()?.heldElsewhere(t.props.id)),duplicateBlocked:ct,nestDepth:(e,t,o)=>t===Ge?ze(e,o):0,newSectionNode:vt,canAddTo:(e,t)=>At(Ze(e,t)),blockIsOffered:qe},Dt=new Proxy(ht,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?p(o):o}}),Nt={labelAtLevel:(e,t,o)=>p(ut(e,t,o)),descriptions:Dt,categoryLabel:e=>{const t=je(e);return t===void 0?void 0:p(t)},firstSection:Ue,blockRowName:Qe,rowName:$e,plainText:Ke,Icon:C,Thumbnail:Oe,useProducts:kt},yt={desktop:2e3,tablet:800,mobile:390},X="desktop",Ht={options:Se,initial:X,fluid:X,widths:yt},Wt={read:ot,write:e=>nt(e),forSelection:(e,t)=>tt(e,t)},Mt={first:Y,last:et,firstGroup:bt,lastGroup:K,isSectionGroup:Pt,sectionGroupZone:Tt,panelOf:e=>e===Y?M:null,get sharedReach(){return v()?xt:void 0},get shared(){return L()?lt:void 0},get groupTab(){return v()?at:void 0},get groupBadge(){return v()?F({type:K})??void 0:void 0},get changeNotice(){return v()?st():void 0},get band(){return v()?Vt:void 0},get groupAccepts(){return v()?wt:void 0}},Vt={foldable:!0},xt=e=>F(e)??dt(e);function Yt(e){return{...Z(j(e),U(e)),openSettings:()=>e.show(V)}}function Ft(e,t){De(e,t),Ne()}const $o={useOwnerName:Ve,useDocumentLabel:Fe,useBridges:Lt,useStandaloneBridges:Yt,useDocumentPass:Ft,blockRules:Bt,blockLook:Nt,devices:Ht,leftView:Wt,pinned:Mt,Canvas:ft,canvasDrag:{media:St},Inspector:_e};export{$o as WEBSITE_SCREEN};
|
|
1
|
+
"use client";import{jsx as i,Fragment as B,jsxs as _}from"react/jsx-runtime";import{useCallback as R,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 D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as y}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 Ee}from"efficient-easel/draw/client";import{usePreviewHeader as he}from"../../render/components/PreviewHeaderContext.js";import{usePreviewSocial as we}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Te,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 H,heroMediaRows as ve,heroPartId as W,readHeroPartId as ke}from"../../render/lib/puck/hero-media-parts.js";import _e,{CHAT_MODE as Re,HEADER_MODE as V,SOCIAL_MODE as Ce,WEBSITE_MODE as M}from"./SectionEditor.js";import C from"./SectionIcon.js";import Oe from"./SectionThumbnail.js";import{useScreenDocument as O}from"efficient-easel/screen/components/ScreenDocumentContext";import Le from"./StylesPanel.js";import{LOCATIONS_TYPE as Ae,useLocationsTree as Be}from"./useLocationsTree.js";import{usePinnedChromeSeed as De}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ne}from"./useHostDocumentBridge.js";import{usePreviewHref as ye}from"./usePreviewHref.js";import{WebsitePreviewButton as He}from"./WebsitePreviewButton.js";import{SITE_STYLES_TABS as We,SITE_STYLES_TEXT_TAB as Ve,useWebsiteName as Me}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as xe}from"./useWebsiteMainAction.js";import{VersionHistory as Ye}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Fe}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ge,heroGroupNestDepth as ze}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ke}from"../../format/lib/markup.js";import{categoryShortLabel as je,PINNED_SECTION_TYPE as Ue}from"../lib/puck/add-palette.js";import{canAddTo as Ze}from"../lib/puck/add-target.js";import{blockIsOffered as qe}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Xe,setBookingPreview as Je}from"../../render/lib/puck/booking-preview.js";import{footerBlockRowName as Qe}from"../../format/lib/puck/footer-block-row-name.js";import{sourceRowName as $e}from"../../format/lib/puck/source-row-name.js";import{FOOTER_TYPE as et,HEADER_TYPE as Y}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as tt,readLeftView as ot,resolveLeftView as rt,writeLeftView as nt}from"../../format/lib/puck/left-view.js";import{websiteIsLockedBlock as it}from"../lib/puck/locked-blocks.js";import{everyPageNotice as st,noOwnTab as at,pinnedReach as F,websiteDuplicateBlocked as ct}from"../lib/puck/every-page.js";import{sharedSectionReach as dt,WEBSITE_SHARED_SECTIONS as lt}from"../lib/shared-sections-layer.js";import{activeSharedSections as L,setSharedEditor as G}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as pt}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as mt,scrollPreviewToTop as z}from"efficient-easel/screen/lib/puck/preview-dom";import{SiteCanvas as ft}from"../lib/puck/overrides.js";import{labelAtLevel as ut}from"../../format/lib/puck/section-catalog.js";import{WEBSITE_MEDIA_DROP as St}from"../../format/lib/puck/media-drop.js";import{editorWords as Et,say as p}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ht}from"../../format/lib/puck/section-descriptions.js";import{groupAccepts as wt,isSectionGroupType as Pt,sectionGroupZone as Tt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as bt}from"../../format/lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as gt,SAVE_AS_TEMPLATE_EVENT as It}from"../../format/lib/save-as-template-action.js";import{newSectionNode as vt}from"../lib/sections/new-section-node.js";import{useHostProducts as kt}from"../lib/use-host-products.js";import{backendOf as _t}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=be(),c=y().tree,d=e,n=d.kind==="ticker"?d.heroId:null,a=R(s=>{if(!s)return;t({kind:"ticker",heroId:s}),mt(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(D,{icon:i(C,{type:"ticker",size:13}),name:p(Te),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=y().tree,{appState:d}=N(f=>f),n=d.data.content??[],a=oe(n);a.current=n;const s=e,u=Ie.find(f=>H[f]===s.kind),m=u&&"nodeId"in s?W(String(s.nodeId),u):null,h=R(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 T={kind:H[l.part],nodeId:l.nodeId};t({index:w},T)},[t]);return P(()=>{o(m)},[m,o]),P(()=>{r(h)},[r,h]),{partRows:(f,{rowClick:l})=>{const w=String(f.props.id),T=ve(f);if(T.length===0)return null;const S=I=>{const g=W(w,I.part);return i(D,{icon:i(C,{type:I.part==="media"?"heroMedia":"heroImage",size:13}),name:p(I.label),onSelect:()=>h(g),selected:m===g,rowProps:{onClick:l(()=>h(g))},words:c},g)},[E,...b]=T;return _(B,{children:[S(E),b.length>0&&i(pe,{children:b.map(S)})]})}}}function Z(e,t){return{partRows:(o,r)=>_(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Rt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:a,notifyParent:s,token:u}=O(),{hasPreviewLink:m}=o,h=_t(x()).preview?.draftLink,f=xe(e.data),l=gt({hasTrustedConsole:!!u,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),w=R(()=>{!c||!r||s(It,{siteId:c,slug:r})},[s,c,r]),T=ye({pageSlug:r,siteId:c,token:u}),S=t.previewHref?.(r)??T;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")})})}),barView:()=>m&&r&&i(He,{liveHref:S,pageId:d??null,draftLink:h}),mainAction:f}}function Ct(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=O(),{hasSiteTheme:a,explainsSiteSettings:s}=o,u=E=>t.setView(E),[m,h]=re(We[0].id),{surface:f,setSurface:l}=Pe(),w=()=>{if(a){u("styles"),t.reveal(),z();return}e.show(M),e.reveal(),z()},T={id:"pages",label:p("Pages"),icon:i(ae,{}),panel:({onHide:E})=>i(fe,{activeSurface:f,onPreviewSurface:l,onNavigate:b=>{l(null),n(r?{kind:"template",id:r,pageSlug:b}:{kind:"page",slug:b,siteId:c??void 0})},onClose:E})},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:E,notify:b})=>i(Le,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:b,tab:m,onTabChange:h})}),{railLead:[T],railTrail:S,resolveLeftView:E=>rt(E,a),openSettings:w,openStyles:()=>{h(Ve),u("styles")}}}function Ot(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=O(),c=N(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=L();if(!n||!r)return;let a=!1;return pt(d).list().then(s=>{a||n.learn(s)}).catch(()=>{}),()=>{a=!0}},[r,d])}function Lt(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:a}=t;P(()=>{Je(n?.type==="BookingBox"&&n.props.region==="confirm"?Xe(a(String(n.props.id))):null)},[n?.props.id]);const s=Be(e,t),{capabilities:{hasSiteSettings:u}}=O();Ot();const{setSelected:m,setSelectHandler:h}=he(),{chat:f,setChat:l,setSelected:w,setSelectHandler:T}=ue(),S=c==="header";P(()=>{m(S)},[S,m]),P(()=>{h(()=>d(V))},[h,d]);const E=R(()=>d(Re),[d]),b=c==="chat";P(()=>{w(b)},[b,w]),P(()=>{T(E)},[T,E]);const{setOpenHandler:I}=we(),g=R(()=>d(Ce),[d]);P(()=>{I(g)},[I,g]);const J=Z(j(e),U(e)),Q=Rt(t),$=Ct(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:_(Ee.Provider,{value:ee,children:[k,i(Ye,{})]})}),addPanelRow:k=>u?_("div",{className:"sf-addside-sitewide",children:[i("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:i(C,{type:"chat",size:16})}),_("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),E()},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 At(e){const t=Et();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 Bt={isLockedBlock:(e,t)=>it(e)||!!(t&&L()?.heldElsewhere(t.props.id)),duplicateBlocked:ct,nestDepth:(e,t,o)=>t===Ge?ze(e,o):0,newSectionNode:vt,canAddTo:(e,t)=>At(Ze(e,t)),blockIsOffered:qe},Dt=new Proxy(ht,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?p(o):o}}),Nt={labelAtLevel:(e,t,o)=>p(ut(e,t,o)),descriptions:Dt,categoryLabel:e=>{const t=je(e);return t===void 0?void 0:p(t)},firstSection:Ue,blockRowName:Qe,rowName:$e,plainText:Ke,Icon:C,Thumbnail:Oe,useProducts:kt},yt={desktop:2e3,tablet:800,mobile:390},X="desktop",Ht={options:Se,initial:X,fluid:X,widths:yt},Wt={read:ot,write:e=>nt(e),forSelection:(e,t)=>tt(e,t)},Vt={first:Y,last:et,firstGroup:bt,lastGroup:K,isSectionGroup:Pt,sectionGroupZone:Tt,panelOf:e=>e===Y?V:null,get sharedReach(){return v()?xt:void 0},get shared(){return L()?lt:void 0},get groupTab(){return v()?at:void 0},get groupBadge(){return v()?F({type:K})??void 0:void 0},get changeNotice(){return v()?st():void 0},get band(){return v()?Mt:void 0},get groupAccepts(){return v()?wt:void 0}},Mt={foldable:!0},xt=e=>F(e)??dt(e);function Yt(e){return{...Z(j(e),U(e)),openSettings:()=>e.show(M)}}function Ft(e,t){De(e,t),Ne()}const $o={useOwnerName:Me,useDocumentLabel:Fe,useBridges:Lt,useStandaloneBridges:Yt,useDocumentPass:Ft,blockRules:Bt,blockLook:Nt,devices:Ht,leftView:Wt,pinned:Vt,Canvas:ft,canvasDrag:{media:St},Inspector:_e};export{$o as WEBSITE_SCREEN};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as R,Fragment as I}from"react/jsx-runtime";import{cloneElement as he,useId as mt,useRef as oe,useState as W}from"react";import{useEasel as U,useSelectedFields as re}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as me,hidableText as ge}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Y,LINK_FIELD_MARKER as be,MEDIA_FIELD_MARKER as xe,SCAFFOLD_FIELD_MARKER as ye,TEXT_FIELD_MARKER as E,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 Se,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 X,GALLERY_LAYOUT_KEYS as Ce}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 _e}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 Ie,BackgroundIcon as At,BorderAllIcon as Ft,BlockSectionIcon as Dt,CartIcon as Bt,ColumnWidthsIcon as Ee,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 Te,GridIcon as jt,GroundIcon as zt,HashIcon as Re,HeightIcon as Vt,ImageIcon as Yt,ListIcon as qt,LocationIcon as ie,NudgeIcon as Jt,PaddingAllIcon as Zt,PaddingBottomIcon as Oe,PaddingLeftIcon as we,PaddingRightIcon as Pe,PaddingTopIcon as ke,PageIcon as Ne,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 Le}from"../../components/FieldGlyph.js";import{resolvePageBackground as cn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as ve,CORNER_SIDE_POINTS as dn,hasOwnSectionCorners as un,normalizeCornerSides as Ae}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 Fe}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as m,SettingsGroup as hn,SettingsGroupSub as mn,SettingsBorder as gn,SettingsSegmented as bn,SettingsSides as xn,SettingsSidesEach as De,sidesStartEach as yn,SettingsSwitch as Be,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 He,PositionInput as Dn,Slider as Bn,Tooltip as Ge}from"efficient-shell/ui";import{ColourRow as Me,InheritedColourRow as Hn}from"./ColourControl.js";import Ke 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 $}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 We}from"efficient-easel/draw/client";import{SECTION_PADDING as T}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 j,SECTION_SCREEN_PCT as lo}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as ao,containerDirectionPoints as so,resolveContainerDirection as Ue}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as co,BOX_BLOCK_SPACING_LABEL as uo,BOX_BLOCK_SPACING_POINTS as Xe,BOX_JUSTIFY_POINTS as $e,BOX_PHONE_ROW_LABEL as po,BOX_PHONE_ROW_MAX as fo,BOX_PHONE_ROW_MIN as je,BOX_SHARE_LABEL as ze,BOX_SHARE_POINTS as se,BOX_WRAP_LABEL as ho,BOX_WRAP_POINTS as Ve}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 Ye}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Uo}from"./panel-heading-scope.js";import{withStyleKind as Xo}from"efficient-easel/style-clipboard";import{useEaselSession as $o}from"efficient-easel/screen/lib/session-context";import{backendOf as jo}from"../website-session.js";function G(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!q(n)&&Xo(n,`section:${t}`);return e}function ol({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function zo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function Vo(e){return e.type===qe}function P(e){return Vo(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function Yo(){const{appState:e}=U(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 qo(){const{blockGap:e}=H();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function Jo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:qo(),onReset:t})}function Zo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Yo(),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}=me(e),f=oe(null),p=oe(null),h=w=>t(c?{text:w,hidden:u}:w),b=()=>t({text:d,hidden:!u}),C=c&&u,O=mt(),_=i?or(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(wt,{children:l(i)}):void 0,V=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(m,{label:l(n),icon:r(ln,{}),htmlFor:O,className:C?"is-hidden":void 0,hint:_,action:c?r(Ge,{content:V,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":V,onClick:b,children:u?r(We,{name:"eye-off",size:14}):r(We,{name:"eye",size:14})})}):void 0,children:R("div",{className:"sf-copybox",children:[s&&r(Ke,{target:a?p:f,value:d,onChange:h}),a?r("textarea",{id:O,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:w=>h(w.target.value)}):r("input",{id:O,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:w=>h(w.target.value)})]})})}function rl(e,t){return{...e,[ye]:t}}function il(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function ll(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}const Je="sfPanelOnly";function al(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function sl(e){return!!e&&typeof e=="object"&&e[Je]===!0}function cl(e){const t=e[E];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[E]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as ka,SCALAR_TEXT_CONTROLS as Na}from"efficient-easel/draw";function dl(e,t){if(!e[E])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,[E]:e};if(!Qo.has(e.control))return n;const o=t.render;return{...$(n,"authored-copy"),render:i=>r(Wn,{name:i.name,children:o(i)})}},ul="Everything else on this block comes from the linked post. Unlink it to edit by hand.",er={field:"source.slug",set:!0},pl={not:er},tr="Select a word, then press the highlighter.",nr=new Set([tr]),or=e=>nr.has(e);function fl(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 hl(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 ml(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 gl(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 bl(e){return{type:"custom",[be]:{label:e},render:({value:t,onChange:n})=>r(eo,{value:ge(t),onChange:n,label:e})}}function xl(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 yl={Design:kt,Animation:Ie};function Sl(e,t){return e.includes("Design")?t!=="Design":null}function Ze(e,t){return{type:"custom",[Y]:{label:e,level:t},marker:!0,fold:e,render:()=>r(I,{})}}function S(e){return Ze(e,2)}function Cl(e){return{type:"custom",render:()=>r(rr,{text:e})}}function rr({text:e}){return r("p",{className:"sf-note",children:l(e)})}function _l(e){return Ze(e,1)}function Il(e){return q(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function El(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(I,{})};return Qe.set(n,o),o}function Tl(e){return q(e)!==null&&e?.designGroup!==void 0}const et=new Map;function Rl(e){const t=et.get(e)??{type:"custom",[Y]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(I,{})};return et.set(e,t),t}function ir(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ol(e,t){return ir(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(I,{})}}function wl(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(I,{})}}function Pl({title:e,children:t}){const[n,o]=W(()=>!de.has(e));return r(hn,{title:e,open:n,onToggle:i=>{o(i),i?de.delete(e):de.add(e)},children:t})}const de=new Set;function kl({label:e}){return r(mn,{title:l(e),level:Uo(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 R("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(Ge,{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 Nl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Ao(n,t);return r(m,{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(m,{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 Ll(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",boxSize:"md",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(m,{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 h=typeof f=="number"?f:null,b=h===null;return r(m,{label:l(e),icon:u?P(u):void 0,value:b?d||a===void 0?void 0:l(a):`${h}px`,changed:!b,action:d?he(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:h,label:e,onChange:p}):M({min:n,max:o,step:i,value:h??n,readout:!1,ariaLabel:e,onChange:p})})}}}function vl(e){const t=K("Gap",r(Te,{}),ce.min,ce.max,ce.step,yo[e],"px",(n,o)=>r(Jo,{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 ue(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(m,{label:l(Q),icon:r(Gt,{}),changed:i,action:he(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=Ae(a)??[...ve];return r(vn,{label:l(Q),value:s,corners:dn,onChange:d=>{const u=Ae(d)??[];c(u.length===ve.length?null:u)},radius:t,onRadiusChange:n,radiusMin:D,radiusMax:Se,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return $({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 ue({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 Ye(A())}function ur(){return r(I,{children:lt()?it:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function Al(){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]=W(()=>Cn(a,c)),u=pr();return r(m,{label:l("Border"),icon:r(Ft,{}),action:r(De,{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 Fl(){return{_gMotion:S("Motion"),sectionAnimation:fe("Entrance",r(Ie,{}),[...fn],pn)}}function pe(){let e=null;try{const{appState:t,selectedItem:n}=U(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Fe(t?.data,o):null}catch{e=null}return e!==null&&Ye(e)}function st(e){const{cornerRadiusPx:t}=H(),n=pe(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=U(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?Fe(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=pe(),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(I,{children:pe()?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 ue({sidesKey:"cardCornerSides",useFollowed:()=>st(D),mark:r(gr,{label:Q}),hint:r(br,{})})}function yr(){return{type:"custom",render:()=>r(bt,{})}}function Dl(e){return{...e,render:t=>r(xt,{render:e.render,props:t})}}function Bl(){return{_gShape:S("Shape"),cardCorners:xr(),cardCornerSides:rt(),cardCornersApplyAll:yr()}}function Hl(){return k("Justify",r(vt,{}),$e,$e[0].value)}function Gl(){return k("Item alignment",r(Nt,{}),co,"stretch")}function Ml(){return k(ho,r(sn,{}),Ve,Ve[0].value)}function Kl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=se.find(o=>o.value===e)??se[0];return r(m,{label:l(ze),icon:r(Ee,{}),value:l(n.label),children:r(He,{className:"sf-gallery-layouts",label:l(ze),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 Wl(){return k(uo,r(Te,{}),Xe,Xe[0].value)}function Ul(){return K(po,r(Qt,{}),je,fo,1,je)}function Xl(e){const t=fe(ao,zo("`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),Ue(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Ue(e,n.value),onChange:o=>n.onChange(o)})}}function $l(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(m,{label:l(e),icon:r(Le,{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 jl(){return{_gCellWidth:S("Cell width"),gridSpan:k("Positions",r(Ee,{}),[{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=U(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(I,{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 zl(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(m,{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:ke,Bottom:Oe,Left:we,Right:Pe},wr=e=>{const t=Or[e];return r(t,{})};function Vl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Rr[_],a=_=>K(i("Top"),r(ke,{}),T.min,T.max,T.step,_,"px"),c=(_,V,w,ne=T)=>g("mobile",Ir({label:i(_),icon:wr(_),desktopKey:V,min:ne.min,max:ne.max,step:ne.step,fallback:w})),s=e.top??T.min,d=e.bottom??T.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??T,h=e.side??p.min,b=e.sidePhone??h,C=e.phone===!0,O=_=>C?g("desktop",_):_;return G({...o?{_gSpacing:S("Padding")}:{},[t]:O(a(s)),...C?{[B(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:O(K(i("Bottom"),r(Oe,{}),T.min,T.max,T.step,d,"px")),...C?{[B(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:O(K(i("Left"),r(we,{}),p.min,p.max,p.step,h,"px")),...C?{[B(u)]:c("Left",u,b,p)}:{},[f]:O(K(i("Right"),r(Pe,{}),p.min,p.max,p.step,h,"px")),...C?{[B(f)]:c("Right",f,b,p)}:{}}:{}})}const z=["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 z)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(z.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries(z.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=W(()=>yn(a,c));return r(m,{label:l("Padding"),icon:r(Zt,{}),action:r(De,{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 Yl(e={}){const t={...Pr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(z.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=()=>$({type:"custom",render:()=>r(J,{})},"always"),c=z.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?R("div",{className:"sf-position-line",children:[s,d]}):r(m,{label:i,icon:r(Jt,{}),changed:a,action:d,children:s})}function ql(e){return{[e.keys.x]:{type:"custom",render:()=>r(vr,{o:e})},[e.keys.y]:{...$({type:"custom",render:()=>r(J,{})},"always"),reachedBy:e.keys.x}}}const Ar={contained:"Contained",page:"Page",full:"Full"},ee="Width";function Jl(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(m,{label:l(ee),icon:r(an,{}),action:n?r(Zo,{inherited:a?.inherited??!1,onReset:()=>i(Ko),label:ee}):void 0,children:te({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ee})})}})}function Zl(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(m,{label:j,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:j})})}),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:j,onChange:i})})}}),n=()=>fe("Unit",r(Re,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return G({_gHeight:S(j),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(j),changed:n,detail:i,onReset:e})}function Ql(){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(m,{label:l(ae),labelId:n,icon:P(r(nn,{})),action:R(I,{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(Be,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const ut="e.g. about";function ea(){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 ta(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(m,{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(m,{label:l(e),labelId:d,icon:n,action:r(Be,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function na(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(Me,{label:l("Background"),icon:r(Ne,{}),id:i,value:cn(e),onChange:t})}}}function oa(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(m,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(Ln,{id:c,checked:a,onChange:o})})}}}const ra={follows:"fill"},ia={follows:"ink"};function la(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(Me,{label:l(e),icon:n,value:o||t,onChange:i})}}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 aa(){return $({type:"custom",render:()=>r(J,{})},"always")}const Gr=_e([]);function sa(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}=U(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:_e(c,a)})}function ft({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(m,{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 ca={top:r(Ut,{}),right:r(Wt,{}),bottom:r(Mt,{}),left:r(Kt,{})};function da(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 h=a?.[f];return h?{value:p.value,label:p.label,icon:h}:{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 h=t.some(b=>b.value===f)?f:n;return r(m,{label:l(e),icon:i,value:c(h)?.label?l(c(h).label):"",children:pt({label:e,value:h,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(m,{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 ua(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 pa(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 fa(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 ha=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function fe(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(m,{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 ma(e,t,n,o={}){return{type:"custom",[xe]:!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 ga={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ba({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=!!jo($o()).geocode,s=(d,u)=>t({...o,[d]:u===""?void 0:Number(u)});return R(m,{label:l(n),icon:r(ie,{}),children:[c&&R(I,{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&&R("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(m,{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:d=>s("lat",d.target.value)})}),r(m,{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:d=>s("lng",d.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 xa(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 ya={label:"Ticker items",icon:r(qt,{})};function Sa(e,t,n,o){return{type:"custom",[E]:{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]=W(null),u=p=>p.map(h=>({text:h?.text??""})),f=p=>{const h=Xr(n,p,s);h===null&&(c.current=null),d(h),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(Ke,{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,h,b)=>r("input",{type:"text",className:a&&s===h?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:h+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(h)}})})}function Ca(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 _a(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 Ia(){return{outline:k("Card outline",r(rn,{}),Xn,jn),indexBadge:k("Card number",r(Re,{}),Un,$n),showBadge:F("Product badge",!0,r(Le,{noun:"tag"}))}}function Ea(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(Ne,{}))}}function Ta(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(m,{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:Se,step:yt,hint:"Rounds the picture. The card's own corner is in Styles."})}function Ra(){return ue({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 Oa(){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]=W(null),i=Ce.filter(c=>n===null||X[c].across===n),a=e&&e in X?X[e]:null;return R(I,{children:[r(m,{label:l("Photos in a row"),icon:r(Ht,{}),children:R("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(m,{label:l("Layout"),icon:r(jt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Ce.length}),children:r(He,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(X[c].label),picture:r("span",{className:"sf-gallery-pic",children:X[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{er as BOUND_TO_POST,ul as BOUND_TO_POST_NOTE,yl as BUCKET_ICONS,ga as CUSTOM_FIELD_MEDIA,ba as CoordsField,ca as EDGE_ARROWS,Fn as FOCAL_DEFAULT,Hr as FOCAL_POINTS,Y as FOLD_FIELD_MARKER,ra as FOLLOWS_SITE_BUTTON,ia as FOLLOWS_SITE_BUTTON_INK,pt as FocalPicker,kl as GroupLabel,tr as HIGHLIGHT_HINT,L as HidableTextField,be as LINK_FIELD_MARKER,ol as Label,xe as MEDIA_FIELD_MARKER,ha as MEDIA_TYPE_OPTIONS,pl as NOT_BOUND_TO_POST,Pl as PanelBand,rr as PanelNoteLine,Tr as PhoneChoiceRow,Er as PhoneChoiceStrip,ft as PlacementGridView,ye as SCAFFOLD_FIELD_MARKER,Na as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Pr as SIDE_PAD_KEYS,te as Segmented,Jo as SiteGapDefaultReset,M as Slider,tt as Swatches,ka as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,ya as TICKER_ITEMS_ROW,$r as TextListField,Zo as WidthDefaultReset,Xr as aimAfterListChange,ea as anchorFields,N as backTo,Nl as backgroundField,Gl as boxAlignField,Wl as boxBlockSpacingField,Hl as boxJustifyField,Ul as boxPhoneRowField,Kl as boxShareField,Ml as boxWrapField,El as bucketHeader,xr as cardCornersField,lr as cardImageBackgroundField,zr as cardImageField,_a as cardMediaFields,Bl as cardShapeFields,Ea as cardShowFields,Ia as cardStyleFields,jl as cellWidthFields,oa as checkbox,la as colorInput,gl as copyText,rt as cornerSidesField,ue as cornersRowField,ta as dateTime,Rl as designGroupHeader,Xl as directionField,Ta as displayFields,da as edgePad,Sl as entriesHiddenForTab,xa as focusAfterRemove,aa as focusKeptField,Ol as foldMarker,q as foldMetaOf,ir as foldTitleOf,Oa as galleryLayoutField,vl as gapField,S as group,Zl as heightFields,ge as hidableText,or as hintIsWhileTyping,P as iconOf,Ra as imageCornersField,dl as inOwnBox,Il as isBucketHeader,Tl as isDesignGroupHeader,Vo as isNoGlyph,bl as linkField,ua as multiSelect,zo as noGlyph,na as pageBackgroundField,Cl as panelNote,zl as phoneChoiceField,Ir as phoneOverrideField,sa as placementField,ml as plainText,xl as plainTextarea,ql as positionFields,Lr as positionPatch,nt as pxField,wl as quietMarker,me as readHidable,Wr as rowText,pa as searchSelect,_l as section,Fl as sectionAnimationFields,at as sectionBorderField,dr as sectionCornersField,Al as sectionShapeFields,Ll as sectionThemeFields,fe as segmented,k as select,Ur as setRowText,G as sharedStyleKinds,Yl as sidesPaddingFields,kr as sidesPaddingPatch,$l as sizeField,K as slider,fa as sourceField,Vl as spacingFields,Ql as stickFields,Dl as templateField,fl as text,gt as textFieldIdentifier,ll as textFieldOffPage,sl as textFieldPanelOnly,Sa as textList,Ca as textListRowField,hl as textarea,F as toggle,ma as upload,Yo as usePageWidthDetail,A as useSelectedProps,ot as useSelectedSibling,qo as useSiteGapDetail,Jl as widthField,cl as withIdentifier,il as withOffPage,al as withPanelOnly,rl as withScaffold};
|
|
1
|
+
"use client";import{jsx as r,jsxs as O,Fragment as I}from"react/jsx-runtime";import{cloneElement as ge,useId as xt,useRef as ie,useState as U}from"react";import{useEasel as j,useSelectedFields as le}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as be,hidableText as xe}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as q,LINK_FIELD_MARKER as ye,MEDIA_FIELD_MARKER as Se,SCAFFOLD_FIELD_MARKER as Ce,TEXT_FIELD_MARKER as E,foldMetaOf as J,textFieldIdentifier as yt}from"efficient-easel/draw";import St from"../../components/ApplyCornersToSiblings.js";import Ct from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as _t,CORNER_RADIUS_MAX as _e,CORNER_RADIUS_MIN as B}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as It,IMAGE_CORNERS_LABEL as Et}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Tt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Ot,GALLERY_LAYOUTS as X,GALLERY_LAYOUT_KEYS as Ie}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as Rt,HERO_GROUP_PLACEMENTS as wt,HERO_GROUP_PLACEMENT_DEFAULT as Pt,normalisePlacement as kt,placementPoints as Ee}from"../../../format/lib/hero-group-placement.js";import Lt from"../../components/KeepHint.js";import Nt from"../../components/AnchorField.js";import{AdjustIcon as vt,AlignLeftIcon as At,EyeIcon as Ft,AlignSeparateIcon as Dt,AnimationIcon as Te,BackgroundIcon as Bt,BorderAllIcon as Ht,BlockSectionIcon as Gt,CartIcon as Mt,ColumnWidthsIcon as Oe,ColumnsIcon as Kt,CornerIcon as Wt,DirectionDownIcon as Ut,DirectionLeftIcon as jt,DirectionRightIcon as Xt,DirectionUpIcon as $t,DollarIcon as zt,FinishIcon as Vt,GapIcon as Re,GridIcon as Yt,GroundIcon as qt,HashIcon as we,HeightIcon as Jt,ImageIcon as Zt,ListIcon as Qt,LocationIcon as ae,NudgeIcon as en,PaddingAllIcon as tn,PaddingBottomIcon as Pe,PaddingLeftIcon as ke,PaddingRightIcon as Le,PaddingTopIcon as Ne,PageIcon as ve,PhoneIcon as nn,PlacementIcon as on,ProductSizeIcon as rn,StickyIcon as ln,RotateIcon as an,SquareIcon as sn,TypeIcon as cn,WidthIcon as dn,WrapIcon as un}from"efficient-easel/icons";import{FieldGlyph as Ae}from"../../components/FieldGlyph.js";import{resolvePageBackground as pn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Fe,CORNER_SIDE_POINTS as fn,hasOwnSectionCorners as hn,normalizeCornerSides as De}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as mn,SECTION_MOTION_OPTIONS as gn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Be}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as m,SettingsGroup as bn,SettingsGroupSub as xn,SettingsBorder as yn,SettingsSegmented as Sn,SettingsSides as Cn,SettingsSidesEach as He,sidesStartEach as _n,SettingsSwitch as Ge,borderSides as In,borderStartEach as En}from"efficient-easel/panel";import{FieldSelect as Tn,ListField as On}from"efficient-easel/fields";import{DisplayChips as Rn}from"efficient-shell/ui";import{desktopDisplayChanged as wn,partShownOnDesktop as Pn,partShownOnPhone as kn,phoneDisplayChanged as Ln,withDesktopPart as Nn,withPhonePart as vn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as An,Checkbox as Fn,CornersInput as Dn,DateTimePicker as Bn,FOCAL_DEFAULT as Hn,PictureTiles as Me,PositionInput as Gn,Slider as Mn,Tooltip as Ke}from"efficient-shell/ui";import{ColourRow as We,InheritedColourRow as Kn}from"./ColourControl.js";import Ue from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as Wn,NoControlMark as Z,noControlField as $}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Un}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as jn,phoneKey as H,resolvePhoneValue as se}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Xn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as $n,CARD_OUTLINE_OPTIONS as zn,DEFAULT_CARD_INDEX_FORMAT as Vn,DEFAULT_CARD_OUTLINE as Yn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as qn,DEFAULT_COVER_INDEX as Jn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Zn}from"efficient-easel/draw";import Qn from"../../components/MediaUploadField.js";import eo from"../../components/MultiSelectField.js";import to from"../../components/SectionThemePicker.js";import no from"../../components/SearchSelectField.js";import oo from"../../components/StorefrontLinkField.js";import{UiIcon as je}from"efficient-easel/draw/client";import{SECTION_PADDING as T}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as ro,resolveSectionMinHeight as io}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Q,SECTION_STICK_LABEL as ce,hasPhoneStick as lo,resolveSectionStick as ao}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as so,SECTION_MIN_HEIGHT_GROUP_LABEL as z,SECTION_SCREEN_PCT as co}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as uo,containerDirectionPoints as po,resolveContainerDirection as Xe}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as fo,BOX_BLOCK_SPACING_LABEL as ho,BOX_BLOCK_SPACING_POINTS as $e,BOX_JUSTIFY_POINTS as ze,BOX_PHONE_ROW_LABEL as mo,BOX_PHONE_ROW_MAX as go,BOX_PHONE_ROW_MIN as Ve,BOX_SHARE_LABEL as Ye,BOX_SHARE_POINTS as de,BOX_WRAP_LABEL as bo,BOX_WRAP_POINTS as qe}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as G}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as xo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as yo,normalizeTheme as So,siteButtonPaint as Co}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ue,CONTAINER_GAP_BUILT_IN as _o,GAP_FIELD_CONTAINER as Io,hasOwnContainerGap as Eo,resolveContainerGap as To}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Oo,CARD_IMAGE_BG_OFF as Ro,CARD_IMAGE_BG_SWATCH_NAMES as wo,CARD_IMAGE_BG_SWATCHES as Po,isCardImageBackgroundInheriting as ko,cardImageBackgroundChoice as Lo,THEME_CARD_IMAGE_BG as No}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as vo,SECTION_BG_SWATCHES as Ao,SECTION_BG_SWATCH_NAMES as Fo,THEME_SECTION_BG as Do,isSectionBackgroundInheriting as Bo}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Ho}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Go,TYPE_SIZE_INHERIT as Mo,isTypeSizeInheriting as Ko}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Wo,WIDTH_CHOICE_LABEL as Uo,WIDTH_INHERIT as jo,resolveWidth as Xo,sectionRunsFullWidth as Je}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as $o}from"./panel-heading-scope.js";import{withStyleKind as zo}from"efficient-easel/style-clipboard";import{useEaselSession as Vo}from"efficient-easel/screen/lib/session-context";import{backendOf as Yo}from"../website-session.js";import{describedAs as R}from"../../../format/lib/host-document-bridge.js";function M(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!J(n)&&zo(n,`section:${t}`);return e}function al({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function Ze(){return null}function qo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(Ze,{},e)}function Jo(e){return e.type===Ze}function k(e){return Jo(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function Zo(){const{appState:e}=j(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Xo(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 Qo(){const{blockGap:e}=G();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function er({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Qo(),onReset:t})}function tr({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Zo(),onReset:t})}function v({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=be(e),f=ie(null),p=ie(null),h=P=>t(c?{text:P,hidden:u}:P),b=()=>t({text:d,hidden:!u}),C=c&&u,w=xt(),_=i?lr(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(Lt,{children:l(i)}):void 0,Y=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(m,{label:l(n),icon:r(cn,{}),htmlFor:w,className:C?"is-hidden":void 0,hint:_,action:c?r(Ke,{content:Y,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":Y,onClick:b,children:u?r(je,{name:"eye-off",size:14}):r(je,{name:"eye",size:14})})}):void 0,children:O("div",{className:"sf-copybox",children:[s&&r(Ue,{target:a?p:f,value:d,onChange:h}),a?r("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:P=>h(P.target.value)}):r("input",{id:w,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:P=>h(P.target.value)})]})})}function sl(e,t){return{...e,[Ce]:t}}function cl(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function dl(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}const Qe="sfPanelOnly";function ul(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Qe]:!0}}function pl(e){return!!e&&typeof e=="object"&&e[Qe]===!0}function fl(e){const t=e[E];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[E]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Aa,SCALAR_TEXT_CONTROLS as Fa}from"efficient-easel/draw";function hl(e,t){if(!e[E])throw new Error("inOwnBox: the field holds no authored text");const{[Wn]:o,...i}=e;return{...i,[Un]:!0,render:t}}const nr=new Set(Zn),ee={type:"radio",options:[{value:!0},{value:!1}]},et={text:{type:"object",objectFields:{text:{type:"text"},hidden:ee}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:ee}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},A=(e,t)=>{const n=R({...t,[E]:e},{...et[e.control],label:e.label});if(!nr.has(e.control))return n;const o=t.render;return{...$(n,"authored-copy"),render:i=>r(Xn,{name:i.name,children:o(i)})}},ml="Everything else on this block comes from the linked post. Unlink it to edit by hand.",or={field:"source.slug",set:!0},gl={not:or},rr="Select a word, then press the highlighter.",ir=new Set([rr]),lr=e=>ir.has(e);function bl(e,t,n){return A({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(v,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function xl(e,t,n){return A({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(v,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function yl(e,t,n){return A({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(v,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Sl(e,t,n){return A({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(v,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function Cl(e){return{type:"custom",[ye]:{label:e},...R({},{type:"text",label:e}),render:({value:t,onChange:n})=>r(oo,{value:xe(t),onChange:n,label:e})}}function _l(e,t,n){return A({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(v,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Il={Design:vt,Animation:Te};function El(e,t){return e.includes("Design")?t!=="Design":null}function tt(e,t){return{type:"custom",[q]:{label:e,level:t},marker:!0,fold:e,render:()=>r(I,{})}}function S(e){return tt(e,2)}function Tl(e){return{type:"custom",render:()=>r(ar,{text:e})}}function ar({text:e}){return r("p",{className:"sf-note",children:l(e)})}function Ol(e){return tt(e,1)}function Rl(e){return J(e)!==null&&e?.tabs!==void 0}const nt=new Map;function wl(e,t){const n=`${e}\0${t?t.join(""):""}`,o=nt.get(n)??{type:"custom",tabs:t,[q]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(I,{})};return nt.set(n,o),o}function Pl(e){return J(e)!==null&&e?.designGroup!==void 0}const ot=new Map;function kl(e){const t=ot.get(e)??{type:"custom",[q]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(I,{})};return ot.set(e,t),t}function sr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ll(e,t){return sr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(I,{})}}function Nl(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(I,{})}}function vl({title:e,children:t}){const[n,o]=U(()=>!pe.has(e));return r(bn,{title:e,open:n,onToggle:i=>{o(i),i?pe.delete(e):pe.add(e)},children:t})}const pe=new Set;function Al({label:e}){return r(xn,{title:l(e),level:$o(2)})}function rt({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 O("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(Ke,{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 Fl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Bo(n,t);return r(m,{label:l(e),icon:r(Bt,{}),changed:!i,action:r(y,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(vo)}),children:rt({swatches:Ao,current:i?Do:n??t??"",onPick:o,names:Fo})})}}}function cr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=ko(i,t);return r(m,{label:l(e),icon:r(qt,{}),changed:!a,action:r(y,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Oo)}),children:rt({swatches:Po,current:a?No:Lo(i,t),onPick:o,names:wo})})}}}function Dl(e=n=>n,t){return M({_gSectionTheme:S(Ho),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(to,{value:e(n),onChange:o,followLabel:t})}})}function K({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(Mn,{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",boxSize:"md",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function W(e,t,n,o,i,a,c="",s){return{type:"custom",...R({},{type:"number",label:e}),render:d=>r(m,{label:l(e),icon:k(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:K({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function it(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 h=typeof f=="number"?f:null,b=h===null;return r(m,{label:l(e),icon:u?k(u):void 0,value:b?d||a===void 0?void 0:l(a):`${h}px`,changed:!b,action:d?ge(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:h,label:e,onChange:p}):K({min:n,max:o,step:i,value:h??n,readout:!1,ariaLabel:e,onChange:p})})}}}function Bl(e){const t=W("Gap",r(Re,{}),ue.min,ue.max,ue.step,_o[e],"px",(n,o)=>r(er,{inherited:!Eo(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[Io]:e,render:n=>t.render({...n,value:To(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const te="Corners";function fe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(m,{label:l(te),icon:r(Wt,{}),changed:i,action:ge(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(dr,{tier:e,px:o,onRadius:n})})}}}function lt(e){let t=null;try{t=le()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function dr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=lt(e.sidesKey),s=De(a)??[...Fe];return r(Dn,{label:l(te),value:s,corners:fn,onChange:d=>{const u=De(d)??[];c(u.length===Fe.length?null:u)},radius:t,onRadiusChange:n,radiusMin:B,radiusMax:_e,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function at(){return $({type:"custom",render:()=>r(Z,{})},"always")}function ur({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=G(),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 pr(){const{cornerRadiusPx:e}=G();return typeof e=="number"?e:B}function fr(){return fe({sidesKey:"sectionCornerSides",useFollowed:pr,useClosedReason:()=>ct()?l(st):null,mark:r(ur,{label:te}),hint:r(hr,{})})}const st="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function ct(){return Je(F())}function hr(){return r(I,{children:ct()?st:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function Hl(){return M({_gShape:S("Shape"),sectionCorners:fr(),sectionCornerSides:at(),sectionBorder:dt("desktop"),sectionBorderPhone:dt("mobile")})}const mr=()=>({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 gr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function br(){let e;try{const t=So(G().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||yo.line}function xr({value:e,onChange:t,tier:n}){const[o]=lt("sectionBorder"),i=br(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=U(()=>En(a,c)),u=mr();return r(m,{label:l("Border"),icon:r(Ht,{}),action:r(He,{each:s,label:l("Each side"),onChange:d}),children:r(yn,{label:l("Border"),value:a,each:s,onChange:f=>t(gr(f)),placeholder:{sides:In(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:xo})})}function dt(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(xr,{value:t,onChange:n,tier:e})})}function Gl(){return{_gMotion:S("Motion"),sectionAnimation:me("Entrance",r(Te,{}),[...gn],mn)}}function he(){let e=null;try{const{appState:t,selectedItem:n}=j(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Be(t?.data,o):null}catch{e=null}return e!==null&&Je(e)}function ut(e){const{cornerRadiusPx:t}=G(),n=he(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=j(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?Be(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return hn(a)?a:o}function yr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=he(),i=ut(B),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 Sr(){return r(I,{children:he()?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 Cr(){return fe({sidesKey:"cardCornerSides",useFollowed:()=>ut(B),mark:r(yr,{label:te}),hint:r(Sr,{})})}function _r(){return{type:"custom",render:()=>r(St,{})}}function Ml(e){return{...e,render:t=>r(Ct,{render:e.render,props:t})}}function Kl(){return{_gShape:S("Shape"),cardCorners:Cr(),cardCornerSides:at(),cardCornersApplyAll:_r()}}function Wl(){return L("Justify",r(Dt,{}),ze,ze[0].value)}function Ul(){return L("Item alignment",r(At,{}),fo,"stretch")}function jl(){return L(bo,r(un,{}),qe,qe[0].value)}function Xl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=de.find(o=>o.value===e)??de[0];return r(m,{label:l(Ye),icon:r(Oe,{}),value:l(n.label),children:r(Me,{className:"sf-gallery-layouts",label:l(Ye),value:n.value,onChange:t,options:de.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:Ir(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function Ir(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 $l(){return L(ho,r(Re,{}),$e,$e[0].value)}function zl(){return W(mo,r(nn,{}),Ve,go,1,Ve)}function Vl(e){const t=me(uo,qo("`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)."),po(e),Xe(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Xe(e,n.value),onChange:o=>n.onChange(o)})}}function Yl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(m,{label:l(e),icon:r(Ae,{noun:a}),action:r(y,{words:x()?.panel,label:l(e),changed:!Ko(c),detail:l("the Text style in Styles"),onReset:()=>s(Mo),defaultAction:{onPress:()=>s(Go),title:l("Keep this section's own built-in size"),icon:r(Gt,{})}}),children:K({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function ql(){return{_gCellWidth:S("Cell width"),gridSpan:L("Positions",r(Oe,{}),[{label:"Auto",value:""},...Array.from({length:Tt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function F(){let e=null;try{e=j(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Er({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=F()[c],u=se(void 0,d,s);return r(I,{children:K({min:e,max:t,step:n,value:se(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function Tr({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=F()[t],c=se(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 Or(e){return it(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(Tr,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Er,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Jl(e){return{type:"custom",render:({value:t,onChange:n})=>r(wr,{...e,value:t,onChange:n})}}function Rr({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(m,{label:l(e),icon:k(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:oe({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function wr({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=F()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Rr,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Pr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},kr={Top:Ne,Bottom:Pe,Left:ke,Right:Le},Lr=e=>{const t=kr[e];return r(t,{})};function Zl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Pr[_],a=_=>W(i("Top"),r(Ne,{}),T.min,T.max,T.step,_,"px"),c=(_,Y,P,re=T)=>g("mobile",Or({label:i(_),icon:Lr(_),desktopKey:Y,min:re.min,max:re.max,step:re.step,fallback:P})),s=e.top??T.min,d=e.bottom??T.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??T,h=e.side??p.min,b=e.sidePhone??h,C=e.phone===!0,w=_=>C?g("desktop",_):_;return M({...o?{_gSpacing:S("Padding")}:{},[t]:w(a(s)),...C?{[H(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:w(W(i("Bottom"),r(Pe,{}),T.min,T.max,T.step,d,"px")),...C?{[H(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:w(W(i("Left"),r(ke,{}),p.min,p.max,p.step,h,"px")),...C?{[H(u)]:c("Left",u,b,p)}:{},[f]:w(W(i("Right"),r(Le,{}),p.min,p.max,p.step,h,"px")),...C?{[H(f)]:c("Right",f,b,p)}:{}}:{}})}const V=["top","right","bottom","left"],Nr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},pt=e=>typeof e=="number"?e:null;function vr(e,t,n){const o={};for(const i of V)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function Ar({tier:e,o:t}){let n=null;try{n=le()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries(V.map(u=>[u,pt(o[i[u]])])),c=Object.fromEntries(V.map(u=>[u,String(e==="mobile"?pt(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=U(()=>_n(a,c));return r(m,{label:l("Padding"),icon:r(tn,{}),action:r(He,{each:s,label:l("Each side"),onChange:d}),children:r(Cn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=vr(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 Ql(e={}){const t={...Nr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(V.map(s=>[s,H(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(Ar,{tier:s,o:n})};return o?g(s,d):d},a=()=>$({type:"custom",render:()=>r(Z,{})},"always"),c=V.filter(s=>s!=="top");return M({...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 ft=e=>typeof e=="number"?e:null;function Fr(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 Dr({o:e}){let t=null;try{t=le()}catch{t=null}const n=t?.values??{},o={x:ft(n[e.keys.x]),y:ft(n[e.keys.y])},i=l(e.label??"Position"),a=!!(o.x||o.y),c=u=>{const f=Fr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},s=r(Gn,{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?O("div",{className:"sf-position-line",children:[s,d]}):r(m,{label:i,icon:r(en,{}),changed:a,action:d,children:s})}function ea(e){return{[e.keys.x]:{type:"custom",render:()=>r(Dr,{o:e})},[e.keys.y]:{...$({type:"custom",render:()=>r(Z,{})},"always"),reachedBy:e.keys.x}}}const Br={contained:"Contained",page:"Page",full:"Full"},ne="Width";function ta(e,t=Wo,n=!0){const o=t.map(i=>({label:Uo[i]??Br[i],value:i}));return M({...n?{_gWidth:S(ne)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(m,{label:l(ne),icon:r(dn,{}),action:n?r(tr,{inherited:a?.inherited??!1,onReset:()=>i(jo),label:ne}):void 0,children:oe({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ne})})}})}function na(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(m,{label:z,icon:k(r(Jt,{})),action:o?o(a):void 0,children:oe({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:z})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?co:so;return r("div",{className:"sf-field",children:K({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:z,onChange:i})})}}),n=()=>me("Unit",r(we,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return M({_gHeight:S(z),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(Hr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Hr({onClear:e}){const t=F(),n=ro(t),o=io(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(y,{words:x()?.panel,label:l(z),changed:n,detail:i,onReset:e})}function oa(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Gr,{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:K({min:Q.min,max:Q.max,step:Q.step,value:typeof n=="number"?n:Q.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:S(ce),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Gr({value:e,onChange:t,labelId:n,phone:o}){const i=F(),a=ao(i),c=o?a.phone:e===!0;return r(m,{label:l(ce),labelId:n,icon:k(r(ln,{})),action:O(I,{children:[o?r(y,{words:x()?.panel,label:l(ce),changed:lo(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(Ge,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const ht="e.g. about";function ra(){return{_gAnchor:S("Anchor"),anchor:A({control:"plainText",label:"Name",placeholder:ht},{type:"custom",render:({value:e,onChange:t})=>r(Nt,{value:e,onChange:t,nameBox:(n,o)=>r(v,{value:n,onChange:o,label:"Name",placeholder:ht,hideable:!1,markup:!1})})})}}function ia(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(m,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(Bn,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function D(e,t,n){return{type:"custom",...R({},{...ee,label:e}),render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(m,{label:l(e),labelId:d,icon:n,action:r(Ge,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function la(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(We,{label:l("Background"),icon:r(ve,{}),id:i,value:pn(e),onChange:t})}}}function aa(e,t){return{type:"custom",...R({},{...ee,label:e}),render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(m,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(Fn,{id:c,checked:a,onChange:o})})}}}const sa={follows:"fill"},ca={follows:"ink"};function da(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Mr,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(We,{label:l(e),icon:n,value:o||t,onChange:i})}}function Mr({label:e,part:t,icon:n,value:o,onChange:i}){const a=Co(G().theme),c=t==="fill"?a.fill:a.ink;return r(Kn,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),l("Styles")),onChange:i,onReset:()=>i("")})}const Kr=[{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 mt({label:e,value:t,onChange:n,points:o=Kr}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(An,{label:l(e),value:t,points:i,onChange:n})}function ua(){return $({type:"custom",render:()=>r(Z,{})},"always")}const Wr=Ee([]);function pa(e,{stacking:t,fallback:n=Pt}){return{type:"custom",render:({value:o,onChange:i})=>{const a=wt.includes(o)?o:n;return t?r(Ur,{label:e,value:a,onChange:i}):gt({label:e,value:a,onChange:i,points:Wr})}}}function Ur({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=j(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?Rt(o?.data,a):[];return gt({label:e,value:t,onChange:n,points:Ee(c,a)})}function gt({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(m,{label:l(e),icon:r(on,{}),hint:i?.title?l(i.title):void 0,children:mt({label:e,value:kt(t),onChange:n,points:o})})}const fa={top:r($t,{}),right:r(Xt,{}),bottom:r(Ut,{}),left:r(jt,{})};function ha(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 h=a?.[f];return h?{value:p.value,label:p.label,icon:h}:{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 h=t.some(b=>b.value===f)?f:n;return r(m,{label:l(e),icon:i,value:c(h)?.label?l(c(h).label):"",children:mt({label:e,value:h,onChange:p,points:u})})}}}const jr="\0note";function L(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},...R({},{type:"select",label:e}),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(m,{label:l(e),icon:k(t),children:r(Tn,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:jr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function ma(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(eo,{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 ga(e,t,n,o){return{type:"custom",options:t,fallback:n,...R({},{type:"select",label:e}),render:({value:i,onChange:a,field:c})=>r(no,{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 ba(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function oe({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(Sn,{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 xa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function me(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",...R({},{type:"radio",label:e,options:i.map(a=>({value:a.value,label:a.label}))}),render:({value:a,onChange:c,field:s})=>r(m,{label:l(e),icon:k(t),children:oe({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function ya(e,t,n,o={}){return{type:"custom",[Se]:!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 Sa={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ca({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=!!Yo(Vo()).geocode,s=(d,u)=>t({...o,[d]:u===""?void 0:Number(u)});return O(m,{label:l(n),icon:r(ae,{}),children:[c&&O(I,{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&&O("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(m,{label:l("Latitude"),icon:r(ae,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:d=>s("lat",d.target.value)})}),r(m,{label:l("Longitude"),icon:r(ae,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:d=>s("lng",d.target.value)})})]})]})}function Xr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function $r(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 _a(e,t){return e===null?null:t>e?e:null}function zr(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 Ia={label:"Ticker items",icon:r(Qt,{})};function Ea(e,t,n,o){return{type:"custom",[E]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...R({},{...et.textList,label:e}),render:({value:i,onChange:a})=>r(Vr,{label:e,icon:k(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Vr({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=ie(null),[s,d]=U(null),u=p=>p.map(h=>({text:h?.text??""})),f=p=>{const h=zr(n,p,s);h===null&&(c.current=null),d(h),i(u(p))};return r(On,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Ue,{target:c,value:Xr(n,s),onChange:p=>i($r(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,h,b)=>r("input",{type:"text",className:a&&s===h?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:h+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(h)}})})}function Ta(e,t){const n=`${e.label} — row ${t+1}`;return A({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(v,{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 Oa(e){return{_gCards:S("Cards"),coverIndex:L("Cover image",r(Zt,{}),qn,String(Jn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:cr("Image background",Ro),cardImage:qr(),spinOnHover:D("Rotate on hover",e?.spinDefault??!0,r(an,{}))}}function Ra(){return{outline:L("Card outline",r(sn,{}),zn,Yn),indexBadge:L("Card number",r(we,{}),$n,Vn),showBadge:D("Product badge",!0,r(Ae,{noun:"tag"}))}}function wa(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:D("Price",!0,r(zt,{})),showCardFinishes:D("Finish swatches",!0,r(Vt,{})),showCardSizes:D("Sizes",n.showCardSizes,r(rn,{})),showCardBuy:D("Buy button",n.showCardBuy,r(Mt,{})),showCardPage:D("Page button",n.showCardPage,r(ve,{}))}}function Pa(e,t="display"){const n=H(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(bt,{parts:e,changed:wn(o),shown:a=>Pn(o,a),onPress:(a,c)=>i(Nn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(Yr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function bt({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(m,{label:c,icon:r(Ft,{}),changed:t,action:r(y,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(Rn,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function Yr({parts:e,desktopKey:t,value:n,onChange:o}){const i=F()[t];return r(bt,{parts:e,changed:Ln(n),shown:a=>kn(i,n,a),onPress:(a,c)=>o(vn(n,a,c)),onReset:()=>o(jn),detail:l("the same as Desktop")})}function qr(){return it("Card image",{min:B,max:_e,step:_t,hint:"Rounds the picture. The card's own corner is in Styles."})}function ka(){return fe({sidesKey:"cornerSides",step:It,useFollowed:()=>B,mark:r(Jr,{label:Et}),hint:l("Rounds the picture. Left alone it stays square.")})}function Jr({label:e,changed:t=!1,onReset:n=()=>{}}){return r(y,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function La(){return{type:"custom",render:({value:e,onChange:t})=>r(Zr,{value:typeof e=="string"?e:"",onChange:t})}}function Zr({value:e,onChange:t}){const[n,o]=U(null),i=Ie.filter(c=>n===null||X[c].across===n),a=e&&e in X?X[e]:null;return O(I,{children:[r(m,{label:l("Photos in a row"),icon:r(Kt,{}),children:O("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),Ot.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(m,{label:l("Layout"),icon:r(Yt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Ie.length}),children:r(Me,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(X[c].label),picture:r("span",{className:"sf-gallery-pic",children:X[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{or as BOUND_TO_POST,ml as BOUND_TO_POST_NOTE,Il as BUCKET_ICONS,Sa as CUSTOM_FIELD_MEDIA,Ca as CoordsField,fa as EDGE_ARROWS,Hn as FOCAL_DEFAULT,Kr as FOCAL_POINTS,q as FOLD_FIELD_MARKER,sa as FOLLOWS_SITE_BUTTON,ca as FOLLOWS_SITE_BUTTON_INK,mt as FocalPicker,Al as GroupLabel,rr as HIGHLIGHT_HINT,v as HidableTextField,ye as LINK_FIELD_MARKER,al as Label,Se as MEDIA_FIELD_MARKER,xa as MEDIA_TYPE_OPTIONS,gl as NOT_BOUND_TO_POST,vl as PanelBand,ar as PanelNoteLine,wr as PhoneChoiceRow,Rr as PhoneChoiceStrip,gt as PlacementGridView,Ce as SCAFFOLD_FIELD_MARKER,Fa as SCALAR_TEXT_CONTROLS,st as SECTION_BLEEDS_HINT,Nr as SIDE_PAD_KEYS,oe as Segmented,er as SiteGapDefaultReset,K as Slider,rt as Swatches,Aa as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,Ia as TICKER_ITEMS_ROW,Vr as TextListField,tr as WidthDefaultReset,zr as aimAfterListChange,ra as anchorFields,N as backTo,Fl as backgroundField,Ul as boxAlignField,$l as boxBlockSpacingField,Wl as boxJustifyField,zl as boxPhoneRowField,Xl as boxShareField,jl as boxWrapField,wl as bucketHeader,Cr as cardCornersField,cr as cardImageBackgroundField,qr as cardImageField,Oa as cardMediaFields,Kl as cardShapeFields,wa as cardShowFields,Ra as cardStyleFields,ql as cellWidthFields,aa as checkbox,da as colorInput,Sl as copyText,at as cornerSidesField,fe as cornersRowField,ia as dateTime,kl as designGroupHeader,Vl as directionField,Pa as displayFields,ha as edgePad,El as entriesHiddenForTab,_a as focusAfterRemove,ua as focusKeptField,Ll as foldMarker,J as foldMetaOf,sr as foldTitleOf,La as galleryLayoutField,Bl as gapField,S as group,na as heightFields,xe as hidableText,lr as hintIsWhileTyping,k as iconOf,ka as imageCornersField,hl as inOwnBox,Rl as isBucketHeader,Pl as isDesignGroupHeader,Jo as isNoGlyph,Cl as linkField,ma as multiSelect,qo as noGlyph,la as pageBackgroundField,Tl as panelNote,Jl as phoneChoiceField,Or as phoneOverrideField,pa as placementField,yl as plainText,_l as plainTextarea,ea as positionFields,Fr as positionPatch,it as pxField,Nl as quietMarker,be as readHidable,Xr as rowText,ga as searchSelect,Ol as section,Gl as sectionAnimationFields,dt as sectionBorderField,fr as sectionCornersField,Hl as sectionShapeFields,Dl as sectionThemeFields,me as segmented,L as select,$r as setRowText,M as sharedStyleKinds,Ql as sidesPaddingFields,vr as sidesPaddingPatch,Yl as sizeField,W as slider,ba as sourceField,Zl as spacingFields,oa as stickFields,Ml as templateField,bl as text,yt as textFieldIdentifier,dl as textFieldOffPage,pl as textFieldPanelOnly,Ea as textList,Ta as textListRowField,xl as textarea,D as toggle,ya as upload,Zo as usePageWidthDetail,F as useSelectedProps,lt as useSelectedSibling,Qo as useSiteGapDetail,ta as widthField,fl as withIdentifier,cl as withOffPage,ul as withPanelOnly,sl as withScaffold};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EaselBlockType, EaselSelection, PageEditOp } from "efficient-easel/screen/lib/host";
|
|
1
|
+
import type { EaselBlockType, EaselFieldDescription, EaselSelection, PageEditOp } from "efficient-easel/screen/lib/host";
|
|
2
2
|
type AnyDocument = {
|
|
3
3
|
root?: unknown;
|
|
4
4
|
content?: unknown[];
|
|
@@ -14,6 +14,8 @@ type BlockConfig = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare function blockLabel(config: BlockConfig, type: string): string;
|
|
16
16
|
export declare function describeSelection(config: BlockConfig, document: AnyDocument, selectedId: string | null | undefined): EaselSelection | null;
|
|
17
|
+
export declare const FIELD_DESCRIPTION_MARKER = "sfDescribedAs";
|
|
18
|
+
export declare function describedAs<F extends object>(field: F, description: EaselFieldDescription): F;
|
|
17
19
|
export declare function describeBlocks(config: BlockConfig): Record<string, EaselBlockType>;
|
|
18
20
|
export type ApplyResult<D> = {
|
|
19
21
|
ok: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const p=t=>!!t&&typeof t=="object"&&typeof t.type=="string"&&!!t.props&&typeof t.props=="object";function u(t,
|
|
1
|
+
const p=t=>!!t&&typeof t=="object"&&typeof t.type=="string"&&!!t.props&&typeof t.props=="object";function u(t,e){const n=t.components[e]?.label;return typeof n=="string"&&n.trim()?n.trim():e}function j(t){return t.length>3&&t.endsWith("s")?t.slice(0,-1):t}function b(t,e,n,o){t.forEach((s,c)=>{if(p(s)){o.push({node:s,list:t,index:c,parent:e,slot:n});for(const[r,l]of Object.entries(s.props))Array.isArray(l)&&l.some(p)&&b(l,s,r,o)}})}function _(t){const e=[];b(Array.isArray(t.content)?t.content:[],null,"",e);for(const n of Object.values(t.zones??{}))Array.isArray(n)&&b(n,null,"",e);return e}function y(t,e){return _(t).find(n=>String(n.node.props.id)===e)}function v(t,e,n){if(!n)return null;const o=y(e,n);if(!o)return null;const s=u(t,o.node.type),c=o.parent?`${u(t,o.parent.type)} · ${j(o.slot)} ${o.index+1}`:s;return{blockId:n,type:o.node.type,label:c,path:""}}const k="sfDescribedAs";function E(t,e){return{...t,[k]:e}}const $=t=>t.filter(e=>!!e&&typeof e=="object"&&"value"in e).map(e=>typeof e.label=="string"?{value:e.value,label:e.label}:{value:e.value});function m(t){if(!t||typeof t!="object")return null;const e=t;if(typeof e.type!="string")return null;const n=e.type==="custom"?e[k]:void 0,o={type:n?.type??e.type},s=n?.label??e.label;typeof s=="string"&&(o.label=s);const c=n?.options??e.options;Array.isArray(c)&&(o.options=$(c));for(const r of["arrayFields","objectFields"]){const l=n?.[r]??e[r];l&&typeof l=="object"&&(o[r]=h(l))}return o}function h(t){const e={};for(const[n,o]of Object.entries(t??{})){const s=m(o);s&&(e[n]=s)}return e}function O(t){const e={};for(const[n,o]of Object.entries(t.components))o&&(e[n]={label:u(t,n),fields:h(o.fields)});return e}function x(t,e){let n=t;for(const o of e?e.split("."):[]){const s=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(o);if(!s||!n||typeof n!="object")return null;n=n[s[1]],s[2]!==void 0&&(n=Array.isArray(n)?n[Number(s[2])]:void 0)}return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function d(t,e){return t.findIndex(n=>p(n)&&String(n.props.id)===e)}function A(t,e,n){const o=e||n;if(!o)return t.length;const s=d(t,o);if(s<0)throw new Error(`there is no top-level block ${o}`);return e?s+1:s}function w(t,e,n,o){const s=structuredClone(e),c=Array.isArray(s.content)?s.content:s.content=[];try{n.forEach((r,l)=>{const a=i=>{throw new Error(`change ${l+1}: ${i}`)};switch(r.op){case"set_props":{const i=y(s,r.block_id)??a(`there is no block ${r.block_id}`);"id"in r.props&&a("a block's id is never changed");const f=x(i.node.props,r.path)??a(`there is no ${r.path} in that block`);Object.assign(f,structuredClone(r.props));break}case"insert_block":{const i=t.components[r.type]??a(`there is no block type ${r.type}`),f=i.defaultProps&&typeof i.defaultProps=="object"?i.defaultProps:{},g={type:r.type,props:{...structuredClone(f),...structuredClone(r.props),id:o(r.type)}};c.splice(A(c,r.after,r.before),0,g);break}case"remove_block":{const i=d(c,r.block_id);i<0&&a(`there is no top-level block ${r.block_id}`),c.splice(i,1);break}case"move_block":{const i=d(c,r.block_id);i<0&&a(`there is no top-level block ${r.block_id}`);const[f]=c.splice(i,1);c.splice(A(c,r.after,r.before),0,f);break}default:a(`"${r.op}" is not a change this editor makes`)}})}catch(r){return{ok:!1,reason:r instanceof Error?r.message:String(r)}}return{ok:!0,document:s}}export{k as FIELD_DESCRIPTION_MARKER,w as applyPageEdits,u as blockLabel,O as describeBlocks,v as describeSelection,E as describedAs};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "40.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
|
-
"efficient-easel": "^20.
|
|
56
|
+
"efficient-easel": "^20.2.0",
|
|
57
57
|
"efficient-shell": "^9.1.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/node": "^20",
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
|
-
"efficient-easel": "^20.
|
|
75
|
+
"efficient-easel": "^20.2.0",
|
|
76
76
|
"efficient-shell": "^9.1.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|