efficient-web-builder 47.1.0 → 47.2.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.
Files changed (111) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/dist/editor/components/BlockGapField.d.ts +15 -1
  3. package/dist/editor/components/BlockGapField.js +1 -1
  4. package/dist/editor/components/DuplicateToPageMenu.d.ts +2 -0
  5. package/dist/editor/components/DuplicateToPageMenu.js +1 -1
  6. package/dist/editor/components/SideSpaceField.d.ts +31 -1
  7. package/dist/editor/components/SideSpaceField.js +1 -1
  8. package/dist/editor/components/SiteFields.js +1 -1
  9. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  10. package/dist/editor/components/StorefrontEditor.js +1 -1
  11. package/dist/editor/components/WebsiteSettingsPanel.d.ts +10 -0
  12. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  13. package/dist/editor/lib/animation/AnimationDurationRow.d.ts +4 -0
  14. package/dist/editor/lib/animation/AnimationDurationRow.js +1 -1
  15. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  16. package/dist/editor/lib/animation/fields.js +1 -1
  17. package/dist/editor/lib/animation/loop-fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  19. package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
  20. package/dist/editor/lib/document/canvas-typing.js +1 -1
  21. package/dist/editor/lib/document/card-display-chips.d.ts +33 -0
  22. package/dist/editor/lib/document/card-display-chips.js +1 -0
  23. package/dist/editor/lib/document/controls.d.ts +13 -0
  24. package/dist/editor/lib/document/controls.js +1 -1
  25. package/dist/editor/lib/document/field-groups.js +1 -1
  26. package/dist/editor/lib/document/live-number-field.d.ts +12 -0
  27. package/dist/editor/lib/document/live-number-field.js +1 -0
  28. package/dist/editor/lib/document/page-root.js +2 -2
  29. package/dist/editor/lib/editor-document-adapter.d.ts +5 -1
  30. package/dist/editor/lib/editor-document-adapter.js +1 -1
  31. package/dist/editor/lib/sections/section-dry-run.d.ts +34 -0
  32. package/dist/editor/lib/sections/section-dry-run.js +2 -2
  33. package/dist/format/lib/animation/index.d.ts +1 -0
  34. package/dist/format/lib/animation/index.js +1 -1
  35. package/dist/format/lib/content/block-sources.d.ts +9 -0
  36. package/dist/format/lib/content/block-sources.js +1 -1
  37. package/dist/format/lib/content/box-layout.d.ts +12 -1
  38. package/dist/format/lib/content/box-layout.js +1 -1
  39. package/dist/format/lib/content/box-separator.js +1 -1
  40. package/dist/format/lib/content/card-template.d.ts +1 -0
  41. package/dist/format/lib/content/card-template.js +1 -1
  42. package/dist/format/lib/content/container-gap.d.ts +9 -1
  43. package/dist/format/lib/content/container-gap.js +1 -1
  44. package/dist/format/lib/content/count-numbers.d.ts +7 -0
  45. package/dist/format/lib/content/count-numbers.js +1 -0
  46. package/dist/format/lib/content/page-width.d.ts +11 -0
  47. package/dist/format/lib/content/page-width.js +1 -1
  48. package/dist/format/lib/content/section-sticky.d.ts +1 -0
  49. package/dist/format/lib/content/section-sticky.js +1 -1
  50. package/dist/format/lib/content/site-gutter.d.ts +6 -0
  51. package/dist/format/lib/content/site-gutter.js +1 -1
  52. package/dist/format/lib/document/easel-row-words.d.ts +1 -0
  53. package/dist/format/lib/document/easel-row-words.js +1 -1
  54. package/dist/format/lib/document/panel-bands.d.ts +1 -0
  55. package/dist/format/lib/document/panel-bands.js +1 -1
  56. package/dist/format/lib/document/passes/settings-groups.js +1 -1
  57. package/dist/format/lib/document/site-gap-fields.d.ts +1 -1
  58. package/dist/format/lib/document/site-gap-fields.js +1 -1
  59. package/dist/format/lib/editor-words-catalogue.d.ts +5 -0
  60. package/dist/format/lib/editor-words-catalogue.js +3 -3
  61. package/dist/format/lib/fit-words.js +4 -3
  62. package/dist/format/lib/sections/strip-shape.d.ts +1 -0
  63. package/dist/format/lib/sections/strip-shape.js +1 -1
  64. package/dist/format/lib/site-theme-row.d.ts +2 -0
  65. package/dist/format/lib/site-twin-row.d.ts +5 -0
  66. package/dist/format/lib/site-twin-row.js +1 -0
  67. package/dist/format/lib/source-rules/flat-theme-palette.js +1 -1
  68. package/dist/format/lib/source-rules/one-loop-module.js +3 -3
  69. package/dist/render/components/BlockFrame.d.ts +2 -1
  70. package/dist/render/components/BlockFrame.js +1 -1
  71. package/dist/render/components/Btn.js +1 -1
  72. package/dist/render/components/CountRowsContext.d.ts +8 -0
  73. package/dist/render/components/CountRowsContext.js +1 -0
  74. package/dist/render/components/Flex.d.ts +3 -1
  75. package/dist/render/components/Flex.js +1 -1
  76. package/dist/render/components/ImageBlock.d.ts +4 -1
  77. package/dist/render/components/ImageBlock.js +1 -1
  78. package/dist/render/components/InBoxContext.d.ts +1 -0
  79. package/dist/render/components/InBoxContext.js +1 -1
  80. package/dist/render/components/IntroBleed.js +1 -1
  81. package/dist/render/components/LocationMap.js +1 -1
  82. package/dist/render/components/PreviewHeaderContext.d.ts +9 -1
  83. package/dist/render/components/PreviewHeaderContext.js +1 -1
  84. package/dist/render/components/SiteGutterFrame.d.ts +7 -1
  85. package/dist/render/components/SiteGutterFrame.js +1 -1
  86. package/dist/render/lib/animation/LoopTrack.d.ts +2 -2
  87. package/dist/render/lib/animation/LoopTrack.js +1 -1
  88. package/dist/render/lib/content/block-size.js +1 -1
  89. package/dist/render/lib/content/section-edge.d.ts +10 -0
  90. package/dist/render/lib/content/section-edge.js +1 -0
  91. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  92. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  93. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  94. package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
  95. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  96. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +5 -0
  97. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  98. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +1 -1
  99. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  100. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  101. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  102. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  103. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  104. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  105. package/dist/render/lib/document/passes/block-size.js +1 -1
  106. package/dist/render/lib/document/passes/section-anchor.js +1 -1
  107. package/dist/render/lib/document/passes/section-padding.js +1 -1
  108. package/dist/render/lib/document/passes/slots-start-afresh.js +1 -1
  109. package/dist/render/lib/sections/section-to-box.d.ts +5 -1
  110. package/dist/render/lib/sections/section-to-box.js +1 -1
  111. package/package.json +2 -2
