efficient-web-builder 2.1.0 → 3.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 +30 -0
- package/README.md +7 -0
- package/dist/components/PartInkControl.js +1 -1
- package/dist/components/SectionEditor.js +1 -1
- package/dist/components/StylesPanel.js +1 -1
- package/dist/components/SwitchToBoxFooter.js +1 -1
- package/dist/components/TextStyleRow.js +1 -1
- package/dist/components/TextStylesField.js +1 -1
- package/dist/components/WebsiteScreenParts.js +1 -1
- package/dist/components/WebsiteSettingsPanel.d.ts +5 -9
- package/dist/components/WebsiteSettingsPanel.js +1 -1
- package/dist/components/storefront-editor.css +242 -335
- package/dist/lib/puck/ColourControl.d.ts +5 -0
- package/dist/lib/puck/ColourControl.js +1 -1
- package/dist/lib/puck/controls.d.ts +0 -10
- package/dist/lib/puck/controls.js +1 -1
- package/dist/lib/source-rules/label-vocabulary.js +4 -4
- package/dist/lib/source-rules/one-colour-control.js +2 -2
- package/dist/lib/source-rules/support/label-extraction.js +5 -5
- package/package.json +5 -5
- package/dist/lib/puck/slider-typing.d.ts +0 -9
- package/dist/lib/puck/slider-typing.js +0 -1
|
@@ -9,3 +9,8 @@ export declare function ColourControl({ value, onChange, label, id, caption, inh
|
|
|
9
9
|
after?: ReactNode;
|
|
10
10
|
ariaLabel?: string;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
12
|
+
export declare function AnyColourSwatch({ value, onChange, label, }: {
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (next: string) => void;
|
|
15
|
+
label: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s,jsxs as p}from"react/jsx-runtime";import{ColorPicker as h,HexInput as x}from"efficient-shell/ui";import{typedHex as u}from"efficient-easel/pick";import{usePreviewHeader as C}from"../../components/PreviewHeaderContext.js";import{themeSwatches as w}from"./theme-swatches.js";function S({value:e,onChange:o,label:r,id:n,caption:l,inherited:t,after:a,ariaLabel:c}){return s(b,{value:e,onChange:o,label:c??r,id:n,caption:l,inherited:t,after:a})}function g(){const{theme:e}=C();return w(e).map(o=>({value:o.value,label:o.name}))}function b({value:e,onChange:o,label:r,id:n,caption:l,inherited:t,after:a}){const c=g(),i=e?null:u(t??""),f=l!==void 0&&(!e||u(l)!==u(e))?l:null,d=m=>{m!==e&&o(m)};return p("div",{className:"sf-colour",children:[s(h,{id:n,value:e,onChange:d,label:r,presets:c,fallback:i??void 0,size:"sm",align:"end"}),f!==null?s("span",{className:"sf-colour-caption",children:f}):s("span",{className:"sf-colour-hexwrap",children:s(x,{value:e||i||"",onChange:d,label:`${r} hex code`,placeholder:e||i?void 0:"Not set",className:i?"sf-colour-hex is-inherited":"sf-colour-hex"})}),a]})}function y({value:e,onChange:o,label:r}){return s(h,{value:e,onChange:n=>{n&&n!==e&&o(n)},label:r,size:"sm",align:"end"})}export{y as AnyColourSwatch,S as ColourControl};
|
|
@@ -126,16 +126,6 @@ export declare function Slider({ min, max, step, value, onChange, suffix, readou
|
|
|
126
126
|
ariaLabel?: string;
|
|
127
127
|
disabled?: boolean;
|
|
128
128
|
}): import("react").JSX.Element;
|
|
129
|
-
export declare function SliderValue({ value, min, max, step, onChange, suffix, ariaLabel, children, }: {
|
|
130
|
-
value: number;
|
|
131
|
-
min: number;
|
|
132
|
-
max: number;
|
|
133
|
-
step: number;
|
|
134
|
-
onChange: (next: number) => void;
|
|
135
|
-
suffix?: string;
|
|
136
|
-
ariaLabel?: string;
|
|
137
|
-
children?: ReactNode;
|
|
138
|
-
}): import("react").JSX.Element;
|
|
139
129
|
export declare function slider(label: string, icon: ReactElement, min: number, max: number, step: number, fallback: number, suffix?: string, action?: (value: unknown, onChange: (v: unknown) => void) => ReactNode): CustomField<number>;
|
|
140
130
|
export declare function pxField(label: string, opts: {
|
|
141
131
|
min: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as S,Fragment as I}from"react/jsx-runtime";import{cloneElement as Je,useId as Ze,useRef as j,useState as q}from"react";import{useEasel as O}from"efficient-easel/easel";import{readHidable as ue,hidableText as de}from"./hidable.js";import{FOCAL_DEFAULT as pe}from"../image-focus.js";import{FOLD_FIELD_MARKER as J,LINK_FIELD_MARKER as fe,MEDIA_FIELD_MARKER as me,SCAFFOLD_FIELD_MARKER as he,TEXT_FIELD_MARKER as T,foldMetaOf as Z,textFieldIdentifier as Qe}from"./field-markers.js";import et from"../../components/ApplyCornersToSiblings.js";import{CARD_IMAGE_RADIUS_STEP as tt,CORNER_RADIUS_MAX as W,CORNER_RADIUS_MIN as H}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 A,GALLERY_LAYOUT_KEYS as ge}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 be}from"../hero-group-placement.js";import ut from"../../components/KeepHint.js";import{AlignLeftIcon as dt,AlignSeparateIcon as pt,AnimationIcon as xe,BackgroundIcon as ft,BlockSectionIcon as mt,CartIcon as ht,ColumnWidthsIcon as Ce,ColumnsIcon as gt,CornerIcon as Se,DirectionDownIcon as bt,DirectionLeftIcon as xt,DirectionRightIcon as Ct,DirectionUpIcon as St,DollarIcon as _t,FinishIcon as It,GapIcon as _e,GridIcon as yt,GroundIcon as Et,HashIcon as Ie,ImageIcon as Tt,LayoutIcon as Rt,ListIcon as vt,LocationIcon as Q,PaddingBottomIcon as Lt,PaddingLeftIcon as Nt,PaddingRightIcon as Ot,PaddingTopIcon as At,PageIcon as ye,PhoneIcon as Ft,PlacementIcon as Pt,ProductSizeIcon as wt,RotateIcon as kt,SquareIcon as Dt,StylesIcon as Bt,TextLinesIcon as Ht,TypeIcon as Mt,WidthIcon as Gt,WrapIcon as $t}from"efficient-easel/icons";import{FieldGlyph as Ee}from"../../components/FieldGlyph.js";import{resolvePageBackground as Wt}from"../content/page-background.js";import{CORNER_SIDES as F,CORNER_SIDE_POINTS as ee,CORNER_SIDES_LABEL as P,cornerSidesSummary as Te,hasOwnSectionCorners as Ut,normalizeCornerSides as U}from"../content/section-corners.js";import{hasOwnCardCorners as Kt}from"../content/card-corners.js";import{SECTION_MOTION_NONE as Xt,SECTION_MOTION_OPTIONS as Vt}from"../content/section-animation.js";import{enclosingSectionProps as Re}from"./enclosing-section.js";import{SettingsCorners as ve,SettingsDefaultReset as g,SettingsField as m,SettingsGroupHead as zt,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,Tooltip as Le}from"efficient-shell/ui";import{ColourControl as Ne}from"./ColourControl.js";import Oe from"./MarkupToolbar.js";import{deviceField as R}from"./device-fields.js";import{noControlField as tn}from"./panel-no-control-mark.js";import{phoneKey as K,resolvePhoneValue as te}from"./phone-override.js";import{SuppressibleText as nn}from"./section-text-suppress.js";import{TYPED_NUMBER_COMMIT as on,typedNumberKey as Ae}from"./slider-typing.js";import{CARD_INDEX_OPTIONS as rn,CARD_OUTLINE_OPTIONS as ln,DEFAULT_CARD_INDEX_FORMAT as an,DEFAULT_CARD_OUTLINE as sn}from"../sections/product-card-style.js";import{COVER_INDEX_OPTIONS as cn,DEFAULT_COVER_INDEX as un}from"../sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as dn}from"./text-control-kinds.js";import pn from"../../components/ImageFocusRow.js";import fn from"../../components/MediaUploadField.js";import mn from"../../components/MultiSelectField.js";import hn from"../../components/SectionThemePicker.js";import gn from"../../components/SearchSelectField.js";import bn from"../../components/StorefrontLinkField.js";import Fe from"../../components/UiIcon.js";import{SECTION_PADDING as _}from"../content/section-padding.js";import{hasPhoneHeight as xn,resolveSectionMinHeight as Cn}from"../content/section-min-height.js";import{VIEW_TIER_LABEL as ne}from"../content/view-tiers.js";import{SECTION_MIN_HEIGHT as Sn,SECTION_MIN_HEIGHT_GROUP_LABEL as M,SECTION_SCREEN_PCT as _n}from"../content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as In,containerDirectionPoints as yn,resolveContainerDirection as Pe}from"../content/container-direction.js";import{BOX_ALIGN_POINTS as En,BOX_BLOCK_SPACING_LABEL as Tn,BOX_BLOCK_SPACING_POINTS as we,BOX_JUSTIFY_POINTS as ke,BOX_PHONE_ROW_LABEL as Rn,BOX_PHONE_ROW_MAX as vn,BOX_PHONE_ROW_MIN as De,BOX_SHARE_LABEL as Be,BOX_SHARE_POINTS as oe,BOX_WRAP_LABEL as Ln,BOX_WRAP_POINTS as He}from"../content/box-layout.js";import{usePreviewHeader as X}from"../../components/PreviewHeaderContext.js";import{CONTAINER_GAP as re,CONTAINER_GAP_BUILT_IN as Nn,GAP_FIELD_CONTAINER as On,hasOwnContainerGap as An,resolveContainerGap as Fn}from"../content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Pn,CARD_IMAGE_BG_OFF as wn,CARD_IMAGE_BG_SWATCH_NAMES as kn,CARD_IMAGE_BG_SWATCHES as Dn,isCardImageBackgroundInheriting as Bn,resolveCardImageBackground as Hn,THEME_CARD_IMAGE_BG as Mn}from"../content/card-image-background.js";import{SECTION_BG_INHERIT as Gn,SECTION_BG_SWATCHES as $n,SECTION_BG_SWATCH_NAMES as Wn,THEME_SECTION_BG as Un,isSectionBackgroundInheriting as Kn}from"../content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Xn}from"../content/section-surface.js";import{TYPE_SIZE_FIXED as Vn,TYPE_SIZE_INHERIT as zn,isTypeSizeInheriting as Yn}from"../content/section-type-size.js";import{SECTION_WIDTH_CHOICES as jn,WIDTH_CHOICE_LABEL as qn,WIDTH_INHERIT as Jn,resolveWidth as Zn,sectionRunsFullWidth as Me}from"../content/section-width.js";import{useFoldHeadingLevel as Ge}from"./panel-heading-scope.js";import{withStyleKind as Qn}from"efficient-easel/style-clipboard";function G(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!Z(n)&&Qn(n,`section:${t}`);return e}function Jr({children:e}){return r("div",{className:"sf-field-label",children:e})}function $e(){return null}function eo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r($e,{},e)}function to(e){return e.type===$e}function V(e){return to(e)?void 0:e}function w(e,t){return`${e} from ${t}`}function no(){const{appState:e}=O(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Zn(t,"full");return w(n==="page"?`${o}px`:n==="contained"?"Contained":"Full","the page")}function oo(){const{blockGap:e}=X();return e===null?"this container's own spacing":w(`${e}px`,"Site styles")}function ro({inherited:e,onReset:t,label:n}){return r(g,{label:n,changed:!e,detail:oo(),onReset:t})}function io({inherited:e,onReset:t,label:n}){return r(g,{label:n,changed:!e,detail:no(),onReset:t})}function k({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:l,hideable:a=!0,markup:s=!0}){const{text:u,hidden:d}=ue(e),f=j(null),c=j(null),p=E=>t(a?{text:E,hidden:d}:E),h=()=>t({text:u,hidden:!d}),b=a&&d,y=Ze(),x=i?uo(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:i}):r(ut,{children:i}):void 0;return r(m,{label:n,icon:r(Mt,{}),htmlFor:y,className:b?"is-hidden":void 0,hint:x,action:a?r(Le,{content:d?`Show ${n} on the slide`:`Hide ${n} on the slide`,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":d,"aria-label":d?`Show ${n} on the slide`:`Hide ${n} on the slide`,onClick:h,children:d?r(Fe,{name:"eye-off",size:14}):r(Fe,{name:"eye",size:14})})}):void 0,children:S("div",{className:"sf-copybox",children:[s&&r(Oe,{target:l?c:f,value:u,onChange:p}),l?r("textarea",{id:y,ref:c,value:u,placeholder:o,onChange:E=>p(E.target.value)}):r("input",{id:y,ref:f,type:"text",value:u,placeholder:o,onChange:E=>p(E.target.value)})]})})}function Zr(e,t){return{...e,[he]:t}}function Qr(e){const t=e[T];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[T]:{...t,offPage:!0}}}function ei(e){return!e||typeof e!="object"?!1:e[T]?.offPage===!0}function ti(e){const t=e[T];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[T]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as rl,SCALAR_TEXT_CONTROLS as il}from"./text-control-kinds.js";const lo=new Set(dn),D=(e,t)=>{const n={...t,[T]:e};if(!lo.has(e.control))return n;const o=t.render;return{...tn(n,"authored-copy"),render:i=>r(nn,{name:i.name,children:o(i)})}},ni="Everything else on this block comes from the linked post. Unlink it to edit by hand.",ao="Select a word, then press the highlighter.",so="A short name so a link can jump straight to this section, like yoursite.com/page#about.",co=new Set([ao]),uo=e=>co.has(e);function oi(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 ri(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 po(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 ii(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 li(e){return{type:"custom",[fe]:{label:e},render:({value:t,onChange:n})=>r(bn,{value:de(t),onChange:n,label:e})}}function ai(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 si={Content:Ht,Style:Bt,Layout:Rt,Animation:xe};function ci(e,t){return e.includes("Content")?t!=="Content":null}function fo({label:e}){return r(zt,{title:e,level:Ge(1)})}function mo({level:e,label:t}){return e===1?r(fo,{label:t}):r(go,{label:t})}function We(e,t){return{type:"custom",[J]:{label:e,level:t},render:()=>r(mo,{level:t,label:e})}}function C(e){return We(e,2)}function ui(e){return{type:"custom",render:()=>r(ho,{text:e})}}function ho({text:e}){return r("p",{className:"sf-note",children:e})}function di(e){return We(e,1)}function pi(e){return Z(e)!==null&&e?.tabs!==void 0}const Ue=new Map;function fi(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Ue.get(n)??{type:"custom",tabs:t,[J]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(I,{})};return Ue.set(n,o),o}function go({label:e}){return r(Yt,{title:e,level:Ge(2)})}function Ke({swatches:e,current:t,onPick:n,names:o}){const i=e.find(a=>a.toLowerCase()===t.toLowerCase()),l=(i?o?.[i]:void 0)??t;return S("div",{className:"sf-swatches",children:[e.map(a=>{const s=o?.[a]??a;return r(Le,{content:s,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===a.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===a.toLowerCase()?"is-active":""}`,style:{background:a},onClick:()=>n(a),"aria-label":s})},a)}),r("span",{className:"sf-swatch-hex",children:l})]})}function mi(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Kn(n,t);return r(m,{label:e,icon:r(ft,{}),changed:!i,action:r(g,{label:e,changed:!i,detail:"the theme's section background",onReset:()=>o(Gn)}),children:Ke({swatches:$n,current:i?Un:n??t??"",onPick:o,names:Wn})})}}}function bo(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,l=Bn(i,t);return r(m,{label:e,icon:r(Et,{}),changed:!l,action:r(g,{label:e,changed:!l,detail:"the theme's image stage",onReset:()=>o(Pn)}),children:Ke({swatches:Dn,current:l?Mn:Hn(i,t),onPick:o,names:kn})})}}}function hi(e=n=>n,t){return G({_gSectionTheme:C(Xn),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(hn,{value:e(n),onChange:o,followLabel:t})}})}function L({min:e,max:t,step:n,value:o,onChange:i,suffix:l="",readout:a=!0,notch:s,ariaLabel:u,disabled:d=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return S("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:[r("input",{type:"range",min:e,max:t,step:n,value:o,"aria-label":u,disabled:d||void 0,onChange:c=>i(Number(c.target.value))}),a&&r(xo,{value:o,min:e,max:t,step:n,suffix:l,ariaLabel:u,onChange:i})]})}function xo({value:e,min:t,max:n,step:o,onChange:i,suffix:l="",ariaLabel:a,children:s}){const[u,d]=q(null),f=c=>{c.editing||d(null),c.commit!==null&&c.commit!==e&&i(c.commit)};return u===null?r("button",{type:"button",className:"sf-slider-val",title:"Click to type a value","aria-label":a?`${a}: type a value`:"Type a value",onClick:()=>d(String(e)),children:s??S(I,{children:[e,l]})}):r("input",{autoFocus:!0,type:"text",inputMode:"decimal",className:"sf-slider-val sf-slider-typed",value:u,"aria-label":a,onChange:c=>d(c.target.value),onFocus:c=>c.currentTarget.select(),onKeyDown:c=>{const p=Ae(c.key,u,t,n,o);p.handled&&(c.preventDefault(),c.stopPropagation(),f(p))},onBlur:()=>f(Ae(on,u,t,n,o))})}function B(e,t,n,o,i,l,a="",s){return{type:"custom",render:u=>r(m,{label:e,icon:V(t),action:s?s("storedValue"in u?u.storedValue:u.value,u.onChange):void 0,children:L({min:n,max:o,step:i,value:typeof u.value=="number"?u.value:l,suffix:a,onChange:u.onChange})})}}function Xe({min:e,max:t,step:n,px:o,label:i,onChange:l,disabled:a=!1}){const{cornerRadiusPx:s}=X();return r(I,{children:L({min:e,max:t,step:n,value:o??(typeof s=="number"?s:e),readout:!1,ariaLabel:i,disabled:a,onChange:l})})}function $(e,t){const{min:n,max:o,step:i=1,unsetLabel:l,hint:a,restAtSite:s=!1,restTrack:u,unsetMark:d}=t;return{type:"custom",render:({value:f,onChange:c})=>{const p=typeof f=="number"?f:null,h=p===null;return r(m,{label:e,value:h?d?void 0:l:`${p}px`,changed:!h,action:d?Je(d,{changed:!h,onReset:()=>c(null)}):r(g,{label:e,changed:!h,onReset:()=>c(null)}),hint:a,children:u?u({min:n,max:o,step:i,px:p,label:e,onChange:c}):s?r(Xe,{min:n,max:o,step:i,px:p,label:e,onChange:c}):L({min:n,max:o,step:i,value:p??n,readout:!1,ariaLabel:e,onChange:c})})}}}function gi(e){const t=B("Gap",r(_e,{}),re.min,re.max,re.step,Nn[e],"px",(n,o)=>r(ro,{inherited:!An(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[On]:e,render:n=>t.render({...n,value:Fn(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}function Co(){return{type:"custom",render:({value:e,onChange:t})=>{const o=U(e)??[...F],i=o.length===F.length;return r(m,{label:P,icon:r(Se,{}),value:Te(o),changed:!i,action:r(g,{label:P,changed:!i,onReset:()=>t(null)}),hint:"Corners left off stay square. The row above sets how round the others are.",children:r(Eo,{value:o,onChange:l=>{const a=U(l)??[];t(a.length===F.length?null:a)}})})}}}function So({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=X(),i=typeof o=="number"?`${o}px`:"not set";return r(g,{label:e,changed:t,detail:o==null?"the built-in corners":w(i,"Site styles"),onReset:n})}function _o(){return $("Corners",{min:H,max:W,unsetLabel:"Follows the site",unsetMark:r(So,{label:"Corners"}),restTrack:e=>r(Io,{...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 ie(){return Me(z())}function Io(e){return r(Xe,{...e,disabled:ie()})}function yo(){return r(I,{children:ie()?Ve:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function Eo({value:e,onChange:t}){const n=ie();return r(ve,{label:P,value:e,corners:n?ee.map(o=>({...o,disabled:!0,title:Ve})):ee,onChange:t})}function bi(){return G({_gShape:C("Shape"),sectionCorners:_o(),sectionCornerSides:Co()})}function xi(){return{_gMotion:C("Motion"),sectionAnimation:ce("Entrance",r(xe,{}),[...Vt],Xt)}}function le(){let e=null;try{const{appState:t,selectedItem:n}=O(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Re(t?.data,o):null}catch{e=null}return e!==null&&Me(e)}function ze(e){const{cornerRadiusPx:t}=X(),n=le(),o=typeof t=="number"?t:e;let i=null;try{const{appState:a,selectedItem:s}=O(d=>d),u=s?.props?.id?String(s.props.id):void 0;i=u?Re(a?.data,u):null}catch{i=null}if(n||!i)return o;const l=i.sectionCorners;return Ut(l)?l:o}function To({min:e,max:t,step:n,px:o,label:i,onChange:l}){const a=ze(e);return r(I,{children:L({min:e,max:t,step:n,value:o??a,readout:!1,ariaLabel:i,onChange:l})})}function Ro({label:e,changed:t=!1,onReset:n=()=>{}}){const o=le(),i=ze(H),l=o?"Site":"Section";return r(g,{label:e,changed:t,detail:w(`${i}px`,o?"Site styles":"the section"),onReset:n})}function vo(){return r(I,{children:le()?"The section is full width, so this card follows Site styles ▸ Basics ▸ Corners.":"Follows the section's Corners until you set a number here."})}function Lo(){return $("Corners",{min:H,max:W,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(ve,{label:P,value:e,corners:ee,onChange:t})}function Oo({unset:e}){return r(I,{children:e?"Set a number above first — there is nothing to shape yet.":"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 o=U(e)??[...F],i=o.length===F.length;return r(m,{label:P,icon:r(Se,{}),value:Te(o),changed:!i,action:r(g,{label:P,changed:!i,onReset:()=>t(null)}),hint:r(Oo,{unset:!Kt(e)}),children:r(No,{value:o,onChange:l=>{const a=U(l)??[];t(a.length===F.length?null:a)}})})}}}function Fo(){return{type:"custom",render:()=>r(et,{})}}function Ci(){return{_gShape:C("Shape"),cardCorners:Lo(),cardCornerSides:Ao(),cardCornersApplyAll:Fo()}}function Si(){return v("Justify",r(pt,{}),ke,ke[0].value)}function _i(){return v("Item alignment",r(dt,{}),En,"stretch")}function Ii(){return v(Ln,r($t,{}),He,He[0].value)}function yi(){return{type:"custom",render:({value:e,onChange:t})=>{const n=oe.find(o=>o.value===e)??oe[0];return r(m,{label:Be,icon:r(Ce,{}),value:n.label,children:r("div",{className:"sf-gallery-layouts",role:"group","aria-label":Be,children:oe.map(o=>r("button",{type:"button","aria-pressed":n.value===o.value,"aria-label":o.label,title:o.label,onClick:()=>t(o.value),children:r("span",{className:"sf-gallery-pic",children:Po(o.weights).map((i,l)=>r("i",{style:{gridColumn:`span ${i}`}},l))})},o.value))})})}}}function Po(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 Ei(){return v(Tn,r(_e,{}),we,we[0].value)}function Ti(){return B(Rn,r(Ft,{}),De,vn,1,De)}function Ri(e){const t=ce(In,eo("`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)."),yn(e),Pe(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Pe(e,n.value),onChange:o=>n.onChange(o)})}}function vi(e,t,n,o,i,l){return{type:"custom",render:({value:a,onChange:s})=>r(m,{label:e,icon:r(Ee,{noun:l}),action:r(g,{label:e,changed:!Yn(a),detail:"the Text style in Site styles",onReset:()=>s(zn),defaultAction:{onPress:()=>s(Vn),title:"Keep this section's own built-in size",icon:r(mt,{})}}),children:L({min:t,max:n,step:o,value:typeof a=="number"?a:i,suffix:"px",onChange:s})})}}function Li(){return{_gCellWidth:C("Cell width"),gridSpan:v("Positions",r(Ce,{}),[{label:"Auto",value:""},...Array.from({length:rt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function z(){let e=null;try{e=O(t=>t).selectedItem}catch{e=null}return e?.props??{}}function wo({min:e,max:t,step:n,px:o,label:i,onChange:l,desktopKey:a,fallback:s}){const u=z()[a],d=te(void 0,u,s);return r(I,{children:L({min:e,max:t,step:n,value:te(o,u,s),readout:!1,ariaLabel:i,notch:d,onChange:l})})}function ko({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const l=z()[t],a=te(void 0,l,n);return r(g,{label:e,changed:o,detail:`${a}px on ${ne.desktop.toLowerCase()}`,onReset:i})}function Do(e){return $(e.label,{min:e.min,max:e.max,step:e.step,unsetLabel:`Follows ${ne.desktop}`,unsetMark:r(ko,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(wo,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Ni(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=x=>o?x:`Padding ${x.toLowerCase()}`,l=x=>B(i("Top"),r(At,{}),_.min,_.max,_.step,x,"px"),a=(x,E,qe,Y=_)=>R("mobile",Do({label:i(x),desktopKey:E,min:Y.min,max:Y.max,step:Y.step,fallback:qe})),s=e.top??_.min,u=e.bottom??_.min,d="sectionPaddingLeft",f="sectionPaddingRight",c=e.sideBounds??_,p=e.side??c.min,h=e.sidePhone??p,b=e.phone===!0,y=x=>b?R("desktop",x):x;return G({...o?{_gSpacing:C("Padding")}:{},[t]:y(l(s)),...b?{[K(t)]:a("Top",t,s)}:{},...e.only==="top"?{}:{[n]:y(B(i("Bottom"),r(Lt,{}),_.min,_.max,_.step,u,"px")),...b?{[K(n)]:a("Bottom",n,u)}:{}},...e.sides?{[d]:y(B(i("Left"),r(Nt,{}),c.min,c.max,c.step,p,"px")),...b?{[K(d)]:a("Left",d,h,c)}:{},[f]:y(B(i("Right"),r(Ot,{}),c.min,c.max,c.step,p,"px")),...b?{[K(f)]:a("Right",f,h,c)}:{}}:{}})}const Bo={contained:"Contained",page:"Page",full:"Full"},ae="Width";function Oi(e,t=jn,n=!0){const o=t.map(i=>({label:qn[i]??Bo[i],value:i}));return G({...n?{_gWidth:C(ae)}:{},widthMode:{type:"custom",render:({onChange:i,field:l})=>r(m,{label:"Width",icon:r(Gt,{}),action:n?r(io,{inherited:l?.inherited??!1,onReset:()=>i(Jn),label:ae}):void 0,children:se({options:o,value:l?.currentValue||e,onChange:i,ariaLabel:ae})})}})}function Ai(){const e=o=>({type:"custom",render:({value:i,onChange:l})=>S("div",{className:"sf-field",children:[o?S("div",{className:"sf-field-head",children:[r("span",{className:"sf-field-label sf-field-label--inline",children:M}),o(l)]}):null,r("div",{children:se({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:l,ariaLabel:M})})]})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:l})=>{const a=l?.unit==="%"?"%":"px",s=a==="%"?_n:Sn;return r("div",{className:"sf-field",children:L({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:a,ariaLabel:M,onChange:i})})}}),n=()=>ce("Unit",r(Ie,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return G({_gHeight:C(M),sectionHeightMode:R("desktop",e()),sectionHeightValue:R("desktop",t()),sectionHeightUnit:R("desktop",n()),sectionHeightModePhone:R("mobile",e(o=>r(Ho,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:R("mobile",t()),sectionHeightUnitPhone:R("mobile",n())})}function Ho({onClear:e}){const t=z(),n=xn(t),o=Cn(t),i=`${o.mode==="auto"?"Auto":`${o.value}${o.unit}`} on ${ne.desktop.toLowerCase()}`;return r(g,{label:M,changed:n,detail:i,onReset:e})}function Fi(){return{_gAnchor:C("Anchor"),anchor:po("Anchor name","e.g. about",so)}}function N(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:l,name:a})=>{const s=typeof o=="boolean"?o:t,u=`${l??a??e}-label`;return r(m,{label:e,labelId:u,icon:n,action:r(Jt,{checked:s,onChange:i,ariaLabelledBy:u})})}}}function Pi(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(m,{label:"Background",icon:r(ye,{}),htmlFor:i,action:r(Ne,{id:i,label:"Background",value:Wt(e),onChange:t})})}}}function wi(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const l=typeof n=="boolean"?n:t,a=`${i??e}-checkbox`;return r(m,{label:e,htmlFor:a,className:"sf-checkbox",action:r(en,{id:a,checked:l,onChange:o})})}}}function ki(e,t){return{type:"custom",render:({value:n,onChange:o})=>r(m,{label:e,action:Ne({value:n||t,onChange:o,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 Ye({label:e,value:t,onChange:n,points:o=Mo}){return r(jt,{label:e,value:t,points:o,onChange:n})}function Di(e,t=pe,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}=O(a=>a),l=i?.props?.[o];return r(pn,{label:e,value:t,onChange:n,image:typeof l=="string"?l:void 0})}const $o=be([]);function Bi(e,{stacking:t,fallback:n=st}){return{type:"custom",render:({value:o,onChange:i})=>{const l=at.includes(o)?o:n;return t?r(Wo,{label:e,value:l,onChange:i}):je({label:e,value:l,onChange:i,points:$o})}}}function Wo({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=O(s=>s),l=i?.props?.id?String(i.props.id):void 0,a=l?lt(o?.data,l):[];return je({label:e,value:t,onChange:n,points:be(a,l)})}function je({label:e,value:t,onChange:n,points:o}){const i=o.find(l=>l.disabled);return r(m,{label:e,icon:r(Pt,{}),hint:i?i.title:void 0,children:Ye({label:e,value:ct(t),onChange:n,points:o})})}const Hi={top:r(St,{}),right:r(Ct,{}),bottom:r(bt,{}),left:r(xt,{})};function Mi(e,t,n,o,i,l){const a=f=>t.find(c=>c.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),u=f=>{const c=t.find(h=>h.cell===f);if(!c)return s(`missing-${f}`);const p=l?.[f];return p?{value:c.value,label:c.label,icon:p}:{value:c.value,label:c.label}},d=[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:c})=>{const p=t.some(h=>h.value===f)?f:n;return r(m,{label:e,icon:i,value:a(p)?.label??"",children:Ye({label:e,value:p,onChange:c,points:d})})}}}const Uo="\0note";function v(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:l,onChange:a,field:s})=>{const u=s.options??n,d=s.fallback??o,f=u.some(c=>c.value===l)?l:d;return r(m,{label:e,icon:V(t),children:r(Zt,{value:f,ariaLabel:e,onChange:a,options:[...i?[{label:i,value:Uo,disabled:!0}]:[],...u.map(c=>({label:c.label,value:c.value}))]})})}}}function Gi(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:l})=>r(mn,{label:e,options:l.options??t,value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:n}:{}})}}function $i(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:l,field:a})=>r(gn,{label:e,options:a.options??t,fallback:a.fallback??n,value:i,onChange:l,placeholder:o})}}function Wi(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function se({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(qt,{options:e.map(l=>({id:l.value,label:l.label,title:l.title})),value:t,onChange:n,ariaLabel:o,disabled:i})}const Ui=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ce(e,t,n,o){const i=n.map(l=>typeof l=="string"?{label:l,value:l}:l);return{type:"custom",render:({value:l,onChange:a,field:s})=>r(m,{label:e,icon:V(t),children:se({options:i,value:i.some(u=>u.value===l)?l:l||s?.currentValue||o,onChange:a,ariaLabel:e})})}}function Ki(e,t,n){return{type:"custom",[me]:!0,render:({value:o,onChange:i})=>r(fn,{value:o||"",onChange:i,label:e,accept:t,placeholder:n})}}const Xi={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Vi({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,l=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",a=(s,u)=>t({...o,[s]:u===""?void 0:Number(u)});return S(m,{label: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?"Finding…":"Find coordinates"}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:l},children:o.status}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:"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?"Hide manual coordinates":"Enter coordinates manually"}),o.manual&&S("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(m,{label:"Latitude",icon:r(Q,{}),children:r("input",{type:"number",step:"any",placeholder:"e.g. 34.0990198",value:typeof o.lat=="number"?o.lat:"",onChange:s=>a("lat",s.target.value)})}),r(m,{label:"Longitude",icon:r(Q,{}),children:r("input",{type:"number",step:"any",placeholder:"e.g. -117.9842833",value:typeof o.lng=="number"?o.lng:"",onChange:s=>a("lng",s.target.value)})})]})]})}function Ko(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,l)=>l===t?{text:n}:i)}function zi(e,t){return e===null?null:t>e?e:null}function Vo(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 Yi={label:"Ticker items",icon:r(vt,{})};function ji(e,t,n,o){return{type:"custom",[T]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:l})=>r(zo,{label:e,icon:V(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:l,markup:o==="markup"})}}function zo({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:l=!1}){const a=j(null),[s,u]=q(null),d=c=>c.map(p=>({text:p?.text??""}));return r(Qt,{label:e,icon:t,noun:"item",items:n,onChange:c=>{const p=Vo(n,c,s);p===null&&(a.current=null),u(p),i(d(c))},newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?r(Oe,{target:a,value:Ko(n,s),onChange:c=>i(Xo(n,s??-1,c)),disabled:s===null,label:s===null?"Formatting — click a row first":`Formatting — row ${s+1}`}):void 0,renderRow:(c,p,h)=>r("input",{type:"text",className:l&&s===p?"sf-list-marking":void 0,value:c?.text??"",placeholder:o,"aria-label":`${e} ${p+1}`,onChange:b=>h({text:b.target.value}),onFocus:b=>{a.current=b.currentTarget,u(p)}})})}function qi(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:n,placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ji(e){return{_gCards:C("Cards"),coverIndex:v("Cover image",r(Tt,{}),cn,String(un),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:bo("Image background",wn),cardImage:Yo(),spinOnHover:N("Rotate on hover",e?.spinDefault??!0,r(kt,{}))}}function Zi(){return{outline:v("Card outline",r(Dt,{}),ln,sn),indexBadge:v("Card number",r(Ie,{}),rn,an),showBadge:N("Product badge",!0,r(Ee,{noun:"tag"}))}}function Qi(e){const t=e?.bottomDefault??!0;return{_gShowOnCard:C("Show on a card"),showCardPrice:N("Price",!0,r(_t,{})),showCardFinishes:N("Finish swatches",!0,r(It,{})),showCardSizes:N("Sizes",t,r(wt,{})),showCardBuy:N("Buy button",t,r(ht,{})),showCardPage:N("Page button",t,r(ye,{}))}}function Yo(){return $("Card image",{min:H,max:W,step:tt,hint:"Rounds the picture. The card's own corner is in Site styles."})}function el(){return $(ot,{min:H,max:W,step:nt,unsetLabel:"Square",hint:"Rounds the picture. Left alone it stays square."})}function tl(){return{type:"custom",render:({value:e,onChange:t})=>r(jo,{value:typeof e=="string"?e:"",onChange:t})}}function jo({value:e,onChange:t}){const[n,o]=q(null),i=ge.filter(a=>n===null||A[a].across===n),l=e&&e in A?A[e]:null;return S(I,{children:[r(m,{label:"Photos in a row",icon:r(gt,{}),children:S("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:"All"}),it.map(a=>r("button",{type:"button","aria-pressed":n===a,onClick:()=>o(a),children:a},a))]})}),r(m,{label:"Layout",icon:r(yt,{}),value:l?l.label:"Not chosen",hint:`${i.length} of ${ge.length} layouts`,children:r("div",{className:"sf-gallery-layouts",children:i.map(a=>r("button",{type:"button","aria-pressed":e===a,"aria-label":A[a].label,title:A[a].label,onClick:()=>t(e===a?"":a),children:r("span",{className:"sf-gallery-pic",children:A[a].desktop.map(([s,u],d)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${u}`}},d))})},a))})})]})}export{so as ANCHOR_HINT,ni as BOUND_TO_POST_NOTE,si as BUCKET_ICONS,Xi as CUSTOM_FIELD_MEDIA,Vi as CoordsField,Hi as EDGE_ARROWS,pe as FOCAL_DEFAULT,Mo as FOCAL_POINTS,J as FOLD_FIELD_MARKER,Ye as FocalPicker,go as GroupLabel,ao as HIGHLIGHT_HINT,k as HidableTextField,fe as LINK_FIELD_MARKER,Jr as Label,me as MEDIA_FIELD_MARKER,Ui as MEDIA_TYPE_OPTIONS,ho as PanelNoteLine,je as PlacementGridView,he as SCAFFOLD_FIELD_MARKER,il as SCALAR_TEXT_CONTROLS,Ve as SECTION_BLEEDS_HINT,fo as SectionHeading,se as Segmented,ro as SiteGapDefaultReset,L as Slider,xo as SliderValue,Ke as Swatches,rl as TEXT_CONTROL_KINDS,T as TEXT_FIELD_MARKER,Yi as TICKER_ITEMS_ROW,zo as TextListField,io as WidthDefaultReset,Vo as aimAfterListChange,Fi as anchorFields,w as backTo,mi as backgroundField,_i as boxAlignField,Ei as boxBlockSpacingField,Si as boxJustifyField,Ti as boxPhoneRowField,yi as boxShareField,Ii as boxWrapField,fi as bucketHeader,Ao as cardCornerSidesField,Lo as cardCornersField,bo as cardImageBackgroundField,Yo as cardImageField,Ji as cardMediaFields,Ci as cardShapeFields,Qi as cardShowFields,Zi as cardStyleFields,Li as cellWidthFields,wi as checkbox,ki as colorInput,ii as copyText,Ri as directionField,Mi as edgePad,ci as entriesHiddenForTab,Di as focalPicker,zi as focusAfterRemove,Z as foldMetaOf,tl as galleryLayoutField,gi as gapField,C as group,Ai as heightFields,de as hidableText,uo as hintIsWhileTyping,V as iconOf,el as imageCornersField,pi as isBucketHeader,to as isNoGlyph,li as linkField,Gi as multiSelect,eo as noGlyph,Pi as pageBackgroundField,ui as panelNote,Do as phoneOverrideField,Bi as placementField,po as plainText,ai as plainTextarea,$ as pxField,ue as readHidable,Ko as rowText,$i as searchSelect,di as section,xi as sectionAnimationFields,Co as sectionCornerSidesField,_o as sectionCornersField,bi as sectionShapeFields,hi as sectionThemeFields,ce as segmented,v as select,Xo as setRowText,vi as sizeField,B as slider,Wi as sourceField,Ni as spacingFields,oi as text,Qe as textFieldIdentifier,ei as textFieldOffPage,ji as textList,qi as textListRowField,ri as textarea,N as toggle,Ki as upload,no as usePageWidthDetail,oo as useSiteGapDetail,Oi as widthField,ti as withIdentifier,Qr as withOffPage,Zr as withScaffold};
|
|
1
|
+
"use client";import{jsx as r,jsxs as y,Fragment as E}from"react/jsx-runtime";import{cloneElement as qe,useId as Je,useRef as q,useState as ue}from"react";import{useEasel as N}from"efficient-easel/easel";import{readHidable as de,hidableText as pe}from"./hidable.js";import{FOCAL_DEFAULT as fe}from"../image-focus.js";import{FOLD_FIELD_MARKER as J,LINK_FIELD_MARKER as me,MEDIA_FIELD_MARKER as he,SCAFFOLD_FIELD_MARKER as ge,TEXT_FIELD_MARKER as T,foldMetaOf as Z,textFieldIdentifier as Ze}from"./field-markers.js";import Qe from"../../components/ApplyCornersToSiblings.js";import{CARD_IMAGE_RADIUS_STEP as et,CORNER_RADIUS_MAX as W,CORNER_RADIUS_MIN as B}from"../content/card-image-shape.js";import{IMAGE_CORNER_STEP as tt,IMAGE_CORNERS_LABEL as nt}from"../content/image-corners.js";import{GRID_MAX_COLUMNS as ot}from"../content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as rt,GALLERY_LAYOUTS as A,GALLERY_LAYOUT_KEYS as be}from"../content/gallery-layout.js";import{anchorSiblingsOf as it,HERO_GROUP_PLACEMENTS as lt,HERO_GROUP_PLACEMENT_DEFAULT as at,normalisePlacement as st,placementPoints as xe}from"../hero-group-placement.js";import ct from"../../components/KeepHint.js";import{AlignLeftIcon as ut,AlignSeparateIcon as dt,AnimationIcon as Ce,BackgroundIcon as pt,BlockSectionIcon as ft,CartIcon as mt,ColumnWidthsIcon as Se,ColumnsIcon as ht,CornerIcon as Ie,DirectionDownIcon as gt,DirectionLeftIcon as bt,DirectionRightIcon as xt,DirectionUpIcon as Ct,DollarIcon as St,FinishIcon as It,GapIcon as _e,GridIcon as _t,GroundIcon as yt,HashIcon as ye,ImageIcon as Et,LayoutIcon as Tt,ListIcon as Rt,LocationIcon as Q,PaddingBottomIcon as Lt,PaddingLeftIcon as vt,PaddingRightIcon as Ot,PaddingTopIcon as Nt,PageIcon as Ee,PhoneIcon as At,PlacementIcon as Ft,ProductSizeIcon as Pt,RotateIcon as wt,SquareIcon as kt,StylesIcon as Dt,TextLinesIcon as Ht,TypeIcon as Bt,WidthIcon as Gt,WrapIcon as Mt}from"efficient-easel/icons";import{FieldGlyph as Te}from"../../components/FieldGlyph.js";import{resolvePageBackground as $t}from"../content/page-background.js";import{CORNER_SIDES as F,CORNER_SIDE_POINTS as ee,CORNER_SIDES_LABEL as P,cornerSidesSummary as Re,hasOwnSectionCorners as Wt,normalizeCornerSides as U}from"../content/section-corners.js";import{hasOwnCardCorners as Ut}from"../content/card-corners.js";import{SECTION_MOTION_NONE as Kt,SECTION_MOTION_OPTIONS as Xt}from"../content/section-animation.js";import{enclosingSectionProps as Le}from"./enclosing-section.js";import{SettingsCorners as ve,SettingsDefaultReset as g,SettingsField as m,SettingsGroupHead as zt,SettingsGroupSub as Vt,SettingsPlacement as Yt,SettingsSegmented as jt,SettingsSwitch as qt}from"efficient-easel/panel";import{FieldSelect as Jt,ListField as Zt}from"efficient-easel/fields";import{Checkbox as Qt,Slider as en,Tooltip as K}from"efficient-shell/ui";import{ColourControl as Oe}from"./ColourControl.js";import Ne from"./MarkupToolbar.js";import{deviceField as R}from"./device-fields.js";import{noControlField as tn}from"./panel-no-control-mark.js";import{phoneKey as X,resolvePhoneValue as te}from"./phone-override.js";import{SuppressibleText as nn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as on,CARD_OUTLINE_OPTIONS as rn,DEFAULT_CARD_INDEX_FORMAT as ln,DEFAULT_CARD_OUTLINE as an}from"../sections/product-card-style.js";import{COVER_INDEX_OPTIONS as sn,DEFAULT_COVER_INDEX as cn}from"../sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as un}from"./text-control-kinds.js";import dn from"../../components/ImageFocusRow.js";import pn from"../../components/MediaUploadField.js";import fn from"../../components/MultiSelectField.js";import mn from"../../components/SectionThemePicker.js";import hn from"../../components/SearchSelectField.js";import gn from"../../components/StorefrontLinkField.js";import Ae from"../../components/UiIcon.js";import{SECTION_PADDING as S}from"../content/section-padding.js";import{hasPhoneHeight as bn,resolveSectionMinHeight as xn}from"../content/section-min-height.js";import{VIEW_TIER_LABEL as ne}from"../content/view-tiers.js";import{SECTION_MIN_HEIGHT as Cn,SECTION_MIN_HEIGHT_GROUP_LABEL as G,SECTION_SCREEN_PCT as Sn}from"../content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as In,containerDirectionPoints as _n,resolveContainerDirection as Fe}from"../content/container-direction.js";import{BOX_ALIGN_POINTS as yn,BOX_BLOCK_SPACING_LABEL as En,BOX_BLOCK_SPACING_POINTS as Pe,BOX_JUSTIFY_POINTS as we,BOX_PHONE_ROW_LABEL as Tn,BOX_PHONE_ROW_MAX as Rn,BOX_PHONE_ROW_MIN as ke,BOX_SHARE_LABEL as De,BOX_SHARE_POINTS as oe,BOX_WRAP_LABEL as Ln,BOX_WRAP_POINTS as He}from"../content/box-layout.js";import{usePreviewHeader as z}from"../../components/PreviewHeaderContext.js";import{CONTAINER_GAP as re,CONTAINER_GAP_BUILT_IN as vn,GAP_FIELD_CONTAINER as On,hasOwnContainerGap as Nn,resolveContainerGap as An}from"../content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Fn,CARD_IMAGE_BG_OFF as Pn,CARD_IMAGE_BG_SWATCH_NAMES as wn,CARD_IMAGE_BG_SWATCHES as kn,isCardImageBackgroundInheriting as Dn,resolveCardImageBackground as Hn,THEME_CARD_IMAGE_BG as Bn}from"../content/card-image-background.js";import{SECTION_BG_INHERIT as Gn,SECTION_BG_SWATCHES as Mn,SECTION_BG_SWATCH_NAMES as $n,THEME_SECTION_BG as Wn,isSectionBackgroundInheriting as Un}from"../content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Kn}from"../content/section-surface.js";import{TYPE_SIZE_FIXED as Xn,TYPE_SIZE_INHERIT as zn,isTypeSizeInheriting as Vn}from"../content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Yn,WIDTH_CHOICE_LABEL as jn,WIDTH_INHERIT as qn,resolveWidth as Jn,sectionRunsFullWidth as Be}from"../content/section-width.js";import{useFoldHeadingLevel as Ge}from"./panel-heading-scope.js";import{withStyleKind as Zn}from"efficient-easel/style-clipboard";function M(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!Z(n)&&Zn(n,`section:${t}`);return e}function Yr({children:e}){return r("div",{className:"sf-field-label",children:e})}function Me(){return null}function Qn(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(Me,{},e)}function eo(e){return e.type===Me}function V(e){return eo(e)?void 0:e}function w(e,t){return`${e} from ${t}`}function to(){const{appState:e}=N(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Jn(t,"full");return w(n==="page"?`${o}px`:n==="contained"?"Contained":"Full","the page")}function no(){const{blockGap:e}=z();return e===null?"this container's own spacing":w(`${e}px`,"Site styles")}function oo({inherited:e,onReset:t,label:n}){return r(g,{label:n,changed:!e,detail:no(),onReset:t})}function ro({inherited:e,onReset:t,label:n}){return r(g,{label:n,changed:!e,detail:to(),onReset:t})}function k({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:l,hideable:a=!0,markup:s=!0}){const{text:c,hidden:d}=de(e),f=q(null),u=q(null),p=_=>t(a?{text:_,hidden:d}:_),h=()=>t({text:c,hidden:!d}),b=a&&d,I=Je(),x=i?co(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:i}):r(ct,{children:i}):void 0;return r(m,{label:n,icon:r(Bt,{}),htmlFor:I,className:b?"is-hidden":void 0,hint:x,action:a?r(K,{content:d?`Show ${n} on the slide`:`Hide ${n} on the slide`,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":d,"aria-label":d?`Show ${n} on the slide`:`Hide ${n} on the slide`,onClick:h,children:d?r(Ae,{name:"eye-off",size:14}):r(Ae,{name:"eye",size:14})})}):void 0,children:y("div",{className:"sf-copybox",children:[s&&r(Ne,{target:l?u:f,value:c,onChange:p}),l?r("textarea",{id:I,ref:u,value:c,placeholder:o,onChange:_=>p(_.target.value)}):r("input",{id:I,ref:f,type:"text",value:c,placeholder:o,onChange:_=>p(_.target.value)})]})})}function jr(e,t){return{...e,[ge]:t}}function qr(e){const t=e[T];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[T]:{...t,offPage:!0}}}function Jr(e){return!e||typeof e!="object"?!1:e[T]?.offPage===!0}function Zr(e){const t=e[T];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[T]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as tl,SCALAR_TEXT_CONTROLS as nl}from"./text-control-kinds.js";const io=new Set(un),D=(e,t)=>{const n={...t,[T]:e};if(!io.has(e.control))return n;const o=t.render;return{...tn(n,"authored-copy"),render:i=>r(nn,{name:i.name,children:o(i)})}},Qr="Everything else on this block comes from the linked post. Unlink it to edit by hand.",lo="Select a word, then press the highlighter.",ao="A short name so a link can jump straight to this section, like yoursite.com/page#about.",so=new Set([lo]),co=e=>so.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 uo(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",[me]:{label:e},render:({value:t,onChange:n})=>r(gn,{value:pe(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={Content:Ht,Style:Dt,Layout:Tt,Animation:Ce};function li(e,t){return e.includes("Content")?t!=="Content":null}function po({label:e}){return r(zt,{title:e,level:Ge(1)})}function fo({level:e,label:t}){return e===1?r(po,{label:t}):r(ho,{label:t})}function $e(e,t){return{type:"custom",[J]:{label:e,level:t},render:()=>r(fo,{level:t,label:e})}}function C(e){return $e(e,2)}function ai(e){return{type:"custom",render:()=>r(mo,{text:e})}}function mo({text:e}){return r("p",{className:"sf-note",children:e})}function si(e){return $e(e,1)}function ci(e){return Z(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,[J]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(E,{})};return We.set(n,o),o}function ho({label:e}){return r(Vt,{title:e,level:Ge(2)})}function Ue({swatches:e,current:t,onPick:n,names:o}){const i=e.find(a=>a.toLowerCase()===t.toLowerCase()),l=(i?o?.[i]:void 0)??t;return y("div",{className:"sf-swatches",children:[e.map(a=>{const s=o?.[a]??a;return r(K,{content:s,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===a.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===a.toLowerCase()?"is-active":""}`,style:{background:a},onClick:()=>n(a),"aria-label":s})},a)}),r("span",{className:"sf-swatch-hex",children:l})]})}function di(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Un(n,t);return r(m,{label:e,icon:r(pt,{}),changed:!i,action:r(g,{label:e,changed:!i,detail:"the theme's section background",onReset:()=>o(Gn)}),children:Ue({swatches:Mn,current:i?Wn:n??t??"",onPick:o,names:$n})})}}}function go(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,l=Dn(i,t);return r(m,{label:e,icon:r(yt,{}),changed:!l,action:r(g,{label:e,changed:!l,detail:"the theme's image stage",onReset:()=>o(Fn)}),children:Ue({swatches:kn,current:l?Bn:Hn(i,t),onPick:o,names:wn})})}}}function pi(e=n=>n,t){return M({_gSectionTheme:C(Kn),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(mn,{value:e(n),onChange:o,followLabel:t})}})}function v({min:e,max:t,step:n,value:o,onChange:i,suffix:l="",readout:a=!0,notch:s,ariaLabel:c,disabled:d=!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(en,{min:e,max:t,step:n,value:o,suffix:l||void 0,showInput:a,label:c,disabled:d,size:"sm",className:"sf-slider-track",onChange:u=>{u!==null&&u!==o&&i(u)}})})}function H(e,t,n,o,i,l,a="",s){return{type:"custom",render:c=>r(m,{label:e,icon:V(t),action:s?s("storedValue"in c?c.storedValue:c.value,c.onChange):void 0,children:v({min:n,max:o,step:i,value:typeof c.value=="number"?c.value:l,suffix:a,ariaLabel:e,onChange:c.onChange})})}}function Ke({min:e,max:t,step:n,px:o,label:i,onChange:l,disabled:a=!1}){const{cornerRadiusPx:s}=z();return r(E,{children:v({min:e,max:t,step:n,value:o??(typeof s=="number"?s:e),readout:!1,ariaLabel:i,disabled:a,onChange:l})})}function $(e,t){const{min:n,max:o,step:i=1,unsetLabel:l,hint:a,restAtSite:s=!1,restTrack:c,unsetMark:d}=t;return{type:"custom",render:({value:f,onChange:u})=>{const p=typeof f=="number"?f:null,h=p===null;return r(m,{label:e,value:h?d?void 0:l:`${p}px`,changed:!h,action:d?qe(d,{changed:!h,onReset:()=>u(null)}):r(g,{label:e,changed:!h,onReset:()=>u(null)}),hint:a,children:c?c({min:n,max:o,step:i,px:p,label:e,onChange:u}):s?r(Ke,{min:n,max:o,step:i,px:p,label:e,onChange:u}):v({min:n,max:o,step:i,value:p??n,readout:!1,ariaLabel:e,onChange:u})})}}}function fi(e){const t=H("Gap",r(_e,{}),re.min,re.max,re.step,vn[e],"px",(n,o)=>r(oo,{inherited:!Nn(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[On]:e,render:n=>t.render({...n,value:An(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}function bo(){return{type:"custom",render:({value:e,onChange:t})=>{const o=U(e)??[...F],i=o.length===F.length;return r(m,{label:P,icon:r(Ie,{}),value:Re(o),changed:!i,action:r(g,{label:P,changed:!i,onReset:()=>t(null)}),hint:"Corners left off stay square. The row above sets how round the others are.",children:r(_o,{value:o,onChange:l=>{const a=U(l)??[];t(a.length===F.length?null:a)}})})}}}function xo({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=z(),i=typeof o=="number"?`${o}px`:"not set";return r(g,{label:e,changed:t,detail:o==null?"the built-in corners":w(i,"Site styles"),onReset:n})}function Co(){return $("Corners",{min:B,max:W,unsetLabel:"Follows the site",unsetMark:r(xo,{label:"Corners"}),restTrack:e=>r(So,{...e}),hint:r(Io,{})})}const Xe="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function ie(){return Be(Y())}function So(e){return r(Ke,{...e,disabled:ie()})}function Io(){return r(E,{children:ie()?Xe:"Follows Site styles ▸ Basics ▸ Corners until you set a number here."})}function _o({value:e,onChange:t}){const n=ie();return r(ve,{label:P,value:e,corners:n?ee.map(o=>({...o,disabled:!0,title:Xe})):ee,onChange:t})}function mi(){return M({_gShape:C("Shape"),sectionCorners:Co(),sectionCornerSides:bo()})}function hi(){return{_gMotion:C("Motion"),sectionAnimation:ce("Entrance",r(Ce,{}),[...Xt],Kt)}}function le(){let e=null;try{const{appState:t,selectedItem:n}=N(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Le(t?.data,o):null}catch{e=null}return e!==null&&Be(e)}function ze(e){const{cornerRadiusPx:t}=z(),n=le(),o=typeof t=="number"?t:e;let i=null;try{const{appState:a,selectedItem:s}=N(d=>d),c=s?.props?.id?String(s.props.id):void 0;i=c?Le(a?.data,c):null}catch{i=null}if(n||!i)return o;const l=i.sectionCorners;return Wt(l)?l:o}function yo({min:e,max:t,step:n,px:o,label:i,onChange:l}){const a=ze(e);return r(E,{children:v({min:e,max:t,step:n,value:o??a,readout:!1,ariaLabel:i,onChange:l})})}function Eo({label:e,changed:t=!1,onReset:n=()=>{}}){const o=le(),i=ze(B),l=o?"Site":"Section";return r(g,{label:e,changed:t,detail:w(`${i}px`,o?"Site styles":"the section"),onReset:n})}function To(){return r(E,{children:le()?"The section is full width, so this card follows Site styles ▸ Basics ▸ Corners.":"Follows the section's Corners until you set a number here."})}function Ro(){return $("Corners",{min:B,max:W,unsetLabel:"Follows the section",unsetMark:r(Eo,{label:"Corners"}),restTrack:e=>r(yo,{...e}),hint:r(To,{})})}function Lo({value:e,onChange:t}){return r(ve,{label:P,value:e,corners:ee,onChange:t})}function vo({unset:e}){return r(E,{children:e?"Set a number above first — there is nothing to shape yet.":"Corners left off stay square. The row above sets how round the others are."})}function Oo(){return{type:"custom",render:({value:e,onChange:t})=>{const o=U(e)??[...F],i=o.length===F.length;return r(m,{label:P,icon:r(Ie,{}),value:Re(o),changed:!i,action:r(g,{label:P,changed:!i,onReset:()=>t(null)}),hint:r(vo,{unset:!Ut(e)}),children:r(Lo,{value:o,onChange:l=>{const a=U(l)??[];t(a.length===F.length?null:a)}})})}}}function No(){return{type:"custom",render:()=>r(Qe,{})}}function gi(){return{_gShape:C("Shape"),cardCorners:Ro(),cardCornerSides:Oo(),cardCornersApplyAll:No()}}function bi(){return L("Justify",r(dt,{}),we,we[0].value)}function xi(){return L("Item alignment",r(ut,{}),yn,"stretch")}function Ci(){return L(Ln,r(Mt,{}),He,He[0].value)}function Si(){return{type:"custom",render:({value:e,onChange:t})=>{const n=oe.find(o=>o.value===e)??oe[0];return r(m,{label:De,icon:r(Se,{}),value:n.label,children:r("div",{className:"sf-gallery-layouts",role:"group","aria-label":De,children:oe.map(o=>r(K,{content:o.label,className:"sf-tile-tip",children:r("button",{type:"button","aria-pressed":n.value===o.value,"aria-label":o.label,onClick:()=>t(o.value),children:r("span",{className:"sf-gallery-pic",children:Ao(o.weights).map((i,l)=>r("i",{style:{gridColumn:`span ${i}`}},l))})})},o.value))})})}}}function Ao(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 Ii(){return L(En,r(_e,{}),Pe,Pe[0].value)}function _i(){return H(Tn,r(At,{}),ke,Rn,1,ke)}function yi(e){const t=ce(In,Qn("`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)."),_n(e),Fe(e,void 0));return{type:"custom",render:n=>t.render({...n,value:Fe(e,n.value),onChange:o=>n.onChange(o)})}}function Ei(e,t,n,o,i,l){return{type:"custom",render:({value:a,onChange:s})=>r(m,{label:e,icon:r(Te,{noun:l}),action:r(g,{label:e,changed:!Vn(a),detail:"the Text style in Site styles",onReset:()=>s(zn),defaultAction:{onPress:()=>s(Xn),title:"Keep this section's own built-in size",icon:r(ft,{})}}),children:v({min:t,max:n,step:o,value:typeof a=="number"?a:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Ti(){return{_gCellWidth:C("Cell width"),gridSpan:L("Positions",r(Se,{}),[{label:"Auto",value:""},...Array.from({length:ot},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function Y(){let e=null;try{e=N(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Fo({min:e,max:t,step:n,px:o,label:i,onChange:l,desktopKey:a,fallback:s}){const c=Y()[a],d=te(void 0,c,s);return r(E,{children:v({min:e,max:t,step:n,value:te(o,c,s),readout:!1,ariaLabel:i,notch:d,onChange:l})})}function Po({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const l=Y()[t],a=te(void 0,l,n);return r(g,{label:e,changed:o,detail:`${a}px on ${ne.desktop.toLowerCase()}`,onReset:i})}function wo(e){return $(e.label,{min:e.min,max:e.max,step:e.step,unsetLabel:`Follows ${ne.desktop}`,unsetMark:r(Po,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Fo,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Ri(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=x=>o?x:`Padding ${x.toLowerCase()}`,l=x=>H(i("Top"),r(Nt,{}),S.min,S.max,S.step,x,"px"),a=(x,_,je,j=S)=>R("mobile",wo({label:i(x),desktopKey:_,min:j.min,max:j.max,step:j.step,fallback:je})),s=e.top??S.min,c=e.bottom??S.min,d="sectionPaddingLeft",f="sectionPaddingRight",u=e.sideBounds??S,p=e.side??u.min,h=e.sidePhone??p,b=e.phone===!0,I=x=>b?R("desktop",x):x;return M({...o?{_gSpacing:C("Padding")}:{},[t]:I(l(s)),...b?{[X(t)]:a("Top",t,s)}:{},...e.only==="top"?{}:{[n]:I(H(i("Bottom"),r(Lt,{}),S.min,S.max,S.step,c,"px")),...b?{[X(n)]:a("Bottom",n,c)}:{}},...e.sides?{[d]:I(H(i("Left"),r(vt,{}),u.min,u.max,u.step,p,"px")),...b?{[X(d)]:a("Left",d,h,u)}:{},[f]:I(H(i("Right"),r(Ot,{}),u.min,u.max,u.step,p,"px")),...b?{[X(f)]:a("Right",f,h,u)}:{}}:{}})}const ko={contained:"Contained",page:"Page",full:"Full"},ae="Width";function Li(e,t=Yn,n=!0){const o=t.map(i=>({label:jn[i]??ko[i],value:i}));return M({...n?{_gWidth:C(ae)}:{},widthMode:{type:"custom",render:({onChange:i,field:l})=>r(m,{label:"Width",icon:r(Gt,{}),action:n?r(ro,{inherited:l?.inherited??!1,onReset:()=>i(qn),label:ae}):void 0,children:se({options:o,value:l?.currentValue||e,onChange:i,ariaLabel:ae})})}})}function vi(){const e=o=>({type:"custom",render:({value:i,onChange:l})=>y("div",{className:"sf-field",children:[o?y("div",{className:"sf-field-head",children:[r("span",{className:"sf-field-label sf-field-label--inline",children:G}),o(l)]}):null,r("div",{children:se({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:l,ariaLabel:G})})]})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:l})=>{const a=l?.unit==="%"?"%":"px",s=a==="%"?Sn:Cn;return r("div",{className:"sf-field",children:v({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:a,ariaLabel:G,onChange:i})})}}),n=()=>ce("Unit",r(ye,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return M({_gHeight:C(G),sectionHeightMode:R("desktop",e()),sectionHeightValue:R("desktop",t()),sectionHeightUnit:R("desktop",n()),sectionHeightModePhone:R("mobile",e(o=>r(Do,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:R("mobile",t()),sectionHeightUnitPhone:R("mobile",n())})}function Do({onClear:e}){const t=Y(),n=bn(t),o=xn(t),i=`${o.mode==="auto"?"Auto":`${o.value}${o.unit}`} on ${ne.desktop.toLowerCase()}`;return r(g,{label:G,changed:n,detail:i,onReset:e})}function Oi(){return{_gAnchor:C("Anchor"),anchor:uo("Anchor name","e.g. about",ao)}}function O(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:l,name:a})=>{const s=typeof o=="boolean"?o:t,c=`${l??a??e}-label`;return r(m,{label:e,labelId:c,icon:n,action:r(qt,{checked:s,onChange:i,ariaLabelledBy:c})})}}}function Ni(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(m,{label:"Background",icon:r(Ee,{}),htmlFor:i,action:r(Oe,{id:i,label:"Background",value:$t(e),onChange:t})})}}}function Ai(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const l=typeof n=="boolean"?n:t,a=`${i??e}-checkbox`;return r(m,{label:e,htmlFor:a,className:"sf-checkbox",action:r(Qt,{id:a,checked:l,onChange:o})})}}}function Fi(e,t){return{type:"custom",render:({value:n,onChange:o})=>r(m,{label:e,action:Oe({value:n||t,onChange:o,label:e})})}}const Ho=[{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 Ve({label:e,value:t,onChange:n,points:o=Ho}){return r(Yt,{label:e,value:t,points:o,onChange:n})}function Pi(e,t=fe,n="mediaImage"){return{type:"custom",render:({value:o,onChange:i})=>r("div",{className:"sf-focal-row",children:r(Bo,{label:e,value:o||t,onChange:i,imageProp:n})})}}function Bo({label:e,value:t,onChange:n,imageProp:o}){const{selectedItem:i}=N(a=>a),l=i?.props?.[o];return r(dn,{label:e,value:t,onChange:n,image:typeof l=="string"?l:void 0})}const Go=xe([]);function wi(e,{stacking:t,fallback:n=at}){return{type:"custom",render:({value:o,onChange:i})=>{const l=lt.includes(o)?o:n;return t?r(Mo,{label:e,value:l,onChange:i}):Ye({label:e,value:l,onChange:i,points:Go})}}}function Mo({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=N(s=>s),l=i?.props?.id?String(i.props.id):void 0,a=l?it(o?.data,l):[];return Ye({label:e,value:t,onChange:n,points:xe(a,l)})}function Ye({label:e,value:t,onChange:n,points:o}){const i=o.find(l=>l.disabled);return r(m,{label:e,icon:r(Ft,{}),hint:i?i.title:void 0,children:Ve({label:e,value:st(t),onChange:n,points:o})})}const ki={top:r(Ct,{}),right:r(xt,{}),bottom:r(gt,{}),left:r(bt,{})};function Di(e,t,n,o,i,l){const a=f=>t.find(u=>u.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),c=f=>{const u=t.find(h=>h.cell===f);if(!u)return s(`missing-${f}`);const p=l?.[f];return p?{value:u.value,label:u.label,icon:p}:{value:u.value,label:u.label}},d=[s("corner-top-left"),c("top"),s("corner-top-right"),c("left"),s("centre"),c("right"),s("corner-bottom-left"),c("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:u})=>{const p=t.some(h=>h.value===f)?f:n;return r(m,{label:e,icon:i,value:a(p)?.label??"",children:Ve({label:e,value:p,onChange:u,points:d})})}}}const $o="\0note";function L(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:l,onChange:a,field:s})=>{const c=s.options??n,d=s.fallback??o,f=c.some(u=>u.value===l)?l:d;return r(m,{label:e,icon:V(t),children:r(Jt,{value:f,ariaLabel:e,onChange:a,options:[...i?[{label:i,value:$o,disabled:!0}]:[],...c.map(u=>({label:u.label,value:u.value}))]})})}}}function Hi(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:l})=>r(fn,{label:e,options:l.options??t,value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:n}:{}})}}function Bi(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:l,field:a})=>r(hn,{label:e,options:a.options??t,fallback:a.fallback??n,value:i,onChange:l,placeholder:o})}}function Gi(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function se({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(jt,{options:e.map(l=>({id:l.value,label:l.label,title:l.title})),value:t,onChange:n,ariaLabel:o,disabled:i})}const Mi=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function ce(e,t,n,o){const i=n.map(l=>typeof l=="string"?{label:l,value:l}:l);return{type:"custom",render:({value:l,onChange:a,field:s})=>r(m,{label:e,icon:V(t),children:se({options:i,value:i.some(c=>c.value===l)?l:l||s?.currentValue||o,onChange:a,ariaLabel:e})})}}function $i(e,t,n){return{type:"custom",[he]:!0,render:({value:o,onChange:i})=>r(pn,{value:o||"",onChange:i,label:e,accept:t,placeholder:n})}}const Wi={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ui({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,l=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",a=(s,c)=>t({...o,[s]:c===""?void 0:Number(c)});return y(m,{label: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?"Finding…":"Find coordinates"}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:l},children:o.status}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:"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?"Hide manual coordinates":"Enter coordinates manually"}),o.manual&&y("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(m,{label:"Latitude",icon:r(Q,{}),children:r("input",{type:"number",step:"any",placeholder:"e.g. 34.0990198",value:typeof o.lat=="number"?o.lat:"",onChange:s=>a("lat",s.target.value)})}),r(m,{label:"Longitude",icon:r(Q,{}),children:r("input",{type:"number",step:"any",placeholder:"e.g. -117.9842833",value:typeof o.lng=="number"?o.lng:"",onChange:s=>a("lng",s.target.value)})})]})]})}function Wo(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Uo(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,l)=>l===t?{text:n}:i)}function Ki(e,t){return e===null?null:t>e?e:null}function Ko(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 Xi={label:"Ticker items",icon:r(Rt,{})};function zi(e,t,n,o){return{type:"custom",[T]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:l})=>r(Xo,{label:e,icon:V(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:l,markup:o==="markup"})}}function Xo({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:l=!1}){const a=q(null),[s,c]=ue(null),d=u=>u.map(p=>({text:p?.text??""}));return r(Zt,{label:e,icon:t,noun:"item",items:n,onChange:u=>{const p=Ko(n,u,s);p===null&&(a.current=null),c(p),i(d(u))},newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?r(Ne,{target:a,value:Wo(n,s),onChange:u=>i(Uo(n,s??-1,u)),disabled:s===null,label:s===null?"Formatting — click a row first":`Formatting — row ${s+1}`}):void 0,renderRow:(u,p,h)=>r("input",{type:"text",className:l&&s===p?"sf-list-marking":void 0,value:u?.text??"",placeholder:o,"aria-label":`${e} ${p+1}`,onChange:b=>h({text:b.target.value}),onFocus:b=>{a.current=b.currentTarget,c(p)}})})}function Vi(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:n,placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Yi(e){return{_gCards:C("Cards"),coverIndex:L("Cover image",r(Et,{}),sn,String(cn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:go("Image background",Pn),cardImage:zo(),spinOnHover:O("Rotate on hover",e?.spinDefault??!0,r(wt,{}))}}function ji(){return{outline:L("Card outline",r(kt,{}),rn,an),indexBadge:L("Card number",r(ye,{}),on,ln),showBadge:O("Product badge",!0,r(Te,{noun:"tag"}))}}function qi(e){const t=e?.bottomDefault??!0;return{_gShowOnCard:C("Show on a card"),showCardPrice:O("Price",!0,r(St,{})),showCardFinishes:O("Finish swatches",!0,r(It,{})),showCardSizes:O("Sizes",t,r(Pt,{})),showCardBuy:O("Buy button",t,r(mt,{})),showCardPage:O("Page button",t,r(Ee,{}))}}function zo(){return $("Card image",{min:B,max:W,step:et,hint:"Rounds the picture. The card's own corner is in Site styles."})}function Ji(){return $(nt,{min:B,max:W,step:tt,unsetLabel:"Square",hint:"Rounds the picture. Left alone it stays square."})}function Zi(){return{type:"custom",render:({value:e,onChange:t})=>r(Vo,{value:typeof e=="string"?e:"",onChange:t})}}function Vo({value:e,onChange:t}){const[n,o]=ue(null),i=be.filter(a=>n===null||A[a].across===n),l=e&&e in A?A[e]:null;return y(E,{children:[r(m,{label:"Photos in a row",icon:r(ht,{}),children:y("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:"All"}),rt.map(a=>r("button",{type:"button","aria-pressed":n===a,onClick:()=>o(a),children:a},a))]})}),r(m,{label:"Layout",icon:r(_t,{}),value:l?l.label:"Not chosen",hint:`${i.length} of ${be.length} layouts`,children:r("div",{className:"sf-gallery-layouts",children:i.map(a=>r(K,{content:A[a].label,className:"sf-tile-tip",children:r("button",{type:"button","aria-pressed":e===a,"aria-label":A[a].label,onClick:()=>t(e===a?"":a),children:r("span",{className:"sf-gallery-pic",children:A[a].desktop.map(([s,c],d)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${c}`}},d))})})},a))})})]})}export{ao as ANCHOR_HINT,Qr as BOUND_TO_POST_NOTE,ii as BUCKET_ICONS,Wi as CUSTOM_FIELD_MEDIA,Ui as CoordsField,ki as EDGE_ARROWS,fe as FOCAL_DEFAULT,Ho as FOCAL_POINTS,J as FOLD_FIELD_MARKER,Ve as FocalPicker,ho as GroupLabel,lo as HIGHLIGHT_HINT,k as HidableTextField,me as LINK_FIELD_MARKER,Yr as Label,he as MEDIA_FIELD_MARKER,Mi as MEDIA_TYPE_OPTIONS,mo as PanelNoteLine,Ye as PlacementGridView,ge as SCAFFOLD_FIELD_MARKER,nl as SCALAR_TEXT_CONTROLS,Xe as SECTION_BLEEDS_HINT,po as SectionHeading,se as Segmented,oo as SiteGapDefaultReset,v as Slider,Ue as Swatches,tl as TEXT_CONTROL_KINDS,T as TEXT_FIELD_MARKER,Xi as TICKER_ITEMS_ROW,Xo as TextListField,ro as WidthDefaultReset,Ko as aimAfterListChange,Oi as anchorFields,w as backTo,di as backgroundField,xi as boxAlignField,Ii as boxBlockSpacingField,bi as boxJustifyField,_i as boxPhoneRowField,Si as boxShareField,Ci as boxWrapField,ui as bucketHeader,Oo as cardCornerSidesField,Ro as cardCornersField,go as cardImageBackgroundField,zo as cardImageField,Yi as cardMediaFields,gi as cardShapeFields,qi as cardShowFields,ji as cardStyleFields,Ti as cellWidthFields,Ai as checkbox,Fi as colorInput,ni as copyText,yi as directionField,Di as edgePad,li as entriesHiddenForTab,Pi as focalPicker,Ki as focusAfterRemove,Z as foldMetaOf,Zi as galleryLayoutField,fi as gapField,C as group,vi as heightFields,pe as hidableText,co as hintIsWhileTyping,V as iconOf,Ji as imageCornersField,ci as isBucketHeader,eo as isNoGlyph,oi as linkField,Hi as multiSelect,Qn as noGlyph,Ni as pageBackgroundField,ai as panelNote,wo as phoneOverrideField,wi as placementField,uo as plainText,ri as plainTextarea,$ as pxField,de as readHidable,Wo as rowText,Bi as searchSelect,si as section,hi as sectionAnimationFields,bo as sectionCornerSidesField,Co as sectionCornersField,mi as sectionShapeFields,pi as sectionThemeFields,ce as segmented,L as select,Uo as setRowText,Ei as sizeField,H as slider,Gi as sourceField,Ri as spacingFields,ei as text,Ze as textFieldIdentifier,Jr as textFieldOffPage,zi as textList,Vi as textListRowField,ti as textarea,O as toggle,$i as upload,to as usePageWidthDetail,no as useSiteGapDetail,Li as widthField,Zr as withIdentifier,qr as withOffPage,jr as withScaffold};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{failedChecks as $,ruleChecks as x}from"./rule.js";import{isPanelFile as v,readLabels as w,readPanelLabels as C}from"./support/label-extraction.js";import{registryFiles as T}from"./support/registry-source.js";const p=["kicker","tagline","headline","blurb","description","copy","paragraph","photo","picture","cta","kind","class","grayscale","greyscale","colour","align","align items","text alignment","centre","catalogue","behaviour","labelled","stylised","stack","container","gutter","margin","site width","max width","contained","boxed","header offset","clearance"],j=o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=p.map(o=>({word:o,pattern:new RegExp(`\\b${j(o)}s?\\b`)}));function H(o){return o.split(/\(| — /)[0].trim()}function k(o,c){const t=H(o).toLowerCase(),a=[];for(const{word:d,pattern:l}of R)l.test(t)&&a.push(`N10.1 "${d}"`);/^title\b/.test(t)&&!c&&a.push("N10.2 Title at section level"),/^heading\b/.test(t)&&c&&a.push("N10.2 Heading at item level");const e=/\b(button|link)\s+(text|label|href|url)$/.exec(t);return e&&a.push(`N10.3 "${e[1]} ${e[2]}"`),t==="text"&&a.push("N10.4 bare Text"),a}function N(o,c,t){const a=T(o),e=o.filter(v),d=new Map,l=[],h=(n,
|
|
1
|
+
import{failedChecks as $,ruleChecks as x}from"./rule.js";import{isPanelFile as v,readLabels as w,readPanelLabels as C}from"./support/label-extraction.js";import{registryFiles as T}from"./support/registry-source.js";const p=["kicker","tagline","headline","blurb","description","copy","paragraph","photo","picture","cta","kind","class","grayscale","greyscale","colour","align","align items","text alignment","centre","catalogue","behaviour","labelled","stylised","stack","container","gutter","margin","site width","max width","contained","boxed","header offset","clearance"],j=o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=p.map(o=>({word:o,pattern:new RegExp(`\\b${j(o)}s?\\b`)}));function H(o){return o.split(/\(| — /)[0].trim()}function k(o,c){const t=H(o).toLowerCase(),a=[];for(const{word:d,pattern:l}of R)l.test(t)&&a.push(`N10.1 "${d}"`);/^title\b/.test(t)&&!c&&a.push("N10.2 Title at section level"),/^heading\b/.test(t)&&c&&a.push("N10.2 Heading at item level");const e=/\b(button|link)\s+(text|label|href|url)$/.exec(t);return e&&a.push(`N10.3 "${e[1]} ${e[2]}"`),t==="text"&&a.push("N10.4 bare Text"),a}function N(o,c,t){const a=T(o),e=o.filter(v),d=new Map,l=[],h=(n,r)=>{for(const u of n){const y=r(u.text);d.set(u.path,y.length);for(const m of y)l.push({...m,file:u.path,why:k(m.label,m.item)})}};h(a,w),h(e,C);for(const[n,r]of Object.entries(c.floors)){const u=d.get(n);t(`${n} yields >= ${r} labels (found ${u??"none: not read"})`,u!==void 0&&u>=r,u===void 0?"it has a floor but was not read — it dropped out of the panels and the registry":"the reader is broken, not the panel")}const s=a.reduce((n,r)=>n+(d.get(r.path)??0),0);t(`the block registry yields >= ${c.minRegistryLabels} labels across ${a.length} files (found ${s})`,s>=c.minRegistryLabels,"the reader is broken, not the panel");const g=l.filter(n=>n.why.length>0),f=n=>c.parked.some(r=>r.file===n.file&&r.label===n.label),i=g.filter(n=>!f(n)),b=l.filter(n=>n.item).length;t(`every field label obeys N10.1–N10.4 (${l.length} read across ${a.length+e.length} files: ${l.length-b} section-level, ${b} item-level)`,i.length===0,`${i.length} break doc/naming.md N10:
|
|
2
2
|
`+i.map(n=>` ${n.file}:${n.line} ${n.item?"[item] ":"[section]"} ${JSON.stringify(n.label)} — ${n.why.join(", ")}`).join(`
|
|
3
|
-
`));for(const n of c.parked)t(`PARKED ${n.file} ${JSON.stringify(n.label)} still breaks N10 — ${n.why}`,g.some(
|
|
4
|
-
`)},{path:"components/FixturePanel.tsx",text:['import { SettingsField } from "efficient-easel/panel";',"const items = [",' { label: "Copy", onClick: () => copy() },',"];","const rows = [",' { key: "photo", label: "Photo", group: "media" },',"];",'<SettingsField label="Colour" />'].join(`
|
|
5
|
-
`)},{path:"components/HandRolled.tsx",text:'<div className="sf-field"><Row label="Gutter" /></div>'},{path:"components/ShopperForm.tsx",text:'<Field label="Description" />'}],d=x("fixture"),{read:l,live:h}=N(e,{floors:{"components/FixturePanel.tsx":5,"components/HandRolled.tsx":1,"components/Moved.tsx":1},minRegistryLabels:8,parked:[{file:"components/FixturePanel.tsx",label:"Colour",why:"fixture: still breaks"},{file:"lib/puck/config.tsx",label:"Headline",why:"fixture: renamed long ago"}]},d.check),
|
|
3
|
+
`));for(const n of c.parked)t(`PARKED ${n.file} ${JSON.stringify(n.label)} still breaks N10 — ${n.why}`,g.some(r=>r.file===n.file&&r.label===n.label),"it no longer breaks N10 (renamed, or its row deleted) — take it out of the list");return{read:l,live:i}}function L(o,c){const{check:t,report:a}=x("label vocabulary");t(`N10.1 forbids ${p.length} words, each written once, lower-case and trimmed: ${[...p].sort().join(", ")}`,p.length>0&&new Set(p).size===p.length&&p.every(e=>e===e.trim().toLowerCase()&&e.length>0),JSON.stringify(p));{const e=(l,h=!1)=>k(l,h),d=p.filter(l=>{const h=`N10.1 "${l}"`,s=l[0].toUpperCase()+l.slice(1);return!e(s).includes(h)||!e(`Card ${l}s`).includes(h)});t("N10.1 catches every word on the list, alone and as a qualified plural",d.length===0,d.join(", ")),t("N10.1 …but not inside a longer word",e("Copyright").length===0&&e("Classic layout").length===0&&e("Stacking order").length===0,JSON.stringify([e("Copyright"),e("Classic layout"),e("Stacking order")])),t("N10.2 a section's label may not start Title, an item's may not start Heading",e("Title").includes("N10.2 Title at section level")&&e("Heading",!0).includes("N10.2 Heading at item level")),t("N10.2 …and each is right at its own level",e("Heading").length===0&&e("Title",!0).length===0&&e("Card title").length===0&&e("Section heading",!0).length===0),t("N10.3 nothing follows `button` or `link`",e("Button text").includes('N10.3 "button text"')&&e("Submit button label").includes('N10.3 "button label"')&&e("Link href").includes('N10.3 "link href"')&&e("Archive link URL").includes('N10.3 "link url"')),t("N10.3 …and the pair itself passes",e("Button").length===0&&e("Button link").length===0&&e("Archive link").length===0),t("N10.4 a bare Text fails; Alt text is a name",e("Text").includes("N10.4 bare Text")&&e("Alt text").length===0),t("the name is cut at a hint tail, so a hint cannot corrupt the verdict",e("Body (blank line = new paragraph)").length===0&&e("Copy — the words under it").includes('N10.1 "copy"'))}{const e=[{path:"lib/puck/config.tsx",text:['heading: plainText("Heading"),','eyebrow: plainText("Kicker"),','title: plainText("Title"),','cards: { type: "array", label: "Cards",'," arrayFields: {",' heading: plainText("Heading"),',' title: plainText("Card title"),'," },","},",'layout: { type: "select", label: "Layout",',' options: [{ label: "Centre", value: "center" }] },'].join(`
|
|
4
|
+
`)},{path:"components/FixturePanel.tsx",text:['import { SettingsField } from "efficient-easel/panel";',"const items = [",' { label: "Copy", onClick: () => copy() },',"];","const rows = [",' { key: "photo", label: "Photo", group: "media" },',"];","const tabs: SettingsTabItem[] = [",' { id: "text", label: "Text" },',"];",'<SettingsField label="Colour" />'].join(`
|
|
5
|
+
`)},{path:"components/HandRolled.tsx",text:'<div className="sf-field"><Row label="Gutter" /></div>'},{path:"components/ShopperForm.tsx",text:'<Field label="Description" />'}],d=x("fixture"),{read:l,live:h}=N(e,{floors:{"components/FixturePanel.tsx":5,"components/HandRolled.tsx":1,"components/Moved.tsx":1},minRegistryLabels:8,parked:[{file:"components/FixturePanel.tsx",label:"Colour",why:"fixture: still breaks"},{file:"lib/puck/config.tsx",label:"Headline",why:"fixture: renamed long ago"}]},d.check),s=$(d.report()).map(i=>i.name),g=i=>s.some(b=>b.startsWith(i)),f=l.map(i=>i.label);t("the fixture reads the registry's fields and the panels' rows, and no option, action, tab or shopper's form",f.join(" · ")==="Heading · Kicker · Title · Cards · Heading · Card title · Layout · Photo · Colour · Gutter",f.join(" · ")),t("…and the breaches are the ones it wrote, the parked one waived",h.map(i=>`${i.label}=${i.why.join("+")}`).join(" · ")==='Kicker=N10.1 "kicker" · Title=N10.2 Title at section level · Heading=N10.2 Heading at item level · Photo=N10.1 "photo" · Gutter=N10.1 "gutter"',JSON.stringify(h.map(i=>[i.label,i.why]))),t("a file under its floor goes red",g("components/FixturePanel.tsx yields")&&!g("components/HandRolled.tsx yields"),s.join(" | ")),t("a floored file that is not read goes red",g("components/Moved.tsx yields"),s.join(" | ")),t("a registry under its floor goes red",g("the block registry yields"),s.join(" | ")),t("a PARKED label that no longer breaks N10 goes red, and one that still does is waived",g('PARKED lib/puck/config.tsx "Headline"')&&!g('PARKED components/FixturePanel.tsx "Colour"'),s.join(" | ")),t("the verdict goes red on a live breach",g("every field label obeys"),s.join(" | ")),t("…and nothing else did",s.length===5,s.join(" | "))}return N(o,c,t),a()}export{p as NEVER_WORDS,L as labelVocabulary,k as vocabularyBreaches};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ruleChecks as $}from"./rule.js";const n=
|
|
2
|
-
// ${e}`))),t("the reader sees
|
|
1
|
+
import{ruleChecks as $}from"./rule.js";const n=l=>l.replace(/\/\*[\s\S]*?\*\//g,"").replace(/(^|[^:])\/\/.*$/gm,"$1"),c=new RegExp('type=\\{?"color"'),i=new RegExp("<ColorPicker\\b"),h=new RegExp(`<(?:${["ColourPicker","ColourSwatchRow","ColourWindow"].join("|")})\\b`),d=new RegExp('className="[^"]*sf-(ink|colorinput)');function k(l,s){const{check:t,report:C}=$("one colour control");{const e='<input type="color" value={v} />',m="<ColorPicker value={v} onChange={f} />",w="<ColourSwatchRow value={v} onChange={f} />";t("the reader sees a native colour input",c.test(n(e))),t("…and not one a comment talks about",!c.test(n(`/* ${e} */
|
|
2
|
+
// ${e}`))),t("the reader sees the shell's ColorPicker",i.test(n(m))),t("…and tells it from efficient-easel's colour UI",!i.test(w)&&h.test(w)&&!h.test(m)),t("…and the retired classes in markup",d.test('<span className="sf-ink-row" />')&&d.test('<div className="x sf-colorinput" />'))}const r=l.filter(e=>/\.tsx?$/.test(e.path));t(`read the source (${r.length} TS/TSX files, at least ${s.minFiles})`,r.length>=s.minFiles,"fewer means the walk broke, and every check below is vacuous");const a=r.map(e=>[e.path,n(e.text)]),u=a.filter(([,e])=>c.test(e)).map(([e])=>e),o=a.filter(([,e])=>i.test(e)).map(([e])=>e),p=a.filter(([,e])=>h.test(e)).map(([e])=>e);t("§1 nothing draws efficient-easel's own colour UI — the shell's ColorPicker replaced it (harness UI-24)",p.length===0,p.join(", ")),t("§1 nothing draws a native colour input — its window is the operating system's",u.length===0,u.join(", ")),s.sharedControl?(t(`read the shared control ${s.sharedControl}`,r.some(e=>e.path===s.sharedControl)),t("§1 exactly one file draws efficient-shell's ColorPicker",o.length===1,o.length===0?"NONE — the reader is broken, and every check below is vacuous":`${o.length}: ${o.join(", ")}`),t(`§1 …and it is the shared control, ${s.sharedControl}`,o[0]===s.sharedControl,o.join(", "))):t("§1 no file here draws efficient-shell's ColorPicker — the builder's shared control is the one that does",o.length===0,`${o.length}: ${o.join(", ")}`);const f=r.filter(e=>d.test(e.text)).map(e=>e.path);return t("§9 nothing draws a `sf-ink-` or `sf-colorinput` class any more",f.length===0,f.join(", ")),C()}export{k as oneColourControl,n as stripComments};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
`),n=new RegExp(`(?<![A-Za-z0-9_.$])(${
|
|
3
|
-
`),n=[];for(let
|
|
4
|
-
`).forEach((n,
|
|
5
|
-
`);return[...A(e),...
|
|
1
|
+
const g=["text","textarea","plainText","copyText","plainTextarea","linkField","textList","upload","toggle","checkbox","select","searchSelect","segmented","slider","colorInput","focalPicker","sizeField","backgroundField","multiSelect"];function A(e){const t=e.split(`
|
|
2
|
+
`),n=new RegExp(`(?<![A-Za-z0-9_.$])(${g.join("|")})\\("((?:[^"\\\\]|\\\\.)*)"`,"g"),o=/label:\s*"((?:[^"\\]|\\.)*)"/g,s=new RegExp(`(?<![A-Za-z0-9_.$])(${g.join("|")})\\(\\s*$`),l=/^\s*"((?:[^"\\]|\\.)*)"\s*,/,r=[];let c=0,h=0;const f=[];return t.forEach((a,u)=>{const d=u+1,b=h>0;for(const i of a.matchAll(n))r.push({line:d,label:i[2],item:b,builder:i[1]});const m=s.exec(a);if(m){let i=u+1;for(;i<t.length&&t[i].trim()==="";)i+=1;const p=i<t.length?l.exec(t[i]):null;p&&r.push({line:i+1,label:p[1],item:b,builder:m[1]})}for(const i of a.matchAll(o)){const p=a.slice(0,i.index??0),x=u>0?t[u-1].trim():"";(/type:\s*"/.test(p)||/type:\s*"[a-z]+"\s*,?$/.test(x))&&r.push({line:d,label:i[1],item:b})}for(let i=0;i<a.length;i+=1)a[i]==="{"?(/arrayFields:\s*$/.test(a.slice(0,i))&&(f.push(c),h+=1),c+=1):a[i]==="}"&&(c-=1,f.length&&c===f[f.length-1]&&(f.pop(),h-=1))}),r}function L(e,t){let n=0,o=-1;for(let l=t-1;l>=0;l-=1){const r=e[l];if(r==="}")n+=1;else if(r==="{"){if(n===0){o=l;break}n-=1}}if(o<0)return"";let s=0;for(let l=o;l<e.length;l+=1)if(e[l]==="{")s+=1;else if(e[l]==="}"&&(s-=1,s===0))return e.slice(o,l+1);return e.slice(o)}function $(e){let t=0,n="";for(const o of e){if(o==="{"||o==="["){t+=1;continue}if(o==="}"||o==="]"){t-=1;continue}t===1&&(n+=o)}return n}function w(e,t){const n=$(L(e,t));return/(^|[,;])\s*(value|fields|render|resolveFields|panelId|href|amount|meta)\s*:/.test(n)||y(e,t)}function y(e,t){let n=0,o=0;for(let s=t-1;s>=0;s-=1){const l=e[s];if(l==="}"||l==="]"||l===")")n+=1;else if(l==="{"||l==="("){if(n>0){n-=1;continue}if(l==="("||++o>1)return!1}else if(l==="["){if(n>0){n-=1;continue}return/SettingsTabItem\[\]\s*=\s*$/.test(e.slice(Math.max(0,s-80),s))}}return!1}function F(e){const t=e.split(`
|
|
3
|
+
`),n=[];for(let l=0,r=0;l<t.length;l+=1)n.push(r),r+=t[l].length+1;const o=/label:\s*"((?:[^"\\]|\\.)*)"/g,s=[];return t.forEach((l,r)=>{for(const c of l.matchAll(o))w(e,n[r]+(c.index??0))||s.push({line:r+1,label:c[1],item:!1})}),s}const j=/(?<![-A-Za-z])label="((?:[^"\\]|\\.)*)"/g;function E(e){const t=[];return e.split(`
|
|
4
|
+
`).forEach((n,o)=>{for(const s of n.matchAll(j))t.push({line:o+1,label:s[1],item:!1})}),t}const S=/className="sf-field"|from\s*["']efficient-easel/;function I(e){return e.path.startsWith("components/")&&e.path.endsWith(".tsx")&&S.test(e.text)}const k=6;function O(e,t){for(let n=t;n<Math.min(e.length,t+k);n+=1){if(/^\s*\}[,)]?\s*$/.test(e[n])&&n>t)return!1;if(/\bonClick:/.test(e[n]))return!0}return!1}function N(e){const t=new Set,n=e.split(`
|
|
5
|
+
`);return[...A(e),...F(e),...E(e)].filter(o=>{const s=`${o.line}:${o.label}`;return t.has(s)?!1:(t.add(s),!O(n,o.line-1))})}export{g as BUILDERS,j as JSX_LABEL,I as isPanelFile,E as readJsxLabels,A as readLabels,N as readPanelLabels,F as readRowLabels};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.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",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@tabler/icons-react": "^3.46.0",
|
|
42
|
-
"efficient-easel": "^0.
|
|
43
|
-
"efficient-shell": "^4.
|
|
42
|
+
"efficient-easel": "^1.0.0",
|
|
43
|
+
"efficient-shell": "^4.165.0",
|
|
44
44
|
"isomorphic-dompurify": "^3.18.0",
|
|
45
45
|
"next": ">=16",
|
|
46
46
|
"react": ">=19",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@types/node": "^20",
|
|
59
59
|
"@types/react": "^19",
|
|
60
60
|
"@types/react-dom": "^19",
|
|
61
|
-
"efficient-easel": "^0.
|
|
62
|
-
"efficient-shell": "^4.
|
|
61
|
+
"efficient-easel": "^1.0.0",
|
|
62
|
+
"efficient-shell": "^4.165.0",
|
|
63
63
|
"esbuild": "^0.28.0",
|
|
64
64
|
"happy-dom": "^20.14.5",
|
|
65
65
|
"isomorphic-dompurify": "^3.18.0",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type TypedNumberOutcome = {
|
|
2
|
-
handled: boolean;
|
|
3
|
-
editing: boolean;
|
|
4
|
-
commit: number | null;
|
|
5
|
-
};
|
|
6
|
-
export declare const TYPED_NUMBER_COMMIT = "Enter";
|
|
7
|
-
export declare const TYPED_NUMBER_CANCEL = "Escape";
|
|
8
|
-
export declare function typedNumberValue(text: string, min: number, max: number, step: number): number | null;
|
|
9
|
-
export declare function typedNumberKey(key: string, draft: string, min: number, max: number, step: number): TypedNumberOutcome;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const l="Enter",c="Escape",s=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/,m=/(px|%)$/i;function p(n,e,r,t){const u=n.trim().replace(/\s+/g,"").replace(m,"");if(!s.test(u))return null;const i=Number(u);if(!Number.isFinite(i))return null;const a=Math.min(r,Math.max(e,i));if(!(t>0))return a;const d=e+Math.round((a-e)/t)*t,o=Math.min(r,Math.max(e,d));return Number(o.toFixed(4))}function f(n,e,r,t,u){return n===l?{handled:!0,editing:!1,commit:p(e,r,t,u)}:n===c?{handled:!0,editing:!1,commit:null}:{handled:!1,editing:!0,commit:null}}export{c as TYPED_NUMBER_CANCEL,l as TYPED_NUMBER_COMMIT,f as typedNumberKey,p as typedNumberValue};
|