efficient-web-builder 31.1.0 → 32.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 +24 -0
- package/dist/editor/components/PreviewChatContext.d.ts +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontLinkField.d.ts +1 -1
- package/dist/editor/components/WebsitePreviewButton.d.ts +1 -1
- package/dist/editor/components/storefront-editor.css +13 -0
- package/dist/editor/components/usePinnedChromeSeed.js +1 -1
- package/dist/editor/components/useSocialSettings.js +1 -1
- package/dist/editor/components/useStorefrontBlogPosts.d.ts +1 -1
- package/dist/editor/lib/editor-document-adapter.d.ts +1 -1
- package/dist/editor/lib/page-live-state.d.ts +1 -1
- package/dist/editor/lib/puck/add-palette.d.ts +0 -1
- package/dist/editor/lib/puck/add-palette.js +1 -1
- package/dist/editor/lib/puck/add-target.d.ts +0 -1
- package/dist/editor/lib/puck/blocks/general/HeroGroup/fields.js +1 -1
- package/dist/editor/lib/puck/controls.d.ts +14 -1
- package/dist/editor/lib/puck/controls.js +1 -1
- package/dist/editor/lib/puck/footer-blocks.d.ts +0 -1
- package/dist/editor/lib/puck/footer-blocks.js +1 -1
- package/dist/editor/lib/site-live-state.d.ts +1 -1
- package/dist/editor/lib/theme-row-persist.js +1 -1
- package/dist/editor/lib/website-session.d.ts +1 -1
- package/dist/format/lib/puck/container-blocks.d.ts +1 -1
- package/dist/{editor → format}/lib/puck/pinned-seed-gate.d.ts +0 -1
- package/dist/format/lib/puck/pinned-seed-gate.js +1 -0
- package/dist/{editor → format}/lib/web-backend.d.ts +1 -3
- package/dist/format/lib/web-backend.js +0 -0
- package/dist/render/lib/puck/slot-specs.d.ts +0 -1
- package/package.json +3 -3
- package/dist/editor/lib/puck/pinned-seed-gate.js +0 -1
- package/dist/editor/lib/web-backend.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 32.0.0 - 2026-10-21
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **BREAKING: no builder module hands on an easel screen name** (SSOT, harness DUP-1; 31.0.0 kept six). A host imports each name from its easel subpath:
|
|
10
|
+
- `lib/web-backend` no longer exports `WebsiteBackendError`, `isBackendError`, `STATUS_UNREACHABLE`, `provideHostFailures`, `readHostFailure`, `hostLoadRefusalOf`, `hostUnreachableMessage`, `WebsiteBackendErrorKind`, `HostFailure`: take them from `efficient-easel/screen/lib/backend-error`.
|
|
11
|
+
- `lib/puck/slot-specs` no longer exports `NodeDefaults`, `SlotSectionSpec`: `efficient-easel/screen/lib/puck/slot-section-spec`.
|
|
12
|
+
- `lib/puck/add-palette` no longer exports `matchesQuery`, `PaletteSection`: `efficient-easel/screen/lib/puck/palette-sections`.
|
|
13
|
+
- `lib/puck/add-target` no longer exports `AddTarget`, `AddTargetSource`: `efficient-easel/screen/lib/puck/add-target-types`.
|
|
14
|
+
- `lib/puck/footer-blocks` no longer exports `blockRuns`, `BlockChoice`, `BlockChoiceRun`: `efficient-easel/screen/lib/puck/block-choice`.
|
|
15
|
+
- `lib/puck/pinned-seed-gate` no longer exports `resetForDocumentSwitch`, `saveStatusForNewDocument`, `saveStatusOf`, `DocumentSwitchSetters`, `SaveStatus`: `efficient-easel/screen/lib/document-switch`.
|
|
16
|
+
- **BREAKING: `lib/web-backend` and `lib/puck/pinned-seed-gate` are on the `format` side now.** With the easel re-exports gone they draw no React and import no editor package, so `scripts/entry-sides.mjs` classes them `format`, as it does every pure module (doc/adr/0005). A host imports `efficient-web-builder/format/lib/web-backend` and `efficient-web-builder/format/lib/puck/pinned-seed-gate`; the `editor/` paths are gone (`verify-published-entries`: 4 files moved). The path change goes in the host's own pull request that takes 32.0.0, because the `format/` paths exist only from this release: 5 files in efficient-storefront-blocks (`src/editor/lib/efficient-backend.ts`, `src/editor/lib/storefront-editor.ts`, `package/src/index.tsx`, `package/src/types.check.ts`, `scripts/test-template-editor-isolation.ts`) and 2 in efficient-storefront (`scripts/test-dynamic-page-own-slug-404.ts`, `scripts/test-editor-page-lock.ts`).
|
|
17
|
+
- Hosts: efficient-storefront-blocks moved in #145 (0.53.0). efficient-storefront moved 3 guard files in #1717; before it takes this release (it pins 30.1.1 now) it syncs its vendored blocks to 0.53.0 or later and moves one more line (`scripts/test-editor-page-lock.ts`, `resetForDocumentSwitch`). No admin, portal, easel, shell or CLI file named one. Each name is the same class, function or type as before. No stored value, page, setting or pixel changes.
|
|
18
|
+
- The builder's own 9 files that used them import easel directly.
|
|
19
|
+
- **The Box inside a Hero moves by two boxes, straight in its Position band** (Layered images v3, Lewis 2026-10-21: final, option 1). The two ±40px sliders `Sideways` and `Up and down` are gone. In their place: a left-and-right box and an up-and-down box (efficient-shell `PositionInput`, glyphs `nudge-x` and `nudge-y`), with no row name of their own, because the band already says Position. It is the same shell part the email designer's Layered images picture draws (there, in a panel with no Position band, the row is called `Position`). One edit writes both stored values in one write. The stored keys `nudgeX` / `nudgeY` do not move (N10.6): no page, setting or pixel changes.
|
|
20
|
+
- New builder `positionFields` (and `positionPatch`) in `lib/puck/controls`, for any part that moves by a nudge; `label: null` draws the boxes with no row.
|
|
21
|
+
- **BREAKING: the efficient-shell peer range narrows to `^8.13.0`** (peer and dev), the release with `PositionInput` and the `nudge-x` / `nudge-y` glyphs. A host on an older shell moves first.
|
|
22
|
+
|
|
23
|
+
### Guards
|
|
24
|
+
|
|
25
|
+
- `scripts/test-screen-in-easel.mjs` (red first): `PASS_THROUGH` is empty, so no file in `src/` re-exports `efficient-easel/screen` beside its own code. It failed on main with the six modules named.
|
|
26
|
+
- `scripts/test-shell-peer-range.ts`: the floor is 8.13.0.
|
|
27
|
+
- `scripts/test-hero-group-position-row.tsx` (red first): one row on `nudgeX` with both boxes in order and no slider left; `nudgeY` kept and reached by that row; one edit writes only what changed and a cleared box removes its key; a stored `nudgeX` / `nudgeY` still moves the Box.
|
|
28
|
+
|
|
5
29
|
## 31.1.0 - 2026-10-21
|
|
6
30
|
|
|
7
31
|
### Removed
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { ChatSettings } from "
|
|
2
|
+
import type { ChatSettings } from "../../format/lib/web-backend.js";
|
|
3
3
|
import { type ChatLauncherPosition } from "../../format/lib/content/chat-launcher.js";
|
|
4
4
|
export type ChatPreview = {
|
|
5
5
|
enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{useCallback as H,useEffect as S,useMemo as l,useRef as V,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as X}from"../lib/puck/build-config.js";import{withTemplateMediaPlaceholders as Z}from"../../format/lib/puck/templateFields.js";import{setEditorPageSlug as R}from"../../format/lib/puck/editor-page-context.js";import{ScreenDocumentContext as $}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as ee}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as te}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as re}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as oe}from"efficient-easel/draw/client";import{PreviewLocationPartProvider as ie}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ne}from"./PreviewPartStyleContext.js";import{sectionTemplates as O}from"efficient-easel/screen/lib/section-templates";import{nodeToDoc as se,docToNode as B}from"efficient-easel/screen/lib/puck/section-doc";import{newNodeId as de}from"efficient-easel/draw";import{migrateRenamedProps as ae}from"../../format/lib/puck/renamed-props.js";import{buildSlotSeedChildren as ce}from"../../render/lib/puck/slot-specs.js";import{FOOTER_TYPE as me,buildDefaultFooterBlocks as le}from"../lib/puck/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as ue,useAdminBridge as fe}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as pe}from"efficient-easel/screen/lib/host";import{ChromeWrap as ve}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as ge}from"efficient-easel/screen/lib/session";import{useEaselSession as he}from"efficient-easel/screen/lib/session-context";import{say as F}from"../../format/lib/editor-words.js";import{retargetWhenSaved as Se}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as Pe}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as Ee}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as P,THEME_MODE_KEY as ye}from"../../format/lib/theme.js";import{makeSitePageAdapter as L}from"../lib/editor-document-adapter.js";import{documentPermissions as Te}from"efficient-easel/edit-lock";import{useAutosave as we}from"efficient-easel/autosave";import{saveStatusOf as Ne}from"
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{useCallback as H,useEffect as S,useMemo as l,useRef as V,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as X}from"../lib/puck/build-config.js";import{withTemplateMediaPlaceholders as Z}from"../../format/lib/puck/templateFields.js";import{setEditorPageSlug as R}from"../../format/lib/puck/editor-page-context.js";import{ScreenDocumentContext as $}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as ee}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as te}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as re}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as oe}from"efficient-easel/draw/client";import{PreviewLocationPartProvider as ie}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ne}from"./PreviewPartStyleContext.js";import{sectionTemplates as O}from"efficient-easel/screen/lib/section-templates";import{nodeToDoc as se,docToNode as B}from"efficient-easel/screen/lib/puck/section-doc";import{newNodeId as de}from"efficient-easel/draw";import{migrateRenamedProps as ae}from"../../format/lib/puck/renamed-props.js";import{buildSlotSeedChildren as ce}from"../../render/lib/puck/slot-specs.js";import{FOOTER_TYPE as me,buildDefaultFooterBlocks as le}from"../lib/puck/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as ue,useAdminBridge as fe}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as pe}from"efficient-easel/screen/lib/host";import{ChromeWrap as ve}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as ge}from"efficient-easel/screen/lib/session";import{useEaselSession as he}from"efficient-easel/screen/lib/session-context";import{say as F}from"../../format/lib/editor-words.js";import{retargetWhenSaved as Se}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as Pe}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as Ee}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as P,THEME_MODE_KEY as ye}from"../../format/lib/theme.js";import{makeSitePageAdapter as L}from"../lib/editor-document-adapter.js";import{documentPermissions as Te}from"efficient-easel/edit-lock";import{useAutosave as we}from"efficient-easel/autosave";import{saveStatusOf as Ne}from"efficient-easel/screen/lib/document-switch";import{blocksOf as ke}from"../lib/website-session.js";const Ce=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),Ae=x(()=>import("efficient-easel/screen/components/SectionScreenShell"),{ssr:!1}),U="HeroSingle",W="Untitled section";function Ie(i,E){const d=E.components,r=d[i]?i:U,y=d[r]?.defaultProps??{},n=ce(r,f=>d[f]?.defaultProps??{}),s=r===me?{blocks:le()}:null;return{type:r,props:{id:de(r),...y,...n?{[n.slot]:n.children}:null,...s}}}function Oe(){if(typeof window>"u")return P;try{const i=window.localStorage.getItem(ye);return i==="light"||i==="dark"||i==="auto"?i:P}catch{return P}}function be({id:i,initialType:E,initialName:d=W}){const[r,y]=u(i),n=V(r);S(()=>{n.current=r},[r]);const s=pe(),[f,Y]=u(E),[b,j]=u(d),[a,T]=u(void 0),[K,G]=u(P),{token:w,tokenRef:M}=fe({onMessage:e=>{if(Ee(e)||Pe(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const I=t.target.id;if(I===n.current)return;const J=t.target.type,Q=t.target.name;Se(k,()=>{Y(J),j(Q||W),y(I),s.address.show({kind:"section",id:I})},()=>s.send("storefront-editor:save-failed"))}}}),N=we({save:e=>O.update(e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&s.send("storefront-editor:save-failed")}}),{state:p,push:D,flush:k}=N;S(()=>G(Oe()),[]);const c=he(),v=c.usesBridgedToken?!!w:!0,g=l(()=>X(ge(c),ke(c)),[c]);S(()=>{if(!v)return;let e=!1;return T(void 0),O.ensure(r,b,Ie(f??U,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,f,b,v,g]);const C=H(e=>{s.send("storefront-editor:dirty");const t=B(e);t&&D({id:n.current,node:t})},[D,s]),h=s.send,_=H(async e=>{try{return await e(M.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),q=l(()=>Z(g,!0),[g]);S(()=>(R(null),()=>R(null)),[]);const m=l(()=>a?ae(se(a)):null,[a]),A=l(()=>({target:{kind:"page",slug:""},adapter:L(void 0),capabilities:L(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:M,notifyParent:h,runAuthed:_,docId:r,data:m,getLiveData:()=>m,footerOriginSlug:null,error:null,redirecting:!1,saveStatus:Ne(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:C,flushSave:k,onPublish:async e=>{const t=B(e);t&&await O.update(n.current,t)},bridgeCapabilities:ue,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,_,m,p,C,k,N.retryNow]),z=l(()=>Te(!A.readOnly),[A.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:F("Loading…")}):a===null||!m?o("div",{className:"sf-msg sf-msg--error",children:F("Couldn’t open this section.")}):o($.Provider,{value:A,children:o(ee,{themeMode:K,chromePlaceholder:!0,children:o(ve,{wrap:c.chrome?.wrap,surface:"section",children:o(te,{children:o(re,{children:o(oe,{children:o(ie,{children:o(ne,{children:o(Ce,{config:q,data:m,onChange:C,permissions:z,children:o(Ae,{})},r)})})})})})})})})}export{be as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import type { BlogPostRow, LinkTargetPage } from "
|
|
2
|
+
import type { BlogPostRow, LinkTargetPage } from "../../format/lib/web-backend.js";
|
|
3
3
|
import { type LinkFilters, type LinkPickerSetupInput } from "../../format/lib/links/link-picker-setup.js";
|
|
4
4
|
export declare const loadPages: (key?: string) => Promise<LinkTargetPage[]>;
|
|
5
5
|
export declare const loadPosts: (key?: string) => Promise<BlogPostRow[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WebsitePreview } from "
|
|
1
|
+
import type { WebsitePreview } from "../../format/lib/web-backend.js";
|
|
2
2
|
type DraftLink = NonNullable<WebsitePreview["draftLink"]>;
|
|
3
3
|
type Opener = Pick<Window, "open">;
|
|
4
4
|
export declare function openDraftPreview({ pageId, liveHref, draftLink, win, }: {
|
|
@@ -1955,6 +1955,19 @@
|
|
|
1955
1955
|
white-space: nowrap;
|
|
1956
1956
|
}
|
|
1957
1957
|
|
|
1958
|
+
/* The Position boxes with no row of their own (the Hero Box, Lewis 2026-10-21):
|
|
1959
|
+
the two boxes, then the shared ↺ reset at the end of the same line — the
|
|
1960
|
+
band above already names them, so there is no label row to hold the reset. */
|
|
1961
|
+
.sf-position-line {
|
|
1962
|
+
display: flex;
|
|
1963
|
+
align-items: center;
|
|
1964
|
+
gap: 8px;
|
|
1965
|
+
}
|
|
1966
|
+
.sf-position-line > :first-child {
|
|
1967
|
+
flex: 1;
|
|
1968
|
+
min-width: 0;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1958
1971
|
/* Text field with a visibility eye: leading type glyph · label · trailing eye.
|
|
1959
1972
|
The eye flips a stored `hidden` flag that drops the element from the slide
|
|
1960
1973
|
render — see controls.tsx. The input stays editable (dimmed) while hidden. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as G,useRef as L}from"react";import{createNode as x,newId as z}from"efficient-easel/data";import{useEaselApi as U}from"efficient-easel/easel";import{useScreenDocument as Z}from"efficient-easel/screen/components/ScreenDocumentContext";import{SITE_FOOTER_SLUG as H}from"../../format/lib/content/footer.js";import{boxFooterFromFooter as B}from"../../format/lib/puck/box-footer.js";import{ROOT_ZONE as l,missingPinnedTypes as j,pinnedDuplicateIds as D}from"efficient-easel/draw";import{FOOTER_TYPE as c,HEADER_TYPE as p,buildDefaultFooterBlocks as P,buildDefaultHeaderNode as E}from"../lib/puck/footer-blocks.js";import{canSeedPinnedChrome as q}from"
|
|
1
|
+
"use client";import{useEffect as G,useRef as L}from"react";import{createNode as x,newId as z}from"efficient-easel/data";import{useEaselApi as U}from"efficient-easel/easel";import{useScreenDocument as Z}from"efficient-easel/screen/components/ScreenDocumentContext";import{SITE_FOOTER_SLUG as H}from"../../format/lib/content/footer.js";import{boxFooterFromFooter as B}from"../../format/lib/puck/box-footer.js";import{ROOT_ZONE as l,missingPinnedTypes as j,pinnedDuplicateIds as D}from"efficient-easel/draw";import{FOOTER_TYPE as c,HEADER_TYPE as p,buildDefaultFooterBlocks as P,buildDefaultHeaderNode as E}from"../lib/puck/footer-blocks.js";import{canSeedPinnedChrome as q}from"../../format/lib/puck/pinned-seed-gate.js";import{siteFooterDocChrome as J,SITE_FOOTER_TYPE as f}from"../../format/lib/puck/section-groups.js";import{inPlaceSeedPlan as K}from"../lib/puck/pinned-in-place-seed.js";function se(t,F){const{adapter:k,capabilities:T,currentSlug:O,docId:u,data:y,saveStatus:I}=Z(),{hasSiteSettings:N,hasPinnedChrome:b}=T,C=!!T.editsPinnedInPlace&&O!==H,R=O===H,_=U().getState,v=L(null);G(()=>{if(!q({docId:u,saveStatus:I,seededDocId:v.current})||(v.current=u,!b))return;const m=_().appState.data,o=m.content,a=y?.content??[],d=(e,n)=>e.some(r=>r?.type===n);if(!N){const e=new Set(D(o)),n=e.size?o.filter(s=>!e.has(s.props.id)):o;e.size&&t.setDocument({...m,content:n});const r=j(n,a);if(r.includes(c)){const s=n.length,i=t.insertSection(c,s);t.replaceComponent(l,s,{type:c,props:{id:i,blocks:P()}})}r.includes(p)&&t.insertNode(l,0,E());return}if(R){const e=J(o);if(e!==o&&t.setDocument({...m,content:[...e]}),!e.find(r=>r.type===c)&&!d(a,c)&&!d(e,f)&&!d(a,f)){const r=(i,g)=>x(F,i,g),s={type:c,props:{blocks:P()}};t.insertNode(l,e.length,B(s,r,z(f)))}return}if(C){const e=!!k?.pinnedChrome?.state().docId,n=K(o,{hasChromeDoc:e}),r=new Set([...n.remove,...D(o.filter(i=>!n.remove.includes(String(i.props.id))))]),s=r.size?o.filter(i=>!r.has(String(i.props.id))):o;if(s.length!==o.length&&t.setDocument({...m,content:s}),n.seedFooter&&!d(a,c)&&!d(a,f)){const i=(Y,A)=>x(F,Y,A),g={type:c,props:{blocks:P()}};t.insertNode(l,s.length,B(g,i,z(f)))}if(n.seedHeader&&!d(a,p)){const i=s[0]?.type==="SiteHeader"?1:0;t.insertNode(l,i,E())}return}const h=o.filter(e=>e.type!==c),w=new Set(D(h)),S=w.size?h.filter(e=>!w.has(e.props.id)):h;S.length!==o.length&&t.setDocument({...m,content:S}),!d(S,p)&&!d(a,p)&&t.insertNode(l,0,E())},[u,I,y,_,t,N,b,R,C,k])}export{se as usePinnedChromeSeed};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useCallback as d,useEffect as p,useMemo as v,useRef as h,useState as A}from"react";import{EMPTY_SOCIAL_ROWS as L}from"../../render/components/PreviewSocialContext.js";import{SOCIAL_PLATFORMS as O,normalizeSocialLinks as C}from"../../format/lib/content/social-links.js";import{refreshSiteLiveState as w}from"../lib/site-live-state.js";import{backendOf as y}from"../lib/website-session.js";import{useEaselSession as _}from"efficient-easel/screen/lib/session-context";import{WebsiteBackendError as g}from"
|
|
1
|
+
"use client";import{useCallback as d,useEffect as p,useMemo as v,useRef as h,useState as A}from"react";import{EMPTY_SOCIAL_ROWS as L}from"../../render/components/PreviewSocialContext.js";import{SOCIAL_PLATFORMS as O,normalizeSocialLinks as C}from"../../format/lib/content/social-links.js";import{refreshSiteLiveState as w}from"../lib/site-live-state.js";import{backendOf as y}from"../lib/website-session.js";import{useEaselSession as _}from"efficient-easel/screen/lib/session-context";import{WebsiteBackendError as g}from"efficient-easel/screen/lib/backend-error";const F="Could not save this link. Check your connection and try again.";function R(n,e){if(!(n instanceof g)||n.kind!=="invalid")return null;const s=n.fields?.[e];return typeof s=="string"&&s.trim()?s:null}function T(n){return Object.fromEntries(O.map(e=>[e,{value:n[e]??"",error:null}]))}function D({token:n,siteId:e,enabled:s}){const[i,c]=A(L),m=h(null),a=h(!1),b=_(),t=y(b).social,o=s&&!!n&&!!e&&!!t;p(()=>{if(!o||!n||!e||!t)return;m.current!==e&&(m.current=e,a.current=!1,c(L));let r=!1;return t.get({siteId:e}).then(l=>{!r&&!a.current&&c(T(l))}).catch(()=>{}),()=>{r=!0}},[o,n,e,t]);const S=d(async(r,l)=>{if(!o||!n||!e||!t)return{ok:!1,error:"There is no website to save to."};try{const f=await t.update({[r]:l.trim()},{siteId:e});return a.current=!0,w(),c(u=>({...u,[r]:{value:f[r]??"",error:null}})),{ok:!0}}catch(f){const u=R(f,r)??F;return c(E=>({...E,[r]:{...E[r],error:u}})),{ok:!1,error:u}}},[o,n,e,t]),k=v(()=>C(Object.fromEntries(O.map(r=>[r,i[r].value]))),[i]);return v(()=>({links:k,rows:i,canSave:o,saveLink:S}),[k,i,o,S])}export{F as SOCIAL_SAVE_FAILED,R as socialFieldError,D as useSocialSettings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BlogPostRow } from "
|
|
1
|
+
import type { BlogPostRow } from "../../format/lib/web-backend.js";
|
|
2
2
|
export declare const loadStorefrontBlogPosts: (force?: boolean) => Promise<BlogPostRow[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LockHolder, SaveConflict } from "efficient-easel/edit-lock";
|
|
2
2
|
import { type OfferedSets } from "./editor-blocks.js";
|
|
3
3
|
import type { EaselCapabilities as EditorCapabilities, EaselDocument as EditorDocument, EaselDocumentAdapter as EditorDocumentAdapter } from "efficient-easel/screen/lib/document-contract";
|
|
4
|
-
import type { EditorPageRow, SiteLiveState, WebsiteBackend } from "
|
|
4
|
+
import type { EditorPageRow, SiteLiveState, WebsiteBackend } from "../../format/lib/web-backend.js";
|
|
5
5
|
export type { EditorPageRow };
|
|
6
6
|
export type { EditorCapabilities, EditorDocument, EditorDocumentAdapter };
|
|
7
7
|
export type WebsiteCapabilities = EditorCapabilities & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ScreenMainAction } from "efficient-easel/screen/lib/screen-parts";
|
|
2
|
-
import type { PageLiveState, SiteChange } from "
|
|
2
|
+
import type { PageLiveState, SiteChange } from "../../format/lib/web-backend.js";
|
|
3
3
|
export type { PageLiveState };
|
|
4
4
|
export declare function noteLoaded(id: string, live: PageLiveState | undefined): void;
|
|
5
5
|
export declare function noteSaved(id: string, live: PageLiveState | undefined): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Config } from "efficient-easel/blocks";
|
|
2
2
|
import { type PaletteSection } from "efficient-easel/screen/lib/puck/palette-sections";
|
|
3
|
-
export { matchesQuery, type PaletteSection } from "efficient-easel/screen/lib/puck/palette-sections";
|
|
4
3
|
export declare const CATEGORY_META: Record<string, {
|
|
5
4
|
label: string;
|
|
6
5
|
icon: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildPaletteSections as
|
|
1
|
+
import{buildPaletteSections as l,categoryLabel as r,paletteWithoutPinned as i,pinnedSection as c}from"efficient-easel/screen/lib/puck/palette-sections";import{labelAtLevel as b,LEVEL_NAMED_TYPE as u}from"../../../format/lib/puck/section-catalog.js";const t={openers:{label:"Hero & intros",icon:"image"},shop:{label:"Shop & galleries",icon:"bag"},product:{label:"Product page",icon:"box"},checkout:{label:"Checkout & ordering",icon:"bag"},about:{label:"About & brand story",icon:"book"},content:{label:"Text & content",icon:"type"},proof:{label:"Stats & social proof",icon:"star"},promo:{label:"Promotions & sign-ups",icon:"sparkles"},blog:{label:"Blog & journal",icon:"newspaper"},navigation:{label:"Navigation & wayfinding",icon:"bookmark"},legal:{label:"Legal & documents",icon:"file"},contact:{label:"Contact, FAQ & forms",icon:"mail"},structure:{label:"Layout, structure & embeds",icon:"grid"}};function n(o){return t[o]?.label}function d(o,e={}){return l(o,{labelAtLevel:b,categoryLabel:n,descriptions:e})}function f(o,e){return r(o,e,n)}function m(o){return t[o]?.icon??"layers"}const a=u;function y(o){return c(o,a)}function x(o){return i(o,a)}export{t as CATEGORY_META,a as PINNED_SECTION_TYPE,d as buildPaletteSections,m as categoryIcon,f as categoryLabel,n as categoryShortLabel,x as paletteWithoutPinned,y as pinnedSection};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { AddTarget } from "efficient-easel/screen/lib/puck/add-target-types";
|
|
2
|
-
export type { AddTarget, AddTargetSource } from "efficient-easel/screen/lib/puck/add-target-types";
|
|
3
2
|
export declare function canAddTo(nodeType: string, nestDepth?: number): AddTarget | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{HERO_GROUP_NUDGE_LIMIT as n,HERO_GROUP_WIDTH_DEFAULT as u,HERO_GROUP_WIDTH_MAX as p,HERO_GROUP_WIDTH_MIN as d,HERO_GROUP_WIDTH_NESTED_DEFAULT as _,heroGroupNestDepth as g}from"../../../../../../format/lib/hero-group-placement.js";import{WidthIcon as l}from"efficient-easel/icons";import{boxAlignField as f,boxJustifyField as c,boxWrapField as H,directionField as h,gapField as x,group as e,placementField as F,plainText as G,positionFields as O,sidesPaddingFields as R,slider as s,withIdentifier as D,withOffPage as E,withPanelOnly as P}from"../../../controls.js";import{PH as I}from"../../../../../../format/lib/puck/blocks/placeholders.js";import{withRowRules as T}from"../../../../../../render/lib/puck/show-when.js";import{HeroGroupSlots as w}from"../../../../../../render/lib/puck/blocks/general/HeroGroup/render.js";const j={fields:T({_gContent:e("Content"),name:P(D(E(G("Box name",I.boxName)))),content:w.content,_gLayout:e("Layout"),placement:F("Placement",{stacking:!0}),width:s("Width",r(l,{}),d,p,5,u,"%"),direction:h("HeroGroup"),gap:x("HeroGroup"),justify:c(),align:f(),wrap:H(),_gNudge:e("Nudge"),...O({keys:{x:"nudgeX",y:"nudgeY"},min:-n,max:n,label:null}),...R()},[[["placement"],{context:"heroGroupDepth",is:0}]]),resolveFields:(o,{fields:t,appState:m})=>{const a=typeof o.props.id=="string"?o.props.id:"";if(g(m?.data,a)===0)return t;const i={...t};return i.width=s("Width",r(l,{}),d,p,5,_,"%"),i}};export{j as HeroGroupFields};
|
|
@@ -4,7 +4,7 @@ import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIEL
|
|
|
4
4
|
import type { ShowWhenRule } from "../../../render/lib/puck/show-when.js";
|
|
5
5
|
import { type HeroGroupPlacement } from "../../../format/lib/hero-group-placement.js";
|
|
6
6
|
import { type SettingsSidesValue, type SettingsBorderValue } from "efficient-easel/panel";
|
|
7
|
-
import { type AlignmentPoint, FOCAL_DEFAULT } from "efficient-shell/ui";
|
|
7
|
+
import { type AlignmentPoint, FOCAL_DEFAULT, type PositionValue } from "efficient-shell/ui";
|
|
8
8
|
import type { GeocodeState } from "../../../format/lib/content/contact.js";
|
|
9
9
|
import { type DirectionContainer } from "../../../format/lib/content/container-direction.js";
|
|
10
10
|
import { GAP_FIELD_CONTAINER, type GapContainer } from "../../../format/lib/content/container-gap.js";
|
|
@@ -269,6 +269,19 @@ export type SidesPaddingOptions = {
|
|
|
269
269
|
step?: number;
|
|
270
270
|
};
|
|
271
271
|
export declare function sidesPaddingFields(opts?: SidesPaddingOptions): Record<string, CustomField<undefined> | CustomField<number>>;
|
|
272
|
+
type PositionKeys = {
|
|
273
|
+
x: string;
|
|
274
|
+
y: string;
|
|
275
|
+
};
|
|
276
|
+
export declare function positionPatch(keys: PositionKeys, before: PositionValue, next: PositionValue): Record<string, number | undefined>;
|
|
277
|
+
export type PositionOptions = {
|
|
278
|
+
keys: PositionKeys;
|
|
279
|
+
min: number;
|
|
280
|
+
max: number;
|
|
281
|
+
step?: number;
|
|
282
|
+
label?: string | null;
|
|
283
|
+
};
|
|
284
|
+
export declare function positionFields(o: PositionOptions): Record<string, CustomField<number>>;
|
|
272
285
|
export declare function widthField(defaultMode: WidthMode, modes?: readonly WidthMode[], inheritable?: boolean): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
|
|
273
286
|
export declare function heightFields(): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
|
|
274
287
|
export declare function stickFields(): Record<string, CustomField<undefined> | CustomField<boolean> | CustomField<number>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as k,Fragment as T}from"react/jsx-runtime";import{cloneElement as pe,useId as ft,useRef as ne,useState as z}from"react";import{useEasel as W,useSelectedFields as fe}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as he,hidableText as me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as V,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as Y,textFieldIdentifier as ht}from"efficient-easel/draw";import mt from"../../components/ApplyCornersToSiblings.js";import gt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as bt,CORNER_RADIUS_MAX as Se,CORNER_RADIUS_MIN as v}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as xt,IMAGE_CORNERS_LABEL as St}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as yt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Ct,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as ye}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as _t,HERO_GROUP_PLACEMENTS as It,HERO_GROUP_PLACEMENT_DEFAULT as Et,normalisePlacement as Tt,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import Rt from"../../components/KeepHint.js";import{AdjustIcon as Ot,AlignLeftIcon as wt,EyeIcon as Pt,AlignSeparateIcon as kt,AnimationIcon as _e,BackgroundIcon as Lt,BorderAllIcon as Nt,BlockSectionIcon as At,CartIcon as vt,ColumnWidthsIcon as Ie,ColumnsIcon as Ft,CornerIcon as Dt,DirectionDownIcon as Bt,DirectionLeftIcon as Ht,DirectionRightIcon as Gt,DirectionUpIcon as Mt,DollarIcon as Kt,FinishIcon as Wt,GapIcon as Ee,GridIcon as Ut,GroundIcon as Xt,HashIcon as Te,HeightIcon as $t,ImageIcon as jt,ListIcon as zt,LocationIcon as oe,PaddingAllIcon as Vt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Yt,PlacementIcon as qt,ProductSizeIcon as Jt,StickyIcon as Zt,RotateIcon as Qt,SquareIcon as en,TypeIcon as tn,WidthIcon as nn,WrapIcon as on}from"efficient-easel/icons";import{FieldGlyph as Le}from"../../components/FieldGlyph.js";import{resolvePageBackground as rn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Ne,CORNER_SIDE_POINTS as ln,hasOwnSectionCorners as an,normalizeCornerSides as Ae}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as sn,SECTION_MOTION_OPTIONS as cn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as ve}from"./enclosing-section.js";import{SettingsDefaultReset as S,SettingsField as h,SettingsGroupHead as dn,SettingsGroupSub as un,SettingsBorder as pn,SettingsSegmented as fn,SettingsSides as hn,SettingsSidesEach as Fe,sidesStartEach as mn,SettingsSwitch as De,borderSides as gn,borderStartEach as bn}from"efficient-easel/panel";import{FieldSelect as xn,ListField as Sn}from"efficient-easel/fields";import{DisplayChips as yn}from"efficient-shell/ui";import{desktopDisplayChanged as Cn,partShownOnDesktop as _n,partShownOnPhone as In,phoneDisplayChanged as En,withDesktopPart as Tn,withPhonePart as Rn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as On,Checkbox as wn,CornersInput as Pn,DateTimePicker as kn,FOCAL_DEFAULT as Ln,PictureTiles as Be,Slider as Nn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as An}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as vn,NoControlMark as re,noControlField as q}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Fn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Dn,phoneKey as F,resolvePhoneValue as ie}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Bn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Hn,CARD_OUTLINE_OPTIONS as Gn,DEFAULT_CARD_INDEX_FORMAT as Mn,DEFAULT_CARD_OUTLINE as Kn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Wn,DEFAULT_COVER_INDEX as Un}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Xn}from"efficient-easel/draw";import $n from"../../components/MediaUploadField.js";import jn from"../../components/MultiSelectField.js";import zn from"../../components/SectionThemePicker.js";import Vn from"../../components/SearchSelectField.js";import Yn from"../../components/StorefrontLinkField.js";import{UiIcon as Ke}from"efficient-easel/draw/client";import{SECTION_PADDING as E}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as qn,resolveSectionMinHeight as Jn}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as J,SECTION_STICK_LABEL as le,hasPhoneStick as Zn,resolveSectionStick as Qn}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as eo,SECTION_MIN_HEIGHT_GROUP_LABEL as X,SECTION_SCREEN_PCT as to}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as no,containerDirectionPoints as oo,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as ro,BOX_BLOCK_SPACING_LABEL as io,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as lo,BOX_PHONE_ROW_MAX as ao,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as ae,BOX_WRAP_LABEL as so,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as D}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as co}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as uo,normalizeTheme as po,siteButtonPaint as fo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as se,CONTAINER_GAP_BUILT_IN as ho,GAP_FIELD_CONTAINER as mo,hasOwnContainerGap as go,resolveContainerGap as bo}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as xo,CARD_IMAGE_BG_OFF as So,CARD_IMAGE_BG_SWATCH_NAMES as yo,CARD_IMAGE_BG_SWATCHES as Co,isCardImageBackgroundInheriting as _o,cardImageBackgroundChoice as Io,THEME_CARD_IMAGE_BG as Eo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as To,SECTION_BG_SWATCHES as Ro,SECTION_BG_SWATCH_NAMES as Oo,THEME_SECTION_BG as wo,isSectionBackgroundInheriting as Po}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as ko}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Lo,TYPE_SIZE_INHERIT as No,isTypeSizeInheriting as Ao}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as vo,WIDTH_CHOICE_LABEL as Fo,WIDTH_INHERIT as Do,resolveWidth as Bo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Ho}from"efficient-easel/style-clipboard";function B(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!Y(n)&&Ho(n,`section:${t}`);return e}function Yi({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Go(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function Mo(e){return e.type===qe}function w(e){return Mo(e)?void 0:e}function L(e,t){return l("{value} from {from}",{value:e,from:t})}function Ko(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Bo(t,"full");return n==="page"?L(`${o}px`,l("the page")):n==="contained"?L(l("Contained"),l("the page")):L(l("Full"),l("the page"))}function Wo(){const{blockGap:e}=D();return e===null?l("this container's own spacing"):L(`${e}px`,l("Site styles"))}function Uo({inherited:e,onReset:t,label:n}){return r(S,{words:x()?.panel,label:l(n),changed:!e,detail:Wo(),onReset:t})}function Xo({inherited:e,onReset:t,label:n}){return r(S,{words:x()?.panel,label:l(n),changed:!e,detail:Ko(),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=he(e),f=ne(null),p=ne(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=ft(),_=i?qo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(Rt,{children:l(i)}):void 0,j=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(tn,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:j,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":j,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[s&&r(Me,{target:a?p:f,value:d,onChange:m}),a?r("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)}):r("input",{id:R,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)})]})})}function qi(e,t){return{...e,[xe]:t}}function Ji(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function Zi(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function Qi(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function el(e){return!!e&&typeof e=="object"&&e[Je]===!0}function tl(e){const t=e[I];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[I]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as xa,SCALAR_TEXT_CONTROLS as Sa}from"efficient-easel/draw";function nl(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[vn]:o,...i}=e;return{...i,[Fn]:!0,render:t}}const $o=new Set(Xn),G=(e,t)=>{const n={...t,[I]:e};if(!$o.has(e.control))return n;const o=t.render;return{...q(n,"authored-copy"),render:i=>r(Bn,{name:i.name,children:o(i)})}},ol="Everything else on this block comes from the linked post. Unlink it to edit by hand.",jo={field:"source.slug",set:!0},rl={not:jo},zo="Select a word, then press the highlighter.",Vo="A short name so a link can jump straight to this section, like yoursite.com/page#about.",Yo=new Set([zo]),qo=e=>Yo.has(e);function il(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function ll(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function Jo(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function al(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function sl(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(Yn,{value:me(t),onChange:n,label:e})}}function cl(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const dl={Design:Ot,Animation:_e};function ul(e,t){return e.includes("Design")?t!=="Design":null}function Zo({label:e}){return r(dn,{title:l(e),level:Ye(1)})}function Qo({level:e,label:t}){return e===1?r(Zo,{label:t}):r(nr,{label:t})}function Ze(e,t){return{type:"custom",[V]:{label:e,level:t},render:()=>r(Qo,{level:t,label:e})}}function y(e){return Ze(e,2)}function pl(e){return{type:"custom",render:()=>r(er,{text:e})}}function er({text:e}){return r("p",{className:"sf-note",children:l(e)})}function fl(e){return Ze(e,1)}function hl(e){return Y(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function ml(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[V]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function gl(e){return Y(e)!==null&&e?.designGroup!==void 0}const et=new Map;function bl(e){const t=et.get(e)??{type:"custom",[V]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function tr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function xl(e,t){return tr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function Sl(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(T,{})}}function nr({label:e}){return r(un,{title:l(e),level:Ye(2)})}function tt({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return k("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(He,{content:d,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":d})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function yl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Po(n,t);return r(h,{label:l(e),icon:r(Lt,{}),changed:!i,action:r(S,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(To)}),children:tt({swatches:Ro,current:i?wo:n??t??"",onPick:o,names:Oo})})}}}function or(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=_o(i,t);return r(h,{label:l(e),icon:r(Xt,{}),changed:!a,action:r(S,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(xo)}),children:tt({swatches:Co,current:a?Eo:Io(i,t),onPick:o,names:yo})})}}}function Cl(e=n=>n,t){return B({_gSectionTheme:y(ko),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(zn,{value:e(n),onChange:o,followLabel:t})}})}function M({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:d,disabled:u=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(Nn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:d===void 0?void 0:l(d),disabled:u,size:"sm",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function K(e,t,n,o,i,a,c="",s){return{type:"custom",render:d=>r(h,{label:l(e),icon:w(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:M({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function nt(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return r(h,{label:l(e),icon:u?w(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?pe(d,{changed:!b,onReset:()=>p(null)}):r(S,{words:x()?.panel,label:l(e),changed:!b,onReset:()=>p(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:m,label:e,onChange:p}):M({min:n,max:o,step:i,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function _l(e){const t=K("Gap",r(Ee,{}),se.min,se.max,se.step,ho[e],"px",(n,o)=>r(Uo,{inherited:!go(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[mo]:e,render:n=>t.render({...n,value:bo(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Z="Corners";function ce(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(Z),icon:r(Dt,{}),changed:i,action:pe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(rr,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=fe()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function rr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=Ae(a)??[...Ne];return r(Pn,{label:l(Z),value:s,corners:ln,onChange:d=>{const u=Ae(d)??[];c(u.length===Ne.length?null:u)},radius:t,onRadiusChange:n,radiusMin:v,radiusMax:Se,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return q({type:"custom",render:()=>r(re,{})},"always")}function ir({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=D(),i=typeof o=="number"?`${o}px`:l("not set");return r(S,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):L(i,l("Site styles")),onReset:n})}function lr(){const{cornerRadiusPx:e}=D();return typeof e=="number"?e:v}function ar(){return ce({sidesKey:"sectionCornerSides",useFollowed:lr,useClosedReason:()=>lt()?l(it):null,mark:r(ir,{label:Z}),hint:r(sr,{})})}const it="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function lt(){return Ve(N())}function sr(){return r(T,{children:lt()?it:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function Il(){return B({_gShape:y("Shape"),sectionCorners:ar(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const cr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function dr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ur(){let e;try{const t=po(D().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||uo.line}function pr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=ur(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=z(()=>bn(a,c)),u=cr();return r(h,{label:l("Border"),icon:r(Nt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(pn,{label:l("Border"),value:a,each:s,onChange:f=>t(dr(f)),placeholder:{sides:gn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:co})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(pr,{value:t,onChange:n,tier:e})})}function El(){return{_gMotion:y("Motion"),sectionAnimation:ue("Entrance",r(_e,{}),[...cn],sn)}}function de(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?ve(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=D(),n=de(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=W(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?ve(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return an(a)?a:o}function fr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=de(),i=st(v),a=o?"Site":"Section";return r(S,{words:x()?.panel,label:l(e),changed:t,detail:L(`${i}px`,o?l("Site styles"):l("the section")),onReset:n})}function hr(){return r(T,{children:de()?l("The section is full width, so this card follows Site styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function mr(){return ce({sidesKey:"cardCornerSides",useFollowed:()=>st(v),mark:r(fr,{label:Z}),hint:r(hr,{})})}function gr(){return{type:"custom",render:()=>r(mt,{})}}function Tl(e){return{...e,render:t=>r(gt,{render:e.render,props:t})}}function Rl(){return{_gShape:y("Shape"),cardCorners:mr(),cardCornerSides:rt(),cardCornersApplyAll:gr()}}function Ol(){return P("Justify",r(kt,{}),Xe,Xe[0].value)}function wl(){return P("Item alignment",r(wt,{}),ro,"stretch")}function Pl(){return P(so,r(on,{}),ze,ze[0].value)}function kl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=ae.find(o=>o.value===e)??ae[0];return r(h,{label:l(je),icon:r(Ie,{}),value:l(n.label),children:r(Be,{className:"sf-gallery-layouts",label:l(je),value:n.value,onChange:t,options:ae.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:br(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function br(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Ll(){return P(io,r(Ee,{}),Ue,Ue[0].value)}function Nl(){return K(lo,r(Yt,{}),$e,ao,1,$e)}function Al(e){const t=ue(no,Go("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),oo(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function vl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Le,{noun:a}),action:r(S,{words:x()?.panel,label:l(e),changed:!Ao(c),detail:l("the Text style in Site styles"),onReset:()=>s(No),defaultAction:{onPress:()=>s(Lo),title:l("Keep this section's own built-in size"),icon:r(At,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Fl(){return{_gCellWidth:y("Cell width"),gridSpan:P("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:yt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function N(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function xr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=N()[c],u=ie(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:ie(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function Sr({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=N()[t],c=ie(void 0,a,n);return r(S,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function yr(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(Sr,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(xr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Dl(e){return{type:"custom",render:({value:t,onChange:n})=>r(_r,{...e,value:t,onChange:n})}}function Cr({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(h,{label:l(e),icon:w(t),action:r(S,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:ee({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function _r({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=N()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Cr,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Ir={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Er={Top:Pe,Bottom:Re,Left:Oe,Right:we},Tr=e=>{const t=Er[e];return r(t,{})};function Bl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Ir[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,j,O,te=E)=>g("mobile",yr({label:i(_),icon:Tr(_),desktopKey:j,min:te.min,max:te.max,step:te.step,fallback:O})),s=e.top??E.min,d=e.bottom??E.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??E,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,R=_=>C?g("desktop",_):_;return B({...o?{_gSpacing:y("Padding")}:{},[t]:R(a(s)),...C?{[F(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:R(K(i("Bottom"),r(Re,{}),E.min,E.max,E.step,d,"px")),...C?{[F(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:R(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[F(u)]:c("Left",u,b,p)}:{},[f]:R(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[F(f)]:c("Right",f,b,p)}:{}}:{}})}const $=["top","right","bottom","left"],Rr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function Or(e,t,n){const o={};for(const i of $)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function wr({tier:e,o:t}){let n=null;try{n=fe()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries($.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries($.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=z(()=>mn(a,c));return r(h,{label:l("Padding"),icon:r(Vt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(hn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=Or(i,a,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:l("Padding top"),right:l("Padding right"),bottom:l("Padding bottom"),left:l("Padding left")},vertical:l("Top and bottom"),horizontal:l("Left and right"),unit:"px"}})})}function Hl(e={}){const t={...Rr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries($.map(s=>[s,F(t[s])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,i=s=>{const d={type:"custom",render:()=>r(wr,{tier:s,o:n})};return o?g(s,d):d},a=()=>q({type:"custom",render:()=>r(re,{})},"always"),c=$.filter(s=>s!=="top");return B({...e.group===!1?{}:{_gSpacing:y("Padding")},[n.keys.top]:i("desktop"),...o?{[n.phoneKeys.top]:i("mobile")}:{},...Object.fromEntries(c.map(s=>[n.keys[s],{...a(),reachedBy:n.keys.top}])),...o?Object.fromEntries(c.map(s=>[n.phoneKeys[s],g("mobile",a())])):{}})}const Pr={contained:"Contained",page:"Page",full:"Full"},Q="Width";function Gl(e,t=vo,n=!0){const o=t.map(i=>({label:Fo[i]??Pr[i],value:i}));return B({...n?{_gWidth:y(Q)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(Q),icon:r(nn,{}),action:n?r(Xo,{inherited:a?.inherited??!1,onReset:()=>i(Do),label:Q}):void 0,children:ee({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:Q})})}})}function Ml(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:X,icon:w(r($t,{})),action:o?o(a):void 0,children:ee({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:X})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?to:eo;return r("div",{className:"sf-field",children:M({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:X,onChange:i})})}}),n=()=>ue("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return B({_gHeight:y(X),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(kr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function kr({onClear:e}){const t=N(),n=qn(t),o=Jn(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(S,{words:x()?.panel,label:l(X),changed:n,detail:i,onReset:e})}function Kl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Lr,{value:o,onChange:i,labelId:`${a??c??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>r("div",{className:"sf-field",children:M({min:J.min,max:J.max,step:J.step,value:typeof n=="number"?n:J.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:y(le),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Lr({value:e,onChange:t,labelId:n,phone:o}){const i=N(),a=Qn(i),c=o?a.phone:e===!0;return r(h,{label:l(le),labelId:n,icon:w(r(Zt,{})),action:k(T,{children:[o?r(S,{words:x()?.panel,label:l(le),changed:Zn(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(De,{checked:c,onChange:t,ariaLabelledBy:n})]})})}function Wl(){return{_gAnchor:y("Anchor"),anchor:Jo("Anchor name","e.g. about",Vo)}}function Ul(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(kn,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function A(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(h,{label:l(e),labelId:d,icon:n,action:r(De,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function Xl(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(ke,{}),htmlFor:i,action:r(Ge,{id:i,label:"Background",value:rn(e),onChange:t})})}}}function $l(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(wn,{id:c,checked:a,onChange:o})})}}}const jl={follows:"fill"},zl={follows:"ink"};function Vl(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Nr,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(h,{label:l(e),icon:n,action:Ge({value:o||t,onChange:i,label:e})})}}function Nr({label:e,part:t,icon:n,value:o,onChange:i}){const a=fo(D().theme),c=t==="fill"?a.fill:a.ink;return r(An,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:L(c.toUpperCase(),l("Site styles")),onChange:i,onReset:()=>i("")})}const Ar=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function dt({label:e,value:t,onChange:n,points:o=Ar}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(On,{label:l(e),value:t,points:i,onChange:n})}function Yl(){return q({type:"custom",render:()=>r(re,{})},"always")}const vr=Ce([]);function ql(e,{stacking:t,fallback:n=Et}){return{type:"custom",render:({value:o,onChange:i})=>{const a=It.includes(o)?o:n;return t?r(Fr,{label:e,value:a,onChange:i}):ut({label:e,value:a,onChange:i,points:vr})}}}function Fr({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=W(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?_t(o?.data,a):[];return ut({label:e,value:t,onChange:n,points:Ce(c,a)})}function ut({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(qt,{}),hint:i?.title?l(i.title):void 0,children:dt({label:e,value:Tt(t),onChange:n,points:o})})}const Jl={top:r(Mt,{}),right:r(Gt,{}),bottom:r(Bt,{}),left:r(Ht,{})};function Zl(e,t,n,o,i,a){const c=f=>t.find(p=>p.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return s(`missing-${f}`);const m=a?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[s("corner-top-left"),d("top"),s("corner-top-right"),d("left"),s("centre"),d("right"),s("corner-bottom-left"),d("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:dt({label:e,value:m,onChange:p,points:u})})}}}const Dr="\0note";function P(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const d=s.options??n,u=s.fallback??o,f=d.some(p=>p.value===a)?a:u;return r(h,{label:l(e),icon:w(t),children:r(xn,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Dr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function Ql(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(jn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function ea(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Vn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function ta(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function ee({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(fn,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const na=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ue(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:w(t),children:ee({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function oa(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r($n,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const ra={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ia({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=(s,d)=>t({...o,[s]:d===""?void 0:Number(d)});return k(h,{label:l(n),icon:r(oe,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&k("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:s=>c("lat",s.target.value)})}),r(h,{label:l("Longitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:s=>c("lng",s.target.value)})})]})]})}function Br(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Hr(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function la(e,t){return e===null?null:t>e?e:null}function Gr(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const aa={label:"Ticker items",icon:r(zt,{})};function sa(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r(Mr,{label:e,icon:w(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Mr({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=ne(null),[s,d]=z(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Gr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(Sn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Me,{target:c,value:Br(n,s),onChange:p=>i(Hr(n,s??-1,p)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(p,m,b)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(m)}})})}function ca(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function da(e){return{_gCards:y("Cards"),coverIndex:P("Cover image",r(jt,{}),Wn,String(Un),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:or("Image background",So),cardImage:Wr(),spinOnHover:A("Rotate on hover",e?.spinDefault??!0,r(Qt,{}))}}function ua(){return{outline:P("Card outline",r(en,{}),Gn,Kn),indexBadge:P("Card number",r(Te,{}),Hn,Mn),showBadge:A("Product badge",!0,r(Le,{noun:"tag"}))}}function pa(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:y("Show on a card"),showCardPrice:A("Price",!0,r(Kt,{})),showCardFinishes:A("Finish swatches",!0,r(Wt,{})),showCardSizes:A("Sizes",n.showCardSizes,r(Jt,{})),showCardBuy:A("Buy button",n.showCardBuy,r(vt,{})),showCardPage:A("Page button",n.showCardPage,r(ke,{}))}}function fa(e,t="display"){const n=F(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(pt,{parts:e,changed:Cn(o),shown:a=>_n(o,a),onPress:(a,c)=>i(Tn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(Kr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function pt({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(Pt,{}),changed:t,action:r(S,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(yn,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function Kr({parts:e,desktopKey:t,value:n,onChange:o}){const i=N()[t];return r(pt,{parts:e,changed:En(n),shown:a=>In(i,n,a),onPress:(a,c)=>o(Rn(n,a,c)),onReset:()=>o(Dn),detail:l("the same as Desktop")})}function Wr(){return nt("Card image",{min:v,max:Se,step:bt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function ha(){return ce({sidesKey:"cornerSides",step:xt,useFollowed:()=>v,mark:r(Ur,{label:St}),hint:l("Rounds the picture. Left alone it stays square.")})}function Ur({label:e,changed:t=!1,onReset:n=()=>{}}){return r(S,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function ma(){return{type:"custom",render:({value:e,onChange:t})=>r(Xr,{value:typeof e=="string"?e:"",onChange:t})}}function Xr({value:e,onChange:t}){const[n,o]=z(null),i=ye.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return k(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Ft,{}),children:k("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),Ct.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(Ut,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:ye.length}),children:r(Be,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(U[c].label),picture:r("span",{className:"sf-gallery-pic",children:U[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{Vo as ANCHOR_HINT,jo as BOUND_TO_POST,ol as BOUND_TO_POST_NOTE,dl as BUCKET_ICONS,ra as CUSTOM_FIELD_MEDIA,ia as CoordsField,Jl as EDGE_ARROWS,Ln as FOCAL_DEFAULT,Ar as FOCAL_POINTS,V as FOLD_FIELD_MARKER,jl as FOLLOWS_SITE_BUTTON,zl as FOLLOWS_SITE_BUTTON_INK,dt as FocalPicker,nr as GroupLabel,zo as HIGHLIGHT_HINT,H as HidableTextField,ge as LINK_FIELD_MARKER,Yi as Label,be as MEDIA_FIELD_MARKER,na as MEDIA_TYPE_OPTIONS,rl as NOT_BOUND_TO_POST,er as PanelNoteLine,_r as PhoneChoiceRow,Cr as PhoneChoiceStrip,ut as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Sa as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Rr as SIDE_PAD_KEYS,Zo as SectionHeading,ee as Segmented,Uo as SiteGapDefaultReset,M as Slider,tt as Swatches,xa as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,aa as TICKER_ITEMS_ROW,Mr as TextListField,Xo as WidthDefaultReset,Gr as aimAfterListChange,Wl as anchorFields,L as backTo,yl as backgroundField,wl as boxAlignField,Ll as boxBlockSpacingField,Ol as boxJustifyField,Nl as boxPhoneRowField,kl as boxShareField,Pl as boxWrapField,ml as bucketHeader,mr as cardCornersField,or as cardImageBackgroundField,Wr as cardImageField,da as cardMediaFields,Rl as cardShapeFields,pa as cardShowFields,ua as cardStyleFields,Fl as cellWidthFields,$l as checkbox,Vl as colorInput,al as copyText,rt as cornerSidesField,ce as cornersRowField,Ul as dateTime,bl as designGroupHeader,Al as directionField,fa as displayFields,Zl as edgePad,ul as entriesHiddenForTab,la as focusAfterRemove,Yl as focusKeptField,xl as foldMarker,Y as foldMetaOf,tr as foldTitleOf,ma as galleryLayoutField,_l as gapField,y as group,Ml as heightFields,me as hidableText,qo as hintIsWhileTyping,w as iconOf,ha as imageCornersField,nl as inOwnBox,hl as isBucketHeader,gl as isDesignGroupHeader,Mo as isNoGlyph,sl as linkField,Ql as multiSelect,Go as noGlyph,Xl as pageBackgroundField,pl as panelNote,Dl as phoneChoiceField,yr as phoneOverrideField,ql as placementField,Jo as plainText,cl as plainTextarea,nt as pxField,Sl as quietMarker,he as readHidable,Br as rowText,ea as searchSelect,fl as section,El as sectionAnimationFields,at as sectionBorderField,ar as sectionCornersField,Il as sectionShapeFields,Cl as sectionThemeFields,ue as segmented,P as select,Hr as setRowText,B as sharedStyleKinds,Hl as sidesPaddingFields,Or as sidesPaddingPatch,vl as sizeField,K as slider,ta as sourceField,Bl as spacingFields,Kl as stickFields,Tl as templateField,il as text,ht as textFieldIdentifier,Zi as textFieldOffPage,el as textFieldPanelOnly,sa as textList,ca as textListRowField,ll as textarea,A as toggle,oa as upload,Ko as usePageWidthDetail,N as useSelectedProps,ot as useSelectedSibling,Wo as useSiteGapDetail,Gl as widthField,tl as withIdentifier,Ji as withOffPage,Qi as withPanelOnly,qi as withScaffold};
|
|
1
|
+
"use client";import{jsx as r,jsxs as w,Fragment as T}from"react/jsx-runtime";import{cloneElement as fe,useId as ht,useRef as oe,useState as V}from"react";import{useEasel as W,useSelectedFields as re}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as he,hidableText as me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Y,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as q,textFieldIdentifier as mt}from"efficient-easel/draw";import gt from"../../components/ApplyCornersToSiblings.js";import bt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as xt,CORNER_RADIUS_MAX as ye,CORNER_RADIUS_MIN as A}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as yt,IMAGE_CORNERS_LABEL as St}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Ct}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as _t,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as Se}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as It,HERO_GROUP_PLACEMENTS as Et,HERO_GROUP_PLACEMENT_DEFAULT as Tt,normalisePlacement as Rt,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import Ot from"../../components/KeepHint.js";import{AdjustIcon as wt,AlignLeftIcon as Pt,EyeIcon as kt,AlignSeparateIcon as Nt,AnimationIcon as _e,BackgroundIcon as Lt,BorderAllIcon as vt,BlockSectionIcon as At,CartIcon as Ft,ColumnWidthsIcon as Ie,ColumnsIcon as Dt,CornerIcon as Bt,DirectionDownIcon as Ht,DirectionLeftIcon as Gt,DirectionRightIcon as Mt,DirectionUpIcon as Kt,DollarIcon as Wt,FinishIcon as Ut,GapIcon as Ee,GridIcon as Xt,GroundIcon as $t,HashIcon as Te,HeightIcon as jt,ImageIcon as zt,ListIcon as Vt,LocationIcon as ie,NudgeIcon as Yt,PaddingAllIcon as qt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Jt,PlacementIcon as Zt,ProductSizeIcon as Qt,StickyIcon as en,RotateIcon as tn,SquareIcon as nn,TypeIcon as on,WidthIcon as rn,WrapIcon as ln}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as an}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Le,CORNER_SIDE_POINTS as sn,hasOwnSectionCorners as cn,normalizeCornerSides as ve}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as dn,SECTION_MOTION_OPTIONS as un}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Ae}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as h,SettingsGroupHead as pn,SettingsGroupSub as fn,SettingsBorder as hn,SettingsSegmented as mn,SettingsSides as gn,SettingsSidesEach as Fe,sidesStartEach as bn,SettingsSwitch as De,borderSides as xn,borderStartEach as yn}from"efficient-easel/panel";import{FieldSelect as Sn,ListField as Cn}from"efficient-easel/fields";import{DisplayChips as _n}from"efficient-shell/ui";import{desktopDisplayChanged as In,partShownOnDesktop as En,partShownOnPhone as Tn,phoneDisplayChanged as Rn,withDesktopPart as On,withPhonePart as wn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Pn,Checkbox as kn,CornersInput as Nn,DateTimePicker as Ln,FOCAL_DEFAULT as vn,PictureTiles as Be,PositionInput as An,Slider as Fn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as Dn}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as Bn,NoControlMark as J,noControlField as X}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Hn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Gn,phoneKey as F,resolvePhoneValue as le}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Mn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Kn,CARD_OUTLINE_OPTIONS as Wn,DEFAULT_CARD_INDEX_FORMAT as Un,DEFAULT_CARD_OUTLINE as Xn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as $n,DEFAULT_COVER_INDEX as jn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as zn}from"efficient-easel/draw";import Vn from"../../components/MediaUploadField.js";import Yn from"../../components/MultiSelectField.js";import qn from"../../components/SectionThemePicker.js";import Jn from"../../components/SearchSelectField.js";import Zn from"../../components/StorefrontLinkField.js";import{UiIcon as Ke}from"efficient-easel/draw/client";import{SECTION_PADDING as E}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as Qn,resolveSectionMinHeight as eo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as ae,hasPhoneStick as to,resolveSectionStick as no}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as oo,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as ro}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as io,containerDirectionPoints as lo,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as ao,BOX_BLOCK_SPACING_LABEL as so,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as co,BOX_PHONE_ROW_MAX as uo,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as se,BOX_WRAP_LABEL as po,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as D}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as fo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as ho,normalizeTheme as mo,siteButtonPaint as go}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ce,CONTAINER_GAP_BUILT_IN as bo,GAP_FIELD_CONTAINER as xo,hasOwnContainerGap as yo,resolveContainerGap as So}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Co,CARD_IMAGE_BG_OFF as _o,CARD_IMAGE_BG_SWATCH_NAMES as Io,CARD_IMAGE_BG_SWATCHES as Eo,isCardImageBackgroundInheriting as To,cardImageBackgroundChoice as Ro,THEME_CARD_IMAGE_BG as Oo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as wo,SECTION_BG_SWATCHES as Po,SECTION_BG_SWATCH_NAMES as ko,THEME_SECTION_BG as No,isSectionBackgroundInheriting as Lo}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as vo}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Ao,TYPE_SIZE_INHERIT as Fo,isTypeSizeInheriting as Do}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Bo,WIDTH_CHOICE_LABEL as Ho,WIDTH_INHERIT as Go,resolveWidth as Mo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Ko}from"efficient-easel/style-clipboard";function B(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!q(n)&&Ko(n,`section:${t}`);return e}function el({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Wo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function Uo(e){return e.type===qe}function P(e){return Uo(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function Xo(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Mo(t,"full");return n==="page"?N(`${o}px`,l("the page")):n==="contained"?N(l("Contained"),l("the page")):N(l("Full"),l("the page"))}function $o(){const{blockGap:e}=D();return e===null?l("this container's own spacing"):N(`${e}px`,l("Site styles"))}function jo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:$o(),onReset:t})}function zo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Xo(),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=he(e),f=oe(null),p=oe(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=ht(),_=i?Qo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(Ot,{children:l(i)}):void 0,z=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(on,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:z,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":z,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:w("div",{className:"sf-copybox",children:[s&&r(Me,{target:a?p:f,value:d,onChange:m}),a?r("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)}):r("input",{id:R,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)})]})})}function tl(e,t){return{...e,[xe]:t}}function nl(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function ol(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function rl(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function il(e){return!!e&&typeof e=="object"&&e[Je]===!0}function ll(e){const t=e[I];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[I]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Ea,SCALAR_TEXT_CONTROLS as Ta}from"efficient-easel/draw";function al(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[Bn]:o,...i}=e;return{...i,[Hn]:!0,render:t}}const Vo=new Set(zn),G=(e,t)=>{const n={...t,[I]:e};if(!Vo.has(e.control))return n;const o=t.render;return{...X(n,"authored-copy"),render:i=>r(Mn,{name:i.name,children:o(i)})}},sl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Yo={field:"source.slug",set:!0},cl={not:Yo},qo="Select a word, then press the highlighter.",Jo="A short name so a link can jump straight to this section, like yoursite.com/page#about.",Zo=new Set([qo]),Qo=e=>Zo.has(e);function dl(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function ul(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function er(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function pl(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function fl(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(Zn,{value:me(t),onChange:n,label:e})}}function hl(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const ml={Design:wt,Animation:_e};function gl(e,t){return e.includes("Design")?t!=="Design":null}function tr({label:e}){return r(pn,{title:l(e),level:Ye(1)})}function nr({level:e,label:t}){return e===1?r(tr,{label:t}):r(ir,{label:t})}function Ze(e,t){return{type:"custom",[Y]:{label:e,level:t},render:()=>r(nr,{level:t,label:e})}}function S(e){return Ze(e,2)}function bl(e){return{type:"custom",render:()=>r(or,{text:e})}}function or({text:e}){return r("p",{className:"sf-note",children:l(e)})}function xl(e){return Ze(e,1)}function yl(e){return q(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function Sl(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[Y]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function Cl(e){return q(e)!==null&&e?.designGroup!==void 0}const et=new Map;function _l(e){const t=et.get(e)??{type:"custom",[Y]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function rr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Il(e,t){return rr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function El(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(T,{})}}function ir({label:e}){return r(fn,{title:l(e),level:Ye(2)})}function tt({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return w("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(He,{content:d,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":d})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function Tl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Lo(n,t);return r(h,{label:l(e),icon:r(Lt,{}),changed:!i,action:r(y,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(wo)}),children:tt({swatches:Po,current:i?No:n??t??"",onPick:o,names:ko})})}}}function lr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=To(i,t);return r(h,{label:l(e),icon:r($t,{}),changed:!a,action:r(y,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Co)}),children:tt({swatches:Eo,current:a?Oo:Ro(i,t),onPick:o,names:Io})})}}}function Rl(e=n=>n,t){return B({_gSectionTheme:S(vo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(qn,{value:e(n),onChange:o,followLabel:t})}})}function M({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:d,disabled:u=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(Fn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:d===void 0?void 0:l(d),disabled:u,size:"sm",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function K(e,t,n,o,i,a,c="",s){return{type:"custom",render:d=>r(h,{label:l(e),icon:P(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:M({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function nt(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return r(h,{label:l(e),icon:u?P(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?fe(d,{changed:!b,onReset:()=>p(null)}):r(y,{words:x()?.panel,label:l(e),changed:!b,onReset:()=>p(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:m,label:e,onChange:p}):M({min:n,max:o,step:i,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function Ol(e){const t=K("Gap",r(Ee,{}),ce.min,ce.max,ce.step,bo[e],"px",(n,o)=>r(jo,{inherited:!yo(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[xo]:e,render:n=>t.render({...n,value:So(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Q="Corners";function de(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(Q),icon:r(Bt,{}),changed:i,action:fe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(ar,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=re()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function ar({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=ve(a)??[...Le];return r(Nn,{label:l(Q),value:s,corners:sn,onChange:d=>{const u=ve(d)??[];c(u.length===Le.length?null:u)},radius:t,onRadiusChange:n,radiusMin:A,radiusMax:ye,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return X({type:"custom",render:()=>r(J,{})},"always")}function sr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=D(),i=typeof o=="number"?`${o}px`:l("not set");return r(y,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(i,l("Site styles")),onReset:n})}function cr(){const{cornerRadiusPx:e}=D();return typeof e=="number"?e:A}function dr(){return de({sidesKey:"sectionCornerSides",useFollowed:cr,useClosedReason:()=>lt()?l(it):null,mark:r(sr,{label:Q}),hint:r(ur,{})})}const it="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function lt(){return Ve(L())}function ur(){return r(T,{children:lt()?it:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function wl(){return B({_gShape:S("Shape"),sectionCorners:dr(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const pr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function fr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function hr(){let e;try{const t=mo(D().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||ho.line}function mr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=hr(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=V(()=>yn(a,c)),u=pr();return r(h,{label:l("Border"),icon:r(vt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(hn,{label:l("Border"),value:a,each:s,onChange:f=>t(fr(f)),placeholder:{sides:xn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:fo})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(mr,{value:t,onChange:n,tier:e})})}function Pl(){return{_gMotion:S("Motion"),sectionAnimation:pe("Entrance",r(_e,{}),[...un],dn)}}function ue(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Ae(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=D(),n=ue(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=W(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?Ae(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return cn(a)?a:o}function gr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=ue(),i=st(A),a=o?"Site":"Section";return r(y,{words:x()?.panel,label:l(e),changed:t,detail:N(`${i}px`,o?l("Site styles"):l("the section")),onReset:n})}function br(){return r(T,{children:ue()?l("The section is full width, so this card follows Site styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function xr(){return de({sidesKey:"cardCornerSides",useFollowed:()=>st(A),mark:r(gr,{label:Q}),hint:r(br,{})})}function yr(){return{type:"custom",render:()=>r(gt,{})}}function kl(e){return{...e,render:t=>r(bt,{render:e.render,props:t})}}function Nl(){return{_gShape:S("Shape"),cardCorners:xr(),cardCornerSides:rt(),cardCornersApplyAll:yr()}}function Ll(){return k("Justify",r(Nt,{}),Xe,Xe[0].value)}function vl(){return k("Item alignment",r(Pt,{}),ao,"stretch")}function Al(){return k(po,r(ln,{}),ze,ze[0].value)}function Fl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=se.find(o=>o.value===e)??se[0];return r(h,{label:l(je),icon:r(Ie,{}),value:l(n.label),children:r(Be,{className:"sf-gallery-layouts",label:l(je),value:n.value,onChange:t,options:se.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:Sr(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function Sr(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Dl(){return k(so,r(Ee,{}),Ue,Ue[0].value)}function Bl(){return K(co,r(Jt,{}),$e,uo,1,$e)}function Hl(e){const t=pe(io,Wo("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),lo(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function Gl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Ne,{noun:a}),action:r(y,{words:x()?.panel,label:l(e),changed:!Do(c),detail:l("the Text style in Site styles"),onReset:()=>s(Fo),defaultAction:{onPress:()=>s(Ao),title:l("Keep this section's own built-in size"),icon:r(At,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Ml(){return{_gCellWidth:S("Cell width"),gridSpan:k("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:Ct},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Cr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=L()[c],u=le(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:le(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function _r({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=L()[t],c=le(void 0,a,n);return r(y,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function Ir(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(_r,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Cr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Kl(e){return{type:"custom",render:({value:t,onChange:n})=>r(Tr,{...e,value:t,onChange:n})}}function Er({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(h,{label:l(e),icon:P(t),action:r(y,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:te({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function Tr({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=L()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Er,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Rr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Or={Top:Pe,Bottom:Re,Left:Oe,Right:we},wr=e=>{const t=Or[e];return r(t,{})};function Wl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Rr[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,z,O,ne=E)=>g("mobile",Ir({label:i(_),icon:wr(_),desktopKey:z,min:ne.min,max:ne.max,step:ne.step,fallback:O})),s=e.top??E.min,d=e.bottom??E.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??E,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,R=_=>C?g("desktop",_):_;return B({...o?{_gSpacing:S("Padding")}:{},[t]:R(a(s)),...C?{[F(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:R(K(i("Bottom"),r(Re,{}),E.min,E.max,E.step,d,"px")),...C?{[F(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:R(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[F(u)]:c("Left",u,b,p)}:{},[f]:R(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[F(f)]:c("Right",f,b,p)}:{}}:{}})}const j=["top","right","bottom","left"],Pr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function kr(e,t,n){const o={};for(const i of j)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function Nr({tier:e,o:t}){let n=null;try{n=re()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries(j.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries(j.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=V(()=>bn(a,c));return r(h,{label:l("Padding"),icon:r(qt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(gn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=kr(i,a,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:l("Padding top"),right:l("Padding right"),bottom:l("Padding bottom"),left:l("Padding left")},vertical:l("Top and bottom"),horizontal:l("Left and right"),unit:"px"}})})}function Ul(e={}){const t={...Pr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(j.map(s=>[s,F(t[s])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,i=s=>{const d={type:"custom",render:()=>r(Nr,{tier:s,o:n})};return o?g(s,d):d},a=()=>X({type:"custom",render:()=>r(J,{})},"always"),c=j.filter(s=>s!=="top");return B({...e.group===!1?{}:{_gSpacing:S("Padding")},[n.keys.top]:i("desktop"),...o?{[n.phoneKeys.top]:i("mobile")}:{},...Object.fromEntries(c.map(s=>[n.keys[s],{...a(),reachedBy:n.keys.top}])),...o?Object.fromEntries(c.map(s=>[n.phoneKeys[s],g("mobile",a())])):{}})}const dt=e=>typeof e=="number"?e:null;function Lr(e,t,n){const o={};for(const i of["x","y"])n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function vr({o:e}){let t=null;try{t=re()}catch{t=null}const n=t?.values??{},o={x:dt(n[e.keys.x]),y:dt(n[e.keys.y])},i=l(e.label??"Position"),a=!!(o.x||o.y),c=u=>{const f=Lr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},s=r(An,{label:i,value:o,onChange:c,words:{x:l("Left and right"),y:l("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=r(y,{words:x()?.panel,label:i,changed:a,detail:"0 px, 0 px",onReset:()=>c({x:null,y:null})});return e.label===null?w("div",{className:"sf-position-line",children:[s,d]}):r(h,{label:i,icon:r(Yt,{}),changed:a,action:d,children:s})}function Xl(e){return{[e.keys.x]:{type:"custom",render:()=>r(vr,{o:e})},[e.keys.y]:{...X({type:"custom",render:()=>r(J,{})},"always"),reachedBy:e.keys.x}}}const Ar={contained:"Contained",page:"Page",full:"Full"},ee="Width";function $l(e,t=Bo,n=!0){const o=t.map(i=>({label:Ho[i]??Ar[i],value:i}));return B({...n?{_gWidth:S(ee)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(ee),icon:r(rn,{}),action:n?r(zo,{inherited:a?.inherited??!1,onReset:()=>i(Go),label:ee}):void 0,children:te({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ee})})}})}function jl(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:$,icon:P(r(jt,{})),action:o?o(a):void 0,children:te({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:$})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?ro:oo;return r("div",{className:"sf-field",children:M({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:$,onChange:i})})}}),n=()=>pe("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return B({_gHeight:S($),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(Fr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Fr({onClear:e}){const t=L(),n=Qn(t),o=eo(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(y,{words:x()?.panel,label:l($),changed:n,detail:i,onReset:e})}function zl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Dr,{value:o,onChange:i,labelId:`${a??c??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>r("div",{className:"sf-field",children:M({min:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:S(ae),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Dr({value:e,onChange:t,labelId:n,phone:o}){const i=L(),a=no(i),c=o?a.phone:e===!0;return r(h,{label:l(ae),labelId:n,icon:P(r(en,{})),action:w(T,{children:[o?r(y,{words:x()?.panel,label:l(ae),changed:to(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(De,{checked:c,onChange:t,ariaLabelledBy:n})]})})}function Vl(){return{_gAnchor:S("Anchor"),anchor:er("Anchor name","e.g. about",Jo)}}function Yl(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(Ln,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function v(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(h,{label:l(e),labelId:d,icon:n,action:r(De,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function ql(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(ke,{}),htmlFor:i,action:r(Ge,{id:i,label:"Background",value:an(e),onChange:t})})}}}function Jl(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(kn,{id:c,checked:a,onChange:o})})}}}const Zl={follows:"fill"},Ql={follows:"ink"};function ea(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Br,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(h,{label:l(e),icon:n,action:Ge({value:o||t,onChange:i,label:e})})}}function Br({label:e,part:t,icon:n,value:o,onChange:i}){const a=go(D().theme),c=t==="fill"?a.fill:a.ink;return r(Dn,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),l("Site styles")),onChange:i,onReset:()=>i("")})}const Hr=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function ut({label:e,value:t,onChange:n,points:o=Hr}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(Pn,{label:l(e),value:t,points:i,onChange:n})}function ta(){return X({type:"custom",render:()=>r(J,{})},"always")}const Gr=Ce([]);function na(e,{stacking:t,fallback:n=Tt}){return{type:"custom",render:({value:o,onChange:i})=>{const a=Et.includes(o)?o:n;return t?r(Mr,{label:e,value:a,onChange:i}):pt({label:e,value:a,onChange:i,points:Gr})}}}function Mr({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=W(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?It(o?.data,a):[];return pt({label:e,value:t,onChange:n,points:Ce(c,a)})}function pt({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(Zt,{}),hint:i?.title?l(i.title):void 0,children:ut({label:e,value:Rt(t),onChange:n,points:o})})}const oa={top:r(Kt,{}),right:r(Mt,{}),bottom:r(Ht,{}),left:r(Gt,{})};function ra(e,t,n,o,i,a){const c=f=>t.find(p=>p.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return s(`missing-${f}`);const m=a?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[s("corner-top-left"),d("top"),s("corner-top-right"),d("left"),s("centre"),d("right"),s("corner-bottom-left"),d("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:ut({label:e,value:m,onChange:p,points:u})})}}}const Kr="\0note";function k(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const d=s.options??n,u=s.fallback??o,f=d.some(p=>p.value===a)?a:u;return r(h,{label:l(e),icon:P(t),children:r(Sn,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Kr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function ia(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(Yn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function la(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Jn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function aa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function te({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(mn,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const sa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function pe(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:P(t),children:te({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function ca(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r(Vn,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const da={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ua({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=(s,d)=>t({...o,[s]:d===""?void 0:Number(d)});return w(h,{label:l(n),icon:r(ie,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&w("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(ie,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:s=>c("lat",s.target.value)})}),r(h,{label:l("Longitude"),icon:r(ie,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:s=>c("lng",s.target.value)})})]})]})}function Wr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Ur(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function pa(e,t){return e===null?null:t>e?e:null}function Xr(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const fa={label:"Ticker items",icon:r(Vt,{})};function ha(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r($r,{label:e,icon:P(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function $r({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=oe(null),[s,d]=V(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Xr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(Cn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Me,{target:c,value:Wr(n,s),onChange:p=>i(Ur(n,s??-1,p)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(p,m,b)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(m)}})})}function ma(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(H,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function ga(e){return{_gCards:S("Cards"),coverIndex:k("Cover image",r(zt,{}),$n,String(jn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:lr("Image background",_o),cardImage:zr(),spinOnHover:v("Rotate on hover",e?.spinDefault??!0,r(tn,{}))}}function ba(){return{outline:k("Card outline",r(nn,{}),Wn,Xn),indexBadge:k("Card number",r(Te,{}),Kn,Un),showBadge:v("Product badge",!0,r(Ne,{noun:"tag"}))}}function xa(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:S("Show on a card"),showCardPrice:v("Price",!0,r(Wt,{})),showCardFinishes:v("Finish swatches",!0,r(Ut,{})),showCardSizes:v("Sizes",n.showCardSizes,r(Qt,{})),showCardBuy:v("Buy button",n.showCardBuy,r(Ft,{})),showCardPage:v("Page button",n.showCardPage,r(ke,{}))}}function ya(e,t="display"){const n=F(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(ft,{parts:e,changed:In(o),shown:a=>En(o,a),onPress:(a,c)=>i(On(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(jr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function ft({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(kt,{}),changed:t,action:r(y,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(_n,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function jr({parts:e,desktopKey:t,value:n,onChange:o}){const i=L()[t];return r(ft,{parts:e,changed:Rn(n),shown:a=>Tn(i,n,a),onPress:(a,c)=>o(wn(n,a,c)),onReset:()=>o(Gn),detail:l("the same as Desktop")})}function zr(){return nt("Card image",{min:A,max:ye,step:xt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function Sa(){return de({sidesKey:"cornerSides",step:yt,useFollowed:()=>A,mark:r(Vr,{label:St}),hint:l("Rounds the picture. Left alone it stays square.")})}function Vr({label:e,changed:t=!1,onReset:n=()=>{}}){return r(y,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Ca(){return{type:"custom",render:({value:e,onChange:t})=>r(Yr,{value:typeof e=="string"?e:"",onChange:t})}}function Yr({value:e,onChange:t}){const[n,o]=V(null),i=Se.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return w(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Dt,{}),children:w("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),_t.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(Xt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Se.length}),children:r(Be,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(U[c].label),picture:r("span",{className:"sf-gallery-pic",children:U[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{Jo as ANCHOR_HINT,Yo as BOUND_TO_POST,sl as BOUND_TO_POST_NOTE,ml as BUCKET_ICONS,da as CUSTOM_FIELD_MEDIA,ua as CoordsField,oa as EDGE_ARROWS,vn as FOCAL_DEFAULT,Hr as FOCAL_POINTS,Y as FOLD_FIELD_MARKER,Zl as FOLLOWS_SITE_BUTTON,Ql as FOLLOWS_SITE_BUTTON_INK,ut as FocalPicker,ir as GroupLabel,qo as HIGHLIGHT_HINT,H as HidableTextField,ge as LINK_FIELD_MARKER,el as Label,be as MEDIA_FIELD_MARKER,sa as MEDIA_TYPE_OPTIONS,cl as NOT_BOUND_TO_POST,or as PanelNoteLine,Tr as PhoneChoiceRow,Er as PhoneChoiceStrip,pt as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Ta as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Pr as SIDE_PAD_KEYS,tr as SectionHeading,te as Segmented,jo as SiteGapDefaultReset,M as Slider,tt as Swatches,Ea as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,fa as TICKER_ITEMS_ROW,$r as TextListField,zo as WidthDefaultReset,Xr as aimAfterListChange,Vl as anchorFields,N as backTo,Tl as backgroundField,vl as boxAlignField,Dl as boxBlockSpacingField,Ll as boxJustifyField,Bl as boxPhoneRowField,Fl as boxShareField,Al as boxWrapField,Sl as bucketHeader,xr as cardCornersField,lr as cardImageBackgroundField,zr as cardImageField,ga as cardMediaFields,Nl as cardShapeFields,xa as cardShowFields,ba as cardStyleFields,Ml as cellWidthFields,Jl as checkbox,ea as colorInput,pl as copyText,rt as cornerSidesField,de as cornersRowField,Yl as dateTime,_l as designGroupHeader,Hl as directionField,ya as displayFields,ra as edgePad,gl as entriesHiddenForTab,pa as focusAfterRemove,ta as focusKeptField,Il as foldMarker,q as foldMetaOf,rr as foldTitleOf,Ca as galleryLayoutField,Ol as gapField,S as group,jl as heightFields,me as hidableText,Qo as hintIsWhileTyping,P as iconOf,Sa as imageCornersField,al as inOwnBox,yl as isBucketHeader,Cl as isDesignGroupHeader,Uo as isNoGlyph,fl as linkField,ia as multiSelect,Wo as noGlyph,ql as pageBackgroundField,bl as panelNote,Kl as phoneChoiceField,Ir as phoneOverrideField,na as placementField,er as plainText,hl as plainTextarea,Xl as positionFields,Lr as positionPatch,nt as pxField,El as quietMarker,he as readHidable,Wr as rowText,la as searchSelect,xl as section,Pl as sectionAnimationFields,at as sectionBorderField,dr as sectionCornersField,wl as sectionShapeFields,Rl as sectionThemeFields,pe as segmented,k as select,Ur as setRowText,B as sharedStyleKinds,Ul as sidesPaddingFields,kr as sidesPaddingPatch,Gl as sizeField,K as slider,aa as sourceField,Wl as spacingFields,zl as stickFields,kl as templateField,dl as text,mt as textFieldIdentifier,ol as textFieldOffPage,il as textFieldPanelOnly,ha as textList,ma as textListRowField,ul as textarea,v as toggle,ca as upload,Xo as usePageWidthDetail,L as useSelectedProps,ot as useSelectedSibling,$o as useSiteGapDetail,$l as widthField,ll as withIdentifier,nl as withOffPage,rl as withPanelOnly,tl as withScaffold};
|
|
@@ -2,7 +2,6 @@ import type { BlockChoice } from "efficient-easel/screen/lib/puck/block-choice";
|
|
|
2
2
|
import { HEADER_TYPE, FOOTER_TYPE, type TreeItem } from "efficient-easel/draw";
|
|
3
3
|
export { HEADER_TYPE, FOOTER_TYPE };
|
|
4
4
|
export declare function buildDefaultHeaderNode(): TreeItem;
|
|
5
|
-
export { blockRuns, type BlockChoice, type BlockChoiceRun } from "efficient-easel/screen/lib/puck/block-choice";
|
|
6
5
|
export declare const FOOTER_BLOCK_CHOICES: BlockChoice[];
|
|
7
6
|
export declare const GROUP_BLOCK_CHOICES: BlockChoice[];
|
|
8
7
|
export declare const FOOTER_GROUP_TYPE = "FooterGroup";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HEADER_TYPE as e,FOOTER_TYPE as r,newNodeId as n}from"efficient-easel/draw";function
|
|
1
|
+
import{HEADER_TYPE as e,FOOTER_TYPE as r,newNodeId as n}from"efficient-easel/draw";function F(){return{type:e,props:{id:n(e)}}}const l=[{type:"FooterLogo",label:"Logo"},{type:"FooterMenu",label:"Menu"},{type:"FooterText",label:"Text"},{type:"FooterEmailSignup",label:"Email Form"},{type:"FooterSocial",label:"Social Logos"},{type:"FooterGroup",label:"Footer Box"},{type:"FooterDivider",label:"Divider"}],p=l.filter(o=>o.type!=="FooterLogo"&&o.type!=="FooterGroup"),a="FooterGroup",c="blocks";function d(o){return o===r?l:o===a?p:null}function s(){const o=(t,i)=>({type:t,props:{id:`${t}-${crypto.randomUUID()}`,...i}});return[o("FooterLogo",{widthPct:100,align:"left",tagline:""}),o("FooterGroup",{direction:"vertical",align:"start",blocks:[o("FooterText",{text:"Join our email list",size:"md",tone:"default"}),o("FooterEmailSignup",{heading:"",placeholder:"Email address",buttonLabel:"Subscribe"})]})]}export{c as FOOTER_BLOCKS_SLOT,l as FOOTER_BLOCK_CHOICES,a as FOOTER_GROUP_TYPE,r as FOOTER_TYPE,p as GROUP_BLOCK_CHOICES,e as HEADER_TYPE,d as blockChoicesFor,s as buildDefaultFooterBlocks,F as buildDefaultHeaderNode};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SiteLiveState } from "
|
|
1
|
+
import type { SiteLiveState } from "../../format/lib/web-backend.js";
|
|
2
2
|
export type { SiteLiveState };
|
|
3
3
|
export declare function readSiteLiveStateWith(read: (() => Promise<SiteLiveState>) | null): void;
|
|
4
4
|
export declare function noteSiteLiveState(state: SiteLiveState): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as m,useEffect as h,useRef as p}from"react";import{currentEaselSession as v}from"efficient-easel/screen/lib/session";import{backendOf as T}from"./website-session.js";import{useEaselSession as b}from"efficient-easel/screen/lib/session-context";import{refreshSiteLiveState as E}from"./site-live-state.js";import{holdSiteWrites as g}from"../../format/lib/site-writes.js";import{WebsiteBackendError as x}from"
|
|
1
|
+
import{useCallback as m,useEffect as h,useRef as p}from"react";import{currentEaselSession as v}from"efficient-easel/screen/lib/session";import{backendOf as T}from"./website-session.js";import{useEaselSession as b}from"efficient-easel/screen/lib/session-context";import{refreshSiteLiveState as E}from"./site-live-state.js";import{holdSiteWrites as g}from"../../format/lib/site-writes.js";import{WebsiteBackendError as x}from"efficient-easel/screen/lib/backend-error";function w(r=v()){return(u,c,o)=>{const e=T(r).theme;return e?e.update(u,o?{siteId:o}:void 0):Promise.reject(new x("invalid","This backend stores no site theme."))}}function S(r){return r.themeFromDocument?{status:"skipped",reason:"template"}:r.token?null:{status:"skipped",reason:"no-token"}}async function j(r,u=w()){const{themeFromDocument:c,token:o,siteId:e,patch:n}=r,a=S({themeFromDocument:c,token:o});if(a)return a;if(Object.keys(n).length===0)return{status:"skipped",reason:"empty"};try{return await u(n,o,e??void 0),{status:"saved"}}catch(f){return{status:"failed",error:f}}}function Q({themeFromDocument:r,tokenRef:u,siteId:c,onResult:o}){const e=p(null),n=p({}),a=b(),f=p(o);f.current=o;const d=p(null),l=m(t=>{if(t.status==="skipped"){const s=`skipped:${t.reason}`;if(d.current===s)return;d.current=s}else d.current=null;f.current?.(t)},[]),i=m(async()=>{e.current&&(clearTimeout(e.current),e.current=null);const t=n.current;n.current={};const s=await j({themeFromDocument:r,token:u?.current,siteId:c,patch:t},w(a));return l(s),s.status==="saved"&&E(),s.status==="failed"&&(n.current={...t,...n.current}),s},[r,u,c,l,a]),y=m((t,s=!1)=>{const k=S({themeFromDocument:r,token:u?.current});if(k){l(k);return}n.current={...n.current,...t},e.current&&clearTimeout(e.current),s?i():e.current=setTimeout(()=>{i()},500)},[r,u,i,l]);return h(()=>()=>{i()},[i]),h(()=>g(async()=>{if(!e.current&&Object.keys(n.current).length===0)return;const t=await i();if(t.status==="failed")throw t.error}),[i]),{persist:y,flush:i}}export{S as refusalToQueue,w as themeRowSender,Q as useThemeRowPersist,j as writeThemeRow};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type EaselSession as EditorSession } from "efficient-easel/screen/lib/session";
|
|
2
2
|
import type { EditorBlocks } from "./editor-blocks.js";
|
|
3
|
-
import type { WebsiteBackend } from "
|
|
3
|
+
import type { WebsiteBackend } from "../../format/lib/web-backend.js";
|
|
4
4
|
export declare const backendOf: (session?: EditorSession) => WebsiteBackend;
|
|
5
5
|
export declare const blocksOf: (session: EditorSession) => EditorBlocks | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BlockChoice } from "
|
|
1
|
+
import type { BlockChoice } from "efficient-easel/screen/lib/puck/block-choice";
|
|
2
2
|
export declare const CONTAINER_BLOCKS_SLOT = "content";
|
|
3
3
|
export declare const BOX_TYPE = "Flex";
|
|
4
4
|
export declare const CONTAINER_BLOCK_CHOICES: BlockChoice[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SaveStatus } from "efficient-easel/screen/lib/document-switch";
|
|
2
|
-
export { resetForDocumentSwitch, saveStatusForNewDocument, saveStatusOf, type DocumentSwitchSetters, type SaveStatus, } from "efficient-easel/screen/lib/document-switch";
|
|
3
2
|
export declare function canSeedPinnedChrome(state: {
|
|
4
3
|
docId: string | null;
|
|
5
4
|
saveStatus: SaveStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(d){return!d.docId||d.saveStatus==="saving"?!1:d.seededDocId!==d.docId}export{e as canSeedPinnedChrome};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EaselPageRow as EditorPageRow, SiteRecord, SiteRecordPatch, WebsiteEditLock } from "efficient-easel/screen/lib/document-contract";
|
|
2
2
|
import type { HostPickedMedia } from "efficient-easel/screen/lib/host";
|
|
3
|
-
import type { SiteThemeRow, SiteThemeRowPatch } from "
|
|
3
|
+
import type { SiteThemeRow, SiteThemeRowPatch } from "./site-theme-row.js";
|
|
4
4
|
import type { SectionTemplate, SectionTemplateRecord } from "efficient-easel/screen/lib/section-template-types";
|
|
5
5
|
export type PageLayout = Record<string, unknown>;
|
|
6
6
|
export type { EditorPageRow, SiteRecord, SiteRecordPatch, WebsiteEditLock };
|
|
@@ -164,5 +164,3 @@ export interface WebsiteBackend {
|
|
|
164
164
|
social?: WebsiteSocial;
|
|
165
165
|
theme?: WebsiteTheme;
|
|
166
166
|
}
|
|
167
|
-
export { WebsiteBackendError, isBackendError, STATUS_UNREACHABLE, provideHostFailures, readHostFailure, hostLoadRefusalOf, hostUnreachableMessage } from "efficient-easel/screen/lib/backend-error";
|
|
168
|
-
export type { WebsiteBackendErrorKind, HostFailure } from "efficient-easel/screen/lib/backend-error";
|
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type TreeItem } from "efficient-easel/draw";
|
|
2
2
|
import type { NodeDefaults, SlotSectionSpec } from "efficient-easel/screen/lib/puck/slot-section-spec";
|
|
3
|
-
export type { NodeDefaults, SlotSectionSpec } from "efficient-easel/screen/lib/puck/slot-section-spec";
|
|
4
3
|
export declare const SLOT_SECTION_SPECS: Record<string, SlotSectionSpec>;
|
|
5
4
|
export declare function registerSlotSectionSpecs(specs: Record<string, SlotSectionSpec>): void;
|
|
6
5
|
export declare function buildSlotSeedChildren(type: string, defaultsFor?: NodeDefaults): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
56
|
"efficient-easel": "^15.0.0",
|
|
57
|
-
"efficient-shell": "^8.
|
|
57
|
+
"efficient-shell": "^8.13.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
60
60
|
"react": ">=19",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@types/react": "^19",
|
|
75
75
|
"@types/react-dom": "^19",
|
|
76
76
|
"efficient-easel": "^15.0.0",
|
|
77
|
-
"efficient-shell": "^8.
|
|
77
|
+
"efficient-shell": "^8.13.0",
|
|
78
78
|
"esbuild": "^0.28.0",
|
|
79
79
|
"happy-dom": "^20.14.5",
|
|
80
80
|
"isomorphic-dompurify": "^3.18.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{resetForDocumentSwitch as d,saveStatusForNewDocument as t,saveStatusOf as c}from"efficient-easel/screen/lib/document-switch";function o(e){return!e.docId||e.saveStatus==="saving"?!1:e.seededDocId!==e.docId}export{o as canSeedPinnedChrome,d as resetForDocumentSwitch,t as saveStatusForNewDocument,c as saveStatusOf};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{WebsiteBackendError as a,isBackendError as o,STATUS_UNREACHABLE as s,provideHostFailures as t,readHostFailure as d,hostLoadRefusalOf as i,hostUnreachableMessage as l}from"efficient-easel/screen/lib/backend-error";export{s as STATUS_UNREACHABLE,a as WebsiteBackendError,i as hostLoadRefusalOf,l as hostUnreachableMessage,o as isBackendError,t as provideHostFailures,d as readHostFailure};
|