efficient-web-builder 56.0.0 → 57.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 +36 -0
- package/dist/editor/components/HeroPartPanel.js +1 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/SiteFields.d.ts +2 -1
- package/dist/editor/components/SiteFields.js +1 -1
- package/dist/editor/components/storefront-editor.css +5 -5
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/components/useSectionToBoxPass.js +1 -1
- package/dist/editor/lib/animation/entrance-fields.d.ts +0 -3
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/animation/loop-fields.d.ts +2 -0
- package/dist/editor/lib/animation/loop-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +2 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/host-document-bridge.d.ts +2 -1
- package/dist/editor/lib/host-document-bridge.js +1 -1
- package/dist/editor/lib/keyed-store.d.ts +7 -0
- package/dist/editor/lib/keyed-store.js +1 -0
- package/dist/editor/lib/page-live-state.js +1 -1
- package/dist/editor/lib/page-video-frames.d.ts +11 -0
- package/dist/editor/lib/page-video-frames.js +1 -0
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/editor/lib/sections/new-section-node.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/animation/hover.d.ts +2 -3
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/document/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/section-catalog.js +6 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +7 -2
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/hero-video.d.ts +10 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/sections/active-press-context.d.ts +4 -0
- package/dist/format/lib/sections/active-press-context.js +1 -0
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/sections/section-presets.d.ts +5 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +2 -2
- package/dist/format/lib/web-backend.d.ts +9 -0
- package/dist/render/components/{BoxCellWidthContext.d.ts → BoxCellContext.d.ts} +0 -1
- package/dist/render/components/BoxCellContext.js +1 -0
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +0 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/sanitize.d.ts +1 -0
- package/dist/render/lib/document/sanitize.js +1 -1
- package/package.json +5 -5
- package/dist/render/components/BoxCellWidthContext.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as l,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Pe,createContext as Ut,useContext as Kt,useEffect as $t,useId as Be,useRef as V,useState as z}from"react";import{useEasel as ce,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as Xt,fromDateKey as jt}from"efficient-shell/format";import{say as i,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as De,loadingShowsOf as Vt,loadingStillHint as zt}from"../../../format/lib/hero-video.js";import{readHidable as ve,hidableText as He}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as ue,LINK_FIELD_MARKER as Ge,MEDIA_FIELD_MARKER as Me,SCAFFOLD_FIELD_MARKER as We,TEXT_FIELD_MARKER as T,foldMetaOf as de,textFieldIdentifier as Yt}from"efficient-easel/draw";import qt from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Ue}from"../../../render/lib/document/show-when.js";import Jt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Zt,CORNER_RADIUS_MAX as Ke,CORNER_RADIUS_MIN as W}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as Qt,IMAGE_CORNERS_LABEL as en}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as tn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as nn,GALLERY_LAYOUTS as te,GALLERY_LAYOUT_KEYS as on,galleryChoices as $e,galleryPictureCells as rn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as ln}from"./shell-glyph.js";import{anchorSiblingsOf as sn,placementPoints as an}from"../../../format/lib/hero-group-placement.js";import cn from"../../components/AnchorField.js";import un from"../../components/SourceStatus.js";import{AdjustIcon as dn,EyeIcon as pn,AnimationIcon as fn,BackgroundIcon as hn,BorderAllIcon as mn,BlockSectionIcon as gn,ColumnWidthsIcon as pe,ColumnsIcon as Xe,CornerIcon as bn,DirectionDownIcon as xn,DirectionLeftIcon as Sn,DirectionRightIcon as yn,DirectionUpIcon as wn,EditIcon as Cn,GapIcon as _n,GridIcon as Rn,GroundIcon as fe,HashIcon as je,HeightIcon as On,ImageIcon as Tn,ListIcon as En,LocationIcon as Ve,PaddingBottomIcon as ze,PaddingLeftIcon as Ye,PaddingRightIcon as qe,PaddingTopIcon as Je,PageIcon as In,StickyIcon as kn,SearchIcon as Fn,SquareIcon as An,TypeIcon as Ln,WidthIcon as Nn}from"efficient-easel/icons";import{FieldGlyph as Ze}from"../../components/FieldGlyph.js";import{resolvePageBackground as Pn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Bn}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as Qe,CORNER_SIDE_POINTS as Dn,hasOwnSectionCorners as vn,normalizeCornerSides as et}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Hn,enclosingSection as Gn}from"./enclosing-section.js";import{SettingsDefaultReset as w,SettingsDrill as Mn,SettingsField as x,SettingsGroup as Wn,SettingsGroupSub as Un,SettingsSegmented as Kn,SettingsBorder as $n,SettingsSidesEach as Xn,SettingsSwitch as he,borderSides as jn,borderStartEach as Vn}from"efficient-easel/panel";import{ListField as zn}from"efficient-easel/fields";import{DisplayChips as Yn}from"efficient-shell/ui";import{desktopDisplayChanged as qn,partShownOnDesktop as Jn,partShownOnPhone as Zn,phoneDisplayChanged as Qn,withDesktopPart as eo,withPhonePart as to}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as no,Checkbox as oo,ColorSwatch as ro,CornersInput as lo,DatePicker as io,DateTimePicker as so,FOCAL_DEFAULT as ao,IconPicker as tt,COLUMN_COUNT_MAX as nt,COLUMN_SHARE_MIN as co,COLUMN_SHARES_EQUAL as uo,resolveColumnShares as ot,WidthsBar as po,useShellStrings as fo,IconButton as rt,InputNumber as lt,Slider as ho,Tooltip as me}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as mo}from"./geocode-resolve.js";import{ColourRow as it,InheritedColourRow as ge}from"./ColourControl.js";import{keptByRow as go}from"efficient-easel/screen/lib/document/style-fields";import st from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as bo,NoControlMark as xo,noControlField as at}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as So}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as yo,resolvePhoneValue as be}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as U}from"efficient-easel/draw";import{SuppressibleText as wo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Co,CARD_OUTLINE_OPTIONS as _o,DEFAULT_CARD_INDEX_FORMAT as Ro,DEFAULT_CARD_OUTLINE as Oo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as To,DEFAULT_COVER_INDEX as Eo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Io}from"efficient-easel/draw";import ko from"../../components/MediaUploadField.js";import Fo from"../../components/MultiSelectField.js";import Ao from"../../components/SectionThemePicker.js";import Lo from"../../components/SearchSelectField.js";import No from"../../components/StorefrontLinkField.js";import{UiIcon as ct}from"efficient-easel/draw/client";import{SECTION_PADDING as E}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Po}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Bo}from"efficient-easel/draw/client";import{encodePartId as Do}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as vo,useEaselStrings as Ho}from"efficient-easel/strings";import{hasPhoneHeight as Go,hasTabletHeight as xe,resolveSectionMinHeight as Mo,resolveTabletHeight as Wo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ne,SECTION_STICK_LABEL as Se,hasPhoneStick as Uo,hasTabletStick as Ko,resolveSectionStick as ut}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as $o,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as Xo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as jo,resolveContainerDirection as dt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Vo,BOX_BLOCK_SPACING_POINTS as pt,BOX_PHONE_ROW_LABEL as ft,BOX_COLUMNS_MAX as zo,BOX_COLUMNS_MIN as ht,BOX_PHONE_ROW_MAX as Yo,BOX_PHONE_ROW_MIN as ye,BOX_SHARE_CHOICES as mt,BOX_SHARE_LABEL as K,boxShareChoiceOf as gt,boxShareWidthsOf as we,BOX_SHARE_PHONE_DEFAULT as qo,BOX_SHARE_PHONE_POINTS as Jo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as B}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Zo,borderBySide as bt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Qo,normalizeTheme as xt,normalizeThemeColors as er,sectionBandTone as tr,surfaceTwoTone as nr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as St,CONTAINER_GAP_BUILT_IN as or,CONTAINER_GAP_PHONE as Ce,GAP_FIELD_CONTAINER as _e,followsSitePhoneGap as rr,hasOwnContainerGap as lr,hasOwnPhoneGap as Re,resolveContainerGap as yt,resolvePhoneContainerGap as wt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as ir,CARD_IMAGE_BG_OFF as sr,CARD_IMAGE_BG_SWATCH_NAMES as ar,CARD_IMAGE_BG_SWATCHES as cr,isCardImageBackgroundInheriting as ur,cardImageBackgroundChoice as dr,THEME_CARD_IMAGE_BG as pr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as fr,SECTION_BG_NO_FILL as hr,sectionBackgroundChoice as mr,THEME_SECTION_BG as Oe,isSectionBackgroundEmpty as gr,sectionBackgroundHex as Ct}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as br,nestedAccentValue as _t,resolveSectionAccent as oe}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as xr,TYPE_SIZE_INHERIT as Sr,isTypeSizeInheriting as yr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as wr,WIDTH_CHOICE_LABEL as Cr,WIDTH_INHERIT as _r}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Rr}from"./panel-heading-scope.js";import{useEaselSession as Or}from"efficient-easel/screen/lib/session-context";import{backendOf as Tr}from"../website-session.js";import{BOX_GAP as Er,describedAs as I,group as O,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Te,onDesktopWords as D,phoneTwinFields as re}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Ir,gapField as Ee,iconPickerRow as kr,pickerCellIcon as Fr,pickerNoneIcon as Ar,Segmented as Ie,segmented as Lr,select as Z,slider as $}from"./box-fields.js";function xs({children:e}){return l("div",{className:"sf-field-label",children:typeof e=="string"?i(e):e})}function v(e,t){return i("{value} from {from}",{value:e,from:t})}function Nr(){const{blockGap:e}=B();return e===null?i("this container's own spacing"):v(`${e}px`,i("Styles"))}function Pr({inherited:e,onReset:t,label:n}){return l(w,{words:y()?.panel,label:i(n),changed:!e,detail:Nr(),onReset:t})}function Br(e){return Ee({...Er,builtIn:or[e],resolve:(t,n)=>yt(e,t,n?.siteGap),action:(t,n)=>l(Pr,{inherited:!lr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[_e]:e}})}function Dr(e){return Ue(R("mobile",{[_e]:e,type:"custom",render:t=>l(Gr,{container:e,...t})}),Rt)}function vr(e){return Ue(R("tablet",{[_e]:e,type:"custom",render:t=>l(Hr,{container:e,...t})}),Rt)}const Rt={not:{field:"gap",in:Array.from({length:-St.min},(e,t)=>St.min+t)}};function Ss(e){return{gap:R("desktop",Br(e)),[U("gap")]:vr(e),[F("gap")]:Dr(e)}}function Hr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Ce.min,yt(e,n,o));return Ee({...Ce,builtIn:r,resolve:s=>Re(s)?s:r,action:(s,c)=>l(w,{words:y()?.panel,label:i("Gap"),changed:Re(s),detail:D(u=>i(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Gr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},a=wt(e,void 0,n,o,r);return Ee({...Ce,builtIn:a,resolve:c=>wt(e,c,n,o,r),action:(c,u)=>l(w,{words:y()?.panel,label:i("Gap"),changed:Re(c),detail:v(`${a}px`,rr(e,n,r)?i("Styles"):i("Desktop")),onReset:()=>u(void 0)})}).render(t)}function ys(e){return Ir({offered:jo(e),fallback:dt(e,void 0),resolve:t=>dt(e,t)})}function ws(e,t){return an(t?sn(e,t):[],t)}function Mr({inherited:e,onReset:t,label:n}){return l(w,{words:y()?.panel,label:i(n),changed:!e,detail:v(i("Full"),i("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:u,hidden:f}=ve(e),m=V(null),p=V(null),d=_=>t(s?{text:_,hidden:f}:_),g=()=>t({text:u,hidden:!f}),h=s&&f,C=Be(),S=r?Xr(r)?l("span",{className:"sf-hint-while-typing",children:i(r)}):i(r):void 0,b=f?i("Show {label} on the slide",{label:i(n)}):i("Hide {label} on the slide",{label:i(n)});return l(x,{label:i(n),icon:l(Ln,{}),htmlFor:C,className:h?"is-hidden":void 0,hint:S,action:s?l(me,{content:b,children:l(rt,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?l(ct,{name:"eye-off",size:14}):l(ct,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&l(st,{target:a?p:m,value:u,onChange:d}),a?l("textarea",{id:C,ref:p,value:u,placeholder:o===void 0?void 0:i(o),onChange:_=>d(_.target.value)}):l("input",{id:C,ref:m,type:"text",value:u,placeholder:o===void 0?void 0:i(o),onChange:_=>d(_.target.value)})]})})}function Cs(e,t){return{...e,[We]:t}}function _s(e){const t=e[T];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[T]:{...t,offPage:!0}}}function Rs(e){return!e||typeof e!="object"?!1:e[T]?.offPage===!0}const Ot="sfPanelOnly";function Os(e){if(!e[T])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Ot]:!0}}function Ts(e){return!!e&&typeof e=="object"&&e[Ot]===!0}function Es(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 Ma,SCALAR_TEXT_CONTROLS as Wa}from"efficient-easel/draw";function Is(e,t){if(!e[T])throw new Error("inOwnBox: the field holds no authored text");const{[bo]:o,...r}=e;return{...r,[So]:!0,render:t}}const Wr=new Set(Io),Q={type:"radio",options:[{value:!0},{value:!1}]},Tt={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=I({...t,[T]:e},{...Tt[e.control],label:e.label});if(!Wr.has(e.control))return n;const o=t.render;return{...at(n,"authored-copy"),render:r=>l(wo,{name:r.name,children:o(r)})}},ks="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Ur={field:"source.slug",set:!0},Fs={not:Ur},Kr="Select a word, then press the highlighter.",$r=new Set([Kr]),Xr=e=>$r.has(e);function As(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>l(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ls(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>l(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ns(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>l(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Ps(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>l(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Bs(e){return{type:"custom",[Ge]:{label:e},...I({},{type:"text",label:e}),render:({value:t,onChange:n})=>l(No,{value:He(t),onChange:n,label:e})}}function Ds(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>l(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const vs={Design:dn,Animation:fn};function Hs(e){return{type:"custom",render:()=>l(jr,{text:e})}}function jr({text:e}){return l("p",{className:"sf-note",children:i(e)})}function Gs(e){return de(e)!==null&&e?.tabs!==void 0}const Et=new Map;function Ms(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Et.get(n)??{type:"custom",tabs:t,[ue]:{label:e,level:1},bucket:e,marker:!0,render:()=>l(k,{})};return Et.set(n,o),o}const It=new Map;function Ws(e){const t=It.get(e)??{type:"custom",[ue]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>l(k,{})};return It.set(e,t),t}function Vr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Us(e,t){return Vr(e)===t?e:{...e,marker:!0,fold:t,render:()=>l(k,{})}}function Ks(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>l(k,{})}}function $s({title:e,children:t}){const[n,o]=z(()=>!ke.has(e));return l(Wn,{title:e,open:n,onToggle:r=>{o(r),r?ke.delete(e):ke.add(e)},children:t})}const ke=new Set;function Xs({label:e}){return l(Un,{title:i(e),level:Rr(2)})}function zr({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),a=r?o?.[r]:void 0,s=a?i(a):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?i(o[c]):c;return l(me,{content:u,children:l(ro,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),l("span",{className:"sf-swatch-hex",children:s})]})}function js(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>l(Yr,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Yr({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const a=typeof o=="string"?o:void 0,{colors:s,n:c}=Wt(),u={background:s.background,surface:s.surface,surface2:nr(s),band:tr(s)},f=n?Oe:t,m=gr(a,t,f),p=Ct(void 0,f,u),d=n?fr:void 0,g=mr(a,t),h=f===Oe?i("the theme's section background"):i("Theme {n} background",{n:c});return l(ge,{label:i(e),icon:l(hn,{}),value:m?"":Ct(a,t,u),inherited:p,resetTo:v(p.toUpperCase(),h),onChange:r,onReset:()=>r(d),choices:[{label:i("No fill"),color:"",selected:g==="none",onPick:()=>r(hr)},{label:`${i("Section band")} · ${u.band.toUpperCase()}`,color:u.band,selected:g==="band",onPick:()=>r(Oe)}]})}function qr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=ur(r,t);return l(x,{label:i(e),icon:l(fe,{}),changed:!a,action:l(w,{words:y()?.panel,label:i(e),changed:!a,detail:i("the theme's image stage"),onReset:()=>o(ir)}),children:zr({swatches:cr,current:a?pr:dr(r,t),onPick:o,names:ar})})}}}function Vs(e=n=>n,t){return J({_gSectionTheme:O(br),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>l(Ao,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:u,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:d}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return l("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:l(ho,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:i(p)}:{},suffix:a||void 0,showInput:s,label:u===void 0?void 0:i(u),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?d?.():h!==o&&r(h)}})})}function kt(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:u,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:d})=>{const g=typeof p=="number"?p:null,h=g===null;return l(x,{label:i(e),icon:f?q(f):void 0,value:h?u||a===void 0?void 0:i(a):`${g}${m}`,changed:!h,action:u?Pe(u,{changed:!h,onReset:()=>d(null)}):l(w,{words:y()?.panel,label:i(e),changed:!h,onReset:()=>d(null)}),hint:typeof s=="string"?i(s):s,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:d}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:d})})}}}const le="Corners";function Fe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return l(x,{label:i(le),icon:l(bn,{}),changed:r,action:Pe(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:l(Zr,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Ft(){return at({type:"custom",render:()=>l(xo,{})},"always")}function Jr(){const e=M();return t=>e?.onChangeMany(t)}function Zr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=A(e.sidesKey),s=et(r)??[...Qe];return l(lo,{label:i(le),value:s,corners:Dn,onChange:c=>{const u=et(c)??[];a(u.length===Qe.length?null:u)},radius:t,onRadiusChange:n,radiusMin:W,radiusMax:Ke,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function At(){return Ft()}function Qr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=B(),r=typeof o=="number"?`${o}px`:i("not set");return l(w,{words:y()?.panel,label:i(e),changed:t,detail:o==null?i("the built-in corners"):v(r,i("Styles")),onReset:n})}function el(){const{cornerRadiusPx:e}=B();return typeof e=="number"?e:W}function tl(){return Fe({sidesKey:"sectionCornerSides",useFollowed:el,mark:l(Qr,{label:le}),hint:nl})}const nl="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function zs(){return J({_gShape:O("Shape"),sectionCorners:tl(),sectionCornerSides:At(),...X("sectionBorder",Lt)})}const ol=()=>({width:i("Border width"),sides:{top:i("Border top"),right:i("Border right"),bottom:i("Border bottom"),left:i("Border left")},style:i("Border style"),styles:{solid:i("Solid"),dashed:i("Dashed"),dotted:i("Dotted")},color:i("Border color"),unit:"px"});function rl(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ll(){let e;try{const t=xt(B().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Qo.line}function il({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:a=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[u,f]=z(()=>r?Vn(c,s):!1),m=ol(),p=d=>rl(r&&a?d:{width:d.width,color:d.color,...a?{style:d.style}:{}});return l(x,{label:i("Border"),icon:l(mn,{}),action:r?l(Xn,{each:u,label:i("Each side"),onChange:f}):void 0,children:l($n,{label:i("Border"),value:c,each:u,onChange:d=>t(p(d)),placeholder:n,presets:o,words:m,styles:a,max:Zo})})}function sl({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(U("sectionBorder")),a=ll(),s=u=>u&&typeof u=="object"?u:{},c=n==="phone"?{...bt(s(o)),...bt(s(r))}:n==="tablet"?s(o):{};return l(il,{value:e,onChange:t,placeholder:{sides:jn(c),style:c.style??"solid",color:c.color||a},presets:[a],above:c})}function Ys(e){return R(e,Lt(e==="mobile"?"phone":e))}function Lt(e){return{type:"custom",render:({value:t,onChange:n})=>l(sl,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>re(e,t(o),Te)[r];return{[e]:n("desktop",e),[U(e)]:n("tablet",U(e)),[F(e)]:n("phone",F(e))}}function qs(e){return{type:"custom",render:()=>l(al,{partKey:e})}}function al({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=B(),r=Ho();let a=null;try{a=Bo().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return l(Mn,{name:i("Text"),preview:Po(s,c,{noStyle:i("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??vo.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(Do(t,e))}})}function Nt(e){const{cornerRadiusPx:t}=B(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=ce(u=>u),c=s?.props?.id?String(s.props.id):void 0;o=c?Gn(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return vn(r)?r:n}function cl({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Nt(W);return l(w,{words:y()?.panel,label:i(e),changed:t,detail:v(`${o}px`,i("the section")),onReset:n})}function ul(){return l(k,{children:i("Follows the section's Corners until you set a number here.")})}function dl(){return Fe({sidesKey:"cardCornerSides",useFollowed:()=>Nt(W),mark:l(cl,{label:le}),hint:l(ul,{})})}function pl(){return{type:"custom",render:()=>l(qt,{})}}function Js(e){return{...e,render:t=>l(Jt,{render:e.render,props:t})}}function Zs(){return{_gShape:O("Shape"),cardCorners:dl(),cardCornerSides:At(),cardCornersApplyAll:pl()}}function fl(){return I({type:"custom",render:e=>l(ml,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function hl(e,t){const n=gt(e);if(n!=="custom")return i(mt.find(r=>r.value===n)?.label??"");const o=ot(we(e,t),t);return o?[...o,100-o.reduce((r,a)=>r+a,0)].join(" / "):i("Custom")}function ml(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,a="follows"in e,s=t!=null,c=s?t:a?e.follows:void 0,u=gt(c),f=r>=2&&r<=nt,m=()=>[...uo[r]??[]],p=V(null),d=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===u||b==="custom"&&!f||n(b==="custom"?m():b)},h=i("The width bar works for 2 to {count} blocks.",{count:nt}),C=s&&(a||t!=="content"),S=fo().widths.hint(r,co);return l(x,{label:i(K),icon:l(pe,{}),changed:C,hint:u!=="custom"?void 0:f?S:h,action:l(w,{words:y()?.panel,label:i(K),changed:C,disabled:e.readOnly===!0,detail:a?D(b=>i(b),hl(e.follows,r),e.followsView):i("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[l("div",{className:"sf-share-pick",children:l(tt,{label:i(K),value:u,options:mt.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:i(b.label),icon:Fr(l("span",{className:"sf-gallery-pic sf-share-pic",children:Pt(b.weights).map((_,j)=>l("i",{style:{gridColumn:`span ${_}`}},j))}),i(b.label),b.value==="custom"&&!f?h:i(b.label))})),onChange:g,columns:3,cell:Bt,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&f?l("div",{onFocus:()=>{p.current={value:t,shares:ot(we(c,r),r)}},onBlur:()=>{p.current=null},children:l(po,{label:i(K),count:r,value:we(c,r),onChange:d,readOnly:e.readOnly===!0})}):null]})})}function Pt(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 Qs(){return Z(Vo,l(_n,{}),pt,pt[0].value)}function ea(){return R("mobile",kr(K,l(pe,{}),Jo.map(e=>({label:e.label,value:e.value,picture:l("span",{className:"sf-gallery-pic sf-share-pic",children:Pt(e.weights).map((t,n)=>l("i",{style:{gridColumn:`span ${t}`}},n))})})),qo,{columns:2,cell:Bt}))}const Bt={width:"5.75rem",height:"3.25rem"};function ta(){return re("share",fl(),Te)[U("share")]}function gl(){return R("mobile",$(ft,l(Xe,{}),ye,Yo,1,ye,"",{clear:{phoneFollows:!1,hint:ye}}))}const Dt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function na(){const e=$(ft,l(Xe,{}),ht,zo,1,ht,"",{clear:{emptyLabel:"Auto"}}),t=re("columns",e,{...Dt,tablet:Te.tablet}),n=re("columns",e,Dt,{phoneRow:gl()});return{...t,phoneRow:n.phoneRow}}function oa(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>l(x,{label:i(e),icon:l(Ze,{noun:a}),action:l(w,{words:y()?.panel,label:i(e),changed:!yr(s),detail:i("the Text style in Styles"),onReset:()=>c(Sr),defaultAction:{onPress:()=>c(xr),title:i("Keep this section's own built-in size"),icon:l(gn,{})}}),children:ee({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function ra(){return{_gCellWidth:O("Cell width"),gridSpan:Z("Positions",l(pe,{}),[{label:"Auto",value:""},...Array.from({length:tn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Kt(bl),t=ce(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const bl=Ut(null);function xl({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const u=L()[s],f=be(void 0,u,c);return l(k,{children:ee({min:e,max:t,step:n,value:be(o,u,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function Sl({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=L()[t],c=be(void 0,s,n);return l(w,{words:y()?.panel,label:i(e),changed:r,detail:D(u=>i(u),`${c}${o}`),onReset:a})}function yl(e){return kt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:l(Sl,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>l(xl,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const wl={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Cl={Top:Je,Bottom:ze,Left:Ye,Right:qe},_l=e=>{const t=Cl[e];return l(t,{})};function la(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=S=>wl[S],a=S=>$(r("Top"),l(Je,{}),E.min,E.max,E.step,S,"px"),s=(S,b,_,j=E)=>R("mobile",yl({label:r(S),icon:_l(S),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??E.min,u=e.bottom??E.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??E,d=e.side??p.min,g=e.sidePhone??d,h=e.phone===!0,C=S=>h?R("desktop",S):S;return J({...o?{_gSpacing:O("Padding")}:{},[t]:C(a(c)),...h?{[F(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:C($(r("Bottom"),l(ze,{}),E.min,E.max,E.step,u,"px")),...h?{[F(n)]:s("Bottom",n,u)}:{}},...e.sides?{[f]:C($(r("Left"),l(Ye,{}),p.min,p.max,p.step,d,"px")),...h?{[F(f)]:s("Left",f,g,p)}:{},[m]:C($(r("Right"),l(qe,{}),p.min,p.max,p.step,d,"px")),...h?{[F(m)]:s("Right",m,g,p)}:{}}:{}})}function ia(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&de(s)?e[a]:s])),o={};let r=!1;for(const[a,s]of Object.entries(e)){if(a in t){r||Object.assign(o,n),r=!0;continue}o[a]=s}return r||Object.assign(o,n),o}const ie="Width";function sa(e,t=wr,n=!0){const o=t.map(r=>({label:Cr[r],value:r}));return J({...n?{_gWidth:O(ie)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>l(x,{label:i(ie),icon:l(Nn,{}),action:n?l(Mr,{inherited:a?.inherited??!1,onReset:()=>r(_r),label:ie}):void 0,children:Ie({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:ie})})}})}function aa(){const e=(o,r)=>({type:"custom",render:({value:a,onChange:s})=>l(Rl,{value:a,onChange:s,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:a,field:s})=>l(Tl,{value:r,onChange:a,unit:s?.unit,view:o})}),n=o=>{const r=Lr("Unit",l(je,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const a=r.render;return{...r,render:s=>l(El,{props:s,draw:a,view:o})}};return J({_gHeight:O(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>l(Il,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function Rl({value:e,onChange:t,view:n,badge:o}){const r=L(),a=c=>["auto","fixed","screen"].includes(c),s=se(n,r)?.mode??"auto";return l(x,{label:Y,icon:q(l(On,{})),action:o?o(t):void 0,children:Ie({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:a(e)?e:s,onChange:t,ariaLabel:Y})})}function vt(e,t){return e==="phone"&&xe(t)?Wo(t):Mo(t)}function se(e,t){return e==="desktop"||(e==="tablet"?xe(t):Go(t))?null:vt(e,t)}const P=(e,t)=>e==="tablet"?U(t):F(t);function Ol(e,t,n,o){const r=se(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Ht(e,t,n){const o=M(),r=se(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const u=Ol(e,c,t,s);return u===null?{[e==="desktop"?t:P(e,t)]:s}:Object.keys(u).length?u:null})}}function Tl({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:a}=Ht(o,"sectionHeightValue",t),s=(r?r.unit:n)==="%"?"%":"px",c=s==="%"?Xo:$o;return l("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:s,ariaLabel:Y,onChange:a})})}function El({props:e,draw:t,view:n}){const{followed:o,write:r}=Ht(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Il({view:e,onClear:t}){const n=L(),o=se(e,n)===null,r=e==="phone"&&xe(n),a=vt(e,n),s=D(c=>i(c),a.mode==="auto"?i("Auto"):`${a.value}${a.unit}`,r?"tablet":"desktop");return l(w,{words:y()?.panel,label:i(Y),changed:o,detail:s,onReset:t})}function ca(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>l(Al,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>l(kl,{value:o,onChange:r,view:n})});return{_gStick:O(Se),...X("stickTop",e),...X("stickTopDistance",t)}}function kl({value:e,onChange:t,view:n}){const o=M(),r=L(),a=n==="desktop"||Ae(n,r)?null:Gt(n,ut(r)),s=a&&o?c=>o.onChangeMany(u=>{const f=Fl(n,u,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return l("div",{className:"sf-field",children:ee({min:ne.min,max:ne.max,step:ne.step,value:a?null:typeof e=="number"?e:ne.fallback,...a?{placeholder:a.distance}:{},suffix:"px",ariaLabel:i("Distance from top"),onChange:s})})}function Ae(e,t){return e==="tablet"?Ko(t):Uo(t)}function Gt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Fl(e,t,n){return e==="desktop"||Ae(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Al({value:e,onChange:t,labelId:n,view:o}){const r=L(),a=ut(r),s=o==="phone"?a.phone:o==="tablet"?a.tablet:e===!0,c=o==="phone"&&a.ownTablet,u=o==="desktop"?null:Gt(o,a),f=u?.on?`${u.distance}px`:i("Off");return l(x,{label:i(Se),labelId:n,icon:q(l(kn,{})),action:N(k,{children:[o!=="desktop"?l(w,{words:y()?.panel,label:i(Se),changed:Ae(o,r),detail:D(m=>i(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,l(he,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const Mt="e.g. about";function ua(){return{_gAnchor:O("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Mt},{type:"custom",render:({value:e,onChange:t})=>l(cn,{value:e,onChange:t,nameBox:(n,o)=>l(H,{value:n,onChange:o,label:"Name",placeholder:Mt,hideable:!1,markup:!1})})})}}function da(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return l(x,{label:i(e),icon:t,htmlFor:c,hint:n===void 0?void 0:i(n),children:l(so,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:f=>r(f?f.toISOString():"")})})}}}function pa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return l(x,{label:i(e),icon:t,htmlFor:c,hint:n===void 0?void 0:i(n),children:l(io,{id:c,value:jt(typeof o=="string"?o:null),onChange:u=>r(u?Xt(u):"")})})}}}function Ll(e,t,n,o){return{type:"custom",...I({},{...Q,label:e}),render:r=>{const{value:a,onChange:s,id:c,name:u}=r,f="follows"in r,m=r,p=typeof a=="boolean",d=typeof m.follows=="boolean"?m.follows:t,g=p?a:f?d:t,h=`${c??u??e}-label`,C=m.readOnly===!0,S=l(he,{checked:g,onChange:s,disabled:C,ariaLabelledBy:h});return l(x,{label:i(e),labelId:h,icon:n,hint:o===void 0?void 0:i(o),action:f?N(k,{children:[l(w,{words:y()?.panel,label:i(e),changed:p,detail:m.followsNoView?i(d?"On":"Off"):D(b=>i(b),i(d?"On":"Off"),m.followsView),disabled:C,onReset:()=>s(void 0)}),S]}):S})}}}function fa(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return l(it,{label:i("Background"),icon:l(In,{}),id:r,value:Pn(e),onChange:t})}}}function ha(e,t){return{type:"custom",...I({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return l(x,{label:i(e),htmlFor:s,className:"sf-checkbox",action:l(oo,{id:s,checked:a,onChange:o})})}}}function ma(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>l(it,{label:i(e),icon:n,value:o||t,onChange:r})}}function ga(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return l(Nl,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Nl({value:e,onChange:t,twin:n}){const{hex:o,n:r}=Bl(),a=v(o.toUpperCase(),i("Theme {n} background",{n:r}));if(n){const s=Bn(n.follows);return l(ge,{label:i("Fill"),icon:l(fe,{}),value:e,inherited:s??o,resetTo:D(c=>i(c),s?s.toUpperCase():a,n.view),onChange:t,onReset:()=>t(void 0)})}return l(ge,{label:i("Fill"),icon:l(fe,{}),value:e,inherited:o,resetTo:a,onChange:t,onReset:()=>t("")})}function Pl(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return oe(n);const r=Hn(e,t);if(r.length===0)return null;const a=oe(_t(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=oe(_t(r[s].sectionAccent));if(c!==null)return c}return oe(r[0].sectionAccent)}function Bl(){const{colors:e,n:t}=Wt();return{hex:e.background,n:t}}function Wt(){const e=xt(B().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=ce(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?Pl(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:er(e.themes[o]),n:o+1}}const Dl=[{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 vl({label:e,value:t,onChange:n,points:o=Dl}){const r=o.map(a=>({...a,label:i(a.label),...a.title?{title:i(a.title)}:null}));return l(no,{label:i(e),value:t,points:r,onChange:n})}function ba(){return Ft()}const xa={top:l(wn,{}),right:l(yn,{}),bottom:l(xn,{}),left:l(Sn,{})};function Sa(e,t,n,o,r,a,s){const c=p=>t.find(d=>d.value===p),u=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const d=t.find(h=>h.cell===p);if(!d)return u(`missing-${p}`);const g=a?.[p];return g?{value:d.value,label:d.label,icon:g}:{value:d.value,label:d.label}},m=[u("corner-top-left"),f("top"),u("corner-top-right"),f("left"),u("centre"),f("right"),u("corner-bottom-left"),f("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:d})=>{const g=t.some(h=>h.value===p)?p:n;return l(x,{label:i(e),icon:r,value:c(g)?.label?i(c(g).label):s?i(s):"",children:vl({label:e,value:g,onChange:d,points:m})})}}}function ya(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>l(Fo,{label:e,options:(a.options??t).map(s=>({...s,label:i(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:i(n)}:{}})}}function wa(e,t,n,o){return{type:"custom",options:t,fallback:n,...I({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>l(Lo,{label:e,options:(s.options??t).map(c=>({...c,label:i(c.label)})),fallback:s.fallback??n,value:r,onChange:a,placeholder:o===void 0?void 0:i(o)})}}function Ca(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return l(e,{...r})}}}const _a=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ra(e,t,n){const o=Object.keys(De).map(r=>({label:De[r],value:r,picture:n[r]}));return{type:"custom",...I({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>l(Hl,{label:e,icon:t,options:o,onChange:r})}}function Hl({label:e,icon:t,options:n,onChange:o}){const r=M()?.values??{},a=Vt(r),s=zt(r);return l(x,{label:i(e),icon:q(t),hint:s==="frame-missing-image"?i("This video has no frame yet. The slide shows its image until one is made."):s==="frame-missing-surface"?i("This video has no frame yet. The slide shows its background colour until one is made."):s==="image-missing-frame"?i("No image yet. The slide shows the video's frame until you choose one."):s==="image-missing-surface"?i("No image yet. The slide shows its background colour until you choose one."):void 0,children:Ie({options:n,value:a,onChange:o,ariaLabel:e})})}function Oa(e,t,n,o={}){const r={type:"custom",[Me]:!0,render:({value:a,onChange:s,name:c})=>l(ko,{value:a||"",onChange:s,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Ta={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Gl(e){const t=i(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ea({value:e,onChange:t,label:n}){const o=e||{},r=M(),a=r?r.values!==r.node.props:!0,s=!!o.pending&&a,c=!!o.pending&&!a,u=!!Tr(Or()).geocode,f=Be(),m=(p,d)=>t({...o,[p]:d??void 0});return N(k,{children:[l(x,{label:i(n),icon:l(Ve,{}),action:u?l(me,{content:i("Find from the address (OpenStreetMap)"),children:l(rt,{"aria-label":i("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:l(Fn,{})})}):void 0,children:u&&o.status?l(un,{compact:!0,oneLine:!0,spaced:!1,status:s?"busy":o.ok&&!c?"found":"notfound",statusText:s?i("Finding…"):c?i(mo):i(o.status),hint:Gl(o)}):null}),l(x,{label:i("Enter by hand"),labelId:f,icon:l(Cn,{}),action:l(he,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&l(x,{label:i("Latitude, longitude"),icon:l(Ve,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[l(lt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:i("Latitude")}),l(lt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:i("Longitude")})]})})]})}function Ml(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Wl(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,a)=>a===t?{text:n}:r)}function Ia(e,t){return e===null?null:t>e?e:null}function Ul(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 ka={label:"Ticker items",icon:l(En,{})};function Fa(e,t,n,o){return{type:"custom",[T]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...I({},{...Tt.textList,label:e}),render:({value:r,onChange:a})=>l(Kl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Kl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=V(null),[c,u]=z(null),f=p=>p.map(d=>({text:d?.text??""})),m=p=>{const d=Ul(n,p,c);d===null&&(s.current=null),u(d),r(f(p))};return l(zn,{label:i(e),icon:t,noun:i("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?l(st,{target:s,value:Ml(n,c),onChange:p=>r(Wl(n,c??-1,p)),disabled:c===null,label:c===null?i("Formatting — click a row first"):i("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,d,g)=>l("input",{type:"text",className:a&&c===d?"sf-list-marking":void 0,value:p?.text??"",placeholder:i(o),"aria-label":i("{label} {n}",{label:i(e),n:d+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{s.current=h.currentTarget,u(d)}})})}function Aa(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>l(H,{value:o,onChange:r,label:i("{label} — row {n}",{label:i(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function La(e){return{_gCards:O("Cards"),coverIndex:Z("Cover image",l(Tn,{}),To,String(Eo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:qr("Image background",sr),cardImage:jl()}}function Na(){return{outline:Z("Card outline",l(An,{}),_o,Oo),indexBadge:Z("Card number",l(je,{}),Co,Ro),showBadge:Ll("Product badge",!0,l(Ze,{noun:"tag"}))}}function Pa(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ae.find(a=>a.id===r).label}),o=r=>I(go(Le),n(r));return{_gShowOnCard:O("Show on a card"),[Le]:I({type:"custom",render:()=>l($l,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Le)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Le="showCardPrice",ae=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function $l({rest:e}){const t=L(),n=Jr(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=ae.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return l(Ne,{parts:ae,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(ae.map(({id:s})=>[s,void 0])))})}function Ba(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>l(Ne,{parts:e,changed:qn(o),shown:a=>Jn(o,a),onPress:(a,s)=>r(eo(o,a,s)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>l(Xl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ne({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a,disabledReason:s}){const c=i("Display");return l(x,{label:c,icon:l(pn,{}),changed:t,action:l(w,{words:y()?.panel,label:c,changed:t,detail:a,onReset:r}),children:l(Yn,{label:c,items:e.map(u=>({id:u.id,label:i(u.label),shown:n(u.id),...s?{disabled:!0,disabledReason:i(s)}:{}})),onChange:o})})}function Xl({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return l(Ne,{parts:e,changed:Qn(n),shown:a=>Zn(r,n,a),onPress:(a,s)=>o(to(n,a,s)),onReset:()=>o(yo),detail:i("the same as Desktop")})}function jl(){return kt("Card image",{min:W,max:Ke,step:Zt,hint:"Rounds the picture. The card's own corner is in Styles."})}function Da(){return Fe({sidesKey:"cornerSides",step:Qt,useFollowed:()=>W,mark:l(Vl,{label:en}),hint:i("Rounds the picture. Left alone it stays square.")})}function Vl({label:e,changed:t=!1,onReset:n=()=>{}}){return l(w,{words:y()?.panel,label:i(e),changed:t,onReset:n})}function va(){return{type:"custom",render:({value:e,onChange:t})=>l(Jl,{value:typeof e=="string"?e:"",onChange:t})}}function zl({layout:e,width:t}){return l("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:rn(e).map(([n,o],r)=>l("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const Yl={width:"3.5rem",height:"2.5rem"},ql=200;function Jl({value:e,onChange:t}){const[n,o]=z(null),[r,a]=z(4),s=V(null);$t(()=>{const d=s.current;if(!d||typeof ResizeObserver!="function")return;const g=()=>a(d.getBoundingClientRect().width>=ql?4:3);g();const h=new ResizeObserver(g);return h.observe(d),()=>h.disconnect()},[]);const c=e&&e in te?e:"",u=$e(n,c),f=$e(n,"").length,m=ln("no-symbol"),p=[{value:"",label:i("Not chosen"),icon:Ar(m,i("Not chosen"))},...u.map(d=>({value:d,label:i(te[d].label),icon:l(zl,{layout:te[d],width:40})}))];return l(x,{label:i("Layout"),icon:l(Rn,{}),value:c?i(te[c].label):void 0,children:l("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:l(tt,{label:i("Layout"),value:c,options:p,onChange:t,columns:r,cell:Yl,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[l("span",{className:"text-2xs text-ink-faint",children:i("Photos in a row")}),l(Kn,{options:[{id:"all",label:i("All")},...nn.map(d=>({id:String(d),label:String(d)}))],value:n===null?"all":String(n),ariaLabel:i("Photos in a row"),onChange:d=>o(d==="all"?null:Number(d))}),l("span",{className:"text-2xs text-ink-faint",children:i("{n} of {total} layouts",{n:f,total:on.length})})]})})})})}export{Ur as BOUND_TO_POST,ks as BOUND_TO_POST_NOTE,vs as BUCKET_ICONS,Ta as CUSTOM_FIELD_MEDIA,Ea as CoordsField,Rt as DESKTOP_GAP_NOT_OVERLAP,Ne as DisplayRow,xa as EDGE_ARROWS,ao as FOCAL_DEFAULT,Dl as FOCAL_POINTS,ue as FOLD_FIELD_MARKER,vl as FocalPicker,Xs as GroupLabel,Kr as HIGHLIGHT_HINT,H as HidableTextField,Ge as LINK_FIELD_MARKER,xs as Label,Me as MEDIA_FIELD_MARKER,_a as MEDIA_TYPE_OPTIONS,Fs as NOT_BOUND_TO_POST,$s as PanelBand,jr as PanelNoteLine,bl as RowPropsContext,We as SCAFFOLD_FIELD_MARKER,Wa as SCALAR_TEXT_CONTROLS,Pr as SiteGapDefaultReset,ee as Slider,zr as Swatches,Ma as TEXT_CONTROL_KINDS,T as TEXT_FIELD_MARKER,ka as TICKER_ITEMS_ROW,Kl as TextListField,ie as WIDTH_LABEL,Mr as WidthDefaultReset,Ul as aimAfterListChange,ua as anchorFields,v as backTo,js as backgroundField,Qs as boxBlockSpacingField,na as boxColumnsFields,ga as boxFillField,gl as boxPhoneRowField,fl as boxShareField,ea as boxSharePhoneField,ta as boxShareTabletField,Pl as boxThemeIndexOf,Ms as bucketHeader,qs as buttonWordsEntryField,dl as cardCornersField,qr as cardImageBackgroundField,jl as cardImageField,La as cardMediaFields,Zs as cardShapeFields,Pa as cardShowFields,Na as cardStyleFields,ra as cellWidthFields,ha as checkbox,ma as colorInput,ys as containerDirectionField,Br as containerGapField,Dr as containerGapPhoneField,Ss as containerGapRows,vr as containerGapTabletField,Gl as coordsResultTip,Ps as copyText,At as cornerSidesField,Fe as cornersRowField,pa as date,da as dateTime,Ws as designGroupHeader,Ba as displayFields,Sa as edgePad,Ia as focusAfterRemove,ba as focusKeptField,Us as foldMarker,de as foldMetaOf,Vr as foldTitleOf,Ol as followedHeightPatch,Fl as followedStickPatch,va as galleryLayoutField,aa as heightFields,se as heightFollowedBy,ws as heroGroupPlacementPoints,He as hidableText,Xr as hintIsWhileTyping,Da as imageCornersField,Is as inOwnBox,Gs as isBucketHeader,Ft as keptBy,Bs as linkField,Ra as loadingShowsField,ya as multiSelect,fa as pageBackgroundField,Hs as panelNote,yl as phoneOverrideField,Ns as plainText,Ds as plainTextarea,kt as pxField,Ks as quietMarker,ve as readHidable,Ml as rowText,wa as searchSelect,Ys as sectionBorderField,tl as sectionCornersField,zs as sectionShapeFields,Vs as sectionThemeFields,Wl as setRowText,oa as sizeField,Ca as sourceField,la as spacingFields,ca as stickFields,ia as swapPadding,Js as templateField,As as text,Yt as textFieldIdentifier,Rs as textFieldOffPage,Ts as textFieldPanelOnly,Fa as textList,Aa as textListRowField,Ls as textarea,Ll as toggle,Oa as upload,Jr as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Nr as useSiteGapDetail,sa as widthField,Es as withIdentifier,_s as withOffPage,Os as withPanelOnly,Cs as withScaffold};
|
|
1
|
+
"use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Pe,createContext as Kt,useContext as ve,useEffect as $t,useId as Be,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as Xt,fromDateKey as jt}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as De,firstFrameHint as Vt,loadingShowsOf as zt,loadingStillHint as Yt}from"../../../format/lib/hero-video.js";import{pageFramesFor as qt,usePageVideoFrames as Jt}from"../page-video-frames.js";import{ScreenDocumentContext as Zt}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as He,hidableText as Ge}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as de,LINK_FIELD_MARKER as Me,MEDIA_FIELD_MARKER as Ue,SCAFFOLD_FIELD_MARKER as We,TEXT_FIELD_MARKER as T,foldMetaOf as ue,textFieldIdentifier as Qt}from"efficient-easel/draw";import en from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Ke}from"../../../render/lib/document/show-when.js";import tn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as nn,CORNER_RADIUS_MAX as $e,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as on,IMAGE_CORNERS_LABEL as rn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as ln}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as sn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as an,galleryChoices as Xe,galleryPictureCells as cn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as dn}from"./shell-glyph.js";import{anchorSiblingsOf as un,placementPoints as pn}from"../../../format/lib/hero-group-placement.js";import fn from"../../components/AnchorField.js";import hn from"../../components/SourceStatus.js";import{AdjustIcon as mn,EyeIcon as gn,AnimationIcon as bn,BackgroundIcon as wn,BorderAllIcon as xn,BlockSectionIcon as Sn,ColumnWidthsIcon as pe,ColumnsIcon as je,CornerIcon as yn,DirectionDownIcon as Cn,DirectionLeftIcon as _n,DirectionRightIcon as Rn,DirectionUpIcon as On,EditIcon as Tn,GapIcon as In,GridIcon as En,GroundIcon as fe,HashIcon as Ve,HeightIcon as kn,ImageIcon as Fn,ListIcon as An,LocationIcon as ze,PaddingBottomIcon as Ye,PaddingLeftIcon as qe,PaddingRightIcon as Je,PaddingTopIcon as Ze,PageIcon as Ln,StickyIcon as Nn,SearchIcon as Pn,SquareIcon as vn,TypeIcon as Bn,WidthIcon as Dn}from"efficient-easel/icons";import{FieldGlyph as Qe}from"../../components/FieldGlyph.js";import{resolvePageBackground as Hn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Gn}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as et,CORNER_SIDE_POINTS as Mn,hasOwnSectionCorners as Un,normalizeCornerSides as tt}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Wn,enclosingSection as Kn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as $n,SettingsField as w,SettingsGroup as Xn,SettingsGroupSub as jn,SettingsSegmented as Vn,SettingsBorder as zn,SettingsSidesEach as Yn,SettingsSwitch as he,borderSides as qn,borderStartEach as Jn}from"efficient-easel/panel";import{ListField as Zn}from"efficient-easel/fields";import{DisplayChips as Qn}from"efficient-shell/ui";import{desktopDisplayChanged as eo,partShownOnDesktop as to,partShownOnPhone as no,phoneDisplayChanged as oo,withDesktopPart as ro,withPhonePart as io}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as lo,Checkbox as so,ColorSwatch as ao,CornersInput as co,DatePicker as uo,DateTimePicker as po,FOCAL_DEFAULT as fo,IconPicker as nt,COLUMN_COUNT_MAX as ot,COLUMN_SHARE_MIN as ho,COLUMN_SHARES_EQUAL as mo,resolveColumnShares as rt,WidthsBar as go,useShellStrings as bo,IconButton as it,InputNumber as lt,Slider as wo,Tooltip as me}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as xo}from"./geocode-resolve.js";import{ColourRow as st,InheritedColourRow as ge}from"./ColourControl.js";import{keptByRow as So}from"efficient-easel/screen/lib/document/style-fields";import at from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as yo,NoControlMark as Co,noControlField as ct}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as _o}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Ro,resolvePhoneValue as be}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as Oo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as To,CARD_OUTLINE_OPTIONS as Io,DEFAULT_CARD_INDEX_FORMAT as Eo,DEFAULT_CARD_OUTLINE as ko}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Fo,DEFAULT_COVER_INDEX as Ao}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Lo}from"efficient-easel/draw";import No from"../../components/MediaUploadField.js";import Po from"../../components/MultiSelectField.js";import vo from"../../components/SectionThemePicker.js";import Bo from"../../components/SearchSelectField.js";import Do from"../../components/StorefrontLinkField.js";import{UiIcon as dt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Ho}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Go}from"efficient-easel/draw/client";import{encodePartId as Mo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Uo,useEaselStrings as Wo}from"efficient-easel/strings";import{hasPhoneHeight as Ko,hasTabletHeight as we,resolveSectionMinHeight as $o,resolveTabletHeight as Xo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as oe,SECTION_STICK_LABEL as xe,hasPhoneStick as jo,hasTabletStick as Vo,resolveSectionStick as ut}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as zo,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as Yo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as qo,resolveContainerDirection as pt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Jo,BOX_BLOCK_SPACING_POINTS as ft,BOX_PHONE_ROW_LABEL as ht,BOX_COLUMNS_MAX as Zo,BOX_COLUMNS_MIN as mt,BOX_PHONE_ROW_MAX as Qo,BOX_PHONE_ROW_MIN as Se,BOX_SHARE_CHOICES as gt,BOX_SHARE_LABEL as K,boxShareChoiceOf as bt,boxShareWidthsOf as ye,BOX_SHARE_PHONE_DEFAULT as er,BOX_SHARE_PHONE_POINTS as tr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as nr,borderBySide as wt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as or,normalizeTheme as xt,normalizeThemeColors as rr,sectionBandTone as ir,surfaceTwoTone as lr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as St,CONTAINER_GAP_BUILT_IN as sr,CONTAINER_GAP_PHONE as Ce,GAP_FIELD_CONTAINER as _e,followsSitePhoneGap as ar,hasOwnContainerGap as cr,hasOwnPhoneGap as Re,resolveContainerGap as yt,resolvePhoneContainerGap as Ct}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as dr,CARD_IMAGE_BG_OFF as ur,CARD_IMAGE_BG_SWATCH_NAMES as pr,CARD_IMAGE_BG_SWATCHES as fr,isCardImageBackgroundInheriting as hr,cardImageBackgroundChoice as mr,THEME_CARD_IMAGE_BG as gr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as br,SECTION_BG_NO_FILL as wr,sectionBackgroundChoice as xr,THEME_SECTION_BG as Oe,isSectionBackgroundEmpty as Sr,sectionBackgroundHex as _t}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as yr,nestedAccentValue as Rt,resolveSectionAccent as re}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Cr,TYPE_SIZE_INHERIT as _r,isTypeSizeInheriting as Rr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Or,WIDTH_CHOICE_LABEL as Tr,WIDTH_INHERIT as Ir}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Er}from"./panel-heading-scope.js";import{useEaselSession as kr}from"efficient-easel/screen/lib/session-context";import{backendOf as Fr}from"../website-session.js";import{BOX_GAP as Ar,describedAs as E,group as O,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Te,onDesktopWords as B,phoneTwinFields as ie}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Lr,gapField as Ie,iconPickerRow as Nr,pickerCellIcon as Pr,pickerNoneIcon as vr,Segmented as Ee,segmented as Br,select as Z,slider as $}from"./box-fields.js";function Os({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Dr(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Hr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:Dr(),onReset:t})}function Gr(e){return Ie({...Ar,builtIn:sr[e],resolve:(t,n)=>yt(e,t,n?.siteGap),action:(t,n)=>i(Hr,{inherited:!cr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[_e]:e}})}function Mr(e){return Ke(R("mobile",{[_e]:e,type:"custom",render:t=>i(Kr,{container:e,...t})}),Ot)}function Ur(e){return Ke(R("tablet",{[_e]:e,type:"custom",render:t=>i(Wr,{container:e,...t})}),Ot)}const Ot={not:{field:"gap",in:Array.from({length:-St.min},(e,t)=>St.min+t)}};function Ts(e){return{gap:R("desktop",Gr(e)),[W("gap")]:Ur(e),[F("gap")]:Mr(e)}}function Wr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Ce.min,yt(e,n,o));return Ie({...Ce,builtIn:r,resolve:a=>Re(a)?a:r,action:(a,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Re(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Kr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=Ct(e,void 0,n,o,r);return Ie({...Ce,builtIn:s,resolve:c=>Ct(e,c,n,o,r),action:(c,d)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Re(c),detail:D(`${s}px`,ar(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Is(e){return Lr({offered:qo(e),fallback:pt(e,void 0),resolve:t=>pt(e,t)})}function Es(e,t){return pn(t?un(e,t):[],t)}function $r({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=He(e),h=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),m=a&&f,C=Be(),x=r?Yr(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(w,{label:l(n),icon:i(Bn,{}),htmlFor:C,className:m?"is-hidden":void 0,hint:x,action:a?i(me,{content:b,children:i(it,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(dt,{name:"eye-off",size:14}):i(dt,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(at,{target:s?p:h,value:d,onChange:u}),s?i("textarea",{id:C,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:C,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function ks(e,t){return{...e,[We]:t}}function Fs(e){const t=e[T];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[T]:{...t,offPage:!0}}}function As(e){return!e||typeof e!="object"?!1:e[T]?.offPage===!0}const Tt="sfPanelOnly";function Ls(e){if(!e[T])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Tt]:!0}}function Ns(e){return!!e&&typeof e=="object"&&e[Tt]===!0}function Ps(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 Va,SCALAR_TEXT_CONTROLS as za}from"efficient-easel/draw";function vs(e,t){if(!e[T])throw new Error("inOwnBox: the field holds no authored text");const{[yo]:o,...r}=e;return{...r,[_o]:!0,render:t}}const Xr=new Set(Lo),Q={type:"radio",options:[{value:!0},{value:!1}]},It={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[T]:e},{...It[e.control],label:e.label});if(!Xr.has(e.control))return n;const o=t.render;return{...ct(n,"authored-copy"),render:r=>i(Oo,{name:r.name,children:o(r)})}},Bs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",jr={field:"source.slug",set:!0},Ds={not:jr},Vr="Select a word, then press the highlighter.",zr=new Set([Vr]),Yr=e=>zr.has(e);function Hs(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Gs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ms(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Us(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Ws(e){return{type:"custom",[Me]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Do,{value:Ge(t),onChange:n,label:e})}}function Ks(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const $s={Design:mn,Animation:bn};function Xs(e){return{type:"custom",render:()=>i(qr,{text:e})}}function qr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function js(e){return ue(e)!==null&&e?.tabs!==void 0}const Et=new Map;function Vs(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Et.get(n)??{type:"custom",tabs:t,[de]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Et.set(n,o),o}const kt=new Map;function zs(e){const t=kt.get(e)??{type:"custom",[de]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return kt.set(e,t),t}function Jr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ys(e,t){return Jr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function qs(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function Js({title:e,children:t}){const[n,o]=z(()=>!ke.has(e));return i(Xn,{title:e,open:n,onToggle:r=>{o(r),r?ke.delete(e):ke.add(e)},children:t})}const ke=new Set;function Zs({label:e}){return i(jn,{title:l(e),level:Er(2)})}function Zr({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(me,{content:d,children:i(ao,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function Qs(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Qr,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Qr({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Wt(),d={background:a.background,surface:a.surface,surface2:lr(a),band:ir(a)},f=n?Oe:t,h=Sr(s,t,f),p=_t(void 0,f,d),u=n?br:void 0,g=xr(s,t),m=f===Oe?l("the theme's section background"):l("Theme {n} background",{n:c});return i(ge,{label:l(e),icon:i(wn,{}),value:h?"":_t(s,t,d),inherited:p,resetTo:D(p.toUpperCase(),m),onChange:r,onReset:()=>r(u),choices:[{label:l("No fill"),color:"",selected:g==="none",onPick:()=>r(wr)},{label:`${l("Section band")} · ${d.band.toUpperCase()}`,color:d.band,selected:g==="band",onPick:()=>r(Oe)}]})}function ei(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=hr(r,t);return i(w,{label:l(e),icon:i(fe,{}),changed:!s,action:i(y,{words:S()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(dr)}),children:Zr({swatches:fr,current:s?gr:mr(r,t),onPick:o,names:pr})})}}}function ea(e=n=>n,t){return J({_gSectionTheme:O(yr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(vo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:h,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(wo,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:m=>{m===null?u?.():m!==o&&r(m)}})})}function Ft(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,m=g===null;return i(w,{label:l(e),icon:f?q(f):void 0,value:m?d||s===void 0?void 0:l(s):`${g}${h}`,changed:!m,action:d?Pe(d,{changed:!m,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:l(e),changed:!m,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const le="Corners";function Fe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(w,{label:l(le),icon:i(yn,{}),changed:r,action:Pe(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(ni,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function At(){return ct({type:"custom",render:()=>i(Co,{})},"always")}function ti(){const e=M();return t=>e?.onChangeMany(t)}function ni({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=tt(r)??[...et];return i(co,{label:l(le),value:a,corners:Mn,onChange:c=>{const d=tt(c)??[];s(d.length===et.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:$e,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Lt(){return At()}function oi({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(y,{words:S()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ri(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function ii(){return Fe({sidesKey:"sectionCornerSides",useFollowed:ri,mark:i(oi,{label:le}),hint:li})}const li="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function ta(){return J({_gShape:O("Shape"),sectionCorners:ii(),sectionCornerSides:Lt(),...X("sectionBorder",Nt)})}const si=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function ai(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ci(){let e;try{const t=xt(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||or.line}function di({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?Jn(c,a):!1),h=si(),p=u=>ai(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(w,{label:l("Border"),icon:i(xn,{}),action:r?i(Yn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(zn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:h,styles:s,max:nr})})}function ui({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=ci(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...wt(a(o)),...wt(a(r))}:n==="tablet"?a(o):{};return i(di,{value:e,onChange:t,placeholder:{sides:qn(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function na(e){return R(e,Nt(e==="mobile"?"phone":e))}function Nt(e){return{type:"custom",render:({value:t,onChange:n})=>i(ui,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>ie(e,t(o),Te)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function oa(e){return{type:"custom",render:()=>i(pi,{partKey:e})}}function pi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=Wo();let s=null;try{s=Go().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i($n,{name:l("Text"),preview:Ho(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Uo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(Mo(t,e))}})}function Pt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Kn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Un(r)?r:n}function fi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Pt(U);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function hi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function mi(){return Fe({sidesKey:"cardCornerSides",useFollowed:()=>Pt(U),mark:i(fi,{label:le}),hint:i(hi,{})})}function gi(){return{type:"custom",render:()=>i(en,{})}}function ra(e){return{...e,render:t=>i(tn,{render:e.render,props:t})}}function ia(){return{_gShape:O("Shape"),cardCorners:mi(),cardCornerSides:Lt(),cardCornersApplyAll:gi()}}function bi(){return E({type:"custom",render:e=>i(xi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function wi(e,t){const n=bt(e);if(n!=="custom")return l(gt.find(r=>r.value===n)?.label??"");const o=rt(ye(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function xi(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=bt(c),f=r>=2&&r<=ot,h=()=>[...mo[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?h():b)},m=l("The width bar works for 2 to {count} blocks.",{count:ot}),C=a&&(s||t!=="content"),x=bo().widths.hint(r,ho);return i(w,{label:l(K),icon:i(pe,{}),changed:C,hint:d!=="custom"?void 0:f?x:m,action:i(y,{words:S()?.panel,label:l(K),changed:C,disabled:e.readOnly===!0,detail:s?B(b=>l(b),wi(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(nt,{label:l(K),value:d,options:gt.map(b=>({value:b.value,label:b.value==="custom"&&!f?m:l(b.label),icon:Pr(i("span",{className:"sf-gallery-pic sf-share-pic",children:vt(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?m:l(b.label))})),onChange:g,columns:3,cell:Bt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:rt(ye(c,r),r)}},onBlur:()=>{p.current=null},children:i(go,{label:l(K),count:r,value:ye(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function vt(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 la(){return Z(Jo,i(In,{}),ft,ft[0].value)}function sa(){return R("mobile",Nr(K,i(pe,{}),tr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:vt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),er,{columns:2,cell:Bt}))}const Bt={width:"5.75rem",height:"3.25rem"};function aa(){return ie("share",bi(),Te)[W("share")]}function Si(){return R("mobile",$(ht,i(je,{}),Se,Qo,1,Se,"",{clear:{phoneFollows:!1,hint:Se}}))}const Dt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function ca(){const e=$(ht,i(je,{}),mt,Zo,1,mt,"",{clear:{emptyLabel:"Auto"}}),t=ie("columns",e,{...Dt,tablet:Te.tablet}),n=ie("columns",e,Dt,{phoneRow:Si()});return{...t,phoneRow:n.phoneRow}}function da(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(w,{label:l(e),icon:i(Qe,{noun:s}),action:i(y,{words:S()?.panel,label:l(e),changed:!Rr(a),detail:l("the Text style in Styles"),onReset:()=>c(_r),defaultAction:{onPress:()=>c(Cr),title:l("Keep this section's own built-in size"),icon:i(Sn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function ua(){return{_gCellWidth:O("Cell width"),gridSpan:Z("Positions",i(pe,{}),[{label:"Auto",value:""},...Array.from({length:ln},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=ve(yi),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const yi=Kt(null);function Ci({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=be(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:be(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function _i({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=be(void 0,a,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ri(e){return Ft(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(_i,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Ci,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Oi={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ti={Top:Ze,Bottom:Ye,Left:qe,Right:Je},Ii=e=>{const t=Ti[e];return i(t,{})};function pa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Oi[x],s=x=>$(r("Top"),i(Ze,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ri({label:r(x),icon:Ii(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,m=e.phone===!0,C=x=>m?R("desktop",x):x;return J({...o?{_gSpacing:O("Padding")}:{},[t]:C(s(c)),...m?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:C($(r("Bottom"),i(Ye,{}),I.min,I.max,I.step,d,"px")),...m?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:C($(r("Left"),i(qe,{}),p.min,p.max,p.step,u,"px")),...m?{[F(f)]:a("Left",f,g,p)}:{},[h]:C($(r("Right"),i(Je,{}),p.min,p.max,p.step,u,"px")),...m?{[F(h)]:a("Right",h,g,p)}:{}}:{}})}function fa(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&ue(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const se="Width";function ha(e,t=Or,n=!0){const o=t.map(r=>({label:Tr[r],value:r}));return J({...n?{_gWidth:O(se)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(w,{label:l(se),icon:i(Dn,{}),action:n?i($r,{inherited:s?.inherited??!1,onReset:()=>r(Ir),label:se}):void 0,children:Ee({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:se})})}})}function ma(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Ei,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Fi,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Br("Unit",i(Ve,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Ai,{props:a,draw:s,view:o})}};return J({_gHeight:O(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Li,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function Ei({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=ae(n,r)?.mode??"auto";return i(w,{label:Y,icon:q(i(kn,{})),action:o?o(t):void 0,children:Ee({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function Ht(e,t){return e==="phone"&&we(t)?Xo(t):$o(t)}function ae(e,t){return e==="desktop"||(e==="tablet"?we(t):Ko(t))?null:Ht(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function ki(e,t,n,o){const r=ae(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Gt(e,t,n){const o=M(),r=ae(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=ki(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Fi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Gt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?Yo:zo;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Ai({props:e,draw:t,view:n}){const{followed:o,write:r}=Gt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Li({view:e,onClear:t}){const n=L(),o=ae(e,n)===null,r=e==="phone"&&we(n),s=Ht(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(y,{words:S()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function ga(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(vi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Ni,{value:o,onChange:r,view:n})});return{_gStick:O(xe),...X("stickTop",e),...X("stickTopDistance",t)}}function Ni({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Ae(n,r)?null:Mt(n,ut(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Pi(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:oe.min,max:oe.max,step:oe.step,value:s?null:typeof e=="number"?e:oe.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Ae(e,t){return e==="tablet"?Vo(t):jo(t)}function Mt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Pi(e,t,n){return e==="desktop"||Ae(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function vi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=ut(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:Mt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(w,{label:l(xe),labelId:n,icon:q(i(Nn,{})),action:N(k,{children:[o!=="desktop"?i(y,{words:S()?.panel,label:l(xe),changed:Ae(o,r),detail:B(h=>l(h),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(he,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Ut="e.g. about";function ba(){return{_gAnchor:O("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Ut},{type:"custom",render:({value:e,onChange:t})=>i(fn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Ut,hideable:!1,markup:!1})})})}}function wa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(po,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function xa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(uo,{id:c,value:jt(typeof o=="string"?o:null),onChange:d=>r(d?Xt(d):"")})})}}}function Bi(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,h=r,p=typeof s=="boolean",u=typeof h.follows=="boolean"?h.follows:t,g=p?s:f?u:t,m=`${c??d??e}-label`,C=h.readOnly===!0,x=i(he,{checked:g,onChange:a,disabled:C,ariaLabelledBy:m});return i(w,{label:l(e),labelId:m,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(y,{words:S()?.panel,label:l(e),changed:p,detail:h.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),h.followsView),disabled:C,onReset:()=>a(void 0)}),x]}):x})}}}function Sa(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(st,{label:l("Background"),icon:i(Ln,{}),id:r,value:Hn(e),onChange:t})}}}function ya(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(w,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(so,{id:a,checked:s,onChange:o})})}}}function Ca(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(st,{label:l(e),icon:n,value:o||t,onChange:r})}}function _a(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Di,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Di({value:e,onChange:t,twin:n}){const{hex:o,n:r}=Gi(),s=D(o.toUpperCase(),l("Theme {n} background",{n:r}));if(n){const a=Gn(n.follows);return i(ge,{label:l("Fill"),icon:i(fe,{}),value:e,inherited:a??o,resetTo:B(c=>l(c),a?a.toUpperCase():s,n.view),onChange:t,onReset:()=>t(void 0)})}return i(ge,{label:l("Fill"),icon:i(fe,{}),value:e,inherited:o,resetTo:s,onChange:t,onReset:()=>t("")})}function Hi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return re(n);const r=Wn(e,t);if(r.length===0)return null;const s=re(Rt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=re(Rt(r[a].sectionAccent));if(c!==null)return c}return re(r[0].sectionAccent)}function Gi(){const{colors:e,n:t}=Wt();return{hex:e.background,n:t}}function Wt(){const e=xt(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Hi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:rr(e.themes[o]),n:o+1}}const Mi=[{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 Ui({label:e,value:t,onChange:n,points:o=Mi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(lo,{label:l(e),value:t,points:r,onChange:n})}function Ra(){return At()}const Oa={top:i(On,{}),right:i(Rn,{}),bottom:i(Cn,{}),left:i(_n,{})};function Ta(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(m=>m.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},h=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(m=>m.value===p)?p:n;return i(w,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:Ui({label:e,value:g,onChange:u,points:h})})}}}function Ia(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Po,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Ea(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Bo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function ka(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Fa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Aa(e,t,n){const o=Object.keys(De).map(r=>({label:De[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Ki,{label:e,icon:t,options:o,onChange:r})}}function Wi(e,t,n){const o=Vt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Yt(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function Ki({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=zt(s),c=ve(Zt),d=Jt(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const h=qt(r?.id,f,d);return i(w,{label:l(e),icon:q(t),hint:Wi(s,h,c?.hasUnsavedEdits??!1),children:Ee({options:n,value:a,onChange:o,ariaLabel:e})})}function La(e,t,n,o={}){const r={type:"custom",[Ue]:!0,render:({value:s,onChange:a,name:c})=>i(No,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Na={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function $i(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Pa({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Fr(kr()).geocode,f=Be(),h=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(w,{label:l(n),icon:i(ze,{}),action:d?i(me,{content:l("Find from the address (OpenStreetMap)"),children:i(it,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Pn,{})})}):void 0,children:d&&o.status?i(hn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(xo):l(o.status),hint:$i(o)}):null}),i(w,{label:l("Enter by hand"),labelId:f,icon:i(Tn,{}),action:i(he,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(w,{label:l("Latitude, longitude"),icon:i(ze,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(lt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(lt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Xi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function ji(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function va(e,t){return e===null?null:t>e?e:null}function Vi(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 Ba={label:"Ticker items",icon:i(An,{})};function Da(e,t,n,o){return{type:"custom",[T]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...It.textList,label:e}),render:({value:r,onChange:s})=>i(zi,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function zi({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),h=p=>{const u=Vi(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(Zn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(at,{target:a,value:Xi(n,c),onChange:p=>r(ji(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:m=>g({text:m.target.value}),onFocus:m=>{a.current=m.currentTarget,d(u)}})})}function Ha(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ga(e){return{_gCards:O("Cards"),coverIndex:Z("Cover image",i(Fn,{}),Fo,String(Ao),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ei("Image background",ur),cardImage:Ji()}}function Ma(){return{outline:Z("Card outline",i(vn,{}),Io,ko),indexBadge:Z("Card number",i(Ve,{}),To,Eo),showBadge:Bi("Product badge",!0,i(Qe,{noun:"tag"}))}}function Ua(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ce.find(s=>s.id===r).label}),o=r=>E(So(Le),n(r));return{_gShowOnCard:O("Show on a card"),[Le]:E({type:"custom",render:()=>i(Yi,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Le)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Le="showCardPrice",ce=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Yi({rest:e}){const t=L(),n=ti(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ce.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Ne,{parts:ce,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ce.map(({id:a})=>[a,void 0])))})}function Wa(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Ne,{parts:e,changed:eo(o),shown:s=>to(o,s),onPress:(s,a)=>r(ro(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(qi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ne({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(w,{label:c,icon:i(gn,{}),changed:t,action:i(y,{words:S()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(Qn,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function qi({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(Ne,{parts:e,changed:oo(n),shown:s=>no(r,n,s),onPress:(s,a)=>o(io(n,s,a)),onReset:()=>o(Ro),detail:l("the same as Desktop")})}function Ji(){return Ft("Card image",{min:U,max:$e,step:nn,hint:"Rounds the picture. The card's own corner is in Styles."})}function Ka(){return Fe({sidesKey:"cornerSides",step:on,useFollowed:()=>U,mark:i(Zi,{label:rn}),hint:l("Rounds the picture. Left alone it stays square.")})}function Zi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function $a(){return{type:"custom",render:({value:e,onChange:t})=>i(nl,{value:typeof e=="string"?e:"",onChange:t})}}function Qi({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:cn(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const el={width:"3.5rem",height:"2.5rem"},tl=200;function nl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);$t(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=tl?4:3);g();const m=new ResizeObserver(g);return m.observe(u),()=>m.disconnect()},[]);const c=e&&e in ne?e:"",d=Xe(n,c),f=Xe(n,"").length,h=dn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:vr(h,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(Qi,{layout:ne[u],width:40})}))];return i(w,{label:l("Layout"),icon:i(En,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(nt,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:el,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Vn,{options:[{id:"all",label:l("All")},...sn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:an.length})})]})})})})}export{jr as BOUND_TO_POST,Bs as BOUND_TO_POST_NOTE,$s as BUCKET_ICONS,Na as CUSTOM_FIELD_MEDIA,Pa as CoordsField,Ot as DESKTOP_GAP_NOT_OVERLAP,Ne as DisplayRow,Oa as EDGE_ARROWS,fo as FOCAL_DEFAULT,Mi as FOCAL_POINTS,de as FOLD_FIELD_MARKER,Ui as FocalPicker,Zs as GroupLabel,Vr as HIGHLIGHT_HINT,H as HidableTextField,Me as LINK_FIELD_MARKER,Os as Label,Ue as MEDIA_FIELD_MARKER,Fa as MEDIA_TYPE_OPTIONS,Ds as NOT_BOUND_TO_POST,Js as PanelBand,qr as PanelNoteLine,yi as RowPropsContext,We as SCAFFOLD_FIELD_MARKER,za as SCALAR_TEXT_CONTROLS,Hr as SiteGapDefaultReset,ee as Slider,Zr as Swatches,Va as TEXT_CONTROL_KINDS,T as TEXT_FIELD_MARKER,Ba as TICKER_ITEMS_ROW,zi as TextListField,se as WIDTH_LABEL,$r as WidthDefaultReset,Vi as aimAfterListChange,ba as anchorFields,D as backTo,Qs as backgroundField,la as boxBlockSpacingField,ca as boxColumnsFields,_a as boxFillField,Si as boxPhoneRowField,bi as boxShareField,sa as boxSharePhoneField,aa as boxShareTabletField,Hi as boxThemeIndexOf,Vs as bucketHeader,oa as buttonWordsEntryField,mi as cardCornersField,ei as cardImageBackgroundField,Ji as cardImageField,Ga as cardMediaFields,ia as cardShapeFields,Ua as cardShowFields,Ma as cardStyleFields,ua as cellWidthFields,ya as checkbox,Ca as colorInput,Is as containerDirectionField,Gr as containerGapField,Mr as containerGapPhoneField,Ts as containerGapRows,Ur as containerGapTabletField,$i as coordsResultTip,Us as copyText,Lt as cornerSidesField,Fe as cornersRowField,xa as date,wa as dateTime,zs as designGroupHeader,Wa as displayFields,Ta as edgePad,va as focusAfterRemove,Ra as focusKeptField,Ys as foldMarker,ue as foldMetaOf,Jr as foldTitleOf,ki as followedHeightPatch,Pi as followedStickPatch,$a as galleryLayoutField,ma as heightFields,ae as heightFollowedBy,Es as heroGroupPlacementPoints,Ge as hidableText,Yr as hintIsWhileTyping,Ka as imageCornersField,vs as inOwnBox,js as isBucketHeader,At as keptBy,Ws as linkField,Wi as loadingRowHint,Aa as loadingShowsField,Ia as multiSelect,Sa as pageBackgroundField,Xs as panelNote,Ri as phoneOverrideField,Ms as plainText,Ks as plainTextarea,Ft as pxField,qs as quietMarker,He as readHidable,Xi as rowText,Ea as searchSelect,na as sectionBorderField,ii as sectionCornersField,ta as sectionShapeFields,ea as sectionThemeFields,ji as setRowText,da as sizeField,ka as sourceField,pa as spacingFields,ga as stickFields,fa as swapPadding,ra as templateField,Hs as text,Qt as textFieldIdentifier,As as textFieldOffPage,Ns as textFieldPanelOnly,Da as textList,Ha as textListRowField,Gs as textarea,Bi as toggle,La as upload,ti as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Dr as useSiteGapDetail,ha as widthField,Ps as withIdentifier,Fs as withOffPage,Ls as withPanelOnly,ks as withScaffold};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content","Card list":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"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",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design"},H={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return H[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(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=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of G(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(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 ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.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=ae.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)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",H],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(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 j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(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{H as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
|
|
1
|
+
import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content","Card list":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"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",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Loop:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design"},H={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return H[a]??$[a]??I[o]}function pe(e,t,o){const a=_(e,t,o);return a?X(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=P(a),p=h(C?C.inner:a),l=p?I[p.label]:void 0;if(l)for(const g of G(l))t.includes(g)||t.push(g)}return t}const ge=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(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 ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let p=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.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=ae.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(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(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",H],["KEY_GROUP",$]]){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/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=p?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(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 j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(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{H as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,ge as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,pe as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as h,Fragment as x,jsxs as D}from"react/jsx-runtime";import{useContext as F,useEffect as k,useMemo as P,useRef as w}from"react";import{EaselCanvas as $,repeatCopyAt as M,useEasel as N}from"efficient-easel/easel";import _ from"../../components/PreviewThemeFrame.js";import{OpenDocumentChromeLoadNotice as W}from"../../components/PinnedChromeLoadNotice.js";import{SiteRestoreNotice as b}from"../../components/SiteRestoreNotice.js";import{decodePartId as j,REPEAT_ATTRIBUTE as S,REPEAT_INDEX_ATTRIBUTE as v}from"efficient-easel/draw";import{usePreviewParts as B}from"efficient-easel/draw/client";import{cssString as E,partElement as A,partTypingTarget as K,setCanvasTypingPart as I}from"./canvas-typing.js";import{usePartTypingDeps as O}from"../../components/usePartTypingDeps.js";import{copyRowTarget as V,copyRowValue as H,writeCopyText as L}from"./card-copy-rows.js";import{partColourName as U,partThemeColors as q,readInks as J}from"../../../format/lib/document/part-inks.js";import{PART_ATTR as C}from"../../../render/lib/document/text-parts.js";import{useBlockMetadata as X}from"../editor-block-metadata.js";import{usePreviewHeader as z,useSiteContentWidth as G}from"../../../render/components/PreviewHeaderContext.js";import{setEditorSiteContentWidth as R}from"../../../format/lib/document/editor-site-widths.js";import{siteWidthsMetadata as Q}from"../../../format/lib/content/section-width.js";import{useEditorCanvasStyles as Y}from"../editor-canvas-styles.js";import{usePageVideoFrames as Z,videoFramesMetadata as ee}from"../page-video-frames.js";import{ScreenDocumentContext as te}from"efficient-easel/screen/components/ScreenDocumentContext";function we(o){const{mirrorHostStyles:s}=Y(),p=X(),{sectionBackgroundWidth:a,themeFromDocument:d}=z(),e=G(),r=F(te),t=Z(r?.docId??null),f=N(c=>c.appState.data),l=ee(t,f),n=JSON.stringify(l),m=P(()=>l,[n]),u=P(()=>({...o.metadata??p??{},...Q(d?null:a,e),...m}),[o.metadata,p,a,e,d,m]);k(()=>(R(e),()=>R(null)),[e]);const i=w(null),g=re(i),{onDocument:y}=o,T=c=>{i.current=c,y?.(c)};return D(x,{children:[h(b,{}),h(W,{}),h($,{...o,onDocument:T,typing:g,metadata:u,height:"fill",mirrorStyles:s,frameWrapper:_})]})}function re(o){const s=O(),p=B(),a=w({parts:p});return a.current={parts:p},P(()=>{const d=(e,r)=>{let t=K(e,s),f,l=null;const n=r??(t?null:A(null,o.current,e)),m=!t&&n?M(n):null,u=m?j(e):null;if(m&&n&&u?.propKey){t=V({...m,nodeId:u.nodeId,key:u.propKey},s),f=u.propKey;const T=n.closest(`[${S}][${v}]`),c=`[${S}="${E(T?.getAttribute(S)??"")}"][${v}="${E(T?.getAttribute(v)??"")}"]`;l=()=>(n.ownerDocument??o.current)?.querySelector(c)??null}if(!t)return null;let i=n;const g=()=>(i=A(i,l?l():i?.ownerDocument??o.current,e),i),y=g();return y?{element:g,value:t.value,rules:t.rules,multiline:t.multiline,skip:t.skip,write:t.write,key:f,toolbar:{offered:t.offered,colors:t.offered.length>0?q(J(y)):void 0,colorNameOf:U}}:null};return{at:e=>{const r=e.closest(`[${C}]`),t=r?.getAttribute(C);return r&&t?d(t,r):null},atSelection:()=>{const e=a.current.parts.selectedPartId;return e?d(e,null):null},onCopyText:e=>L(e,s),copyValue:e=>H(e,s),onChange:e=>{if(!e.typing){I(null);return}const r=e.element.closest(`[${C}]`)?.getAttribute(C)??null;I(r),r&&a.current.parts.selectedPartId!==r&&a.current.parts.select(r)}}},[s,o])}export{we as SiteCanvas};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{settleCountNode as ee,settleCountSources as te}from"../../format/lib/content/count-numbers.js";import{SITE_FOOTER_SLUG as A}from"../../format/lib/content/footer.js";import{offeredSetsOf as U}from"./editor-blocks.js";import{isBackendError as
|
|
1
|
+
"use client";import{settleCountNode as ee,settleCountSources as te}from"../../format/lib/content/count-numbers.js";import{SITE_FOOTER_SLUG as A}from"../../format/lib/content/footer.js";import{offeredSetsOf as U}from"./editor-blocks.js";import{isBackendError as L}from"efficient-easel/screen/lib/backend-error";import{isEfficientBackend as z}from"efficient-easel/screen/lib/session";import{noteLoaded as _,notePublished as T,noteSaved as N,pageLiveState as oe}from"./page-live-state.js";import{noteVideoFramesLoaded as ne,noteVideoFramesSaved as ie}from"./page-video-frames.js";import{noteSiteLiveState as se,refreshSiteLiveState as J}from"./site-live-state.js";import{say as re}from"../../format/lib/editor-words.js";import{sendSiteWrites as ae}from"../../format/lib/site-writes.js";import{isPopupPageLayout as le}from"../../format/lib/popup/new-popup.js";import{spliceChrome as ce,splitChrome as G}from"./pinned-chrome-doc.js";import{references as de,sectionNodeOf as ue,spliceShared as fe,splitShared as me}from"../../format/lib/shared-section-docs.js";import{setActiveSharedSections as W}from"../../format/lib/shared-sections-active.js";import{setActivePinnedChrome as Y}from"../../format/lib/pinned-chrome-lock.js";import{backendOf as $}from"./website-session.js";function I(o){return!!(o?.publish&&o.liveState)}function ve(o,i){if(!I(o))return;const{versions:a,nameVersion:d,restoreVersion:s,previewVersion:n}=o;if(!(!a||!d||!s||!n))return{list:()=>a.call(o,i),name:(f,S)=>d.call(o,f,S,i),restore:(f,S)=>s.call(o,f,S??{},i),preview:f=>n.call(o,f,i)}}function he(o,i){return async(a,d)=>{try{await ae()}catch(n){throw new Error(re("A change waiting to go live could not be saved."),{cause:n})}return(await o.publish(i)).state==="live"?se({state:"live",changes:[]}):J(0),{version:d??null}}}function V(o,i,a){const d=i?{siteId:i}:void 0;return{resolve:s=>o.load({slug:s,...d}).then(n=>(n&&(_(n.id,n.live),ne(n.id,n.videoFrames)),n)),saveLayout:(s,n,f,S)=>o.save(s,{layout:n},{version:f,clientId:S??""}).then(v=>(N(s,v.live),ie(s,v.videoFrames),J(),v)),rereadVersion:o.version?s=>o.version(s):void 0,publish:I(a)?he(a,d):o.publish?(s,n)=>o.publish(s,n?{version:n}:void 0).then(f=>(T(s,f.live),f)):void 0,listPages:()=>o.list(d),createPage:o.create?s=>o.create({...s,...d}):void 0,deletePage:o.remove?(s,n)=>o.remove(s,n):void 0}}function pe(o,i,a,d,s=!1){let n=null;const f=new Set;let S=!1,v=new Map,y=new Map,m=new Map,P=new Map,g={docId:null,lockHolder:null,conflict:null,saveFailed:!1,unpublished:!1,loadFailed:!1,sections:[]};const k=new Set,E=()=>{if(!n)return!1;const e=oe(n.id);return e==="changed"||e==="never"||e===void 0&&S},w=e=>{g={...g,...e,docId:n?.id??null,unpublished:E(),sections:[...m.values()]};for(const t of k)t()},F=(e,t,r)=>{t?m.set(e,{section:e,title:v.get(e)?.title??"",problem:t,holder:r}):m.delete(e)},H=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},C=e=>f.has(e),R=()=>new Map([...v].map(([e,t])=>[e,t.layout])),j=()=>`SharedSection-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}`,M=(e,t,r,l)=>{const c=H(t);v.set(e,{layout:c,version:r,savedJson:JSON.stringify(c),title:l})},D={state:()=>g,subscribe:e=>(k.add(e),()=>{k.delete(e)})},Q={sectionOf:e=>y.get(e)?.section??null,heldElsewhere:e=>{const t=y.get(e)?.section;return!!(t&&m.get(t)?.problem==="lock")},adopt:(e,t)=>{M(t.id,t.layout,t.layout_updated_at,t.title),y.set(e,{section:t.id,refId:j()}),P.set(t.id,t.used_on),w({})},place:e=>{if([...y.values()].some(l=>l.section===e.id))return null;const t=ue(H(e.layout)),r=typeof t?.props?.id=="string"?t.props.id:null;return!t||!r||!t.type?null:(M(e.id,e.layout,e.layout_updated_at,e.title),y.set(r,{section:e.id,refId:j()}),P.set(e.id,e.used_on),t)},usedOn:e=>P.get(e)??null,learn:e=>{for(const t of e){P.set(t.id,t.used_on);const r=v.get(t.id);r&&(r.title=t.title);const l=m.get(t.id);l&&m.set(t.id,{...l,title:t.title})}w({})}},X=async(e,t)=>{for(const[r,l]of e){const c=v.get(r),u=JSON.stringify(l);if(!(!c||u===c.savedJson||m.get(r)?.problem==="lock"))try{const h=await o.save(r,{layout:l},{version:c.version,clientId:t??""});N(r,h.live),c.layout=l,c.version=h.version,c.savedJson=u,F(r,null)}catch(h){L(h,"changed-elsewhere")?F(r,"conflict"):L(h,"lock-taken")?F(r,"lock",h.holder??void 0):F(r,"save")}}e.size&&J(),w({})};return{resolve:async e=>{if(Y(e===A?null:D),W(e===A?null:Q),v=new Map,y=new Map,m=new Map,P=new Map,e===A)return a.resolve(e);let t=!1;const[r,l]=await Promise.all([a.resolve(e),o.load({slug:A,...i}).catch(()=>(t=!0,null))]);if(l&&!le(r?.layout)){_(l.id,l.live);const p=H(l.layout);n={id:l.id,layout:p,version:l.version,savedJson:""}}else n=null;if(S=!1,!r)return w({conflict:null,saveFailed:!1,loadFailed:t}),r;const c=H(r.layout),u=de(c),h=await Promise.all(u.map(p=>o.load({id:p.section,...i}).catch(()=>null)));u.forEach((p,Z)=>{const b=h[Z];b?(_(b.id,b.live),M(p.section,b.layout,b.version,"")):(v.delete(p.section),m.set(p.section,{section:p.section,title:"",problem:"load"}))});const B=fe(c,R());if(y=B.held,!n)return y.size&&f.add(r.id),w({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...r,layout:B.working}:r;const O=ce(B.working,n.layout);return n.savedJson=JSON.stringify(G(O,n.layout).chrome),f.add(r.id),w({conflict:null,saveFailed:!1,loadFailed:!1}),{...r,layout:O}},saveLayout:async(e,t,r,l)=>{if(!C(e))return a.saveLayout(e,t,r,l);const c=n,u=c?G(t,c.layout):{page:t,chrome:null},h=me(u.page,y,R()),B=await a.saveLayout(e,h.page,r,l);if(await X(h.docs,l),!c)return B;const O=JSON.stringify(u.chrome);if(!u.chrome||O===c.savedJson||g.lockHolder)return B;try{const p=await o.save(c.id,{layout:u.chrome},{version:c.version,clientId:l??""});N(c.id,p.live),J(),c.layout=u.chrome,c.version=p.version,c.savedJson=O,S=!0,w({conflict:null,saveFailed:!1})}catch(p){L(p,"changed-elsewhere")?w({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):L(p,"lock-taken")?w({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):w({saveFailed:!0})}return B},publish:a.publish?async(e,t)=>{const r=await a.publish(e,t),l=n;if(l&&C(e)&&!s&&o.publish&&E()&&!g.lockHolder){const c=await o.publish(l.id,l.version?{version:l.version}:void 0);T(l.id,c.live),c.version!==null&&(l.version=c.version),S=!1,w({})}if(C(e)&&!s&&o.publish)for(const[c,u]of v){if(m.get(c)?.problem==="lock")continue;const h=await o.publish(c,u.version?{version:u.version}:void 0);T(c,h.live),h.version!==null&&(u.version=h.version)}return r}:void 0,lock:d?{claim:async(e,t,r)=>{const l=await d.claim(e,t,r);if(!C(e))return l;const c=n;if(c)try{await d.claim(c.id,t,!1),g.lockHolder&&w({lockHolder:null})}catch(u){L(u,"lock-taken")&&w({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of v.keys())try{await d.claim(u,t,!1),m.get(u)?.problem==="lock"&&F(u,null)}catch(h){L(h,"lock-taken")&&F(u,"lock",h.holder??void 0)}return v.size&&w({}),l},release:async(e,t)=>{if(await d.release(e,t),!C(e))return;const r=n;r&&!g.lockHolder&&await d.release(r.id,t).catch(()=>{});for(const l of v.keys())m.get(l)?.problem!=="lock"&&await d.release(l,t).catch(()=>{})}}:void 0,pinnedChrome:D}}function q(o){const i=(a,d,s)=>o.save(a,d.layout?{...d,layout:te(d.layout)}:d,s);return new Proxy(o,{get(a,d){if(d==="save")return i;const s=Reflect.get(a,d,a);return typeof s=="function"?s.bind(a):s}})}function Me(o,i,a){return o.update(i,ee(a))}function _e(o,i=$(),a=U(),d={}){const s=z(i),n=o?{siteId:o}:void 0,f=s?!!o:!0,S=i.site.update,v=s&&a.commerce&&a.service,y=!!d.editsPinnedInPlace&&v,m=I(i.site)?i.site:void 0,P=q(i.pages),g=V(P,o,m),k=y?pe(P,n,g,i.lock,!!m):null;return{capabilities:{canPublish:!!m||!!i.pages.publish,hasSiteSettings:s,hasSiteTheme:!!i.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!i.pages.create,canDeletePagesInline:!!i.pages.remove,hasEditLock:!!i.lock,hasEditGuard:!0,hasPinnedChrome:v,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!S,hasPreviewLink:s||!!i.preview,hasCatalog:s&&a.commerce,hasForms:s&&a.service,hasBlog:!!i.blog&&a.service,offersCommerce:a.commerce,offersService:a.service},...g,...K(g.resolve),lock:i.lock,...k,site:f?()=>i.site.get(n):void 0,siteLiveState:m?()=>m.liveState(n):void 0,siteVersions:ve(m,n),updateSite:f&&S?E=>S(E,n):void 0,previewHref:i.preview?E=>i.preview.href(E):void 0}}function Te(o,i=$(),a=U()){const d=z(i),s=i.templates,n=s?q(s.pages(o)):{list:()=>Promise.reject(new Error(x)),load:()=>Promise.reject(new Error(x)),save:()=>Promise.reject(new Error(x))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!n.create,canDeletePagesInline:!!n.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&a.commerce&&a.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&a.commerce,hasForms:d&&a.service,hasBlog:!!i.blog&&a.service,offersCommerce:a.commerce,offersService:a.service},...V(n,void 0),...K(V(n,void 0).resolve),publish:void 0,templateName:s?()=>s.get(o).then(f=>f.name):void 0}}function K(o){return{resolve:i=>(Y(null),W(null),o(i))}}const x="This editor's backend has no website templates.";export{_e as makeSitePageAdapter,Te as makeTemplatePageAdapter,Me as saveSectionTemplate,q as settlingPages};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type EaselBlockType, type EaselSelection, type PageEditOp } from "efficient-easel/screen/lib/host";
|
|
2
|
+
import type { PressContext } from "../../format/lib/sections/section-presets.js";
|
|
2
3
|
type AnyDocument = {
|
|
3
4
|
root?: unknown;
|
|
4
5
|
content?: unknown[];
|
|
@@ -25,5 +26,5 @@ export type ApplyResult<D> = {
|
|
|
25
26
|
ok: false;
|
|
26
27
|
reason: string;
|
|
27
28
|
};
|
|
28
|
-
export declare function applyPageEdits<D extends AnyDocument>(config: BlockConfig, document: D, ops: PageEditOp[], newId: (type: string) => string): ApplyResult<D>;
|
|
29
|
+
export declare function applyPageEdits<D extends AnyDocument>(config: BlockConfig, document: D, ops: PageEditOp[], newId: (type: string) => string, ctx?: PressContext): ApplyResult<D>;
|
|
29
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FIELD_DESCRIPTION_MARKER as
|
|
1
|
+
import{FIELD_DESCRIPTION_MARKER as j}from"efficient-easel/screen/lib/host";import{isNode as d}from"efficient-easel/data";import{RETIRED_SECTIONS as v}from"../../format/lib/document/section-catalog.js";import{layoutPresetFor as O}from"./sections/text-layouts.js";function u(r,t){const e=r.components[t]?.label;return typeof e=="string"&&e.trim()?e.trim():t}function E(r){return r.length>3&&r.endsWith("s")?r.slice(0,-1):r}function b(r,t,e,o){r.forEach((s,l)=>{if(d(s)){o.push({node:s,list:r,index:l,parent:t,slot:e});for(const[i,n]of Object.entries(s.props))Array.isArray(n)&&n.some(d)&&b(n,s,i,o)}})}function x(r){const t=[];b(Array.isArray(r.content)?r.content:[],null,"",t);for(const e of Object.values(r.zones??{}))Array.isArray(e)&&b(e,null,"",t);return t}function h(r,t){return x(r).find(e=>String(e.node.props.id)===t)}function N(r,t,e){if(!e)return null;const o=h(t,e);if(!o)return null;const s=u(r,o.node.type),l=o.parent?`${u(r,o.parent.type)} · ${E(o.slot)} ${o.index+1}`:s;return{blockId:e,type:o.node.type,label:l,path:""}}const w=r=>r.filter(t=>!!t&&typeof t=="object"&&"value"in t).map(t=>typeof t.label=="string"?{value:t.value,label:t.label}:{value:t.value});function F(r){if(!r||typeof r!="object")return null;const t=r;if(typeof t.type!="string")return null;const e=t.type==="custom"?t[j]:void 0,o={type:e?.type??t.type},s=e?.label??t.label;typeof s=="string"&&(o.label=s);const l=e?.options??t.options;Array.isArray(l)&&(o.options=w(l));for(const i of["arrayFields","objectFields"]){const n=e?.[i]??t[i];n&&typeof n=="object"&&(o[i]=k(n))}return o}function k(r){const t={};for(const[e,o]of Object.entries(r??{})){const s=F(o);s&&(t[e]=s)}return t}function z(r){const t={};for(const[e,o]of Object.entries(r.components))o&&(t[e]={label:u(r,e),fields:k(o.fields),...m(e)?{retired:!0}:{}});return t}function m(r){return Object.prototype.hasOwnProperty.call(v,r)}function A(r,t){const e=r.components[t]?.defaultProps;return e&&typeof e=="object"?structuredClone(e):{}}function S(r,t){let e=r;for(const o of t?t.split("."):[]){const s=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(o);if(!s||!e||typeof e!="object")return null;e=e[s[1]],s[2]!==void 0&&(e=Array.isArray(e)?e[Number(s[2])]:void 0)}return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function y(r,t){return r.findIndex(e=>d(e)&&String(e.props.id)===t)}function g(r,t,e){const o=t||e;if(!o)return r.length;const s=y(r,o);if(s<0)throw new Error(`there is no top-level block ${o}`);return t?s+1:s}function D(r,t,e,o,s={}){const l=structuredClone(t),i=Array.isArray(l.content)?l.content:l.content=[];try{e.forEach((n,_)=>{const a=c=>{throw new Error(`change ${_+1}: ${c}`)};switch(n.op){case"set_props":{const c=h(l,n.block_id)??a(`there is no block ${n.block_id}`);"id"in n.props&&a("a block's id is never changed");const f=S(c.node.props,n.path)??a(`there is no ${n.path} in that block`);Object.assign(f,structuredClone(n.props));break}case"insert_block":{r.components[n.type]??a(`there is no block type ${n.type}`),m(n.type)&&a(`${u(r,n.type)} is retired: it is no longer added (a page that holds one keeps it)`);const c=O(n.type),f=Object.keys(n.props??{}).filter(p=>p!=="id");c&&f.length&&a(`${u(r,n.type)} is laid down as a Box of blocks: insert it with no props, then change its blocks`);const $=c?c(p=>A(r,p),o,s):{type:n.type,props:{...A(r,n.type),...structuredClone(n.props),id:o(n.type)}};i.splice(g(i,n.after,n.before),0,$);break}case"remove_block":{const c=y(i,n.block_id);c<0&&a(`there is no top-level block ${n.block_id}`),i.splice(c,1);break}case"move_block":{const c=y(i,n.block_id);c<0&&a(`there is no top-level block ${n.block_id}`);const[f]=i.splice(c,1);i.splice(g(i,n.after,n.before),0,f);break}default:a(`"${n.op}" is not a change this editor makes`)}})}catch(n){return{ok:!1,reason:n instanceof Error?n.message:String(n)}}return{ok:!0,document:l}}export{D as applyPageEdits,u as blockLabel,z as describeBlocks,N as describeSelection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useSyncExternalStore as u}from"react";function a(){const t=new Map,r=new Set,s=e=>(r.add(e),()=>{r.delete(e)});return{get:e=>t.get(e),has:e=>t.has(e),set(e,n){if(!(t.has(e)&&t.get(e)===n)){t.set(e,n);for(const o of r)o()}},use(e){const n=()=>e?t.get(e):void 0;return u(s,n,n)}}}export{a as keyedStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{say as n}from"../../format/lib/editor-words.js";import{keyedStore as l}from"./keyed-store.js";const r=l(),i=r.set;function h(e,t){i(e,t)}function p(e,t){const o=r.get(e);i(e,t??(o==="live"?"changed":o))}function g(e,t){i(e,t??"live")}function d(e){return r.get(e)}function m(e){return r.use(e)}function y(e,t){return e==="live"&&t?"changed":e}function x({live:e,onPress:t,busy:o=!1,pinnedUnpublished:s=!1,goingLive:a}){const u=e==="live"&&!s,c=e==="changed"?n("Changes not live yet"):e==="never"?n("Never published"):s?n("Header and footer not live yet"):e==="live"?n("Everything is live"):null;return{label:n("Publish"),tooltip:e==="never"?n("Put this page on your site"):n("Put your changes on your site"),status:c,quiet:u?{label:n("Published"),reason:n("Everything is live")}:null,...a&&a.length?{goingLive:a}:{},onPress:t,busy:o}}function b(e){return e.map(t=>t.change==="take_down"?n("{name} (taken down)",{name:t.name}):t.name)}export{y as effectiveLive,b as goingLiveLines,x as mainActionFor,h as noteLoaded,g as notePublished,p as noteSaved,d as pageLiveState,m as usePageLiveState};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type KnownVideoFrame } from "../../format/lib/hero-video.js";
|
|
2
|
+
import type { VideoFrames } from "../../format/lib/web-backend.js";
|
|
3
|
+
export type NotedVideoFrame = Required<KnownVideoFrame>;
|
|
4
|
+
export type PageVideoFrames = Readonly<Record<string, NotedVideoFrame>>;
|
|
5
|
+
export declare function noteVideoFramesLoaded(id: string, said: VideoFrames | undefined): void;
|
|
6
|
+
export declare function noteVideoFramesSaved(id: string, said: VideoFrames | undefined): void;
|
|
7
|
+
export declare function pageVideoFrames(id: string): PageVideoFrames | undefined;
|
|
8
|
+
export declare function usePageVideoFrames(id: string | null): PageVideoFrames | undefined;
|
|
9
|
+
export declare function nodesWithoutPageFrames(data: unknown, isShared?: (id: string) => boolean): ReadonlySet<string>;
|
|
10
|
+
export declare function pageFramesFor(nodeId: string | undefined, data: unknown, known: PageVideoFrames | undefined, isShared?: (id: string) => boolean): PageVideoFrames | undefined;
|
|
11
|
+
export declare function videoFramesMetadata(known: PageVideoFrames | undefined, data?: unknown, isShared?: (id: string) => boolean): Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{VIDEO_FRAMES_KEY as i,VIDEO_FRAMES_NOT_OWN_KEY as m}from"../../format/lib/hero-video.js";import{keyedStore as d}from"./keyed-store.js";import{idsNotThePagesOwn as p}from"./pinned-chrome-doc.js";import{activeSharedSections as F}from"../../format/lib/shared-sections-active.js";const n=d();function s(e,t,o){if(!t)return;const r={...n.get(e)};for(const[u,c]of Object.entries(t))r[u]={...c,noted:o};n.set(e,r)}function E(e,t){s(e,t,"load")}function S(e,t){s(e,t,"save")}function V(e){return n.get(e)}function _(e){return n.use(e)}const a=e=>!!F()?.sectionOf(e);function f(e,t=a){return p(e,t)}function l(e,t,o,r=a){if(o)return e&&f(t,r).has(e)?void 0:o}function v(e,t,o=a){if(!e)return{};const r=[...f(t,o)];return r.length?{[i]:e,[m]:r}:{[i]:e}}export{f as nodesWithoutPageFrames,E as noteVideoFramesLoaded,S as noteVideoFramesSaved,l as pageFramesFor,V as pageVideoFrames,_ as usePageVideoFrames,v as videoFramesMetadata};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type ChromeLayout = Record<string, unknown>;
|
|
2
2
|
export declare const PINNED_CHROME_TYPES: readonly string[];
|
|
3
|
+
export declare function idsNotThePagesOwn(working: ChromeLayout | null | undefined, isShared: (id: string) => boolean): Set<string>;
|
|
3
4
|
export declare function spliceChrome(page: ChromeLayout, chrome: ChromeLayout | null): ChromeLayout;
|
|
4
5
|
export declare function splitChrome(working: ChromeLayout, chrome: ChromeLayout | null): {
|
|
5
6
|
page: ChromeLayout;
|