@@ -193,6 +193,7 @@ export declare function boxShareField(points?: readonly (typeof BOX_SHARE_POINTS
193
193
  export declare function boxBlockSpacingField(): SelectField;
194
194
  export declare function boxSharePhoneField(): CustomField<string>;
195
195
  export declare function boxPhoneRowField(): import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
196
+ export declare function boxColumnsFields(): Record<string, import("efficient-easel/screen/lib/document/box-fields").BoxField<number>>;
196
197
  export declare function sizeField(label: string, min: number, max: number, step: number, fallback: number, role: TypeRole): CustomField<TypeSizeValue>;
197
198
  export declare function cellWidthFields(): Record<string, unknown>;
198
199
  export declare function useSelectedProps(): Record<string, unknown>;
@@ -332,6 +333,18 @@ export declare function displayFields(parts: readonly {
332
333
  id: string;
333
334
  label: string;
334
335
  }[], key?: string): Record<string, CustomField<unknown>>;
336
+ export declare function DisplayRow({ parts, changed, shown, onPress, onReset, detail, disabledReason, }: {
337
+ parts: readonly {
338
+ id: string;
339
+ label: string;
340
+ }[];
341
+ changed: boolean;
342
+ shown: (id: string) => boolean;
343
+ onPress: (id: string, shown: boolean) => void;
344
+ onReset: () => void;
345
+ detail?: string;
346
+ disabledReason?: string;
347
+ }): import("react").JSX.Element;
335
348
  export declare function cardImageField(): CustomField<number | null>;
336
349
  export declare function imageCornersField(): CustomField<number | null>;
337
350
  export declare function galleryLayoutField(): CustomField<string>;
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as k,Fragment as O}from"react/jsx-runtime";import{cloneElement as he,useEffect as ut,useId as ge,useRef as z,useState as H}from"react";import{useEasel as ne}from"efficient-easel/easel";import{toDateKey as pt,fromDateKey as ft}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{mediaValueSrc as be}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as xe,loadingShowsOf as mt}from"../../../format/lib/hero-video.js";import{readHidable as Se,hidableText as ye}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as oe,LINK_FIELD_MARKER as Ce,MEDIA_FIELD_MARKER as _e,SCAFFOLD_FIELD_MARKER as we,TEXT_FIELD_MARKER as w,foldMetaOf as re,textFieldIdentifier as ht}from"efficient-easel/draw";import gt from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as bt}from"../../../render/lib/document/show-when.js";import xt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as St,CORNER_RADIUS_MAX as Ie,CORNER_RADIUS_MIN as L}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as yt,IMAGE_CORNERS_LABEL as Ct}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as _t}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as wt,GALLERY_LAYOUTS as Y,GALLERY_LAYOUT_KEYS as It,galleryChoices as Ee,galleryPictureCells as Et}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Rt}from"./shell-glyph.js";import{anchorSiblingsOf as Tt,placementPoints as Ot}from"../../../format/lib/hero-group-placement.js";import Pt,{KEEP_HINT_CLASS as At}from"../../components/KeepHint.js";import Ft from"../../components/AnchorField.js";import{AdjustIcon as kt,EyeIcon as Lt,AnimationIcon as Nt,BackgroundIcon as vt,BorderAllIcon as Dt,BlockSectionIcon as Bt,ColumnWidthsIcon as Re,ColumnsIcon as Ht,CornerIcon as Gt,DirectionDownIcon as Mt,DirectionLeftIcon as Kt,DirectionRightIcon as Wt,DirectionUpIcon as Ut,EditIcon as $t,GapIcon as Xt,GridIcon as jt,GroundIcon as Te,HashIcon as Oe,HeightIcon as zt,ImageIcon as Yt,ListIcon as Vt,LocationIcon as Pe,PaddingBottomIcon as Ae,PaddingLeftIcon as Fe,PaddingRightIcon as ke,PaddingTopIcon as Le,PageIcon as qt,StickyIcon as Zt,RotateIcon as Jt,SearchIcon as Qt,SquareIcon as en,TypeIcon as tn,WidthIcon as nn}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as on}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as ve,CORNER_SIDE_POINTS as rn,hasOwnSectionCorners as ln,normalizeCornerSides as De}from"../../../format/lib/content/section-corners.js";import{enclosingPath as an,enclosingSection as sn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as cn,SettingsField as h,SettingsGroup as dn,SettingsGroupSub as un,SettingsSegmented as pn,SettingsBorder as fn,SettingsSidesEach as mn,SettingsSwitch as ie,borderSides as hn,borderStartEach as gn}from"efficient-easel/panel";import{ListField as bn}from"efficient-easel/fields";import{DisplayChips as xn}from"efficient-shell/ui";import{desktopDisplayChanged as Sn,partShownOnDesktop as yn,partShownOnPhone as Cn,phoneDisplayChanged as _n,withDesktopPart as wn,withPhonePart as In}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as En,Checkbox as Rn,ColorSwatch as Tn,CornersInput as On,DatePicker as Pn,DateTimePicker as An,FOCAL_DEFAULT as Fn,PictureTiles as kn,IconPicker as Ln,IconButton as Be,InputNumber as He,Slider as Nn,Tooltip as V}from"efficient-shell/ui";import{ColourRow as Ge,InheritedColourRow as vn}from"./ColourControl.js";import{keptByRow as Dn}from"efficient-easel/screen/lib/document/style-fields";import Me from"./MarkupToolbar.js";import{deviceField as b}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Bn,NoControlMark as Hn,noControlField as Ke}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Gn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Mn,resolvePhoneValue as le}from"../../../format/lib/document/phone-override.js";import{phoneKey as N}from"efficient-easel/draw";import{SuppressibleText as Kn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Wn,CARD_OUTLINE_OPTIONS as Un,DEFAULT_CARD_INDEX_FORMAT as $n,DEFAULT_CARD_OUTLINE as Xn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as jn,DEFAULT_COVER_INDEX as zn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Yn}from"efficient-easel/draw";import Vn from"../../components/MediaUploadField.js";import{useSelectedHost as ae}from"./selected-host.js";import qn from"../../components/MultiSelectField.js";import Zn from"../../components/SectionThemePicker.js";import Jn from"../../components/SearchSelectField.js";import Qn from"../../components/StorefrontLinkField.js";import{UiIcon as We}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as eo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as to}from"efficient-easel/draw/client";import{encodePartId as no}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as oo,useEaselStrings as ro}from"efficient-easel/strings";import{hasPhoneHeight as io,resolveSectionMinHeight as lo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as q,SECTION_STICK_LABEL as se,hasPhoneStick as ao,resolveSectionStick as so}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as co,SECTION_MIN_HEIGHT_GROUP_LABEL as G,SECTION_SCREEN_PCT as uo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as po,resolveContainerDirection as Ue}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as fo,BOX_BLOCK_SPACING_POINTS as $e,BOX_PHONE_ROW_LABEL as mo,BOX_PHONE_ROW_MAX as ho,BOX_PHONE_ROW_MIN as Xe,BOX_SHARE_LABEL as ce,BOX_SHARE_PHONE_DEFAULT as go,BOX_SHARE_PHONE_POINTS as bo,BOX_SHARE_POINTS as xo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as P}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as So}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as je,normalizeTheme as ze}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ye,CONTAINER_GAP_BUILT_IN as yo,CONTAINER_GAP_PHONE as Co,GAP_FIELD_CONTAINER as Ve,hasOwnContainerGap as _o,hasOwnPhoneGap as wo,resolveContainerGap as Io,resolvePhoneContainerGap as qe}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Eo,CARD_IMAGE_BG_OFF as Ro,CARD_IMAGE_BG_SWATCH_NAMES as To,CARD_IMAGE_BG_SWATCHES as Oo,isCardImageBackgroundInheriting as Po,cardImageBackgroundChoice as Ao,THEME_CARD_IMAGE_BG as Fo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ko,SECTION_BG_SWATCHES as Lo,SECTION_BG_SWATCH_NAMES as No,THEME_SECTION_BG as vo,isSectionBackgroundInheriting as Do}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Bo,nestedAccentValue as Ze,resolveSectionAccent as Z}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Ho,TYPE_SIZE_INHERIT as Go,isTypeSizeInheriting as Mo}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Ko,WIDTH_CHOICE_LABEL as Wo,WIDTH_INHERIT as Uo}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as $o}from"./panel-heading-scope.js";import{useEaselSession as Xo}from"efficient-easel/screen/lib/session-context";import{backendOf as jo}from"../website-session.js";import{BOX_GAP as zo,describedAs as E,group as _,iconOf as M,sharedStyleKinds as K}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Yo,gapField as Je,Segmented as de,segmented as Vo,select as W,slider as U}from"./box-fields.js";function Cl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function v(e,t){return l("{value} from {from}",{value:e,from:t})}function qo(){const{blockGap:e}=P();return e===null?l("this container's own spacing"):v(`${e}px`,l("Styles"))}function Zo({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:qo(),onReset:t})}function Jo(e){return Je({...zo,builtIn:yo[e],resolve:(t,n)=>Io(e,t,n?.siteGap),action:(t,n)=>i(Zo,{inherited:!_o(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Ve]:e}})}function Qo(e){return bt(b("mobile",{[Ve]:e,type:"custom",render:t=>i(tr,{container:e,...t})}),er)}const er={not:{field:"gap",in:Array.from({length:-Ye.min},(e,t)=>Ye.min+t)}};function _l(e){return{gap:b("desktop",Jo(e)),[N("gap")]:Qo(e)}}function tr({container:e,...t}){const[n]=D("gap"),o=t.field?.siteGap,r=qe(e,void 0,n,o);return Je({...Co,builtIn:r,resolve:s=>qe(e,s,n,o),action:(s,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:wo(s),detail:v(`${r}px`,l("Desktop")),onReset:()=>c(void 0)})}).render(t)}function wl(e){return Yo({offered:po(e),fallback:Ue(e,void 0),resolve:t=>Ue(e,t)})}function Il(e,t){return Ot(t?Tt(e,t):[],t)}function nr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:v(l("Full"),l("the page")),onReset:t})}function A({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:d,hidden:f}=Se(e),m=z(null),p=z(null),u=T=>t(s?{text:T,hidden:f}:T),x=()=>t({text:d,hidden:!f}),g=s&&f,R=ge(),C=r?ar(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(Pt,{children:l(r)}):void 0,j=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(h,{label:l(n),icon:i(tn,{}),htmlFor:R,className:g?"is-hidden":void 0,hint:C,action:s?i(V,{content:j,children:i(Be,{"aria-pressed":f,"aria-label":j,onClick:x,children:f?i(We,{name:"eye-off",size:14}):i(We,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[c&&i(Me,{target:a?p:m,value:d,onChange:u}),a?i("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:T=>u(T.target.value)}):i("input",{id:R,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:T=>u(T.target.value)})]})})}function El(e,t){return{...e,[we]:t}}function Rl(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function Tl(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const Qe="sfPanelOnly";function Ol(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Qe]:!0}}function Pl(e){return!!e&&typeof e=="object"&&e[Qe]===!0}function Al(e){const t=e[w];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[w]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Wa,SCALAR_TEXT_CONTROLS as Ua}from"efficient-easel/draw";function Fl(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[Bn]:o,...r}=e;return{...r,[Gn]:!0,render:t}}const or=new Set(Yn),$={type:"radio",options:[{value:!0},{value:!1}]},et={text:{type:"object",objectFields:{text:{type:"text"},hidden:$}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:$}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},F=(e,t)=>{const n=E({...t,[w]:e},{...et[e.control],label:e.label});if(!or.has(e.control))return n;const o=t.render;return{...Ke(n,"authored-copy"),render:r=>i(Kn,{name:r.name,children:o(r)})}},kl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",rr={field:"source.slug",set:!0},Ll={not:rr},ir="Select a word, then press the highlighter.",lr=new Set([ir]),ar=e=>lr.has(e);function Nl(e,t,n){return F({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function vl(e,t,n){return F({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Dl(e,t,n){return F({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Bl(e,t,n){return F({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Hl(e){return{type:"custom",[Ce]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Qn,{value:ye(t),onChange:n,label:e})}}function Gl(e,t,n){return F({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Ml={Design:kt,Animation:Nt};function Kl(e,t){return e.includes("Design")?t!=="Design":null}function Wl(e){return{type:"custom",render:()=>i(sr,{text:e})}}function sr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function Ul(e){return re(e)!==null&&e?.tabs!==void 0}const tt=new Map;function $l(e,t){const n=`${e}\0${t?t.join(""):""}`,o=tt.get(n)??{type:"custom",tabs:t,[oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(O,{})};return tt.set(n,o),o}const nt=new Map;function Xl(e){const t=nt.get(e)??{type:"custom",[oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(O,{})};return nt.set(e,t),t}function cr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function jl(e,t){return cr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(O,{})}}function zl(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(O,{})}}function Yl({title:e,children:t}){const[n,o]=H(()=>!ue.has(e));return i(dn,{title:e,open:n,onToggle:r=>{o(r),r?ue.delete(e):ue.add(e)},children:t})}const ue=new Set;function Vl({label:e}){return i(un,{title:l(e),level:$o(2)})}function ot({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?l(a):t;return k("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(V,{content:d,children:i(Tn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function ql(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=Do(n,t);return i(h,{label:l(e),icon:i(vt,{}),changed:!r,action:i(y,{words:S()?.panel,label:l(e),changed:!r,detail:l("the theme's section background"),onReset:()=>o(ko)}),children:ot({swatches:Lo,current:r?vo:n??t??"",onPick:o,names:No})})}}}function dr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=Po(r,t);return i(h,{label:l(e),icon:i(Te,{}),changed:!a,action:i(y,{words:S()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Eo)}),children:ot({swatches:Oo,current:a?Fo:Ao(r,t),onPick:o,names:To})})}}}function Zl(e=n=>n,t){return K({_gSectionTheme:_(Bo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Zn,{value:e(n),onChange:o,followLabel:t})}})}function X({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:d,disabled:f=!1}){const m=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:m?"sf-slider has-notch":"sf-slider",style:m?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Nn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:s,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&r(p)}})})}function rt(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const x=typeof p=="number"?p:null,g=x===null;return i(h,{label:l(e),icon:f?M(f):void 0,value:g?d||a===void 0?void 0:l(a):`${x}${m}`,changed:!g,action:d?he(d,{changed:!g,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:l(e),changed:!g,onReset:()=>u(null)}),hint:typeof s=="string"?l(s):s,children:c?c({min:n,max:o,step:r,px:x,label:e,onChange:u}):X({min:n,max:o,step:r,value:x??n,readout:!1,ariaLabel:e,onChange:u})})}}}const J="Corners";function pe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(h,{label:l(J),icon:i(Gt,{}),changed:r,action:he(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(pr,{tier:e,px:o,onRadius:n})})}}}function D(e){const t=ae();return[t?.values?.[e],n=>t?.onChange(e,n)]}function it(){return Ke({type:"custom",render:()=>i(Hn,{})},"always")}function ur(){const e=ae();return t=>e?.onChangeMany(t)}function pr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=D(e.sidesKey),s=De(r)??[...ve];return i(On,{label:l(J),value:s,corners:rn,onChange:c=>{const d=De(c)??[];a(d.length===ve.length?null:d)},radius:t,onRadiusChange:n,radiusMin:L,radiusMax:Ie,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function lt(){return it()}function fr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=P(),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"):v(r,l("Styles")),onReset:n})}function mr(){const{cornerRadiusPx:e}=P();return typeof e=="number"?e:L}function hr(){return pe({sidesKey:"sectionCornerSides",useFollowed:mr,mark:i(fr,{label:J}),hint:gr})}const gr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Jl(){return K({_gShape:_("Shape"),sectionCorners:hr(),sectionCornerSides:lt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const br=()=>({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 xr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Sr(){let e;try{const t=ze(P().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||je.line}function yr({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:a=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[d,f]=H(()=>r?gn(c,s):!1),m=br(),p=u=>xr(r&&a?u:{width:u.width,color:u.color,...a?{style:u.style}:{}});return i(h,{label:l("Border"),icon:i(Dt,{}),action:r?i(mn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(fn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:a,max:So})})}function Cr({value:e,onChange:t,tier:n}){const[o]=D("sectionBorder"),r=Sr(),a=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(yr,{value:e,onChange:t,placeholder:{sides:hn(a),style:a.style??"solid",color:a.color||r},presets:[r],above:a})}function at(e){return b(e,{type:"custom",render:({value:t,onChange:n})=>i(Cr,{value:t,onChange:n,tier:e})})}function Ql(e){return{type:"custom",render:()=>i(_r,{partKey:e})}}function _r({partKey:e}){const[t]=D("id"),[n]=D("_partStyles"),{textStyles:o}=P(),r=ro();let a=null;try{a=to().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(cn,{name:l("Text"),preview:eo(s,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??oo.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(no(t,e))}})}function st(e){const{cornerRadiusPx:t}=P(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=ne(d=>d),c=s?.props?.id?String(s.props.id):void 0;o=c?sn(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return ln(r)?r:n}function wr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=st(L);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:v(`${o}px`,l("the section")),onReset:n})}function Ir(){return i(O,{children:l("Follows the section's Corners until you set a number here.")})}function Er(){return pe({sidesKey:"cardCornerSides",useFollowed:()=>st(L),mark:i(wr,{label:J}),hint:i(Ir,{})})}function Rr(){return{type:"custom",render:()=>i(gt,{})}}function ea(e){return{...e,render:t=>i(xt,{render:e.render,props:t})}}function ta(){return{_gShape:_("Shape"),cardCorners:Er(),cardCornerSides:lt(),cardCornersApplyAll:Rr()}}function Tr(e=xo,t=e[0].value){return E({type:"custom",render:({value:n,onChange:o})=>{const r=e.find(a=>a.value===n)??e.find(a=>a.value===t)??e[0];return i(h,{label:l(ce),icon:i(Re,{}),value:l(r.label),children:i(kn,{className:"sf-gallery-layouts",label:l(ce),value:r.value,onChange:o,options:e.map(a=>({value:a.value,label:l(a.label),picture:i("span",{className:"sf-gallery-pic",children:Or(a.weights).map((s,c)=>i("i",{style:{gridColumn:`span ${s}`}},c))})}))})})}},{type:"select",label:ce,options:e.map(n=>({value:n.value,label:n.label}))})}function Or(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 na(){return W(fo,i(Xt,{}),$e,$e[0].value)}function oa(){return b("mobile",Tr(bo,go))}function ra(){return b("mobile",U(mo,i(Ht,{}),Xe,ho,1,Xe))}function ia(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>i(h,{label:l(e),icon:i(Ne,{noun:a}),action:i(y,{words:S()?.panel,label:l(e),changed:!Mo(s),detail:l("the Text style in Styles"),onReset:()=>c(Go),defaultAction:{onPress:()=>c(Ho),title:l("Keep this section's own built-in size"),icon:i(Bt,{})}}),children:X({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function la(){return{_gCellWidth:_("Cell width"),gridSpan:W("Positions",i(Re,{}),[{label:"Auto",value:""},...Array.from({length:_t},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function B(){let e=null;try{e=ne(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Pr({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const d=B()[s],f=le(void 0,d,c);return i(O,{children:X({min:e,max:t,step:n,value:le(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function Ar({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=B()[t],c=le(void 0,s,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:l("{value} on desktop",{value:`${c}${o}`}),onReset:a})}function Fr(e){return rt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Ar,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Pr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const kr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Lr={Top:Le,Bottom:Ae,Left:Fe,Right:ke},Nr=e=>{const t=Lr[e];return i(t,{})};function aa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=C=>kr[C],a=C=>U(r("Top"),i(Le,{}),I.min,I.max,I.step,C,"px"),s=(C,j,T,te=I)=>b("mobile",Fr({label:r(C),icon:Nr(C),desktopKey:j,min:te.min,max:te.max,step:te.step,fallback:T})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,x=e.sidePhone??u,g=e.phone===!0,R=C=>g?b("desktop",C):C;return K({...o?{_gSpacing:_("Padding")}:{},[t]:R(a(c)),...g?{[N(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:R(U(r("Bottom"),i(Ae,{}),I.min,I.max,I.step,d,"px")),...g?{[N(n)]:s("Bottom",n,d)}:{}},...e.sides?{[f]:R(U(r("Left"),i(Fe,{}),p.min,p.max,p.step,u,"px")),...g?{[N(f)]:s("Left",f,x,p)}:{},[m]:R(U(r("Right"),i(ke,{}),p.min,p.max,p.step,u,"px")),...g?{[N(m)]:s("Right",m,x,p)}:{}}:{}})}function sa(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&re(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 Q="Width";function ca(e,t=Ko,n=!0){const o=t.map(r=>({label:Wo[r],value:r}));return K({...n?{_gWidth:_(Q)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>i(h,{label:l(Q),icon:i(nn,{}),action:n?i(nr,{inherited:a?.inherited??!1,onReset:()=>r(Uo),label:Q}):void 0,children:de({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:Q})})}})}function da(){const e=o=>({type:"custom",render:({value:r,onChange:a})=>i(h,{label:G,icon:M(i(zt,{})),action:o?o(a):void 0,children:de({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:a,ariaLabel:G})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:a})=>{const s=a?.unit==="%"?"%":"px",c=s==="%"?uo:co;return i("div",{className:"sf-field",children:X({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:s,ariaLabel:G,onChange:r})})}}),n=()=>Vo("Unit",i(Oe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return K({_gHeight:_(G),sectionHeightMode:b("desktop",e()),sectionHeightValue:b("desktop",t()),sectionHeightUnit:b("desktop",n()),sectionHeightModePhone:b("mobile",e(o=>i(vr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:b("mobile",t()),sectionHeightUnitPhone:b("mobile",n())})}function vr({onClear:e}){const t=B(),n=io(t),o=lo(t),r=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return i(y,{words:S()?.panel,label:l(G),changed:n,detail:r,onReset:e})}function ua(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>i(Dr,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:X({min:q.min,max:q.max,step:q.step,value:typeof n=="number"?n:q.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:_(se),stickTop:b("desktop",e(!1)),stickTopDistance:b("desktop",t()),stickTopPhone:b("mobile",e(!0)),stickTopDistancePhone:b("mobile",t())}}function Dr({value:e,onChange:t,labelId:n,phone:o}){const r=B(),a=so(r),s=o?a.phone:e===!0;return i(h,{label:l(se),labelId:n,icon:M(i(Zt,{})),action:k(O,{children:[o?i(y,{words:S()?.panel,label:l(se),changed:ao(r),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,i(ie,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const ct="e.g. about";function pa(){return{_gAnchor:_("Anchor"),anchor:F({control:"plainText",label:"Name",placeholder:ct},{type:"custom",render:({value:e,onChange:t})=>i(Ft,{value:e,onChange:t,nameBox:(n,o)=>i(A,{value:n,onChange:o,label:"Name",placeholder:ct,hideable:!1,markup:!1})})})}}function fa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(h,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(An,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function ma(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return i(h,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Pn,{id:c,value:ft(typeof o=="string"?o:null),onChange:d=>r(d?pt(d):"")})})}}}function dt(e,t,n,o){return{type:"custom",...E({},{...$,label:e}),render:({value:r,onChange:a,id:s,name:c})=>{const d=typeof r=="boolean"?r:t,f=`${s??c??e}-label`;return i(h,{label:l(e),labelId:f,icon:n,hint:o===void 0?void 0:l(o),action:i(ie,{checked:d,onChange:a,ariaLabelledBy:f})})}}}function ha(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(Ge,{label:l("Background"),icon:i(qt,{}),id:r,value:on(e),onChange:t})}}}function ga(e,t){return{type:"custom",...E({},{...$,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(h,{label:l(e),htmlFor:s,className:"sf-checkbox",action:i(Rn,{id:s,checked:a,onChange:o})})}}}function ba(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(Ge,{label:l(e),icon:n,value:o||t,onChange:r})}}function xa(){return{type:"custom",render:({value:e,onChange:t})=>i(Br,{value:typeof e=="string"?e:"",onChange:t})}}function Br({value:e,onChange:t}){const{hex:n,n:o}=Gr();return i(vn,{label:l("Fill"),icon:i(Te,{}),value:e,inherited:n,resetTo:v(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function Hr(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return Z(n);const r=an(e,t);if(r.length===0)return null;const a=Z(Ze(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=Z(Ze(r[s].sectionAccent));if(c!==null)return c}return Z(r[0].sectionAccent)}function Gr(){const e=ze(P().theme),[t]=D("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=ne(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?Hr(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{hex:e.themes[o].background??je.background,n:o+1}}const Mr=[{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 Kr({label:e,value:t,onChange:n,points:o=Mr}){const r=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return i(En,{label:l(e),value:t,points:r,onChange:n})}function Sa(){return it()}const ya={top:i(Ut,{}),right:i(Wt,{}),bottom:i(Mt,{}),left:i(Kt,{})};function Ca(e,t,n,o,r,a){const s=m=>t.find(p=>p.value===m),c=m=>({value:m,label:"",disabled:!0,title:o}),d=m=>{const p=t.find(x=>x.cell===m);if(!p)return c(`missing-${m}`);const u=a?.[m];return u?{value:p.value,label:p.label,icon:u}:{value:p.value,label:p.label}},f=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:m,onChange:p})=>{const u=t.some(x=>x.value===m)?m:n;return i(h,{label:l(e),icon:r,value:s(u)?.label?l(s(u).label):"",children:Kr({label:e,value:u,onChange:p,points:f})})}}}function _a(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>i(qn,{label:e,options:(a.options??t).map(s=>({...s,label:l(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function wa(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>i(Jn,{label:e,options:(s.options??t).map(c=>({...c,label:l(c.label)})),fallback:s.fallback??n,value:r,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function Ia(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ea=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ra(e,t,n){const o=Object.keys(xe).map(r=>({label:xe[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(Wr,{label:e,icon:t,options:o,onChange:r})}}function Wr({label:e,icon:t,options:n,onChange:o}){const r=ae()?.values??{},a=mt(r),s=a==="frame"&&!!be(r.mediaVideo)&&!be(r.videoFrame);return i(h,{label:l(e),icon:M(t),hint:s?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:de({options:n,value:a,onChange:o,ariaLabel:e})})}function Ta(e,t,n,o={}){return{type:"custom",[_e]:!0,render:({value:r,onChange:a,name:s})=>i(Vn,{value:r||"",onChange:a,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const Oa={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ur(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=!!o.pending,a=r?"var(--ink-faint)":o.ok?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",s=!!jo(Xo()).geocode,c=ge(),d=(f,m)=>t({...o,[f]:m??void 0});return k(O,{children:[i(h,{label:l(n),icon:i(Pe,{}),action:s?i(V,{content:l("Find from the address (OpenStreetMap)"),children:i(Be,{"aria-label":l("Find from the address"),"aria-busy":r||void 0,disabled:r,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Qt,{})})}):void 0,children:s&&o.status?i(V,{content:Ur(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${At}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:a},children:r?l("Finding…"):l(o.status)})}):null}),i(h,{label:l("Enter by hand"),labelId:c,icon:i($t,{}),action:i(ie,{checked:!!o.manual,onChange:f=>t({...o,manual:f}),ariaLabelledBy:c})}),o.manual&&i(h,{label:l("Latitude, longitude"),icon:i(Pe,{}),children:k("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(He,{value:typeof o.lat=="number"?o.lat:null,onChange:f=>d("lat",f),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(He,{value:typeof o.lng=="number"?o.lng:null,onChange:f=>d("lng",f),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function $r(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Xr(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 Aa(e,t){return e===null?null:t>e?e:null}function jr(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 Fa={label:"Ticker items",icon:i(Vt,{})};function ka(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...et.textList,label:e}),render:({value:r,onChange:a})=>i(zr,{label:e,icon:M(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function zr({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=z(null),[c,d]=H(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=jr(n,p,c);u===null&&(s.current=null),d(u),r(f(p))};return i(bn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?i(Me,{target:s,value:$r(n,c),onChange:p=>r(Xr(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,x)=>i("input",{type:"text",className:a&&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:g=>x({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,d(u)}})})}function La(e,t){const n=`${e.label} — row ${t+1}`;return F({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(A,{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 Na(e){return{_gCards:_("Cards"),coverIndex:W("Cover image",i(Yt,{}),jn,String(zn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:dr("Image background",Ro),cardImage:qr(),spinOnHover:dt("Rotate on hover",e?.spinDefault??!0,i(Jt,{}))}}function va(){return{outline:W("Card outline",i(en,{}),Un,Xn),indexBadge:W("Card number",i(Oe,{}),Wn,$n),showBadge:dt("Product badge",!0,i(Ne,{noun:"tag"}))}}function Da(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...$,label:ee.find(a=>a.id===r).label}),o=r=>E(Dn(fe),n(r));return{_gShowOnCard:_("Show on a card"),[fe]:E({type:"custom",render:()=>i(Yr,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(fe)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const fe="showCardPrice",ee=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Yr({rest:e}){const t=B(),n=ur(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=ee.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(me,{parts:ee,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(ee.map(({id:s})=>[s,void 0])))})}function Ba(e,t="display"){const n=N(t);return{[t]:b("desktop",{type:"custom",render:({value:o,onChange:r})=>i(me,{parts:e,changed:Sn(o),shown:a=>yn(o,a),onPress:(a,s)=>r(wn(o,a,s)),onReset:()=>r(void 0)})}),[n]:b("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Vr,{parts:e,desktopKey:t,value:o,onChange:r})})}}function me({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a}){const s=l("Display");return i(h,{label:s,icon:i(Lt,{}),changed:t,action:i(y,{words:S()?.panel,label:s,changed:t,detail:a,onReset:r}),children:i(xn,{label:s,items:e.map(c=>({id:c.id,label:l(c.label),shown:n(c.id)})),onChange:o})})}function Vr({parts:e,desktopKey:t,value:n,onChange:o}){const r=B()[t];return i(me,{parts:e,changed:_n(n),shown:a=>Cn(r,n,a),onPress:(a,s)=>o(In(n,a,s)),onReset:()=>o(Mn),detail:l("the same as Desktop")})}function qr(){return rt("Card image",{min:L,max:Ie,step:St,hint:"Rounds the picture. The card's own corner is in Styles."})}function Ha(){return pe({sidesKey:"cornerSides",step:yt,useFollowed:()=>L,mark:i(Zr,{label:Ct}),hint:l("Rounds the picture. Left alone it stays square.")})}function Zr({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function Ga(){return{type:"custom",render:({value:e,onChange:t})=>i(ti,{value:typeof e=="string"?e:"",onChange:t})}}function Jr({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:Et(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const Qr={width:"3.5rem",height:"2.5rem"},ei=200;function ti({value:e,onChange:t}){const[n,o]=H(null),[r,a]=H(4),s=z(null);ut(()=>{const u=s.current;if(!u||typeof ResizeObserver!="function")return;const x=()=>a(u.getBoundingClientRect().width>=ei?4:3);x();const g=new ResizeObserver(x);return g.observe(u),()=>g.disconnect()},[]);const c=e&&e in Y?e:"",d=Ee(n,c),f=Ee(n,"").length,m=Rt("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:m},...d.map(u=>({value:u,label:l(Y[u].label),icon:i(Jr,{layout:Y[u],width:40})}))];return i(h,{label:l("Layout"),icon:i(jt,{}),value:c?l(Y[c].label):l("Not chosen"),children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(Ln,{label:l("Layout"),value:c,emptyValue:"",options:p,onChange:t,columns:r,cell:Qr,header:k("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(pn,{options:[{id:"all",label:l("All")},...wt.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:It.length})})]})})})})}export{rr as BOUND_TO_POST,kl as BOUND_TO_POST_NOTE,Ml as BUCKET_ICONS,Oa as CUSTOM_FIELD_MEDIA,Pa as CoordsField,er as DESKTOP_GAP_NOT_OVERLAP,ya as EDGE_ARROWS,Fn as FOCAL_DEFAULT,Mr as FOCAL_POINTS,oe as FOLD_FIELD_MARKER,Kr as FocalPicker,Vl as GroupLabel,ir as HIGHLIGHT_HINT,A as HidableTextField,Ce as LINK_FIELD_MARKER,Cl as Label,_e as MEDIA_FIELD_MARKER,Ea as MEDIA_TYPE_OPTIONS,Ll as NOT_BOUND_TO_POST,Yl as PanelBand,sr as PanelNoteLine,we as SCAFFOLD_FIELD_MARKER,Ua as SCALAR_TEXT_CONTROLS,Zo as SiteGapDefaultReset,X as Slider,ot as Swatches,Wa as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,Fa as TICKER_ITEMS_ROW,zr as TextListField,Q as WIDTH_LABEL,nr as WidthDefaultReset,jr as aimAfterListChange,pa as anchorFields,v as backTo,ql as backgroundField,na as boxBlockSpacingField,xa as boxFillField,ra as boxPhoneRowField,Tr as boxShareField,oa as boxSharePhoneField,Hr as boxThemeIndexOf,$l as bucketHeader,Ql as buttonWordsEntryField,Er as cardCornersField,dr as cardImageBackgroundField,qr as cardImageField,Na as cardMediaFields,ta as cardShapeFields,Da as cardShowFields,va as cardStyleFields,la as cellWidthFields,ga as checkbox,ba as colorInput,wl as containerDirectionField,Jo as containerGapField,Qo as containerGapPhoneField,_l as containerGapRows,Ur as coordsResultTip,Bl as copyText,lt as cornerSidesField,pe as cornersRowField,ma as date,fa as dateTime,Xl as designGroupHeader,Ba as displayFields,Ca as edgePad,Kl as entriesHiddenForTab,Aa as focusAfterRemove,Sa as focusKeptField,jl as foldMarker,re as foldMetaOf,cr as foldTitleOf,Ga as galleryLayoutField,da as heightFields,Il as heroGroupPlacementPoints,ye as hidableText,ar as hintIsWhileTyping,Ha as imageCornersField,Fl as inOwnBox,Ul as isBucketHeader,it as keptBy,Hl as linkField,Ra as loadingShowsField,_a as multiSelect,ha as pageBackgroundField,Wl as panelNote,Fr as phoneOverrideField,Dl as plainText,Gl as plainTextarea,rt as pxField,zl as quietMarker,Se as readHidable,$r as rowText,wa as searchSelect,at as sectionBorderField,hr as sectionCornersField,Jl as sectionShapeFields,Zl as sectionThemeFields,Xr as setRowText,ia as sizeField,Ia as sourceField,aa as spacingFields,ua as stickFields,sa as swapPadding,ea as templateField,Nl as text,ht as textFieldIdentifier,Tl as textFieldOffPage,Pl as textFieldPanelOnly,ka as textList,La as textListRowField,vl as textarea,dt as toggle,Ta as upload,ur as useSelectedPatch,B as useSelectedProps,D as useSelectedSibling,qo as useSiteGapDetail,ca as widthField,Al as withIdentifier,Rl as withOffPage,Ol as withPanelOnly,El as withScaffold};
1
+ "use client";import{jsx as i,jsxs as k,Fragment as T}from"react/jsx-runtime";import{cloneElement as ge,useEffect as mt,useId as be,useRef as z,useState as G}from"react";import{useEasel as ne}from"efficient-easel/easel";import{toDateKey as ht,fromDateKey as gt}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{mediaValueSrc as xe}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as Se,loadingShowsOf as bt}from"../../../format/lib/hero-video.js";import{readHidable as ye,hidableText as _e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as oe,LINK_FIELD_MARKER as Ce,MEDIA_FIELD_MARKER as we,SCAFFOLD_FIELD_MARKER as Ie,TEXT_FIELD_MARKER as w,foldMetaOf as re,textFieldIdentifier as xt}from"efficient-easel/draw";import St from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as yt}from"../../../render/lib/document/show-when.js";import _t from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Ct,CORNER_RADIUS_MAX as Re,CORNER_RADIUS_MIN as L}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as wt,IMAGE_CORNERS_LABEL as It}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Rt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Et,GALLERY_LAYOUTS as Y,GALLERY_LAYOUT_KEYS as Ot,galleryChoices as Ee,galleryPictureCells as Tt}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Pt}from"./shell-glyph.js";import{anchorSiblingsOf as At,placementPoints as Ft}from"../../../format/lib/hero-group-placement.js";import kt,{KEEP_HINT_CLASS as Lt}from"../../components/KeepHint.js";import Nt from"../../components/AnchorField.js";import{AdjustIcon as vt,EyeIcon as Bt,AnimationIcon as Dt,BackgroundIcon as Ht,BorderAllIcon as Gt,BlockSectionIcon as Mt,ColumnWidthsIcon as Oe,ColumnsIcon as Te,CornerIcon as Kt,DirectionDownIcon as Wt,DirectionLeftIcon as Ut,DirectionRightIcon as $t,DirectionUpIcon as Xt,EditIcon as jt,GapIcon as zt,GridIcon as Yt,GroundIcon as Pe,HashIcon as Ae,HeightIcon as Vt,ImageIcon as qt,ListIcon as Zt,LocationIcon as Fe,PaddingBottomIcon as ke,PaddingLeftIcon as Le,PaddingRightIcon as Ne,PaddingTopIcon as ve,PageIcon as Jt,StickyIcon as Qt,RotateIcon as en,SearchIcon as tn,SquareIcon as nn,TypeIcon as on,WidthIcon as rn}from"efficient-easel/icons";import{FieldGlyph as Be}from"../../components/FieldGlyph.js";import{resolvePageBackground as ln}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as De,CORNER_SIDE_POINTS as an,hasOwnSectionCorners as sn,normalizeCornerSides as He}from"../../../format/lib/content/section-corners.js";import{enclosingPath as cn,enclosingSection as dn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as un,SettingsField as h,SettingsGroup as pn,SettingsGroupSub as fn,SettingsSegmented as mn,SettingsBorder as hn,SettingsSidesEach as gn,SettingsSwitch as ie,borderSides as bn,borderStartEach as xn}from"efficient-easel/panel";import{ListField as Sn}from"efficient-easel/fields";import{DisplayChips as yn}from"efficient-shell/ui";import{desktopDisplayChanged as _n,partShownOnDesktop as Cn,partShownOnPhone as wn,phoneDisplayChanged as In,withDesktopPart as Rn,withPhonePart as En}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as On,Checkbox as Tn,ColorSwatch as Pn,CornersInput as An,DatePicker as Fn,DateTimePicker as kn,FOCAL_DEFAULT as Ln,PictureTiles as Nn,IconPicker as vn,IconButton as Ge,InputNumber as Me,Slider as Bn,Tooltip as V}from"efficient-shell/ui";import{ColourRow as Ke,InheritedColourRow as Dn}from"./ColourControl.js";import{keptByRow as Hn}from"efficient-easel/screen/lib/document/style-fields";import We from"./MarkupToolbar.js";import{deviceField as b}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Gn,NoControlMark as Mn,noControlField as Ue}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Kn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Wn,resolvePhoneValue as le}from"../../../format/lib/document/phone-override.js";import{phoneKey as N}from"efficient-easel/draw";import{SuppressibleText as Un}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as $n,CARD_OUTLINE_OPTIONS as Xn,DEFAULT_CARD_INDEX_FORMAT as jn,DEFAULT_CARD_OUTLINE as zn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Yn,DEFAULT_COVER_INDEX as Vn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as qn}from"efficient-easel/draw";import Zn from"../../components/MediaUploadField.js";import{useSelectedHost as ae}from"./selected-host.js";import Jn from"../../components/MultiSelectField.js";import Qn from"../../components/SectionThemePicker.js";import eo from"../../components/SearchSelectField.js";import to from"../../components/StorefrontLinkField.js";import{UiIcon as $e}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as no}from"../../../render/lib/content/button-look.js";import{usePreviewParts as oo}from"efficient-easel/draw/client";import{encodePartId as ro}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as io,useEaselStrings as lo}from"efficient-easel/strings";import{hasPhoneHeight as ao,resolveSectionMinHeight as so}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as q,SECTION_STICK_LABEL as se,hasPhoneStick as co,resolveSectionStick as uo}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as po,SECTION_MIN_HEIGHT_GROUP_LABEL as M,SECTION_SCREEN_PCT as fo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as mo,resolveContainerDirection as Xe}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as ho,BOX_BLOCK_SPACING_POINTS as je,BOX_PHONE_ROW_LABEL as ze,BOX_COLUMNS_MAX as go,BOX_COLUMNS_MIN as Ye,BOX_PHONE_ROW_MAX as bo,BOX_PHONE_ROW_MIN as ce,BOX_SHARE_LABEL as de,BOX_SHARE_PHONE_DEFAULT as xo,BOX_SHARE_PHONE_POINTS as So,BOX_SHARE_POINTS as yo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as P}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as _o}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Ve,normalizeTheme as qe}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ze,CONTAINER_GAP_BUILT_IN as Co,CONTAINER_GAP_PHONE as wo,GAP_FIELD_CONTAINER as Je,followsSitePhoneGap as Io,hasOwnContainerGap as Ro,hasOwnPhoneGap as Eo,resolveContainerGap as Oo,resolvePhoneContainerGap as Qe}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as To,CARD_IMAGE_BG_OFF as Po,CARD_IMAGE_BG_SWATCH_NAMES as Ao,CARD_IMAGE_BG_SWATCHES as Fo,isCardImageBackgroundInheriting as ko,cardImageBackgroundChoice as Lo,THEME_CARD_IMAGE_BG as No}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as vo,SECTION_BG_SWATCHES as Bo,SECTION_BG_SWATCH_NAMES as Do,THEME_SECTION_BG as Ho,isSectionBackgroundInheriting as Go}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Mo,nestedAccentValue as et,resolveSectionAccent as Z}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Ko,TYPE_SIZE_INHERIT as Wo,isTypeSizeInheriting as Uo}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as $o,WIDTH_CHOICE_LABEL as Xo,WIDTH_INHERIT as jo}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as zo}from"./panel-heading-scope.js";import{useEaselSession as Yo}from"efficient-easel/screen/lib/session-context";import{backendOf as Vo}from"../website-session.js";import{BOX_GAP as qo,describedAs as R,group as C,iconOf as K,sharedStyleKinds as W}from"efficient-easel/screen/lib/document/box-fields";import{phoneTwinFields as Zo}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Jo,gapField as tt,Segmented as ue,segmented as Qo,select as U,slider as v}from"./box-fields.js";function Tl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function B(e,t){return l("{value} from {from}",{value:e,from:t})}function er(){const{blockGap:e}=P();return e===null?l("this container's own spacing"):B(`${e}px`,l("Styles"))}function tr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:er(),onReset:t})}function nr(e){return tt({...qo,builtIn:Co[e],resolve:(t,n)=>Oo(e,t,n?.siteGap),action:(t,n)=>i(tr,{inherited:!Ro(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Je]:e}})}function or(e){return yt(b("mobile",{[Je]:e,type:"custom",render:t=>i(ir,{container:e,...t})}),rr)}const rr={not:{field:"gap",in:Array.from({length:-Ze.min},(e,t)=>Ze.min+t)}};function Pl(e){return{gap:b("desktop",nr(e)),[N("gap")]:or(e)}}function ir({container:e,...t}){const[n]=D("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},a=Qe(e,void 0,n,o,r);return tt({...wo,builtIn:a,resolve:c=>Qe(e,c,n,o,r),action:(c,d)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Eo(c),detail:B(`${a}px`,Io(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Al(e){return Jo({offered:mo(e),fallback:Xe(e,void 0),resolve:t=>Xe(e,t)})}function Fl(e,t){return Ft(t?At(e,t):[],t)}function lr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:B(l("Full"),l("the page")),onReset:t})}function A({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:d,hidden:f}=ye(e),m=z(null),p=z(null),u=O=>t(s?{text:O,hidden:f}:O),x=()=>t({text:d,hidden:!f}),g=s&&f,E=be(),_=r?ur(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(kt,{children:l(r)}):void 0,j=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(h,{label:l(n),icon:i(on,{}),htmlFor:E,className:g?"is-hidden":void 0,hint:_,action:s?i(V,{content:j,children:i(Ge,{"aria-pressed":f,"aria-label":j,onClick:x,children:f?i($e,{name:"eye-off",size:14}):i($e,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[c&&i(We,{target:a?p:m,value:d,onChange:u}),a?i("textarea",{id:E,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>u(O.target.value)}):i("input",{id:E,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>u(O.target.value)})]})})}function kl(e,t){return{...e,[Ie]:t}}function Ll(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function Nl(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const nt="sfPanelOnly";function vl(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[nt]:!0}}function Bl(e){return!!e&&typeof e=="object"&&e[nt]===!0}function Dl(e){const t=e[w];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[w]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Va,SCALAR_TEXT_CONTROLS as qa}from"efficient-easel/draw";function Hl(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[Gn]:o,...r}=e;return{...r,[Kn]:!0,render:t}}const ar=new Set(qn),$={type:"radio",options:[{value:!0},{value:!1}]},ot={text:{type:"object",objectFields:{text:{type:"text"},hidden:$}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:$}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},F=(e,t)=>{const n=R({...t,[w]:e},{...ot[e.control],label:e.label});if(!ar.has(e.control))return n;const o=t.render;return{...Ue(n,"authored-copy"),render:r=>i(Un,{name:r.name,children:o(r)})}},Gl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",sr={field:"source.slug",set:!0},Ml={not:sr},cr="Select a word, then press the highlighter.",dr=new Set([cr]),ur=e=>dr.has(e);function Kl(e,t,n){return F({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Wl(e,t,n){return F({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ul(e,t,n){return F({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function $l(e,t,n){return F({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Xl(e){return{type:"custom",[Ce]:{label:e},...R({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(to,{value:_e(t),onChange:n,label:e})}}function jl(e,t,n){return F({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const zl={Design:vt,Animation:Dt};function Yl(e,t){return e.includes("Design")?t!=="Design":null}function Vl(e){return{type:"custom",render:()=>i(pr,{text:e})}}function pr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function ql(e){return re(e)!==null&&e?.tabs!==void 0}const rt=new Map;function Zl(e,t){const n=`${e}\0${t?t.join(""):""}`,o=rt.get(n)??{type:"custom",tabs:t,[oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(T,{})};return rt.set(n,o),o}const it=new Map;function Jl(e){const t=it.get(e)??{type:"custom",[oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(T,{})};return it.set(e,t),t}function fr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ql(e,t){return fr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(T,{})}}function ea(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(T,{})}}function ta({title:e,children:t}){const[n,o]=G(()=>!pe.has(e));return i(pn,{title:e,open:n,onToggle:r=>{o(r),r?pe.delete(e):pe.add(e)},children:t})}const pe=new Set;function na({label:e}){return i(fn,{title:l(e),level:zo(2)})}function lt({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?l(a):t;return k("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(V,{content:d,children:i(Pn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function oa(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=Go(n,t);return i(h,{label:l(e),icon:i(Ht,{}),changed:!r,action:i(y,{words:S()?.panel,label:l(e),changed:!r,detail:l("the theme's section background"),onReset:()=>o(vo)}),children:lt({swatches:Bo,current:r?Ho:n??t??"",onPick:o,names:Do})})}}}function mr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=ko(r,t);return i(h,{label:l(e),icon:i(Pe,{}),changed:!a,action:i(y,{words:S()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(To)}),children:lt({swatches:Fo,current:a?No:Lo(r,t),onPick:o,names:Ao})})}}}function ra(e=n=>n,t){return W({_gSectionTheme:C(Mo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Qn,{value:e(n),onChange:o,followLabel:t})}})}function X({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:d,disabled:f=!1}){const m=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:m?"sf-slider has-notch":"sf-slider",style:m?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Bn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:s,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&r(p)}})})}function at(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const x=typeof p=="number"?p:null,g=x===null;return i(h,{label:l(e),icon:f?K(f):void 0,value:g?d||a===void 0?void 0:l(a):`${x}${m}`,changed:!g,action:d?ge(d,{changed:!g,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:l(e),changed:!g,onReset:()=>u(null)}),hint:typeof s=="string"?l(s):s,children:c?c({min:n,max:o,step:r,px:x,label:e,onChange:u}):X({min:n,max:o,step:r,value:x??n,readout:!1,ariaLabel:e,onChange:u})})}}}const J="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(h,{label:l(J),icon:i(Kt,{}),changed:r,action:ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(gr,{tier:e,px:o,onRadius:n})})}}}function D(e){const t=ae();return[t?.values?.[e],n=>t?.onChange(e,n)]}function st(){return Ue({type:"custom",render:()=>i(Mn,{})},"always")}function hr(){const e=ae();return t=>e?.onChangeMany(t)}function gr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=D(e.sidesKey),s=He(r)??[...De];return i(An,{label:l(J),value:s,corners:an,onChange:c=>{const d=He(c)??[];a(d.length===De.length?null:d)},radius:t,onRadiusChange:n,radiusMin:L,radiusMax:Re,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function ct(){return st()}function br({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=P(),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"):B(r,l("Styles")),onReset:n})}function xr(){const{cornerRadiusPx:e}=P();return typeof e=="number"?e:L}function Sr(){return fe({sidesKey:"sectionCornerSides",useFollowed:xr,mark:i(br,{label:J}),hint:yr})}const yr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function ia(){return W({_gShape:C("Shape"),sectionCorners:Sr(),sectionCornerSides:ct(),sectionBorder:dt("desktop"),sectionBorderPhone:dt("mobile")})}const _r=()=>({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 Cr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function wr(){let e;try{const t=qe(P().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Ve.line}function Ir({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:a=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[d,f]=G(()=>r?xn(c,s):!1),m=_r(),p=u=>Cr(r&&a?u:{width:u.width,color:u.color,...a?{style:u.style}:{}});return i(h,{label:l("Border"),icon:i(Gt,{}),action:r?i(gn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(hn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:a,max:_o})})}function Rr({value:e,onChange:t,tier:n}){const[o]=D("sectionBorder"),r=wr(),a=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(Ir,{value:e,onChange:t,placeholder:{sides:bn(a),style:a.style??"solid",color:a.color||r},presets:[r],above:a})}function dt(e){return b(e,{type:"custom",render:({value:t,onChange:n})=>i(Rr,{value:t,onChange:n,tier:e})})}function la(e){return{type:"custom",render:()=>i(Er,{partKey:e})}}function Er({partKey:e}){const[t]=D("id"),[n]=D("_partStyles"),{textStyles:o}=P(),r=lo();let a=null;try{a=oo().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(un,{name:l("Text"),preview:no(s,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??io.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(ro(t,e))}})}function ut(e){const{cornerRadiusPx:t}=P(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=ne(d=>d),c=s?.props?.id?String(s.props.id):void 0;o=c?dn(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return sn(r)?r:n}function Or({label:e,changed:t=!1,onReset:n=()=>{}}){const o=ut(L);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:B(`${o}px`,l("the section")),onReset:n})}function Tr(){return i(T,{children:l("Follows the section's Corners until you set a number here.")})}function Pr(){return fe({sidesKey:"cardCornerSides",useFollowed:()=>ut(L),mark:i(Or,{label:J}),hint:i(Tr,{})})}function Ar(){return{type:"custom",render:()=>i(St,{})}}function aa(e){return{...e,render:t=>i(_t,{render:e.render,props:t})}}function sa(){return{_gShape:C("Shape"),cardCorners:Pr(),cardCornerSides:ct(),cardCornersApplyAll:Ar()}}function Fr(e=yo,t=e[0].value){return R({type:"custom",render:({value:n,onChange:o})=>{const r=e.find(a=>a.value===n)??e.find(a=>a.value===t)??e[0];return i(h,{label:l(de),icon:i(Oe,{}),value:l(r.label),children:i(Nn,{className:"sf-gallery-layouts",label:l(de),value:r.value,onChange:o,options:e.map(a=>({value:a.value,label:l(a.label),picture:i("span",{className:"sf-gallery-pic",children:kr(a.weights).map((s,c)=>i("i",{style:{gridColumn:`span ${s}`}},c))})}))})})}},{type:"select",label:de,options:e.map(n=>({value:n.value,label:n.label}))})}function kr(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function ca(){return U(ho,i(zt,{}),je,je[0].value)}function da(){return b("mobile",Fr(So,xo))}function Lr(){return b("mobile",v(ze,i(Te,{}),ce,bo,1,ce,"",{clear:{phoneFollows:!1,hint:ce}}))}const Nr={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function ua(){return Zo("columns",v(ze,i(Te,{}),Ye,go,1,Ye,"",{clear:{emptyLabel:"Auto"}}),Nr,{phoneRow:Lr()})}function pa(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>i(h,{label:l(e),icon:i(Be,{noun:a}),action:i(y,{words:S()?.panel,label:l(e),changed:!Uo(s),detail:l("the Text style in Styles"),onReset:()=>c(Wo),defaultAction:{onPress:()=>c(Ko),title:l("Keep this section's own built-in size"),icon:i(Mt,{})}}),children:X({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function fa(){return{_gCellWidth:C("Cell width"),gridSpan:U("Positions",i(Oe,{}),[{label:"Auto",value:""},...Array.from({length:Rt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function H(){let e=null;try{e=ne(t=>t).selectedItem}catch{e=null}return e?.props??{}}function vr({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const d=H()[s],f=le(void 0,d,c);return i(T,{children:X({min:e,max:t,step:n,value:le(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function Br({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=H()[t],c=le(void 0,s,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:l("{value} on desktop",{value:`${c}${o}`}),onReset:a})}function Dr(e){return at(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Br,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(vr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Hr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Gr={Top:ve,Bottom:ke,Left:Le,Right:Ne},Mr=e=>{const t=Gr[e];return i(t,{})};function ma(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=_=>Hr[_],a=_=>v(r("Top"),i(ve,{}),I.min,I.max,I.step,_,"px"),s=(_,j,O,te=I)=>b("mobile",Dr({label:r(_),icon:Mr(_),desktopKey:j,min:te.min,max:te.max,step:te.step,fallback:O})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,x=e.sidePhone??u,g=e.phone===!0,E=_=>g?b("desktop",_):_;return W({...o?{_gSpacing:C("Padding")}:{},[t]:E(a(c)),...g?{[N(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:E(v(r("Bottom"),i(ke,{}),I.min,I.max,I.step,d,"px")),...g?{[N(n)]:s("Bottom",n,d)}:{}},...e.sides?{[f]:E(v(r("Left"),i(Le,{}),p.min,p.max,p.step,u,"px")),...g?{[N(f)]:s("Left",f,x,p)}:{},[m]:E(v(r("Right"),i(Ne,{}),p.min,p.max,p.step,u,"px")),...g?{[N(m)]:s("Right",m,x,p)}:{}}:{}})}function ha(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&re(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 Q="Width";function ga(e,t=$o,n=!0){const o=t.map(r=>({label:Xo[r],value:r}));return W({...n?{_gWidth:C(Q)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>i(h,{label:l(Q),icon:i(rn,{}),action:n?i(lr,{inherited:a?.inherited??!1,onReset:()=>r(jo),label:Q}):void 0,children:ue({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:Q})})}})}function ba(){const e=o=>({type:"custom",render:({value:r,onChange:a})=>i(h,{label:M,icon:K(i(Vt,{})),action:o?o(a):void 0,children:ue({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:a,ariaLabel:M})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:a})=>{const s=a?.unit==="%"?"%":"px",c=s==="%"?fo:po;return i("div",{className:"sf-field",children:X({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:s,ariaLabel:M,onChange:r})})}}),n=()=>Qo("Unit",i(Ae,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return W({_gHeight:C(M),sectionHeightMode:b("desktop",e()),sectionHeightValue:b("desktop",t()),sectionHeightUnit:b("desktop",n()),sectionHeightModePhone:b("mobile",e(o=>i(Kr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:b("mobile",t()),sectionHeightUnitPhone:b("mobile",n())})}function Kr({onClear:e}){const t=H(),n=ao(t),o=so(t),r=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return i(y,{words:S()?.panel,label:l(M),changed:n,detail:r,onReset:e})}function xa(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>i(Wr,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:X({min:q.min,max:q.max,step:q.step,value:typeof n=="number"?n:q.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:C(se),stickTop:b("desktop",e(!1)),stickTopDistance:b("desktop",t()),stickTopPhone:b("mobile",e(!0)),stickTopDistancePhone:b("mobile",t())}}function Wr({value:e,onChange:t,labelId:n,phone:o}){const r=H(),a=uo(r),s=o?a.phone:e===!0;return i(h,{label:l(se),labelId:n,icon:K(i(Qt,{})),action:k(T,{children:[o?i(y,{words:S()?.panel,label:l(se),changed:co(r),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,i(ie,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const pt="e.g. about";function Sa(){return{_gAnchor:C("Anchor"),anchor:F({control:"plainText",label:"Name",placeholder:pt},{type:"custom",render:({value:e,onChange:t})=>i(Nt,{value:e,onChange:t,nameBox:(n,o)=>i(A,{value:n,onChange:o,label:"Name",placeholder:pt,hideable:!1,markup:!1})})})}}function ya(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(h,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(kn,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function _a(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return i(h,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Fn,{id:c,value:gt(typeof o=="string"?o:null),onChange:d=>r(d?ht(d):"")})})}}}function ft(e,t,n,o){return{type:"custom",...R({},{...$,label:e}),render:({value:r,onChange:a,id:s,name:c})=>{const d=typeof r=="boolean"?r:t,f=`${s??c??e}-label`;return i(h,{label:l(e),labelId:f,icon:n,hint:o===void 0?void 0:l(o),action:i(ie,{checked:d,onChange:a,ariaLabelledBy:f})})}}}function Ca(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(Ke,{label:l("Background"),icon:i(Jt,{}),id:r,value:ln(e),onChange:t})}}}function wa(e,t){return{type:"custom",...R({},{...$,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(h,{label:l(e),htmlFor:s,className:"sf-checkbox",action:i(Tn,{id:s,checked:a,onChange:o})})}}}function Ia(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(Ke,{label:l(e),icon:n,value:o||t,onChange:r})}}function Ra(){return{type:"custom",render:({value:e,onChange:t})=>i(Ur,{value:typeof e=="string"?e:"",onChange:t})}}function Ur({value:e,onChange:t}){const{hex:n,n:o}=Xr();return i(Dn,{label:l("Fill"),icon:i(Pe,{}),value:e,inherited:n,resetTo:B(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function $r(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return Z(n);const r=cn(e,t);if(r.length===0)return null;const a=Z(et(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=Z(et(r[s].sectionAccent));if(c!==null)return c}return Z(r[0].sectionAccent)}function Xr(){const e=qe(P().theme),[t]=D("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=ne(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?$r(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{hex:e.themes[o].background??Ve.background,n:o+1}}const jr=[{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 zr({label:e,value:t,onChange:n,points:o=jr}){const r=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return i(On,{label:l(e),value:t,points:r,onChange:n})}function Ea(){return st()}const Oa={top:i(Xt,{}),right:i($t,{}),bottom:i(Wt,{}),left:i(Ut,{})};function Ta(e,t,n,o,r,a){const s=m=>t.find(p=>p.value===m),c=m=>({value:m,label:"",disabled:!0,title:o}),d=m=>{const p=t.find(x=>x.cell===m);if(!p)return c(`missing-${m}`);const u=a?.[m];return u?{value:p.value,label:p.label,icon:u}:{value:p.value,label:p.label}},f=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:m,onChange:p})=>{const u=t.some(x=>x.value===m)?m:n;return i(h,{label:l(e),icon:r,value:s(u)?.label?l(s(u).label):"",children:zr({label:e,value:u,onChange:p,points:f})})}}}function Pa(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>i(Jn,{label:e,options:(a.options??t).map(s=>({...s,label:l(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Aa(e,t,n,o){return{type:"custom",options:t,fallback:n,...R({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>i(eo,{label:e,options:(s.options??t).map(c=>({...c,label:l(c.label)})),fallback:s.fallback??n,value:r,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function Fa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const ka=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function La(e,t,n){const o=Object.keys(Se).map(r=>({label:Se[r],value:r,picture:n[r]}));return{type:"custom",...R({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Yr,{label:e,icon:t,options:o,onChange:r})}}function Yr({label:e,icon:t,options:n,onChange:o}){const r=ae()?.values??{},a=bt(r),s=a==="frame"&&!!xe(r.mediaVideo)&&!xe(r.videoFrame);return i(h,{label:l(e),icon:K(t),hint:s?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:ue({options:n,value:a,onChange:o,ariaLabel:e})})}function Na(e,t,n,o={}){return{type:"custom",[we]:!0,render:({value:r,onChange:a,name:s})=>i(Zn,{value:r||"",onChange:a,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const va={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Vr(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 Ba({value:e,onChange:t,label:n}){const o=e||{},r=!!o.pending,a=r?"var(--ink-faint)":o.ok?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",s=!!Vo(Yo()).geocode,c=be(),d=(f,m)=>t({...o,[f]:m??void 0});return k(T,{children:[i(h,{label:l(n),icon:i(Fe,{}),action:s?i(V,{content:l("Find from the address (OpenStreetMap)"),children:i(Ge,{"aria-label":l("Find from the address"),"aria-busy":r||void 0,disabled:r,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(tn,{})})}):void 0,children:s&&o.status?i(V,{content:Vr(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${Lt}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:a},children:r?l("Finding…"):l(o.status)})}):null}),i(h,{label:l("Enter by hand"),labelId:c,icon:i(jt,{}),action:i(ie,{checked:!!o.manual,onChange:f=>t({...o,manual:f}),ariaLabelledBy:c})}),o.manual&&i(h,{label:l("Latitude, longitude"),icon:i(Fe,{}),children:k("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Me,{value:typeof o.lat=="number"?o.lat:null,onChange:f=>d("lat",f),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(Me,{value:typeof o.lng=="number"?o.lng:null,onChange:f=>d("lng",f),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function qr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Zr(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 Da(e,t){return e===null?null:t>e?e:null}function Jr(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 Ha={label:"Ticker items",icon:i(Zt,{})};function Ga(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...R({},{...ot.textList,label:e}),render:({value:r,onChange:a})=>i(Qr,{label:e,icon:K(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Qr({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=z(null),[c,d]=G(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=Jr(n,p,c);u===null&&(s.current=null),d(u),r(f(p))};return i(Sn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?i(We,{target:s,value:qr(n,c),onChange:p=>r(Zr(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,x)=>i("input",{type:"text",className:a&&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:g=>x({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,d(u)}})})}function Ma(e,t){const n=`${e.label} — row ${t+1}`;return F({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ka(e){return{_gCards:C("Cards"),coverIndex:U("Cover image",i(qt,{}),Yn,String(Vn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:mr("Image background",Po),cardImage:ni(),spinOnHover:ft("Rotate on hover",e?.spinDefault??!0,i(en,{}))}}function Wa(){return{outline:U("Card outline",i(nn,{}),Xn,zn),indexBadge:U("Card number",i(Ae,{}),$n,jn),showBadge:ft("Product badge",!0,i(Be,{noun:"tag"}))}}function Ua(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...$,label:ee.find(a=>a.id===r).label}),o=r=>R(Hn(me),n(r));return{_gShowOnCard:C("Show on a card"),[me]:R({type:"custom",render:()=>i(ei,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(me)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const me="showCardPrice",ee=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function ei({rest:e}){const t=H(),n=hr(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=ee.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(he,{parts:ee,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(ee.map(({id:s})=>[s,void 0])))})}function $a(e,t="display"){const n=N(t);return{[t]:b("desktop",{type:"custom",render:({value:o,onChange:r})=>i(he,{parts:e,changed:_n(o),shown:a=>Cn(o,a),onPress:(a,s)=>r(Rn(o,a,s)),onReset:()=>r(void 0)})}),[n]:b("mobile",{type:"custom",render:({value:o,onChange:r})=>i(ti,{parts:e,desktopKey:t,value:o,onChange:r})})}}function he({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a,disabledReason:s}){const c=l("Display");return i(h,{label:c,icon:i(Bt,{}),changed:t,action:i(y,{words:S()?.panel,label:c,changed:t,detail:a,onReset:r}),children:i(yn,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...s?{disabled:!0,disabledReason:l(s)}:{}})),onChange:o})})}function ti({parts:e,desktopKey:t,value:n,onChange:o}){const r=H()[t];return i(he,{parts:e,changed:In(n),shown:a=>wn(r,n,a),onPress:(a,s)=>o(En(n,a,s)),onReset:()=>o(Wn),detail:l("the same as Desktop")})}function ni(){return at("Card image",{min:L,max:Re,step:Ct,hint:"Rounds the picture. The card's own corner is in Styles."})}function Xa(){return fe({sidesKey:"cornerSides",step:wt,useFollowed:()=>L,mark:i(oi,{label:It}),hint:l("Rounds the picture. Left alone it stays square.")})}function oi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function ja(){return{type:"custom",render:({value:e,onChange:t})=>i(ai,{value:typeof e=="string"?e:"",onChange:t})}}function ri({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:Tt(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const ii={width:"3.5rem",height:"2.5rem"},li=200;function ai({value:e,onChange:t}){const[n,o]=G(null),[r,a]=G(4),s=z(null);mt(()=>{const u=s.current;if(!u||typeof ResizeObserver!="function")return;const x=()=>a(u.getBoundingClientRect().width>=li?4:3);x();const g=new ResizeObserver(x);return g.observe(u),()=>g.disconnect()},[]);const c=e&&e in Y?e:"",d=Ee(n,c),f=Ee(n,"").length,m=Pt("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:m},...d.map(u=>({value:u,label:l(Y[u].label),icon:i(ri,{layout:Y[u],width:40})}))];return i(h,{label:l("Layout"),icon:i(Yt,{}),value:c?l(Y[c].label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(vn,{label:l("Layout"),value:c,emptyValue:"",options:p,onChange:t,columns:r,cell:ii,header:k("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(mn,{options:[{id:"all",label:l("All")},...Et.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:Ot.length})})]})})})})}export{sr as BOUND_TO_POST,Gl as BOUND_TO_POST_NOTE,zl as BUCKET_ICONS,va as CUSTOM_FIELD_MEDIA,Ba as CoordsField,rr as DESKTOP_GAP_NOT_OVERLAP,he as DisplayRow,Oa as EDGE_ARROWS,Ln as FOCAL_DEFAULT,jr as FOCAL_POINTS,oe as FOLD_FIELD_MARKER,zr as FocalPicker,na as GroupLabel,cr as HIGHLIGHT_HINT,A as HidableTextField,Ce as LINK_FIELD_MARKER,Tl as Label,we as MEDIA_FIELD_MARKER,ka as MEDIA_TYPE_OPTIONS,Ml as NOT_BOUND_TO_POST,ta as PanelBand,pr as PanelNoteLine,Ie as SCAFFOLD_FIELD_MARKER,qa as SCALAR_TEXT_CONTROLS,tr as SiteGapDefaultReset,X as Slider,lt as Swatches,Va as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,Ha as TICKER_ITEMS_ROW,Qr as TextListField,Q as WIDTH_LABEL,lr as WidthDefaultReset,Jr as aimAfterListChange,Sa as anchorFields,B as backTo,oa as backgroundField,ca as boxBlockSpacingField,ua as boxColumnsFields,Ra as boxFillField,Lr as boxPhoneRowField,Fr as boxShareField,da as boxSharePhoneField,$r as boxThemeIndexOf,Zl as bucketHeader,la as buttonWordsEntryField,Pr as cardCornersField,mr as cardImageBackgroundField,ni as cardImageField,Ka as cardMediaFields,sa as cardShapeFields,Ua as cardShowFields,Wa as cardStyleFields,fa as cellWidthFields,wa as checkbox,Ia as colorInput,Al as containerDirectionField,nr as containerGapField,or as containerGapPhoneField,Pl as containerGapRows,Vr as coordsResultTip,$l as copyText,ct as cornerSidesField,fe as cornersRowField,_a as date,ya as dateTime,Jl as designGroupHeader,$a as displayFields,Ta as edgePad,Yl as entriesHiddenForTab,Da as focusAfterRemove,Ea as focusKeptField,Ql as foldMarker,re as foldMetaOf,fr as foldTitleOf,ja as galleryLayoutField,ba as heightFields,Fl as heroGroupPlacementPoints,_e as hidableText,ur as hintIsWhileTyping,Xa as imageCornersField,Hl as inOwnBox,ql as isBucketHeader,st as keptBy,Xl as linkField,La as loadingShowsField,Pa as multiSelect,Ca as pageBackgroundField,Vl as panelNote,Dr as phoneOverrideField,Ul as plainText,jl as plainTextarea,at as pxField,ea as quietMarker,ye as readHidable,qr as rowText,Aa as searchSelect,dt as sectionBorderField,Sr as sectionCornersField,ia as sectionShapeFields,ra as sectionThemeFields,Zr as setRowText,pa as sizeField,Fa as sourceField,ma as spacingFields,xa as stickFields,ha as swapPadding,aa as templateField,Kl as text,xt as textFieldIdentifier,Nl as textFieldOffPage,Bl as textFieldPanelOnly,Ga as textList,Ma as textListRowField,Wl as textarea,ft as toggle,Na as upload,hr as useSelectedPatch,H as useSelectedProps,D as useSelectedSibling,er as useSiteGapDetail,ga as widthField,Dl as withIdentifier,Ll as withOffPage,vl as withPanelOnly,kl 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 B}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as T}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",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design","Text style":"Design",Entrance:"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","ProductGrid._gCards":"Design"},G={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return G[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function H(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 H(l))t.includes(p)||t.push(p)}return t}const pe=[...S(B(),D("full"),E(),m(),x()),...Object.keys(B()),...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(T()),...Object.keys(T())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...H(_("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)","EmailFormBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...B(),...D("full"),...E(),...m(),...O(),...w(),...T()};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",G],["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{G 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,H 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",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 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","Text style":"Design",Entrance:"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","ProductGrid._gCards":"Design"},G={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return G[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function H(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 H(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T(),D("full"),E(),m(),x()),...Object.keys(T()),...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=[...H(_("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(),...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 u=_(t,n,i.label);if(i.level!==2||!u||!K[u].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 ${u??"(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:u,entries:[]});continue}const s=_(t,n,i.label);if(!s)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:s,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",G],["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(s=>s.place===r),c=i.findIndex(s=>s.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const s of i)for(const[u,N]of s.entries)y[u]=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{G 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,H as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
@@ -0,0 +1,12 @@
1
+ import type { DropdownMenuEntry } from "efficient-shell/ui";
2
+ import { type SourceChoice } from "../../../format/lib/content/block-sources.js";
3
+ export declare function liveNumberMenu(choices: readonly SourceChoice[], onLink: (key: string) => void): DropdownMenuEntry[];
4
+ export declare function LiveNumberBox({ id, text, countKey, choices, onText, onLink, }: {
5
+ id: string;
6
+ text: string;
7
+ countKey: string;
8
+ choices: readonly SourceChoice[];
9
+ onText: (next: string) => void;
10
+ onLink: (key: string) => void;
11
+ }): import("react").JSX.Element;
12
+ export declare function withLiveNumberRow<F extends Record<string, unknown>>(fields: F, props: Record<string, unknown> | undefined): F;
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{useId as b}from"react";import{useEasel as v,useSelectedHost as y}from"efficient-easel/easel";import{CloseIcon as C,LinkIcon as x,LockIcon as k}from"efficient-easel/icons";import{SettingsField as N}from"efficient-easel/panel";import{deviceField as h,deviceNote as O}from"efficient-easel/screen/lib/document/device-fields";import{Input as s}from"efficient-shell/ui";import{namedRowField as g}from"../../../format/lib/content/card-template.js";import{COUNT_KEY_PROP as c,COUNTS_SOURCE as I,sourceChoices as R}from"../../../format/lib/content/block-sources.js";import{consentWordsOf as S}from"../../../format/lib/content/consent-banner.js";import{countsReachText as w,countWords as d,linkedCount as _}from"../../../format/lib/content/count-numbers.js";import{readHidable as E,useSelectedSibling as L}from"./controls.js";import{partValueWithText as T}from"../../../render/lib/document/part-text.js";import{say as i}from"../../../format/lib/editor-words.js";const f=(e,t)=>t==="number"?`${d(e.value)} · ${i(e.label)}`:`${i(e.label)} · ${d(e.value)}`;function W(e,t){return[{type:"label",key:"heading",label:i("Live numbers")},...e.map(n=>({key:n.key,label:f(n,"name"),onSelect:()=>t(n.key)}))]}function F({id:e,text:t,countKey:n,choices:r,onText:u,onLink:a}){const l=n?r.find(m=>m.key===n):void 0;return o("div",{className:"sf-copybox",children:n?o(s,{id:e,readOnly:!0,value:l?f(l,"number"):t,leftIcon:o(k,{size:16}),endAction:{label:i("Unlink"),icon:o(C,{size:16}),onClick:()=>a("")}}):o(s,{id:e,value:t,onChange:m=>u(m.target.value),endAction:r.length?{label:i("Connect to a live number"),icon:o(x,{size:16}),menu:W(r,a)}:void 0})})}function U(){const e=y();try{return v(t=>w(t.appState.data.content,e?.id))}catch{return!0}}function $({value:e,onChange:t}){const n=b(),[r,u]=L(c),a=U();return o(N,{label:i("Body"),htmlFor:n,children:o(F,{id:n,text:E(e).text,countKey:_({[c]:r}),choices:a?R(I):z,onText:l=>t(T("textarea",e,l)),onLink:u})})}const j=O(),z=[],p=new WeakMap;function H(e){let t=p.get(e);if(!t){const n={...e,render:({value:r,onChange:u})=>o($,{value:r,onChange:u})};t=h("desktop",n),p.set(e,t)}return t}function ee(e,t){if(typeof t?.[c]!="string"||S(t)!==null||g(t))return e;const n=e.text;return!n||typeof n!="object"?e:{_dDevice:j,...e,text:H(n)}}export{F as LiveNumberBox,W as liveNumberMenu,ee as withLiveNumberRow};
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as T}from"react/jsx-runtime";import{accentItalicCss as L,storedTextStyles as O,textStylesCss as M}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as $,PAGE_WIDTH_ATTR as K,siteWidthTokens as X,siteGutterTokens as Y,heroBackgroundTokens as q}from"../../../format/lib/content/page-width.js";import{siteBlockGapTokens as J}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as Q}from"../../../render/components/PreviewHeaderContext.js";import{SitePhotographyProvider as U}from"../../../render/components/SitePhotographyContext.js";import{CORNER_STYLE_TO_PX as Z,normalizeCornerStyle as ee,normalizeCornerRadius as te,themeColorStyle as oe,typeSizesStyle as re,headingTypographyStyle as ne,normalizeHeadingTypography as ae,themeAccentStyle as se,themeButtonStyle as ie,themePresetAccentVars as de,themeSurfaceStyle as ce,siteCornerRadiusTokens as le,shadowColorTokens as pe,headingCompressionAttr as he,cardShadowAttr as me,cardGapAttr as fe,hoverEffectAttr as ue}from"../../../format/lib/theme.js";import{fontRoleStyle as ge}from"../../../format/lib/fonts.js";import{wordStyleTokens as Se}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as ye,pageHasHeaderSection as k,pageTakesTopSpace as xe,topSpaceMarker as Te,TOP_SPACE_ATTR as ke,HEADER_CLEARANCE_CLASS as Ce}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as Ee,HEADER_INK_ATTR as Ae}from"../../../render/lib/document/header-ink.js";import{useEasel as Pe}from"efficient-easel/easel";import{pageBackgroundVars as ve}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as _e}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as Re}from"../../../render/lib/document/editing-bridges.js";import we from"../../components/SectionTextPartBridge.js";const Ie={SectionTextParts:we};import{PageWidthWrapper as et,PublishedPageFrame as tt,pageWidthTokens as ot}from"../../../render/lib/document/page-frame.js";const We="color-mix(in oklab, var(--bg) 40%, #ffffff)",Be="12vh";function Ge({style:o,children:s}){const{appState:i}=Pe(u=>u),t=i.data.content,n=i.data.root;if(ye(t))return r("div",{className:"sf-themed-content",style:{...o,background:We,minHeight:"100vh",paddingBottom:Be},children:r("div",{style:{background:"var(--bg)"},children:s})});const d=k(t)&&xe(n,t),c=k(t)?Te(n,t):null,h=c?{[ke]:c}:null,l=$(n?.widthChoice),m=l?{[K]:l}:null,p=d?null:Ee(t),f=p?{[Ae]:p}:null;return r("div",{className:`sf-themed-content${d?` ${Ce}`:""}`,style:o,...f,...h,...m,children:r("div",{style:{background:"var(--bg)",minHeight:"100%"},children:s})})}function Je({propsTheme:o,propsFonts:s,propsCornerStyle:i,propsCornerRadiusPx:t,propsHeadingCompression:n,propsHeadingTypography:d,pageBackground:c,chromeInheritsSiteBackground:h,suppressPreviewNav:l,footer:m,overlay:p,children:f}){const{theme:u,fonts:C,sizes:E,cornerRadiusPx:A,cardShadow:g,shadowColor:P,cardGap:v,hoverEffect:S,headingCompression:_,siteWidth:R,siteGutter:w,blockGap:I,headingTypography:W,heroBackgroundFollowsWidth:B,photographyGrayscale:G,textStyles:H,wordStyles:N,themeFromDocument:e}=Q(),a=e?o:u,b=e?s:C,D=e?void 0:E,z=e?t===void 0?Z[ee(i)]:te(t):A,V=e?n:_,y=e?d:W,x=[M(O(e?void 0:H)),L(ae(y).italicStrong)].filter(Boolean).join(`
2
- `),j=_e(),F={...oe(a),...re(D),...ne(y),...j.style,...h?{}:ve(c)};return T("div",{className:"sf-theme-surfaces sf-theme-accent",style:{...ge(b),...Se(e?null:N),...se(a),...ie(a),...de(a),...ce(a),...le(z),...pe(e?void 0:g,e?void 0:P,e?void 0:S),...X(e?void 0:R),...Y(e?void 0:w),...J(e?void 0:I),...q(e?void 0:B)},"data-sf-headings":he(V),"data-sf-card-shadow":e?void 0:me(g),"data-sf-card-gap":e?void 0:fe(v),"data-sf-card-hover":e?void 0:ue(S),onClickCapture:l,children:[x?r("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:x}}):null,r(U,{grayscale:e?void 0:G,children:T(Re,{value:Ie,children:[r(Ge,{style:F,children:f}),m,p]})})]})}const Qe=o=>{o.target?.closest?.("a")&&o.preventDefault()};export{Ie as EDITING_BRIDGES,Ge as EditorPageBody,Je as EditorThemedBody,et as PageWidthWrapper,tt as PublishedPageFrame,We as SECTION_PREVIEW_CANVAS,Be as SECTION_PREVIEW_CANVAS_TAIL,ot as pageWidthTokens,Qe as suppressPreviewNav};
1
+ import{jsx as n,jsxs as P}from"react/jsx-runtime";import{accentItalicCss as M,storedTextStyles as $,textStylesCss as K}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as X,PAGE_WIDTH_ATTR as Y,siteWidthTokens as q,siteGutterTokens as J,siteGutterPhoneClass as Q,siteGutterPhoneTokens as U,heroBackgroundTokens as Z}from"../../../format/lib/content/page-width.js";import{siteBlockGapPhoneClass as ee,siteBlockGapPhoneTokens as te,siteBlockGapTokens as oe}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as ne}from"../../../render/components/PreviewHeaderContext.js";import{SitePhotographyProvider as re}from"../../../render/components/SitePhotographyContext.js";import{CORNER_STYLE_TO_PX as se,normalizeCornerStyle as ae,normalizeCornerRadius as ie,themeColorStyle as de,typeSizesStyle as ce,headingTypographyStyle as le,normalizeHeadingTypography as he,themeAccentStyle as pe,themeButtonStyle as fe,themePresetAccentVars as me,themeSurfaceStyle as ue,siteCornerRadiusTokens as Se,shadowColorTokens as ge,headingCompressionAttr as ye,cardShadowAttr as xe,cardGapAttr as Te,hoverEffectAttr as ke}from"../../../format/lib/theme.js";import{fontRoleStyle as Pe}from"../../../format/lib/fonts.js";import{wordStyleTokens as Ce}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as Ee,pageHasHeaderSection as C,pageTakesTopSpace as Ae,topSpaceMarker as Ge,TOP_SPACE_ATTR as ve,HEADER_CLEARANCE_CLASS as _e}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as Be,HEADER_INK_ATTR as Re}from"../../../render/lib/document/header-ink.js";import{useEasel as we}from"efficient-easel/easel";import{pageBackgroundVars as Ie}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as We}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as He}from"../../../render/lib/document/editing-bridges.js";import Ne from"../../components/SectionTextPartBridge.js";const be={SectionTextParts:Ne};import{PageWidthWrapper as at,PublishedPageFrame as it,pageWidthTokens as dt}from"../../../render/lib/document/page-frame.js";const De="color-mix(in oklab, var(--bg) 40%, #ffffff)",ze="12vh";function je({style:o,children:a}){const{appState:i}=we(u=>u),t=i.data.content,r=i.data.root;if(Ee(t))return n("div",{className:"sf-themed-content",style:{...o,background:De,minHeight:"100vh",paddingBottom:ze},children:n("div",{style:{background:"var(--bg)"},children:a})});const d=C(t)&&Ae(r,t),c=C(t)?Ge(r,t):null,p=c?{[ve]:c}:null,l=X(r?.widthChoice),f=l?{[Y]:l}:null,h=d?null:Be(t),m=h?{[Re]:h}:null;return n("div",{className:`sf-themed-content${d?` ${_e}`:""}`,style:o,...m,...p,...f,children:n("div",{style:{background:"var(--bg)",minHeight:"100%"},children:a})})}function ot({propsTheme:o,propsFonts:a,propsCornerStyle:i,propsCornerRadiusPx:t,propsHeadingCompression:r,propsHeadingTypography:d,pageBackground:c,chromeInheritsSiteBackground:p,suppressPreviewNav:l,footer:f,overlay:h,children:m}){const{theme:u,fonts:E,sizes:A,cornerRadiusPx:G,cardShadow:S,shadowColor:v,cardGap:_,hoverEffect:g,headingCompression:B,siteWidth:R,siteGutter:w,siteGutterPhone:y,blockGap:I,blockGapPhone:x,headingTypography:W,heroBackgroundFollowsWidth:H,photographyGrayscale:N,textStyles:b,wordStyles:D,themeFromDocument:e}=ne(),s=e?o:u,z=e?a:E,j=e?void 0:A,V=e?t===void 0?se[ae(i)]:ie(t):G,F=e?r:B,T=e?d:W,k=[K($(e?void 0:b)),M(he(T).italicStrong)].filter(Boolean).join(`
2
+ `),L=We(),O={...de(s),...ce(j),...le(T),...L.style,...p?{}:Ie(c)};return P("div",{className:`sf-theme-surfaces sf-theme-accent ${[Q(e?void 0:y),ee(e?void 0:x)].filter(Boolean).join(" ")}`.trim(),style:{...Pe(z),...Ce(e?null:D),...pe(s),...fe(s),...me(s),...ue(s),...Se(V),...ge(e?void 0:S,e?void 0:v,e?void 0:g),...q(e?void 0:R),...J(e?void 0:w),...U(e?void 0:y),...oe(e?void 0:I),...te(e?void 0:x),...Z(e?void 0:H)},"data-sf-headings":ye(F),"data-sf-card-shadow":e?void 0:xe(S),"data-sf-card-gap":e?void 0:Te(_),"data-sf-card-hover":e?void 0:ke(g),onClickCapture:l,children:[k?n("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:k}}):null,n(re,{grayscale:e?void 0:N,children:P(He,{value:be,children:[n(je,{style:O,children:m}),f,h]})})]})}const nt=o=>{o.target?.closest?.("a")&&o.preventDefault()};export{be as EDITING_BRIDGES,je as EditorPageBody,ot as EditorThemedBody,at as PageWidthWrapper,it as PublishedPageFrame,De as SECTION_PREVIEW_CANVAS,ze as SECTION_PREVIEW_CANVAS_TAIL,dt as pageWidthTokens,nt as suppressPreviewNav};
@@ -1,8 +1,10 @@
1
1
  import type { LockHolder, SaveConflict } from "efficient-easel/edit-lock";
2
+ import type { SectionTemplateStore } from "efficient-easel/screen/lib/section-template-types";
3
+ import type { TreeItem } from "efficient-easel/draw";
2
4
  import { type OfferedSets } from "./editor-blocks.js";
3
5
  import type { EaselCapabilities as EditorCapabilities, EaselDocument as EditorDocument, EaselDocumentAdapter as EditorDocumentAdapter } from "efficient-easel/screen/lib/document-contract";
4
6
  import type { SiteVersionsAccess } from "./site-versions.js";
5
- import type { EditorPageRow, SiteLiveState, WebsiteBackend } from "../../format/lib/web-backend.js";
7
+ import type { EditorPageRow, SiteLiveState, WebsiteBackend, WebsitePages } from "../../format/lib/web-backend.js";
6
8
  export type { EditorPageRow };
7
9
  export type { EditorCapabilities, EditorDocument, EditorDocumentAdapter };
8
10
  export type WebsiteCapabilities = EditorCapabilities & {
@@ -36,5 +38,7 @@ export type WebsiteDocumentAdapter = EditorDocumentAdapter & {
36
38
  export type SitePageAdapterOptions = {
37
39
  editsPinnedInPlace?: boolean;
38
40
  };
41
+ export declare function settlingPages(pages: WebsitePages): WebsitePages;
42
+ export declare function saveSectionTemplate(store: Pick<SectionTemplateStore, "update">, id: string, node: TreeItem): Promise<import("efficient-easel/screen/lib/section-template-types").SectionTemplate>;
39
43
  export declare function makeSitePageAdapter(siteId: string | undefined, backend?: WebsiteBackend, offered?: OfferedSets, options?: SitePageAdapterOptions): WebsiteDocumentAdapter;
40
44
  export declare function makeTemplatePageAdapter(templateId: string, backend?: WebsiteBackend, offered?: OfferedSets): WebsiteDocumentAdapter;
@@ -1 +1 @@
1
- "use client";import{SITE_FOOTER_SLUG as H}from"../../format/lib/content/footer.js";import{offeredSetsOf as x}from"./editor-blocks.js";import{isBackendError as F}from"efficient-easel/screen/lib/backend-error";import{isEfficientBackend as z}from"efficient-easel/screen/lib/session";import{noteLoaded as M,notePublished as _,noteSaved as T,pageLiveState as Z}from"./page-live-state.js";import{noteSiteLiveState as ee,refreshSiteLiveState as A}from"./site-live-state.js";import{say as te}from"../../format/lib/editor-words.js";import{sendSiteWrites as ne}from"../../format/lib/site-writes.js";import{isPopupPageLayout as oe}from"../../format/lib/popup/new-popup.js";import{spliceChrome as ie,splitChrome as G}from"./pinned-chrome-doc.js";import{references as se,sectionNodeOf as re,spliceShared as le,splitShared as ae}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(n){return!!(n?.publish&&n.liveState)}function ce(n,s){if(!I(n))return;const{versions:c,nameVersion:d,restoreVersion:a,previewVersion:o}=n;if(!(!c||!d||!a||!o))return{list:()=>c.call(n,s),name:(f,w)=>d.call(n,f,w,s),restore:(f,w)=>a.call(n,f,w??{},s),preview:f=>o.call(n,f,s)}}function de(n,s){return async(c,d)=>{try{await ne()}catch(o){throw new Error(te("A change waiting to go live could not be saved."),{cause:o})}return(await n.publish(s)).state==="live"?ee({state:"live",changes:[]}):A(0),{version:d??null}}}function N(n,s,c){const d=s?{siteId:s}:void 0;return{resolve:a=>n.load({slug:a,...d}).then(o=>(o&&M(o.id,o.live),o)),saveLayout:(a,o,f,w)=>n.save(a,{layout:o},{version:f,clientId:w??""}).then(v=>(T(a,v.live),A(),v)),rereadVersion:n.version?a=>n.version(a):void 0,publish:I(c)?de(c,d):n.publish?(a,o)=>n.publish(a,o?{version:o}:void 0).then(f=>(_(a,f.live),f)):void 0,listPages:()=>n.list(d),createPage:n.create?a=>n.create({...a,...d}):void 0,deletePage:n.remove?(a,o)=>n.remove(a,o):void 0}}function ue(n,s,c,d,a=!1){let o=null;const f=new Set;let w=!1,v=new Map,y=new Map,h=new Map,g=new Map,P={docId:null,lockHolder:null,conflict:null,saveFailed:!1,unpublished:!1,loadFailed:!1,sections:[]};const B=new Set,D=()=>{if(!o)return!1;const e=Z(o.id);return e==="changed"||e==="never"||e===void 0&&w},S=e=>{P={...P,...e,docId:o?.id??null,unpublished:D(),sections:[...h.values()]};for(const t of B)t()},k=(e,t,i)=>{t?h.set(e,{section:e,title:v.get(e)?.title??"",problem:t,holder:i}):h.delete(e)},C=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},L=e=>f.has(e),R=()=>new Map([...v].map(([e,t])=>[e,t.layout])),V=()=>`SharedSection-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}`,J=(e,t,i,r)=>{const l=C(t);v.set(e,{layout:l,version:i,savedJson:JSON.stringify(l),title:r})},U={state:()=>P,subscribe:e=>(B.add(e),()=>{B.delete(e)})},K={sectionOf:e=>y.get(e)?.section??null,heldElsewhere:e=>{const t=y.get(e)?.section;return!!(t&&h.get(t)?.problem==="lock")},adopt:(e,t)=>{J(t.id,t.layout,t.layout_updated_at,t.title),y.set(e,{section:t.id,refId:V()}),g.set(t.id,t.used_on),S({})},place:e=>{if([...y.values()].some(r=>r.section===e.id))return null;const t=re(C(e.layout)),i=typeof t?.props?.id=="string"?t.props.id:null;return!t||!i||!t.type?null:(J(e.id,e.layout,e.layout_updated_at,e.title),y.set(i,{section:e.id,refId:V()}),g.set(e.id,e.used_on),t)},usedOn:e=>g.get(e)??null,learn:e=>{for(const t of e){g.set(t.id,t.used_on);const i=v.get(t.id);i&&(i.title=t.title);const r=h.get(t.id);r&&h.set(t.id,{...r,title:t.title})}S({})}},Q=async(e,t)=>{for(const[i,r]of e){const l=v.get(i),u=JSON.stringify(r);if(!(!l||u===l.savedJson||h.get(i)?.problem==="lock"))try{const m=await n.save(i,{layout:r},{version:l.version,clientId:t??""});T(i,m.live),l.layout=r,l.version=m.version,l.savedJson=u,k(i,null)}catch(m){F(m,"changed-elsewhere")?k(i,"conflict"):F(m,"lock-taken")?k(i,"lock",m.holder??void 0):k(i,"save")}}e.size&&A(),S({})};return{resolve:async e=>{if(Y(e===H?null:U),W(e===H?null:K),v=new Map,y=new Map,h=new Map,g=new Map,e===H)return c.resolve(e);let t=!1;const[i,r]=await Promise.all([c.resolve(e),n.load({slug:H,...s}).catch(()=>(t=!0,null))]);if(r&&!oe(i?.layout)){M(r.id,r.live);const p=C(r.layout);o={id:r.id,layout:p,version:r.version,savedJson:""}}else o=null;if(w=!1,!i)return S({conflict:null,saveFailed:!1,loadFailed:t}),i;const l=C(i.layout),u=se(l),m=await Promise.all(u.map(p=>n.load({id:p.section,...s}).catch(()=>null)));u.forEach((p,X)=>{const b=m[X];b?(M(b.id,b.live),J(p.section,b.layout,b.version,"")):(v.delete(p.section),h.set(p.section,{section:p.section,title:"",problem:"load"}))});const E=le(l,R());if(y=E.held,!o)return y.size&&f.add(i.id),S({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...i,layout:E.working}:i;const O=ie(E.working,o.layout);return o.savedJson=JSON.stringify(G(O,o.layout).chrome),f.add(i.id),S({conflict:null,saveFailed:!1,loadFailed:!1}),{...i,layout:O}},saveLayout:async(e,t,i,r)=>{if(!L(e))return c.saveLayout(e,t,i,r);const l=o,u=l?G(t,l.layout):{page:t,chrome:null},m=ae(u.page,y,R()),E=await c.saveLayout(e,m.page,i,r);if(await Q(m.docs,r),!l)return E;const O=JSON.stringify(u.chrome);if(!u.chrome||O===l.savedJson||P.lockHolder)return E;try{const p=await n.save(l.id,{layout:u.chrome},{version:l.version,clientId:r??""});T(l.id,p.live),A(),l.layout=u.chrome,l.version=p.version,l.savedJson=O,w=!0,S({conflict:null,saveFailed:!1})}catch(p){F(p,"changed-elsewhere")?S({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):F(p,"lock-taken")?S({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):S({saveFailed:!0})}return E},publish:c.publish?async(e,t)=>{const i=await c.publish(e,t),r=o;if(r&&L(e)&&!a&&n.publish&&D()&&!P.lockHolder){const l=await n.publish(r.id,r.version?{version:r.version}:void 0);_(r.id,l.live),l.version!==null&&(r.version=l.version),w=!1,S({})}if(L(e)&&!a&&n.publish)for(const[l,u]of v){if(h.get(l)?.problem==="lock")continue;const m=await n.publish(l,u.version?{version:u.version}:void 0);_(l,m.live),m.version!==null&&(u.version=m.version)}return i}:void 0,lock:d?{claim:async(e,t,i)=>{const r=await d.claim(e,t,i);if(!L(e))return r;const l=o;if(l)try{await d.claim(l.id,t,!1),P.lockHolder&&S({lockHolder:null})}catch(u){F(u,"lock-taken")&&S({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of v.keys())try{await d.claim(u,t,!1),h.get(u)?.problem==="lock"&&k(u,null)}catch(m){F(m,"lock-taken")&&k(u,"lock",m.holder??void 0)}return v.size&&S({}),r},release:async(e,t)=>{if(await d.release(e,t),!L(e))return;const i=o;i&&!P.lockHolder&&await d.release(i.id,t).catch(()=>{});for(const r of v.keys())h.get(r)?.problem!=="lock"&&await d.release(r,t).catch(()=>{})}}:void 0,pinnedChrome:U}}function Le(n,s=$(),c=x(),d={}){const a=z(s),o=n?{siteId:n}:void 0,f=a?!!n:!0,w=s.site.update,v=a&&c.commerce&&c.service,y=!!d.editsPinnedInPlace&&v,h=I(s.site)?s.site:void 0,g=N(s.pages,n,h),P=y?ue(s.pages,o,g,s.lock,!!h):null;return{capabilities:{canPublish:!!h||!!s.pages.publish,hasSiteSettings:a,hasSiteTheme:!!s.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!s.pages.create,canDeletePagesInline:!!s.pages.remove,hasEditLock:!!s.lock,hasEditGuard:!0,hasPinnedChrome:v,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!w,hasPreviewLink:a||!!s.preview,hasCatalog:a&&c.commerce,hasForms:a&&c.service,hasBlog:!!s.blog&&c.service,offersCommerce:c.commerce,offersService:c.service},...g,...q(g.resolve),lock:s.lock,...P,site:f?()=>s.site.get(o):void 0,siteLiveState:h?()=>h.liveState(o):void 0,siteVersions:ce(h,o),updateSite:f&&w?B=>w(B,o):void 0,previewHref:s.preview?B=>s.preview.href(B):void 0}}function Oe(n,s=$(),c=x()){const d=z(s),a=s.templates,o=a?a.pages(n):{list:()=>Promise.reject(new Error(j)),load:()=>Promise.reject(new Error(j)),save:()=>Promise.reject(new Error(j))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!o.create,canDeletePagesInline:!!o.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&c.commerce&&c.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&c.commerce,hasForms:d&&c.service,hasBlog:!!s.blog&&c.service,offersCommerce:c.commerce,offersService:c.service},...N(o,void 0),...q(N(o,void 0).resolve),publish:void 0,templateName:a?()=>a.get(n).then(f=>f.name):void 0}}function q(n){return{resolve:s=>(Y(null),W(null),n(s))}}const j="This editor's backend has no website templates.";export{Le as makeSitePageAdapter,Oe as makeTemplatePageAdapter};
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 C}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 ne}from"./page-live-state.js";import{noteSiteLiveState as oe,refreshSiteLiveState as J}from"./site-live-state.js";import{say as se}from"../../format/lib/editor-words.js";import{sendSiteWrites as ie}from"../../format/lib/site-writes.js";import{isPopupPageLayout as re}from"../../format/lib/popup/new-popup.js";import{spliceChrome as le,splitChrome as G}from"./pinned-chrome-doc.js";import{references as ae,sectionNodeOf as ce,spliceShared as de,splitShared as ue}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(n){return!!(n?.publish&&n.liveState)}function fe(n,s){if(!I(n))return;const{versions:l,nameVersion:d,restoreVersion:i,previewVersion:o}=n;if(!(!l||!d||!i||!o))return{list:()=>l.call(n,s),name:(f,w)=>d.call(n,f,w,s),restore:(f,w)=>i.call(n,f,w??{},s),preview:f=>o.call(n,f,s)}}function me(n,s){return async(l,d)=>{try{await ie()}catch(o){throw new Error(se("A change waiting to go live could not be saved."),{cause:o})}return(await n.publish(s)).state==="live"?oe({state:"live",changes:[]}):J(0),{version:d??null}}}function x(n,s,l){const d=s?{siteId:s}:void 0;return{resolve:i=>n.load({slug:i,...d}).then(o=>(o&&_(o.id,o.live),o)),saveLayout:(i,o,f,w)=>n.save(i,{layout:o},{version:f,clientId:w??""}).then(h=>(N(i,h.live),J(),h)),rereadVersion:n.version?i=>n.version(i):void 0,publish:I(l)?me(l,d):n.publish?(i,o)=>n.publish(i,o?{version:o}:void 0).then(f=>(T(i,f.live),f)):void 0,listPages:()=>n.list(d),createPage:n.create?i=>n.create({...i,...d}):void 0,deletePage:n.remove?(i,o)=>n.remove(i,o):void 0}}function ve(n,s,l,d,i=!1){let o=null;const f=new Set;let w=!1,h=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 F=new Set,E=()=>{if(!o)return!1;const e=ne(o.id);return e==="changed"||e==="never"||e===void 0&&w},S=e=>{g={...g,...e,docId:o?.id??null,unpublished:E(),sections:[...m.values()]};for(const t of F)t()},k=(e,t,r)=>{t?m.set(e,{section:e,title:h.get(e)?.title??"",problem:t,holder:r}):m.delete(e)},H=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},L=e=>f.has(e),j=()=>new Map([...h].map(([e,t])=>[e,t.layout])),D=()=>`SharedSection-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}`,M=(e,t,r,a)=>{const c=H(t);h.set(e,{layout:c,version:r,savedJson:JSON.stringify(c),title:a})},V={state:()=>g,subscribe:e=>(F.add(e),()=>{F.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:D()}),P.set(t.id,t.used_on),S({})},place:e=>{if([...y.values()].some(a=>a.section===e.id))return null;const t=ce(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:D()}),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=h.get(t.id);r&&(r.title=t.title);const a=m.get(t.id);a&&m.set(t.id,{...a,title:t.title})}S({})}},X=async(e,t)=>{for(const[r,a]of e){const c=h.get(r),u=JSON.stringify(a);if(!(!c||u===c.savedJson||m.get(r)?.problem==="lock"))try{const v=await n.save(r,{layout:a},{version:c.version,clientId:t??""});N(r,v.live),c.layout=a,c.version=v.version,c.savedJson=u,k(r,null)}catch(v){C(v,"changed-elsewhere")?k(r,"conflict"):C(v,"lock-taken")?k(r,"lock",v.holder??void 0):k(r,"save")}}e.size&&J(),S({})};return{resolve:async e=>{if(Y(e===A?null:V),W(e===A?null:Q),h=new Map,y=new Map,m=new Map,P=new Map,e===A)return l.resolve(e);let t=!1;const[r,a]=await Promise.all([l.resolve(e),n.load({slug:A,...s}).catch(()=>(t=!0,null))]);if(a&&!re(r?.layout)){_(a.id,a.live);const p=H(a.layout);o={id:a.id,layout:p,version:a.version,savedJson:""}}else o=null;if(w=!1,!r)return S({conflict:null,saveFailed:!1,loadFailed:t}),r;const c=H(r.layout),u=ae(c),v=await Promise.all(u.map(p=>n.load({id:p.section,...s}).catch(()=>null)));u.forEach((p,Z)=>{const b=v[Z];b?(_(b.id,b.live),M(p.section,b.layout,b.version,"")):(h.delete(p.section),m.set(p.section,{section:p.section,title:"",problem:"load"}))});const B=de(c,j());if(y=B.held,!o)return y.size&&f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...r,layout:B.working}:r;const O=le(B.working,o.layout);return o.savedJson=JSON.stringify(G(O,o.layout).chrome),f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:!1}),{...r,layout:O}},saveLayout:async(e,t,r,a)=>{if(!L(e))return l.saveLayout(e,t,r,a);const c=o,u=c?G(t,c.layout):{page:t,chrome:null},v=ue(u.page,y,j()),B=await l.saveLayout(e,v.page,r,a);if(await X(v.docs,a),!c)return B;const O=JSON.stringify(u.chrome);if(!u.chrome||O===c.savedJson||g.lockHolder)return B;try{const p=await n.save(c.id,{layout:u.chrome},{version:c.version,clientId:a??""});N(c.id,p.live),J(),c.layout=u.chrome,c.version=p.version,c.savedJson=O,w=!0,S({conflict:null,saveFailed:!1})}catch(p){C(p,"changed-elsewhere")?S({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):C(p,"lock-taken")?S({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):S({saveFailed:!0})}return B},publish:l.publish?async(e,t)=>{const r=await l.publish(e,t),a=o;if(a&&L(e)&&!i&&n.publish&&E()&&!g.lockHolder){const c=await n.publish(a.id,a.version?{version:a.version}:void 0);T(a.id,c.live),c.version!==null&&(a.version=c.version),w=!1,S({})}if(L(e)&&!i&&n.publish)for(const[c,u]of h){if(m.get(c)?.problem==="lock")continue;const v=await n.publish(c,u.version?{version:u.version}:void 0);T(c,v.live),v.version!==null&&(u.version=v.version)}return r}:void 0,lock:d?{claim:async(e,t,r)=>{const a=await d.claim(e,t,r);if(!L(e))return a;const c=o;if(c)try{await d.claim(c.id,t,!1),g.lockHolder&&S({lockHolder:null})}catch(u){C(u,"lock-taken")&&S({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of h.keys())try{await d.claim(u,t,!1),m.get(u)?.problem==="lock"&&k(u,null)}catch(v){C(v,"lock-taken")&&k(u,"lock",v.holder??void 0)}return h.size&&S({}),a},release:async(e,t)=>{if(await d.release(e,t),!L(e))return;const r=o;r&&!g.lockHolder&&await d.release(r.id,t).catch(()=>{});for(const a of h.keys())m.get(a)?.problem!=="lock"&&await d.release(a,t).catch(()=>{})}}:void 0,pinnedChrome:V}}function q(n){const s=(l,d,i)=>n.save(l,d.layout?{...d,layout:te(d.layout)}:d,i);return new Proxy(n,{get(l,d){if(d==="save")return s;const i=Reflect.get(l,d,l);return typeof i=="function"?i.bind(l):i}})}function He(n,s,l){return n.update(s,ee(l))}function Ae(n,s=$(),l=U(),d={}){const i=z(s),o=n?{siteId:n}:void 0,f=i?!!n:!0,w=s.site.update,h=i&&l.commerce&&l.service,y=!!d.editsPinnedInPlace&&h,m=I(s.site)?s.site:void 0,P=q(s.pages),g=x(P,n,m),F=y?ve(P,o,g,s.lock,!!m):null;return{capabilities:{canPublish:!!m||!!s.pages.publish,hasSiteSettings:i,hasSiteTheme:!!s.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!s.pages.create,canDeletePagesInline:!!s.pages.remove,hasEditLock:!!s.lock,hasEditGuard:!0,hasPinnedChrome:h,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!w,hasPreviewLink:i||!!s.preview,hasCatalog:i&&l.commerce,hasForms:i&&l.service,hasBlog:!!s.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...g,...K(g.resolve),lock:s.lock,...F,site:f?()=>s.site.get(o):void 0,siteLiveState:m?()=>m.liveState(o):void 0,siteVersions:fe(m,o),updateSite:f&&w?E=>w(E,o):void 0,previewHref:s.preview?E=>s.preview.href(E):void 0}}function Je(n,s=$(),l=U()){const d=z(s),i=s.templates,o=i?q(i.pages(n)):{list:()=>Promise.reject(new Error(R)),load:()=>Promise.reject(new Error(R)),save:()=>Promise.reject(new Error(R))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!o.create,canDeletePagesInline:!!o.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&l.commerce&&l.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&l.commerce,hasForms:d&&l.service,hasBlog:!!s.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...x(o,void 0),...K(x(o,void 0).resolve),publish:void 0,templateName:i?()=>i.get(n).then(f=>f.name):void 0}}function K(n){return{resolve:s=>(Y(null),W(null),n(s))}}const R="This editor's backend has no website templates.";export{Ae as makeSitePageAdapter,Je as makeTemplatePageAdapter,He as saveSectionTemplate,q as settlingPages};
@@ -89,6 +89,40 @@ export declare function dryRunSections(pages: readonly DryRunPage[], opts?: {
89
89
  draw?: (node: SectionNode) => string;
90
90
  sites?: readonly SiteFacts[];
91
91
  }): DryRunReport;
92
+ export type CliPageRow = {
93
+ id: string;
94
+ site: string;
95
+ slug: string;
96
+ layout: unknown;
97
+ published_layout: unknown;
98
+ layout_updated_at: string;
99
+ };
100
+ export declare function pagesFromCliExport(rows: readonly CliPageRow[], opts: {
101
+ schema: string;
102
+ siteName: (siteId: string) => string;
103
+ }): DryRunPage[];
104
+ export type PageEdit = {
105
+ id: string;
106
+ slug: string;
107
+ patch?: {
108
+ layout: unknown;
109
+ expected_updated_at: string;
110
+ };
111
+ converted: {
112
+ type: string;
113
+ id: string;
114
+ }[];
115
+ skipped: {
116
+ type: string;
117
+ id: string;
118
+ why: string;
119
+ }[];
120
+ held?: string;
121
+ };
122
+ export declare function pageEdits(rows: readonly CliPageRow[], opts: {
123
+ types: readonly string[];
124
+ site?: SiteFacts;
125
+ }): PageEdit[];
92
126
  export declare function siteWritesFile(report: DryRunReport): {
93
127
  schema: string;
94
128
  site: string;