efficient-web-builder 9.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +186 -0
- package/dist/components/SectionEditor.js +1 -1
- package/dist/components/SectionTextEntries.d.ts +3 -1
- package/dist/components/SectionTextEntries.js +1 -1
- package/dist/components/SiteFields.d.ts +2 -1
- package/dist/components/SiteFields.js +1 -1
- package/dist/components/SlotChildRows.js +1 -1
- package/dist/components/storefront-editor.css +14 -4
- package/dist/lib/content/card-corners.d.ts +1 -1
- package/dist/lib/content/card-corners.js +1 -1
- package/dist/lib/content/section-corners.d.ts +0 -2
- package/dist/lib/content/section-corners.js +1 -1
- package/dist/lib/editor-words-catalogue.d.ts +15 -7
- package/dist/lib/editor-words-catalogue.js +4 -4
- package/dist/lib/puck/apply-card-corners.js +1 -1
- package/dist/lib/puck/blocks/general/Footprint/fields.js +1 -1
- package/dist/lib/puck/blocks/general/Hero/fields.js +1 -1
- package/dist/lib/puck/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/lib/puck/blocks/general/LongRead/fields.js +1 -1
- package/dist/lib/puck/blocks/general/ProcessSteps/fields.js +1 -1
- package/dist/lib/puck/blocks/general/Prose/fields.js +1 -1
- package/dist/lib/puck/blocks/general/Split/fields.js +1 -1
- package/dist/lib/puck/blocks/general/Timeline/fields.js +1 -1
- package/dist/lib/puck/blocks/general/TimelineTrack/fields.js +1 -1
- package/dist/lib/puck/controls.d.ts +21 -11
- package/dist/lib/puck/controls.js +1 -1
- package/dist/lib/puck/field-buckets.d.ts +1 -1
- package/dist/lib/puck/field-buckets.js +1 -1
- package/dist/lib/puck/field-groups.d.ts +19 -8
- package/dist/lib/puck/field-groups.js +1 -1
- package/dist/lib/puck/panel-bands.d.ts +14 -0
- package/dist/lib/puck/panel-bands.js +1 -0
- package/dist/lib/puck/panel-drop-empty-headings.js +1 -1
- package/dist/lib/puck/passes/settings-groups.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as T,Fragment as R}from"react/jsx-runtime";import{cloneElement as Je,useId as Ze,useRef as ee,useState as pe}from"react";import{useEasel as F}from"efficient-easel/easel";import{say as l,editorEaselWords as b}from"../editor-words.js";import{readHidable as fe,hidableText as me}from"./hidable.js";import{FOLD_FIELD_MARKER as te,LINK_FIELD_MARKER as he,MEDIA_FIELD_MARKER as ge,SCAFFOLD_FIELD_MARKER as be,TEXT_FIELD_MARKER as v,foldMetaOf as ne,textFieldIdentifier as Qe}from"./field-markers.js";import et from"../../components/ApplyCornersToSiblings.js";import{CARD_IMAGE_RADIUS_STEP as tt,CORNER_RADIUS_MAX as $,CORNER_RADIUS_MIN as M}from"../content/card-image-shape.js";import{IMAGE_CORNER_STEP as nt,IMAGE_CORNERS_LABEL as ot}from"../content/image-corners.js";import{GRID_MAX_COLUMNS as rt}from"../content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as it,GALLERY_LAYOUTS as w,GALLERY_LAYOUT_KEYS as xe}from"../content/gallery-layout.js";import{anchorSiblingsOf as lt,HERO_GROUP_PLACEMENTS as at,HERO_GROUP_PLACEMENT_DEFAULT as st,normalisePlacement as ct,placementPoints as Ce}from"../hero-group-placement.js";import ut from"../../components/KeepHint.js";import{AlignLeftIcon as dt,AlignSeparateIcon as pt,AnimationIcon as Se,BackgroundIcon as ft,BlockSectionIcon as mt,CartIcon as ht,ColumnWidthsIcon as Ie,ColumnsIcon as gt,CornerIcon as _e,DirectionDownIcon as bt,DirectionLeftIcon as xt,DirectionRightIcon as Ct,DirectionUpIcon as St,DollarIcon as It,FinishIcon as _t,GapIcon as ye,GridIcon as yt,GroundIcon as Et,HashIcon as Ee,ImageIcon as Tt,LayoutIcon as Rt,ListIcon as vt,LocationIcon as oe,PaddingBottomIcon as Lt,PaddingLeftIcon as Nt,PaddingRightIcon as Ot,PaddingTopIcon as At,PageIcon as Te,PhoneIcon as Ft,PlacementIcon as wt,ProductSizeIcon as Pt,RotateIcon as kt,SquareIcon as Dt,StylesIcon as Bt,TextLinesIcon as Ht,TypeIcon as Gt,WidthIcon as Mt,WrapIcon as Wt}from"efficient-easel/icons";import{FieldGlyph as Re}from"../../components/FieldGlyph.js";import{resolvePageBackground as Ut}from"../content/page-background.js";import{CORNER_SIDES as P,CORNER_SIDE_POINTS as re,CORNER_SIDES_LABEL as k,cornerSidesSummary as ve,hasOwnSectionCorners as Kt,normalizeCornerSides as z}from"../content/section-corners.js";import{hasOwnCardCorners as Xt}from"../content/card-corners.js";import{SECTION_MOTION_NONE as $t,SECTION_MOTION_OPTIONS as zt}from"../content/section-animation.js";import{enclosingSectionProps as Le}from"./enclosing-section.js";import{SettingsCorners as Ne,SettingsDefaultReset as x,SettingsField as h,SettingsGroupHead as Vt,SettingsGroupSub as Yt,SettingsPlacement as jt,SettingsSegmented as qt,SettingsSwitch as Jt}from"efficient-easel/panel";import{FieldSelect as Zt,ListField as Qt}from"efficient-easel/fields";import{Checkbox as en,DateTimePicker as tn,FOCAL_DEFAULT as Oe,Slider as nn,Tooltip as V}from"efficient-shell/ui";import{ColourControl as Ae}from"./ColourControl.js";import Fe from"./MarkupToolbar.js";import{deviceField as L}from"./device-fields.js";import{noControlField as on}from"./panel-no-control-mark.js";import{phoneKey as Y,resolvePhoneValue as ie}from"./phone-override.js";import{SuppressibleText as rn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as ln,CARD_OUTLINE_OPTIONS as an,DEFAULT_CARD_INDEX_FORMAT as sn,DEFAULT_CARD_OUTLINE as cn}from"../sections/product-card-style.js";import{COVER_INDEX_OPTIONS as un,DEFAULT_COVER_INDEX as dn}from"../sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as pn}from"./text-control-kinds.js";import fn from"../../components/ImageFocusRow.js";import mn from"../../components/MediaUploadField.js";import hn from"../../components/MultiSelectField.js";import gn from"../../components/SectionThemePicker.js";import bn from"../../components/SearchSelectField.js";import xn from"../../components/StorefrontLinkField.js";import we from"../../components/UiIcon.js";import{SECTION_PADDING as _}from"../content/section-padding.js";import{hasPhoneHeight as Cn,resolveSectionMinHeight as Sn}from"../content/section-min-height.js";import{SECTION_MIN_HEIGHT as In,SECTION_MIN_HEIGHT_GROUP_LABEL as W,SECTION_SCREEN_PCT as _n}from"../content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as yn,containerDirectionPoints as En,resolveContainerDirection as Pe}from"../content/container-direction.js";import{BOX_ALIGN_POINTS as Tn,BOX_BLOCK_SPACING_LABEL as Rn,BOX_BLOCK_SPACING_POINTS as ke,BOX_JUSTIFY_POINTS as De,BOX_PHONE_ROW_LABEL as vn,BOX_PHONE_ROW_MAX as Ln,BOX_PHONE_ROW_MIN as Be,BOX_SHARE_LABEL as He,BOX_SHARE_POINTS as le,BOX_WRAP_LABEL as Nn,BOX_WRAP_POINTS as Ge}from"../content/box-layout.js";import{usePreviewHeader as j}from"../../components/PreviewHeaderContext.js";import{CONTAINER_GAP as ae,CONTAINER_GAP_BUILT_IN as On,GAP_FIELD_CONTAINER as An,hasOwnContainerGap as Fn,resolveContainerGap as wn}from"../content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Pn,CARD_IMAGE_BG_OFF as kn,CARD_IMAGE_BG_SWATCH_NAMES as Dn,CARD_IMAGE_BG_SWATCHES as Bn,isCardImageBackgroundInheriting as Hn,cardImageBackgroundChoice as Gn,THEME_CARD_IMAGE_BG as Mn}from"../content/card-image-background.js";import{SECTION_BG_INHERIT as Wn,SECTION_BG_SWATCHES as Un,SECTION_BG_SWATCH_NAMES as Kn,THEME_SECTION_BG as Xn,isSectionBackgroundInheriting as $n}from"../content/section-background.js";import{SECTION_THEME_GROUP_LABEL as zn}from"../content/section-surface.js";import{TYPE_SIZE_FIXED as Vn,TYPE_SIZE_INHERIT as Yn,isTypeSizeInheriting as jn}from"../content/section-type-size.js";import{SECTION_WIDTH_CHOICES as qn,WIDTH_CHOICE_LABEL as Jn,WIDTH_INHERIT as Zn,resolveWidth as Qn,sectionRunsFullWidth as Me}from"../content/section-width.js";import{useFoldHeadingLevel as We}from"./panel-heading-scope.js";import{withStyleKind as eo}from"efficient-easel/style-clipboard";function U(e){for(const[t,o]of Object.entries(e))o&&typeof o=="object"&&!ne(o)&&eo(o,`section:${t}`);return e}function qr({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function Ue(){return null}function to(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(Ue,{},e)}function no(e){return e.type===Ue}function q(e){return no(e)?void 0:e}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function oo(){const{appState:e}=F(i=>i),t=e.data.root?.props??{},{mode:o,pageWidth:n}=Qn(t,"full");return o==="page"?D(`${n}px`,l("the page")):o==="contained"?D(l("Contained"),l("the page")):D(l("Full"),l("the page"))}function ro(){const{blockGap:e}=j();return e===null?l("this container's own spacing"):D(`${e}px`,l("Site styles"))}function io({inherited:e,onReset:t,label:o}){return r(x,{words:b()?.panel,label:l(o),changed:!e,detail:ro(),onReset:t})}function lo({inherited:e,onReset:t,label:o}){return r(x,{words:b()?.panel,label:l(o),changed:!e,detail:oo(),onReset:t})}function B({value:e,onChange:t,label:o,placeholder:n,hint:i,multiline:a,hideable:s=!0,markup:c=!0}){const{text:u,hidden:p}=fe(e),m=ee(null),d=ee(null),f=E=>t(s?{text:E,hidden:p}:E),g=()=>t({text:u,hidden:!p}),C=s&&p,y=Ze(),S=i?po(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(ut,{children:l(i)}):void 0,X=p?l("Show {label} on the slide",{label:l(o)}):l("Hide {label} on the slide",{label:l(o)});return r(h,{label:l(o),icon:r(Gt,{}),htmlFor:y,className:C?"is-hidden":void 0,hint:S,action:s?r(V,{content:X,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":p,"aria-label":X,onClick:g,children:p?r(we,{name:"eye-off",size:14}):r(we,{name:"eye",size:14})})}):void 0,children:T("div",{className:"sf-copybox",children:[c&&r(Fe,{target:a?d:m,value:u,onChange:f}),a?r("textarea",{id:y,ref:d,value:u,placeholder:n===void 0?void 0:l(n),onChange:E=>f(E.target.value)}):r("input",{id:y,ref:m,type:"text",value:u,placeholder:n===void 0?void 0:l(n),onChange:E=>f(E.target.value)})]})})}function Jr(e,t){return{...e,[be]:t}}function Zr(e){const t=e[v];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[v]:{...t,offPage:!0}}}function Qr(e){return!e||typeof e!="object"?!1:e[v]?.offPage===!0}function ei(e){const t=e[v];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[v]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as rl,SCALAR_TEXT_CONTROLS as il}from"./text-control-kinds.js";const ao=new Set(pn),H=(e,t)=>{const o={...t,[v]:e};if(!ao.has(e.control))return o;const n=t.render;return{...on(o,"authored-copy"),render:i=>r(rn,{name:i.name,children:n(i)})}},ti="Everything else on this block comes from the linked post. Unlink it to edit by hand.",so="Select a word, then press the highlighter.",co="A short name so a link can jump straight to this section, like yoursite.com/page#about.",uo=new Set([so]),po=e=>uo.has(e);function ni(e,t,o){return H({control:"text",label:e,placeholder:t,hint:o},{type:"custom",render:({value:n,onChange:i})=>r(B,{value:n,onChange:i,label:e,placeholder:t,hint:o})})}function oi(e,t,o){return H({control:"textarea",label:e,placeholder:t,hint:o},{type:"custom",render:({value:n,onChange:i})=>r(B,{value:n,onChange:i,label:e,placeholder:t,hint:o,multiline:!0})})}function fo(e,t,o){return H({control:"plainText",label:e,placeholder:t,hint:o},{type:"custom",render:({value:n,onChange:i})=>r(B,{value:n,onChange:i,label:e,placeholder:t,hint:o,hideable:!1,markup:!1})})}function ri(e,t,o){return H({control:"copyText",label:e,placeholder:t,hint:o},{type:"custom",render:({value:n,onChange:i})=>r(B,{value:n,onChange:i,label:e,placeholder:t,hint:o,hideable:!1})})}function ii(e){return{type:"custom",[he]:{label:e},render:({value:t,onChange:o})=>r(xn,{value:me(t),onChange:o,label:e})}}function li(e,t,o){return H({control:"plainTextarea",label:e,placeholder:t,hint:o},{type:"custom",render:({value:n,onChange:i})=>r(B,{value:n,onChange:i,label:e,placeholder:t,hint:o,multiline:!0,hideable:!1})})}const ai={Content:Ht,Style:Bt,Layout:Rt,Animation:Se};function si(e,t){return e.includes("Content")?t!=="Content":null}function mo({label:e}){return r(Vt,{title:l(e),level:We(1)})}function ho({level:e,label:t}){return e===1?r(mo,{label:t}):r(bo,{label:t})}function Ke(e,t){return{type:"custom",[te]:{label:e,level:t},render:()=>r(ho,{level:t,label:e})}}function I(e){return Ke(e,2)}function ci(e){return{type:"custom",render:()=>r(go,{text:e})}}function go({text:e}){return r("p",{className:"sf-note",children:l(e)})}function ui(e){return Ke(e,1)}function di(e){return ne(e)!==null&&e?.tabs!==void 0}const Xe=new Map;function pi(e,t){const o=`${e}\0${t?t.join(""):""}`,n=Xe.get(o)??{type:"custom",tabs:t,[te]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(R,{})};return Xe.set(o,n),n}function bo({label:e}){return r(Yt,{title:l(e),level:We(2)})}function $e({swatches:e,current:t,onPick:o,names:n}){const i=e.find(c=>c.toLowerCase()===t.toLowerCase()),a=i?n?.[i]:void 0,s=a?l(a):t;return T("div",{className:"sf-swatches",children:[e.map(c=>{const u=n?.[c]?l(n[c]):c;return r(V,{content:u,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===c.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===c.toLowerCase()?"is-active":""}`,style:{background:c},onClick:()=>o(c),"aria-label":u})},c)}),r("span",{className:"sf-swatch-hex",children:s})]})}function fi(e,t){return{type:"custom",render:({value:o,onChange:n})=>{const i=$n(o,t);return r(h,{label:l(e),icon:r(ft,{}),changed:!i,action:r(x,{words:b()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>n(Wn)}),children:$e({swatches:Un,current:i?Xn:o??t??"",onPick:n,names:Kn})})}}}function xo(e,t){return{type:"custom",render:({value:o,onChange:n})=>{const i=o,a=Hn(i,t);return r(h,{label:l(e),icon:r(Et,{}),changed:!a,action:r(x,{words:b()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>n(Pn)}),children:$e({swatches:Bn,current:a?Mn:Gn(i,t),onPick:n,names:Dn})})}}}function mi(e=o=>o,t){return U({_gSectionTheme:I(zn),sectionAccent:{type:"custom",render:({value:o,onChange:n})=>r(gn,{value:e(o),onChange:n,followLabel:t})}})}function O({min:e,max:t,step:o,value:n,onChange:i,suffix:a="",readout:s=!0,notch:c,ariaLabel:u,disabled:p=!1}){const m=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return r("div",{className:m?"sf-slider has-notch":"sf-slider",style:m?{"--sf-notch":(c-e)/(t-e)}:void 0,children:r(nn,{min:e,max:t,step:o,value:n,suffix:a||void 0,showInput:s,label:u===void 0?void 0:l(u),disabled:p,size:"sm",className:"sf-slider-track",onChange:d=>{d!==null&&d!==n&&i(d)}})})}function G(e,t,o,n,i,a,s="",c){return{type:"custom",render:u=>r(h,{label:l(e),icon:q(t),action:c?c("storedValue"in u?u.storedValue:u.value,u.onChange):void 0,children:O({min:o,max:n,step:i,value:typeof u.value=="number"?u.value:a,suffix:s,ariaLabel:e,onChange:u.onChange})})}}function ze({min:e,max:t,step:o,px:n,label:i,onChange:a,disabled:s=!1}){const{cornerRadiusPx:c}=j();return r(R,{children:O({min:e,max:t,step:o,value:n??(typeof c=="number"?c:e),readout:!1,ariaLabel:i,disabled:s,onChange:a})})}function K(e,t){const{min:o,max:n,step:i=1,unsetLabel:a,hint:s,restAtSite:c=!1,restTrack:u,unsetMark:p}=t;return{type:"custom",render:({value:m,onChange:d})=>{const f=typeof m=="number"?m:null,g=f===null;return r(h,{label:l(e),value:g?p||a===void 0?void 0:l(a):`${f}px`,changed:!g,action:p?Je(p,{changed:!g,onReset:()=>d(null)}):r(x,{words:b()?.panel,label:l(e),changed:!g,onReset:()=>d(null)}),hint:typeof s=="string"?l(s):s,children:u?u({min:o,max:n,step:i,px:f,label:e,onChange:d}):c?r(ze,{min:o,max:n,step:i,px:f,label:e,onChange:d}):O({min:o,max:n,step:i,value:f??o,readout:!1,ariaLabel:e,onChange:d})})}}}function hi(e){const t=G("Gap",r(ye,{}),ae.min,ae.max,ae.step,On[e],"px",(o,n)=>r(io,{inherited:!Fn(e,o),onReset:()=>n(void 0),label:"Gap"}));return{type:"custom",[An]:e,render:o=>t.render({...o,value:wn(e,o.value,o.field?.siteGap),storedValue:o.value,onChange:n=>o.onChange(n)})}}function Co(){return{type:"custom",render:({value:e,onChange:t})=>{const n=z(e)??[...P],i=n.length===P.length;return r(h,{label:l(k),icon:r(_e,{}),value:ve(n),changed:!i,action:r(x,{words:b()?.panel,label:l(k),changed:!i,onReset:()=>t(null)}),hint:"Corners left off stay square. The row above sets how round the others are.",children:r(Eo,{value:n,onChange:a=>{const s=z(a)??[];t(s.length===P.length?null:s)}})})}}}function So({label:e,changed:t=!1,onReset:o=()=>{}}){const{cornerRadiusPx:n}=j(),i=typeof n=="number"?`${n}px`:l("not set");return r(x,{words:b()?.panel,label:l(e),changed:t,detail:n==null?l("the built-in corners"):D(i,l("Site styles")),onReset:o})}function Io(){return K("Corners",{min:M,max:$,unsetLabel:"Follows the site",unsetMark:r(So,{label:"Corners"}),restTrack:e=>r(_o,{...e}),hint:r(yo,{})})}const Ve="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function se(){return Me(J())}function _o(e){return r(ze,{...e,disabled:se()})}function yo(){return r(R,{children:se()?Ve:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function Eo({value:e,onChange:t}){const o=se();return r(Ne,{label:l(k),value:e,corners:o?re.map(n=>({...n,disabled:!0,title:Ve})):re,onChange:t})}function gi(){return U({_gShape:I("Shape"),sectionCorners:Io(),sectionCornerSides:Co()})}function bi(){return{_gMotion:I("Motion"),sectionAnimation:de("Entrance",r(Se,{}),[...zt],$t)}}function ce(){let e=null;try{const{appState:t,selectedItem:o}=F(i=>i),n=o?.props?.id?String(o.props.id):void 0;e=n?Le(t?.data,n):null}catch{e=null}return e!==null&&Me(e)}function Ye(e){const{cornerRadiusPx:t}=j(),o=ce(),n=typeof t=="number"?t:e;let i=null;try{const{appState:s,selectedItem:c}=F(p=>p),u=c?.props?.id?String(c.props.id):void 0;i=u?Le(s?.data,u):null}catch{i=null}if(o||!i)return n;const a=i.sectionCorners;return Kt(a)?a:n}function To({min:e,max:t,step:o,px:n,label:i,onChange:a}){const s=Ye(e);return r(R,{children:O({min:e,max:t,step:o,value:n??s,readout:!1,ariaLabel:i,onChange:a})})}function Ro({label:e,changed:t=!1,onReset:o=()=>{}}){const n=ce(),i=Ye(M),a=n?"Site":"Section";return r(x,{words:b()?.panel,label:l(e),changed:t,detail:D(`${i}px`,n?l("Site styles"):l("the section")),onReset:o})}function vo(){return r(R,{children:ce()?l("The section is full width, so this card follows Site styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function Lo(){return K("Corners",{min:M,max:$,unsetLabel:"Follows the section",unsetMark:r(Ro,{label:"Corners"}),restTrack:e=>r(To,{...e}),hint:r(vo,{})})}function No({value:e,onChange:t}){return r(Ne,{label:l(k),value:e,corners:re,onChange:t})}function Oo({unset:e}){return r(R,{children:e?l("Set a number above first — there is nothing to shape yet."):l("Corners left off stay square. The row above sets how round the others are.")})}function Ao(){return{type:"custom",render:({value:e,onChange:t})=>{const n=z(e)??[...P],i=n.length===P.length;return r(h,{label:l(k),icon:r(_e,{}),value:ve(n),changed:!i,action:r(x,{words:b()?.panel,label:l(k),changed:!i,onReset:()=>t(null)}),hint:r(Oo,{unset:!Xt(e)}),children:r(No,{value:n,onChange:a=>{const s=z(a)??[];t(s.length===P.length?null:s)}})})}}}function Fo(){return{type:"custom",render:()=>r(et,{})}}function xi(){return{_gShape:I("Shape"),cardCorners:Lo(),cardCornerSides:Ao(),cardCornersApplyAll:Fo()}}function Ci(){return N("Justify",r(pt,{}),De,De[0].value)}function Si(){return N("Item alignment",r(dt,{}),Tn,"stretch")}function Ii(){return N(Nn,r(Wt,{}),Ge,Ge[0].value)}function _i(){return{type:"custom",render:({value:e,onChange:t})=>{const o=le.find(n=>n.value===e)??le[0];return r(h,{label:l(He),icon:r(Ie,{}),value:l(o.label),children:r("div",{className:"sf-gallery-layouts",role:"group","aria-label":l(He),children:le.map(n=>r(V,{content:l(n.label),className:"sf-tile-tip",children:r("button",{type:"button","aria-pressed":o.value===n.value,"aria-label":l(n.label),onClick:()=>t(n.value),children:r("span",{className:"sf-gallery-pic",children:wo(n.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})})},n.value))})})}}}function wo(e){if(!e)return[3,4];const t=e.reduce((o,n)=>o+n,0);return e.map(o=>Math.round(o/t*12))}function yi(){return N(Rn,r(ye,{}),ke,ke[0].value)}function Ei(){return G(vn,r(Ft,{}),Be,Ln,1,Be)}function Ti(e){const t=de(yn,to("`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)."),En(e),Pe(e,void 0));return{type:"custom",render:o=>t.render({...o,value:Pe(e,o.value),onChange:n=>o.onChange(n)})}}function Ri(e,t,o,n,i,a){return{type:"custom",render:({value:s,onChange:c})=>r(h,{label:l(e),icon:r(Re,{noun:a}),action:r(x,{words:b()?.panel,label:l(e),changed:!jn(s),detail:l("the Text style in Site styles"),onReset:()=>c(Yn),defaultAction:{onPress:()=>c(Vn),title:l("Keep this section's own built-in size"),icon:r(mt,{})}}),children:O({min:t,max:o,step:n,value:typeof s=="number"?s:i,suffix:"px",ariaLabel:e,onChange:c})})}}function vi(){return{_gCellWidth:I("Cell width"),gridSpan:N("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:rt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function J(){let e=null;try{e=F(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Po({min:e,max:t,step:o,px:n,label:i,onChange:a,desktopKey:s,fallback:c}){const u=J()[s],p=ie(void 0,u,c);return r(R,{children:O({min:e,max:t,step:o,value:ie(n,u,c),readout:!1,ariaLabel:i,notch:p,onChange:a})})}function ko({label:e,desktopKey:t,fallback:o,changed:n=!1,onReset:i=()=>{}}){const a=J()[t],s=ie(void 0,a,o);return r(x,{words:b()?.panel,label:l(e),changed:n,detail:l("{value} on desktop",{value:`${s}px`}),onReset:i})}function Do(e){return K(e.label,{min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(ko,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Po,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Bo={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"};function Li(e={}){const t=e.keys?.top??"sectionPaddingTop",o=e.keys?.bottom??"sectionPaddingBottom",n=e.group!==!1,i=S=>n?S:Bo[S],a=S=>G(i("Top"),r(At,{}),_.min,_.max,_.step,S,"px"),s=(S,X,E,Q=_)=>L("mobile",Do({label:i(S),desktopKey:X,min:Q.min,max:Q.max,step:Q.step,fallback:E})),c=e.top??_.min,u=e.bottom??_.min,p="sectionPaddingLeft",m="sectionPaddingRight",d=e.sideBounds??_,f=e.side??d.min,g=e.sidePhone??f,C=e.phone===!0,y=S=>C?L("desktop",S):S;return U({...n?{_gSpacing:I("Padding")}:{},[t]:y(a(c)),...C?{[Y(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[o]:y(G(i("Bottom"),r(Lt,{}),_.min,_.max,_.step,u,"px")),...C?{[Y(o)]:s("Bottom",o,u)}:{}},...e.sides?{[p]:y(G(i("Left"),r(Nt,{}),d.min,d.max,d.step,f,"px")),...C?{[Y(p)]:s("Left",p,g,d)}:{},[m]:y(G(i("Right"),r(Ot,{}),d.min,d.max,d.step,f,"px")),...C?{[Y(m)]:s("Right",m,g,d)}:{}}:{}})}const Ho={contained:"Contained",page:"Page",full:"Full"},Z="Width";function Ni(e,t=qn,o=!0){const n=t.map(i=>({label:Jn[i]??Ho[i],value:i}));return U({...o?{_gWidth:I(Z)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(Z),icon:r(Mt,{}),action:o?r(lo,{inherited:a?.inherited??!1,onReset:()=>i(Zn),label:Z}):void 0,children:ue({options:n,value:a?.currentValue||e,onChange:i,ariaLabel:Z})})}})}function Oi(){const e=n=>({type:"custom",render:({value:i,onChange:a})=>T("div",{className:"sf-field",children:[n?T("div",{className:"sf-field-head",children:[r("span",{className:"sf-field-label sf-field-label--inline",children:W}),n(a)]}):null,r("div",{children:ue({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:W})})]})}),t=()=>({type:"custom",render:({value:n,onChange:i,field:a})=>{const s=a?.unit==="%"?"%":"px",c=s==="%"?_n:In;return r("div",{className:"sf-field",children:O({min:c.min,max:c.max,step:c.step,value:typeof n=="number"?n:c.fallback,suffix:s,ariaLabel:W,onChange:i})})}}),o=()=>de("Unit",r(Ee,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return U({_gHeight:I(W),sectionHeightMode:L("desktop",e()),sectionHeightValue:L("desktop",t()),sectionHeightUnit:L("desktop",o()),sectionHeightModePhone:L("mobile",e(n=>r(Go,{onClear:()=>n(void 0)}))),sectionHeightValuePhone:L("mobile",t()),sectionHeightUnitPhone:L("mobile",o())})}function Go({onClear:e}){const t=J(),o=Cn(t),n=Sn(t),i=l("{value} on desktop",{value:n.mode==="auto"?l("Auto"):`${n.value}${n.unit}`});return r(x,{words:b()?.panel,label:l(W),changed:o,detail:i,onReset:e})}function Ai(){return{_gAnchor:I("Anchor"),anchor:fo("Anchor name","e.g. about",co)}}function Fi(e,t,o){return{type:"custom",render:({value:n,onChange:i,id:a,name:s})=>{const c=`${a??s??e}-datetime`,u=Date.parse(typeof n=="string"?n:"");return r(h,{label:l(e),icon:t,htmlFor:c,hint:o===void 0?void 0:l(o),children:r(tn,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:p=>i(p?p.toISOString():"")})})}}}function A(e,t,o){return{type:"custom",render:({value:n,onChange:i,id:a,name:s})=>{const c=typeof n=="boolean"?n:t,u=`${a??s??e}-label`;return r(h,{label:l(e),labelId:u,icon:o,action:r(Jt,{checked:c,onChange:i,ariaLabelledBy:u})})}}}function wi(){return{type:"custom",render:({value:e,onChange:t,id:o,name:n})=>{const i=`${String(o??n??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(Te,{}),htmlFor:i,action:r(Ae,{id:i,label:"Background",value:Ut(e),onChange:t})})}}}function Pi(e,t){return{type:"custom",render:({value:o,onChange:n,id:i})=>{const a=typeof o=="boolean"?o:t,s=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:s,className:"sf-checkbox",action:r(en,{id:s,checked:a,onChange:n})})}}}function ki(e,t){return{type:"custom",render:({value:o,onChange:n})=>r(h,{label:l(e),action:Ae({value:o||t,onChange:n,label:e})})}}const Mo=[{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 je({label:e,value:t,onChange:o,points:n=Mo}){const i=n.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(jt,{label:l(e),value:t,points:i,onChange:o})}function Di(e,t=Oe,o="mediaImage"){return{type:"custom",render:({value:n,onChange:i})=>r("div",{className:"sf-focal-row",children:r(Wo,{label:e,value:n||t,onChange:i,imageProp:o})})}}function Wo({label:e,value:t,onChange:o,imageProp:n}){const{selectedItem:i}=F(s=>s),a=i?.props?.[n];return r(fn,{label:e,value:t,onChange:o,image:typeof a=="string"?a:void 0})}const Uo=Ce([]);function Bi(e,{stacking:t,fallback:o=st}){return{type:"custom",render:({value:n,onChange:i})=>{const a=at.includes(n)?n:o;return t?r(Ko,{label:e,value:a,onChange:i}):qe({label:e,value:a,onChange:i,points:Uo})}}}function Ko({label:e,value:t,onChange:o}){const{appState:n,selectedItem:i}=F(c=>c),a=i?.props?.id?String(i.props.id):void 0,s=a?lt(n?.data,a):[];return qe({label:e,value:t,onChange:o,points:Ce(s,a)})}function qe({label:e,value:t,onChange:o,points:n}){const i=n.find(a=>a.disabled);return r(h,{label:l(e),icon:r(wt,{}),hint:i?.title?l(i.title):void 0,children:je({label:e,value:ct(t),onChange:o,points:n})})}const Hi={top:r(St,{}),right:r(Ct,{}),bottom:r(bt,{}),left:r(xt,{})};function Gi(e,t,o,n,i,a){const s=m=>t.find(d=>d.value===m),c=m=>({value:m,label:"",disabled:!0,title:n}),u=m=>{const d=t.find(g=>g.cell===m);if(!d)return c(`missing-${m}`);const f=a?.[m];return f?{value:d.value,label:d.label,icon:f}:{value:d.value,label:d.label}},p=[c("corner-top-left"),u("top"),c("corner-top-right"),u("left"),c("centre"),u("right"),c("corner-bottom-left"),u("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:m,onChange:d})=>{const f=t.some(g=>g.value===m)?m:o;return r(h,{label:l(e),icon:i,value:s(f)?.label?l(s(f).label):"",children:je({label:e,value:f,onChange:d,points:p})})}}}const Xo="\0note";function N(e,t,o,n,i){return{type:"custom",options:o,fallback:n,...i?{note:i}:{},render:({value:a,onChange:s,field:c})=>{const u=c.options??o,p=c.fallback??n,m=u.some(d=>d.value===a)?a:p;return r(h,{label:l(e),icon:q(t),children:r(Zt,{value:m,ariaLabel:l(e),onChange:s,options:[...i?[{label:l(i),value:Xo,disabled:!0}]:[],...u.map(d=>({label:l(d.label),value:d.value}))]})})}}}function Mi(e,t,o){return{type:"custom",options:t,render:({value:n,onChange:i,field:a})=>r(hn,{label:e,options:(a.options??t).map(s=>({...s,label:l(s.label)})),value:Array.isArray(n)?n:[],onChange:i,...o?{emptyLabel:l(o)}:{}})}}function Wi(e,t,o,n){return{type:"custom",options:t,fallback:o,render:({value:i,onChange:a,field:s})=>r(bn,{label:e,options:(s.options??t).map(c=>({...c,label:l(c.label)})),fallback:s.fallback??o,value:i,onChange:a,placeholder:n===void 0?void 0:l(n)})}}function Ui(e,t={}){return{type:"custom",render:({value:o,onChange:n})=>{const i={value:o,onChange:n,...t};return r(e,{...i})}}}function ue({options:e,value:t,onChange:o,ariaLabel:n,disabled:i=!1}){return r(qt,{options:e.map(a=>({id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)})),value:t,onChange:o,ariaLabel:l(n),disabled:i})}const Ki=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function de(e,t,o,n){const i=o.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:s,field:c})=>r(h,{label:l(e),icon:q(t),children:ue({options:i,value:i.some(u=>u.value===a)?a:a||c?.currentValue||n,onChange:s,ariaLabel:e})})}}function Xi(e,t,o){return{type:"custom",[ge]:!0,render:({value:n,onChange:i})=>r(mn,{value:n||"",onChange:i,label:e,accept:t,placeholder:o})}}const $i={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function zi({value:e,onChange:t,label:o}){const n=e||{},i=!!n.pending,a=i?"var(--fg-dim, #888)":n.ok?"#1d9e75":"#d85a30",s=(c,u)=>t({...n,[c]:u===""?void 0:Number(u)});return T(h,{label:l(o),icon:r(oe,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...n,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),n.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(n.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...n,manual:!n.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:n.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),n.manual&&T("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof n.lat=="number"?n.lat:"",onChange:c=>s("lat",c.target.value)})}),r(h,{label:l("Longitude"),icon:r(oe,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof n.lng=="number"?n.lng:"",onChange:c=>s("lng",c.target.value)})})]})]})}function $o(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function zo(e,t,o){const n=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?n:n.map((i,a)=>a===t?{text:o}:i)}function Vi(e,t){return e===null?null:t>e?e:null}function Vo(e,t,o){if(o===null||o>=t.length)return null;for(let n=0;n<o;n+=1)if(e[n]!==t[n])return null;return e[o]!==t[o]&&t.includes(e[o])||e[o]!==t[o]&&t.length!==e.length?null:o}const Yi={label:"Ticker items",icon:r(vt,{})};function ji(e,t,o,n){return{type:"custom",[v]:{control:"textList",label:e,placeholder:o,itemKey:"text",rendering:n},render:({value:i,onChange:a})=>r(Yo,{label:e,icon:q(t),items:Array.isArray(i)?i:[],placeholder:o,onChange:a,markup:n==="markup"})}}function Yo({label:e,icon:t,items:o,placeholder:n,onChange:i,markup:a=!1}){const s=ee(null),[c,u]=pe(null),p=d=>d.map(f=>({text:f?.text??""})),m=d=>{const f=Vo(o,d,c);f===null&&(s.current=null),u(f),i(p(d))};return r(Qt,{label:l(e),icon:t,noun:l("item"),items:o,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Fe,{target:s,value:$o(o,c),onChange:d=>i(zo(o,c??-1,d)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(d,f,g)=>r("input",{type:"text",className:a&&c===f?"sf-list-marking":void 0,value:d?.text??"",placeholder:l(n),"aria-label":l("{label} {n}",{label:l(e),n:f+1}),onChange:C=>g({text:C.target.value}),onFocus:C=>{s.current=C.currentTarget,u(f)}})})}function qi(e,t){const o=`${e.label} — row ${t+1}`;return H({control:"plainText",label:o,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:n,onChange:i})=>r(B,{value:n,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ji(e){return{_gCards:I("Cards"),coverIndex:N("Cover image",r(Tt,{}),un,String(dn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:xo("Image background",kn),cardImage:jo(),spinOnHover:A("Rotate on hover",e?.spinDefault??!0,r(kt,{}))}}function Zi(){return{outline:N("Card outline",r(Dt,{}),an,cn),indexBadge:N("Card number",r(Ee,{}),ln,sn),showBadge:A("Product badge",!0,r(Re,{noun:"tag"}))}}function Qi(e){const t=e?.bottomDefault??!0;return{_gShowOnCard:I("Show on a card"),showCardPrice:A("Price",!0,r(It,{})),showCardFinishes:A("Finish swatches",!0,r(_t,{})),showCardSizes:A("Sizes",t,r(Pt,{})),showCardBuy:A("Buy button",t,r(ht,{})),showCardPage:A("Page button",t,r(Te,{}))}}function jo(){return K("Card image",{min:M,max:$,step:tt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function el(){return K(ot,{min:M,max:$,step:nt,unsetLabel:"Square",hint:"Rounds the picture. Left alone it stays square."})}function tl(){return{type:"custom",render:({value:e,onChange:t})=>r(qo,{value:typeof e=="string"?e:"",onChange:t})}}function qo({value:e,onChange:t}){const[o,n]=pe(null),i=xe.filter(s=>o===null||w[s].across===o),a=e&&e in w?w[e]:null;return T(R,{children:[r(h,{label:l("Photos in a row"),icon:r(gt,{}),children:T("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":o===null,onClick:()=>n(null),children:l("All")}),it.map(s=>r("button",{type:"button","aria-pressed":o===s,onClick:()=>n(s),children:s},s))]})}),r(h,{label:l("Layout"),icon:r(yt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:xe.length}),children:r("div",{className:"sf-gallery-layouts",children:i.map(s=>r(V,{content:l(w[s].label),className:"sf-tile-tip",children:r("button",{type:"button","aria-pressed":e===s,"aria-label":l(w[s].label),onClick:()=>t(e===s?"":s),children:r("span",{className:"sf-gallery-pic",children:w[s].desktop.map(([c,u],p)=>r("i",{style:{gridColumn:`span ${c}`,gridRow:`span ${u}`}},p))})})},s))})})]})}export{co as ANCHOR_HINT,ti as BOUND_TO_POST_NOTE,ai as BUCKET_ICONS,$i as CUSTOM_FIELD_MEDIA,zi as CoordsField,Hi as EDGE_ARROWS,Oe as FOCAL_DEFAULT,Mo as FOCAL_POINTS,te as FOLD_FIELD_MARKER,je as FocalPicker,bo as GroupLabel,so as HIGHLIGHT_HINT,B as HidableTextField,he as LINK_FIELD_MARKER,qr as Label,ge as MEDIA_FIELD_MARKER,Ki as MEDIA_TYPE_OPTIONS,go as PanelNoteLine,qe as PlacementGridView,be as SCAFFOLD_FIELD_MARKER,il as SCALAR_TEXT_CONTROLS,Ve as SECTION_BLEEDS_HINT,mo as SectionHeading,ue as Segmented,io as SiteGapDefaultReset,O as Slider,$e as Swatches,rl as TEXT_CONTROL_KINDS,v as TEXT_FIELD_MARKER,Yi as TICKER_ITEMS_ROW,Yo as TextListField,lo as WidthDefaultReset,Vo as aimAfterListChange,Ai as anchorFields,D as backTo,fi as backgroundField,Si as boxAlignField,yi as boxBlockSpacingField,Ci as boxJustifyField,Ei as boxPhoneRowField,_i as boxShareField,Ii as boxWrapField,pi as bucketHeader,Ao as cardCornerSidesField,Lo as cardCornersField,xo as cardImageBackgroundField,jo as cardImageField,Ji as cardMediaFields,xi as cardShapeFields,Qi as cardShowFields,Zi as cardStyleFields,vi as cellWidthFields,Pi as checkbox,ki as colorInput,ri as copyText,Fi as dateTime,Ti as directionField,Gi as edgePad,si as entriesHiddenForTab,Di as focalPicker,Vi as focusAfterRemove,ne as foldMetaOf,tl as galleryLayoutField,hi as gapField,I as group,Oi as heightFields,me as hidableText,po as hintIsWhileTyping,q as iconOf,el as imageCornersField,di as isBucketHeader,no as isNoGlyph,ii as linkField,Mi as multiSelect,to as noGlyph,wi as pageBackgroundField,ci as panelNote,Do as phoneOverrideField,Bi as placementField,fo as plainText,li as plainTextarea,K as pxField,fe as readHidable,$o as rowText,Wi as searchSelect,ui as section,bi as sectionAnimationFields,Co as sectionCornerSidesField,Io as sectionCornersField,gi as sectionShapeFields,mi as sectionThemeFields,de as segmented,N as select,zo as setRowText,Ri as sizeField,G as slider,Ui as sourceField,Li as spacingFields,ni as text,Qe as textFieldIdentifier,Qr as textFieldOffPage,ji as textList,qi as textListRowField,oi as textarea,A as toggle,Xi as upload,oo as usePageWidthDetail,ro as useSiteGapDetail,Ni as widthField,ei as withIdentifier,Zr as withOffPage,Jr as withScaffold};
|
|
1
|
+
"use client";import{jsx as r,jsxs as v,Fragment as T}from"react/jsx-runtime";import{cloneElement as ae,useId as Je,useRef as Z,useState as se}from"react";import{useEasel as F,useSelectedFields as Ze}from"efficient-easel/easel";import{say as l,editorEaselWords as b}from"../editor-words.js";import{readHidable as ce,hidableText as ue}from"./hidable.js";import{FOLD_FIELD_MARKER as U,LINK_FIELD_MARKER as de,MEDIA_FIELD_MARKER as pe,SCAFFOLD_FIELD_MARKER as fe,TEXT_FIELD_MARKER as R,foldMetaOf as X,textFieldIdentifier as Qe}from"./field-markers.js";import et from"../../components/ApplyCornersToSiblings.js";import{CARD_IMAGE_RADIUS_STEP as tt,CORNER_RADIUS_MAX as me,CORNER_RADIUS_MIN as L}from"../content/card-image-shape.js";import{IMAGE_CORNER_STEP as nt,IMAGE_CORNERS_LABEL as ot}from"../content/image-corners.js";import{GRID_MAX_COLUMNS as rt}from"../content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as it,GALLERY_LAYOUTS as w,GALLERY_LAYOUT_KEYS as he}from"../content/gallery-layout.js";import{anchorSiblingsOf as lt,HERO_GROUP_PLACEMENTS as at,HERO_GROUP_PLACEMENT_DEFAULT as st,normalisePlacement as ct,placementPoints as ge}from"../hero-group-placement.js";import ut from"../../components/KeepHint.js";import{AdjustIcon as dt,AlignLeftIcon as pt,AlignSeparateIcon as ft,AnimationIcon as be,BackgroundIcon as mt,BlockSectionIcon as ht,CartIcon as gt,ColumnWidthsIcon as xe,ColumnsIcon as bt,CornerIcon as xt,DirectionDownIcon as St,DirectionLeftIcon as Ct,DirectionRightIcon as It,DirectionUpIcon as _t,DollarIcon as yt,FinishIcon as Et,GapIcon as Se,GridIcon as Tt,GroundIcon as Rt,HashIcon as Ce,HeightIcon as Nt,ImageIcon as Ot,ListIcon as At,LocationIcon as Q,PaddingBottomIcon as vt,PaddingLeftIcon as Ft,PaddingRightIcon as Lt,PaddingTopIcon as wt,PageIcon as Ie,PhoneIcon as Pt,PlacementIcon as kt,ProductSizeIcon as Dt,RotateIcon as Ht,SquareIcon as Bt,TypeIcon as Gt,WidthIcon as Mt,WrapIcon as Wt}from"efficient-easel/icons";import{FieldGlyph as _e}from"../../components/FieldGlyph.js";import{resolvePageBackground as Kt}from"../content/page-background.js";import{CORNER_SIDES as ye,CORNER_SIDE_POINTS as Ut,hasOwnSectionCorners as Xt,normalizeCornerSides as Ee}from"../content/section-corners.js";import{SECTION_MOTION_NONE as $t,SECTION_MOTION_OPTIONS as zt}from"../content/section-animation.js";import{enclosingSectionProps as Te}from"./enclosing-section.js";import{SettingsDefaultReset as x,SettingsField as h,SettingsGroupHead as Vt,SettingsGroupSub as jt,SettingsSegmented as Yt,SettingsSwitch as qt}from"efficient-easel/panel";import{FieldSelect as Jt,ListField as Zt}from"efficient-easel/fields";import{AlignmentGrid as Qt,Checkbox as en,CornersInput as tn,DateTimePicker as nn,FOCAL_DEFAULT as Re,Slider as on,Tooltip as $}from"efficient-shell/ui";import{ColourControl as Ne}from"./ColourControl.js";import Oe from"./MarkupToolbar.js";import{deviceField as N}from"./device-fields.js";import{NoControlMark as rn,noControlField as Ae}from"./panel-no-control-mark.js";import{phoneKey as z,resolvePhoneValue as ee}from"./phone-override.js";import{SuppressibleText as ln}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as an,CARD_OUTLINE_OPTIONS as sn,DEFAULT_CARD_INDEX_FORMAT as cn,DEFAULT_CARD_OUTLINE as un}from"../sections/product-card-style.js";import{COVER_INDEX_OPTIONS as dn,DEFAULT_COVER_INDEX as pn}from"../sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as fn}from"./text-control-kinds.js";import mn from"../../components/ImageFocusRow.js";import hn from"../../components/MediaUploadField.js";import gn from"../../components/MultiSelectField.js";import bn from"../../components/SectionThemePicker.js";import xn from"../../components/SearchSelectField.js";import Sn from"../../components/StorefrontLinkField.js";import ve from"../../components/UiIcon.js";import{SECTION_PADDING as _}from"../content/section-padding.js";import{hasPhoneHeight as Cn,resolveSectionMinHeight as In}from"../content/section-min-height.js";import{SECTION_MIN_HEIGHT as _n,SECTION_MIN_HEIGHT_GROUP_LABEL as B,SECTION_SCREEN_PCT as yn}from"../content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as En,containerDirectionPoints as Tn,resolveContainerDirection as Fe}from"../content/container-direction.js";import{BOX_ALIGN_POINTS as Rn,BOX_BLOCK_SPACING_LABEL as Nn,BOX_BLOCK_SPACING_POINTS as Le,BOX_JUSTIFY_POINTS as we,BOX_PHONE_ROW_LABEL as On,BOX_PHONE_ROW_MAX as An,BOX_PHONE_ROW_MIN as Pe,BOX_SHARE_LABEL as ke,BOX_SHARE_POINTS as te,BOX_WRAP_LABEL as vn,BOX_WRAP_POINTS as De}from"../content/box-layout.js";import{usePreviewHeader as V}from"../../components/PreviewHeaderContext.js";import{CONTAINER_GAP as ne,CONTAINER_GAP_BUILT_IN as Fn,GAP_FIELD_CONTAINER as Ln,hasOwnContainerGap as wn,resolveContainerGap as Pn}from"../content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as kn,CARD_IMAGE_BG_OFF as Dn,CARD_IMAGE_BG_SWATCH_NAMES as Hn,CARD_IMAGE_BG_SWATCHES as Bn,isCardImageBackgroundInheriting as Gn,cardImageBackgroundChoice as Mn,THEME_CARD_IMAGE_BG as Wn}from"../content/card-image-background.js";import{SECTION_BG_INHERIT as Kn,SECTION_BG_SWATCHES as Un,SECTION_BG_SWATCH_NAMES as Xn,THEME_SECTION_BG as $n,isSectionBackgroundInheriting as zn}from"../content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Vn}from"../content/section-surface.js";import{TYPE_SIZE_FIXED as jn,TYPE_SIZE_INHERIT as Yn,isTypeSizeInheriting as qn}from"../content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Jn,WIDTH_CHOICE_LABEL as Zn,WIDTH_INHERIT as Qn,resolveWidth as eo,sectionRunsFullWidth as He}from"../content/section-width.js";import{useFoldHeadingLevel as Be}from"./panel-heading-scope.js";import{withStyleKind as to}from"efficient-easel/style-clipboard";function G(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!X(n)&&to(n,`section:${t}`);return e}function jr({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function Ge(){return null}function no(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(Ge,{},e)}function oo(e){return e.type===Ge}function M(e){return oo(e)?void 0:e}function P(e,t){return l("{value} from {from}",{value:e,from:t})}function ro(){const{appState:e}=F(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=eo(t,"full");return n==="page"?P(`${o}px`,l("the page")):n==="contained"?P(l("Contained"),l("the page")):P(l("Full"),l("the page"))}function io(){const{blockGap:e}=V();return e===null?l("this container's own spacing"):P(`${e}px`,l("Site styles"))}function lo({inherited:e,onReset:t,label:n}){return r(x,{words:b()?.panel,label:l(n),changed:!e,detail:io(),onReset:t})}function ao({inherited:e,onReset:t,label:n}){return r(x,{words:b()?.panel,label:l(n),changed:!e,detail:ro(),onReset:t})}function k({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:u,hidden:p}=ce(e),f=Z(null),d=Z(null),m=E=>t(c?{text:E,hidden:p}:E),C=()=>t({text:u,hidden:!p}),g=c&&p,y=Je(),I=i?fo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(ut,{children:l(i)}):void 0,K=p?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(Gt,{}),htmlFor:y,className:g?"is-hidden":void 0,hint:I,action:c?r($,{content:K,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":p,"aria-label":K,onClick:C,children:p?r(ve,{name:"eye-off",size:14}):r(ve,{name:"eye",size:14})})}):void 0,children:v("div",{className:"sf-copybox",children:[s&&r(Oe,{target:a?d:f,value:u,onChange:m}),a?r("textarea",{id:y,ref:d,value:u,placeholder:o===void 0?void 0:l(o),onChange:E=>m(E.target.value)}):r("input",{id:y,ref:f,type:"text",value:u,placeholder:o===void 0?void 0:l(o),onChange:E=>m(E.target.value)})]})})}function Yr(e,t){return{...e,[fe]:t}}function qr(e){const t=e[R];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[R]:{...t,offPage:!0}}}function Jr(e){return!e||typeof e!="object"?!1:e[R]?.offPage===!0}function Zr(e){const t=e[R];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[R]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as ll,SCALAR_TEXT_CONTROLS as al}from"./text-control-kinds.js";const so=new Set(fn),D=(e,t)=>{const n={...t,[R]:e};if(!so.has(e.control))return n;const o=t.render;return{...Ae(n,"authored-copy"),render:i=>r(ln,{name:i.name,children:o(i)})}},Qr="Everything else on this block comes from the linked post. Unlink it to edit by hand.",co="Select a word, then press the highlighter.",uo="A short name so a link can jump straight to this section, like yoursite.com/page#about.",po=new Set([co]),fo=e=>po.has(e);function ei(e,t,n){return D({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(k,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function ti(e,t,n){return D({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(k,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function mo(e,t,n){return D({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(k,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function ni(e,t,n){return D({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(k,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function oi(e){return{type:"custom",[de]:{label:e},render:({value:t,onChange:n})=>r(Sn,{value:ue(t),onChange:n,label:e})}}function ri(e,t,n){return D({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(k,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const ii={Design:dt,Animation:be};function li(e,t){return e.includes("Design")?t!=="Design":null}function ho({label:e}){return r(Vt,{title:l(e),level:Be(1)})}function go({level:e,label:t}){return e===1?r(ho,{label:t}):r(So,{label:t})}function Me(e,t){return{type:"custom",[U]:{label:e,level:t},render:()=>r(go,{level:t,label:e})}}function S(e){return Me(e,2)}function ai(e){return{type:"custom",render:()=>r(bo,{text:e})}}function bo({text:e}){return r("p",{className:"sf-note",children:l(e)})}function si(e){return Me(e,1)}function ci(e){return X(e)!==null&&e?.tabs!==void 0}const We=new Map;function ui(e,t){const n=`${e}\0${t?t.join(""):""}`,o=We.get(n)??{type:"custom",tabs:t,[U]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return We.set(n,o),o}function di(e){return X(e)!==null&&e?.designGroup!==void 0}const Ke=new Map;function pi(e){const t=Ke.get(e)??{type:"custom",[U]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return Ke.set(e,t),t}function xo(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function fi(e,t){return xo(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function mi(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(T,{})}}function So({label:e}){return r(jt,{title:l(e),level:Be(2)})}function Ue({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return v("div",{className:"sf-swatches",children:[e.map(s=>{const u=o?.[s]?l(o[s]):s;return r($,{content:u,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":u})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function hi(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=zn(n,t);return r(h,{label:l(e),icon:r(mt,{}),changed:!i,action:r(x,{words:b()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(Kn)}),children:Ue({swatches:Un,current:i?$n:n??t??"",onPick:o,names:Xn})})}}}function Co(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=Gn(i,t);return r(h,{label:l(e),icon:r(Rt,{}),changed:!a,action:r(x,{words:b()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(kn)}),children:Ue({swatches:Bn,current:a?Wn:Mn(i,t),onPick:o,names:Hn})})}}}function gi(e=n=>n,t){return G({_gSectionTheme:S(Vn),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(bn,{value:e(n),onChange:o,followLabel:t})}})}function W({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:u,disabled:p=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(on,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:u===void 0?void 0:l(u),disabled:p,size:"sm",className:"sf-slider-track",onChange:d=>{d!==null&&d!==o&&i(d)}})})}function H(e,t,n,o,i,a,c="",s){return{type:"custom",render:u=>r(h,{label:l(e),icon:M(t),action:s?s("storedValue"in u?u.storedValue:u.value,u.onChange):void 0,children:W({min:n,max:o,step:i,value:typeof u.value=="number"?u.value:a,suffix:c,ariaLabel:e,onChange:u.onChange})})}}function Xe(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:u}=t;return{type:"custom",render:({value:p,onChange:f})=>{const d=typeof p=="number"?p:null,m=d===null;return r(h,{label:l(e),value:m?u||a===void 0?void 0:l(a):`${d}px`,changed:!m,action:u?ae(u,{changed:!m,onReset:()=>f(null)}):r(x,{words:b()?.panel,label:l(e),changed:!m,onReset:()=>f(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:d,label:e,onChange:f}):W({min:n,max:o,step:i,value:d??n,readout:!1,ariaLabel:e,onChange:f})})}}}function bi(e){const t=H("Gap",r(Se,{}),ne.min,ne.max,ne.step,Fn[e],"px",(n,o)=>r(lo,{inherited:!wn(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[Ln]:e,render:n=>t.render({...n,value:Pn(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const j="Corners";function oe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(j),icon:r(xt,{}),changed:i,action:ae(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(_o,{tier:e,px:o,onRadius:n})})}}}function Io(e){let t=null;try{t=Ze()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function _o({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=Io(e.sidesKey),s=Ee(a)??[...ye];return r(tn,{className:"sf-corners",label:l(j),value:s,corners:Ut,onChange:u=>{const p=Ee(u)??[];c(p.length===ye.length?null:p)},radius:t,onRadiusChange:n,radiusMin:L,radiusMax:me,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function $e(){return Ae({type:"custom",render:()=>r(rn,{})},"always")}function yo({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=V(),i=typeof o=="number"?`${o}px`:l("not set");return r(x,{words:b()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):P(i,l("Site styles")),onReset:n})}function Eo(){const{cornerRadiusPx:e}=V();return typeof e=="number"?e:L}function To(){return oe({sidesKey:"sectionCornerSides",useFollowed:Eo,useClosedReason:()=>Ve()?l(ze):null,mark:r(yo,{label:j}),hint:r(Ro,{})})}const ze="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function Ve(){return He(Y())}function Ro(){return r(T,{children:Ve()?ze:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function xi(){return G({_gShape:S("Shape"),sectionCorners:To(),sectionCornerSides:$e()})}function Si(){return{_gMotion:S("Motion"),sectionAnimation:le("Entrance",r(be,{}),[...zt],$t)}}function re(){let e=null;try{const{appState:t,selectedItem:n}=F(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Te(t?.data,o):null}catch{e=null}return e!==null&&He(e)}function je(e){const{cornerRadiusPx:t}=V(),n=re(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=F(p=>p),u=s?.props?.id?String(s.props.id):void 0;i=u?Te(c?.data,u):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return Xt(a)?a:o}function No({label:e,changed:t=!1,onReset:n=()=>{}}){const o=re(),i=je(L),a=o?"Site":"Section";return r(x,{words:b()?.panel,label:l(e),changed:t,detail:P(`${i}px`,o?l("Site styles"):l("the section")),onReset:n})}function Oo(){return r(T,{children:re()?l("The section is full width, so this card follows Site styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function Ao(){return oe({sidesKey:"cardCornerSides",useFollowed:()=>je(L),mark:r(No,{label:j}),hint:r(Oo,{})})}function vo(){return{type:"custom",render:()=>r(et,{})}}function Ci(){return{_gShape:S("Shape"),cardCorners:Ao(),cardCornerSides:$e(),cardCornersApplyAll:vo()}}function Ii(){return O("Justify",r(ft,{}),we,we[0].value)}function _i(){return O("Item alignment",r(pt,{}),Rn,"stretch")}function yi(){return O(vn,r(Wt,{}),De,De[0].value)}function Ei(){return{type:"custom",render:({value:e,onChange:t})=>{const n=te.find(o=>o.value===e)??te[0];return r(h,{label:l(ke),icon:r(xe,{}),value:l(n.label),children:r("div",{className:"sf-gallery-layouts",role:"group","aria-label":l(ke),children:te.map(o=>r($,{content:l(o.label),className:"sf-tile-tip",children:r("button",{type:"button","aria-pressed":n.value===o.value,"aria-label":l(o.label),onClick:()=>t(o.value),children:r("span",{className:"sf-gallery-pic",children:Fo(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})})},o.value))})})}}}function Fo(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 Ti(){return O(Nn,r(Se,{}),Le,Le[0].value)}function Ri(){return H(On,r(Pt,{}),Pe,An,1,Pe)}function Ni(e){const t=le(En,no("`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)."),Tn(e),Fe(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Fe(e,n.value),onChange:o=>n.onChange(o)})}}function Oi(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(_e,{noun:a}),action:r(x,{words:b()?.panel,label:l(e),changed:!qn(c),detail:l("the Text style in Site styles"),onReset:()=>s(Yn),defaultAction:{onPress:()=>s(jn),title:l("Keep this section's own built-in size"),icon:r(ht,{})}}),children:W({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Ai(){return{_gCellWidth:S("Cell width"),gridSpan:O("Positions",r(xe,{}),[{label:"Auto",value:""},...Array.from({length:rt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function Y(){let e=null;try{e=F(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Lo({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const u=Y()[c],p=ee(void 0,u,s);return r(T,{children:W({min:e,max:t,step:n,value:ee(o,u,s),readout:!1,ariaLabel:i,notch:p,onChange:a})})}function wo({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=Y()[t],c=ee(void 0,a,n);return r(x,{words:b()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function Po(e){return Xe(e.label,{min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(wo,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Lo,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const ko={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"};function vi(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=I=>ko[I],a=I=>H(i("Top"),r(wt,{}),_.min,_.max,_.step,I,"px"),c=(I,K,E,J=_)=>N("mobile",Po({label:i(I),desktopKey:K,min:J.min,max:J.max,step:J.step,fallback:E})),s=e.top??_.min,u=e.bottom??_.min,p="sectionPaddingLeft",f="sectionPaddingRight",d=e.sideBounds??_,m=e.side??d.min,C=e.sidePhone??m,g=e.phone===!0,y=I=>g?N("desktop",I):I;return G({...o?{_gSpacing:S("Padding")}:{},[t]:y(a(s)),...g?{[z(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:y(H(i("Bottom"),r(vt,{}),_.min,_.max,_.step,u,"px")),...g?{[z(n)]:c("Bottom",n,u)}:{}},...e.sides?{[p]:y(H(i("Left"),r(Ft,{}),d.min,d.max,d.step,m,"px")),...g?{[z(p)]:c("Left",p,C,d)}:{},[f]:y(H(i("Right"),r(Lt,{}),d.min,d.max,d.step,m,"px")),...g?{[z(f)]:c("Right",f,C,d)}:{}}:{}})}const Do={contained:"Contained",page:"Page",full:"Full"},q="Width";function Fi(e,t=Jn,n=!0){const o=t.map(i=>({label:Zn[i]??Do[i],value:i}));return G({...n?{_gWidth:S(q)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(q),icon:r(Mt,{}),action:n?r(ao,{inherited:a?.inherited??!1,onReset:()=>i(Qn),label:q}):void 0,children:ie({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:q})})}})}function Li(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:B,icon:M(r(Nt,{})),action:o?o(a):void 0,children:ie({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:B})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?yn:_n;return r("div",{className:"sf-field",children:W({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:B,onChange:i})})}}),n=()=>le("Unit",r(Ce,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return G({_gHeight:S(B),sectionHeightMode:N("desktop",e()),sectionHeightValue:N("desktop",t()),sectionHeightUnit:N("desktop",n()),sectionHeightModePhone:N("mobile",e(o=>r(Ho,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:N("mobile",t()),sectionHeightUnitPhone:N("mobile",n())})}function Ho({onClear:e}){const t=Y(),n=Cn(t),o=In(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(x,{words:b()?.panel,label:l(B),changed:n,detail:i,onReset:e})}function wi(){return{_gAnchor:S("Anchor"),anchor:mo("Anchor name","e.g. about",uo)}}function Pi(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(nn,{id:s,value:Number.isFinite(u)?new Date(u):null,onChange:p=>i(p?p.toISOString():"")})})}}}function A(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,u=`${a??c??e}-label`;return r(h,{label:l(e),labelId:u,icon:n,action:r(qt,{checked:s,onChange:i,ariaLabelledBy:u})})}}}function ki(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(Ie,{}),htmlFor:i,action:r(Ne,{id:i,label:"Background",value:Kt(e),onChange:t})})}}}function Di(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(en,{id:c,checked:a,onChange:o})})}}}function Hi(e,t){return{type:"custom",render:({value:n,onChange:o})=>r(h,{label:l(e),action:Ne({value:n||t,onChange:o,label:e})})}}const Bo=[{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 Ye({label:e,value:t,onChange:n,points:o=Bo}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(Qt,{label:l(e),value:t,points:i,onChange:n})}function Bi(e,t=Re,n="mediaImage"){return{type:"custom",render:({value:o,onChange:i})=>r("div",{className:"sf-focal-row",children:r(Go,{label:e,value:o||t,onChange:i,imageProp:n})})}}function Go({label:e,value:t,onChange:n,imageProp:o}){const{selectedItem:i}=F(c=>c),a=i?.props?.[o];return r(mn,{label:e,value:t,onChange:n,image:typeof a=="string"?a:void 0})}const Mo=ge([]);function Gi(e,{stacking:t,fallback:n=st}){return{type:"custom",render:({value:o,onChange:i})=>{const a=at.includes(o)?o:n;return t?r(Wo,{label:e,value:a,onChange:i}):qe({label:e,value:a,onChange:i,points:Mo})}}}function Wo({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=F(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?lt(o?.data,a):[];return qe({label:e,value:t,onChange:n,points:ge(c,a)})}function qe({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(kt,{}),hint:i?.title?l(i.title):void 0,children:Ye({label:e,value:ct(t),onChange:n,points:o})})}const Mi={top:r(_t,{}),right:r(It,{}),bottom:r(St,{}),left:r(Ct,{})};function Wi(e,t,n,o,i,a){const c=f=>t.find(d=>d.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),u=f=>{const d=t.find(C=>C.cell===f);if(!d)return s(`missing-${f}`);const m=a?.[f];return m?{value:d.value,label:d.label,icon:m}:{value:d.value,label:d.label}},p=[s("corner-top-left"),u("top"),s("corner-top-right"),u("left"),s("centre"),u("right"),s("corner-bottom-left"),u("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:d})=>{const m=t.some(C=>C.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:Ye({label:e,value:m,onChange:d,points:p})})}}}const Ko="\0note";function O(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const u=s.options??n,p=s.fallback??o,f=u.some(d=>d.value===a)?a:p;return r(h,{label:l(e),icon:M(t),children:r(Jt,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Ko,disabled:!0}]:[],...u.map(d=>({label:l(d.label),value:d.value}))]})})}}}function Ki(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(gn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function Ui(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(xn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function Xi(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function ie({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(Yt,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const $i=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function le(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:M(t),children:ie({options:i,value:i.some(u=>u.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function zi(e,t,n){return{type:"custom",[pe]:!0,render:({value:o,onChange:i})=>r(hn,{value:o||"",onChange:i,label:e,accept:t,placeholder:n})}}const Vi={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ji({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=(s,u)=>t({...o,[s]:u===""?void 0:Number(u)});return v(h,{label:l(n),icon:r(Q,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&v("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(Q,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:s=>c("lat",s.target.value)})}),r(h,{label:l("Longitude"),icon:r(Q,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:s=>c("lng",s.target.value)})})]})]})}function Uo(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Xo(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function Yi(e,t){return e===null?null:t>e?e:null}function $o(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 qi={label:"Ticker items",icon:r(At,{})};function Ji(e,t,n,o){return{type:"custom",[R]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r(zo,{label:e,icon:M(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function zo({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=Z(null),[s,u]=se(null),p=d=>d.map(m=>({text:m?.text??""})),f=d=>{const m=$o(n,d,s);m===null&&(c.current=null),u(m),i(p(d))};return r(Zt,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Oe,{target:c,value:Uo(n,s),onChange:d=>i(Xo(n,s??-1,d)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(d,m,C)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:d?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:g=>C({text:g.target.value}),onFocus:g=>{c.current=g.currentTarget,u(m)}})})}function Zi(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:i})=>r(k,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Qi(e){return{_gCards:S("Cards"),coverIndex:O("Cover image",r(Ot,{}),dn,String(pn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Co("Image background",Dn),cardImage:Vo(),spinOnHover:A("Rotate on hover",e?.spinDefault??!0,r(Ht,{}))}}function el(){return{outline:O("Card outline",r(Bt,{}),sn,un),indexBadge:O("Card number",r(Ce,{}),an,cn),showBadge:A("Product badge",!0,r(_e,{noun:"tag"}))}}function tl(e){const t=e?.bottomDefault??!0;return{_gShowOnCard:S("Show on a card"),showCardPrice:A("Price",!0,r(yt,{})),showCardFinishes:A("Finish swatches",!0,r(Et,{})),showCardSizes:A("Sizes",t,r(Dt,{})),showCardBuy:A("Buy button",t,r(gt,{})),showCardPage:A("Page button",t,r(Ie,{}))}}function Vo(){return Xe("Card image",{min:L,max:me,step:tt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function nl(){return oe({sidesKey:"cornerSides",step:nt,useFollowed:()=>L,mark:r(jo,{label:ot}),hint:l("Rounds the picture. Left alone it stays square.")})}function jo({label:e,changed:t=!1,onReset:n=()=>{}}){return r(x,{words:b()?.panel,label:l(e),changed:t,onReset:n})}function ol(){return{type:"custom",render:({value:e,onChange:t})=>r(Yo,{value:typeof e=="string"?e:"",onChange:t})}}function Yo({value:e,onChange:t}){const[n,o]=se(null),i=he.filter(c=>n===null||w[c].across===n),a=e&&e in w?w[e]:null;return v(T,{children:[r(h,{label:l("Photos in a row"),icon:r(bt,{}),children:v("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),it.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(Tt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:he.length}),children:r("div",{className:"sf-gallery-layouts",children:i.map(c=>r($,{content:l(w[c].label),className:"sf-tile-tip",children:r("button",{type:"button","aria-pressed":e===c,"aria-label":l(w[c].label),onClick:()=>t(e===c?"":c),children:r("span",{className:"sf-gallery-pic",children:w[c].desktop.map(([s,u],p)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${u}`}},p))})})},c))})})]})}export{uo as ANCHOR_HINT,Qr as BOUND_TO_POST_NOTE,ii as BUCKET_ICONS,Vi as CUSTOM_FIELD_MEDIA,ji as CoordsField,Mi as EDGE_ARROWS,Re as FOCAL_DEFAULT,Bo as FOCAL_POINTS,U as FOLD_FIELD_MARKER,Ye as FocalPicker,So as GroupLabel,co as HIGHLIGHT_HINT,k as HidableTextField,de as LINK_FIELD_MARKER,jr as Label,pe as MEDIA_FIELD_MARKER,$i as MEDIA_TYPE_OPTIONS,bo as PanelNoteLine,qe as PlacementGridView,fe as SCAFFOLD_FIELD_MARKER,al as SCALAR_TEXT_CONTROLS,ze as SECTION_BLEEDS_HINT,ho as SectionHeading,ie as Segmented,lo as SiteGapDefaultReset,W as Slider,Ue as Swatches,ll as TEXT_CONTROL_KINDS,R as TEXT_FIELD_MARKER,qi as TICKER_ITEMS_ROW,zo as TextListField,ao as WidthDefaultReset,$o as aimAfterListChange,wi as anchorFields,P as backTo,hi as backgroundField,_i as boxAlignField,Ti as boxBlockSpacingField,Ii as boxJustifyField,Ri as boxPhoneRowField,Ei as boxShareField,yi as boxWrapField,ui as bucketHeader,Ao as cardCornersField,Co as cardImageBackgroundField,Vo as cardImageField,Qi as cardMediaFields,Ci as cardShapeFields,tl as cardShowFields,el as cardStyleFields,Ai as cellWidthFields,Di as checkbox,Hi as colorInput,ni as copyText,$e as cornerSidesField,oe as cornersRowField,Pi as dateTime,pi as designGroupHeader,Ni as directionField,Wi as edgePad,li as entriesHiddenForTab,Bi as focalPicker,Yi as focusAfterRemove,fi as foldMarker,X as foldMetaOf,xo as foldTitleOf,ol as galleryLayoutField,bi as gapField,S as group,Li as heightFields,ue as hidableText,fo as hintIsWhileTyping,M as iconOf,nl as imageCornersField,ci as isBucketHeader,di as isDesignGroupHeader,oo as isNoGlyph,oi as linkField,Ki as multiSelect,no as noGlyph,ki as pageBackgroundField,ai as panelNote,Po as phoneOverrideField,Gi as placementField,mo as plainText,ri as plainTextarea,Xe as pxField,mi as quietMarker,ce as readHidable,Uo as rowText,Ui as searchSelect,si as section,Si as sectionAnimationFields,To as sectionCornersField,xi as sectionShapeFields,gi as sectionThemeFields,le as segmented,O as select,Xo as setRowText,Oi as sizeField,H as slider,Xi as sourceField,vi as spacingFields,ei as text,Qe as textFieldIdentifier,Jr as textFieldOffPage,Ji as textList,Zi as textListRowField,ti as textarea,A as toggle,zi as upload,ro as usePageWidthDetail,io as useSiteGapDetail,Fi as widthField,Zr as withIdentifier,qr as withOffPage,Yr as withScaffold};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BUCKET_KEY } from "efficient-easel/screen/lib/puck/field-buckets";
|
|
1
|
+
export { BUCKET_KEY, DESIGN_GROUP_KEY } from "efficient-easel/screen/lib/puck/field-buckets";
|
|
2
2
|
export type { Bucket } from "efficient-easel/screen/lib/puck/field-buckets";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BUCKET_KEY as
|
|
1
|
+
import{BUCKET_KEY as _,DESIGN_GROUP_KEY as o}from"efficient-easel/screen/lib/puck/field-buckets";export{_ as BUCKET_KEY,o as DESIGN_GROUP_KEY};
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DESIGN_GROUPS, type DesignGroup } from "efficient-easel/panel";
|
|
2
|
+
import { BUCKET_KEY, DESIGN_GROUP_KEY, type Bucket } from "./field-buckets.js";
|
|
3
|
+
export declare const BUCKETS: readonly ["Design", "Animation"];
|
|
3
4
|
export type { Bucket };
|
|
4
|
-
export {
|
|
5
|
+
export { DESIGN_GROUPS };
|
|
6
|
+
export type { DesignGroup };
|
|
7
|
+
export type Place = DesignGroup | "Animation";
|
|
8
|
+
export declare function bucketOfPlace(place: Place): Bucket;
|
|
9
|
+
export { BUCKET_KEY, DESIGN_GROUP_KEY };
|
|
10
|
+
export declare const EDITOR_ONLY_GROUP = "Editor only \u2014 not shown live";
|
|
11
|
+
export declare const LABEL_GROUP: Readonly<Record<string, Place>>;
|
|
12
|
+
export declare const KEY_GROUP: Readonly<Record<string, Place>>;
|
|
13
|
+
export declare const BLOCK_KEY_GROUP: Readonly<Record<string, Place>>;
|
|
14
|
+
export declare function placeOf(where: string, key: string, label: string): Place | undefined;
|
|
15
|
+
export declare function bucketOf(where: string, key: string, label: string): Bucket | undefined;
|
|
16
|
+
export declare function headerKeysOfPlace(place: Place): string[];
|
|
17
|
+
export declare function headerKeysOf(...builders: Record<string, unknown>[]): string[];
|
|
5
18
|
export declare const LAYOUT_FIELD_KEYS: readonly string[];
|
|
6
19
|
export declare const SECTION_THEME_FIELD_KEYS: readonly string[];
|
|
7
20
|
export declare const SECTION_SHAPE_FIELD_KEYS: readonly string[];
|
|
@@ -10,14 +23,12 @@ export declare const CARD_MEDIA_FIELD_KEYS: readonly string[];
|
|
|
10
23
|
export declare const BOUND_CARD_MEDIA_FIELD_KEYS: readonly string[];
|
|
11
24
|
export declare const CARD_STYLE_FIELD_KEYS: readonly string[];
|
|
12
25
|
export declare const CARD_SHOW_FIELD_KEYS: readonly string[];
|
|
13
|
-
export declare const EDITOR_ONLY_GROUP = "Editor only \u2014 not shown live";
|
|
14
|
-
export declare const LABEL_BUCKET: Record<string, Bucket>;
|
|
15
|
-
export declare const KEY_BUCKET: Readonly<Record<string, Bucket>>;
|
|
16
|
-
export declare function bucketOf(where: string, key: string, label: string): Bucket | undefined;
|
|
17
26
|
export declare const RETIRED: Readonly<Record<string, string>>;
|
|
27
|
+
export declare const PLACE_WORDS: Readonly<Record<Place, readonly string[]>>;
|
|
28
|
+
export declare const INJECTED_RETIRED: Readonly<Record<string, string>>;
|
|
18
29
|
export declare function foldTopTier(fields: Record<string, unknown>): 1 | 2;
|
|
19
30
|
export declare function retiredHeadings(where: string): string[];
|
|
20
31
|
export declare function assignSectionGroups<T extends Record<string, unknown>>(fields: T, where: string): T;
|
|
21
|
-
export declare function
|
|
32
|
+
export declare function seatDesignBucket<T extends Record<string, unknown>>(fields: T): T;
|
|
22
33
|
export declare function hasBucketTabs(fields: Record<string, unknown>): boolean;
|
|
23
34
|
export declare function reseatBucketTabs<T extends Record<string, unknown>>(fields: T): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{anchorFields as m,bucketHeader as p,cardMediaFields as B,cardShowFields as E,cardStyleFields as w,foldMetaOf as y,group as T,heightFields as O,sectionAnimationFields as F,sectionShapeFields as I,sectionThemeFields as x,spacingFields as A,widthField as H}from"./controls.js";import{deviceField as R,deviceMetaOf as D}from"./device-fields.js";import{SETTINGS_BUCKETS as $}from"efficient-easel/panel";import{BUCKET_KEY as i}from"./field-buckets.js";const s=$,V=[i.Layout,...Object.keys(A({phone:!0})),...Object.keys(H("full")),...Object.keys(O()),...Object.keys(m())],z=[i.Style,...Object.keys(x())],X=[i.Style,...Object.keys(I())],Z=[i.Animation,...Object.keys(F())],K=Object.keys(B()),M=new Set(["cardImage","imageBackground"]),ee=[i.Style,...K.filter(o=>o.startsWith("_g")||M.has(o))],te=Object.keys(w()),oe=Object.keys(E({bottomDefault:!0})),P="Editor only — not shown live",v={"Archive link":"Content",Article:"Content",Boxes:"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","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",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":"Style",Gallery:"Style",Image:"Style","Image column":"Style",Images:"Style",Logo:"Style",Media:"Style","Background image":"Style",Color:"Style","Image tint":"Style",Style:"Style",Shape:"Style",Texture:"Style","Text style":"Style",Motion:"Animation",Animation:"Animation",Anchor:"Layout",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Layout",Behavior:"Layout",Controls:"Layout",Diagram:"Layout",[P]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Nudge:"Layout","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:"Layout",Height:"Layout"},_={"AlloyWheelsListing._gCards":"Style","ProductGrid._gCards":"Style"};function j(o,t,n){return _[`${o}.${t}`]??v[n]}const G={"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)","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)","BrandStrip._gContent":"duplicated the Content bucket header above it (66338)","BrandStrip._gStyle":"duplicated the Style bucket header above it (66338)","BrandStrip._gLayout":"duplicated the Layout bucket header above it (66338)","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)"};function ne(o){const t=new Set(Object.values(i));for(const[n,d]of Object.entries(o))if(!t.has(n)&&y(d)?.level===1)return 1;return 2}function Y(o){const t=`${o}.`;return Object.keys(G).filter(n=>n.startsWith(t)).map(n=>n.slice(t.length))}function N(o,t){const n=D(o),d=T(t);return n?R(n.tier,d):d}function ae(o,t){const n=[],d=new Set(Y(t)),g=new Set;let h=null;for(const[e,r]of Object.entries(o)){const a=y(r);if(!a){h||n.push(h={bucket:"Content",entries:[]}),h.entries.push([e,r]);continue}if(d.has(e)){const l=v[a.label];if(a.level!==2||!l||a.label!==l)throw new Error(`${t}.${e}: RETIRED (lib/puck/field-groups.ts) lists this sub-heading as one whose name duplicates its bucket, but it is a level-${a.level} "${a.label}" header in the ${l??"(unclassified)"} bucket. Only a level-2 header whose label IS its bucket's name may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);g.add(e),n.push(h={bucket:l,entries:[]});continue}const c=j(t,e,a.label);if(!c)throw new Error(`${t}.${e}: the inspector group "${a.label}" is not classified in LABEL_BUCKET (lib/puck/field-groups.ts), so there is no way to say which of ${s.join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);const u=e===i[c]&&a.level===1;if(!u&&e===i[c])throw new Error(`${t}.${e}: that key is reserved for the ${c} bucket header, but this field is a level-${a.level} "${a.label}" header, so it cannot serve as one. Rename the section's own field.`);n.push(h={bucket:c,entries:[[e,u||a.level===2?r:N(r,a.label)]],isBucketHeader:u})}const f=new Set(Object.entries(o).filter(([,e])=>y(e)).map(([e])=>e)),k=Object.keys(_).filter(e=>e.startsWith(`${t}.`)).filter(e=>!f.has(e.slice(t.length+1)));if(k.length)throw new Error(`${t}: KEY_BUCKET (lib/puck/field-groups.ts) lists ${JSON.stringify(k)}, 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 b=n.some(e=>e.isBucketHeader)?[]:[...d].filter(e=>!g.has(e));if(b.length)throw new Error(`${t}: RETIRED (lib/puck/field-groups.ts) lists ${JSON.stringify(b)}, but this section has no such fold header${b.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.`);for(const e of s){const r=i[e];if(r in o&&!n.some(a=>a.isBucketHeader&&a.entries[0]?.[0]===r))throw new Error(`${t}.${r} is reserved for the ${e} bucket header but is not a level-1 "${e}" fold header. Rename the section's own field.`)}const S=s.filter(e=>n.some(r=>r.bucket===e)),C={};for(const e of s){const r=n.filter(u=>u.bucket===e);if(!r.length)continue;const a=r.findIndex(u=>u.isBucketHeader);a>0&&r.unshift(...r.splice(a,1));const c=p(e,e===S[0]?S:null);a<0&&(C[i[e]]=c);for(const u of r)for(const[l,L]of u.entries)C[l]=u.isBucketHeader&&l===i[e]?c:L}return C}function ie(o){return i.Content in o?o:{[i.Content]:p("Content",null),...o}}function re(o){return s.some(t=>i[t]in o)}function de(o){const t=s.filter(d=>i[d]in o);if(t.length===0)return o;const n={...o};for(const d of t)n[i[d]]=p(d,d===t[0]?t:null);return n}export{ee as BOUND_CARD_MEDIA_FIELD_KEYS,s as BUCKETS,i as BUCKET_KEY,K as CARD_MEDIA_FIELD_KEYS,oe as CARD_SHOW_FIELD_KEYS,te as CARD_STYLE_FIELD_KEYS,P as EDITOR_ONLY_GROUP,_ as KEY_BUCKET,v as LABEL_BUCKET,V as LAYOUT_FIELD_KEYS,G as RETIRED,Z as SECTION_ANIM_FIELD_KEYS,X as SECTION_SHAPE_FIELD_KEYS,z as SECTION_THEME_FIELD_KEYS,ae as assignSectionGroups,j as bucketOf,ne as foldTopTier,re as hasBucketTabs,de as reseatBucketTabs,Y as retiredHeadings,ie as seatContentBucket};
|
|
1
|
+
import{anchorFields as m,bucketHeader as L,cardMediaFields as N,cardShowFields as Y,cardStyleFields as U,designGroupHeader as x,foldMarker as W,foldMetaOf as h,group as z,quietMarker as q,heightFields as E,sectionAnimationFields as w,sectionShapeFields as O,sectionThemeFields as D,spacingFields as B,widthField as T}from"./controls.js";import{deviceField as J,deviceMetaOf as F}from"./device-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as Q}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"./field-buckets.js";const A=Q;function V(e){return e==="Animation"?"Animation":"Design"}const X="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Boxes:"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","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",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",Texture:"Design","Text style":"Design",Motion:"Animation",Animation:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Controls:"Layout",Diagram:"Layout",[X]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Nudge:"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"},P={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},$={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return $[a]??P[a]??I[o]}function se(e,t,o){const a=_(e,t,o);return a?V(a):void 0}function G(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=F(a),p=h(C?C.inner:a),u=p?I[p.label]:void 0;if(u)for(const g of G(u))t.includes(g)||t.push(g)}return t}const he=[...S(B({phone:!0}),T("full"),E(),m()),...Object.keys(B({phone:!0})),...Object.keys(T("full")),...Object.keys(E()),...Object.keys(m())],be=[...S(D()),...Object.keys(D())],Ce=[...S(O()),...Object.keys(O())],pe=[...S(w()),...Object.keys(w())],Z=Object.keys(N()),ee=new Set(["cardImage","imageBackground"]),ge=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...Z.filter(e=>e.startsWith("_g")||ee.has(e))],ye=Object.keys(U()),ke=Object.keys(Y({bottomDefault:!0})),te={"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)","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)","BrandStrip._gContent":"duplicated the Content bucket header above it (66338)","BrandStrip._gStyle":"duplicated the Style bucket header above it (66338)","BrandStrip._gLayout":"duplicated the Layout bucket header above it (66338)","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)"},H={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},K={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...B({phone:!0}),...T("full"),...E(),...m(),...D(),...O(),...w()};for(const t of Object.keys(K)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!H[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/puck/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 ne=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),oe=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function _e(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ae(e){const t=`${e}.`;return Object.keys(te).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function ie(e,t){const o=F(e),a=z(t);return o?J(o.tier,a):a}function re(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?W(t,o.label):q(t):t}function M(e){return e==="Design"?k:["Animation"]}function Se(e,t){const o=[],a=new Set(ae(t)),C=new Set;let p=!1,u=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(ne.has(n))throw new Error(`${t}.${n}: 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=oe.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: 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.`);(n===d.Design||n===d.Animation)&&(p=!0),o.push(u={place:c,entries:[],adopted:!0});continue}if(!i){u||o.push(u={place:"Content",entries:[]}),u.entries.push([n,r]);continue}if(a.has(n)||n in K){const s=_(t,n,i.label);if(i.level!==2||!s||!H[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/puck/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(n)&&C.add(n),o.push(u={place:s,entries:[]});continue}const l=_(t,n,i.label);if(!l)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/puck/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.`);o.push(u={place:l,entries:[[n,i.level===2?r:ie(r,i.label)]]})}const g=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",$],["KEY_GROUP",P]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!g.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/puck/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=p?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/puck/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 R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>M(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of M(n)){if(!R.has(r))continue;const i=o.filter(l=>l.place===r),c=i.findIndex(l=>l.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=x(r));for(const l of i)for(const[s,j]of l.entries)y[s]=re(r,j)}}return y}function ve(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:x("Content"),...e}}function fe(e){return A.some(t=>d[t]in e)}function me(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{$ as BLOCK_KEY_GROUP,ge as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,Z as CARD_MEDIA_FIELD_KEYS,ke as CARD_SHOW_FIELD_KEYS,ye as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,X as EDITOR_ONLY_GROUP,K as INJECTED_RETIRED,P as KEY_GROUP,I as LABEL_GROUP,he as LAYOUT_FIELD_KEYS,H as PLACE_WORDS,te as RETIRED,pe as SECTION_ANIM_FIELD_KEYS,Ce as SECTION_SHAPE_FIELD_KEYS,be as SECTION_THEME_FIELD_KEYS,Se as assignSectionGroups,se as bucketOf,V as bucketOfPlace,_e as foldTopTier,fe as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,me as reseatBucketTabs,ae as retiredHeadings,ve as seatDesignBucket};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface BandRow {
|
|
2
|
+
shown: boolean;
|
|
3
|
+
labelled: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface DrawnBand {
|
|
6
|
+
key: string;
|
|
7
|
+
rows: readonly BandRow[];
|
|
8
|
+
}
|
|
9
|
+
export declare const TEXT_BAND_KEY = " text";
|
|
10
|
+
export declare const TEXT_BAND_TITLE = "Text";
|
|
11
|
+
export declare function bandIsDropped(band: DrawnBand): boolean;
|
|
12
|
+
export declare function droppedBands(bands: readonly DrawnBand[]): string[];
|
|
13
|
+
export declare function withoutBands<T extends Record<string, unknown>>(fields: T, keys: ReadonlySet<string>): T;
|
|
14
|
+
export declare function sameKeys(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f=" text",u="Text";function s(t){const e=t.rows.filter(o=>o.shown);return e.length===1&&e[0].labelled}function i(t){return t.filter(s).map(e=>e.key)}function l(t,e){let o=null;for(const r of e){const n=t[r];!n||n.marker!==!0||typeof n.fold!="string"||(o??={...t},o[r]={...n,fold:!1})}return o??t}function p(t,e){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}export{f as TEXT_BAND_KEY,u as TEXT_BAND_TITLE,s as bandIsDropped,i as droppedBands,p as sameKeys,l as withoutBands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{foldMetaOf as
|
|
1
|
+
import{foldMetaOf as w,isBucketHeader as E}from"./controls.js";import{deviceMetaOf as k}from"./device-fields.js";import{BUCKET_KEY as h,DESIGN_GROUP_KEY as M,hasBucketTabs as O,reseatBucketTabs as x,seatDesignBucket as B}from"./field-groups.js";import{isStructuralTextProp as C}from"./neutralization-contracts.js";import{noControlMetaOf as D}from"./panel-no-control-mark.js";import{fieldDrawsEntryRow as y}from"./text-parts.js";function S(e,n){const r=k(n),s=r?r.inner:n;if(w(s))return!1;if(s?.type==="slot")return!0;const o=D(s);return o==="always"?!1:o==="authored-copy"?C(e):!0}function d(e){const n=k(e),r=n?n.inner:e,s=w(r);return s?E(r)?0:s.level:null}function T(e,n,r){return r?n===0&&e===h.Design||n===1&&e===M.Content:!1}const b=new WeakMap,R=new WeakMap;function U(e,n="section"){const r=n==="page"?R:b,s=r.get(e);if(s)return s;const o=Object.entries(e).map(([t,a])=>({key:t,field:a,level:d(a),draws:S(t,a)||n==="page"&&d(a)===null&&y(t,a)})),f=n==="section"&&o.some(t=>y(t.key,t.field)),i=new Set;for(let t=0;t<o.length;t++){const a=o[t].level;if(a===null)continue;let m=0;for(let c=t+1;c<o.length;c++){const g=o[c].level;if(g!==null&&g<=a)break;o[c].draws&&(m+=1)}m===0&&!T(o[t].key,a,f)&&i.add(o[t].key)}const l=f&&O(e),v=l&&!(h.Design in e);if(!i.size&&!v)return r.set(e,e),e;const u={};for(const t of o)i.has(t.key)||(u[t.key]=t.field);const p=x(l?B(u):u);return r.set(e,p),p}export{S as drawsControlOnSectionScreen,U as dropEmptyHeadings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const i=new Set(["Reviews","Cards","FAQ","Prose","ProductHero","SpecTable","ProductGrid","ParagraphsA","KeyFeatures","Stats","StatsParagraph","Chart","Mockup","Testimonials","Logos","ContactRouting","ContactLocations","SubmitBuild","ReviewForm","Form","AppointmentBooking","OrderSummary","DeliveryOptions","PaymentBadges","CheckoutCTA","Collections","AlloyWheelsListing","CatalogFilterBar","FitmentFinder","GalleryB","BrandStrip","DocMasthead","DocBody","DocMetaCards","Masthead","FeaturedCover","LongRead","Series","Events","SectionHeader","Grid","Flex","Spacer","Divider","CustomHTML","Breadcrumb","CategoryBar","DocTabs","Hero","HeroSingle","IntroBleed","Manifesto","Timeline","TimelineTrack","Footprint","Banner","TitleWithButtons","Ticker","SubscribeBlogs","TyreSizes","TyreFitment","EuTyreLabel","SpecStrip","ProcessSteps","DetailRows","FitmentTable","CompatibleTyres","RelatedProducts","BundleOffer","Split","Gallery","Subscribe"]),a={name:"sectionGroups",applies:(e,o)=>o.isSection(e)&&(i.has(e)||o.isHostBlock(e)),panel(e,o,t){const r=t.assignSectionGroups;e?.fields&&(e.fields=r(e.fields,o))}},s=new Set(["HeroSlide","Heading","Text","ImageBlock","ButtonBlock","HeroGroup","GalleryItem","Footer","FooterLogo","FooterMenu","FooterGroup","FooterText","PostCard","LogoBlock","CollectionCard","Eyebrow","BookingBox","SubmitBox","FooterSocial","MenuBlock","SocialLogosBlock","EmailFormBlock","SearchBlock","CartBlock"]),n={name:"blockGroups",applies:e=>s.has(e),panel(e,o,t){const r=t.assignSectionGroups;e?.fields&&(e.fields=r(e.fields,o))}};export{n as blockGroups,a as sectionGroups};
|
|
1
|
+
const i=new Set(["Reviews","Cards","FAQ","Prose","ProductHero","SpecTable","ProductGrid","ParagraphsA","KeyFeatures","Stats","StatsParagraph","Chart","Mockup","Testimonials","Logos","ContactRouting","ContactLocations","SubmitBuild","ReviewForm","Form","AppointmentBooking","OrderSummary","DeliveryOptions","PaymentBadges","CheckoutCTA","Collections","AlloyWheelsListing","CatalogFilterBar","FitmentFinder","GalleryB","BrandStrip","DocMasthead","DocBody","DocMetaCards","Masthead","FeaturedCover","LongRead","Series","Events","SectionHeader","Grid","Flex","Spacer","Divider","CustomHTML","Breadcrumb","CategoryBar","DocTabs","Hero","HeroSingle","IntroBleed","Manifesto","Timeline","TimelineTrack","Footprint","Banner","TitleWithButtons","Ticker","SubscribeBlogs","TyreSizes","TyreFitment","EuTyreLabel","SpecStrip","ProcessSteps","DetailRows","FitmentTable","CompatibleTyres","RelatedProducts","BundleOffer","Split","Gallery","Subscribe","Countdown"]),a={name:"sectionGroups",applies:(e,o)=>o.isSection(e)&&(i.has(e)||o.isHostBlock(e)),panel(e,o,t){const r=t.assignSectionGroups;e?.fields&&(e.fields=r(e.fields,o))}},s=new Set(["HeroSlide","Heading","Text","ImageBlock","ButtonBlock","HeroGroup","GalleryItem","Footer","FooterLogo","FooterMenu","FooterGroup","FooterText","PostCard","LogoBlock","CollectionCard","Eyebrow","BookingBox","SubmitBox","FooterSocial","MenuBlock","SocialLogosBlock","EmailFormBlock","SearchBlock","CartBlock"]),n={name:"blockGroups",applies:e=>s.has(e),panel(e,o,t){const r=t.assignSectionGroups;e?.fields&&(e.fields=r(e.fields,o))}};export{n as blockGroups,a as sectionGroups};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@tabler/icons-react": "^3.46.0",
|
|
43
|
-
"efficient-easel": "^
|
|
44
|
-
"efficient-shell": "^7.
|
|
43
|
+
"efficient-easel": "^6.2.0",
|
|
44
|
+
"efficient-shell": "^7.22.1",
|
|
45
45
|
"isomorphic-dompurify": "^3.18.0",
|
|
46
46
|
"next": ">=16",
|
|
47
47
|
"react": ">=19",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@types/node": "^20",
|
|
60
60
|
"@types/react": "^19",
|
|
61
61
|
"@types/react-dom": "^19",
|
|
62
|
-
"efficient-easel": "^
|
|
63
|
-
"efficient-shell": "^7.
|
|
62
|
+
"efficient-easel": "^6.2.0",
|
|
63
|
+
"efficient-shell": "^7.23.1",
|
|
64
64
|
"esbuild": "^0.28.0",
|
|
65
65
|
"happy-dom": "^20.14.5",
|
|
66
66
|
"isomorphic-dompurify": "^3.18.0",
|