efficient-web-builder 58.0.0 → 59.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/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Countdown/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/card-row-fields.d.ts +2 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +12 -6
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/box-background.d.ts +2 -2
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/card-columns.d.ts +1 -0
- package/dist/format/lib/content/card-columns.js +1 -0
- package/dist/format/lib/content/card-place.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +17 -0
- package/dist/format/lib/content/card-state.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/gallery-layout.d.ts +13 -1
- package/dist/format/lib/content/gallery-layout.js +1 -1
- package/dist/format/lib/content/page-background.js +1 -1
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/document/blocks/general/Chart/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Chart/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Countdown/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Countdown/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Mockup/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Mockup/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +10 -0
- package/dist/format/lib/document/card-row-keys.d.ts +14 -0
- package/dist/format/lib/document/card-row-keys.js +1 -0
- package/dist/format/lib/document/cards-template-on-read.d.ts +1 -1
- package/dist/format/lib/document/cards-template-on-read.js +1 -1
- package/dist/format/lib/document/neutralization-contracts.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -2
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/theme-slots.d.ts +20 -0
- package/dist/format/lib/document/theme-slots.js +1 -0
- package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Cards.d.ts +2 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.d.ts +2 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/Countdown.d.ts +2 -1
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/FeaturedCover.d.ts +2 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/MockupSection.d.ts +2 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +3 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/head-core-boxes.js +1 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/package.json +3 -3
- package/dist/editor/lib/document/theme-swatches.d.ts +0 -3
- package/dist/editor/lib/document/theme-swatches.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 59.0.0 - 2026-11-08
|
|
4
|
+
|
|
5
|
+
From main at `bb1ff965`: #608, #610, #611, #602, #613. A major: #608 has `!` in its title, narrows a peer and removes a module. The peer `efficient-shell` narrows from `^12.16.0` to `^12.17.0`; `efficient-easel` stays `^29.0.0`. No stored key or value moves (a stored hex paints as before; 0 rewritten).
|
|
6
|
+
|
|
7
|
+
**For hosts:**
|
|
8
|
+
- Bump `efficient-shell` to `^12.17.0` with this release: the fill pickers read `FILL_COLOR_SLOTS` and `fillColorRole` from it (#608).
|
|
9
|
+
- The module `lib/document/theme-swatches` is renamed `lib/document/theme-slots`; `themeSwatches` is deleted. No host imports the old path (efficient-storefront, efficient-storefront-blocks, efficient-admin-portal and efficient-easel searched: 0) (#608).
|
|
10
|
+
- storefront-blocks, on its bump: the `twoThenThreesPhoto` Gallery layout and its `ratio` value are new (#613); a host that lists gallery layouts may offer it.
|
|
11
|
+
|
|
12
|
+
### Removed (BREAKING)
|
|
13
|
+
|
|
14
|
+
- **`lib/document/theme-swatches`** and its `themeSwatches` list (#608): the one slot table is `lib/document/theme-slots` now. The peer `efficient-shell` narrows to `^12.17.0`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Every fill and background picker names a theme slot** (#608): Box Fill, the section band Background color, the page Background and the card row colour offer Theme N main, text, background, muted and surface first. A pick stores the slot name, not a hex. Text rows keep their own slots and never offer `surface`.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **A Cards press lays down a Box of one Card list** (#602): the highlight badge sits on the card's top line.
|
|
23
|
+
- **A Chart or Mockup Card press lays down a Box** (#610): its words are Text parts; the chart or device card stays one block in its own Box. New `surfacePresetIndex`.
|
|
24
|
+
- **A Countdown or Feature Banner press lays down a Box** (#611): the timer stays one block; the Feature Banner keeps its linked post card whole. New `FOLLOW_THE_BOX` export.
|
|
25
|
+
- **A Two, then threes photo Gallery layout with 4:3 tiles** (#613): layout `twoThenThreesPhoto`, an optional `ratio` and `galleryLayoutRatio`; a wall's phone and desktop rules are checked together.
|
|
26
|
+
|
|
3
27
|
## 58.0.0 - 2026-11-08
|
|
4
28
|
|
|
5
29
|
From main at `c5488050`: #597, #589, #601, #604, #605, #607, #606, #603. A major: #589 has `!` in its title and removes exports. The peers do not change: `efficient-easel` `^29.0.0` and `efficient-shell` `^12.16.0`. No stored key or value moves (0 stored nodes hold a view-hide key or the two removed phone rows).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as
|
|
1
|
+
"use client";import{jsx as r,jsxs as m}from"react/jsx-runtime";import{useRef as C}from"react";import{ColorPicker as w,ColorPickerPanel as x,ColorSwatch as b,HexInput as S,Popover as N,Tooltip as P,colorFill as k,colorSwatchClasses as T,useShellStrings as E}from"efficient-shell/ui";import{SettingsDefaultReset as R,SettingsField as _}from"efficient-easel/panel";import{typedHex as p}from"efficient-easel/pick";import{usePreviewHeader as j}from"../../../render/components/PreviewHeaderContext.js";import{editorEaselWords as F,say as g}from"../../../format/lib/editor-words.js";import{themePresets as I}from"../../../format/lib/document/theme-slots.js";import{SITE_STYLE_UNSET_LABEL as L}from"../../../format/components/SiteStyleUnset.js";function y({value:e,onChange:i,label:o,id:a,caption:s,inherited:c,ariaLabel:t,choices:n}){return r(B,{value:e,onChange:i,label:g(t??o),id:a,caption:s,inherited:c,choices:n})}function z(){const{theme:e}=j();return I(e)}function B({value:e,onChange:i,label:o,id:a,caption:s,inherited:c,choices:t}){const n=z(),l=e?null:p(c??""),d=s!==void 0&&(!e||p(s)!==p(e))?s:null,f=h=>{h!==e&&i(h)};return m("div",{className:"sf-colour",children:[t?r(H,{id:a,value:e,onChange:i,label:o,presets:n,follows:l,choices:t}):r(w,{id:a,value:e,onChange:f,label:o,presets:n,fallback:l??void 0,size:"md",align:"start"}),d!==null?r("span",{className:"sf-colour-caption",children:d}):r("span",{className:"sf-colour-hexwrap",children:r(S,{value:e||l||"",onChange:f,label:g("{label} hex code",{label:o}),placeholder:e||l?void 0:g(L),className:l?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function H({value:e,onChange:i,label:o,id:a,presets:s,follows:c,choices:t}){const n=E().color,l=e||c||"",d=t.findIndex(u=>u.selected),f=d>=0,h=C(d);return f&&(h.current=d),r(N,{id:a,trigger:r("span",{"aria-hidden":"true",className:"absolute inset-0",style:k(l)}),triggerLabel:n.swatch(o,l.toUpperCase()||n.none),triggerClassName:T({size:"md"}),"aria-label":n.panel(o),align:"start",children:m("div",{className:"sf-colour-window",children:[r("div",{role:"group","aria-label":o,className:"sf-colour-choices",children:t.map(u=>r(P,{content:u.label,children:r(b,{color:u.color,"aria-label":u.label,selected:u.selected,onClick:()=>{u.selected||u.onPick()}})},u.label))}),r(x,{value:f?"":e,onChange:i,label:o,presets:s,fallback:(f?l:c)??void 0},h.current)]})})}function W({label:e,icon:i,changed:o,hint:a,onReset:s,resetTo:c,children:t,...n}){return m(_,{label:e,icon:i,htmlFor:n.id,changed:o,hint:a,action:s?r(R,{words:F()?.panel,label:e,changed:!!o,detail:c,onReset:s}):void 0,children:[y({...n,label:e}),t]})}function M({label:e,icon:i,value:o,inherited:a,resetTo:s,onChange:c,onReset:t,hint:n,choices:l}){const d=!!o;return r(W,{label:e,icon:i,value:o,inherited:d?void 0:a,onChange:c,changed:d,onReset:t,resetTo:s,hint:n,choices:l})}export{y as ColourControl,W as ColourRow,M as InheritedColourRow,z as useThemePresets};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import{AccentIcon as O,ListIcon as L}from"efficient-easel/icons";import{isNodeList as F,newId as b}from"efficient-easel/data";import{group as w}from"efficient-easel/screen/lib/document/box-fields";import{COUNT_KEY_PROP as h}from"../../../../../../format/lib/content/block-sources.js";import{CARD_LIST_ROWS as p,CARD_LIST_TYPE as f,cardListFieldsOf as S,cardTemplateOwner as g,namedRowField as I}from"../../../../../../format/lib/content/card-template.js";import{BLOCK_SOURCE_EDIT_PROP as T,NO_BLOCK_SOURCE as E,blockSourceEditField as A,blockSourceField as M,blockSourceFields as P}from"../../../block-source-fields.js";import{select as W}from"../../../box-fields.js";import{text as x}from"../../../controls.js";import{cardsFieldsFollowContent as D}from"../../../../../../format/lib/document/cards-template-on-read.js";import{cardPicks as N,pickRow as j,withOwnCardKeys as v}from"../../../../../../format/lib/document/card-row-keys.js";import{ROW_LIVE_NUMBER_FIELD as B}from"../../../live-number-field.js";import{withShowWhen as d}from"../../../../../../format/lib/document/show-when-attach.js";import{CARD_ROW_FACTS as U,cardRowField as K,cardRowFields as H,cardRowItemField as Y}from"../../../card-row-fields.js";import{say as J}from"../../../../../../format/lib/editor-words.js";import{CardListSlots as V}from"../../../../../../format/lib/document/blocks/general/CardList/meta.js";function y(t){return F(t)?t.some(o=>{const e=o.props??{};return o.type==="Text"&&typeof e[h]=="string"&&I(e)?!0:Object.values(e).some(y)}):!1}const q=t=>Object.defineProperty(Object.fromEntries(t.map(o=>[o.key,""])),"key",{get:()=>b("row"),enumerable:!0}),_=new WeakMap;function z(t,o,e){const r=o.filter(s=>!s.everySource);let n=_.get(t);n||_.set(t,n=new Map);const a=JSON.stringify([r,e]);let i=n.get(a);if(!i){const s=Object.fromEntries(r.map(l=>[l.key,Y(l)]));e&&(s[h]=B);const c=r[0]?.key;i={...t,arrayFields:s,defaultItemProps:q(r),getItemSummary:l=>c&&typeof l?.[c]=="string"&&l[c]||J("Row")},n.set(a,i)}return i}const R="cardListInCardTemplate",m={not:{context:R,is:!0}},G={...U,[R]:(t,o)=>{const e=g(o.appState,t.props?.id);return e===void 0?void 0:e!==null}},Q=d({type:"array",label:"Rows",icon:u(L,{}),arrayFields:{}},{all:[m,E]}),X=t=>t.find(o=>!o.everySource&&(o.kind??"text")==="text")?.key??"title",C=new WeakMap;function Z(t,o){let e=C.get(t);e||C.set(t,e=new WeakMap);let r=e.get(o);return r||e.set(o,r={...t,highlightedCard:o}),r}const $=t=>{const o=new Set(S(null,{type:f,props:t}).map(e=>e.key));return e=>o.has(e)},k=new WeakMap;function ee(t,o){let e=k.get(t);e||k.set(t,e=new WeakMap);let r=e.get(o);return r||e.set(o,r={...t,[p]:o}),r}const Se={fields:{_gSource:w("Source"),dataSource:d(M("Card content","Manual"),m),[T]:A(),_gCardList:w("Card list"),rowField:K("Shows","list"),[p]:Q,highlightedCard:d(W("Highlighted card",u(O,{}),[{label:"None",value:""}],""),m),highlightBadge:d(x("Highlight badge","Most popular"),m),...V},resolveData:t=>{const o=t.props,e=v(o,p),r=D(e,$(e));return r===o?t:{...t,props:r}},resolveFields:(t,o)=>{const e=t.props??{},r=P(f,H(o.fields,t,o),e),n=!!g(o.appState,e.id),a=r[p];if(n||!a)return r;const i=S(o.appState,{type:f,props:e}),s=ee(r,z(a,i,y(e.template))),c=r.highlightedCard;return c?Z(s,j(c,N(e,{rows:p,label:X(i)}))):s},showWhenFacts:G};export{Se as CardListFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{AccentIcon as C,ColumnsIcon as f,StylesIcon as c}from"efficient-easel/icons";import{copyText as S,plainText as w,text as d,textarea as E,withOffPage as F}from"../../../controls.js";import{group as i}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as L,select as m,slider as I}from"../../../box-fields.js";import{CARD_STYLE_PICTURES as p,LAYOUT_CELL as _}from"../../../choice-pictures.js";import{SPLITTABLE_SECTIONS as O,headFieldsForPlacement as T}from"../../../../../../format/lib/sections/section-head-placement.js";import{SECTION_EYEBROW_LOOK_OPTIONS as k,eyebrowLookFor as h}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{BLOCK_SOURCE_EDIT_PROP as P,blockSourceEditField as R,blockSourceField as x,blockSourceFields as M}from"../../../block-source-fields.js";import{cardTemplateFields as u}from"../../../../../../format/lib/content/card-template.js";import{cardRowItemField as y}from"../../../card-row-fields.js";import{cardPicks as j,newCard as v,pickRow as A,withOwnCardKeys as B}from"../../../../../../format/lib/document/card-row-keys.js";import{isNodeList as D}from"efficient-easel/data";import{cardsFieldsFollowContent as H}from"../../../../../../format/lib/document/cards-template-on-read.js";import{CARDS_PH as b,CardsSlots as N}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const K=e=>D(e.template)&&e.template.length>0;function U(e,t){const o=K(t)&&t.cardStyle!=="label-only"&&!!e.highlightedCard;return Object.fromEntries(Object.entries(e).flatMap(([r,l])=>r==="highlightedCard"?o?[[r,A(l,j(t))]]:[]:r==="highlightBadge"?o?[[r,l]]:[]:r==="items"&&o&&l?[[r,q(l)]]:[[r,l]]))}const Y=Object.fromEntries(u("Cards").filter(e=>!e.everySource).map(e=>[e.key,y(e)])),W=Object.fromEntries(u("Cards").filter(e=>e.key==="title"||e.key==="body").map(e=>[e.key,y(e)])),g=new WeakMap;function q(e){let t=g.get(e);return t||g.set(e,t={...e,arrayFields:Y}),t}const ae={fields:{_gSource:i("Source"),dataSource:x("Card content","Manual"),[P]:R(),_gContent:i("Content"),eyebrow:d("Eyebrow",b.eyebrow),eyebrowLook:m("Eyebrow style",s(c,{}),[...k],h("Cards")),title:E("Heading",b.title),items:{type:"array",label:"Cards",arrayFields:W,defaultItemProps:v({title:"",body:""}),getItemSummary:e=>e?.title||e?.body||"Card"},...N,highlightedCard:m("Highlighted card",s(C,{}),[{label:"None",value:""}],""),highlightBadge:d("Highlight badge","Most popular"),_gStyle:i("Style"),cardStyle:L("Card style",s(c,{}),[{label:"Cards",value:"cards",picture:p.cards},{label:"Label only",value:"label-only",picture:p["label-only"]}],"cards",{columns:2,cell:_}),columns:I("Columns",s(f,{}),2,4,1,3)},resolveData:e=>{const t=H(e.props),o=t===e.props?e:{...e,props:t},r=o.props,l=B(r);return l===r?o:{...o,props:l}},resolveFields:(e,{fields:t})=>{const o=T(M("Cards",t,e.props,{hides:["items"]}),e.props.headPlacement,O.Cards.headRows),r=e.props,l=U(o,r);if(r.cardStyle!=="label-only")return l;const a=o.items,n=o.eyebrowLook;return{...l,...a?{items:{...a,arrayFields:{title:S("Feature label"),href:F(w("Link"))}}}:{},...n?{eyebrowLook:{...n,fallback:h("KeyFeatures")}}:{}}}};export{ae as CardsFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{StylesIcon as n}from"efficient-easel/icons";import{copyText as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{StylesIcon as n}from"efficient-easel/icons";import{copyText as m,plainText as p,text as e,textarea as o,withPanelOnly as s}from"../../../controls.js";import{group as a}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as u}from"../../../box-fields.js";import{CHART_PICTURES as t,LAYOUT_CELL as f}from"../../../choice-pictures.js";import{HEAD_ROWS_SHOW_WHEN as b}from"../../../../../../format/lib/sections/section-head-placement.js";import{withRowsShownWhen as y}from"../../../../../../format/lib/document/show-when-attach.js";import{CHART_OWN_BOX_WORDS as c,CHART_PH as r}from"../../../../../../format/lib/document/blocks/general/Chart/meta.js";const _=[...c],R={fields:y({_gContent:a("Content"),eyebrow:e("Chip label",r.eyebrow),title:o("Heading",r.title),body:o("Body",""),items:{type:"array",label:"Data points",arrayFields:{label:m("Label"),value:p("Value")},defaultItemProps:{label:"",value:""},getItemSummary:l=>[l?.label,l?.value].filter(Boolean).join(" · ")||"Point"},caption:e("Caption","Illustrative example"),_gStyle:a("Style"),chartStyle:u("Chart style",i(n,{}),[{label:"Bars",hint:"Bars (comparison / funnel)",value:"bars",picture:t.bars},{label:"Line",hint:"Line (trend)",value:"line",picture:t.line},{label:"Donut",hint:"Donut (split of a whole)",value:"donut",picture:t.donut}],"bars",{columns:3,cell:f}),valueSuffix:s(e("Value suffix","%"))},_,b)};export{R as ChartFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{ClockIcon as n,TagIcon as r}from"efficient-easel/icons";import{dateTime as i,text as t,toggle as m,withPanelOnly as s}from"../../../controls.js";import{HEAD_ROWS_SHOW_WHEN as O}from"../../../../../../format/lib/sections/section-head-placement.js";import{withRowsShownWhen as l}from"../../../../../../format/lib/document/show-when-attach.js";import{COUNTDOWN_DEFAULTS as e,COUNTDOWN_OWN_BOX_WORDS as _}from"../../../../../../format/lib/document/blocks/general/Countdown/meta.js";const W=[..._],T={fields:l({title:t("Heading",e.title),zeroText:s(t("At zero",e.zeroText)),endsAt:i("Ends",o(n,{}),"In your own time zone. Every visitor counts down to the same moment."),showUnits:m("Unit labels",!0,o(r,{}))},W,O)};export{T as CountdownFields};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{BlockColumnIcon as i,PlacementIcon as
|
|
2
|
-
*the counter.*`),body:n("Body",""),_gCard:r("Mockup card"),variant:b("Card type",t(c,{}),g.map(e=>({...e,picture:
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{BlockColumnIcon as i,PlacementIcon as u,StateIcon as s,TemplateIcon as c,TextLinesIcon as d}from"efficient-easel/icons";import{plainText as l,text as a,textarea as n,textList as o}from"../../../controls.js";import{group as r}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as b,select as m}from"../../../box-fields.js";import{LAYOUT_CELL as p,MOCKUP_PICTURES as f}from"../../../choice-pictures.js";import{withMockupVariantRules as y,MOCKUP_DEFAULT_VARIANT as C,MOCKUP_VARIANT_OPTIONS as g}from"../../../../../../format/lib/document/mockup-variant-fields.js";import{HEAD_ROWS_SHOW_WHEN as I}from"../../../../../../format/lib/sections/section-head-placement.js";import{withRowsShownWhen as _}from"../../../../../../format/lib/document/show-when-attach.js";import{MOCKUP_OWN_BOX_WORDS as v}from"../../../../../../format/lib/document/blocks/general/Mockup/meta.js";const S=[...v,"align"],x={fields:_(y({_gContent:r("Content"),eyebrow:a("Chip label","In the product"),title:n("Heading",`Seen from
|
|
2
|
+
*the counter.*`),body:n("Body",""),_gCard:r("Mockup card"),variant:b("Card type",t(c,{}),g.map(e=>({...e,picture:f[e.value]})),C,{columns:3,cell:p}),cardHeader:a("Card header strip","Product record"),badge:a("Header badge","LIVE"),cardTitle:a("Card title",""),cardSubtitle:a("Card subtitle",""),pills:{type:"array",label:"Selector pills",arrayFields:{label:l("Label"),value:l("Value")},defaultItemProps:{label:"",value:""},getItemSummary:e=>[e?.label,e?.value].filter(Boolean).join(" ")||"Pill"},tiles:{type:"array",label:"Spec tiles",arrayFields:{label:l("Label"),value:l("Value")},defaultItemProps:{label:"",value:""},getItemSummary:e=>[e?.label,e?.value].filter(Boolean).join(" ")||"Tile"},rows:{type:"array",label:"Result / order rows",arrayFields:{lead:l("Lead"),detail:l("Detail"),state:m("State",t(s,{}),[{label:"Match / done (green)",value:"ok"},{label:"In progress (main)",value:"warn"},{label:"No match (gray ✕)",value:"no"}],"ok"),status:l("Status chip")},defaultItemProps:{lead:"",detail:"",state:"ok",status:""},getItemSummary:e=>[e?.lead,e?.detail].filter(Boolean).join(" · ")||"Row"},button:a("Button",""),footnote:a("Footnote",""),_gKanban:r("Kanban columns"),col1Title:a("Column 1 title",""),col1Cards:o("Column 1 cards",t(i,{}),"Job card label","verbatim"),col2Title:a("Column 2 title",""),col2Cards:o("Column 2 cards",t(i,{}),"Job card label","verbatim"),col3Title:a("Column 3 title",""),col3Cards:o("Column 3 cards",t(i,{}),"Job card label","verbatim"),col4Title:a("Column 4 title",""),col4Cards:o("Column 4 cards",t(i,{}),"Job card label","verbatim"),_gClaims:r("Claims bars"),barsHeading:a("Bars heading","Defect rate by product"),bars:{type:"array",label:"Bars",arrayFields:{label:l("Label"),value:l("Value")},defaultItemProps:{label:"",value:""},getItemSummary:e=>[e?.label,e?.value].filter(Boolean).join(" · ")||"Bar"},_gTerminal:r("Terminal"),termLines:o("Terminal lines",t(d,{}),"$ efficient …","verbatim"),_gBrowser:r("Browser mock"),urlText:a("URL pill",""),heroTitle:a("Hero line",""),heroButton:a("Hero button",""),products:{type:"array",label:"Product tiles",arrayFields:{name:l("Name"),price:l("Price")},defaultItemProps:{name:"",price:""},getItemSummary:e=>[e?.name,e?.price].filter(Boolean).join(" · ")||"Tile"},_gStyle:r("Style"),align:m("Mockup position",t(u,{}),[{label:"Right of the copy",value:"right"},{label:"Left of the copy",value:"left"}],"right")}),S,I)};export{x as MockupFields};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type CardRowFieldKind, type CardRowFieldSpec } from "../../../format/lib/content/card-template.js";
|
|
2
|
+
import { type CustomField } from "./controls.js";
|
|
2
3
|
import { type SelectField } from "efficient-easel/screen/lib/document/box-fields";
|
|
3
4
|
import { type BlockShowWhenFacts, type ShowWhenRule } from "../../../format/lib/document/show-when-attach.js";
|
|
4
5
|
export declare const OUTSIDE_CARD_TEMPLATE = "outsideCardTemplate";
|
|
5
6
|
export declare const IN_CARD_TEMPLATE: ShowWhenRule;
|
|
6
7
|
export declare const CARD_ROW_FACTS: BlockShowWhenFacts;
|
|
7
8
|
export declare function cardRowField(label: string, kind: CardRowFieldKind): SelectField;
|
|
8
|
-
export declare function cardRowItemField(f: CardRowFieldSpec):
|
|
9
|
+
export declare function cardRowItemField(f: CardRowFieldSpec): CustomField<string> | CustomField<import("efficient-easel/draw").HidableValue>;
|
|
9
10
|
export declare function cardRowFields<Fields extends Record<string, unknown>>(fields: Fields, data: {
|
|
10
11
|
props?: Record<string, unknown>;
|
|
11
12
|
}, params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{GroundIcon as _,ListIcon as M}from"efficient-easel/icons";import{FieldGlyph as P}from"../../components/FieldGlyph.js";import{CARD_LIST_FIELDS as W,CARD_LIST_TYPE as h,cardListFieldsOf as B,cardListShows as G,cardTemplateFieldsOf as N,cardTemplateOwner as b}from"../../../format/lib/content/card-template.js";import{copyText as $,plainText as J,plainTextarea as U,ThemeFillRow as Y,withOffPage as q}from"./controls.js";import{recordRowFields as k}from"../../../format/lib/content/record-row.js";import{recordTypesRevision as z}from"../../../format/lib/content/record-types.js";import{editorRecordType as H}from"../../../format/lib/document/editor-page-context.js";import{blockSourcesRevision as Q,declaredBlockSource as C}from"../../../format/lib/content/block-sources.js";import{select as V}from"./box-fields.js";import{withShowWhen as X}from"../../../format/lib/document/show-when-attach.js";function I(o){const t=o?.data?.root,e=H(t?.props)??"";return e&&k(e,"text").length?e:""}const L="outsideCardTemplate",Z={not:{context:L,is:!0}},wo={[L]:(o,t)=>{const e=b(t.appState,o.props?.id);if(e!==void 0)return e===null&&!I(t.appState)}};function fo(o,t){const e=t==="link"?d(P,{noun:"link"}):t==="colour"?d(_,{}):d(M,{}),a={...V(o,e,[t==="colour"?{label:"Manual",value:""}:{label:"Typed here",value:""}],""),cardRowKind:t};return X(a,Z)}function yo(o){return o.kind==="link"?q(J(o.label)):o.kind==="colour"?oo(o.label):o.multiline?U(o.label):$(o.label)}function oo(o){return{type:"custom",render:({value:t,onChange:e})=>d(Y,{label:o,icon:d(_,{}),value:t,shown:typeof t=="string"?t:"",onChange:e})}}function to(o){return!!(o&&typeof o=="object"&&"cardRowKind"in o)}const O=new WeakMap;function Ro(o,t,e){const a=Object.keys(o).filter(n=>to(o[n]));if(!a.length)return o;const f=t.props??{},r=b(e.appState,f.id),s=typeof r?.type=="string"?r.type:"",l=a.map(n=>typeof f[n]=="string"?f[n].trim():""),A=C(r?.props),c=s===h?b(e.appState,r?.props?.id):null,E=c?G(r?.props,c.type):"",K=c?C(c.props):"",D=c?`${String(c.type??"")}\0${K}`:"",j=s===h&&!c?JSON.stringify(r?.props?.[W]??null):"",y=r?"":I(e.appState),x=[s,A,E,D,j,Q(),y,z(),...l].join("\0");let m=O.get(o);m||O.set(o,m=new Map);const g=m.get(x);if(g)return g;const w={...o};return a.forEach((n,u)=>{const p=o[n],R=s===h?B(e.appState,r,p.cardRowKind):s?N(r,p.cardRowKind):k(y,p.cardRowKind);if(!R.length&&!l[u]&&(!s&&y||p.cardRowKind==="colour")){delete w[n];return}const T=l[u]&&!R.some(i=>i.key===l[u])?l[u]:"",F=p.cardRowKind==="list",v=(i,S)=>F&&S===0&&i.key!==l[u]?"":i.key;w[n]={...p,options:[...F?[]:p.options,...R.map((i,S)=>({label:i.label,value:v(i,S)})),...T?[{label:T,value:T}]:[]]}}),m.set(x,w),w}export{wo as CARD_ROW_FACTS,Z as IN_CARD_TEMPLATE,L as OUTSIDE_CARD_TEMPLATE,fo as cardRowField,Ro as cardRowFields,yo as cardRowItemField};
|
|
@@ -5,15 +5,15 @@ import { type KnownVideoFrame, type LoadingShows } from "../../../format/lib/her
|
|
|
5
5
|
import { readHidable, hidableText, type HidableValue } from "efficient-easel/draw";
|
|
6
6
|
import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "efficient-easel/draw";
|
|
7
7
|
import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
8
|
-
import { boxFillSlot } from "../../../format/lib/content/box-background.js";
|
|
9
8
|
import { type SettingsBorderValue } from "efficient-easel/panel";
|
|
10
9
|
import { type AlignmentPoint, FOCAL_DEFAULT } from "efficient-shell/ui";
|
|
10
|
+
import { type ColourChoice } from "./ColourControl.js";
|
|
11
11
|
import type { GeocodeState } from "../../../format/lib/content/contact.js";
|
|
12
12
|
import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
|
|
13
13
|
import { type DirectionContainer } from "../../../format/lib/content/container-direction.js";
|
|
14
14
|
import { normalizeThemeColors } from "../../../format/lib/theme.js";
|
|
15
15
|
import { GAP_FIELD_CONTAINER, type GapContainer } from "../../../format/lib/content/container-gap.js";
|
|
16
|
-
import { type SectionBackground } from "../../../format/lib/content/section-background.js";
|
|
16
|
+
import { type SectionBackground, type SectionBandColours } from "../../../format/lib/content/section-background.js";
|
|
17
17
|
import { type TypeRole, type TypeSizeValue } from "../../../format/lib/content/section-type-size.js";
|
|
18
18
|
import { type WidthMode } from "../../../format/lib/content/section-width.js";
|
|
19
19
|
import type { Bucket, DesignGroup } from "./field-groups.js";
|
|
@@ -141,6 +141,7 @@ export declare function Swatches({ swatches, current, onPick, names, }: {
|
|
|
141
141
|
names?: Readonly<Record<string, string>>;
|
|
142
142
|
}): import("react").JSX.Element;
|
|
143
143
|
export declare function backgroundField(label: string, builtIn: SectionBackground, followsBand?: boolean): CustomField<SectionBackground>;
|
|
144
|
+
export declare function sectionBandChoices(stored: SectionBackground, builtIn: SectionBackground, colors: ReturnType<typeof normalizeThemeColors>, n: number, band: SectionBandColours, onChange: (next: SectionBackground) => void): ColourChoice[];
|
|
144
145
|
export declare function cardImageBackgroundField(label: string, builtIn: string): CustomField<unknown>;
|
|
145
146
|
export declare function sectionThemeFields(readValue?: (v: unknown) => unknown, followLabel?: string): Record<string, CustomField<unknown>>;
|
|
146
147
|
export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, placeholderWord, onClear, }: {
|
|
@@ -271,11 +272,16 @@ export declare function toggle(label: string, fallback: boolean, icon?: ReactNod
|
|
|
271
272
|
export declare function pageBackgroundField(): CustomField<string>;
|
|
272
273
|
export declare function checkbox(label: string, fallback: boolean): CustomField<boolean>;
|
|
273
274
|
export declare function colorInput(label: string, fallback: string, icon?: ReactElement): CustomField<string>;
|
|
275
|
+
export declare function ThemeFillRow({ label, icon, id, value, shown, onChange, }: {
|
|
276
|
+
label: string;
|
|
277
|
+
icon?: ReactElement;
|
|
278
|
+
id?: string;
|
|
279
|
+
value: unknown;
|
|
280
|
+
shown: string;
|
|
281
|
+
onChange: (next: string) => void;
|
|
282
|
+
}): import("react").JSX.Element;
|
|
274
283
|
export declare function boxFillField(): CustomField<string>;
|
|
275
|
-
export declare function
|
|
276
|
-
hex: string;
|
|
277
|
-
words: string;
|
|
278
|
-
} | null;
|
|
284
|
+
export declare function fillSlotChoices(value: string, colors: ReturnType<typeof normalizeThemeColors>, n: number, onChange: (next: string) => void): ColourChoice[];
|
|
279
285
|
export declare function boxThemeIndexOf(data: unknown, id: string, own: unknown): number | null;
|
|
280
286
|
export declare const FOCAL_POINTS: {
|
|
281
287
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as ve,createContext as Xt,useContext as Be,useEffect as Vt,useId as De,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as zt,fromDateKey as Yt}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as He,firstFrameHint as qt,loadingShowsOf as Jt,loadingStillHint as Zt}from"../../../format/lib/hero-video.js";import{pageFramesFor as Qt,usePageVideoFrames as en}from"../page-video-frames.js";import{ScreenDocumentContext as tn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ge,hidableText as Me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as ue,LINK_FIELD_MARKER as Ue,MEDIA_FIELD_MARKER as We,SCAFFOLD_FIELD_MARKER as Ke,TEXT_FIELD_MARKER as O,foldMetaOf as pe,textFieldIdentifier as nn}from"efficient-easel/draw";import on from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as $e}from"../../../render/lib/document/show-when.js";import rn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as ln,CORNER_RADIUS_MAX as je,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as sn,IMAGE_CORNERS_LABEL as an}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as cn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as dn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as un,galleryChoices as Xe,galleryPictureCells as pn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as fn}from"./shell-glyph.js";import{anchorSiblingsOf as hn,placementPoints as mn}from"../../../format/lib/hero-group-placement.js";import gn from"../../components/AnchorField.js";import bn from"../../components/SourceStatus.js";import{AdjustIcon as wn,EyeIcon as xn,AnimationIcon as Sn,BackgroundIcon as yn,BorderAllIcon as Cn,BlockSectionIcon as _n,ColumnWidthsIcon as fe,ColumnsIcon as Ve,CornerIcon as Rn,DirectionDownIcon as Tn,DirectionLeftIcon as On,DirectionRightIcon as In,DirectionUpIcon as En,EditIcon as kn,GapIcon as Fn,GridIcon as An,GroundIcon as oe,HashIcon as ze,HeightIcon as Ln,ImageIcon as Nn,ListIcon as Pn,LocationIcon as Ye,PaddingBottomIcon as qe,PaddingLeftIcon as Je,PaddingRightIcon as Ze,PaddingTopIcon as Qe,PageIcon as vn,StickyIcon as Bn,SearchIcon as Dn,SquareIcon as Hn,TypeIcon as Gn,WidthIcon as Mn}from"efficient-easel/icons";import{FieldGlyph as et}from"../../components/FieldGlyph.js";import{resolvePageBackground as Un}from"../../../format/lib/content/page-background.js";import{boxFillOf as Wn,boxFillSlot as tt}from"../../../format/lib/content/box-background.js";import{typedHex as Kn}from"efficient-easel/pick";import{CORNER_SIDES as nt,CORNER_SIDE_POINTS as $n,hasOwnSectionCorners as jn,normalizeCornerSides as ot}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Xn,enclosingSection as Vn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as zn,SettingsField as w,SettingsGroup as Yn,SettingsGroupSub as qn,SettingsSegmented as Jn,SettingsBorder as Zn,SettingsSidesEach as Qn,SettingsSwitch as he,borderSides as eo,borderStartEach as to}from"efficient-easel/panel";import{ListField as no}from"efficient-easel/fields";import{DisplayChips as oo}from"efficient-shell/ui";import{desktopDisplayChanged as ro,partShownOnDesktop as io,partShownOnPhone as lo,phoneDisplayChanged as so,withDesktopPart as ao,withPhonePart as co}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as uo,Checkbox as po,ColorSwatch as fo,CornersInput as ho,DatePicker as mo,DateTimePicker as go,FOCAL_DEFAULT as bo,IconPicker as rt,COLUMN_COUNT_MAX as it,COLUMN_SHARE_MIN as wo,COLUMN_SHARES_EQUAL as xo,resolveColumnShares as lt,WidthsBar as So,useShellStrings as yo,IconButton as st,InputNumber as at,Slider as Co,Tooltip as me}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as _o}from"./geocode-resolve.js";import{ColourRow as ge,InheritedColourRow as be}from"./ColourControl.js";import{keptByRow as Ro}from"efficient-easel/screen/lib/document/style-fields";import ct from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as To,NoControlMark as Oo,noControlField as dt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Io}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Eo,resolvePhoneValue as we}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as ko}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Fo,CARD_OUTLINE_OPTIONS as Ao,DEFAULT_CARD_INDEX_FORMAT as Lo,DEFAULT_CARD_OUTLINE as No}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Po,DEFAULT_COVER_INDEX as vo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Bo}from"efficient-easel/draw";import Do from"../../components/MediaUploadField.js";import Ho from"../../components/MultiSelectField.js";import Go from"../../components/SectionThemePicker.js";import Mo from"../../components/SearchSelectField.js";import Uo from"../../components/StorefrontLinkField.js";import{UiIcon as ut}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Wo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Ko}from"efficient-easel/draw/client";import{encodePartId as $o}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as jo,useEaselStrings as Xo}from"efficient-easel/strings";import{hasPhoneHeight as Vo,hasTabletHeight as xe,resolveSectionMinHeight as zo,resolveTabletHeight as Yo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as re,SECTION_STICK_LABEL as Se,hasPhoneStick as qo,hasTabletStick as Jo,resolveSectionStick as pt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as Zo,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as Qo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as er,resolveContainerDirection as ft}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as tr,BOX_BLOCK_SPACING_POINTS as ht,BOX_PHONE_ROW_LABEL as mt,BOX_COLUMNS_MAX as nr,BOX_COLUMNS_MIN as gt,BOX_PHONE_ROW_MAX as or,BOX_PHONE_ROW_MIN as ye,BOX_SHARE_CHOICES as bt,BOX_SHARE_LABEL as K,boxShareChoiceOf as wt,boxShareWidthsOf as Ce,BOX_SHARE_PHONE_DEFAULT as rr,BOX_SHARE_PHONE_POINTS as ir}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as lr,borderBySide as xt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as sr,normalizeTheme as St,normalizeThemeColors as ar,sectionBandTone as cr,surfaceTwoTone as dr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as yt,CONTAINER_GAP_BUILT_IN as ur,CONTAINER_GAP_PHONE as _e,GAP_FIELD_CONTAINER as Re,followsSitePhoneGap as pr,hasOwnContainerGap as fr,hasOwnPhoneGap as Te,resolveContainerGap as Ct,resolvePhoneContainerGap as _t}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as hr,CARD_IMAGE_BG_OFF as mr,CARD_IMAGE_BG_SWATCH_NAMES as gr,CARD_IMAGE_BG_SWATCHES as br,isCardImageBackgroundInheriting as wr,cardImageBackgroundChoice as xr,THEME_CARD_IMAGE_BG as Sr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as yr,SECTION_BG_NO_FILL as Cr,sectionBackgroundChoice as _r,THEME_SECTION_BG as Oe,isSectionBackgroundEmpty as Rr,sectionBackgroundHex as Rt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Tr,nestedAccentValue as Tt,resolveSectionAccent as ie}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Or,TYPE_SIZE_INHERIT as Ir,isTypeSizeInheriting as Er}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as kr,WIDTH_CHOICE_LABEL as Fr,WIDTH_INHERIT as Ar}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Lr}from"./panel-heading-scope.js";import{useEaselSession as Nr}from"efficient-easel/screen/lib/session-context";import{backendOf as Pr}from"../website-session.js";import{BOX_GAP as vr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Ie,onDesktopWords as B,phoneTwinFields as le}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Br,gapField as Ee,iconPickerRow as Dr,pickerCellIcon as Hr,pickerNoneIcon as Gr,Segmented as ke,segmented as Mr,select as Z,slider as $}from"./box-fields.js";function ks({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Ur(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Wr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:Ur(),onReset:t})}function Kr(e){return Ee({...vr,builtIn:ur[e],resolve:(t,n)=>Ct(e,t,n?.siteGap),action:(t,n)=>i(Wr,{inherited:!fr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Re]:e}})}function $r(e){return $e(R("mobile",{[Re]:e,type:"custom",render:t=>i(Vr,{container:e,...t})}),Ot)}function jr(e){return $e(R("tablet",{[Re]:e,type:"custom",render:t=>i(Xr,{container:e,...t})}),Ot)}const Ot={not:{field:"gap",in:Array.from({length:-yt.min},(e,t)=>yt.min+t)}};function Fs(e){return{gap:R("desktop",Kr(e)),[W("gap")]:jr(e),[F("gap")]:$r(e)}}function Xr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(_e.min,Ct(e,n,o));return Ee({..._e,builtIn:r,resolve:a=>Te(a)?a:r,action:(a,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Te(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Vr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=_t(e,void 0,n,o,r);return Ee({..._e,builtIn:s,resolve:c=>_t(e,c,n,o,r),action:(c,d)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Te(c),detail:D(`${s}px`,pr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function As(e){return Br({offered:er(e),fallback:ft(e,void 0),resolve:t=>ft(e,t)})}function Ls(e,t){return mn(t?hn(e,t):[],t)}function zr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ge(e),h=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),m=a&&f,C=De(),x=r?Qr(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(w,{label:l(n),icon:i(Gn,{}),htmlFor:C,className:m?"is-hidden":void 0,hint:x,action:a?i(me,{content:b,children:i(st,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(ut,{name:"eye-off",size:14}):i(ut,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ct,{target:s?p:h,value:d,onChange:u}),s?i("textarea",{id:C,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:C,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Ns(e,t){return{...e,[Ke]:t}}function Ps(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function vs(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}const It="sfPanelOnly";function Bs(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[It]:!0}}function Ds(e){return!!e&&typeof e=="object"&&e[It]===!0}function Hs(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Ja,SCALAR_TEXT_CONTROLS as Za}from"efficient-easel/draw";function Gs(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[To]:o,...r}=e;return{...r,[Io]:!0,render:t}}const Yr=new Set(Bo),Q={type:"radio",options:[{value:!0},{value:!1}]},Et={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...Et[e.control],label:e.label});if(!Yr.has(e.control))return n;const o=t.render;return{...dt(n,"authored-copy"),render:r=>i(ko,{name:r.name,children:o(r)})}},Ms="Everything else on this block comes from the linked post. Unlink it to edit by hand.",qr={field:"source.slug",set:!0},Us={not:qr},Jr="Select a word, then press the highlighter.",Zr=new Set([Jr]),Qr=e=>Zr.has(e);function Ws(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ks(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function $s(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function js(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Xs(e){return{type:"custom",[Ue]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Uo,{value:Me(t),onChange:n,label:e})}}function Vs(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const zs={Design:wn,Animation:Sn};function Ys(e){return{type:"custom",render:()=>i(ei,{text:e})}}function ei({text:e}){return i("p",{className:"sf-note",children:l(e)})}function qs(e){return pe(e)!==null&&e?.tabs!==void 0}const kt=new Map;function Js(e,t){const n=`${e}\0${t?t.join(""):""}`,o=kt.get(n)??{type:"custom",tabs:t,[ue]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return kt.set(n,o),o}const Ft=new Map;function Zs(e){const t=Ft.get(e)??{type:"custom",[ue]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return Ft.set(e,t),t}function ti(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Qs(e,t){return ti(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function ea(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function ta({title:e,children:t}){const[n,o]=z(()=>!Fe.has(e));return i(Yn,{title:e,open:n,onToggle:r=>{o(r),r?Fe.delete(e):Fe.add(e)},children:t})}const Fe=new Set;function na({label:e}){return i(qn,{title:l(e),level:Lr(2)})}function ni({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(me,{content:d,children:i(fo,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function oa(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(oi,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function oi({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=jt(),d={background:a.background,surface:a.surface,surface2:dr(a),band:cr(a)},f=n?Oe:t,h=Rr(s,t,f),p=Rt(void 0,f,d),u=n?yr:void 0,g=_r(s,t),m=f===Oe?l("the theme's section background"):l("Theme {n} background",{n:c});return i(be,{label:l(e),icon:i(yn,{}),value:h?"":Rt(s,t,d),inherited:p,resetTo:D(p.toUpperCase(),m),onChange:r,onReset:()=>r(u),choices:[{label:l("No fill"),color:"",selected:g==="none",onPick:()=>r(Cr)},{label:`${l("Section band")} · ${d.band.toUpperCase()}`,color:d.band,selected:g==="band",onPick:()=>r(Oe)}]})}function ri(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=wr(r,t);return i(w,{label:l(e),icon:i(oe,{}),changed:!s,action:i(y,{words:S()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(hr)}),children:ni({swatches:br,current:s?Sr:xr(r,t),onPick:o,names:gr})})}}}function ra(e=n=>n,t){return J({_gSectionTheme:T(Tr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Go,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:h,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Co,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:m=>{m===null?u?.():m!==o&&r(m)}})})}function At(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,m=g===null;return i(w,{label:l(e),icon:f?q(f):void 0,value:m?d||s===void 0?void 0:l(s):`${g}${h}`,changed:!m,action:d?ve(d,{changed:!m,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:l(e),changed:!m,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const se="Corners";function Ae(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(w,{label:l(se),icon:i(Rn,{}),changed:r,action:ve(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(li,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Lt(){return dt({type:"custom",render:()=>i(Oo,{})},"always")}function ii(){const e=M();return t=>e?.onChangeMany(t)}function li({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=ot(r)??[...nt];return i(ho,{label:l(se),value:a,corners:$n,onChange:c=>{const d=ot(c)??[];s(d.length===nt.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:je,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Nt(){return Lt()}function si({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(y,{words:S()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ai(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function ci(){return Ae({sidesKey:"sectionCornerSides",useFollowed:ai,mark:i(si,{label:se}),hint:di})}const di="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function ia(){return J({_gShape:T("Shape"),sectionCorners:ci(),sectionCornerSides:Nt(),...j("sectionBorder",Pt)})}const ui=()=>({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 pi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function fi(){let e;try{const t=St(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||sr.line}function hi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?to(c,a):!1),h=ui(),p=u=>pi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(w,{label:l("Border"),icon:i(Cn,{}),action:r?i(Qn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Zn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:h,styles:s,max:lr})})}function mi({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=fi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...xt(a(o)),...xt(a(r))}:n==="tablet"?a(o):{};return i(hi,{value:e,onChange:t,placeholder:{sides:eo(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function la(e){return R(e,Pt(e==="mobile"?"phone":e))}function Pt(e){return{type:"custom",render:({value:t,onChange:n})=>i(mi,{value:t,onChange:n,view:e})}}function j(e,t){const n=(o,r)=>le(e,t(o),Ie)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function sa(e){return{type:"custom",render:()=>i(gi,{partKey:e})}}function gi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=Xo();let s=null;try{s=Ko().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(zn,{name:l("Text"),preview:Wo(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??jo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s($o(t,e))}})}function vt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Vn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return jn(r)?r:n}function bi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=vt(U);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function wi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function xi(){return Ae({sidesKey:"cardCornerSides",useFollowed:()=>vt(U),mark:i(bi,{label:se}),hint:i(wi,{})})}function Si(){return{type:"custom",render:()=>i(on,{})}}function aa(e){return{...e,render:t=>i(rn,{render:e.render,props:t})}}function ca(){return{_gShape:T("Shape"),cardCorners:xi(),cardCornerSides:Nt(),cardCornersApplyAll:Si()}}function yi(){return E({type:"custom",render:e=>i(_i,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ci(e,t){const n=wt(e);if(n!=="custom")return l(bt.find(r=>r.value===n)?.label??"");const o=lt(Ce(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function _i(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=wt(c),f=r>=2&&r<=it,h=()=>[...xo[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?h():b)},m=l("The width bar works for 2 to {count} blocks.",{count:it}),C=a&&(s||t!=="content"),x=yo().widths.hint(r,wo);return i(w,{label:l(K),icon:i(fe,{}),changed:C,hint:d!=="custom"?void 0:f?x:m,action:i(y,{words:S()?.panel,label:l(K),changed:C,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Ci(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(rt,{label:l(K),value:d,options:bt.map(b=>({value:b.value,label:b.value==="custom"&&!f?m:l(b.label),icon:Hr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Bt(b.weights).map((_,X)=>i("i",{style:{gridColumn:`span ${_}`}},X))}),l(b.label),b.value==="custom"&&!f?m:l(b.label))})),onChange:g,columns:3,cell:Dt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:lt(Ce(c,r),r)}},onBlur:()=>{p.current=null},children:i(So,{label:l(K),count:r,value:Ce(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Bt(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 da(){return Z(tr,i(Fn,{}),ht,ht[0].value)}function ua(){return R("mobile",Dr(K,i(fe,{}),ir.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Bt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),rr,{columns:2,cell:Dt}))}const Dt={width:"5.75rem",height:"3.25rem"};function pa(){return le("share",yi(),Ie)[W("share")]}function Ri(){return R("mobile",$(mt,i(Ve,{}),ye,or,1,ye,"",{clear:{phoneFollows:!1,hint:ye}}))}const Ht={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function fa(){const e=$(mt,i(Ve,{}),gt,nr,1,gt,"",{clear:{emptyLabel:"Auto"}}),t=le("columns",e,{...Ht,tablet:Ie.tablet}),n=le("columns",e,Ht,{phoneRow:Ri()});return{...t,phoneRow:n.phoneRow}}function ha(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(w,{label:l(e),icon:i(et,{noun:s}),action:i(y,{words:S()?.panel,label:l(e),changed:!Er(a),detail:l("the Text style in Styles"),onReset:()=>c(Ir),defaultAction:{onPress:()=>c(Or),title:l("Keep this section's own built-in size"),icon:i(_n,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function ma(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(fe,{}),[{label:"Auto",value:""},...Array.from({length:cn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Be(Ti),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ti=Xt(null);function Oi({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=we(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:we(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Ii({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=we(void 0,a,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ei(e){return At(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Ii,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Oi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const ki={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Fi={Top:Qe,Bottom:qe,Left:Je,Right:Ze},Ai=e=>{const t=Fi[e];return i(t,{})};function ga(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>ki[x],s=x=>$(r("Top"),i(Qe,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,X=I)=>R("mobile",Ei({label:r(x),icon:Ai(x),desktopKey:b,min:X.min,max:X.max,step:X.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,m=e.phone===!0,C=x=>m?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:C(s(c)),...m?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:C($(r("Bottom"),i(qe,{}),I.min,I.max,I.step,d,"px")),...m?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:C($(r("Left"),i(Je,{}),p.min,p.max,p.step,u,"px")),...m?{[F(f)]:a("Left",f,g,p)}:{},[h]:C($(r("Right"),i(Ze,{}),p.min,p.max,p.step,u,"px")),...m?{[F(h)]:a("Right",h,g,p)}:{}}:{}})}function ba(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&pe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ae="Width";function wa(e,t=kr,n=!0){const o=t.map(r=>({label:Fr[r],value:r}));return J({...n?{_gWidth:T(ae)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(w,{label:l(ae),icon:i(Mn,{}),action:n?i(zr,{inherited:s?.inherited??!1,onReset:()=>r(Ar),label:ae}):void 0,children:ke({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ae})})}})}function xa(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Li,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Pi,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Mr("Unit",i(ze,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(vi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...j("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Bi,{view:o,onClear:()=>r(void 0)}))),...j("sectionHeightValue",t),...j("sectionHeightUnit",n)})}function Li({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=ce(n,r)?.mode??"auto";return i(w,{label:Y,icon:q(i(Ln,{})),action:o?o(t):void 0,children:ke({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function Gt(e,t){return e==="phone"&&xe(t)?Yo(t):zo(t)}function ce(e,t){return e==="desktop"||(e==="tablet"?xe(t):Vo(t))?null:Gt(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Ni(e,t,n,o){const r=ce(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Mt(e,t,n){const o=M(),r=ce(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Ni(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Pi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Mt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?Qo:Zo;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function vi({props:e,draw:t,view:n}){const{followed:o,write:r}=Mt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Bi({view:e,onClear:t}){const n=L(),o=ce(e,n)===null,r=e==="phone"&&xe(n),s=Gt(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(y,{words:S()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Sa(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Gi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Di,{value:o,onChange:r,view:n})});return{_gStick:T(Se),...j("stickTop",e),...j("stickTopDistance",t)}}function Di({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Le(n,r)?null:Ut(n,pt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Hi(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:re.min,max:re.max,step:re.step,value:s?null:typeof e=="number"?e:re.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Le(e,t){return e==="tablet"?Jo(t):qo(t)}function Ut(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Hi(e,t,n){return e==="desktop"||Le(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Gi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=pt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:Ut(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(w,{label:l(Se),labelId:n,icon:q(i(Bn,{})),action:N(k,{children:[o!=="desktop"?i(y,{words:S()?.panel,label:l(Se),changed:Le(o,r),detail:B(h=>l(h),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(he,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Wt="e.g. about";function ya(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Wt},{type:"custom",render:({value:e,onChange:t})=>i(gn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Wt,hideable:!1,markup:!1})})})}}function Ca(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function _a(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(mo,{id:c,value:Yt(typeof o=="string"?o:null),onChange:d=>r(d?zt(d):"")})})}}}function Mi(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,h=r,p=typeof s=="boolean",u=typeof h.follows=="boolean"?h.follows:t,g=p?s:f?u:t,m=`${c??d??e}-label`,C=h.readOnly===!0,x=i(he,{checked:g,onChange:a,disabled:C,ariaLabelledBy:m});return i(w,{label:l(e),labelId:m,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(y,{words:S()?.panel,label:l(e),changed:p,detail:h.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),h.followsView),disabled:C,onReset:()=>a(void 0)}),x]}):x})}}}function Ra(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(ge,{label:l("Background"),icon:i(vn,{}),id:r,value:Un(e),onChange:t})}}}function Ta(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(w,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(po,{id:a,checked:s,onChange:o})})}}}function Oa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ge,{label:l(e),icon:n,value:o||t,onChange:r})}}function Ia(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Ui,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Ui({value:e,onChange:t,twin:n}){const{colors:o,n:r}=jt(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=tt(e),d=c?Kt(c,o,r):null,f=n?()=>t(void 0):()=>t("");if(n){const h=tt(n.follows),p=Wn(n.follows),u=h?Kt(h,o,r):p?{hex:p,words:p.toUpperCase()}:null,g=B(m=>l(m),u?u.words:a,n.view);return d?i($t,{slot:d,resetTo:g,onChange:t,onReset:f}):i(be,{label:l("Fill"),icon:i(oe,{}),value:e,inherited:u?.hex??s,resetTo:g,onChange:t,onReset:f})}return d?i($t,{slot:d,resetTo:a,onChange:t,onReset:f}):i(be,{label:l("Fill"),icon:i(oe,{}),value:e,inherited:s,resetTo:a,onChange:t,onReset:f})}function Kt(e,t,n){const o={main:()=>[t.accent,l("Theme {n} main color",{n})],text:()=>[t.text,l("Theme {n} text color",{n})],background:()=>[t.background,l("Theme {n} background",{n})],muted:()=>[t.muted,l("Theme {n} muted color",{n})]},r=Object.hasOwn(o,e)?o[e]:void 0;if(!r)return null;const[s,a]=r();return{hex:Kn(s??"")??"",words:a}}function $t({slot:e,resetTo:t,onChange:n,onReset:o}){return i(ge,{label:l("Fill"),icon:i(oe,{}),value:e.hex,caption:e.words,onChange:n,changed:!0,onReset:o,resetTo:t})}function Wi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return ie(n);const r=Xn(e,t);if(r.length===0)return null;const s=ie(Tt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=ie(Tt(r[a].sectionAccent));if(c!==null)return c}return ie(r[0].sectionAccent)}function jt(){const e=St(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Wi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:ar(e.themes[o]),n:o+1}}const Ki=[{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 $i({label:e,value:t,onChange:n,points:o=Ki}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(uo,{label:l(e),value:t,points:r,onChange:n})}function Ea(){return Lt()}const ka={top:i(En,{}),right:i(In,{}),bottom:i(Tn,{}),left:i(On,{})};function Fa(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(m=>m.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},h=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(m=>m.value===p)?p:n;return i(w,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:$i({label:e,value:g,onChange:u,points:h})})}}}function Aa(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Ho,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function La(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Mo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Na(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Pa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function va(e,t,n){const o=Object.keys(He).map(r=>({label:He[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Xi,{label:e,icon:t,options:o,onChange:r})}}function ji(e,t,n){const o=qt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Zt(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function Xi({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Jt(s),c=Be(tn),d=en(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const h=Qt(r?.id,f,d);return i(w,{label:l(e),icon:q(t),hint:ji(s,h,c?.hasUnsavedEdits??!1),children:ke({options:n,value:a,onChange:o,ariaLabel:e})})}function Ba(e,t,n,o={}){const r={type:"custom",[We]:!0,render:({value:s,onChange:a,name:c})=>i(Do,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Da={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Vi(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ha({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Pr(Nr()).geocode,f=De(),h=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(w,{label:l(n),icon:i(Ye,{}),action:d?i(me,{content:l("Find from the address (OpenStreetMap)"),children:i(st,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Dn,{})})}):void 0,children:d&&o.status?i(bn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(_o):l(o.status),hint:Vi(o)}):null}),i(w,{label:l("Enter by hand"),labelId:f,icon:i(kn,{}),action:i(he,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(w,{label:l("Latitude, longitude"),icon:i(Ye,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(at,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(at,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function zi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Yi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function Ga(e,t){return e===null?null:t>e?e:null}function qi(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Ma={label:"Ticker items",icon:i(Pn,{})};function Ua(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Et.textList,label:e}),render:({value:r,onChange:s})=>i(Ji,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function Ji({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),h=p=>{const u=qi(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(no,{label:l(e),icon:t,noun:l("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(ct,{target:a,value:zi(n,c),onChange:p=>r(Yi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:m=>g({text:m.target.value}),onFocus:m=>{a.current=m.currentTarget,d(u)}})})}function Wa(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:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ka(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(Nn,{}),Po,String(vo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ri("Image background",mr),cardImage:el()}}function $a(){return{outline:Z("Card outline",i(Hn,{}),Ao,No),indexBadge:Z("Card number",i(ze,{}),Fo,Lo),showBadge:Mi("Product badge",!0,i(et,{noun:"tag"}))}}function ja(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:de.find(s=>s.id===r).label}),o=r=>E(Ro(Ne),n(r));return{_gShowOnCard:T("Show on a card"),[Ne]:E({type:"custom",render:()=>i(Zi,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Ne)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Ne="showCardPrice",de=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Zi({rest:e}){const t=L(),n=ii(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=de.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Pe,{parts:de,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(de.map(({id:a})=>[a,void 0])))})}function Xa(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Pe,{parts:e,changed:ro(o),shown:s=>io(o,s),onPress:(s,a)=>r(ao(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Qi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Pe({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(w,{label:c,icon:i(xn,{}),changed:t,action:i(y,{words:S()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(oo,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function Qi({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(Pe,{parts:e,changed:so(n),shown:s=>lo(r,n,s),onPress:(s,a)=>o(co(n,s,a)),onReset:()=>o(Eo),detail:l("the same as Desktop")})}function el(){return At("Card image",{min:U,max:je,step:ln,hint:"Rounds the picture. The card's own corner is in Styles."})}function Va(){return Ae({sidesKey:"cornerSides",step:sn,useFollowed:()=>U,mark:i(tl,{label:an}),hint:l("Rounds the picture. Left alone it stays square.")})}function tl({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function za(){return{type:"custom",render:({value:e,onChange:t})=>i(il,{value:typeof e=="string"?e:"",onChange:t})}}function nl({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:pn(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const ol={width:"3.5rem",height:"2.5rem"},rl=200;function il({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Vt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=rl?4:3);g();const m=new ResizeObserver(g);return m.observe(u),()=>m.disconnect()},[]);const c=e&&e in ne?e:"",d=Xe(n,c),f=Xe(n,"").length,h=fn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Gr(h,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(nl,{layout:ne[u],width:40})}))];return i(w,{label:l("Layout"),icon:i(An,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(rt,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:ol,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Jn,{options:[{id:"all",label:l("All")},...dn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:un.length})})]})})})})}export{qr as BOUND_TO_POST,Ms as BOUND_TO_POST_NOTE,zs as BUCKET_ICONS,Da as CUSTOM_FIELD_MEDIA,Ha as CoordsField,Ot as DESKTOP_GAP_NOT_OVERLAP,Pe as DisplayRow,ka as EDGE_ARROWS,bo as FOCAL_DEFAULT,Ki as FOCAL_POINTS,ue as FOLD_FIELD_MARKER,$i as FocalPicker,na as GroupLabel,Jr as HIGHLIGHT_HINT,H as HidableTextField,Ue as LINK_FIELD_MARKER,ks as Label,We as MEDIA_FIELD_MARKER,Pa as MEDIA_TYPE_OPTIONS,Us as NOT_BOUND_TO_POST,ta as PanelBand,ei as PanelNoteLine,Ti as RowPropsContext,Ke as SCAFFOLD_FIELD_MARKER,Za as SCALAR_TEXT_CONTROLS,Wr as SiteGapDefaultReset,ee as Slider,ni as Swatches,Ja as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Ma as TICKER_ITEMS_ROW,Ji as TextListField,ae as WIDTH_LABEL,zr as WidthDefaultReset,qi as aimAfterListChange,ya as anchorFields,D as backTo,oa as backgroundField,da as boxBlockSpacingField,fa as boxColumnsFields,Ia as boxFillField,Ri as boxPhoneRowField,yi as boxShareField,ua as boxSharePhoneField,pa as boxShareTabletField,Wi as boxThemeIndexOf,Js as bucketHeader,sa as buttonWordsEntryField,xi as cardCornersField,ri as cardImageBackgroundField,el as cardImageField,Ka as cardMediaFields,ca as cardShapeFields,ja as cardShowFields,$a as cardStyleFields,ma as cellWidthFields,Ta as checkbox,Oa as colorInput,As as containerDirectionField,Kr as containerGapField,$r as containerGapPhoneField,Fs as containerGapRows,jr as containerGapTabletField,Vi as coordsResultTip,js as copyText,Nt as cornerSidesField,Ae as cornersRowField,_a as date,Ca as dateTime,Zs as designGroupHeader,Xa as displayFields,Fa as edgePad,Ga as focusAfterRemove,Ea as focusKeptField,Qs as foldMarker,pe as foldMetaOf,ti as foldTitleOf,Ni as followedHeightPatch,Hi as followedStickPatch,za as galleryLayoutField,xa as heightFields,ce as heightFollowedBy,Ls as heroGroupPlacementPoints,Me as hidableText,Qr as hintIsWhileTyping,Va as imageCornersField,Gs as inOwnBox,qs as isBucketHeader,Lt as keptBy,Xs as linkField,ji as loadingRowHint,va as loadingShowsField,Aa as multiSelect,Ra as pageBackgroundField,Ys as panelNote,Ei as phoneOverrideField,$s as plainText,Vs as plainTextarea,At as pxField,ea as quietMarker,Ge as readHidable,zi as rowText,La as searchSelect,la as sectionBorderField,ci as sectionCornersField,ia as sectionShapeFields,ra as sectionThemeFields,Yi as setRowText,ha as sizeField,Kt as slotFill,Na as sourceField,ga as spacingFields,Sa as stickFields,ba as swapPadding,aa as templateField,Ws as text,nn as textFieldIdentifier,vs as textFieldOffPage,Ds as textFieldPanelOnly,Ua as textList,Wa as textListRowField,Ks as textarea,Mi as toggle,Ba as upload,ii as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Ur as useSiteGapDetail,wa as widthField,Hs as withIdentifier,Ps as withOffPage,Bs as withPanelOnly,Ns as withScaffold};
|
|
1
|
+
"use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Ge,createContext as zt,useContext as Me,useEffect as Yt,useId as Ue,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as qt,fromDateKey as Jt}from"efficient-shell/format";import{say as l,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as We,firstFrameHint as Zt,loadingShowsOf as Qt,loadingStillHint as en}from"../../../format/lib/hero-video.js";import{pageFramesFor as tn,usePageVideoFrames as nn}from"../page-video-frames.js";import{ScreenDocumentContext as on}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ke,hidableText as $e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as pe,LINK_FIELD_MARKER as Xe,MEDIA_FIELD_MARKER as je,SCAFFOLD_FIELD_MARKER as Ve,TEXT_FIELD_MARKER as O,foldMetaOf as fe,textFieldIdentifier as rn}from"efficient-easel/draw";import ln from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ze}from"../../../render/lib/document/show-when.js";import sn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as an,CORNER_RADIUS_MAX as Ye,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as cn,IMAGE_CORNERS_LABEL as dn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as un}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as pn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as fn,galleryChoices as qe,galleryLayoutRatio as hn,galleryPictureCells as mn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as gn}from"./shell-glyph.js";import{anchorSiblingsOf as bn,placementPoints as wn}from"../../../format/lib/hero-group-placement.js";import xn from"../../components/AnchorField.js";import Sn from"../../components/SourceStatus.js";import{AdjustIcon as yn,EyeIcon as Cn,AnimationIcon as _n,BackgroundIcon as Je,BorderAllIcon as Rn,BlockSectionIcon as Tn,ColumnWidthsIcon as he,ColumnsIcon as Ze,CornerIcon as On,DirectionDownIcon as In,DirectionLeftIcon as En,DirectionRightIcon as kn,DirectionUpIcon as Fn,EditIcon as An,GapIcon as Ln,GridIcon as Nn,GroundIcon as me,HashIcon as Qe,HeightIcon as Pn,ImageIcon as vn,ListIcon as Bn,LocationIcon as et,PaddingBottomIcon as tt,PaddingLeftIcon as nt,PaddingRightIcon as ot,PaddingTopIcon as rt,PageIcon as Dn,StickyIcon as Hn,SearchIcon as Gn,SquareIcon as Mn,TypeIcon as Un,WidthIcon as Wn}from"efficient-easel/icons";import{FieldGlyph as it}from"../../components/FieldGlyph.js";import{resolvePageBackground as Kn}from"../../../format/lib/content/page-background.js";import{boxFillOf as $n,boxFillSlot as ge}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as lt,CORNER_SIDE_POINTS as Xn,hasOwnSectionCorners as jn,normalizeCornerSides as st}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Vn,enclosingSection as zn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as Yn,SettingsField as S,SettingsGroup as qn,SettingsGroupSub as Jn,SettingsSegmented as Zn,SettingsBorder as Qn,SettingsSidesEach as eo,SettingsSwitch as be,borderSides as to,borderStartEach as no}from"efficient-easel/panel";import{ListField as oo}from"efficient-easel/fields";import{DisplayChips as ro}from"efficient-shell/ui";import{desktopDisplayChanged as io,partShownOnDesktop as lo,partShownOnPhone as so,phoneDisplayChanged as ao,withDesktopPart as co,withPhonePart as uo}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as po,Checkbox as fo,ColorSwatch as ho,CornersInput as mo,DatePicker as go,DateTimePicker as bo,FOCAL_DEFAULT as wo,IconPicker as at,COLUMN_COUNT_MAX as ct,COLUMN_SHARE_MIN as xo,COLUMN_SHARES_EQUAL as So,resolveColumnShares as dt,WidthsBar as yo,useShellStrings as Co,IconButton as ut,InputNumber as pt,Slider as _o,Tooltip as we}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as Ro}from"./geocode-resolve.js";import{ColourRow as oe,InheritedColourRow as ft}from"./ColourControl.js";import{fillThemeColors as To,slotFill as re}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as xe}from"../../../format/lib/document/part-inks.js";import{keptByRow as Oo}from"efficient-easel/screen/lib/document/style-fields";import ht from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Io,NoControlMark as Eo,noControlField as mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as ko}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Fo,resolvePhoneValue as Se}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as Ao}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Lo,CARD_OUTLINE_OPTIONS as No,DEFAULT_CARD_INDEX_FORMAT as Po,DEFAULT_CARD_OUTLINE as vo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Bo,DEFAULT_COVER_INDEX as Do}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Ho}from"efficient-easel/draw";import Go from"../../components/MediaUploadField.js";import Mo from"../../components/MultiSelectField.js";import Uo from"../../components/SectionThemePicker.js";import Wo from"../../components/SearchSelectField.js";import Ko from"../../components/StorefrontLinkField.js";import{UiIcon as gt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as $o}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Xo}from"efficient-easel/draw/client";import{encodePartId as jo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Vo,useEaselStrings as zo}from"efficient-easel/strings";import{hasPhoneHeight as Yo,hasTabletHeight as ye,resolveSectionMinHeight as qo,resolveTabletHeight as Jo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ie,SECTION_STICK_LABEL as Ce,hasPhoneStick as Zo,hasTabletStick as Qo,resolveSectionStick as bt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as er,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as tr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as nr,resolveContainerDirection as wt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as or,BOX_BLOCK_SPACING_POINTS as xt,BOX_PHONE_ROW_LABEL as St,BOX_COLUMNS_MAX as rr,BOX_COLUMNS_MIN as yt,BOX_PHONE_ROW_MAX as ir,BOX_PHONE_ROW_MIN as _e,BOX_SHARE_CHOICES as Ct,BOX_SHARE_LABEL as K,boxShareChoiceOf as _t,boxShareWidthsOf as Re,BOX_SHARE_PHONE_DEFAULT as lr,BOX_SHARE_PHONE_POINTS as sr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as ar,borderBySide as Rt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as cr,normalizeTheme as Tt,normalizeThemeColors as dr,sectionBandTone as ur,surfaceTwoTone as pr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ot,CONTAINER_GAP_BUILT_IN as fr,CONTAINER_GAP_PHONE as Te,GAP_FIELD_CONTAINER as Oe,followsSitePhoneGap as hr,hasOwnContainerGap as mr,hasOwnPhoneGap as Ie,resolveContainerGap as It,resolvePhoneContainerGap as Et}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as gr,CARD_IMAGE_BG_OFF as br,CARD_IMAGE_BG_SWATCH_NAMES as wr,CARD_IMAGE_BG_SWATCHES as xr,isCardImageBackgroundInheriting as Sr,cardImageBackgroundChoice as yr,THEME_CARD_IMAGE_BG as Cr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as _r,SECTION_BG_NO_FILL as Rr,sectionBackgroundChoice as Tr,THEME_SECTION_BG as Ee,isSectionBackgroundEmpty as Or,sectionBackgroundHex as kt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Ir,nestedAccentValue as Ft,resolveSectionAccent as le}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Er,TYPE_SIZE_INHERIT as kr,isTypeSizeInheriting as Fr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Ar,WIDTH_CHOICE_LABEL as Lr,WIDTH_INHERIT as Nr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Pr}from"./panel-heading-scope.js";import{useEaselSession as vr}from"efficient-easel/screen/lib/session-context";import{backendOf as Br}from"../website-session.js";import{BOX_GAP as Dr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ke,onDesktopWords as B,phoneTwinFields as se}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Hr,gapField as Fe,iconPickerRow as Gr,pickerCellIcon as Mr,pickerNoneIcon as Ur,Segmented as Ae,segmented as Wr,select as Z,slider as $}from"./box-fields.js";function Ps({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Kr(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function $r({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:Kr(),onReset:t})}function Xr(e){return Fe({...Dr,builtIn:fr[e],resolve:(t,n)=>It(e,t,n?.siteGap),action:(t,n)=>i($r,{inherited:!mr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Oe]:e}})}function jr(e){return ze(R("mobile",{[Oe]:e,type:"custom",render:t=>i(Yr,{container:e,...t})}),At)}function Vr(e){return ze(R("tablet",{[Oe]:e,type:"custom",render:t=>i(zr,{container:e,...t})}),At)}const At={not:{field:"gap",in:Array.from({length:-Ot.min},(e,t)=>Ot.min+t)}};function vs(e){return{gap:R("desktop",Xr(e)),[W("gap")]:Vr(e),[F("gap")]:jr(e)}}function zr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Te.min,It(e,n,o));return Fe({...Te,builtIn:r,resolve:a=>Ie(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Yr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=Et(e,void 0,n,o,r);return Fe({...Te,builtIn:s,resolve:c=>Et(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(c),detail:D(`${s}px`,hr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Bs(e){return Hr({offered:nr(e),fallback:wt(e,void 0),resolve:t=>wt(e,t)})}function Ds(e,t){return wn(t?bn(e,t):[],t)}function qr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ke(e),m=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),h=a&&f,w=Ue(),x=r?ti(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(S,{label:l(n),icon:i(Un,{}),htmlFor:w,className:h?"is-hidden":void 0,hint:x,action:a?i(we,{content:b,children:i(ut,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(gt,{name:"eye-off",size:14}):i(gt,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ht,{target:s?p:m,value:d,onChange:u}),s?i("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:w,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Hs(e,t){return{...e,[Ve]:t}}function Gs(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function Ms(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}const Lt="sfPanelOnly";function Us(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Lt]:!0}}function Ws(e){return!!e&&typeof e=="object"&&e[Lt]===!0}function Ks(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as nc,SCALAR_TEXT_CONTROLS as oc}from"efficient-easel/draw";function $s(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[Io]:o,...r}=e;return{...r,[ko]:!0,render:t}}const Jr=new Set(Ho),Q={type:"radio",options:[{value:!0},{value:!1}]},Nt={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...Nt[e.control],label:e.label});if(!Jr.has(e.control))return n;const o=t.render;return{...mt(n,"authored-copy"),render:r=>i(Ao,{name:r.name,children:o(r)})}},Xs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Zr={field:"source.slug",set:!0},js={not:Zr},Qr="Select a word, then press the highlighter.",ei=new Set([Qr]),ti=e=>ei.has(e);function Vs(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function zs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ys(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function qs(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Js(e){return{type:"custom",[Xe]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Ko,{value:$e(t),onChange:n,label:e})}}function Zs(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Qs={Design:yn,Animation:_n};function ea(e){return{type:"custom",render:()=>i(ni,{text:e})}}function ni({text:e}){return i("p",{className:"sf-note",children:l(e)})}function ta(e){return fe(e)!==null&&e?.tabs!==void 0}const Pt=new Map;function na(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Pt.get(n)??{type:"custom",tabs:t,[pe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Pt.set(n,o),o}const vt=new Map;function oa(e){const t=vt.get(e)??{type:"custom",[pe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return vt.set(e,t),t}function oi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ra(e,t){return oi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function ia(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function la({title:e,children:t}){const[n,o]=z(()=>!Le.has(e));return i(qn,{title:e,open:n,onToggle:r=>{o(r),r?Le.delete(e):Le.add(e)},children:t})}const Le=new Set;function sa({label:e}){return i(Jn,{title:l(e),level:Pr(2)})}function ri({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(we,{content:d,children:i(ho,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function aa(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(ii,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function ii({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Be(),d={background:a.background,surface:a.surface,surface2:pr(a),band:ur(a)},f=n?Ee:t,m=Or(s,t,f),p=kt(void 0,f,d),u=n?_r:void 0,g=f===Ee?l("the theme's section background"):l("Theme {n} background",{n:c}),h=li(s,t,a,c,d,r),w=D(p.toUpperCase(),g),x=xe(s),b=x?re(x,a,c):null;return b?i(oe,{label:l(e),icon:i(Je,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:w,choices:h}):i(ft,{label:l(e),icon:i(Je,{}),value:m?"":kt(s,t,d),inherited:p,resetTo:w,onChange:r,onReset:()=>r(u),choices:h})}function li(e,t,n,o,r,s){const a=Tr(e,t);return[{label:l("No fill"),color:"",selected:a==="none",onPick:()=>s(Rr)},{label:`${l("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>s(Ee)},...ve(xe(e)??"",n,o,s)]}function si(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=Sr(r,t);return i(S,{label:l(e),icon:i(me,{}),changed:!s,action:i(C,{words:y()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(gr)}),children:ri({swatches:xr,current:s?Cr:yr(r,t),onPick:o,names:wr})})}}}function ca(e=n=>n,t){return J({_gSectionTheme:T(Ir),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Uo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(_o,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?u?.():h!==o&&r(h)}})})}function Bt(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,h=g===null;return i(S,{label:l(e),icon:f?q(f):void 0,value:h?d||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:d?Ge(d,{changed:!h,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:l(e),changed:!h,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ae="Corners";function Ne(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(S,{label:l(ae),icon:i(On,{}),changed:r,action:Ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(ci,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Dt(){return mt({type:"custom",render:()=>i(Eo,{})},"always")}function ai(){const e=M();return t=>e?.onChangeMany(t)}function ci({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=st(r)??[...lt];return i(mo,{label:l(ae),value:a,corners:Xn,onChange:c=>{const d=st(c)??[];s(d.length===lt.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ye,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Ht(){return Dt()}function di({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:y()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ui(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function pi(){return Ne({sidesKey:"sectionCornerSides",useFollowed:ui,mark:i(di,{label:ae}),hint:fi})}const fi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function da(){return J({_gShape:T("Shape"),sectionCorners:pi(),sectionCornerSides:Ht(),...X("sectionBorder",Gt)})}const hi=()=>({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 mi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function gi(){let e;try{const t=Tt(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||cr.line}function bi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?no(c,a):!1),m=hi(),p=u=>mi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(S,{label:l("Border"),icon:i(Rn,{}),action:r?i(eo,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Qn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:s,max:ar})})}function wi({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=gi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Rt(a(o)),...Rt(a(r))}:n==="tablet"?a(o):{};return i(bi,{value:e,onChange:t,placeholder:{sides:to(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function ua(e){return R(e,Gt(e==="mobile"?"phone":e))}function Gt(e){return{type:"custom",render:({value:t,onChange:n})=>i(wi,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>se(e,t(o),ke)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function pa(e){return{type:"custom",render:()=>i(xi,{partKey:e})}}function xi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=zo();let s=null;try{s=Xo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Yn,{name:l("Text"),preview:$o(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Vo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(jo(t,e))}})}function Mt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?zn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return jn(r)?r:n}function Si({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Mt(U);return i(C,{words:y()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function yi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function Ci(){return Ne({sidesKey:"cardCornerSides",useFollowed:()=>Mt(U),mark:i(Si,{label:ae}),hint:i(yi,{})})}function _i(){return{type:"custom",render:()=>i(ln,{})}}function fa(e){return{...e,render:t=>i(sn,{render:e.render,props:t})}}function ha(){return{_gShape:T("Shape"),cardCorners:Ci(),cardCornerSides:Ht(),cardCornersApplyAll:_i()}}function Ri(){return E({type:"custom",render:e=>i(Oi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ti(e,t){const n=_t(e);if(n!=="custom")return l(Ct.find(r=>r.value===n)?.label??"");const o=dt(Re(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function Oi(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=_t(c),f=r>=2&&r<=ct,m=()=>[...So[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:ct}),w=a&&(s||t!=="content"),x=Co().widths.hint(r,xo);return i(S,{label:l(K),icon:i(he,{}),changed:w,hint:d!=="custom"?void 0:f?x:h,action:i(C,{words:y()?.panel,label:l(K),changed:w,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Ti(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(at,{label:l(K),value:d,options:Ct.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:l(b.label),icon:Mr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?h:l(b.label))})),onChange:g,columns:3,cell:Wt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:dt(Re(c,r),r)}},onBlur:()=>{p.current=null},children:i(yo,{label:l(K),count:r,value:Re(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Ut(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 ma(){return Z(or,i(Ln,{}),xt,xt[0].value)}function ga(){return R("mobile",Gr(K,i(he,{}),sr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),lr,{columns:2,cell:Wt}))}const Wt={width:"5.75rem",height:"3.25rem"};function ba(){return se("share",Ri(),ke)[W("share")]}function Ii(){return R("mobile",$(St,i(Ze,{}),_e,ir,1,_e,"",{clear:{phoneFollows:!1,hint:_e}}))}const Kt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function wa(){const e=$(St,i(Ze,{}),yt,rr,1,yt,"",{clear:{emptyLabel:"Auto"}}),t=se("columns",e,{...Kt,tablet:ke.tablet}),n=se("columns",e,Kt,{phoneRow:Ii()});return{...t,phoneRow:n.phoneRow}}function xa(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(S,{label:l(e),icon:i(it,{noun:s}),action:i(C,{words:y()?.panel,label:l(e),changed:!Fr(a),detail:l("the Text style in Styles"),onReset:()=>c(kr),defaultAction:{onPress:()=>c(Er),title:l("Keep this section's own built-in size"),icon:i(Tn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Sa(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(he,{}),[{label:"Auto",value:""},...Array.from({length:un},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Me(Ei),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ei=zt(null);function ki({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=Se(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:Se(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Fi({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=Se(void 0,a,n);return i(C,{words:y()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ai(e){return Bt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Fi,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(ki,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Li={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ni={Top:rt,Bottom:tt,Left:nt,Right:ot},Pi=e=>{const t=Ni[e];return i(t,{})};function ya(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Li[x],s=x=>$(r("Top"),i(rt,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ai({label:r(x),icon:Pi(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,h=e.phone===!0,w=x=>h?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:w(s(c)),...h?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:w($(r("Bottom"),i(tt,{}),I.min,I.max,I.step,d,"px")),...h?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:w($(r("Left"),i(nt,{}),p.min,p.max,p.step,u,"px")),...h?{[F(f)]:a("Left",f,g,p)}:{},[m]:w($(r("Right"),i(ot,{}),p.min,p.max,p.step,u,"px")),...h?{[F(m)]:a("Right",m,g,p)}:{}}:{}})}function Ca(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&fe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ce="Width";function _a(e,t=Ar,n=!0){const o=t.map(r=>({label:Lr[r],value:r}));return J({...n?{_gWidth:T(ce)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(S,{label:l(ce),icon:i(Wn,{}),action:n?i(qr,{inherited:s?.inherited??!1,onReset:()=>r(Nr),label:ce}):void 0,children:Ae({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ce})})}})}function Ra(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(vi,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Di,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Wr("Unit",i(Qe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Hi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Gi,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function vi({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=de(n,r)?.mode??"auto";return i(S,{label:Y,icon:q(i(Pn,{})),action:o?o(t):void 0,children:Ae({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function $t(e,t){return e==="phone"&&ye(t)?Jo(t):qo(t)}function de(e,t){return e==="desktop"||(e==="tablet"?ye(t):Yo(t))?null:$t(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Bi(e,t,n,o){const r=de(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Xt(e,t,n){const o=M(),r=de(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Bi(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Di({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Xt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?tr:er;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Hi({props:e,draw:t,view:n}){const{followed:o,write:r}=Xt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Gi({view:e,onClear:t}){const n=L(),o=de(e,n)===null,r=e==="phone"&&ye(n),s=$t(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Ta(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Wi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Mi,{value:o,onChange:r,view:n})});return{_gStick:T(Ce),...X("stickTop",e),...X("stickTopDistance",t)}}function Mi({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Pe(n,r)?null:jt(n,bt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Ui(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:ie.min,max:ie.max,step:ie.step,value:s?null:typeof e=="number"?e:ie.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Pe(e,t){return e==="tablet"?Qo(t):Zo(t)}function jt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Ui(e,t,n){return e==="desktop"||Pe(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Wi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=bt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:jt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(S,{label:l(Ce),labelId:n,icon:q(i(Hn,{})),action:N(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:l(Ce),changed:Pe(o,r),detail:B(m=>l(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(be,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Vt="e.g. about";function Oa(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Vt},{type:"custom",render:({value:e,onChange:t})=>i(xn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Vt,hideable:!1,markup:!1})})})}}function Ia(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(bo,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Ea(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Jt(typeof o=="string"?o:null),onChange:d=>r(d?qt(d):"")})})}}}function Ki(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,m=r,p=typeof s=="boolean",u=typeof m.follows=="boolean"?m.follows:t,g=p?s:f?u:t,h=`${c??d??e}-label`,w=m.readOnly===!0,x=i(be,{checked:g,onChange:a,disabled:w,ariaLabelledBy:h});return i(S,{label:l(e),labelId:h,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(C,{words:y()?.panel,label:l(e),changed:p,detail:m.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),m.followsView),disabled:w,onReset:()=>a(void 0)}),x]}):x})}}}function ka(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i($i,{label:"Background",icon:i(Dn,{}),id:r,value:e,shown:Kn(e),onChange:t})}}}function Fa(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(S,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(fo,{id:a,checked:s,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(oe,{label:l(e),icon:n,value:o||t,onChange:r})}}function $i({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:a,n:c}=Be(),d=xe(o),f=d?re(d,a,c):null;return i(oe,{label:l(e),icon:t,id:n,value:f?f.hex:r,caption:f?.words,onChange:s,choices:ve(d??"",a,c,s)})}function La(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Xi,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function ve(e,t,n,o){const r=ge(e);return To(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function Xi({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Be(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=ge(e),d=c?re(c,o,r):null,f=ve(e,o,r,t),m=n?()=>t(void 0):()=>t("");let p=s,u=a;if(n){const g=ge(n.follows),h=$n(n.follows),w=g?re(g,o,r):h?{hex:h,words:h.toUpperCase()}:null;p=w?.hex??s,u=B(x=>l(x),w?w.words:a,n.view)}return d?i(oe,{label:l("Fill"),icon:i(me,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:m,resetTo:u,choices:f}):i(ft,{label:l("Fill"),icon:i(me,{}),value:e,inherited:p,resetTo:u,onChange:t,onReset:m,choices:f})}function ji(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return le(n);const r=Vn(e,t);if(r.length===0)return null;const s=le(Ft(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=le(Ft(r[a].sectionAccent));if(c!==null)return c}return le(r[0].sectionAccent)}function Be(){const e=Tt(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?ji(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:dr(e.themes[o]),n:o+1}}const Vi=[{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 zi({label:e,value:t,onChange:n,points:o=Vi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(po,{label:l(e),value:t,points:r,onChange:n})}function Na(){return Dt()}const Pa={top:i(Fn,{}),right:i(kn,{}),bottom:i(In,{}),left:i(En,{})};function va(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(h=>h.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},m=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(h=>h.value===p)?p:n;return i(S,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:zi({label:e,value:g,onChange:u,points:m})})}}}function Ba(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Mo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Da(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Wo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Ha(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ga=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ma(e,t,n){const o=Object.keys(We).map(r=>({label:We[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(qi,{label:e,icon:t,options:o,onChange:r})}}function Yi(e,t,n){const o=Zt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=en(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function qi({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Qt(s),c=Me(on),d=nn(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const m=tn(r?.id,f,d);return i(S,{label:l(e),icon:q(t),hint:Yi(s,m,c?.hasUnsavedEdits??!1),children:Ae({options:n,value:a,onChange:o,ariaLabel:e})})}function Ua(e,t,n,o={}){const r={type:"custom",[je]:!0,render:({value:s,onChange:a,name:c})=>i(Go,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Wa={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ji(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ka({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Br(vr()).geocode,f=Ue(),m=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(S,{label:l(n),icon:i(et,{}),action:d?i(we,{content:l("Find from the address (OpenStreetMap)"),children:i(ut,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Gn,{})})}):void 0,children:d&&o.status?i(Sn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(Ro):l(o.status),hint:Ji(o)}):null}),i(S,{label:l("Enter by hand"),labelId:f,icon:i(An,{}),action:i(be,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(S,{label:l("Latitude, longitude"),icon:i(et,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(pt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(pt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Zi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Qi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function $a(e,t){return e===null?null:t>e?e:null}function el(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 Xa={label:"Ticker items",icon:i(Bn,{})};function ja(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Nt.textList,label:e}),render:({value:r,onChange:s})=>i(tl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function tl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=el(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(oo,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(ht,{target:a,value:Zi(n,c),onChange:p=>r(Qi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,d(u)}})})}function Va(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:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function za(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(vn,{}),Bo,String(Do),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:si("Image background",br),cardImage:rl()}}function Ya(){return{outline:Z("Card outline",i(Mn,{}),No,vo),indexBadge:Z("Card number",i(Qe,{}),Lo,Po),showBadge:Ki("Product badge",!0,i(it,{noun:"tag"}))}}function qa(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ue.find(s=>s.id===r).label}),o=r=>E(Oo(De),n(r));return{_gShowOnCard:T("Show on a card"),[De]:E({type:"custom",render:()=>i(nl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(De)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const De="showCardPrice",ue=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function nl({rest:e}){const t=L(),n=ai(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ue.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(He,{parts:ue,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ue.map(({id:a})=>[a,void 0])))})}function Ja(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(He,{parts:e,changed:io(o),shown:s=>lo(o,s),onPress:(s,a)=>r(co(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(ol,{parts:e,desktopKey:t,value:o,onChange:r})})}}function He({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(S,{label:c,icon:i(Cn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(ro,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function ol({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(He,{parts:e,changed:ao(n),shown:s=>so(r,n,s),onPress:(s,a)=>o(uo(n,s,a)),onReset:()=>o(Fo),detail:l("the same as Desktop")})}function rl(){return Bt("Card image",{min:U,max:Ye,step:an,hint:"Rounds the picture. The card's own corner is in Styles."})}function Za(){return Ne({sidesKey:"cornerSides",step:cn,useFollowed:()=>U,mark:i(il,{label:dn}),hint:l("Rounds the picture. Left alone it stays square.")})}function il({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:l(e),changed:t,onReset:n})}function Qa(){return{type:"custom",render:({value:e,onChange:t})=>i(cl,{value:typeof e=="string"?e:"",onChange:t})}}function ll({layout:e,width:t}){const n=hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:mn(e).map(([r,s],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},a))})}const sl={width:"3.5rem",height:"2.5rem"},al=200;function cl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Yt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=al?4:3);g();const h=new ResizeObserver(g);return h.observe(u),()=>h.disconnect()},[]);const c=e&&e in ne?e:"",d=qe(n,c),f=qe(n,"").length,m=gn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Ur(m,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(ll,{layout:ne[u],width:40})}))];return i(S,{label:l("Layout"),icon:i(Nn,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(at,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:sl,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Zn,{options:[{id:"all",label:l("All")},...pn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:fn.length})})]})})})})}export{Zr as BOUND_TO_POST,Xs as BOUND_TO_POST_NOTE,Qs as BUCKET_ICONS,Wa as CUSTOM_FIELD_MEDIA,Ka as CoordsField,At as DESKTOP_GAP_NOT_OVERLAP,He as DisplayRow,Pa as EDGE_ARROWS,wo as FOCAL_DEFAULT,Vi as FOCAL_POINTS,pe as FOLD_FIELD_MARKER,zi as FocalPicker,sa as GroupLabel,Qr as HIGHLIGHT_HINT,H as HidableTextField,Xe as LINK_FIELD_MARKER,Ps as Label,je as MEDIA_FIELD_MARKER,Ga as MEDIA_TYPE_OPTIONS,js as NOT_BOUND_TO_POST,la as PanelBand,ni as PanelNoteLine,Ei as RowPropsContext,Ve as SCAFFOLD_FIELD_MARKER,oc as SCALAR_TEXT_CONTROLS,$r as SiteGapDefaultReset,ee as Slider,ri as Swatches,nc as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Xa as TICKER_ITEMS_ROW,tl as TextListField,$i as ThemeFillRow,ce as WIDTH_LABEL,qr as WidthDefaultReset,el as aimAfterListChange,Oa as anchorFields,D as backTo,aa as backgroundField,ma as boxBlockSpacingField,wa as boxColumnsFields,La as boxFillField,Ii as boxPhoneRowField,Ri as boxShareField,ga as boxSharePhoneField,ba as boxShareTabletField,ji as boxThemeIndexOf,na as bucketHeader,pa as buttonWordsEntryField,Ci as cardCornersField,si as cardImageBackgroundField,rl as cardImageField,za as cardMediaFields,ha as cardShapeFields,qa as cardShowFields,Ya as cardStyleFields,Sa as cellWidthFields,Fa as checkbox,Aa as colorInput,Bs as containerDirectionField,Xr as containerGapField,jr as containerGapPhoneField,vs as containerGapRows,Vr as containerGapTabletField,Ji as coordsResultTip,qs as copyText,Ht as cornerSidesField,Ne as cornersRowField,Ea as date,Ia as dateTime,oa as designGroupHeader,Ja as displayFields,va as edgePad,ve as fillSlotChoices,$a as focusAfterRemove,Na as focusKeptField,ra as foldMarker,fe as foldMetaOf,oi as foldTitleOf,Bi as followedHeightPatch,Ui as followedStickPatch,Qa as galleryLayoutField,Ra as heightFields,de as heightFollowedBy,Ds as heroGroupPlacementPoints,$e as hidableText,ti as hintIsWhileTyping,Za as imageCornersField,$s as inOwnBox,ta as isBucketHeader,Dt as keptBy,Js as linkField,Yi as loadingRowHint,Ma as loadingShowsField,Ba as multiSelect,ka as pageBackgroundField,ea as panelNote,Ai as phoneOverrideField,Ys as plainText,Zs as plainTextarea,Bt as pxField,ia as quietMarker,Ke as readHidable,Zi as rowText,Da as searchSelect,li as sectionBandChoices,ua as sectionBorderField,pi as sectionCornersField,da as sectionShapeFields,ca as sectionThemeFields,Qi as setRowText,xa as sizeField,Ha as sourceField,ya as spacingFields,Ta as stickFields,Ca as swapPadding,fa as templateField,Vs as text,rn as textFieldIdentifier,Ms as textFieldOffPage,Ws as textFieldPanelOnly,ja as textList,Va as textListRowField,zs as textarea,Ki as toggle,Ua as upload,ai as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Kr as useSiteGapDetail,_a as widthField,Ks as withIdentifier,Gs as withOffPage,Us as withPanelOnly,Hs as withScaffold};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{convertSection as
|
|
1
|
+
import{convertSection as P,pressesAsBox as S,SECTION_TO_BOX_PRESS as _,sectionToBoxRow as l}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as R,presetFor as k}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as d}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{statsBoxSeed as T,statsPressSeed as B,statsSeedRows as C}from"../../../render/lib/document/blocks/general/section-to-box-rows-stats.js";import{logosPressStarter as N,paymentPressStarter as w}from"../../../render/lib/document/blocks/general/section-to-box-rows-logos.js";import{cardsPressStarter as L}from"../../../render/lib/document/blocks/general/section-to-box-rows-cards.js";import{pageHeaderPressStarter as j}from"../../../render/lib/document/blocks/general/section-to-box-rows-pageheader.js";import{milestoneTimelinePressStarter as v,storyTimelinePressStarter as A}from"../../../render/lib/document/blocks/general/section-to-box-rows-timeline.js";import{seedNodes as U}from"../../../format/lib/document/seed-parts.js";import{propsWithPartStyleValue as W}from"../../../render/lib/document/part-styles.js";import{isNodeList as m}from"efficient-easel/data";const X=Object.keys(d),E={Logos:N,DocMasthead:j,Timeline:A,TimelineTrack:v},D={PaymentBadges:w};function u(t,r,e){const o={};for(const n of Object.keys(r(t.type)))o[n]=void 0;for(const[n,s]of Object.entries(t.props))o[n]=m(s)?s.map(p=>u(p,r,e)):s;return o.id=e(t.type),{type:t.type,props:o}}const O=t=>({...t?.theme?{theme:t.theme}:{},press:!0});function b(t,r,e=0,o=()=>({})){return(n,s,p)=>{const{nodes:i}=P({type:t,props:{...n(t),...o(),id:s(t)}},r,O(p));return u(i[e],n,s)}}const G={Stats:Y,Cards:M};function M(){const t=l("Cards");if(!t)return null;const r=b("Cards",t,0,L);return(e,o,n)=>{const s=r(e,o,n);return{...s,props:{...s.props,name:"Cards section"}}}}function Y(){const t=l("StatsParagraph");return t?(r,e,o)=>{const{nodes:n}=P({type:"StatsParagraph",props:{...r("StatsParagraph"),...B(),id:e("StatsParagraph")}},t,O(o)),s=n[0],p=m(s.props.content)?s.props.content.filter(f=>f.props?.cardStyle===void 0):[],i=x(T(C(),"table")),c=p.map(h),a=u({...s,props:{...s.props,content:[...c,i]}},r,e);return{...a,props:{...a.props,name:"Stats section"}}}:null}function h(t){if(t.props?.name==="Words"){const r=m(t.props.content)?t.props.content.map($):t.props.content;return{...t,props:{...t.props,widthFitPhone:"fill",content:r}}}return m(t.props?.content)?{...t,props:{...t.props,content:t.props.content.map(h)}}:t}function $(t){return t.type!=="Text"?t:{...t,props:W({...t.props,alignTablet:"left"},"text","alignTablet","left")}}const x=t=>U([t],(r,e)=>`${r}-seed-${e}`)[0];function H(t,r){if(!S(t,r))return null;const e=G[t];if(e)return e();const o=l(t);return o?b(t,o,0,E[t]??D[t]):null}function I(t){return(r,e,o)=>{const n=s=>{if(s.type==="Stats"){const c=u(x(T([],"list")),r,e);return{...c,props:{...c.props,name:"Numbers"}}}let p=!1;const i={};for(const[c,a]of Object.entries(s.props))if(m(a)){const f=a.map(n);p||=f.some((y,g)=>y!==a[g]),i[c]=f}else i[c]=a;return p?{type:s.type,props:i}:s};return n(t(r,e,o))}}function st(t,r=_){const e=k(t);return e?I(e):H(t,r)}function ot(){return[...Object.keys(R),...X.filter(t=>S(t)),...Object.keys(E).filter(t=>S(t))]}export{E as MERGE_LAYOUTS,X as TEXT_LAYOUTS,b as conversionPreset,st as layoutPresetFor,ot as layoutTypes};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type FillColorSlot } from "efficient-shell/markup";
|
|
3
3
|
import type { SourceRow } from "./block-sources.js";
|
|
4
4
|
import { type ViewVarNames } from "./view-var-split.js";
|
|
5
5
|
export declare const CARD_SHADOW_CLASS = "sf-card";
|
|
@@ -33,7 +33,7 @@ export declare function isBackgroundBox(src?: string | null): boolean;
|
|
|
33
33
|
export declare function boxDarkenStyle(darken: unknown, style?: unknown): CSSProperties | null;
|
|
34
34
|
export declare const boxFillOf: (value: unknown) => string | null;
|
|
35
35
|
export declare const boxPaintOf: (value: unknown) => string | null;
|
|
36
|
-
export declare const boxFillSlot: (value: unknown) =>
|
|
36
|
+
export declare const boxFillSlot: (value: unknown) => FillColorSlot | null;
|
|
37
37
|
export declare const BOX_SWATCH_PROP = "swatch";
|
|
38
38
|
export declare function boxSwatchFill(props: Record<string, unknown> | null | undefined, row: SourceRow | null | undefined): string | null;
|
|
39
39
|
export declare const BOX_FILL_VIEWS: ViewVarNames;
|