efficient-web-builder 43.0.1 → 44.0.1
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 +50 -2
- package/dist/editor/components/CanvasPartsBridge.d.ts +1 -0
- package/dist/editor/components/CanvasPartsBridge.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/PreviewThemeFrame.d.ts +1 -1
- package/dist/editor/components/PreviewThemeFrame.js +3 -19
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/storefront-editor.css +16 -77
- package/dist/editor/lib/document/MarkupToolbar.d.ts +6 -2
- package/dist/editor/lib/document/MarkupToolbar.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +1 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/part-anchors.d.ts +7 -0
- package/dist/editor/lib/document/part-anchors.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +0 -1
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/markup.d.ts +1 -0
- package/dist/format/lib/markup.js +2 -2
- package/dist/format/lib/popup/rules.d.ts +1 -1
- package/dist/format/lib/popup/rules.js +1 -1
- package/dist/render/components/BlockFrame.d.ts +1 -1
- package/dist/render/components/Btn.js +1 -1
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/ContactLocations.js +3 -45
- package/dist/render/components/Divider.d.ts +1 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/Flex.d.ts +3 -9
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Heading.d.ts +1 -1
- package/dist/render/components/HeroGroup.d.ts +3 -9
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/HeroSection.js +1 -11
- package/dist/render/components/HeroSingle.js +1 -11
- package/dist/render/components/PreviewTickerContext.d.ts +3 -0
- package/dist/render/components/PreviewTickerContext.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +1 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/Text.d.ts +1 -1
- package/dist/render/lib/content/button-look.js +1 -0
- package/dist/{format → render}/lib/content/section-padding.d.ts +23 -5
- package/dist/render/lib/content/section-padding.js +1 -0
- package/dist/render/lib/content/view-values.d.ts +10 -0
- package/dist/render/lib/content/view-values.js +1 -0
- package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Heading/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
- package/dist/render/lib/document/part-styles.d.ts +0 -1
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/text-parts.d.ts +0 -2
- package/dist/render/lib/document/text-parts.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +1 -1
- package/dist/format/lib/content/button-look.js +0 -1
- package/dist/format/lib/content/section-padding.js +0 -1
- /package/dist/{format → render}/lib/content/button-look.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as O,Fragment as I}from"react/jsx-runtime";import{cloneElement as be,useId as It,useRef as ae,useState as j}from"react";import{useEasel as X}from"efficient-easel/easel";import{say as a,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{mediaValueSrc as ye}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as xe,loadingShowsOf as Et}from"../../../format/lib/hero-video.js";import{readHidable as Se,hidableText as Ce}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Q,LINK_FIELD_MARKER as _e,MEDIA_FIELD_MARKER as Ie,SCAFFOLD_FIELD_MARKER as Ee,TEXT_FIELD_MARKER as E,foldMetaOf as ee,textFieldIdentifier as Tt}from"efficient-easel/draw";import wt from"../../components/ApplyCornersToSiblings.js";import Ot from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Rt,CORNER_RADIUS_MAX as Te,CORNER_RADIUS_MIN as G}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as Pt,IMAGE_CORNERS_LABEL as vt}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Lt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as kt,GALLERY_LAYOUTS as $,GALLERY_LAYOUT_KEYS as we,galleryPictureCells as Nt}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as Ft,HERO_GROUP_PLACEMENTS as At,HERO_GROUP_PLACEMENT_DEFAULT as Bt,normalisePlacement as Dt,placementPoints as Oe}from"../../../format/lib/hero-group-placement.js";import Ht from"../../components/KeepHint.js";import Gt from"../../components/AnchorField.js";import{AdjustIcon as Mt,AlignLeftIcon as Wt,EyeIcon as Kt,AlignSeparateIcon as Ut,AnimationIcon as Re,BackgroundIcon as jt,BorderAllIcon as Xt,BlockSectionIcon as $t,CartIcon as zt,ColumnWidthsIcon as Pe,ColumnsIcon as ve,CornerIcon as Vt,DirectionDownIcon as Yt,DirectionLeftIcon as qt,DirectionRightIcon as Jt,DirectionUpIcon as Zt,DollarIcon as Qt,FinishIcon as en,GapIcon as Le,GridIcon as tn,GroundIcon as nn,HashIcon as ke,HeightIcon as on,ImageIcon as rn,ListIcon as ln,LocationIcon as se,NudgeIcon as an,PaddingAllIcon as sn,PaddingBottomIcon as Ne,PaddingLeftIcon as Fe,PaddingRightIcon as Ae,PaddingTopIcon as Be,PageIcon as De,PlacementIcon as cn,ProductSizeIcon as dn,StickyIcon as un,RotateIcon as pn,SquareIcon as fn,TypeIcon as mn,WidthIcon as hn,WrapIcon as gn}from"efficient-easel/icons";import{FieldGlyph as He}from"../../components/FieldGlyph.js";import{resolvePageBackground as bn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Ge,CORNER_SIDE_POINTS as yn,hasOwnSectionCorners as xn,normalizeCornerSides as Me}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as Sn,SECTION_MOTION_OPTIONS as Cn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as We}from"./enclosing-section.js";import{SettingsDefaultReset as x,SettingsDrill as _n,SettingsField as h,SettingsGroup as In,SettingsGroupSub as En,SettingsBorder as Tn,SettingsSegmented as wn,SettingsSides as On,SettingsSidesEach as Ke,sidesStartEach as Rn,SettingsSwitch as Ue,borderSides as Pn,borderStartEach as vn}from"efficient-easel/panel";import{FieldSelect as Ln,ListField as kn}from"efficient-easel/fields";import{DisplayChips as Nn}from"efficient-shell/ui";import{desktopDisplayChanged as Fn,partShownOnDesktop as An,partShownOnPhone as Bn,phoneDisplayChanged as Dn,withDesktopPart as Hn,withPhonePart as Gn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Mn,Checkbox as Wn,CornersInput as Kn,DateTimePicker as Un,FOCAL_DEFAULT as jn,PictureTiles as je,PositionInput as Xn,Slider as $n,Tooltip as Xe}from"efficient-shell/ui";import{ColourRow as $e,InheritedColourRow as zn}from"./ColourControl.js";import ze from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Vn,NoControlMark as te,noControlField as z}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Yn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as qn,resolvePhoneValue as ce}from"../../../format/lib/document/phone-override.js";import{phoneKey as M}from"efficient-easel/draw";import{SuppressibleText as Jn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Zn,CARD_OUTLINE_OPTIONS as Qn,DEFAULT_CARD_INDEX_FORMAT as eo,DEFAULT_CARD_OUTLINE as to}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as no,DEFAULT_COVER_INDEX as oo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as ro}from"efficient-easel/draw";import io from"../../components/MediaUploadField.js";import{useSelectedHost as V}from"./selected-host.js";import lo from"../../components/MultiSelectField.js";import ao from"../../components/SectionThemePicker.js";import so from"../../components/SearchSelectField.js";import co from"../../components/StorefrontLinkField.js";import{UiIcon as Ve}from"efficient-easel/draw/client";import{SECTION_PADDING as T}from"../../../format/lib/content/section-padding.js";import{buttonLook as uo,buttonWordsSummary as po}from"../../../format/lib/content/button-look.js";import{nonEmptyString as fo}from"../../../format/lib/non-empty-string.js";import{usePreviewParts as mo}from"efficient-easel/draw/client";import{encodePartId as ho}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as go,useEaselStrings as bo}from"efficient-easel/strings";import{hasPhoneHeight as yo,resolveSectionMinHeight as xo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ne,SECTION_STICK_LABEL as de,hasPhoneStick as So,resolveSectionStick as Co}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as _o,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as Io}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as Eo,containerDirectionPoints as To,resolveContainerDirection as Ye}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as wo,BOX_BLOCK_SPACING_LABEL as Oo,BOX_BLOCK_SPACING_POINTS as qe,BOX_JUSTIFY_POINTS as Je,BOX_PHONE_ROW_LABEL as Ro,BOX_PHONE_ROW_MAX as Po,BOX_PHONE_ROW_MIN as Ze,BOX_SHARE_LABEL as Qe,BOX_SHARE_POINTS as ue,BOX_WRAP_LABEL as vo,BOX_WRAP_POINTS as et}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as L}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Lo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as ko,normalizeTheme as No,selectedThemeColors as Fo,siteButtonPaint as tt}from"../../../format/lib/theme.js";import{CONTAINER_GAP as pe,CONTAINER_GAP_BUILT_IN as Ao,GAP_FIELD_CONTAINER as Bo,hasOwnContainerGap as Do,resolveContainerGap as Ho}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Go,CARD_IMAGE_BG_OFF as Mo,CARD_IMAGE_BG_SWATCH_NAMES as Wo,CARD_IMAGE_BG_SWATCHES as Ko,isCardImageBackgroundInheriting as Uo,cardImageBackgroundChoice as jo,THEME_CARD_IMAGE_BG as Xo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as $o,SECTION_BG_SWATCHES as zo,SECTION_BG_SWATCH_NAMES as Vo,THEME_SECTION_BG as Yo,isSectionBackgroundInheriting as qo}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Jo}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Zo,TYPE_SIZE_INHERIT as Qo,isTypeSizeInheriting as er}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as tr,WIDTH_CHOICE_LABEL as nr,WIDTH_INHERIT as or,resolveWidth as rr,sectionRunsFullWidth as nt}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as ir}from"./panel-heading-scope.js";import{withStyleKind as lr}from"efficient-easel/style-clipboard";import{useEaselSession as ar}from"efficient-easel/screen/lib/session-context";import{backendOf as sr}from"../website-session.js";import{describedAs as w}from"../../../format/lib/host-document-bridge.js";function W(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!ee(n)&&lr(n,`section:${t}`);return e}function kl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function ot(){return null}function cr(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return i(ot,{},e)}function dr(e){return e.type===ot}function R(e){return dr(e)?void 0:e}function F(e,t){return a("{value} from {from}",{value:e,from:t})}function ur(){const{appState:e}=X(r=>r),t=e.data.root?.props??{},{mode:n,pageWidth:o}=rr(t,"full");return n==="page"?F(`${o}px`,a("the page")):n==="contained"?F(a("Contained"),a("the page")):F(a("Full"),a("the page"))}function pr(){const{blockGap:e}=L();return e===null?a("this container's own spacing"):F(`${e}px`,a("Styles"))}function fr({inherited:e,onReset:t,label:n}){return i(x,{words:y()?.panel,label:a(n),changed:!e,detail:pr(),onReset:t})}function mr({inherited:e,onReset:t,label:n}){return i(x,{words:y()?.panel,label:a(n),changed:!e,detail:ur(),onReset:t})}function A({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:s=!0,markup:c=!0}){const{text:d,hidden:u}=Se(e),f=ae(null),p=ae(null),m=v=>t(s?{text:v,hidden:u}:v),b=()=>t({text:d,hidden:!u}),C=s&&u,P=It(),_=r?xr(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:a(r)}):i(Ht,{children:a(r)}):void 0,Z=u?a("Show {label} on the slide",{label:a(n)}):a("Hide {label} on the slide",{label:a(n)});return i(h,{label:a(n),icon:i(mn,{}),htmlFor:P,className:C?"is-hidden":void 0,hint:_,action:s?i(Xe,{content:Z,children:i("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":Z,onClick:b,children:u?i(Ve,{name:"eye-off",size:14}):i(Ve,{name:"eye",size:14})})}):void 0,children:O("div",{className:"sf-copybox",children:[c&&i(ze,{target:l?p:f,value:d,onChange:m}),l?i("textarea",{id:P,ref:p,value:d,placeholder:o===void 0?void 0:a(o),onChange:v=>m(v.target.value)}):i("input",{id:P,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:a(o),onChange:v=>m(v.target.value)})]})})}function Nl(e,t){return{...e,[Ee]:t}}function Fl(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function Al(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}const rt="sfPanelOnly";function Bl(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[rt]:!0}}function Dl(e){return!!e&&typeof e=="object"&&e[rt]===!0}function Hl(e){const t=e[E];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[E]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as cs,SCALAR_TEXT_CONTROLS as ds}from"efficient-easel/draw";function Gl(e,t){if(!e[E])throw new Error("inOwnBox: the field holds no authored text");const{[Vn]:o,...r}=e;return{...r,[Yn]:!0,render:t}}const hr=new Set(ro),oe={type:"radio",options:[{value:!0},{value:!1}]},it={text:{type:"object",objectFields:{text:{type:"text"},hidden:oe}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:oe}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},B=(e,t)=>{const n=w({...t,[E]:e},{...it[e.control],label:e.label});if(!hr.has(e.control))return n;const o=t.render;return{...z(n,"authored-copy"),render:r=>i(Jn,{name:r.name,children:o(r)})}},Ml="Everything else on this block comes from the linked post. Unlink it to edit by hand.",gr={field:"source.slug",set:!0},Wl={not:gr},br="Select a word, then press the highlighter.",yr=new Set([br]),xr=e=>yr.has(e);function Kl(e,t,n){return B({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ul(e,t,n){return B({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function jl(e,t,n){return B({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Xl(e,t,n){return B({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function $l(e){return{type:"custom",[_e]:{label:e},...w({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(co,{value:Ce(t),onChange:n,label:e})}}function zl(e,t,n){return B({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Vl={Design:Mt,Animation:Re};function Yl(e,t){return e.includes("Design")?t!=="Design":null}function lt(e,t){return{type:"custom",[Q]:{label:e,level:t},marker:!0,fold:e,render:()=>i(I,{})}}function S(e){return lt(e,2)}function ql(e){return{type:"custom",render:()=>i(Sr,{text:e})}}function Sr({text:e}){return i("p",{className:"sf-note",children:a(e)})}function Jl(e){return lt(e,1)}function Zl(e){return ee(e)!==null&&e?.tabs!==void 0}const at=new Map;function Ql(e,t){const n=`${e}\0${t?t.join(""):""}`,o=at.get(n)??{type:"custom",tabs:t,[Q]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(I,{})};return at.set(n,o),o}const st=new Map;function ea(e){const t=st.get(e)??{type:"custom",[Q]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(I,{})};return st.set(e,t),t}function Cr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ta(e,t){return Cr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(I,{})}}function na(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(I,{})}}function oa({title:e,children:t}){const[n,o]=j(()=>!fe.has(e));return i(In,{title:e,open:n,onToggle:r=>{o(r),r?fe.delete(e):fe.add(e)},children:t})}const fe=new Set;function ra({label:e}){return i(En,{title:a(e),level:ir(2)})}function ct({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,s=l?a(l):t;return O("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?a(o[c]):c;return i(Xe,{content:d,children:i("button",{type:"button","aria-pressed":t.toLowerCase()===c.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===c.toLowerCase()?"is-active":""}`,style:{background:c},onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function ia(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=qo(n,t);return i(h,{label:a(e),icon:i(jt,{}),changed:!r,action:i(x,{words:y()?.panel,label:a(e),changed:!r,detail:a("the theme's section background"),onReset:()=>o($o)}),children:ct({swatches:zo,current:r?Yo:n??t??"",onPick:o,names:Vo})})}}}function _r(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=Uo(r,t);return i(h,{label:a(e),icon:i(nn,{}),changed:!l,action:i(x,{words:y()?.panel,label:a(e),changed:!l,detail:a("the theme's image stage"),onReset:()=>o(Go)}),children:ct({swatches:Ko,current:l?Xo:jo(r,t),onPick:o,names:Wo})})}}}function la(e=n=>n,t){return W({_gSectionTheme:S(Jo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(ao,{value:e(n),onChange:o,followLabel:t})}})}function K({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:s=!0,notch:c,ariaLabel:d,disabled:u=!1}){const f=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i($n,{min:e,max:t,step:n,value:o,suffix:l||void 0,showInput:s,label:d===void 0?void 0:a(d),disabled:u,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&r(p)}})})}function U(e,t,n,o,r,l,s="",c){return{type:"custom",...w({},{type:"number",label:e}),render:d=>i(h,{label:a(e),icon:R(t),action:c?c("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:K({min:n,max:o,step:r,value:typeof d.value=="number"?d.value:l,suffix:s,ariaLabel:e,onChange:d.onChange})})}}function dt(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:s,restTrack:c,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return i(h,{label:a(e),icon:u?R(u):void 0,value:b?d||l===void 0?void 0:a(l):`${m}px`,changed:!b,action:d?be(d,{changed:!b,onReset:()=>p(null)}):i(x,{words:y()?.panel,label:a(e),changed:!b,onReset:()=>p(null)}),hint:typeof s=="string"?a(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:p}):K({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function aa(e){const t=U("Gap",i(Le,{}),pe.min,pe.max,pe.step,Ao[e],"px",(n,o)=>i(fr,{inherited:!Do(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[Bo]:e,render:n=>t.render({...n,value:Ho(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const re="Corners";function me(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(h,{label:a(re),icon:i(Vt,{}),changed:r,action:be(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(Ir,{tier:e,px:o,onRadius:n})})}}}function k(e){const t=V();return[t?.values?.[e],n=>t?.onChange(e,n)]}function sa(){const e=V();return t=>e?.onChangeMany(t)}function Ir({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),r=e.useClosedReason?e.useClosedReason():null,[l,s]=k(e.sidesKey),c=Me(l)??[...Ge];return i(Kn,{label:a(re),value:c,corners:yn,onChange:d=>{const u=Me(d)??[];s(u.length===Ge.length?null:u)},radius:t,onRadiusChange:n,radiusMin:G,radiusMax:Te,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:r!==null,disabledReason:r??void 0})}function ut(){return z({type:"custom",render:()=>i(te,{})},"always")}function Er({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=L(),r=typeof o=="number"?`${o}px`:a("not set");return i(x,{words:y()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):F(r,a("Styles")),onReset:n})}function Tr(){const{cornerRadiusPx:e}=L();return typeof e=="number"?e:G}function wr(){return me({sidesKey:"sectionCornerSides",useFollowed:Tr,useClosedReason:()=>ft()?a(pt):null,mark:i(Er,{label:re}),hint:i(Or,{})})}const pt="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function ft(){return nt(D())}function Or(){return i(I,{children:ft()?pt:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function ca(){return W({_gShape:S("Shape"),sectionCorners:wr(),sectionCornerSides:ut(),sectionBorder:ht("desktop"),sectionBorderPhone:ht("mobile")})}const Rr=()=>({width:a("Border width"),sides:{top:a("Border top"),right:a("Border right"),bottom:a("Border bottom"),left:a("Border left")},style:a("Border style"),styles:{solid:a("Solid"),dashed:a("Dashed"),dotted:a("Dotted")},color:a("Border color"),unit:"px"});function Pr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function vr(){let e;try{const t=No(L().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||ko.line}function mt({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[d,u]=j(()=>r?vn(c,s):!1),f=Rr(),p=m=>Pr(r&&l?m:{width:m.width,color:m.color,...l?{style:m.style}:{}});return i(h,{label:a("Border"),icon:i(Xt,{}),action:r?i(Ke,{each:d,label:a("Each side"),onChange:u}):void 0,children:i(Tn,{label:a("Border"),value:c,each:d,onChange:m=>t(p(m)),placeholder:n,presets:o,words:f,styles:l,max:Lo})})}function Lr({value:e,onChange:t,tier:n}){const[o]=k("sectionBorder"),r=vr(),l=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(mt,{value:e,onChange:t,placeholder:{sides:Pn(l),style:l.style??"solid",color:l.color||r},presets:[r],above:l})}function ht(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>i(Lr,{value:t,onChange:n,tier:e})})}function da(e){return{type:"custom",render:()=>i(kr,{partKey:e})}}function kr({partKey:e}){const[t]=k("id"),[n]=k("_partStyles"),{textStyles:o}=L(),r=bo();let l=null;try{l=mo().select}catch{l=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(_n,{name:a("Text"),preview:po(s,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??go.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(ho(t,e))}})}function ua(){return{type:"custom",render:({value:e,onChange:t})=>i(Nr,{value:e,onChange:t})}}function Nr({value:e,onChange:t}){const[n]=k("variant"),[o]=k("buttonColor"),{theme:r}=L(),s=uo({variant:n,buttonColor:o,buttonBorder:e&&typeof e=="object"?e:{}}).border.width,c=fo(o)??(n==="ghost"?Fo(r).text:tt(r).fill);return i(mt,{value:e,onChange:t,placeholder:{sides:{top:s,right:s,bottom:s,left:s},style:"solid",color:c},presets:[c],sides:!1,styles:!1})}function pa(){return{_gMotion:S("Motion"),sectionAnimation:ge("Entrance",i(Re,{}),[...Cn],Sn)}}function he(){let e=null;try{const{appState:t,selectedItem:n}=X(r=>r),o=n?.props?.id?String(n.props.id):void 0;e=o?We(t?.data,o):null}catch{e=null}return e!==null&&nt(e)}function gt(e){const{cornerRadiusPx:t}=L(),n=he(),o=typeof t=="number"?t:e;let r=null;try{const{appState:s,selectedItem:c}=X(u=>u),d=c?.props?.id?String(c.props.id):void 0;r=d?We(s?.data,d):null}catch{r=null}if(n||!r)return o;const l=r.sectionCorners;return xn(l)?l:o}function Fr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=he(),r=gt(G),l=o?"Site":"Section";return i(x,{words:y()?.panel,label:a(e),changed:t,detail:F(`${r}px`,o?a("Styles"):a("the section")),onReset:n})}function Ar(){return i(I,{children:he()?a("The section is full width, so this card follows Styles ▸ Basics ▸ Corners."):a("Follows the section's Corners until you set a number here.")})}function Br(){return me({sidesKey:"cardCornerSides",useFollowed:()=>gt(G),mark:i(Fr,{label:re}),hint:i(Ar,{})})}function Dr(){return{type:"custom",render:()=>i(wt,{})}}function fa(e){return{...e,render:t=>i(Ot,{render:e.render,props:t})}}function ma(){return{_gShape:S("Shape"),cardCorners:Br(),cardCornerSides:ut(),cardCornersApplyAll:Dr()}}function ha(){return N("Justify",i(Ut,{}),Je,Je[0].value)}function ga(){return N("Item alignment",i(Wt,{}),wo,"stretch")}function ba(){return N(vo,i(gn,{}),et,et[0].value)}function ya(){return{type:"custom",render:({value:e,onChange:t})=>{const n=ue.find(o=>o.value===e)??ue[0];return i(h,{label:a(Qe),icon:i(Pe,{}),value:a(n.label),children:i(je,{className:"sf-gallery-layouts",label:a(Qe),value:n.value,onChange:t,options:ue.map(o=>({value:o.value,label:a(o.label),picture:i("span",{className:"sf-gallery-pic",children:Hr(o.weights).map((r,l)=>i("i",{style:{gridColumn:`span ${r}`}},l))})}))})})}}}function Hr(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 xa(){return N(Oo,i(Le,{}),qe,qe[0].value)}function Sa(){return g("mobile",U(Ro,i(ve,{}),Ze,Po,1,Ze))}function Ca(e){const t=ge(Eo,cr("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),To(e),Ye(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Ye(e,n.value),onChange:o=>n.onChange(o)})}}function _a(e,t,n,o,r,l){return{type:"custom",render:({value:s,onChange:c})=>i(h,{label:a(e),icon:i(He,{noun:l}),action:i(x,{words:y()?.panel,label:a(e),changed:!er(s),detail:a("the Text style in Styles"),onReset:()=>c(Qo),defaultAction:{onPress:()=>c(Zo),title:a("Keep this section's own built-in size"),icon:i($t,{})}}),children:K({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Ia(){return{_gCellWidth:S("Cell width"),gridSpan:N("Positions",i(Pe,{}),[{label:"Auto",value:""},...Array.from({length:Lt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function D(){let e=null;try{e=X(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Gr({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:s,fallback:c}){const d=D()[s],u=ce(void 0,d,c);return i(I,{children:K({min:e,max:t,step:n,value:ce(o,d,c),readout:!1,ariaLabel:r,notch:u,onChange:l})})}function Mr({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:r=()=>{}}){const l=D()[t],s=ce(void 0,l,n);return i(x,{words:y()?.panel,label:a(e),changed:o,detail:a("{value} on desktop",{value:`${s}px`}),onReset:r})}function Wr(e){return dt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:i(Mr,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>i(Gr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Ea(e){return{type:"custom",render:({value:t,onChange:n})=>i(Ur,{...e,value:t,onChange:n})}}function Kr({label:e,icon:t,options:n,value:o,resolved:r,restWord:l,onChange:s}){const c=n.some(d=>d.value===o);return i(h,{label:a(e),icon:R(t),action:i(x,{words:y()?.panel,label:a(e),changed:c,detail:a("{value} on desktop",{value:a(l)}),onReset:()=>s(void 0)}),children:J({options:n,value:c?o:r,onChange:d=>s(d),ariaLabel:e})})}function Ur({label:e,icon:t,options:n,desktopKey:o,resolve:r,value:l,onChange:s}){const c=D()[o],d=r(void 0,c),u=n.find(f=>f.value===d)?.label??"";return i(Kr,{label:e,icon:t,options:n,value:l,resolved:d,restWord:u,onChange:s})}const jr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Xr={Top:Be,Bottom:Ne,Left:Fe,Right:Ae},$r=e=>{const t=Xr[e];return i(t,{})};function Ta(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=_=>jr[_],l=_=>U(r("Top"),i(Be,{}),T.min,T.max,T.step,_,"px"),s=(_,Z,v,le=T)=>g("mobile",Wr({label:r(_),icon:$r(_),desktopKey:Z,min:le.min,max:le.max,step:le.step,fallback:v})),c=e.top??T.min,d=e.bottom??T.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??T,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,P=_=>C?g("desktop",_):_;return W({...o?{_gSpacing:S("Padding")}:{},[t]:P(l(c)),...C?{[M(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:P(U(r("Bottom"),i(Ne,{}),T.min,T.max,T.step,d,"px")),...C?{[M(n)]:s("Bottom",n,d)}:{}},...e.sides?{[u]:P(U(r("Left"),i(Fe,{}),p.min,p.max,p.step,m,"px")),...C?{[M(u)]:s("Left",u,b,p)}:{},[f]:P(U(r("Right"),i(Ae,{}),p.min,p.max,p.step,m,"px")),...C?{[M(f)]:s("Right",f,b,p)}:{}}:{}})}const q=["top","right","bottom","left"],zr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},bt=e=>typeof e=="number"?e:null;function Vr(e,t,n){const o={};for(const r of q)n[r]!==t[r]&&(o[e[r]]=n[r]??void 0);return o}function Yr({tier:e,o:t}){const n=V(),o=n?.values??{},r=e==="mobile"?t.phoneKeys:t.keys,l=Object.fromEntries(q.map(u=>[u,bt(o[r[u]])])),s=Object.fromEntries(q.map(u=>[u,String(e==="mobile"?bt(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[c,d]=j(()=>Rn(l,s));return i(h,{label:a("Padding"),icon:i(sn,{}),action:i(Ke,{each:c,label:a("Each side"),onChange:d}),children:i(On,{label:a("Padding"),each:c,value:l,placeholder:s,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=Vr(r,l,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:a("Padding top"),right:a("Padding right"),bottom:a("Padding bottom"),left:a("Padding left")},vertical:a("Top and bottom"),horizontal:a("Left and right"),unit:"px"}})})}function wa(e={}){const t={...zr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(q.map(c=>[c,M(t[c])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,r=c=>{const d={type:"custom",render:()=>i(Yr,{tier:c,o:n})};return o?g(c,d):d},l=()=>z({type:"custom",render:()=>i(te,{})},"always"),s=q.filter(c=>c!=="top");return W({...e.group===!1?{}:{_gSpacing:S("Padding")},[n.keys.top]:r("desktop"),...o?{[n.phoneKeys.top]:r("mobile")}:{},...Object.fromEntries(s.map(c=>[n.keys[c],{...l(),reachedBy:n.keys.top}])),...o?Object.fromEntries(s.map(c=>[n.phoneKeys[c],g("mobile",l())])):{}})}function Oa(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,s])=>[l,l in e&&ee(s)?e[l]:s])),o={};let r=!1;for(const[l,s]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=s}return r||Object.assign(o,n),o}const yt=e=>typeof e=="number"?e:null;function qr(e,t,n){const o={};for(const r of["x","y"])n[r]!==t[r]&&(o[e[r]]=n[r]??void 0);return o}function Jr({o:e}){const t=V(),n=t?.values??{},o={x:yt(n[e.keys.x]),y:yt(n[e.keys.y])},r=a(e.label??"Position"),l=!!(o.x||o.y),s=u=>{const f=qr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},c=i(Xn,{label:r,value:o,onChange:s,words:{x:a("Left and right"),y:a("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=i(x,{words:y()?.panel,label:r,changed:l,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return e.label===null?O("div",{className:"sf-position-line",children:[c,d]}):i(h,{label:r,icon:i(an,{}),changed:l,action:d,children:c})}function Ra(e){return{[e.keys.x]:{type:"custom",render:()=>i(Jr,{o:e})},[e.keys.y]:{...z({type:"custom",render:()=>i(te,{})},"always"),reachedBy:e.keys.x}}}const Zr={contained:"Contained",page:"Page",full:"Full"},ie="Width";function Pa(e,t=tr,n=!0){const o=t.map(r=>({label:nr[r]??Zr[r],value:r}));return W({...n?{_gWidth:S(ie)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(h,{label:a(ie),icon:i(hn,{}),action:n?i(mr,{inherited:l?.inherited??!1,onReset:()=>r(or),label:ie}):void 0,children:J({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:ie})})}})}function va(){const e=o=>({type:"custom",render:({value:r,onChange:l})=>i(h,{label:Y,icon:R(i(on,{})),action:o?o(l):void 0,children:J({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:l,ariaLabel:Y})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:l})=>{const s=l?.unit==="%"?"%":"px",c=s==="%"?Io:_o;return i("div",{className:"sf-field",children:K({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:s,ariaLabel:Y,onChange:r})})}}),n=()=>ge("Unit",i(ke,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return W({_gHeight:S(Y),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>i(Qr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Qr({onClear:e}){const t=D(),n=yo(t),o=xo(t),r=a("{value} on desktop",{value:o.mode==="auto"?a("Auto"):`${o.value}${o.unit}`});return i(x,{words:y()?.panel,label:a(Y),changed:n,detail:r,onReset:e})}function La(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:l,name:s})=>i(ei,{value:o,onChange:r,labelId:`${l??s??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:K({min:ne.min,max:ne.max,step:ne.step,value:typeof n=="number"?n:ne.fallback,suffix:"px",ariaLabel:a("Distance from top"),onChange:o})})});return{_gStick:S(de),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function ei({value:e,onChange:t,labelId:n,phone:o}){const r=D(),l=Co(r),s=o?l.phone:e===!0;return i(h,{label:a(de),labelId:n,icon:R(i(un,{})),action:O(I,{children:[o?i(x,{words:y()?.panel,label:a(de),changed:So(r),detail:a("{value} on desktop",{value:l.desktop?`${l.desktopDistance}px`:a("Off")}),onReset:()=>t(void 0)}):null,i(Ue,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const xt="e.g. about";function ka(){return{_gAnchor:S("Anchor"),anchor:B({control:"plainText",label:"Name",placeholder:xt},{type:"custom",render:({value:e,onChange:t})=>i(Gt,{value:e,onChange:t,nameBox:(n,o)=>i(A,{value:n,onChange:o,label:"Name",placeholder:xt,hideable:!1,markup:!1})})})}}function Na(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(h,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(Un,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:u=>r(u?u.toISOString():"")})})}}}function H(e,t,n){return{type:"custom",...w({},{...oe,label:e}),render:({value:o,onChange:r,id:l,name:s})=>{const c=typeof o=="boolean"?o:t,d=`${l??s??e}-label`;return i(h,{label:a(e),labelId:d,icon:n,action:i(Ue,{checked:c,onChange:r,ariaLabelledBy:d})})}}}function Fa(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i($e,{label:a("Background"),icon:i(De,{}),id:r,value:bn(e),onChange:t})}}}function Aa(e,t){return{type:"custom",...w({},{...oe,label:e}),render:({value:n,onChange:o,id:r})=>{const l=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(h,{label:a(e),htmlFor:s,className:"sf-checkbox",action:i(Wn,{id:s,checked:l,onChange:o})})}}}const Ba={follows:"fill"},Da={follows:"ink"};function Ha(e,t,n,o){if(typeof t!="string"){const r=t.follows;return{type:"custom",render:({value:l,onChange:s})=>i(ti,{label:e,part:r,icon:n,value:l,onChange:s,opacity:o})}}return{type:"custom",render:({value:r,onChange:l})=>i($e,{label:a(e),icon:n,value:r||t,onChange:l})}}function ti({label:e,part:t,icon:n,value:o,onChange:r,opacity:l}){const s=tt(L().theme),c=t==="fill"?s.fill:s.ink,[d,u]=k(l?.key??""),[f]=k(l?.unsetFrom??""),p=typeof d=="number";return i(zn,{label:a(e),icon:n,value:o||"",inherited:c,resetTo:F(c.toUpperCase(),a("Styles")),onChange:r,onReset:()=>{r(""),l&&p&&u(void 0)},...l?{opacity:p?d:l.unset(f),onOpacityChange:m=>u(m),changed:!!o||p}:{}})}const ni=[{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 St({label:e,value:t,onChange:n,points:o=ni}){const r=o.map(l=>({...l,label:a(l.label),...l.title?{title:a(l.title)}:null}));return i(Mn,{label:a(e),value:t,points:r,onChange:n})}function Ga(){return z({type:"custom",render:()=>i(te,{})},"always")}const oi=Oe([]);function Ma(e,{stacking:t,fallback:n=Bt}){return{type:"custom",render:({value:o,onChange:r})=>{const l=At.includes(o)?o:n;return t?i(ri,{label:e,value:l,onChange:r}):Ct({label:e,value:l,onChange:r,points:oi})}}}function ri({label:e,value:t,onChange:n}){const{appState:o,selectedItem:r}=X(c=>c),l=r?.props?.id?String(r.props.id):void 0,s=l?Ft(o?.data,l):[];return Ct({label:e,value:t,onChange:n,points:Oe(s,l)})}function Ct({label:e,value:t,onChange:n,points:o}){const r=o.find(l=>l.disabled);return i(h,{label:a(e),icon:i(cn,{}),hint:r?.title?a(r.title):void 0,children:St({label:e,value:Dt(t),onChange:n,points:o})})}const Wa={top:i(Zt,{}),right:i(Jt,{}),bottom:i(Yt,{}),left:i(qt,{})};function Ka(e,t,n,o,r,l){const s=f=>t.find(p=>p.value===f),c=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return c(`missing-${f}`);const m=l?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return i(h,{label:a(e),icon:r,value:s(m)?.label?a(s(m).label):"",children:St({label:e,value:m,onChange:p,points:u})})}}}const ii="\0note";function N(e,t,n,o,r){return{type:"custom",options:n,fallback:o,...r?{note:r}:{},...w({},{type:"select",label:e}),render:({value:l,onChange:s,field:c})=>{const d=c.options??n,u=c.fallback??o,f=d.some(p=>p.value===l)?l:u;return i(h,{label:a(e),icon:R(t),children:i(Ln,{value:f,ariaLabel:a(e),onChange:s,options:[...r?[{label:a(r),value:ii,disabled:!0}]:[],...d.map(p=>({label:a(p.label),value:p.value}))]})})}}}function Ua(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(lo,{label:e,options:(l.options??t).map(s=>({...s,label:a(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function ja(e,t,n,o){return{type:"custom",options:t,fallback:n,...w({},{type:"select",label:e}),render:({value:r,onChange:l,field:s})=>i(so,{label:e,options:(s.options??t).map(c=>({...c,label:a(c.label)})),fallback:s.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:a(o)})}}function Xa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}function J({options:e,value:t,onChange:n,ariaLabel:o,disabled:r=!1}){return i(wn,{options:e.map(l=>l.picture?{id:l.value,label:l.picture,title:a(l.title??l.label)}:{id:l.value,label:a(l.label),title:l.title===void 0?void 0:a(l.title)}),value:t,onChange:n,ariaLabel:a(o),disabled:r})}const $a=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ge(e,t,n,o){const r=n.map(l=>typeof l=="string"?{label:l,value:l}:l);return{type:"custom",...w({},{type:"radio",label:e,options:r.map(l=>({value:l.value,label:l.label}))}),render:({value:l,onChange:s,field:c})=>i(h,{label:a(e),icon:R(t),children:J({options:r,value:r.some(d=>d.value===l)?l:l||c?.currentValue||o,onChange:s,ariaLabel:e})})}}function za(e,t,n){const o=Object.keys(xe).map(r=>({label:xe[r],value:r,picture:n[r]}));return{type:"custom",...w({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(li,{label:e,icon:t,options:o,onChange:r})}}function li({label:e,icon:t,options:n,onChange:o}){const r=V()?.values??{},l=Et(r),s=l==="frame"&&!!ye(r.mediaVideo)&&!ye(r.videoFrame);return i(h,{label:a(e),icon:R(t),hint:s?a("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:J({options:n,value:l,onChange:o,ariaLabel:e})})}function Va(e,t,n,o={}){return{type:"custom",[Ie]:!0,render:({value:r,onChange:l,name:s})=>i(io,{value:r||"",onChange:l,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const Ya={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function qa({value:e,onChange:t,label:n}){const o=e||{},r=!!o.pending,l=r?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",s=!!sr(ar()).geocode,c=(d,u)=>t({...o,[d]:u===""?void 0:Number(u)});return O(h,{label:a(n),icon:i(se,{}),children:[s&&O(I,{children:[i("button",{type:"button",disabled:r,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:r?"default":"pointer",opacity:r?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:r?a("Finding…"):a("Find coordinates")}),o.status&&i("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:l},children:a(o.status)}),i("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:a("Coordinates from OpenStreetMap")})]}),i("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?a("Hide manual coordinates"):a("Enter coordinates manually")}),o.manual&&O("div",{style:{marginTop:8,display:"grid",gap:8},children:[i(h,{label:a("Latitude"),icon:i(se,{}),children:i("input",{type:"number",step:"any",placeholder:a("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:d=>c("lat",d.target.value)})}),i(h,{label:a("Longitude"),icon:i(se,{}),children:i("input",{type:"number",step:"any",placeholder:a("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:d=>c("lng",d.target.value)})})]})]})}function ai(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function si(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function Ja(e,t){return e===null?null:t>e?e:null}function ci(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 Za={label:"Ticker items",icon:i(ln,{})};function Qa(e,t,n,o){return{type:"custom",[E]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...w({},{...it.textList,label:e}),render:({value:r,onChange:l})=>i(di,{label:e,icon:R(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function di({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const s=ae(null),[c,d]=j(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=ci(n,p,c);m===null&&(s.current=null),d(m),r(u(p))};return i(kn,{label:a(e),icon:t,noun:a("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(ze,{target:s,value:ai(n,c),onChange:p=>r(si(n,c??-1,p)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,m,b)=>i("input",{type:"text",className:l&&c===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{s.current=C.currentTarget,d(m)}})})}function es(e,t){const n=`${e.label} — row ${t+1}`;return B({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:a("{label} — row {n}",{label:a(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function ts(e){return{_gCards:S("Cards"),coverIndex:N("Cover image",i(rn,{}),no,String(oo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:_r("Image background",Mo),cardImage:pi(),spinOnHover:H("Rotate on hover",e?.spinDefault??!0,i(pn,{}))}}function ns(){return{outline:N("Card outline",i(fn,{}),Qn,to),indexBadge:N("Card number",i(ke,{}),Zn,eo),showBadge:H("Product badge",!0,i(He,{noun:"tag"}))}}function os(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:S("Show on a card"),showCardPrice:H("Price",!0,i(Qt,{})),showCardFinishes:H("Finish swatches",!0,i(en,{})),showCardSizes:H("Sizes",n.showCardSizes,i(dn,{})),showCardBuy:H("Buy button",n.showCardBuy,i(zt,{})),showCardPage:H("Page button",n.showCardPage,i(De,{}))}}function rs(e,t="display"){const n=M(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:r})=>i(_t,{parts:e,changed:Fn(o),shown:l=>An(o,l),onPress:(l,s)=>r(Hn(o,l,s)),onReset:()=>r(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:r})=>i(ui,{parts:e,desktopKey:t,value:o,onChange:r})})}}function _t({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l}){const s=a("Display");return i(h,{label:s,icon:i(Kt,{}),changed:t,action:i(x,{words:y()?.panel,label:s,changed:t,detail:l,onReset:r}),children:i(Nn,{label:s,items:e.map(c=>({id:c.id,label:a(c.label),shown:n(c.id)})),onChange:o})})}function ui({parts:e,desktopKey:t,value:n,onChange:o}){const r=D()[t];return i(_t,{parts:e,changed:Dn(n),shown:l=>Bn(r,n,l),onPress:(l,s)=>o(Gn(n,l,s)),onReset:()=>o(qn),detail:a("the same as Desktop")})}function pi(){return dt("Card image",{min:G,max:Te,step:Rt,hint:"Rounds the picture. The card's own corner is in Styles."})}function is(){return me({sidesKey:"cornerSides",step:Pt,useFollowed:()=>G,mark:i(fi,{label:vt}),hint:a("Rounds the picture. Left alone it stays square.")})}function fi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(x,{words:y()?.panel,label:a(e),changed:t,onReset:n})}function ls(){return{type:"custom",render:({value:e,onChange:t})=>i(mi,{value:typeof e=="string"?e:"",onChange:t})}}function mi({value:e,onChange:t}){const[n,o]=j(null),r=we.filter(s=>n===null||$[s].across===n),l=e&&e in $?$[e]:null;return O(I,{children:[i(h,{label:a("Photos in a row"),icon:i(ve,{}),children:O("div",{className:"sf-gallery-filter",children:[i("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:a("All")}),kt.map(s=>i("button",{type:"button","aria-pressed":n===s,onClick:()=>o(s),children:s},s))]})}),i(h,{label:a("Layout"),icon:i(tn,{}),value:l?a(l.label):a("Not chosen"),hint:a("{n} of {total} layouts",{n:r.length,total:we.length}),children:i(je,{className:"sf-gallery-layouts",label:a("Layout"),value:e,onChange:t,onClear:()=>t(""),options:r.map(s=>({value:s,label:a($[s].label),picture:i("span",{className:"sf-gallery-pic",children:Nt($[s]).map(([c,d],u)=>i("i",{style:{gridColumn:`span ${c}`,gridRow:`span ${d}`}},u))})}))})})]})}export{gr as BOUND_TO_POST,Ml as BOUND_TO_POST_NOTE,Vl as BUCKET_ICONS,Ya as CUSTOM_FIELD_MEDIA,qa as CoordsField,Wa as EDGE_ARROWS,jn as FOCAL_DEFAULT,ni as FOCAL_POINTS,Q as FOLD_FIELD_MARKER,Ba as FOLLOWS_SITE_BUTTON,Da as FOLLOWS_SITE_BUTTON_INK,St as FocalPicker,ra as GroupLabel,br as HIGHLIGHT_HINT,A as HidableTextField,_e as LINK_FIELD_MARKER,kl as Label,Ie as MEDIA_FIELD_MARKER,$a as MEDIA_TYPE_OPTIONS,Wl as NOT_BOUND_TO_POST,oa as PanelBand,Sr as PanelNoteLine,Ur as PhoneChoiceRow,Kr as PhoneChoiceStrip,Ct as PlacementGridView,Ee as SCAFFOLD_FIELD_MARKER,ds as SCALAR_TEXT_CONTROLS,pt as SECTION_BLEEDS_HINT,zr as SIDE_PAD_KEYS,J as Segmented,fr as SiteGapDefaultReset,K as Slider,ct as Swatches,cs as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,Za as TICKER_ITEMS_ROW,di as TextListField,mr as WidthDefaultReset,ci as aimAfterListChange,ka as anchorFields,F as backTo,ia as backgroundField,ga as boxAlignField,xa as boxBlockSpacingField,ha as boxJustifyField,Sa as boxPhoneRowField,ya as boxShareField,ba as boxWrapField,Ql as bucketHeader,ua as buttonBorderField,da as buttonWordsEntryField,Br as cardCornersField,_r as cardImageBackgroundField,pi as cardImageField,ts as cardMediaFields,ma as cardShapeFields,os as cardShowFields,ns as cardStyleFields,Ia as cellWidthFields,Aa as checkbox,Ha as colorInput,Xl as copyText,ut as cornerSidesField,me as cornersRowField,Na as dateTime,ea as designGroupHeader,Ca as directionField,rs as displayFields,Ka as edgePad,Yl as entriesHiddenForTab,Ja as focusAfterRemove,Ga as focusKeptField,ta as foldMarker,ee as foldMetaOf,Cr as foldTitleOf,ls as galleryLayoutField,aa as gapField,S as group,va as heightFields,Ce as hidableText,xr as hintIsWhileTyping,R as iconOf,is as imageCornersField,Gl as inOwnBox,Zl as isBucketHeader,dr as isNoGlyph,$l as linkField,za as loadingShowsField,Ua as multiSelect,cr as noGlyph,Fa as pageBackgroundField,ql as panelNote,Ea as phoneChoiceField,Wr as phoneOverrideField,Ma as placementField,jl as plainText,zl as plainTextarea,Ra as positionFields,qr as positionPatch,dt as pxField,na as quietMarker,Se as readHidable,ai as rowText,ja as searchSelect,Jl as section,pa as sectionAnimationFields,ht as sectionBorderField,wr as sectionCornersField,ca as sectionShapeFields,la as sectionThemeFields,ge as segmented,N as select,si as setRowText,W as sharedStyleKinds,wa as sidesPaddingFields,Vr as sidesPaddingPatch,_a as sizeField,U as slider,Xa as sourceField,Ta as spacingFields,La as stickFields,Oa as swapPadding,fa as templateField,Kl as text,Tt as textFieldIdentifier,Al as textFieldOffPage,Dl as textFieldPanelOnly,Qa as textList,es as textListRowField,Ul as textarea,H as toggle,Va as upload,ur as usePageWidthDetail,sa as useSelectedPatch,D as useSelectedProps,k as useSelectedSibling,pr as useSiteGapDetail,Pa as widthField,Hl as withIdentifier,Fl as withOffPage,Bl as withPanelOnly,Nl as withScaffold};
|
|
1
|
+
"use client";import{jsx as i,jsxs as O,Fragment as I}from"react/jsx-runtime";import{cloneElement as be,useId as It,useRef as ae,useState as j}from"react";import{useEasel as X}from"efficient-easel/easel";import{toDateKey as Et,fromDateKey as Tt}from"efficient-shell/format";import{say as a,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{mediaValueSrc as ye}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as xe,loadingShowsOf as wt}from"../../../format/lib/hero-video.js";import{readHidable as Se,hidableText as Ce}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Q,LINK_FIELD_MARKER as _e,MEDIA_FIELD_MARKER as Ie,SCAFFOLD_FIELD_MARKER as Ee,TEXT_FIELD_MARKER as E,foldMetaOf as ee,textFieldIdentifier as Ot}from"efficient-easel/draw";import Rt from"../../components/ApplyCornersToSiblings.js";import Pt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as vt,CORNER_RADIUS_MAX as Te,CORNER_RADIUS_MIN as G}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as kt,IMAGE_CORNERS_LABEL as Lt}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Nt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Ft,GALLERY_LAYOUTS as $,GALLERY_LAYOUT_KEYS as we,galleryPictureCells as At}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as Dt,HERO_GROUP_PLACEMENTS as Bt,HERO_GROUP_PLACEMENT_DEFAULT as Ht,normalisePlacement as Gt,placementPoints as Oe}from"../../../format/lib/hero-group-placement.js";import Mt from"../../components/KeepHint.js";import Kt from"../../components/AnchorField.js";import{AdjustIcon as Wt,AlignLeftIcon as Ut,EyeIcon as jt,AlignSeparateIcon as Xt,AnimationIcon as Re,BackgroundIcon as $t,BorderAllIcon as zt,BlockSectionIcon as Vt,CartIcon as Yt,ColumnWidthsIcon as Pe,ColumnsIcon as ve,CornerIcon as qt,DirectionDownIcon as Jt,DirectionLeftIcon as Zt,DirectionRightIcon as Qt,DirectionUpIcon as en,DollarIcon as tn,FinishIcon as nn,GapIcon as ke,GridIcon as on,GroundIcon as rn,HashIcon as Le,HeightIcon as ln,ImageIcon as an,ListIcon as sn,LocationIcon as se,NudgeIcon as cn,PaddingAllIcon as dn,PaddingBottomIcon as Ne,PaddingLeftIcon as Fe,PaddingRightIcon as Ae,PaddingTopIcon as De,PageIcon as Be,PlacementIcon as un,ProductSizeIcon as pn,StickyIcon as fn,RotateIcon as mn,SquareIcon as hn,TypeIcon as gn,WidthIcon as bn,WrapIcon as yn}from"efficient-easel/icons";import{FieldGlyph as He}from"../../components/FieldGlyph.js";import{resolvePageBackground as xn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Ge,CORNER_SIDE_POINTS as Sn,hasOwnSectionCorners as Cn,normalizeCornerSides as Me}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as _n,SECTION_MOTION_OPTIONS as In}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Ke}from"./enclosing-section.js";import{SettingsDefaultReset as x,SettingsDrill as En,SettingsField as h,SettingsGroup as Tn,SettingsGroupSub as wn,SettingsBorder as On,SettingsSegmented as Rn,SettingsSides as Pn,SettingsSidesEach as We,sidesStartEach as vn,SettingsSwitch as Ue,borderSides as kn,borderStartEach as Ln}from"efficient-easel/panel";import{FieldSelect as Nn,ListField as Fn}from"efficient-easel/fields";import{DisplayChips as An}from"efficient-shell/ui";import{desktopDisplayChanged as Dn,partShownOnDesktop as Bn,partShownOnPhone as Hn,phoneDisplayChanged as Gn,withDesktopPart as Mn,withPhonePart as Kn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Wn,Checkbox as Un,CornersInput as jn,DatePicker as Xn,DateTimePicker as $n,FOCAL_DEFAULT as zn,PictureTiles as je,PositionInput as Vn,Slider as Yn,Tooltip as Xe}from"efficient-shell/ui";import{ColourRow as $e,InheritedColourRow as qn}from"./ColourControl.js";import ze from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Jn,NoControlMark as te,noControlField as z}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Zn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Qn,resolvePhoneValue as ce}from"../../../format/lib/document/phone-override.js";import{phoneKey as M}from"efficient-easel/draw";import{SuppressibleText as eo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as to,CARD_OUTLINE_OPTIONS as no,DEFAULT_CARD_INDEX_FORMAT as oo,DEFAULT_CARD_OUTLINE as ro}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as io,DEFAULT_COVER_INDEX as lo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as ao}from"efficient-easel/draw";import so from"../../components/MediaUploadField.js";import{useSelectedHost as V}from"./selected-host.js";import co from"../../components/MultiSelectField.js";import uo from"../../components/SectionThemePicker.js";import po from"../../components/SearchSelectField.js";import fo from"../../components/StorefrontLinkField.js";import{UiIcon as Ve}from"efficient-easel/draw/client";import{SECTION_PADDING as T}from"../../../render/lib/content/section-padding.js";import{buttonLook as mo,buttonWordsSummary as ho}from"../../../render/lib/content/button-look.js";import{nonEmptyString as go}from"../../../format/lib/non-empty-string.js";import{usePreviewParts as bo}from"efficient-easel/draw/client";import{encodePartId as yo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as xo,useEaselStrings as So}from"efficient-easel/strings";import{hasPhoneHeight as Co,resolveSectionMinHeight as _o}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ne,SECTION_STICK_LABEL as de,hasPhoneStick as Io,resolveSectionStick as Eo}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as To,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as wo}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as Oo,containerDirectionPoints as Ro,resolveContainerDirection as Ye}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as Po,BOX_BLOCK_SPACING_LABEL as vo,BOX_BLOCK_SPACING_POINTS as qe,BOX_JUSTIFY_POINTS as Je,BOX_PHONE_ROW_LABEL as ko,BOX_PHONE_ROW_MAX as Lo,BOX_PHONE_ROW_MIN as Ze,BOX_SHARE_LABEL as Qe,BOX_SHARE_POINTS as ue,BOX_WRAP_LABEL as No,BOX_WRAP_POINTS as et}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as k}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Fo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Ao,normalizeTheme as Do,selectedThemeColors as Bo,siteButtonPaint as tt}from"../../../format/lib/theme.js";import{CONTAINER_GAP as pe,CONTAINER_GAP_BUILT_IN as Ho,GAP_FIELD_CONTAINER as Go,hasOwnContainerGap as Mo,resolveContainerGap as Ko}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Wo,CARD_IMAGE_BG_OFF as Uo,CARD_IMAGE_BG_SWATCH_NAMES as jo,CARD_IMAGE_BG_SWATCHES as Xo,isCardImageBackgroundInheriting as $o,cardImageBackgroundChoice as zo,THEME_CARD_IMAGE_BG as Vo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Yo,SECTION_BG_SWATCHES as qo,SECTION_BG_SWATCH_NAMES as Jo,THEME_SECTION_BG as Zo,isSectionBackgroundInheriting as Qo}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as er}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as tr,TYPE_SIZE_INHERIT as nr,isTypeSizeInheriting as or}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as rr,WIDTH_CHOICE_LABEL as ir,WIDTH_INHERIT as lr,resolveWidth as ar,sectionRunsFullWidth as nt}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as sr}from"./panel-heading-scope.js";import{withStyleKind as cr}from"efficient-easel/style-clipboard";import{useEaselSession as dr}from"efficient-easel/screen/lib/session-context";import{backendOf as ur}from"../website-session.js";import{describedAs as w}from"../../../format/lib/host-document-bridge.js";function K(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!ee(n)&&cr(n,`section:${t}`);return e}function Dl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function ot(){return null}function pr(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return i(ot,{},e)}function fr(e){return e.type===ot}function R(e){return fr(e)?void 0:e}function F(e,t){return a("{value} from {from}",{value:e,from:t})}function mr(){const{appState:e}=X(r=>r),t=e.data.root?.props??{},{mode:n,pageWidth:o}=ar(t,"full");return n==="page"?F(`${o}px`,a("the page")):n==="contained"?F(a("Contained"),a("the page")):F(a("Full"),a("the page"))}function hr(){const{blockGap:e}=k();return e===null?a("this container's own spacing"):F(`${e}px`,a("Styles"))}function gr({inherited:e,onReset:t,label:n}){return i(x,{words:y()?.panel,label:a(n),changed:!e,detail:hr(),onReset:t})}function br({inherited:e,onReset:t,label:n}){return i(x,{words:y()?.panel,label:a(n),changed:!e,detail:mr(),onReset:t})}function A({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:s=!0,markup:c=!0}){const{text:d,hidden:u}=Se(e),f=ae(null),p=ae(null),m=v=>t(s?{text:v,hidden:u}:v),b=()=>t({text:d,hidden:!u}),C=s&&u,P=It(),_=r?_r(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:a(r)}):i(Mt,{children:a(r)}):void 0,Z=u?a("Show {label} on the slide",{label:a(n)}):a("Hide {label} on the slide",{label:a(n)});return i(h,{label:a(n),icon:i(gn,{}),htmlFor:P,className:C?"is-hidden":void 0,hint:_,action:s?i(Xe,{content:Z,children:i("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":Z,onClick:b,children:u?i(Ve,{name:"eye-off",size:14}):i(Ve,{name:"eye",size:14})})}):void 0,children:O("div",{className:"sf-copybox",children:[c&&i(ze,{target:l?p:f,value:d,onChange:m}),l?i("textarea",{id:P,ref:p,value:d,placeholder:o===void 0?void 0:a(o),onChange:v=>m(v.target.value)}):i("input",{id:P,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:a(o),onChange:v=>m(v.target.value)})]})})}function Bl(e,t){return{...e,[Ee]:t}}function Hl(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function Gl(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}const rt="sfPanelOnly";function Ml(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[rt]:!0}}function Kl(e){return!!e&&typeof e=="object"&&e[rt]===!0}function Wl(e){const t=e[E];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[E]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as ms,SCALAR_TEXT_CONTROLS as hs}from"efficient-easel/draw";function Ul(e,t){if(!e[E])throw new Error("inOwnBox: the field holds no authored text");const{[Jn]:o,...r}=e;return{...r,[Zn]:!0,render:t}}const yr=new Set(ao),oe={type:"radio",options:[{value:!0},{value:!1}]},it={text:{type:"object",objectFields:{text:{type:"text"},hidden:oe}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:oe}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},D=(e,t)=>{const n=w({...t,[E]:e},{...it[e.control],label:e.label});if(!yr.has(e.control))return n;const o=t.render;return{...z(n,"authored-copy"),render:r=>i(eo,{name:r.name,children:o(r)})}},jl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",xr={field:"source.slug",set:!0},Xl={not:xr},Sr="Select a word, then press the highlighter.",Cr=new Set([Sr]),_r=e=>Cr.has(e);function $l(e,t,n){return D({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function zl(e,t,n){return D({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Vl(e,t,n){return D({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Yl(e,t,n){return D({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function ql(e){return{type:"custom",[_e]:{label:e},...w({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(fo,{value:Ce(t),onChange:n,label:e})}}function Jl(e,t,n){return D({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Zl={Design:Wt,Animation:Re};function Ql(e,t){return e.includes("Design")?t!=="Design":null}function lt(e,t){return{type:"custom",[Q]:{label:e,level:t},marker:!0,fold:e,render:()=>i(I,{})}}function S(e){return lt(e,2)}function ea(e){return{type:"custom",render:()=>i(Ir,{text:e})}}function Ir({text:e}){return i("p",{className:"sf-note",children:a(e)})}function ta(e){return lt(e,1)}function na(e){return ee(e)!==null&&e?.tabs!==void 0}const at=new Map;function oa(e,t){const n=`${e}\0${t?t.join(""):""}`,o=at.get(n)??{type:"custom",tabs:t,[Q]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(I,{})};return at.set(n,o),o}const st=new Map;function ra(e){const t=st.get(e)??{type:"custom",[Q]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(I,{})};return st.set(e,t),t}function Er(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ia(e,t){return Er(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(I,{})}}function la(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(I,{})}}function aa({title:e,children:t}){const[n,o]=j(()=>!fe.has(e));return i(Tn,{title:e,open:n,onToggle:r=>{o(r),r?fe.delete(e):fe.add(e)},children:t})}const fe=new Set;function sa({label:e}){return i(wn,{title:a(e),level:sr(2)})}function ct({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,s=l?a(l):t;return O("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?a(o[c]):c;return i(Xe,{content:d,children:i("button",{type:"button","aria-pressed":t.toLowerCase()===c.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===c.toLowerCase()?"is-active":""}`,style:{background:c},onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function ca(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=Qo(n,t);return i(h,{label:a(e),icon:i($t,{}),changed:!r,action:i(x,{words:y()?.panel,label:a(e),changed:!r,detail:a("the theme's section background"),onReset:()=>o(Yo)}),children:ct({swatches:qo,current:r?Zo:n??t??"",onPick:o,names:Jo})})}}}function Tr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=$o(r,t);return i(h,{label:a(e),icon:i(rn,{}),changed:!l,action:i(x,{words:y()?.panel,label:a(e),changed:!l,detail:a("the theme's image stage"),onReset:()=>o(Wo)}),children:ct({swatches:Xo,current:l?Vo:zo(r,t),onPick:o,names:jo})})}}}function da(e=n=>n,t){return K({_gSectionTheme:S(er),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(uo,{value:e(n),onChange:o,followLabel:t})}})}function W({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:s=!0,notch:c,ariaLabel:d,disabled:u=!1}){const f=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Yn,{min:e,max:t,step:n,value:o,suffix:l||void 0,showInput:s,label:d===void 0?void 0:a(d),disabled:u,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&r(p)}})})}function U(e,t,n,o,r,l,s="",c){return{type:"custom",...w({},{type:"number",label:e}),render:d=>i(h,{label:a(e),icon:R(t),action:c?c("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:W({min:n,max:o,step:r,value:typeof d.value=="number"?d.value:l,suffix:s,ariaLabel:e,onChange:d.onChange})})}}function dt(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:s,restTrack:c,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return i(h,{label:a(e),icon:u?R(u):void 0,value:b?d||l===void 0?void 0:a(l):`${m}px`,changed:!b,action:d?be(d,{changed:!b,onReset:()=>p(null)}):i(x,{words:y()?.panel,label:a(e),changed:!b,onReset:()=>p(null)}),hint:typeof s=="string"?a(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:p}):W({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function ua(e){const t=U("Gap",i(ke,{}),pe.min,pe.max,pe.step,Ho[e],"px",(n,o)=>i(gr,{inherited:!Mo(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[Go]:e,render:n=>t.render({...n,value:Ko(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const re="Corners";function me(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(h,{label:a(re),icon:i(qt,{}),changed:r,action:be(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(wr,{tier:e,px:o,onRadius:n})})}}}function L(e){const t=V();return[t?.values?.[e],n=>t?.onChange(e,n)]}function pa(){const e=V();return t=>e?.onChangeMany(t)}function wr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),r=e.useClosedReason?e.useClosedReason():null,[l,s]=L(e.sidesKey),c=Me(l)??[...Ge];return i(jn,{label:a(re),value:c,corners:Sn,onChange:d=>{const u=Me(d)??[];s(u.length===Ge.length?null:u)},radius:t,onRadiusChange:n,radiusMin:G,radiusMax:Te,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:r!==null,disabledReason:r??void 0})}function ut(){return z({type:"custom",render:()=>i(te,{})},"always")}function Or({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=k(),r=typeof o=="number"?`${o}px`:a("not set");return i(x,{words:y()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):F(r,a("Styles")),onReset:n})}function Rr(){const{cornerRadiusPx:e}=k();return typeof e=="number"?e:G}function Pr(){return me({sidesKey:"sectionCornerSides",useFollowed:Rr,useClosedReason:()=>ft()?a(pt):null,mark:i(Or,{label:re}),hint:i(vr,{})})}const pt="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function ft(){return nt(B())}function vr(){return i(I,{children:ft()?pt:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function fa(){return K({_gShape:S("Shape"),sectionCorners:Pr(),sectionCornerSides:ut(),sectionBorder:ht("desktop"),sectionBorderPhone:ht("mobile")})}const kr=()=>({width:a("Border width"),sides:{top:a("Border top"),right:a("Border right"),bottom:a("Border bottom"),left:a("Border left")},style:a("Border style"),styles:{solid:a("Solid"),dashed:a("Dashed"),dotted:a("Dotted")},color:a("Border color"),unit:"px"});function Lr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Nr(){let e;try{const t=Do(k().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Ao.line}function mt({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[d,u]=j(()=>r?Ln(c,s):!1),f=kr(),p=m=>Lr(r&&l?m:{width:m.width,color:m.color,...l?{style:m.style}:{}});return i(h,{label:a("Border"),icon:i(zt,{}),action:r?i(We,{each:d,label:a("Each side"),onChange:u}):void 0,children:i(On,{label:a("Border"),value:c,each:d,onChange:m=>t(p(m)),placeholder:n,presets:o,words:f,styles:l,max:Fo})})}function Fr({value:e,onChange:t,tier:n}){const[o]=L("sectionBorder"),r=Nr(),l=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(mt,{value:e,onChange:t,placeholder:{sides:kn(l),style:l.style??"solid",color:l.color||r},presets:[r],above:l})}function ht(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>i(Fr,{value:t,onChange:n,tier:e})})}function ma(e){return{type:"custom",render:()=>i(Ar,{partKey:e})}}function Ar({partKey:e}){const[t]=L("id"),[n]=L("_partStyles"),{textStyles:o}=k(),r=So();let l=null;try{l=bo().select}catch{l=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(En,{name:a("Text"),preview:ho(s,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??xo.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(yo(t,e))}})}function ha(){return{type:"custom",render:({value:e,onChange:t})=>i(Dr,{value:e,onChange:t})}}function Dr({value:e,onChange:t}){const[n]=L("variant"),[o]=L("buttonColor"),{theme:r}=k(),s=mo({variant:n,buttonColor:o,buttonBorder:e&&typeof e=="object"?e:{}}).border.width,c=go(o)??(n==="ghost"?Bo(r).text:tt(r).fill);return i(mt,{value:e,onChange:t,placeholder:{sides:{top:s,right:s,bottom:s,left:s},style:"solid",color:c},presets:[c],sides:!1,styles:!1})}function ga(){return{_gMotion:S("Motion"),sectionAnimation:ge("Entrance",i(Re,{}),[...In],_n)}}function he(){let e=null;try{const{appState:t,selectedItem:n}=X(r=>r),o=n?.props?.id?String(n.props.id):void 0;e=o?Ke(t?.data,o):null}catch{e=null}return e!==null&&nt(e)}function gt(e){const{cornerRadiusPx:t}=k(),n=he(),o=typeof t=="number"?t:e;let r=null;try{const{appState:s,selectedItem:c}=X(u=>u),d=c?.props?.id?String(c.props.id):void 0;r=d?Ke(s?.data,d):null}catch{r=null}if(n||!r)return o;const l=r.sectionCorners;return Cn(l)?l:o}function Br({label:e,changed:t=!1,onReset:n=()=>{}}){const o=he(),r=gt(G),l=o?"Site":"Section";return i(x,{words:y()?.panel,label:a(e),changed:t,detail:F(`${r}px`,o?a("Styles"):a("the section")),onReset:n})}function Hr(){return i(I,{children:he()?a("The section is full width, so this card follows Styles ▸ Basics ▸ Corners."):a("Follows the section's Corners until you set a number here.")})}function Gr(){return me({sidesKey:"cardCornerSides",useFollowed:()=>gt(G),mark:i(Br,{label:re}),hint:i(Hr,{})})}function Mr(){return{type:"custom",render:()=>i(Rt,{})}}function ba(e){return{...e,render:t=>i(Pt,{render:e.render,props:t})}}function ya(){return{_gShape:S("Shape"),cardCorners:Gr(),cardCornerSides:ut(),cardCornersApplyAll:Mr()}}function xa(){return N("Justify",i(Xt,{}),Je,Je[0].value)}function Sa(){return N("Item alignment",i(Ut,{}),Po,"stretch")}function Ca(){return N(No,i(yn,{}),et,et[0].value)}function _a(){return{type:"custom",render:({value:e,onChange:t})=>{const n=ue.find(o=>o.value===e)??ue[0];return i(h,{label:a(Qe),icon:i(Pe,{}),value:a(n.label),children:i(je,{className:"sf-gallery-layouts",label:a(Qe),value:n.value,onChange:t,options:ue.map(o=>({value:o.value,label:a(o.label),picture:i("span",{className:"sf-gallery-pic",children:Kr(o.weights).map((r,l)=>i("i",{style:{gridColumn:`span ${r}`}},l))})}))})})}}}function Kr(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 Ia(){return N(vo,i(ke,{}),qe,qe[0].value)}function Ea(){return g("mobile",U(ko,i(ve,{}),Ze,Lo,1,Ze))}function Ta(e){const t=ge(Oo,pr("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),Ro(e),Ye(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Ye(e,n.value),onChange:o=>n.onChange(o)})}}function wa(e,t,n,o,r,l){return{type:"custom",render:({value:s,onChange:c})=>i(h,{label:a(e),icon:i(He,{noun:l}),action:i(x,{words:y()?.panel,label:a(e),changed:!or(s),detail:a("the Text style in Styles"),onReset:()=>c(nr),defaultAction:{onPress:()=>c(tr),title:a("Keep this section's own built-in size"),icon:i(Vt,{})}}),children:W({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Oa(){return{_gCellWidth:S("Cell width"),gridSpan:N("Positions",i(Pe,{}),[{label:"Auto",value:""},...Array.from({length:Nt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function B(){let e=null;try{e=X(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Wr({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:s,fallback:c}){const d=B()[s],u=ce(void 0,d,c);return i(I,{children:W({min:e,max:t,step:n,value:ce(o,d,c),readout:!1,ariaLabel:r,notch:u,onChange:l})})}function Ur({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:r=()=>{}}){const l=B()[t],s=ce(void 0,l,n);return i(x,{words:y()?.panel,label:a(e),changed:o,detail:a("{value} on desktop",{value:`${s}px`}),onReset:r})}function jr(e){return dt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:i(Ur,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>i(Wr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Ra(e){return{type:"custom",render:({value:t,onChange:n})=>i($r,{...e,value:t,onChange:n})}}function Xr({label:e,icon:t,options:n,value:o,resolved:r,restWord:l,onChange:s}){const c=n.some(d=>d.value===o);return i(h,{label:a(e),icon:R(t),action:i(x,{words:y()?.panel,label:a(e),changed:c,detail:a("{value} on desktop",{value:a(l)}),onReset:()=>s(void 0)}),children:J({options:n,value:c?o:r,onChange:d=>s(d),ariaLabel:e})})}function $r({label:e,icon:t,options:n,desktopKey:o,resolve:r,value:l,onChange:s}){const c=B()[o],d=r(void 0,c),u=n.find(f=>f.value===d)?.label??"";return i(Xr,{label:e,icon:t,options:n,value:l,resolved:d,restWord:u,onChange:s})}const zr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Vr={Top:De,Bottom:Ne,Left:Fe,Right:Ae},Yr=e=>{const t=Vr[e];return i(t,{})};function Pa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=_=>zr[_],l=_=>U(r("Top"),i(De,{}),T.min,T.max,T.step,_,"px"),s=(_,Z,v,le=T)=>g("mobile",jr({label:r(_),icon:Yr(_),desktopKey:Z,min:le.min,max:le.max,step:le.step,fallback:v})),c=e.top??T.min,d=e.bottom??T.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??T,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,P=_=>C?g("desktop",_):_;return K({...o?{_gSpacing:S("Padding")}:{},[t]:P(l(c)),...C?{[M(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:P(U(r("Bottom"),i(Ne,{}),T.min,T.max,T.step,d,"px")),...C?{[M(n)]:s("Bottom",n,d)}:{}},...e.sides?{[u]:P(U(r("Left"),i(Fe,{}),p.min,p.max,p.step,m,"px")),...C?{[M(u)]:s("Left",u,b,p)}:{},[f]:P(U(r("Right"),i(Ae,{}),p.min,p.max,p.step,m,"px")),...C?{[M(f)]:s("Right",f,b,p)}:{}}:{}})}const q=["top","right","bottom","left"],qr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},bt=e=>typeof e=="number"?e:null;function Jr(e,t,n){const o={};for(const r of q)n[r]!==t[r]&&(o[e[r]]=n[r]??void 0);return o}function Zr({tier:e,o:t}){const n=V(),o=n?.values??{},r=e==="mobile"?t.phoneKeys:t.keys,l=Object.fromEntries(q.map(u=>[u,bt(o[r[u]])])),s=Object.fromEntries(q.map(u=>[u,String(e==="mobile"?bt(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[c,d]=j(()=>vn(l,s));return i(h,{label:a("Padding"),icon:i(dn,{}),action:i(We,{each:c,label:a("Each side"),onChange:d}),children:i(Pn,{label:a("Padding"),each:c,value:l,placeholder:s,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=Jr(r,l,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:a("Padding top"),right:a("Padding right"),bottom:a("Padding bottom"),left:a("Padding left")},vertical:a("Top and bottom"),horizontal:a("Left and right"),unit:"px"}})})}function va(e={}){const t={...qr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(q.map(c=>[c,M(t[c])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,r=c=>{const d={type:"custom",render:()=>i(Zr,{tier:c,o:n})};return o?g(c,d):d},l=()=>z({type:"custom",render:()=>i(te,{})},"always"),s=q.filter(c=>c!=="top");return K({...e.group===!1?{}:{_gSpacing:S("Padding")},[n.keys.top]:r("desktop"),...o?{[n.phoneKeys.top]:r("mobile")}:{},...Object.fromEntries(s.map(c=>[n.keys[c],{...l(),reachedBy:n.keys.top}])),...o?Object.fromEntries(s.map(c=>[n.phoneKeys[c],g("mobile",l())])):{}})}function ka(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,s])=>[l,l in e&&ee(s)?e[l]:s])),o={};let r=!1;for(const[l,s]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=s}return r||Object.assign(o,n),o}const yt=e=>typeof e=="number"?e:null;function Qr(e,t,n){const o={};for(const r of["x","y"])n[r]!==t[r]&&(o[e[r]]=n[r]??void 0);return o}function ei({o:e}){const t=V(),n=t?.values??{},o={x:yt(n[e.keys.x]),y:yt(n[e.keys.y])},r=a(e.label??"Position"),l=!!(o.x||o.y),s=u=>{const f=Qr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},c=i(Vn,{label:r,value:o,onChange:s,words:{x:a("Left and right"),y:a("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=i(x,{words:y()?.panel,label:r,changed:l,detail:"0 px, 0 px",onReset:()=>s({x:null,y:null})});return e.label===null?O("div",{className:"sf-position-line",children:[c,d]}):i(h,{label:r,icon:i(cn,{}),changed:l,action:d,children:c})}function La(e){return{[e.keys.x]:{type:"custom",render:()=>i(ei,{o:e})},[e.keys.y]:{...z({type:"custom",render:()=>i(te,{})},"always"),reachedBy:e.keys.x}}}const ti={contained:"Contained",page:"Page",full:"Full"},ie="Width";function Na(e,t=rr,n=!0){const o=t.map(r=>({label:ir[r]??ti[r],value:r}));return K({...n?{_gWidth:S(ie)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(h,{label:a(ie),icon:i(bn,{}),action:n?i(br,{inherited:l?.inherited??!1,onReset:()=>r(lr),label:ie}):void 0,children:J({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:ie})})}})}function Fa(){const e=o=>({type:"custom",render:({value:r,onChange:l})=>i(h,{label:Y,icon:R(i(ln,{})),action:o?o(l):void 0,children:J({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:l,ariaLabel:Y})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:l})=>{const s=l?.unit==="%"?"%":"px",c=s==="%"?wo:To;return i("div",{className:"sf-field",children:W({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:s,ariaLabel:Y,onChange:r})})}}),n=()=>ge("Unit",i(Le,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return K({_gHeight:S(Y),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>i(ni,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function ni({onClear:e}){const t=B(),n=Co(t),o=_o(t),r=a("{value} on desktop",{value:o.mode==="auto"?a("Auto"):`${o.value}${o.unit}`});return i(x,{words:y()?.panel,label:a(Y),changed:n,detail:r,onReset:e})}function Aa(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:l,name:s})=>i(oi,{value:o,onChange:r,labelId:`${l??s??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:W({min:ne.min,max:ne.max,step:ne.step,value:typeof n=="number"?n:ne.fallback,suffix:"px",ariaLabel:a("Distance from top"),onChange:o})})});return{_gStick:S(de),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function oi({value:e,onChange:t,labelId:n,phone:o}){const r=B(),l=Eo(r),s=o?l.phone:e===!0;return i(h,{label:a(de),labelId:n,icon:R(i(fn,{})),action:O(I,{children:[o?i(x,{words:y()?.panel,label:a(de),changed:Io(r),detail:a("{value} on desktop",{value:l.desktop?`${l.desktopDistance}px`:a("Off")}),onReset:()=>t(void 0)}):null,i(Ue,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const xt="e.g. about";function Da(){return{_gAnchor:S("Anchor"),anchor:D({control:"plainText",label:"Name",placeholder:xt},{type:"custom",render:({value:e,onChange:t})=>i(Kt,{value:e,onChange:t,nameBox:(n,o)=>i(A,{value:n,onChange:o,label:"Name",placeholder:xt,hideable:!1,markup:!1})})})}}function Ba(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(h,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i($n,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:u=>r(u?u.toISOString():"")})})}}}function Ha(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-date`;return i(h,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(Xn,{id:c,value:Tt(typeof o=="string"?o:null),onChange:d=>r(d?Et(d):"")})})}}}function H(e,t,n){return{type:"custom",...w({},{...oe,label:e}),render:({value:o,onChange:r,id:l,name:s})=>{const c=typeof o=="boolean"?o:t,d=`${l??s??e}-label`;return i(h,{label:a(e),labelId:d,icon:n,action:i(Ue,{checked:c,onChange:r,ariaLabelledBy:d})})}}}function Ga(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i($e,{label:a("Background"),icon:i(Be,{}),id:r,value:xn(e),onChange:t})}}}function Ma(e,t){return{type:"custom",...w({},{...oe,label:e}),render:({value:n,onChange:o,id:r})=>{const l=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(h,{label:a(e),htmlFor:s,className:"sf-checkbox",action:i(Un,{id:s,checked:l,onChange:o})})}}}const Ka={follows:"fill"},Wa={follows:"ink"};function Ua(e,t,n,o){if(typeof t!="string"){const r=t.follows;return{type:"custom",render:({value:l,onChange:s})=>i(ri,{label:e,part:r,icon:n,value:l,onChange:s,opacity:o})}}return{type:"custom",render:({value:r,onChange:l})=>i($e,{label:a(e),icon:n,value:r||t,onChange:l})}}function ri({label:e,part:t,icon:n,value:o,onChange:r,opacity:l}){const s=tt(k().theme),c=t==="fill"?s.fill:s.ink,[d,u]=L(l?.key??""),[f]=L(l?.unsetFrom??""),p=typeof d=="number";return i(qn,{label:a(e),icon:n,value:o||"",inherited:c,resetTo:F(c.toUpperCase(),a("Styles")),onChange:r,onReset:()=>{r(""),l&&p&&u(void 0)},...l?{opacity:p?d:l.unset(f),onOpacityChange:m=>u(m),changed:!!o||p}:{}})}const ii=[{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 St({label:e,value:t,onChange:n,points:o=ii}){const r=o.map(l=>({...l,label:a(l.label),...l.title?{title:a(l.title)}:null}));return i(Wn,{label:a(e),value:t,points:r,onChange:n})}function ja(){return z({type:"custom",render:()=>i(te,{})},"always")}const li=Oe([]);function Xa(e,{stacking:t,fallback:n=Ht}){return{type:"custom",render:({value:o,onChange:r})=>{const l=Bt.includes(o)?o:n;return t?i(ai,{label:e,value:l,onChange:r}):Ct({label:e,value:l,onChange:r,points:li})}}}function ai({label:e,value:t,onChange:n}){const{appState:o,selectedItem:r}=X(c=>c),l=r?.props?.id?String(r.props.id):void 0,s=l?Dt(o?.data,l):[];return Ct({label:e,value:t,onChange:n,points:Oe(s,l)})}function Ct({label:e,value:t,onChange:n,points:o}){const r=o.find(l=>l.disabled);return i(h,{label:a(e),icon:i(un,{}),hint:r?.title?a(r.title):void 0,children:St({label:e,value:Gt(t),onChange:n,points:o})})}const $a={top:i(en,{}),right:i(Qt,{}),bottom:i(Jt,{}),left:i(Zt,{})};function za(e,t,n,o,r,l){const s=f=>t.find(p=>p.value===f),c=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return c(`missing-${f}`);const m=l?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return i(h,{label:a(e),icon:r,value:s(m)?.label?a(s(m).label):"",children:St({label:e,value:m,onChange:p,points:u})})}}}const si="\0note";function N(e,t,n,o,r){return{type:"custom",options:n,fallback:o,...r?{note:r}:{},...w({},{type:"select",label:e}),render:({value:l,onChange:s,field:c})=>{const d=c.options??n,u=c.fallback??o,f=d.some(p=>p.value===l)?l:u;return i(h,{label:a(e),icon:R(t),children:i(Nn,{value:f,ariaLabel:a(e),onChange:s,options:[...r?[{label:a(r),value:si,disabled:!0}]:[],...d.map(p=>({label:a(p.label),value:p.value}))]})})}}}function Va(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(co,{label:e,options:(l.options??t).map(s=>({...s,label:a(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function Ya(e,t,n,o){return{type:"custom",options:t,fallback:n,...w({},{type:"select",label:e}),render:({value:r,onChange:l,field:s})=>i(po,{label:e,options:(s.options??t).map(c=>({...c,label:a(c.label)})),fallback:s.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:a(o)})}}function qa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}function J({options:e,value:t,onChange:n,ariaLabel:o,disabled:r=!1}){return i(Rn,{options:e.map(l=>l.picture?{id:l.value,label:l.picture,title:a(l.title??l.label)}:{id:l.value,label:a(l.label),title:l.title===void 0?void 0:a(l.title)}),value:t,onChange:n,ariaLabel:a(o),disabled:r})}const Ja=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ge(e,t,n,o){const r=n.map(l=>typeof l=="string"?{label:l,value:l}:l);return{type:"custom",...w({},{type:"radio",label:e,options:r.map(l=>({value:l.value,label:l.label}))}),render:({value:l,onChange:s,field:c})=>i(h,{label:a(e),icon:R(t),children:J({options:r,value:r.some(d=>d.value===l)?l:l||c?.currentValue||o,onChange:s,ariaLabel:e})})}}function Za(e,t,n){const o=Object.keys(xe).map(r=>({label:xe[r],value:r,picture:n[r]}));return{type:"custom",...w({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(ci,{label:e,icon:t,options:o,onChange:r})}}function ci({label:e,icon:t,options:n,onChange:o}){const r=V()?.values??{},l=wt(r),s=l==="frame"&&!!ye(r.mediaVideo)&&!ye(r.videoFrame);return i(h,{label:a(e),icon:R(t),hint:s?a("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:J({options:n,value:l,onChange:o,ariaLabel:e})})}function Qa(e,t,n,o={}){return{type:"custom",[Ie]:!0,render:({value:r,onChange:l,name:s})=>i(so,{value:r||"",onChange:l,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const es={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ts({value:e,onChange:t,label:n}){const o=e||{},r=!!o.pending,l=r?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",s=!!ur(dr()).geocode,c=(d,u)=>t({...o,[d]:u===""?void 0:Number(u)});return O(h,{label:a(n),icon:i(se,{}),children:[s&&O(I,{children:[i("button",{type:"button",disabled:r,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:r?"default":"pointer",opacity:r?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:r?a("Finding…"):a("Find coordinates")}),o.status&&i("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:l},children:a(o.status)}),i("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:a("Coordinates from OpenStreetMap")})]}),i("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?a("Hide manual coordinates"):a("Enter coordinates manually")}),o.manual&&O("div",{style:{marginTop:8,display:"grid",gap:8},children:[i(h,{label:a("Latitude"),icon:i(se,{}),children:i("input",{type:"number",step:"any",placeholder:a("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:d=>c("lat",d.target.value)})}),i(h,{label:a("Longitude"),icon:i(se,{}),children:i("input",{type:"number",step:"any",placeholder:a("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:d=>c("lng",d.target.value)})})]})]})}function di(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function ui(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function ns(e,t){return e===null?null:t>e?e:null}function pi(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 os={label:"Ticker items",icon:i(sn,{})};function rs(e,t,n,o){return{type:"custom",[E]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...w({},{...it.textList,label:e}),render:({value:r,onChange:l})=>i(fi,{label:e,icon:R(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function fi({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const s=ae(null),[c,d]=j(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=pi(n,p,c);m===null&&(s.current=null),d(m),r(u(p))};return i(Fn,{label:a(e),icon:t,noun:a("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(ze,{target:s,value:di(n,c),onChange:p=>r(ui(n,c??-1,p)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,m,b)=>i("input",{type:"text",className:l&&c===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{s.current=C.currentTarget,d(m)}})})}function is(e,t){const n=`${e.label} — row ${t+1}`;return D({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:a("{label} — row {n}",{label:a(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function ls(e){return{_gCards:S("Cards"),coverIndex:N("Cover image",i(an,{}),io,String(lo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Tr("Image background",Uo),cardImage:hi(),spinOnHover:H("Rotate on hover",e?.spinDefault??!0,i(mn,{}))}}function as(){return{outline:N("Card outline",i(hn,{}),no,ro),indexBadge:N("Card number",i(Le,{}),to,oo),showBadge:H("Product badge",!0,i(He,{noun:"tag"}))}}function ss(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:S("Show on a card"),showCardPrice:H("Price",!0,i(tn,{})),showCardFinishes:H("Finish swatches",!0,i(nn,{})),showCardSizes:H("Sizes",n.showCardSizes,i(pn,{})),showCardBuy:H("Buy button",n.showCardBuy,i(Yt,{})),showCardPage:H("Page button",n.showCardPage,i(Be,{}))}}function cs(e,t="display"){const n=M(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:r})=>i(_t,{parts:e,changed:Dn(o),shown:l=>Bn(o,l),onPress:(l,s)=>r(Mn(o,l,s)),onReset:()=>r(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:r})=>i(mi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function _t({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l}){const s=a("Display");return i(h,{label:s,icon:i(jt,{}),changed:t,action:i(x,{words:y()?.panel,label:s,changed:t,detail:l,onReset:r}),children:i(An,{label:s,items:e.map(c=>({id:c.id,label:a(c.label),shown:n(c.id)})),onChange:o})})}function mi({parts:e,desktopKey:t,value:n,onChange:o}){const r=B()[t];return i(_t,{parts:e,changed:Gn(n),shown:l=>Hn(r,n,l),onPress:(l,s)=>o(Kn(n,l,s)),onReset:()=>o(Qn),detail:a("the same as Desktop")})}function hi(){return dt("Card image",{min:G,max:Te,step:vt,hint:"Rounds the picture. The card's own corner is in Styles."})}function ds(){return me({sidesKey:"cornerSides",step:kt,useFollowed:()=>G,mark:i(gi,{label:Lt}),hint:a("Rounds the picture. Left alone it stays square.")})}function gi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(x,{words:y()?.panel,label:a(e),changed:t,onReset:n})}function us(){return{type:"custom",render:({value:e,onChange:t})=>i(bi,{value:typeof e=="string"?e:"",onChange:t})}}function bi({value:e,onChange:t}){const[n,o]=j(null),r=we.filter(s=>n===null||$[s].across===n),l=e&&e in $?$[e]:null;return O(I,{children:[i(h,{label:a("Photos in a row"),icon:i(ve,{}),children:O("div",{className:"sf-gallery-filter",children:[i("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:a("All")}),Ft.map(s=>i("button",{type:"button","aria-pressed":n===s,onClick:()=>o(s),children:s},s))]})}),i(h,{label:a("Layout"),icon:i(on,{}),value:l?a(l.label):a("Not chosen"),hint:a("{n} of {total} layouts",{n:r.length,total:we.length}),children:i(je,{className:"sf-gallery-layouts",label:a("Layout"),value:e,onChange:t,onClear:()=>t(""),options:r.map(s=>({value:s,label:a($[s].label),picture:i("span",{className:"sf-gallery-pic",children:At($[s]).map(([c,d],u)=>i("i",{style:{gridColumn:`span ${c}`,gridRow:`span ${d}`}},u))})}))})})]})}export{xr as BOUND_TO_POST,jl as BOUND_TO_POST_NOTE,Zl as BUCKET_ICONS,es as CUSTOM_FIELD_MEDIA,ts as CoordsField,$a as EDGE_ARROWS,zn as FOCAL_DEFAULT,ii as FOCAL_POINTS,Q as FOLD_FIELD_MARKER,Ka as FOLLOWS_SITE_BUTTON,Wa as FOLLOWS_SITE_BUTTON_INK,St as FocalPicker,sa as GroupLabel,Sr as HIGHLIGHT_HINT,A as HidableTextField,_e as LINK_FIELD_MARKER,Dl as Label,Ie as MEDIA_FIELD_MARKER,Ja as MEDIA_TYPE_OPTIONS,Xl as NOT_BOUND_TO_POST,aa as PanelBand,Ir as PanelNoteLine,$r as PhoneChoiceRow,Xr as PhoneChoiceStrip,Ct as PlacementGridView,Ee as SCAFFOLD_FIELD_MARKER,hs as SCALAR_TEXT_CONTROLS,pt as SECTION_BLEEDS_HINT,qr as SIDE_PAD_KEYS,J as Segmented,gr as SiteGapDefaultReset,W as Slider,ct as Swatches,ms as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,os as TICKER_ITEMS_ROW,fi as TextListField,br as WidthDefaultReset,pi as aimAfterListChange,Da as anchorFields,F as backTo,ca as backgroundField,Sa as boxAlignField,Ia as boxBlockSpacingField,xa as boxJustifyField,Ea as boxPhoneRowField,_a as boxShareField,Ca as boxWrapField,oa as bucketHeader,ha as buttonBorderField,ma as buttonWordsEntryField,Gr as cardCornersField,Tr as cardImageBackgroundField,hi as cardImageField,ls as cardMediaFields,ya as cardShapeFields,ss as cardShowFields,as as cardStyleFields,Oa as cellWidthFields,Ma as checkbox,Ua as colorInput,Yl as copyText,ut as cornerSidesField,me as cornersRowField,Ha as date,Ba as dateTime,ra as designGroupHeader,Ta as directionField,cs as displayFields,za as edgePad,Ql as entriesHiddenForTab,ns as focusAfterRemove,ja as focusKeptField,ia as foldMarker,ee as foldMetaOf,Er as foldTitleOf,us as galleryLayoutField,ua as gapField,S as group,Fa as heightFields,Ce as hidableText,_r as hintIsWhileTyping,R as iconOf,ds as imageCornersField,Ul as inOwnBox,na as isBucketHeader,fr as isNoGlyph,ql as linkField,Za as loadingShowsField,Va as multiSelect,pr as noGlyph,Ga as pageBackgroundField,ea as panelNote,Ra as phoneChoiceField,jr as phoneOverrideField,Xa as placementField,Vl as plainText,Jl as plainTextarea,La as positionFields,Qr as positionPatch,dt as pxField,la as quietMarker,Se as readHidable,di as rowText,Ya as searchSelect,ta as section,ga as sectionAnimationFields,ht as sectionBorderField,Pr as sectionCornersField,fa as sectionShapeFields,da as sectionThemeFields,ge as segmented,N as select,ui as setRowText,K as sharedStyleKinds,va as sidesPaddingFields,Jr as sidesPaddingPatch,wa as sizeField,U as slider,qa as sourceField,Pa as spacingFields,Aa as stickFields,ka as swapPadding,ba as templateField,$l as text,Ot as textFieldIdentifier,Gl as textFieldOffPage,Kl as textFieldPanelOnly,rs as textList,is as textListRowField,zl as textarea,H as toggle,Qa as upload,mr as usePageWidthDetail,pa as useSelectedPatch,B as useSelectedProps,L as useSelectedSibling,hr as useSiteGapDetail,Na as widthField,Wl as withIdentifier,Hl as withOffPage,Ml as withPanelOnly,Bl as withScaffold};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECTION_WIDTH_FIELD_KEYS as Y}from"./section-width-fields.js";import{anchorFields as m,bucketHeader as L,cardMediaFields as U,cardShowFields as W,cardStyleFields as z,designGroupHeader as R,foldMarker as q,foldMetaOf as h,group as J,quietMarker as Q,heightFields as E,sectionAnimationFields as w,sectionShapeFields as O,sectionThemeFields as D,sidesPaddingFields as T,stickFields as x,widthField as B}from"./controls.js";import{deviceField as V,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as X}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=X;function Z(e){return e==="Animation"?"Animation":"Design"}const ee="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design","Text style":"Design",Motion:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Controls:"Layout",Diagram:"Layout",[ee]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Height:"Size"},H={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},$={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,n){const a=`${e}.${t}`;return $[a]??H[a]??I[n]}function Ce(e,t,n){const a=_(e,t,n);return a?Z(a):void 0}function G(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const n of e)for(const a of Object.values(n)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of G(l))t.includes(p)||t.push(p)}return t}const ge=[...S(T(),B("full"),E(),m(),x()),...Object.keys(T()),...Object.keys(B("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x()),...Y],pe=[...S(D()),...Object.keys(D())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],te=Object.keys(U()),oe=new Set(["cardImage","imageBackground"]),_e=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...te.filter(e=>e.startsWith("_g")||oe.has(e))],Se=Object.keys(z()),ve=Object.keys(W({bottomDefault:!0})),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","EmailFormBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T(),...B("full"),...E(),...m(),...D(),...O(),...w()};for(const t of Object.keys(M)){const n=h(e[t]),a=n?I[n.label]:void 0;if(!n||n.level!==2||!a||!K[a].includes(n.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const ae=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ie=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function fe(e){const t=new Set([...Object.values(d),b.Content]);for(const[n,a]of Object.entries(e))if(!t.has(n)&&h(a)?.level===1)return 1;return 2}function re(e){const t=`${e}.`;return Object.keys(ne).filter(n=>n.startsWith(t)).map(n=>n.slice(t.length))}function de(e,t){const n=P(e),a=J(t);return n?V(n.tier,a):a}function ce(e,t){const n=h(t);return n?e==="Content"||e==="Animation"?q(t,n.label):Q(t):t}function j(e){return e==="Design"?k:["Animation"]}function me(e,t){const n=[],a=new Set(re(t)),C=new Set;let g=!1,l=null;for(const[o,r]of Object.entries(e)){const i=h(r);if(ae.has(o))throw new Error(`${t}.${o}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ie.get(o);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${o}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(o===d.Design||o===d.Animation)&&(g=!0),n.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||n.push(l={place:"Content",entries:[]}),l.entries.push([o,r]);continue}if(a.has(o)||o in M){const s=_(t,o,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${o}: ${a.has(o)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(o)&&C.add(o),n.push(l={place:s,entries:[]});continue}const u=_(t,o,i.label);if(!u)throw new Error(`${t}.${o}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);n.push(l={place:u,entries:[[o,i.level===2?r:de(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,o])=>h(o)).map(([o])=>o));for(const[o,r]of[["BLOCK_KEY_GROUP",$],["KEY_GROUP",H]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${o} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(o=>!C.has(o));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const F=new Set(n.filter(o=>o.entries.length>0).map(o=>o.place)),f=A.filter(o=>j(o).some(r=>F.has(r))),y={};for(const o of f){y[d[o]]=L(o,o===f[0]?f:null);for(const r of j(o)){if(!F.has(r))continue;const i=n.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),o==="Design"&&(y[b[r]]=R(r));for(const u of i)for(const[s,N]of u.entries)y[s]=ce(r,N)}}return y}function Le(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:R("Content"),...e}}function Ee(e){return A.some(t=>d[t]in e)}function we(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const n={...e};for(const a of t)n[d[a]]=L(a,a===t[0]?t:null);return n}export{$ as BLOCK_KEY_GROUP,_e as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,te as CARD_MEDIA_FIELD_KEYS,ve as CARD_SHOW_FIELD_KEYS,Se as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,ee as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,H as KEY_GROUP,I as LABEL_GROUP,ge as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,ke as SECTION_ANIM_FIELD_KEYS,ye as SECTION_SHAPE_FIELD_KEYS,pe as SECTION_THEME_FIELD_KEYS,me as assignSectionGroups,Ce as bucketOf,Z as bucketOfPlace,fe as foldTopTier,Ee as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,we as reseatBucketTabs,re as retiredHeadings,Le as seatDesignBucket};
|
|
1
|
+
import{SECTION_WIDTH_FIELD_KEYS as Y}from"./section-width-fields.js";import{anchorFields as m,bucketHeader as L,cardMediaFields as U,cardShowFields as W,cardStyleFields as z,designGroupHeader as R,foldMarker as q,foldMetaOf as h,group as J,quietMarker as Q,heightFields as E,sectionAnimationFields as w,sectionShapeFields as O,sectionThemeFields as D,sidesPaddingFields as T,stickFields as x,widthField as B}from"./controls.js";import{deviceField as V,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as X}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=X;function Z(e){return e==="Animation"?"Animation":"Design"}const ee="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design","Text style":"Design",Motion:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[ee]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Height:"Size"},H={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},$={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,n){const a=`${e}.${t}`;return $[a]??H[a]??I[n]}function Ce(e,t,n){const a=_(e,t,n);return a?Z(a):void 0}function G(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const n of e)for(const a of Object.values(n)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of G(l))t.includes(p)||t.push(p)}return t}const ge=[...S(T(),B("full"),E(),m(),x()),...Object.keys(T()),...Object.keys(B("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x()),...Y],pe=[...S(D()),...Object.keys(D())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],te=Object.keys(U()),oe=new Set(["cardImage","imageBackground"]),_e=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...te.filter(e=>e.startsWith("_g")||oe.has(e))],Se=Object.keys(z()),ve=Object.keys(W({bottomDefault:!0})),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","EmailFormBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T(),...B("full"),...E(),...m(),...D(),...O(),...w()};for(const t of Object.keys(M)){const n=h(e[t]),a=n?I[n.label]:void 0;if(!n||n.level!==2||!a||!K[a].includes(n.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const ae=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ie=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function fe(e){const t=new Set([...Object.values(d),b.Content]);for(const[n,a]of Object.entries(e))if(!t.has(n)&&h(a)?.level===1)return 1;return 2}function re(e){const t=`${e}.`;return Object.keys(ne).filter(n=>n.startsWith(t)).map(n=>n.slice(t.length))}function de(e,t){const n=P(e),a=J(t);return n?V(n.tier,a):a}function ce(e,t){const n=h(t);return n?e==="Content"||e==="Animation"?q(t,n.label):Q(t):t}function j(e){return e==="Design"?k:["Animation"]}function me(e,t){const n=[],a=new Set(re(t)),C=new Set;let g=!1,l=null;for(const[o,r]of Object.entries(e)){const i=h(r);if(ae.has(o))throw new Error(`${t}.${o}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ie.get(o);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${o}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(o===d.Design||o===d.Animation)&&(g=!0),n.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||n.push(l={place:"Content",entries:[]}),l.entries.push([o,r]);continue}if(a.has(o)||o in M){const s=_(t,o,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${o}: ${a.has(o)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(o)&&C.add(o),n.push(l={place:s,entries:[]});continue}const u=_(t,o,i.label);if(!u)throw new Error(`${t}.${o}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);n.push(l={place:u,entries:[[o,i.level===2?r:de(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,o])=>h(o)).map(([o])=>o));for(const[o,r]of[["BLOCK_KEY_GROUP",$],["KEY_GROUP",H]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${o} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(o=>!C.has(o));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const F=new Set(n.filter(o=>o.entries.length>0).map(o=>o.place)),f=A.filter(o=>j(o).some(r=>F.has(r))),y={};for(const o of f){y[d[o]]=L(o,o===f[0]?f:null);for(const r of j(o)){if(!F.has(r))continue;const i=n.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),o==="Design"&&(y[b[r]]=R(r));for(const u of i)for(const[s,N]of u.entries)y[s]=ce(r,N)}}return y}function Le(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:R("Content"),...e}}function Ee(e){return A.some(t=>d[t]in e)}function we(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const n={...e};for(const a of t)n[d[a]]=L(a,a===t[0]?t:null);return n}export{$ as BLOCK_KEY_GROUP,_e as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,te as CARD_MEDIA_FIELD_KEYS,ve as CARD_SHOW_FIELD_KEYS,Se as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,ee as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,H as KEY_GROUP,I as LABEL_GROUP,ge as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,ke as SECTION_ANIM_FIELD_KEYS,ye as SECTION_SHAPE_FIELD_KEYS,pe as SECTION_THEME_FIELD_KEYS,me as assignSectionGroups,Ce as bucketOf,Z as bucketOfPlace,fe as foldTopTier,Ee as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,we as reseatBucketTabs,re as retiredHeadings,Le as seatDesignBucket};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{jsx as d,Fragment as v,jsxs as y}from"react/jsx-runtime";import{useMemo as g,useRef as h}from"react";import{EaselCanvas as C,useEaselApi as I}from"efficient-easel/easel";import P from"../../components/PreviewThemeFrame.js";import{OpenDocumentChromeLoadNotice as T}from"../../components/PinnedChromeLoadNotice.js";import{SiteRestoreNotice as w}from"../../components/SiteRestoreNotice.js";import{usePreviewParts as F}from"efficient-easel/draw/client";import{partElement as D,partTypingTarget as x,setCanvasTypingPart as S}from"./canvas-typing.js";import{partThemeColors as A,readInks as j}from"../../../format/lib/document/part-inks.js";import{PART_ATTR as p}from"../../../render/lib/document/text-parts.js";import{useSectionOps as B}from"efficient-easel/screen/lib/document/use-section-ops";import{useBlockMetadata as E}from"../editor-block-metadata.js";import{usePreviewHeader as M}from"../../../render/components/PreviewHeaderContext.js";import{siteWidthsMetadata as R}from"../../../format/lib/content/section-width.js";import{useEditorCanvasStyles as W}from"../editor-canvas-styles.js";function X(n){const{mirrorHostStyles:s}=W(),i=E(),{sectionBackgroundWidth:m,sectionContentWidth:o,themeFromDocument:c}=M(),u=g(()=>({...n.metadata??i??{},...R(c?null:m,c?null:o)}),[n.metadata,i,m,o,c]),t=h(null),e=_(t),{onDocument:r}=n,a=l=>{t.current=l,r?.(l)};return y(v,{children:[d(w,{}),d(T,{}),d(C,{...n,onDocument:a,typing:e,metadata:u,height:"fill",mirrorStyles:s,frameWrapper:P})]})}function _(n){const s=I(),i=B(),m=F(),o=h({ops:i,parts:m});return o.current={ops:i,parts:m},g(()=>{const c={getItemById:t=>s.getState().getItemById(t),getSelectorForId:t=>s.getState().getSelectorForId(t),get components(){return s.getState().config.components},replace:(t,e,r)=>o.current.ops.replaceComponent(t,e,r)},u=(t,e)=>{const r=x(t,c);if(!r)return null;let a=e;const l=()=>(a=D(a,a?.ownerDocument??n.current,t),a),f=l();return f?{element:l,value:r.value,rules:r.rules,multiline:r.multiline,write:r.write,toolbar:{offered:r.offered,colors:r.offered.length>0?A(j(f)):void 0}}:null};return{at:t=>{const e=t.closest(`[${p}]`),r=e?.getAttribute(p);return e&&r?u(r,e):null},atSelection:()=>{const t=o.current.parts.selectedPartId;return t?u(t,null):null},onChange:t=>{if(!t.typing){S(null);return}const e=t.element.closest(`[${p}]`)?.getAttribute(p)??null;S(e),e&&o.current.parts.selectedPartId!==e&&o.current.parts.select(e)}}},[s,n])}export{X as SiteCanvas};
|
|
@@ -14,7 +14,9 @@ export type PartHost = {
|
|
|
14
14
|
export type PartStamp = {
|
|
15
15
|
element: PartEl;
|
|
16
16
|
partId: string;
|
|
17
|
+
label?: string;
|
|
17
18
|
};
|
|
19
|
+
export declare const PART_LABEL_ATTR = "data-sf-part-label";
|
|
18
20
|
export declare function resolvePartStamps(host: PartHost, nodeId: string, needles: readonly PartNeedle[]): PartStamp[];
|
|
19
21
|
export declare function applyPartStamps(host: PartHost, nodeId: string, stamps: readonly PartStamp[]): PartEl[];
|
|
20
22
|
export type PartAnchorHost = PartHost;
|
|
@@ -22,4 +24,9 @@ export declare function engagePartAnchors(host: PartAnchorHost, needles: readonl
|
|
|
22
24
|
export declare function partOfBlockAt(target: Element | null | undefined, ownerId: string): {
|
|
23
25
|
id: string;
|
|
24
26
|
element: Element;
|
|
27
|
+
whole: boolean;
|
|
28
|
+
label?: string;
|
|
25
29
|
} | null;
|
|
30
|
+
export declare function partLabelOf(element: Element, partId: string): string | undefined;
|
|
31
|
+
export declare const LOCATION_PICK_ATTR = "data-loc-pick";
|
|
32
|
+
export declare function isOnlyPart(element: Element, partId: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{encodePartKey as
|
|
1
|
+
import{encodePartKey as L}from"../../../format/lib/document/part-key.js";import{HERO_MEDIA_PART_LABELS as J,HERO_PART_ATTR as C,heroPartId as Q,readHeroPartId as U}from"../../../render/lib/document/hero-media-parts.js";import{TICKER_PART_ATTR as z,TICKER_PART_LABEL as V,readTickerPartId as X,tickerPartId as Y}from"../../../render/components/PreviewTickerContext.js";import{decodeLocationPartId as Z,encodeLocationPartId as tt}from"../../../render/components/PreviewLocationPartContext.js";import{PART_ATTR as R,PART_KIND_ATTR as et,PART_ROW_ATTR as N,REGION_PART_ATTR as _,decodePartId as nt,encodePartId as O,encodePartRow as ot,normalizePartText as rt,partHeadLabel as st}from"../../../render/lib/document/text-parts.js";const y="data-easel-block",E="data-sf-part-label";function M(c,n){return c.closest(`[${y}]`)?.getAttribute(y)===n}function v(c,n,o){const s=c.querySelectorAll("*"),i=[],a=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!M(e,n))continue;const l=e.getAttribute(et);l&&(i.push({element:e,partId:O(n,l)}),a.add(e))}const u=[],f=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!M(e,n)||a.has(e))continue;const l=rt(e.textContent??"");if(!l)continue;const r=e.closest(`[${N}]`)?.getAttribute(N)||null;r&&f.add(r.replace(/\[\d+\]$/u,"")),u.push({element:e,text:l,row:r})}const x=t=>u.filter(e=>e.row===ot(t.key,t.row.index)),P=u.filter(t=>t.row===null),g=t=>t.row&&f.has(t.key)?x(t):f.size?P:u,d=new Map,T=[],w=t=>t.row?`${t.key}.${t.row.rowKey}`:null,I=new Map;for(const t of o){const e=w(t);if(!e||f.has(t.key))continue;const l=I.get(e);l?l.push(t):I.set(e,[t])}const S=new Set;for(const[t,e]of I){if(e.length<2)continue;const l=e.flatMap(m=>m.texts);if(new Set(l).size===l.length)continue;const r=g(e[0]).filter(m=>l.includes(m.text));if(r.length!==e.length)continue;const A=[...e].sort((m,b)=>(m.row?.index??0)-(b.row?.index??0));for(let m=0;m<A.length;m+=1){const b=A[m],p=r[m].element,h={key:b.key,partKey:L(b.key,b.row),exact:!0},k=d.get(p);k?k.push(h):(d.set(p,[h]),T.push(p))}S.add(t)}const K=new Map;for(const t of o){if(S.has(w(t)??""))continue;const e=L(t.key,t.row);for(const l of t.texts)for(const r of g(t)){if(r.text!==l)continue;const A=K.get(r.element);A?A.add(e):K.set(r.element,new Set([e]))}}const F=(t,e)=>[...K].some(([l,r])=>l!==t&&!r.has(e)&&l.contains(t));for(const t of o){if(S.has(w(t)??""))continue;const e=L(t.key,t.row);for(const l of t.texts){const r=[];let A=null;for(const p of g(t))p.text===l?F(p.element,e)||r.push(p.element):!r.length&&p.text.includes(l)&&(!A||p.text.length<=A.length)&&(A={element:p.element,length:p.text.length});const m=r.length?r:A?[A.element]:[],b=m.filter(p=>!m.some(h=>h!==p&&p.contains(h)));for(const p of b){const h={key:t.key,partKey:e,exact:r.length>0},k=d.get(p);k?k.push(h):(d.set(p,[h]),T.push(p))}}}const G=new Map(o.map(t=>[t.key,st(t.label)])),$=[...i];for(const t of T){const e=d.get(t)??[],l=e.some(r=>r.exact)?e.filter(r=>r.exact):e;if(new Set(l.map(r=>r.partKey)).size===1){const r=G.get(l[0].key);$.push({element:t,partId:O(n,l[0].partKey),...r?{label:r}:{}});continue}new Set(l.map(r=>r.key)).size===1&&$.push({element:t,partId:O(n,l[0].key)})}return $}function B(c,n,o){const s=c.querySelectorAll(`[${R}]`);for(let a=0;a<s.length;a+=1){const u=s[a];M(u,n)&&(u.removeAttribute(R),u.removeAttribute(E))}const i=[];for(const{element:a,partId:u,label:f}of o)a.setAttribute(R,u),f&&a.setAttribute(E,f),i.push(a);return i}function pt(c,n,o,s,i,a=()=>null){let u=null,f=null,x=null;const P=()=>{const g=o(),d=g?.getAttribute(y)??null;if(!g||!d)return!1;u=d;let T=v(c,d,n);return i(g,d,B(c,d,T)),x=a(()=>{const w=v(c,d,n);ct(T,w)||(T=w,i(g,d,B(c,d,w)))}),!0};return P()||(f=s(()=>{(u||P())&&(f?.(),f=null)})),()=>{f?.(),f=null,x?.(),x=null,u&&B(c,u,[])}}function ct(c,n){return c.length===n.length&&c.every((o,s)=>o.element===n[s].element&&o.partId===n[s].partId)}function dt(c,n){const o=c?.closest?.(`[${R}],[${_}]`),s=o?.getAttribute(R)??o?.getAttribute(_),i=s?nt(s):null;if(o&&s&&i?.nodeId===n&&i.propKey)return{id:s,element:o,whole:D(o,s),label:H(o,s)};const a=c?.closest?.(q.slice(2).map(x=>`[${x}]`).join(","));if(!a)return null;const f=a.closest?.(`[${y}]`)?.getAttribute(y)===n?j(a,n):null;return f?{id:f,element:a,whole:D(a,f),label:H(a,f)}:null}function H(c,n){const o=Z(n);if(o)return o.part==="map"?"Map":"Image";const s=U(n);return s?J[s.part]:X(n)?V:c.getAttribute(E)??void 0}const W="data-loc-pick",q=[R,_,C,z,W];function j(c,n){const o=c.getAttribute(R)??c.getAttribute(_);if(o)return o;const s=c.getAttribute(C);if(s)return Q(n,s);if(c.getAttribute(z)!==null)return Y(n);const i=c.getAttribute(W)?.split(":");return i&&(i[1]==="image"||i[1]==="map")&&/^\d+$/.test(i[0])?tt(n,Number(i[0]),i[1]):null}function D(c,n){const o=c.closest?.(`[${y}]`),s=o?.getAttribute(y);if(!o||!s)return!1;const i=new Set;for(const a of o.querySelectorAll(q.map(u=>`[${u}]`).join(","))){if(a.closest?.(`[${y}]`)!==o)continue;const u=j(a,s);u&&i.add(u)}return i.size===1&&i.has(n)}export{y as BLOCK_ATTR,W as LOCATION_PICK_ATTR,E as PART_LABEL_ATTR,B as applyPartStamps,pt as engagePartAnchors,D as isOnlyPart,H as partLabelOf,dt as partOfBlockAt,v as resolvePartStamps};
|
|
@@ -276,7 +276,6 @@ export declare const WEB_BUILDER_WORDS: {
|
|
|
276
276
|
readonly "Clear change": "Clear change";
|
|
277
277
|
readonly "Clear change: {label}": "Clear change: {label}";
|
|
278
278
|
readonly "Clear colors": "Clear colors";
|
|
279
|
-
readonly "Clear formatting": "Clear formatting";
|
|
280
279
|
readonly "Clear override": "Clear override";
|
|
281
280
|
readonly "Clear override: {label}": "Clear override: {label}";
|
|
282
281
|
readonly "Clear this site\u2019s colors?": "Clear this site’s colors?";
|