efficient-web-builder 47.1.0 → 48.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +67 -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/HeroPartPanel.js +1 -1
  7. package/dist/editor/components/HoverEffectField.d.ts +1 -0
  8. package/dist/editor/components/HoverEffectField.js +1 -1
  9. package/dist/editor/components/MediaUploadField.d.ts +9 -0
  10. package/dist/editor/components/MediaUploadField.js +1 -1
  11. package/dist/editor/components/PartSettingsPanel.d.ts +2 -1
  12. package/dist/editor/components/PartSettingsPanel.js +1 -1
  13. package/dist/editor/components/PreviewPartAnchors.d.ts +3 -1
  14. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  15. package/dist/editor/components/SameInEveryViewNote.d.ts +1 -0
  16. package/dist/editor/components/SameInEveryViewNote.js +1 -0
  17. package/dist/editor/components/SaveAsTemplateButton.d.ts +5 -0
  18. package/dist/editor/components/SaveAsTemplateButton.js +1 -0
  19. package/dist/editor/components/SideSpaceField.d.ts +31 -1
  20. package/dist/editor/components/SideSpaceField.js +1 -1
  21. package/dist/editor/components/SiteFields.d.ts +4 -1
  22. package/dist/editor/components/SiteFields.js +1 -1
  23. package/dist/editor/components/SiteRestoreNotice.js +1 -1
  24. package/dist/editor/components/SiteTextStylesField.js +1 -1
  25. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  26. package/dist/editor/components/StorefrontEditor.js +1 -1
  27. package/dist/editor/components/TickerSettingsPanel.js +1 -1
  28. package/dist/editor/components/VersionHistoryDrawer.js +1 -1
  29. package/dist/editor/components/WebsitePreviewButton.d.ts +2 -1
  30. package/dist/editor/components/WebsitePreviewButton.js +1 -1
  31. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  32. package/dist/editor/components/WebsiteSettingsPanel.d.ts +10 -0
  33. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  34. package/dist/editor/components/usePartMotion.d.ts +10 -0
  35. package/dist/editor/components/usePartMotion.js +1 -0
  36. package/dist/editor/components/useSocialSettings.d.ts +2 -2
  37. package/dist/editor/lib/animation/AnimationDurationRow.d.ts +4 -0
  38. package/dist/editor/lib/animation/AnimationDurationRow.js +1 -1
  39. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  40. package/dist/editor/lib/animation/fields.d.ts +1 -1
  41. package/dist/editor/lib/animation/fields.js +1 -1
  42. package/dist/editor/lib/animation/hover-fields.d.ts +1 -0
  43. package/dist/editor/lib/animation/hover-fields.js +1 -0
  44. package/dist/editor/lib/animation/loop-fields.js +1 -1
  45. package/dist/editor/lib/document/add-target.d.ts +2 -1
  46. package/dist/editor/lib/document/add-target.js +1 -1
  47. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  48. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  49. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  50. package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
  51. package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
  52. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  53. package/dist/editor/lib/document/build-config.js +1 -1
  54. package/dist/editor/lib/document/canvas-typing.js +1 -1
  55. package/dist/editor/lib/document/card-display-chips.d.ts +33 -0
  56. package/dist/editor/lib/document/card-display-chips.js +1 -0
  57. package/dist/editor/lib/document/controls.d.ts +19 -2
  58. package/dist/editor/lib/document/controls.js +1 -1
  59. package/dist/editor/lib/document/field-groups.js +1 -1
  60. package/dist/editor/lib/document/geocode-resolve.d.ts +1 -0
  61. package/dist/editor/lib/document/geocode-resolve.js +1 -1
  62. package/dist/editor/lib/document/live-number-field.d.ts +12 -0
  63. package/dist/editor/lib/document/live-number-field.js +1 -0
  64. package/dist/editor/lib/document/page-root.js +2 -2
  65. package/dist/editor/lib/document/part-motion-canvas.d.ts +10 -0
  66. package/dist/editor/lib/document/part-motion-canvas.js +2 -0
  67. package/dist/editor/lib/editor-document-adapter.d.ts +5 -1
  68. package/dist/editor/lib/editor-document-adapter.js +1 -1
  69. package/dist/editor/lib/sections/section-dry-run.d.ts +34 -0
  70. package/dist/editor/lib/sections/section-dry-run.js +2 -2
  71. package/dist/format/lib/animation/hover.d.ts +5 -0
  72. package/dist/format/lib/animation/hover.js +1 -0
  73. package/dist/format/lib/animation/index.d.ts +1 -0
  74. package/dist/format/lib/animation/index.js +1 -1
  75. package/dist/format/lib/content/block-sources.d.ts +9 -0
  76. package/dist/format/lib/content/block-sources.js +1 -1
  77. package/dist/format/lib/content/box-layout.d.ts +20 -1
  78. package/dist/format/lib/content/box-layout.js +1 -1
  79. package/dist/format/lib/content/box-separator.js +1 -1
  80. package/dist/format/lib/content/card-template.d.ts +9 -0
  81. package/dist/format/lib/content/card-template.js +1 -1
  82. package/dist/format/lib/content/container-gap.d.ts +11 -2
  83. package/dist/format/lib/content/container-gap.js +1 -1
  84. package/dist/format/lib/content/count-numbers.d.ts +7 -0
  85. package/dist/format/lib/content/count-numbers.js +1 -0
  86. package/dist/format/lib/content/page-width.d.ts +11 -0
  87. package/dist/format/lib/content/page-width.js +1 -1
  88. package/dist/format/lib/content/section-sticky.d.ts +1 -0
  89. package/dist/format/lib/content/section-sticky.js +1 -1
  90. package/dist/format/lib/content/site-gutter.d.ts +6 -0
  91. package/dist/format/lib/content/site-gutter.js +1 -1
  92. package/dist/format/lib/document/easel-row-words.d.ts +2 -0
  93. package/dist/format/lib/document/easel-row-words.js +1 -1
  94. package/dist/format/lib/document/panel-bands.d.ts +1 -0
  95. package/dist/format/lib/document/panel-bands.js +1 -1
  96. package/dist/format/lib/document/panel-tabs.d.ts +8 -0
  97. package/dist/format/lib/document/panel-tabs.js +1 -0
  98. package/dist/format/lib/document/part-records.d.ts +6 -0
  99. package/dist/format/lib/document/part-records.js +1 -0
  100. package/dist/format/lib/document/passes/registry-context.d.ts +1 -1
  101. package/dist/format/lib/document/passes/registry-context.js +1 -1
  102. package/dist/format/lib/document/passes/settings-groups.js +1 -1
  103. package/dist/format/lib/document/passes/types.d.ts +2 -0
  104. package/dist/format/lib/document/section-groups.d.ts +1 -1
  105. package/dist/format/lib/document/site-gap-fields.d.ts +1 -1
  106. package/dist/format/lib/document/site-gap-fields.js +1 -1
  107. package/dist/format/lib/editor-words-catalogue.d.ts +11 -0
  108. package/dist/format/lib/editor-words-catalogue.js +4 -4
  109. package/dist/format/lib/fit-words.js +4 -3
  110. package/dist/format/lib/hero-ticker.d.ts +1 -0
  111. package/dist/format/lib/hero-ticker.js +1 -1
  112. package/dist/format/lib/sections/strip-shape.d.ts +1 -0
  113. package/dist/format/lib/sections/strip-shape.js +1 -1
  114. package/dist/format/lib/site-theme-row.d.ts +2 -0
  115. package/dist/format/lib/site-twin-row.d.ts +5 -0
  116. package/dist/format/lib/site-twin-row.js +1 -0
  117. package/dist/format/lib/source-rules/flat-theme-palette.js +1 -1
  118. package/dist/format/lib/source-rules/one-loop-module.js +3 -3
  119. package/dist/render/components/BlockFrame.d.ts +2 -1
  120. package/dist/render/components/BlockFrame.js +1 -1
  121. package/dist/render/components/Btn.js +1 -1
  122. package/dist/render/components/CardRowContext.d.ts +3 -1
  123. package/dist/render/components/CardRowContext.js +1 -1
  124. package/dist/render/components/CountRowsContext.d.ts +8 -0
  125. package/dist/render/components/CountRowsContext.js +1 -0
  126. package/dist/render/components/Flex.d.ts +5 -1
  127. package/dist/render/components/Flex.js +1 -1
  128. package/dist/render/components/Grid.d.ts +2 -1
  129. package/dist/render/components/Grid.js +1 -1
  130. package/dist/render/components/HeroGroup.d.ts +2 -1
  131. package/dist/render/components/HeroGroup.js +1 -1
  132. package/dist/render/components/HeroSection.d.ts +2 -1
  133. package/dist/render/components/HeroSection.js +1 -1
  134. package/dist/render/components/HeroSingle.d.ts +2 -1
  135. package/dist/render/components/HeroSingle.js +1 -1
  136. package/dist/render/components/ImageBlock.d.ts +4 -1
  137. package/dist/render/components/ImageBlock.js +1 -1
  138. package/dist/render/components/InBoxContext.d.ts +1 -0
  139. package/dist/render/components/InBoxContext.js +1 -1
  140. package/dist/render/components/IntroBleed.js +1 -1
  141. package/dist/render/components/LocationMap.js +1 -1
  142. package/dist/render/components/PartStyledKind.js +1 -1
  143. package/dist/render/components/PartStyledText.js +1 -1
  144. package/dist/render/components/PreviewHeaderContext.d.ts +9 -1
  145. package/dist/render/components/PreviewHeaderContext.js +1 -1
  146. package/dist/render/components/PublishedPartStylesContext.d.ts +4 -1
  147. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  148. package/dist/render/components/SectionAnimation.d.ts +8 -2
  149. package/dist/render/components/SectionAnimation.js +1 -1
  150. package/dist/render/components/SiteGutterFrame.d.ts +7 -1
  151. package/dist/render/components/SiteGutterFrame.js +1 -1
  152. package/dist/render/lib/animation/LoopTrack.d.ts +2 -2
  153. package/dist/render/lib/animation/LoopTrack.js +1 -1
  154. package/dist/render/lib/animation/part-motion.d.ts +21 -0
  155. package/dist/render/lib/animation/part-motion.js +1 -0
  156. package/dist/render/lib/content/block-size.js +1 -1
  157. package/dist/render/lib/content/button-look.js +1 -1
  158. package/dist/render/lib/content/section-edge.d.ts +10 -0
  159. package/dist/render/lib/content/section-edge.js +1 -0
  160. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  161. package/dist/render/lib/document/blocks/general/Grid/render.js +1 -1
  162. package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
  163. package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
  164. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  165. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  166. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  167. package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
  168. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  169. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +8 -0
  170. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  171. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +1 -1
  172. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  173. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  174. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.d.ts +2 -0
  175. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -0
  176. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  177. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  178. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  179. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  180. package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
  181. package/dist/render/lib/document/part-styles.d.ts +10 -1
  182. package/dist/render/lib/document/part-styles.js +2 -2
  183. package/dist/render/lib/document/passes/block-size.js +1 -1
  184. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  185. package/dist/render/lib/document/passes/section-anchor.js +1 -1
  186. package/dist/render/lib/document/passes/section-padding.js +1 -1
  187. package/dist/render/lib/document/passes/slots-start-afresh.js +1 -1
  188. package/dist/render/lib/sections/section-to-box.d.ts +5 -1
  189. package/dist/render/lib/sections/section-to-box.js +1 -1
  190. package/dist/render/lib/text-styles/site-text-styles.d.ts +16 -4
  191. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  192. package/package.json +3 -3
  193. package/dist/editor/lib/document/selected-host.d.ts +0 -2
  194. package/dist/editor/lib/document/selected-host.js +0 -1
@@ -1 +1 @@
1
- "use client";import{jsx as s,jsxs as ct}from"react/jsx-runtime";import{useCallback as n,useEffect as S,useMemo as ne,useRef as f,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as st}from"../lib/document/build-config.js";import{ChromeWrap as dt}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as ut}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as ht}from"../lib/site-live-state.js";import{holdSiteWrites as lt}from"../../format/lib/site-writes.js";import{backendOf as H,blocksOf as mt}from"../lib/website-session.js";import{useEaselSession as pt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as St}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as ft}from"../../format/lib/document/templateFields.js";import{setEditorPage as ae}from"../../format/lib/document/editor-page-context.js";import{resolveSiteName as gt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as wt,normalizeSiteWidth as Ct}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as ie}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as _t}from"../../format/lib/content/container-gap.js";import Tt,{DocumentScreen as Et}from"efficient-easel/screen/components/ScreenMount";import{useScreenDocument as yt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Pt,siteThemeRow as vt,themeEdited as Ht,themeSeeded as Wt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as kt}from"./PreviewFooterContext.js";import{PreviewChatProvider as Gt,DEFAULT_CHAT_PREVIEW as Rt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Bt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Ft}from"./useSocialSettings.js";import{PreviewSurfaceProvider as It}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Dt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Mt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as xt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Nt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Ot}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as bt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as At}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as zt,DEFAULT_HEADING_COMPRESSION as Lt,DEFAULT_HEADING_TYPOGRAPHY as Yt,DEFAULT_SWITCH_SHOWN as W,DEFAULT_SIZES as Ut,DEFAULT_THEME_MODE as _,normalizeCornerRadius as jt,normalizeCornerStyle as Kt,normalizeCardShadow as Vt,normalizeCardGap as Xt,normalizeHoverEffect as Zt,normalizeShadowColor as qt,IDENTITY_CARD_GAP as ce,IDENTITY_CARD_SHADOW as Jt,IDENTITY_HOVER_EFFECT as Qt,THEME_MODE_KEY as se,THEME_STORAGE_KEY as $t,THEME_SWITCH_HIDE as de,THEME_SWITCH_KEY as k}from"../../format/lib/theme.js";import{DEFAULT_FONTS as er}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as tr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as rr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as or}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as nr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as ar}from"./PreviewChatContext.js";const ir=()=>{if(typeof window>"u")return _;try{const c=window.localStorage.getItem(se);return c==="light"||c==="dark"||c==="auto"?c:_}catch{return _}},ue=c=>{if(!(typeof window>"u"))try{window.localStorage.setItem(se,c)}catch{}},cr=()=>{if(typeof window>"u")return W;try{return window.localStorage.getItem(k)!==de}catch{return W}},sr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem($t)}catch{}},he=c=>{if(!(typeof window>"u"))try{c?window.localStorage.removeItem(k):window.localStorage.setItem(k,de)}catch{}};function dr(){const{adapter:c,capabilities:d,templateId:G,ready:w,token:h,siteId:i,currentSlug:R,currentKind:B}=yt();S(()=>(ae(R,B),()=>ae(null,null)),[R,B]);const T=d.placeholderFrames,[le,F]=r(null),[me,I]=r("");S(()=>{const e=c.templateName;if(!w||!G||!e){I("");return}let a=!1;return e().then(l=>!a&&I(l??"")).catch(()=>{}),()=>{a=!0}},[w,h,G,c]);const[pe,E]=r(_),[Se,y]=r(W),[D,M]=r({value:{selected:0,themes:[]},readFor:null}),fe=D.value,[ge,x]=r(er),[we,N]=r(Ut),[Ce,O]=r(null),[_e,b]=r(Lt),[Te,A]=r(null),[Ee,z]=r(null),[ye,L]=r(ce),[Pe,Y]=r(null),[ve,U]=r(null),[He,j]=r(null),[P,K]=r(null),u=pt(),V=ne(()=>st(ut(u),mt(u)),[u]),We=ne(()=>St(ft(V,T),P),[V,T,P]),[ke,X]=r(Yt),[Ge,Z]=r(null),[Re,q]=r(null),[Be,J]=r(null),[Fe,Q]=r(null),[Ie,$]=r(null),ee=f(null),o=f(!1);S(()=>{E(ir()),y(cr())},[]);const De=n(e=>{o.current=!0,sr(),ue(e),E(e)},[]),Me=n(e=>{o.current=!0,he(e),y(e)},[]),xe=n(e=>{o.current=!0,M(a=>Ht(a,e,i??""))},[i]),Ne=n(e=>{o.current=!0,x(e)},[]),Oe=n(e=>{o.current=!0,N(e)},[]),be=n(e=>{o.current=!0,O(e)},[]),Ae=n(e=>{o.current=!0,b(e)},[]),ze=n(e=>{o.current=!0,A(e)},[]),Le=n(e=>{o.current=!0,z(e)},[]),Ye=n(e=>{o.current=!0,L(e)},[]),Ue=n(e=>{o.current=!0,Y(e)},[]),je=n(e=>{o.current=!0,X(e)},[]),[Ke,te]=r(null),[Ve,Xe]=r(null),Ze=n(e=>{o.current=!0,te(e)},[]),qe=n(e=>{o.current=!0,U(e)},[]),Je=n(e=>{o.current=!0,j(e)},[]),Qe=n(e=>{o.current=!0,K(e)},[]),$e=n(e=>{o.current=!0,Z(e)},[]),et=n(e=>{o.current=!0,q(e)},[]),tt=n(e=>{o.current=!0,J(e)},[]),rt=n(e=>{o.current=!0,Q(e)},[]),ot=n(e=>{o.current=!0,$(e)},[]);S(()=>{const e=H(u).theme;if(!h||!d.hasSiteTheme||!e)return;const a=i??"";ee.current!==a&&(ee.current=a,o.current=!1);let l=!1;return e.get(i?{siteId:i}:void 0).then(t=>{if(l||o.current)return;ue(t.default_mode),he(t.show_theme_switch),E(t.default_mode),y(t.show_theme_switch),M(Wt({selected:t.selected_preset,themes:t.theme_presets},a));const g=or(t);x(g.fonts),N(g.sizes),O(t.corner_radius_px===void 0?zt[Kt(t.corner_style)]:jt(t.corner_radius_px)),b(g.compression),A(t.card_shadow==null?Jt:Vt(t.card_shadow)),L(t.card_gap==null?ce:Xt(t.card_gap)),Y(t.hover_effect==null?Qt:Zt(t.hover_effect)),z(qt(t.shadow_color)),U(Ct(t.site_width)),j(wt(t.site_gutter)),K(_t(t.block_gap)),X(g.typography),te(g.textStyles),Xe(nr(t)),Z(t.hero_background_follows_width===!0),q(ie(t.section_background_width)),J(ie(t.section_content_width)),Q(t.photography_grayscale===!0),$(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,i,d.hasSiteTheme,u]);const nt=Ft({token:h,siteId:i,enabled:d.hasSiteSettings}),[at,re]=r(Rt),oe=f(null),v=f(!1),m=f(null),p=f({}),C=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await H(u).chat?.update(e,i?{siteId:i}:void 0),ht()}catch(a){throw p.current={...e,...p.current},a}},[u,i]);S(()=>lt(()=>m.current||Object.keys(p.current).length>0?C():void 0),[C]);const it=n(e=>{v.current=!0,re(a=>({...a,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,h,C]);return S(()=>{if(!h||!d.hasSiteSettings)return;const e=i??"";oe.current!==e&&(oe.current=e,v.current=!1);let a=!1;const l=H(u).chat;if(l)return l.get(i?{siteId:i}:void 0).then(t=>{a||v.current||re(ar(t))}).catch(()=>{}),()=>{a=!0}},[h,i,d.hasSiteSettings,u]),S(()=>{const e=c.site;if(!w||!d.hasSiteRecord||!e){F(null);return}let a=!1;return e().then(l=>{a||F(gt(l.name))}).catch(()=>{}),()=>{a=!0}},[w,h,d.hasSiteRecord,i,c]),s(Et,{config:We,parts:tr,wrap:(e,a)=>s(Pt,{websiteName:le,templateChrome:T,templateName:me||null,themeMode:pe,onThemeModeChange:De,themeSwitchShown:Se,onThemeSwitchShownChange:Me,theme:fe,themeRow:vt(d.hasSiteTheme,D.readFor,i??""),onThemeChange:xe,fonts:ge,onFontsChange:Ne,cornerRadiusPx:Ce,onCornerRadiusPxChange:be,cardShadow:Te,onCardShadowChange:ze,shadowColor:Ee,onShadowColorChange:Le,cardGap:ye,onCardGapChange:Ye,hoverEffect:Pe,onHoverEffectChange:Ue,headingCompression:_e,onHeadingCompressionChange:Ae,headingTypography:ke,onHeadingTypographyChange:je,textStyles:Ke,onTextStylesChange:Ze,wordStyles:Ve,sizes:we,onSizesChange:Oe,siteWidth:ve,onSiteWidthChange:qe,siteGutter:He,onSiteGutterChange:Je,blockGap:P,onBlockGapChange:Qe,heroBackgroundFollowsWidth:Ge,onHeroBackgroundFollowsWidthChange:$e,sectionBackgroundWidth:Re,onSectionBackgroundWidthChange:et,sectionContentWidth:Be,onSectionContentWidthChange:tt,photographyGrayscale:Fe,onPhotographyGrayscaleChange:rt,shareButtonOnPosts:Ie,onShareButtonOnPostsChange:ot,themeFromDocument:!d.hasSiteTheme,children:s(kt,{children:s(dt,{wrap:u.chrome?.wrap,surface:"page",children:s(Mt,{children:s(xt,{children:s(Nt,{children:s(bt,{children:s(Ot,{children:ct(At,{children:[s(Gt,{chat:at,onChatChange:it,children:s(Bt,{value:nt,children:s(It,{children:e})})}),a]})})})})})})})})})})}function ur({target:c}){return s(Tt,{target:c,addressing:Dt,onHostMessage:rr,children:s(dr,{})})}export{ur as default};
1
+ "use client";import{jsx as s,jsxs as pt}from"react/jsx-runtime";import{useCallback as n,useEffect as S,useMemo as ce,useRef as f,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as St}from"../lib/document/build-config.js";import{ChromeWrap as ft}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as gt}from"efficient-easel/screen/lib/session";import{refreshSiteLiveState as wt}from"../lib/site-live-state.js";import{holdSiteWrites as Ct}from"../../format/lib/site-writes.js";import{backendOf as k,blocksOf as _t}from"../lib/website-session.js";import{useEaselSession as Tt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Et}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Pt}from"../../format/lib/document/templateFields.js";import{setEditorPage as se}from"../../format/lib/document/editor-page-context.js";import{resolveSiteName as yt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Gt,normalizeSiteGutterPhone as vt,normalizeSiteWidth as kt}from"../../format/lib/content/page-width.js";import{normalizeSiteBackground as de}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as ue}from"../../format/lib/content/container-gap.js";import Ht,{DocumentScreen as Wt}from"efficient-easel/screen/components/ScreenMount";import{useScreenDocument as Bt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Rt,siteThemeRow as Ft,themeEdited as It,themeSeeded as Dt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Mt}from"./PreviewFooterContext.js";import{PreviewChatProvider as bt,DEFAULT_CHAT_PREVIEW as xt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Nt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Ot}from"./useSocialSettings.js";import{PreviewSurfaceProvider as zt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as At}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Lt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Yt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Ut}from"efficient-easel/draw/client";import{CanvasPartsBridge as jt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as Kt}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as Vt}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as Xt,DEFAULT_HEADING_COMPRESSION as Zt,DEFAULT_HEADING_TYPOGRAPHY as qt,DEFAULT_SWITCH_SHOWN as H,DEFAULT_SIZES as Jt,DEFAULT_THEME_MODE as _,normalizeCornerRadius as Qt,normalizeCornerStyle as $t,normalizeCardShadow as er,normalizeCardGap as tr,normalizeHoverEffect as rr,normalizeShadowColor as or,IDENTITY_CARD_GAP as he,IDENTITY_CARD_SHADOW as nr,IDENTITY_HOVER_EFFECT as ar,THEME_MODE_KEY as le,THEME_STORAGE_KEY as ir,THEME_SWITCH_HIDE as me,THEME_SWITCH_KEY as W}from"../../format/lib/theme.js";import{DEFAULT_FONTS as cr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as dr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as ur}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as hr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as lr}from"./PreviewChatContext.js";const mr=()=>{if(typeof window>"u")return _;try{const c=window.localStorage.getItem(le);return c==="light"||c==="dark"||c==="auto"?c:_}catch{return _}},pe=c=>{if(!(typeof window>"u"))try{window.localStorage.setItem(le,c)}catch{}},pr=()=>{if(typeof window>"u")return H;try{return window.localStorage.getItem(W)!==me}catch{return H}},Sr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(ir)}catch{}},Se=c=>{if(!(typeof window>"u"))try{c?window.localStorage.removeItem(W):window.localStorage.setItem(W,me)}catch{}};function fr(){const{adapter:c,capabilities:d,templateId:B,ready:w,token:h,siteId:i,currentSlug:R,currentKind:F}=Bt();S(()=>(se(R,F),()=>se(null,null)),[R,F]);const T=d.placeholderFrames,[fe,I]=r(null),[ge,D]=r("");S(()=>{const e=c.templateName;if(!w||!B||!e){D("");return}let a=!1;return e().then(l=>!a&&D(l??"")).catch(()=>{}),()=>{a=!0}},[w,h,B,c]);const[we,E]=r(_),[Ce,P]=r(H),[M,b]=r({value:{selected:0,themes:[]},readFor:null}),_e=M.value,[Te,x]=r(cr),[Ee,N]=r(Jt),[Pe,O]=r(null),[ye,z]=r(Zt),[Ge,A]=r(null),[ve,L]=r(null),[ke,Y]=r(he),[He,U]=r(null),[We,j]=r(null),[Be,K]=r(null),[Re,V]=r(null),[y,X]=r(null),[G,Z]=r(null),u=Tt(),q=ce(()=>St(gt(u),_t(u)),[u]),Fe=ce(()=>Et(Pt(q,T),y,G),[q,T,y,G]),[Ie,J]=r(qt),[De,Q]=r(null),[Me,$]=r(null),[be,ee]=r(null),[xe,te]=r(null),[Ne,re]=r(null),oe=f(null),o=f(!1);S(()=>{E(mr()),P(pr())},[]);const Oe=n(e=>{o.current=!0,Sr(),pe(e),E(e)},[]),ze=n(e=>{o.current=!0,Se(e),P(e)},[]),Ae=n(e=>{o.current=!0,b(a=>It(a,e,i??""))},[i]),Le=n(e=>{o.current=!0,x(e)},[]),Ye=n(e=>{o.current=!0,N(e)},[]),Ue=n(e=>{o.current=!0,O(e)},[]),je=n(e=>{o.current=!0,z(e)},[]),Ke=n(e=>{o.current=!0,A(e)},[]),Ve=n(e=>{o.current=!0,L(e)},[]),Xe=n(e=>{o.current=!0,Y(e)},[]),Ze=n(e=>{o.current=!0,U(e)},[]),qe=n(e=>{o.current=!0,J(e)},[]),[Je,ne]=r(null),[Qe,$e]=r(null),et=n(e=>{o.current=!0,ne(e)},[]),tt=n(e=>{o.current=!0,j(e)},[]),rt=n(e=>{o.current=!0,K(e)},[]),ot=n(e=>{o.current=!0,V(e)},[]),nt=n(e=>{o.current=!0,X(e)},[]),at=n(e=>{o.current=!0,Z(e)},[]),it=n(e=>{o.current=!0,Q(e)},[]),ct=n(e=>{o.current=!0,$(e)},[]),st=n(e=>{o.current=!0,ee(e)},[]),dt=n(e=>{o.current=!0,te(e)},[]),ut=n(e=>{o.current=!0,re(e)},[]);S(()=>{const e=k(u).theme;if(!h||!d.hasSiteTheme||!e)return;const a=i??"";oe.current!==a&&(oe.current=a,o.current=!1);let l=!1;return e.get(i?{siteId:i}:void 0).then(t=>{if(l||o.current)return;pe(t.default_mode),Se(t.show_theme_switch),E(t.default_mode),P(t.show_theme_switch),b(Dt({selected:t.selected_preset,themes:t.theme_presets},a));const g=ur(t);x(g.fonts),N(g.sizes),O(t.corner_radius_px===void 0?Xt[$t(t.corner_style)]:Qt(t.corner_radius_px)),z(g.compression),A(t.card_shadow==null?nr:er(t.card_shadow)),Y(t.card_gap==null?he:tr(t.card_gap)),U(t.hover_effect==null?ar:rr(t.hover_effect)),L(or(t.shadow_color)),j(kt(t.site_width)),K(Gt(t.site_gutter)),V(vt(t.site_gutter_phone)),X(ue(t.block_gap)),Z(ue(t.block_gap_phone)),J(g.typography),ne(g.textStyles),$e(hr(t)),Q(t.hero_background_follows_width===!0),$(de(t.section_background_width)),ee(de(t.section_content_width)),te(t.photography_grayscale===!0),re(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{l=!0}},[h,i,d.hasSiteTheme,u]);const ht=Ot({token:h,siteId:i,enabled:d.hasSiteSettings}),[lt,ae]=r(xt),ie=f(null),v=f(!1),m=f(null),p=f({}),C=n(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(u).chat?.update(e,i?{siteId:i}:void 0),wt()}catch(a){throw p.current={...e,...p.current},a}},[u,i]);S(()=>Ct(()=>m.current||Object.keys(p.current).length>0?C():void 0),[C]);const mt=n(e=>{v.current=!0,ae(a=>({...a,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{C().catch(()=>{})},500))},[d.hasSiteSettings,h,C]);return S(()=>{if(!h||!d.hasSiteSettings)return;const e=i??"";ie.current!==e&&(ie.current=e,v.current=!1);let a=!1;const l=k(u).chat;if(l)return l.get(i?{siteId:i}:void 0).then(t=>{a||v.current||ae(lr(t))}).catch(()=>{}),()=>{a=!0}},[h,i,d.hasSiteSettings,u]),S(()=>{const e=c.site;if(!w||!d.hasSiteRecord||!e){I(null);return}let a=!1;return e().then(l=>{a||I(yt(l.name))}).catch(()=>{}),()=>{a=!0}},[w,h,d.hasSiteRecord,i,c]),s(Wt,{config:Fe,parts:sr,wrap:(e,a)=>s(Rt,{websiteName:fe,templateChrome:T,templateName:ge||null,themeMode:we,onThemeModeChange:Oe,themeSwitchShown:Ce,onThemeSwitchShownChange:ze,theme:_e,themeRow:Ft(d.hasSiteTheme,M.readFor,i??""),onThemeChange:Ae,fonts:Te,onFontsChange:Le,cornerRadiusPx:Pe,onCornerRadiusPxChange:Ue,cardShadow:Ge,onCardShadowChange:Ke,shadowColor:ve,onShadowColorChange:Ve,cardGap:ke,onCardGapChange:Xe,hoverEffect:He,onHoverEffectChange:Ze,headingCompression:ye,onHeadingCompressionChange:je,headingTypography:Ie,onHeadingTypographyChange:qe,textStyles:Je,onTextStylesChange:et,wordStyles:Qe,sizes:Ee,onSizesChange:Ye,siteWidth:We,onSiteWidthChange:tt,siteGutter:Be,onSiteGutterChange:rt,siteGutterPhone:Re,onSiteGutterPhoneChange:ot,blockGap:y,onBlockGapChange:nt,blockGapPhone:G,onBlockGapPhoneChange:at,heroBackgroundFollowsWidth:De,onHeroBackgroundFollowsWidthChange:it,sectionBackgroundWidth:Me,onSectionBackgroundWidthChange:ct,sectionContentWidth:be,onSectionContentWidthChange:st,photographyGrayscale:xe,onPhotographyGrayscaleChange:dt,shareButtonOnPosts:Ne,onShareButtonOnPostsChange:ut,themeFromDocument:!d.hasSiteTheme,children:s(Mt,{children:s(ft,{wrap:u.chrome?.wrap,surface:"page",children:s(Lt,{children:s(Yt,{children:s(Ut,{children:s(Kt,{children:s(jt,{children:pt(Vt,{children:[s(bt,{chat:lt,onChatChange:mt,children:s(Nt,{value:ht,children:s(zt,{children:e})})}),a]})})})})})})})})})})}function gr({target:c}){return s(Ht,{target:c,addressing:At,onHostMessage:dr,children:s(fr,{})})}export{gr as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as T}from"react/jsx-runtime";import{useId as w,useMemo as k}from"react";import{useEasel as E}from"efficient-easel/easel";import{SettingsField as S,SettingsSwitch as x}from"efficient-easel/panel";import{EyeIcon as _}from"efficient-easel/icons";import{fieldShownInView as g}from"efficient-easel/fields";import{usePreviewDevice as b}from"efficient-easel/draw/client";import{DEFAULT_TICKER_ITEMS as y}from"../../format/lib/hero-ticker.js";import{TextListField as R,TICKER_ITEMS_ROW as a}from"../lib/document/controls.js";import{say as p}from"../../format/lib/editor-words.js";import{TICKER_PANEL_ROWS as C}from"../lib/document/part-panel-rows.js";const L="root:default-zone";function O({heroId:m}){const{appState:l,dispatch:d}=E(e=>e),i=l.data.content??[],r=i.findIndex(e=>e.props.id===m),o=r>=0?i[r]:null,h=o?o.props.showTicker??!0:!0,f=k(()=>{const e=o?.props.tickerItems;return Array.isArray(e)?e:y.map(I=>({text:I}))},[o]),s=w(),u=b(),n=e=>g(C[e],u);if(!o)return t("p",{className:"sf-note",children:p("This ticker’s hero is no longer on the page.")});const c=e=>d({type:"replace",destinationZone:L,destinationIndex:r,data:{...o,props:{...o.props,...e}}});return T("div",{children:[n("showTicker")&&t(S,{label:p("Show ticker"),labelId:s,icon:t(_,{}),action:t(x,{checked:h,onChange:e=>c({showTicker:e}),ariaLabelledBy:s})}),n("items")&&t(R,{label:a.label,icon:a.icon,items:f,placeholder:"item",onChange:e=>c({tickerItems:e}),markup:!0})]})}export{O as default};
1
+ "use client";import{jsx as t,Fragment as w,jsxs as k}from"react/jsx-runtime";import{useId as E,useMemo as S}from"react";import{useEasel as _}from"efficient-easel/easel";import{SettingsField as g,SettingsSwitch as x}from"efficient-easel/panel";import{EyeIcon as b}from"efficient-easel/icons";import{fieldShownInView as y}from"efficient-easel/fields";import{usePreviewDevice as R}from"efficient-easel/draw/client";import{DEFAULT_TICKER_ITEMS as O}from"../../format/lib/hero-ticker.js";import{TextListField as C,TICKER_ITEMS_ROW as a}from"../lib/document/controls.js";import{say as p}from"../../format/lib/editor-words.js";import{SiteFields as F}from"./SiteFields.js";import{usePartMotion as A}from"./usePartMotion.js";import{TICKER_MOTION_PART as L}from"../../format/lib/hero-ticker.js";import{TICKER_PANEL_ROWS as M}from"../lib/document/part-panel-rows.js";import{SameInEveryViewNote as N}from"./SameInEveryViewNote.js";const P="root:default-zone";function j({heroId:s}){const{appState:l,dispatch:d}=_(e=>e),n=l.data.content??[],i=n.findIndex(e=>e.props.id===s),o=i>=0?n[i]:null,f=o?o.props.showTicker??!0:!0,h=S(()=>{const e=o?.props.tickerItems;return Array.isArray(e)?e:O.map(I=>({text:I}))},[o]),m=E(),u=R(),r=e=>y(M[e],u),T=A(s,L,"block");if(!o)return t("p",{className:"sf-note",children:p("This ticker’s hero is no longer on the page.")});const c=e=>d({type:"replace",destinationZone:P,destinationIndex:i,data:{...o,props:{...o.props,...e}}});return t(F,{motion:T,body:k(w,{children:[!r("showTicker")&&!r("items")&&t(N,{}),r("showTicker")&&t(g,{label:p("Show ticker"),labelId:m,icon:t(b,{}),action:t(x,{checked:f,onChange:e=>c({showTicker:e}),ariaLabelledBy:m})}),r("items")&&t(C,{label:a.label,icon:a.icon,items:h,placeholder:"item",onChange:e=>c({tickerItems:e}),markup:!0})]})})}export{j as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as u,Fragment as N}from"react/jsx-runtime";import{useCallback as W,useEffect as q,useId as D,useRef as J,useState as g}from"react";import{Avatar as Q,Banner as S,Button as k,ColoredBadge as z,Dialog as L,Drawer as X,DropdownMenu as Z,FormField as _,iconButtonClasses as ee,Inline as E,Input as ne,ListRow as te,Select as re,SortableList as oe,Stack as P}from"efficient-shell/ui";import{EditIcon as ae,EyeIcon as H,MenuIcon as se,MoreIcon as ie,PageIcon as Y,RevertIcon as j,StylesIcon as le}from"efficient-shell/icons/efficient";import{useScreenDocument as M}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as n,sayCount as A}from"../../format/lib/editor-words.js";import{useSiteLiveState as ce}from"../lib/site-live-state.js";import{changeLine as de,closeVersionHistory as ue,HeldEditsNotSaved as he,changesSummary as ge,restoreSiteVersion as pe,useVersionHistoryOpen as fe,versionTitle as me,versionWhen as ye}from"../lib/site-versions.js";const we={page:Y,menu:se};function be(t,o){return t.pages.find(r=>r.id===o)??t.pages[0]??null}function ve(t,o){const r=window.open("","_blank");if(r)try{r.opener=null}catch{}return t.preview(o).then(({url:s})=>{r&&!r.closed?r.location.href=s:window.open(s,"_blank","noopener,noreferrer")},s=>{throw r?.close(),s})}function ke({version:t,page:o,waiting:r,busy:s,error:p,onCancel:b,onConfirm:y,onPage:i}){const l=D();if(!t)return null;const f=t.kind==="draft_before_restore",c=t.number,d=ge(t),v=f?n("Put your drafts back?"):o?n("Restore {page} from version {n}?",{page:o.name,n:c}):n("Restore version {n}?",{n:c}),m=f?n("Your drafts go back to how they were before the restore."):o?n("{page} goes back to version {n} as a draft. Nothing else on your website changes.",{page:o.name,n:c}):d?n("The whole website goes back to version {n} as a draft: {what}.",{n:c,what:d}):n("The whole website goes back to version {n} as a draft.",{n:c}),h=t.deletedPictures??0;return e(L,{open:!0,onClose:()=>{s||b()},size:"sm",title:v,footer:u(N,{children:[e(k,{variant:"secondary",onClick:b,disabled:s,children:n("Cancel")}),e(k,{onClick:y,loading:s,disabled:s,children:n("Restore as draft")})]}),children:u(P,{gap:4,children:[o&&t.pages.length>1?e(_,{label:n("Page"),htmlFor:l,children:e(re,{id:l,value:o.id,options:t.pages.map(C=>({value:C.id,label:C.name})),onChange:i,disabled:s})}):null,e("p",{children:m}),e("p",{children:n("Your live website does not change until you press Publish.")}),h>0?e(S,{tone:"warning",children:A("{n} picture in this version was deleted from the media library. It stays empty.","{n} pictures in this version were deleted from the media library. They stay empty.",h)}):null,r?e(S,{tone:"info",title:n("Your unpublished changes are kept"),children:n("They are saved in Version history as “Draft before restore”, so you can get them back.")}):null,p?e(S,{tone:"danger",children:p}):null]})})}function Ce({version:t,onCancel:o,onSave:r}){const s=D(),[p,b]=g(null),[y,i]=g(""),[l,f]=g(!1),[c,d]=g(null);if(t!==p&&(b(t),i(t?.name??""),d(null)),!t)return null;const v=y.trim()===t.name,m=async()=>{if(!(l||v)){f(!0),d(null);try{await r(y.trim())}catch{d(n("The name was not saved. Try again."))}finally{f(!1)}}};return e(L,{open:!0,onClose:()=>{l||o()},size:"sm",title:n("Name this version"),footer:u(N,{children:[e(k,{variant:"secondary",onClick:o,disabled:l,children:n("Cancel")}),e(k,{onClick:()=>{m()},loading:l,disabled:l||v,children:n("Save")})]}),children:e(_,{label:n("Name"),htmlFor:s,hint:n("Named versions are always kept. Leave it empty to take the name away."),error:c??void 0,children:e(ne,{id:s,value:y,invalid:!!c,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&m()}})})})}function Ne({version:t,expanded:o,onToggle:r,onPreview:s,onRestore:p,onRestorePage:b,onName:y}){const i=t.kind==="draft_before_restore",l=!t.live,f=t.changes.length,c=[...i?[]:[{key:"preview",label:n("Preview"),icon:e(H,{}),onSelect:s}],...l?[{key:"restore",label:i?n("Put these drafts back"):n("Restore whole website"),icon:e(j,{}),onSelect:p}]:[],...l&&!i&&t.pages.length?[{key:"restore-page",label:n("Restore one page only"),icon:e(Y,{}),onSelect:b}]:[],...i?[]:[{type:"divider",key:"divider"},{key:"name",label:n("Name this version"),icon:e(ae,{}),onSelect:y}]];return e(te,{title:u("span",{className:"sf-version-title",children:[e("span",{children:me(t)}),t.live?e(z,{tone:"success",size:"xs",children:n("Live")}):null,t.name?e(z,{tone:"neutral",size:"xs",children:n("Version {n}",{n:t.number})}):null,i?e(z,{tone:"warning",size:"xs",children:n("Not published")}):null]}),expanded:o,onToggle:r,actions:e(Z,{align:"end","aria-label":n("More"),items:c,triggerClassName:ee({variant:"ghost",size:"sm"}),trigger:e(ie,{})}),below:u(P,{gap:3,children:[u(E,{gap:2,align:"center",wrap:!0,className:"sf-version-meta",children:[e(Q,{name:t.createdBy,size:"xs"}),e("span",{children:t.createdBy}),e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:ye(t.createdAt)}),f?u(N,{children:[e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:A("{n} change","{n} changes",f)})]}):null]}),o?u(P,{gap:3,children:[f?e(P,{gap:2,children:t.changes.map(d=>{const v=we[d.kind]??le;return u(E,{gap:2,align:"center",children:[e(v,{size:16}),e("span",{children:de(d)})]},`${d.kind}:${d.id}`)})}):null,u(E,{gap:2,children:[i?null:e(k,{variant:"secondary",size:"sm",leftIcon:e(H,{}),onClick:s,children:n("Preview")}),l?e(k,{variant:"secondary",size:"sm",leftIcon:e(j,{}),onClick:p,children:n("Restore")}):null]})]}):null]})})}function Se({open:t,onClose:o,access:r,waiting:s}){const{flushSave:p,reloadFromServer:b,docId:y}=M(),[i,l]=g(null),[f,c]=g(!1),[d,v]=g(null),[m,h]=g(null),[C,F]=g(!1),[G,I]=g(null),[B,T]=g(null),[O,V]=g(!1),x=J(0),R=W(()=>{const a=++x.current;c(!1),r.list().then(w=>{a===x.current&&l(w)},()=>{a===x.current&&c(!0)})},[r]);q(()=>{t&&R()},[t,R]);const $=a=>{V(!1),ve(r,a.id).catch(()=>V(!0))},K=async()=>{if(!(!m||C)){F(!0),I(null);try{await pe({access:r,version:m.version,page:m.page,flushSave:p,reload:b}),h(null),o()}catch(a){I(a instanceof he?n("Your last changes did not save, so nothing was restored. Try again."):n("The version was not restored. Nothing changed. Try again."))}finally{F(!1)}}};return u(N,{children:[e(X,{open:t,onClose:o,side:"right",size:"md",title:n("Version history"),description:u(N,{children:[n("Every Publish keeps a copy of the whole website: pages, menus and site styles.")," ",n("Products, prices and forms always show as they are now.")]}),footer:e("span",{className:"sf-version-foot",children:n("The newest 30 are kept. Named versions are always kept.")}),children:u(P,{gap:3,children:[O?e(S,{tone:"danger",onDismiss:()=>V(!1),children:n("The preview did not open. Try again.")}):null,f?e(S,{tone:"danger",action:e(k,{variant:"secondary",size:"sm",onClick:R,children:n("Try again")}),children:n("Version history did not load.")}):i===null?e("p",{className:"sf-version-foot",children:n("Loading versions")}):i.length===0?e("p",{className:"sf-version-foot",children:n("No versions yet. Every Publish from now on keeps one.")}):e(oe,{"aria-label":n("Versions"),spacing:"comfortable",children:i.map(a=>e(Ne,{version:a,expanded:d===a.id,onToggle:()=>v(w=>w===a.id?null:a.id),onPreview:()=>$(a),onRestore:()=>{I(null),h({version:a,page:null})},onRestorePage:()=>{I(null),h({version:a,page:be(a,y)})},onName:()=>T(a)},a.id))})]})}),e(ke,{version:m?.version??null,page:m?.page??null,waiting:s,busy:C,error:G,onCancel:()=>h(null),onConfirm:()=>{K()},onPage:a=>h(w=>w&&{...w,page:w.version.pages.find(U=>U.id===a)??w.page})}),e(Ce,{version:B,onCancel:()=>T(null),onSave:async a=>{await r.name(B.id,a),T(null),R()}})]})}function Fe(){const{adapter:t,hasUnsavedEdits:o}=M(),r=t.siteVersions,s=fe(),p=ce();return r?e(Se,{open:s,onClose:ue,access:r,waiting:o||p?.state==="changed"}):null}export{ke as RestoreVersionDialog,Fe as VersionHistory,Se as VersionHistoryDrawer};
1
+ "use client";import{jsx as e,jsxs as u,Fragment as N}from"react/jsx-runtime";import{useCallback as q,useEffect as J,useId as L,useRef as Q,useState as g}from"react";import{useSettledAction as X}from"efficient-easel/easel";import{Avatar as Z,Banner as S,Button as k,ColoredBadge as z,Dialog as _,Drawer as ee,DropdownMenu as ne,FormField as H,iconButtonClasses as te,Inline as E,Input as re,ListRow as oe,Select as se,SortableList as ae,Stack as P}from"efficient-shell/ui";import{EditIcon as ie,EyeIcon as Y,MenuIcon as le,MoreIcon as ce,PageIcon as j,RevertIcon as A,StylesIcon as de}from"efficient-shell/icons/efficient";import{useScreenDocument as M}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as n,sayCount as G}from"../../format/lib/editor-words.js";import{useSiteLiveState as ue}from"../lib/site-live-state.js";import{changeLine as he,closeVersionHistory as ge,HeldEditsNotSaved as pe,changesSummary as me,restoreSiteVersion as fe,useVersionHistoryOpen as ye,versionTitle as we,versionWhen as be}from"../lib/site-versions.js";const ve={page:j,menu:le};function ke(t,o){return t.pages.find(r=>r.id===o)??t.pages[0]??null}function Ce(t,o){const r=window.open("","_blank");if(r)try{r.opener=null}catch{}return t.preview(o).then(({url:a})=>{r&&!r.closed?r.location.href=a:window.open(a,"_blank","noopener,noreferrer")},a=>{throw r?.close(),a})}function Ne({version:t,page:o,waiting:r,busy:a,error:p,onCancel:b,onConfirm:y,onPage:i}){const l=L();if(!t)return null;const m=t.kind==="draft_before_restore",c=t.number,d=me(t),v=m?n("Put your drafts back?"):o?n("Restore {page} from version {n}?",{page:o.name,n:c}):n("Restore version {n}?",{n:c}),f=m?n("Your drafts go back to how they were before the restore."):o?n("{page} goes back to version {n} as a draft. Nothing else on your website changes.",{page:o.name,n:c}):d?n("The whole website goes back to version {n} as a draft: {what}.",{n:c,what:d}):n("The whole website goes back to version {n} as a draft.",{n:c}),h=t.deletedPictures??0;return e(_,{open:!0,onClose:()=>{a||b()},size:"sm",title:v,footer:u(N,{children:[e(k,{variant:"secondary",onClick:b,disabled:a,children:n("Cancel")}),e(k,{onClick:y,loading:a,disabled:a,children:n("Restore as draft")})]}),children:u(P,{gap:4,children:[o&&t.pages.length>1?e(H,{label:n("Page"),htmlFor:l,children:e(se,{id:l,value:o.id,options:t.pages.map(C=>({value:C.id,label:C.name})),onChange:i,disabled:a})}):null,e("p",{children:f}),e("p",{children:n("Your live website does not change until you press Publish.")}),h>0?e(S,{tone:"warning",children:G("{n} picture in this version was deleted from the media library. It stays empty.","{n} pictures in this version were deleted from the media library. They stay empty.",h)}):null,r?e(S,{tone:"info",title:n("Your unpublished changes are kept"),children:n("They are saved in Version history as “Draft before restore”, so you can get them back.")}):null,p?e(S,{tone:"danger",children:p}):null]})})}function Se({version:t,onCancel:o,onSave:r}){const a=L(),[p,b]=g(null),[y,i]=g(""),[l,m]=g(!1),[c,d]=g(null);if(t!==p&&(b(t),i(t?.name??""),d(null)),!t)return null;const v=y.trim()===t.name,f=async()=>{if(!(l||v)){m(!0),d(null);try{await r(y.trim())}catch{d(n("The name was not saved. Try again."))}finally{m(!1)}}};return e(_,{open:!0,onClose:()=>{l||o()},size:"sm",title:n("Name this version"),footer:u(N,{children:[e(k,{variant:"secondary",onClick:o,disabled:l,children:n("Cancel")}),e(k,{onClick:()=>{f()},loading:l,disabled:l||v,children:n("Save")})]}),children:e(H,{label:n("Name"),htmlFor:a,hint:n("Named versions are always kept. Leave it empty to take the name away."),error:c??void 0,children:e(re,{id:a,value:y,invalid:!!c,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&f()}})})})}function Pe({version:t,expanded:o,onToggle:r,onPreview:a,onRestore:p,onRestorePage:b,onName:y}){const i=t.kind==="draft_before_restore",l=!t.live,m=t.changes.length,c=[...i?[]:[{key:"preview",label:n("Preview"),icon:e(Y,{}),onSelect:a}],...l?[{key:"restore",label:i?n("Put these drafts back"):n("Restore whole website"),icon:e(A,{}),onSelect:p}]:[],...l&&!i&&t.pages.length?[{key:"restore-page",label:n("Restore one page only"),icon:e(j,{}),onSelect:b}]:[],...i?[]:[{type:"divider",key:"divider"},{key:"name",label:n("Name this version"),icon:e(ie,{}),onSelect:y}]];return e(oe,{title:u("span",{className:"sf-version-title",children:[e("span",{children:we(t)}),t.live?e(z,{tone:"success",size:"xs",children:n("Live")}):null,t.name?e(z,{tone:"neutral",size:"xs",children:n("Version {n}",{n:t.number})}):null,i?e(z,{tone:"warning",size:"xs",children:n("Not published")}):null]}),expanded:o,onToggle:r,actions:e(ne,{align:"end","aria-label":n("More"),items:c,triggerClassName:te({variant:"ghost",size:"sm"}),trigger:e(ce,{})}),below:u(P,{gap:3,children:[u(E,{gap:2,align:"center",wrap:!0,className:"sf-version-meta",children:[e(Z,{name:t.createdBy,size:"xs"}),e("span",{children:t.createdBy}),e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:be(t.createdAt)}),m?u(N,{children:[e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:G("{n} change","{n} changes",m)})]}):null]}),o?u(P,{gap:3,children:[m?e(P,{gap:2,children:t.changes.map(d=>{const v=ve[d.kind]??de;return u(E,{gap:2,align:"center",children:[e(v,{size:16}),e("span",{children:he(d)})]},`${d.kind}:${d.id}`)})}):null,u(E,{gap:2,children:[i?null:e(k,{variant:"secondary",size:"sm",leftIcon:e(Y,{}),onClick:a,children:n("Preview")}),l?e(k,{variant:"secondary",size:"sm",leftIcon:e(A,{}),onClick:p,children:n("Restore")}):null]})]}):null]})})}function Ie({open:t,onClose:o,access:r,waiting:a}){const{flushSave:p,reloadFromServer:b,docId:y}=M(),[i,l]=g(null),[m,c]=g(!1),[d,v]=g(null),[f,h]=g(null),[C,F]=g(!1),[O,I]=g(null),[B,T]=g(null),[$,V]=g(!1),x=Q(0),R=q(()=>{const s=++x.current;c(!1),r.list().then(w=>{s===x.current&&l(w)},()=>{s===x.current&&c(!0)})},[r]);J(()=>{t&&R()},[t,R]);const K=s=>{V(!1),Ce(r,s.id).catch(()=>V(!0))},U=async()=>{if(!(!f||C)){F(!0),I(null);try{await fe({access:r,version:f.version,page:f.page,flushSave:p,reload:b}),h(null),o()}catch(s){I(s instanceof pe?n("Your last changes did not save, so nothing was restored. Try again."):n("The version was not restored. Nothing changed. Try again."))}finally{F(!1)}}},D=X({onPress:()=>{U()},busy:C});return u(N,{children:[e(ee,{open:t,onClose:o,side:"right",size:"md",title:n("Version history"),description:u(N,{children:[n("Every Publish keeps a copy of the whole website: pages, menus and site styles.")," ",n("Products, prices and forms always show as they are now.")]}),footer:e("span",{className:"sf-version-foot",children:n("The newest 30 are kept. Named versions are always kept.")}),children:u(P,{gap:3,children:[$?e(S,{tone:"danger",onDismiss:()=>V(!1),children:n("The preview did not open. Try again.")}):null,m?e(S,{tone:"danger",action:e(k,{variant:"secondary",size:"sm",onClick:R,children:n("Try again")}),children:n("Version history did not load.")}):i===null?e("p",{className:"sf-version-foot",children:n("Loading versions")}):i.length===0?e("p",{className:"sf-version-foot",children:n("No versions yet. Every Publish from now on keeps one.")}):e(ae,{"aria-label":n("Versions"),spacing:"comfortable",children:i.map(s=>e(Pe,{version:s,expanded:d===s.id,onToggle:()=>v(w=>w===s.id?null:s.id),onPreview:()=>K(s),onRestore:()=>{I(null),h({version:s,page:null})},onRestorePage:()=>{I(null),h({version:s,page:ke(s,y)})},onName:()=>T(s)},s.id))})]})}),e(Ne,{version:f?.version??null,page:f?.page??null,waiting:a,busy:D.busy===!0,error:O,onCancel:()=>h(null),onConfirm:D.onPress,onPage:s=>h(w=>w&&{...w,page:w.version.pages.find(W=>W.id===s)??w.page})}),e(Se,{version:B,onCancel:()=>T(null),onSave:async s=>{await r.name(B.id,s),T(null),R()}})]})}function Le(){const{adapter:t,hasUnsavedEdits:o}=M(),r=t.siteVersions,a=ye(),p=ue();return r?e(Ie,{open:a,onClose:ge,access:r,waiting:o||p?.state==="changed"}):null}export{Ne as RestoreVersionDialog,Le as VersionHistory,Ie as VersionHistoryDrawer};
@@ -1,10 +1,11 @@
1
1
  import type { WebsitePreview } from "../../format/lib/web-backend.js";
2
2
  type DraftLink = NonNullable<WebsitePreview["draftLink"]>;
3
3
  type Opener = Pick<Window, "open">;
4
- export declare function openDraftPreview({ pageId, liveHref, draftLink, win, }: {
4
+ export declare function openDraftPreview({ pageId, liveHref, draftLink, ready, win, }: {
5
5
  pageId: string;
6
6
  liveHref: string;
7
7
  draftLink: DraftLink;
8
+ ready?: () => Promise<unknown>;
8
9
  win?: Opener;
9
10
  }): Promise<void>;
10
11
  export declare function WebsitePreviewButton({ liveHref, pageId, draftLink, }: {
@@ -1 +1 @@
1
- "use client";import{jsx as o}from"react/jsx-runtime";import{ExternalIcon as c}from"efficient-easel/icons";import{EaselIconButton as p}from"efficient-easel/chrome";import{Tooltip as f,iconButtonClasses as b}from"efficient-shell/ui";import{say as a}from"../../format/lib/editor-words.js";function m({pageId:t,liveHref:e,draftLink:r,win:s=window}){const n=s.open("","_blank");if(n)try{n.opener=null}catch{}const l=i=>{n&&!n.closed?n.location.href=i:s.open(i,"_blank","noopener,noreferrer")};return r(t).then(i=>l(i.url??e),()=>l(e))}function x({liveHref:t,pageId:e,draftLink:r}){return r&&e?o(p,{label:a("Preview your saved draft in a new tab"),tip:a("Open your saved draft in a new tab. Visitors don't see it."),onClick:()=>{m({pageId:e,liveHref:t,draftLink:r})},children:o(c,{})}):o(f,{content:a("Preview the live site (opens in a new tab)"),side:"bottom",children:o("a",{className:b({className:"es-iconbtn"}),href:t,target:"_blank",rel:"noopener noreferrer","aria-label":a("Preview the live site in a new tab"),children:o(c,{})})})}export{x as WebsitePreviewButton,m as openDraftPreview};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import{useEffect as h,useRef as p,useState as v}from"react";import{ExternalIcon as m}from"efficient-easel/icons";import{EaselIconButton as y}from"efficient-easel/chrome";import{Tooltip as P,iconButtonClasses as g}from"efficient-shell/ui";import{useSettledPress as x}from"efficient-easel/easel";import{useScreenDocument as S}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as l}from"../../format/lib/editor-words.js";async function _({pageId:i,liveHref:n,draftLink:a,ready:c=async()=>!0,win:r=window}){const e=r.open("","_blank");if(e)try{e.opener=null}catch{}const o=t=>{e&&!e.closed?e.location.href=t:r.open(t,"_blank","noopener,noreferrer")};try{await c()}catch{}return a(i).then(t=>o(t.url??n),()=>o(n))}function I({liveHref:i,pageId:n,draftLink:a}){const{flushSave:c}=S(),r=p(c);r.current=c;const e=x(),[o,t]=v(!1),u=p(null);if(h(()=>()=>u.current?.(),[]),a&&n){const d=()=>new Promise((f,w)=>{u.current=()=>f(!1),e.run(()=>{u.current=null,r.current().then(f,w)})}),b=()=>{o||e.waiting||(t(!0),_({pageId:n,liveHref:i,draftLink:a,ready:d}).finally(()=>t(!1)))};return s(y,{label:l("Preview your saved draft in a new tab"),tip:l("Open your saved draft in a new tab. Visitors don't see it."),disabled:o||e.waiting,onClick:b,children:s(m,{})})}return s(P,{content:l("Preview the live site (opens in a new tab)"),side:"bottom",children:s("a",{className:g({className:"es-iconbtn"}),href:i,target:"_blank",rel:"noopener noreferrer","aria-label":l("Preview the live site in a new tab"),children:s(m,{})})})}export{I as WebsitePreviewButton,_ as openDraftPreview};
@@ -1 +1 @@
1
- "use client";import{jsx as s,Fragment as B,jsxs as k}from"react/jsx-runtime";import{useCallback as R,useEffect as g,useRef as $,useState as y}from"react";import{Button as ee,Tooltip as te}from"efficient-shell/ui";import{SettingsSwitch as oe}from"efficient-easel/panel";import{PagesIcon as re,StylesIcon as ne}from"efficient-easel/rail";import{PaletteIcon as ie}from"efficient-shell/icons/efficient";import{TemplateIcon as se}from"efficient-easel/icons";import{Subtree as ae,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ce}from"./LocationsTreeContext.js";import de from"./PagesPanel.js";import{usePreviewChat as le}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as pe}from"./preview-devices.js";import{PreviewDeviceContext as me}from"efficient-easel/draw/client";import{usePreviewSocial as fe}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as ue}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Se,usePreviewTicker as Ee}from"../../render/components/PreviewTickerContext.js";import{usePreviewHeroPart as he}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Pe,HERO_PART_MODE as W,heroMediaRows as Te,heroPartId as M,readHeroPartId as we}from"../../render/lib/document/hero-media-parts.js";import ge,{CHAT_MODE as Ie,HEADER_MODE as be,SOCIAL_MODE as ve,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as _e}from"./SectionEditor.js";import C from"./SectionIcon.js";import ke from"./SectionThumbnail.js";import{useScreenDocument as O}from"efficient-easel/screen/components/ScreenDocumentContext";import Re from"./StylesPanel.js";import{LOCATIONS_TYPE as Ce,useLocationsTree as Oe}from"./useLocationsTree.js";import{usePinnedChromeSeed as Le}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ae}from"./useHostDocumentBridge.js";import{usePreviewHref as Be}from"./usePreviewHref.js";import{WebsitePreviewButton as ye}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as De,SITE_STYLES_TABS as Ne,SITE_STYLES_TEXT_TAB as He,useWebsiteName as We}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Me}from"./useWebsiteMainAction.js";import{VersionHistory as Ve}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as xe}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ge,heroGroupNestDepth as Ye}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Fe}from"../../format/lib/markup.js";import{categoryShortLabel as ze,PINNED_SECTION_TYPE as Ke}from"../lib/document/add-palette.js";import{canAddTo as je}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Ue}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as Ze}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as qe,setBookingPreview as Xe}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as Je}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as Qe}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as $e,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as et,readLeftView as tt,resolveLeftView as ot,writeLeftView as rt}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as nt}from"../lib/document/locked-blocks.js";import{everyPageNotice as it,noOwnTab as st,pinnedReach as Y,websiteDuplicateBlocked as at}from"../lib/document/every-page.js";import{sharedSectionReach as ct,WEBSITE_SHARED_SECTIONS as dt}from"../lib/shared-sections-layer.js";import{activeSharedSections as L,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as lt}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as pt,scrollPreviewToTop as z}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as mt}from"../lib/document/overrides.js";import{labelAtLevel as ft}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as ut}from"../../format/lib/document/media-drop.js";import{editorWords as St,say as p}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as Et}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as ht,isSectionGroupType as Pt,sectionGroupZone as Tt,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as wt}from"../../format/lib/document/section-groups.js";import{resolveSaveAsTemplateAction as gt,SAVE_AS_TEMPLATE_EVENT as It}from"../../format/lib/save-as-template-action.js";import{cityPalettePresets as bt}from"../lib/sections/city-presets.js";import{newSectionNode as vt}from"../lib/sections/new-section-node.js";import{useHostProducts as _t}from"../lib/use-host-products.js";import{backendOf as kt}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=Ee(),d=H().tree,l=e,n=l.kind==="ticker"?l.heroId:null,a=R(i=>{if(!i)return;t({kind:"ticker",heroId:i}),pt(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(a)},[r,a]),{partRows:(i,{rowClick:f})=>{const u=String(i.props.id);return i.type==="Hero"&&s(D,{icon:s(C,{type:"ticker",size:13}),name:p(Se),onSelect:()=>a(u),selected:n===u,rowProps:{onClick:f(()=>a(u))},words:d})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=he(),d=H().tree,{appState:l}=N(m=>m),n=l.data.content??[],a=$(n);a.current=n;const i=e,f=Pe.find(m=>W[m]===i.kind),u=f&&"nodeId"in i?M(String(i.nodeId),f):null,E=R(m=>{const c=we(m);if(!c)return;const h=a.current.findIndex(T=>String(T.props.id)===c.nodeId);if(h<0)return;const P={kind:W[c.part],nodeId:c.nodeId};t({index:h},P)},[t]);return g(()=>{o(u)},[u,o]),g(()=>{r(E)},[r,E]),{partRows:(m,{rowClick:c})=>{const h=String(m.props.id),P=Te(m);if(P.length===0)return null;const T=S=>{const w=M(h,S.part);return s(D,{icon:s(C,{type:S.part==="media"?"heroMedia":"heroImage",size:13}),name:p(S.label),onSelect:()=>E(w),selected:u===w,rowProps:{onClick:c(()=>E(w))},words:d},w)},[b,...I]=P;return k(B,{children:[T(b),I.length>0&&s(ae,{children:I.map(T)})]})}}}function Z(e,t){return{partRows:(o,r)=>k(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Rt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:d,docId:l,hasUnsavedEdits:n,bridgeCapabilities:a,notifyParent:i,token:f}=O(),{hasPreviewLink:u}=o,E=kt(x()).preview?.draftLink,m=Me(e.data),c=gt({hasTrustedConsole:!!f,canCreatePlatformTemplate:a.canCreatePlatformTemplate,capabilities:o,siteId:d,hasUnsavedEdits:n}),h=R(()=>{!d||!r||i(It,{siteId:d,slug:r})},[i,d,r]),P=Be({pageSlug:r,siteId:d,token:f}),T=t.previewHref?.(r)??P;return{barLead:()=>c.visible&&s(te,{side:"bottom",content:c.enabled?p("Save this website as a platform template"):p(c.disabledReason),children:s("span",{className:"sf-tip-disabled",tabIndex:c.enabled?void 0:0,children:s(ee,{variant:"secondary",disabled:!c.enabled,onClick:h,rightIcon:s(se,{size:15}),children:p("Save as Template")})})}),barView:()=>u&&r&&s(ye,{liveHref:T,pageId:l??null,draftLink:E}),mainAction:m}}function Ct(e,t){const{capabilities:o,templateId:r,siteId:d,tokenRef:l,navigate:n}=O(),{hasSiteTheme:a,explainsSiteSettings:i}=o,f=S=>t.setView(S),[u,E]=y(Ne[0].id),[m,c]=y(!1),{surface:h,setSurface:P}=ue(),T=()=>{if(a){f("styles"),t.reveal(),z();return}e.show(V),e.reveal(),z()},b={id:"pages",label:p("Pages"),icon:s(re,{}),panel:({onHide:S})=>s(de,{activeSurface:h,onPreviewSurface:P,onNavigate:w=>{P(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:d??void 0})},onClose:S})},I=[];return!a&&i&&I.push({id:"appearance",label:p("Appearance"),icon:s(ie,{}),active:e.kind==="website",onSelect:T}),a&&I.push({id:"styles",label:p("Styles"),icon:s(ne,{}),panel:({onHide:S,notify:w})=>s(Re,{tokenRef:l,siteId:d??void 0,onClose:S,onNotify:w,tab:u,onTabChange:E,revealPageGroup:m,onPageGroupRevealed:()=>c(!1)})}),{railLead:[b],railTrail:I,resolveLeftView:S=>ot(S,a),openSettings:T,openStyles:()=>{E(He),f("styles")},openPageStyles:a?()=>{E(De),c(!0),f("styles"),t.reveal()}:i?()=>{e.show(_e),e.reveal()}:void 0}}function Ot(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=O(),d=N(n=>n.config),l=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:d}),()=>F(null)),[e,t,o,d]),g(()=>{const n=L();if(!n||!r)return;let a=!1;return lt(l).list().then(i=>{a||n.learn(i)}).catch(()=>{}),()=>{a=!0}},[r,l])}function Lt(e,t,o,r){const{kind:d,open:l}=e,{selected:n,zoneOf:a}=t;g(()=>{Xe(n?.type==="BookingBox"&&n.props.region==="confirm"?qe(a(String(n.props.id))):null)},[n?.props.id]);const i=Oe(e,t),{capabilities:{hasSiteSettings:f}}=O();Ot();const{chat:u,setChat:E,setSelected:m,setSelectHandler:c}=le(),h=R(()=>l(Ie),[l]),P=d==="chat";g(()=>{m(P)},[P,m]),g(()=>{c(h)},[c,h]);const{setOpenHandler:T}=fe(),b=R(()=>l(ve),[l]);g(()=>{T(b)},[T,b]);const I=Z(j(e),U(e)),S=Rt(t),w=Ct(e,r),J=o.device;return{...I,...S,...w,hasOwnRows:_=>_.type===Ce,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:_=>s(ce.Provider,{value:!0,children:k(me.Provider,{value:J,children:[_,s(Ve,{})]})}),addPanelRow:_=>f?k("div",{className:"sf-addside-sitewide",children:[s("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:s(C,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{_(),h()},children:[p("Live chat"),s("span",{className:"sf-addside-sitewide-desc",children:p("A chat bubble on every page")})]}),s(oe,{checked:u.enabled,onChange:Q=>E({enabled:Q}),ariaLabel:p("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function At(e){const t=St();if(!e||!t)return e;q!==t&&(q=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:p(r.label)})):null,spec:e.spec?{...e.spec,addLabel:p(e.spec.addLabel)}:null},A.set(e,o)),o}const Bt={isLockedBlock:(e,t)=>nt(e,t)||!!(t&&L()?.heldElsewhere(t.props.id)),duplicateBlocked:at,nestDepth:(e,t,o)=>t===Ge?Ye(e,o):0,newSectionNode:vt,canAddTo:(e,t)=>At(je(e,t)),blockIsOffered:Ze,slotsOf:Ue},yt=new Proxy(Et,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?p(o):o}}),Dt={labelAtLevel:(e,t,o)=>p(ft(e,t,o)),descriptions:yt,categoryLabel:e=>{const t=ze(e);return t===void 0?void 0:p(t)},firstSection:Ke,blockRowName:Je,rowName:Qe,plainText:Fe,Icon:C,Thumbnail:ke,useProducts:_t,presets:bt()},Nt={desktop:2e3,tablet:800,mobile:390},X="desktop",Ht={options:pe,initial:X,fluid:X,widths:Nt},Wt={read:tt,write:e=>rt(e),forSelection:(e,t)=>et(e,t)},Mt={first:G,last:$e,firstGroup:wt,lastGroup:K,isSectionGroup:Pt,sectionGroupZone:Tt,panelOf:e=>e===G?be:null,get sharedReach(){return v()?xt:void 0},get shared(){return L()?dt:void 0},get groupTab(){return v()?st:void 0},get groupBadge(){return v()?Y({type:K})??void 0:void 0},get changeNotice(){return v()?it():void 0},get band(){return v()?Vt:void 0},get groupAccepts(){return v()?ht:void 0}},Vt={foldable:!0},xt=e=>Y(e)??ct(e);function Gt(e){return{...Z(j(e),U(e)),openSettings:()=>e.show(V)}}function Yt(e,t){Le(e,t),Ae()}const er={useOwnerName:We,useDocumentLabel:xe,useBridges:Lt,useStandaloneBridges:Gt,useDocumentPass:Yt,blockRules:Bt,blockLook:Dt,devices:Ht,leftView:Wt,pinned:Mt,Canvas:mt,canvasDrag:{media:ut},Inspector:ge};export{er as WEBSITE_SCREEN};
1
+ "use client";import{jsx as a,Fragment as B,jsxs as k}from"react/jsx-runtime";import{useCallback as R,useEffect as g,useRef as $,useState as D}from"react";import{SettingsSwitch as ee}from"efficient-easel/panel";import{PagesIcon as te,StylesIcon as oe}from"efficient-easel/rail";import{PaletteIcon as re}from"efficient-shell/icons/efficient";import{Subtree as ne,TreeRow as y}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ie}from"./LocationsTreeContext.js";import se from"./PagesPanel.js";import{usePreviewChat as ae}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as ce}from"./preview-devices.js";import{PreviewDeviceContext as de}from"efficient-easel/draw/client";import{usePreviewSocial as le}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as me,usePreviewTicker as ue}from"../../render/components/PreviewTickerContext.js";import{usePreviewHeroPart as fe}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Se,HERO_PART_MODE as W,heroMediaRows as Ee,heroPartId as M,readHeroPartId as Pe}from"../../render/lib/document/hero-media-parts.js";import Te,{CHAT_MODE as we,HEADER_MODE as he,SOCIAL_MODE as ge,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as Ie}from"./SectionEditor.js";import C from"./SectionIcon.js";import be from"./SectionThumbnail.js";import{useScreenDocument as O}from"efficient-easel/screen/components/ScreenDocumentContext";import ve from"./StylesPanel.js";import{LOCATIONS_TYPE as _e,useLocationsTree as ke}from"./useLocationsTree.js";import{usePinnedChromeSeed as Re}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ce}from"./useHostDocumentBridge.js";import{usePreviewHref as Oe}from"./usePreviewHref.js";import{WebsitePreviewButton as Le}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Ae,SITE_STYLES_TABS as Be,SITE_STYLES_TEXT_TAB as De,useWebsiteName as ye}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Ne}from"./useWebsiteMainAction.js";import{VersionHistory as He}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as We}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Me,heroGroupNestDepth as Ve}from"../../format/lib/hero-group-placement.js";import{stripMarkup as xe}from"../../format/lib/markup.js";import{categoryShortLabel as Ge,PINNED_SECTION_TYPE as Ye}from"../lib/document/add-palette.js";import{canAddTo as Fe}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Ke}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as je}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as ze,setBookingPreview as Ue}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as Ze}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as qe}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as Xe,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as Je,readLeftView as Qe,resolveLeftView as $e,writeLeftView as et}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as tt}from"../lib/document/locked-blocks.js";import{everyPageNotice as ot,noOwnTab as rt,pinnedReach as Y,websiteDuplicateBlocked as nt}from"../lib/document/every-page.js";import{sharedSectionReach as it,WEBSITE_SHARED_SECTIONS as st}from"../lib/shared-sections-layer.js";import{activeSharedSections as L,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as at}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as ct,scrollPreviewToTop as K}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as dt}from"../lib/document/overrides.js";import{labelAtLevel as lt}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as pt}from"../../format/lib/document/media-drop.js";import{editorWords as mt,say as S}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ut}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as ft,isSectionGroupType as St,sectionGroupZone as Et,SITE_FOOTER_TYPE as j,SITE_HEADER_TYPE as Pt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as Tt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as wt,SAVE_AS_TEMPLATE_EVENT as ht}from"../../format/lib/save-as-template-action.js";import{cityPalettePresets as gt}from"../lib/sections/city-presets.js";import{newSectionNode as It}from"../lib/sections/new-section-node.js";import{useHostProducts as bt}from"../lib/use-host-products.js";import{backendOf as vt}from"../lib/website-session.js";function z({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=ue(),c=H().tree,l=e,n=l.kind==="ticker"?l.heroId:null,s=R(i=>{if(!i)return;t({kind:"ticker",heroId:i}),ct(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const u=String(i.props.id);return i.type==="Hero"&&a(y,{icon:a(C,{type:"ticker",size:13}),name:S(me),onSelect:()=>s(u),selected:n===u,rowProps:{onClick:m(()=>s(u))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=fe(),c=H().tree,{appState:l}=N(p=>p),n=l.data.content??[],s=$(n);s.current=n;const i=e,m=Se.find(p=>W[p]===i.kind),u=m&&"nodeId"in i?M(String(i.nodeId),m):null,E=R(p=>{const d=Pe(p);if(!d)return;const P=s.current.findIndex(w=>String(w.props.id)===d.nodeId);if(P<0)return;const T={kind:W[d.part],nodeId:d.nodeId};t({index:P},T)},[t]);return g(()=>{o(u)},[u,o]),g(()=>{r(E)},[r,E]),{partRows:(p,{rowClick:d})=>{const P=String(p.props.id),T=Ee(p);if(T.length===0)return null;const w=f=>{const h=M(P,f.part);return a(y,{icon:a(C,{type:f.part==="media"?"heroMedia":"heroImage",size:13}),name:S(f.label),onSelect:()=>E(h),selected:u===h,rowProps:{onClick:d(()=>E(h))},words:c},h)},[b,...I]=T;return k(B,{children:[w(b),I.length>0&&a(ne,{children:I.map(w)})]})}}}function Z(e,t){return{partRows:(o,r)=>k(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function _t(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:l,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=O(),{hasPreviewLink:u}=o,E=vt(x()).preview?.draftLink,p=Ne(e.data),d=wt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),P=R(()=>{!c||!r||i(ht,{siteId:c,slug:r})},[i,c,r]),T=Oe({pageSlug:r,siteId:c,token:m}),w=t.previewHref?.(r)??T;return{barLead:()=>d.visible&&a(Tt,{enabled:d.enabled,reason:d.enabled?"":d.disabledReason,onSaved:P}),barView:()=>u&&r&&a(Le,{liveHref:w,pageId:l??null,draftLink:E}),mainAction:p}}function kt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:l,navigate:n}=O(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=f=>t.setView(f),[u,E]=D(Be[0].id),[p,d]=D(!1),{surface:P,setSurface:T}=pe(),w=()=>{if(s){m("styles"),t.reveal(),K();return}e.show(V),e.reveal(),K()},b={id:"pages",label:S("Pages"),icon:a(te,{}),panel:({onHide:f})=>a(se,{activeSurface:P,onPreviewSurface:T,onNavigate:h=>{T(null),n(r?{kind:"template",id:r,pageSlug:h}:{kind:"page",slug:h,siteId:c??void 0})},onClose:f})},I=[];return!s&&i&&I.push({id:"appearance",label:S("Appearance"),icon:a(re,{}),active:e.kind==="website",onSelect:w}),s&&I.push({id:"styles",label:S("Styles"),icon:a(oe,{}),panel:({onHide:f,notify:h})=>a(ve,{tokenRef:l,siteId:c??void 0,onClose:f,onNotify:h,tab:u,onTabChange:E,revealPageGroup:p,onPageGroupRevealed:()=>d(!1)})}),{railLead:[b],railTrail:I,resolveLeftView:f=>$e(f,s),openSettings:w,openStyles:()=>{E(De),m("styles")},openPageStyles:s?()=>{E(Ae),d(!0),m("styles"),t.reveal()}:i?()=>{e.show(Ie),e.reveal()}:void 0}}function Rt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=O(),c=N(n=>n.config),l=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=L();if(!n||!r)return;let s=!1;return at(l).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,l])}function Ct(e,t,o,r){const{kind:c,open:l}=e,{selected:n,zoneOf:s}=t;g(()=>{Ue(n?.type==="BookingBox"&&n.props.region==="confirm"?ze(s(String(n.props.id))):null)},[n?.props.id]);const i=ke(e,t),{capabilities:{hasSiteSettings:m}}=O();Rt();const{chat:u,setChat:E,setSelected:p,setSelectHandler:d}=ae(),P=R(()=>l(we),[l]),T=c==="chat";g(()=>{p(T)},[T,p]),g(()=>{d(P)},[d,P]);const{setOpenHandler:w}=le(),b=R(()=>l(ge),[l]);g(()=>{w(b)},[w,b]);const I=Z(z(e),U(e)),f=_t(t),h=kt(e,r),J=o.device;return{...I,...f,...h,hasOwnRows:_=>_.type===_e,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:_=>a(ie.Provider,{value:!0,children:k(de.Provider,{value:J,children:[_,a(He,{})]})}),addPanelRow:_=>m?k("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(C,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{_(),P()},children:[S("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:S("A chat bubble on every page")})]}),a(ee,{checked:u.enabled,onChange:Q=>E({enabled:Q}),ariaLabel:S("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function Ot(e){const t=mt();if(!e||!t)return e;q!==t&&(q=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:S(r.label)})):null,spec:e.spec?{...e.spec,addLabel:S(e.spec.addLabel)}:null},A.set(e,o)),o}const Lt={isLockedBlock:(e,t)=>tt(e,t)||!!(t&&L()?.heldElsewhere(t.props.id)),duplicateBlocked:nt,nestDepth:(e,t,o)=>t===Me?Ve(e,o):0,newSectionNode:It,canAddTo:(e,t,o,r)=>Ot(Fe(e,t,r)),blockIsOffered:je,slotsOf:Ke},At=new Proxy(ut,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?S(o):o}}),Bt={labelAtLevel:(e,t,o)=>S(lt(e,t,o)),descriptions:At,categoryLabel:e=>{const t=Ge(e);return t===void 0?void 0:S(t)},firstSection:Ye,blockRowName:Ze,rowName:qe,plainText:xe,Icon:C,Thumbnail:be,useProducts:bt,presets:gt()},Dt={desktop:2e3,tablet:800,mobile:390},X="desktop",yt={options:ce,initial:X,fluid:X,widths:Dt},Nt={read:Qe,write:e=>et(e),forSelection:(e,t)=>Je(e,t)},Ht={first:G,last:Xe,firstGroup:Pt,lastGroup:j,isSectionGroup:St,sectionGroupZone:Et,panelOf:e=>e===G?he:null,get sharedReach(){return v()?Mt:void 0},get shared(){return L()?st:void 0},get groupTab(){return v()?rt:void 0},get groupBadge(){return v()?Y({type:j})??void 0:void 0},get changeNotice(){return v()?ot():void 0},get band(){return v()?Wt:void 0},get groupAccepts(){return v()?ft:void 0}},Wt={foldable:!0},Mt=e=>Y(e)??it(e);function Vt(e){return{...Z(z(e),U(e)),openSettings:()=>e.show(V)}}function xt(e,t){Re(e,t),Ce()}const Jo={useOwnerName:ye,useDocumentLabel:We,useBridges:Ct,useStandaloneBridges:Vt,useDocumentPass:xt,blockRules:Lt,blockLook:Bt,devices:yt,leftView:Nt,pinned:Ht,Canvas:dt,canvasDrag:{media:pt},Inspector:Te};export{Jo as WEBSITE_SCREEN};
@@ -19,7 +19,17 @@ export type SiteStylesTabItem = {
19
19
  export declare const SITE_STYLES_TABS: SiteStylesTabItem[];
20
20
  export declare function siteWidthPatch(v: number | null): SiteThemeRowPatch;
21
21
  export declare function blockGapPatch(v: number | null): SiteThemeRowPatch;
22
+ export declare function blockGapPhonePatch(v: number | null): SiteThemeRowPatch;
22
23
  export declare function siteGutterPatch(v: number | null): SiteThemeRowPatch;
24
+ export declare function siteGutterPhonePatch(v: number | null): SiteThemeRowPatch;
25
+ export declare function SideSpaceRootField({ persist, showHint, }: {
26
+ persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
27
+ showHint: boolean;
28
+ }): import("react").JSX.Element | null;
29
+ export declare function BlockGapRootField({ persist, showHint, }: {
30
+ persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
31
+ showHint: boolean;
32
+ }): import("react").JSX.Element | null;
23
33
  export declare function PageGroupFields({ persist, showHint, }: {
24
34
  persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
25
35
  showHint?: boolean;
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as x,jsxs as w}from"react/jsx-runtime";import{useEasel as B,useRootFields as G}from"efficient-easel/easel";import{Inspector as W}from"efficient-easel/fields";import{SettingsGroup as v}from"efficient-easel/panel";import{useEffect as z,useRef as Y,useState as E}from"react";import j from"./ThemeField.js";import U from"./CornersField.js";import X from"./CardShadowField.js";import q from"./ShadowColourField.js";import K from"./BlockGapField.js";import M from"./HoverEffectField.js";import $ from"./PhotographyField.js";import V from"./ShareButtonField.js";import J from"./SideSpaceField.js";import{BackgroundWidthRow as Q,ContentWidthRow as Z,SITE_BACKGROUND_HINT as D,SITE_CONTENT_HINT as ee}from"./SectionWidthRows.js";import te from"./SiteAccentField.js";import ne from"./SiteTextStylesField.js";import{usePreviewHeader as S}from"../../render/components/PreviewHeaderContext.js";import{Button as oe,EmptyState as re,Tabs as ie,Tooltip as se,tabButtonId as ae,tabPanelId as ce}from"efficient-shell/ui";import{ContrastIcon as le,NoteIcon as ue,SettingsIcon as de,TypeIcon as he}from"efficient-easel/icons";import{useThemeRowPersist as pe}from"../lib/theme-row-persist.js";import{themeSaveNotice as fe}from"../../format/lib/theme-save-message.js";import{say as f}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as ge}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as R}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as me}from"../lib/document/page-root-fields.js";import{previewFrame as Se}from"efficient-easel/screen/lib/document/preview-dom";import{useSiteTextStylesWriter as Ce}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as _e,normalizeCornerRadius as Te,normalizeCornerStyle as xe,normalizeShadowColor as we,selectedThemeColors as ye}from"../../format/lib/theme.js";const H="sf-site-styles",be="sf-site-styles-tabpanel",Pe=!1,Ee="Show hints";function Re({shown:e,onChange:t}){return n("div",{className:"sf-hints",children:n(oe,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:n(ue,{size:13}),onClick:()=>t(!e),children:f(Ee)})})}const Bt="text",O="basics",N="this-page-group",I=[{id:O,label:"Basics",icon:n(de,{})},{id:"theme",label:"Theme",icon:n(le,{})},{id:"text",label:"Text",icon:n(he,{})}];function Ie({themeFromDocument:e,persist:t}){const{appState:o,dispatch:i}=B(l=>l),{theme:c,setTheme:r}=S(),p=o.data,h=p.root?.props??{},a=l=>{if(e){const g={...h,theme:l};i({type:"replaceRoot",root:{...p.root,props:g},recordHistory:!0})}else r(l);t({selected_preset:l.selected,theme_presets:l.themes})};return n(j,{value:e?h.theme:c,onChange:a})}function Fe({themeFromDocument:e,persist:t}){const[o,i]=E(null),{theme:c,setFonts:r,setSizes:p,setHeadingTypography:h}=S(),a=Ce({themeFromDocument:e,persist:t}),{old:l,saved:g,writeRoot:m}=a,u=a.fonts,d=a.sizes,T=a.typography,y=s=>s.values.size??Ne(Ae[s.id]??"body")??Be[s.kind],C=s=>a.write(s),F=He(c),b=s=>{const _={...u,accent:s};e?m({fonts:_}):r(_),t({accent_font:s})},P=s=>{p({...d,accent:s}),t({accent_size_px:s})},k=s=>{const _={...T,weightStrong:s};e?m({headingTypography:_}):h(_),t({heading_weight_strong:s})},L=s=>{const _={...T,italicStrong:s};e?m({headingTypography:_}):h(_),t({accent_italic:s})};return w(x,{children:[n(ne,{saved:g,old:l,colours:F,sizeOf:y,onChange:C,openId:o===A?null:o,onOpenChange:i,withoutSize:e}),n(te,{font:u.accent,size:d.accent,weight:T.weightStrong,italic:T.italicStrong,headingWeight:T.weight,open:o===A,onOpenChange:s=>i(s?A:null),onChange:s=>{s.key==="font"?b(s.value):s.key==="size"?P(s.value):s.key==="weight"?k(s.value):L(s.value)},withoutSize:e})]})}const A="accent";function He(e){const t=ye(e);return[{key:"accent",name:f("Accent"),value:t.accent},{key:"text",name:f("Text"),value:t.text},{key:"labels",name:f("Labels"),value:t.muted??t.text}]}const Ae={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Be={heading:32,body:14},Oe={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Ne(e){if(typeof document>"u")return null;const o=(Se()?.contentDocument??document).querySelector(Oe[e]);if(!o)return null;const i=parseFloat(getComputedStyle(o).fontSize);return Number.isFinite(i)?i:null}function ke({themeFromDocument:e,persist:t,showHint:o}){const{appState:i,dispatch:c}=B(d=>d),{cornerRadiusPx:r,setCornerRadiusPx:p}=S(),h=i.data,a=h.root?.props??{},l=a.cornerRadiusPx===void 0?_e[xe(a.cornerStyle)]:Te(a.cornerRadiusPx),g=e?l:r,m=d=>c({type:"replaceRoot",root:{...h.root,props:{...a,...d}},recordHistory:!0});return n(U,{value:g,onChange:d=>{e?m({cornerRadiusPx:d}):p(d),t({corner_radius_px:d})},showHint:o})}function Le(e){return{site_width:e}}function Ge({persist:e,showHint:t}){const{siteWidth:o,setSiteWidth:i,sectionBackgroundWidth:c,setSectionBackgroundWidth:r,sectionContentWidth:p,setSectionContentWidth:h}=S(),a=typeof o=="number"?o:R.default,l=u=>{i(u),e(Le(u),u===null)},g=u=>{r(u),e({section_background_width:u},!0)},m=u=>{h(u),e({section_content_width:u},!0)};return w(x,{children:[n(Q,{value:c??"full",changed:c!==null,detail:f("Full width"),onChange:g,onReset:()=>g(null),hint:t?D:void 0}),n(Z,{mode:p??"content",px:a,min:R.min,max:R.max,changed:typeof o=="number"||p!==null,detail:`${f("Content width")} ${R.default}px`,onMode:m,onPx:u=>l(u),onReset:()=>{m(null),l(null)},hint:t?ee:void 0})]})}function We(e){return{block_gap:e}}function ve(e){return{site_gutter:e}}function ze({persist:e,showHint:t}){const{siteGutter:o,setSiteGutter:i}=S();return n(J,{value:o,onChange:r=>{i(r),e(ve(r),r===null)},showHint:t})}function Ye({persist:e,showHint:t}){const{blockGap:o,setBlockGap:i}=S();return n(K,{value:o,onChange:r=>{i(r),e(We(r),r===null)},showHint:t})}function je({persist:e,showHint:t=!0}){return w(x,{children:[n(Ge,{persist:e,showHint:t}),n(ze,{persist:e,showHint:t}),n(Ye,{persist:e,showHint:t})]})}function Ue(e){return{card_shadow:e}}function Xe(e){return e===null?{shadow_color:null}:{shadow_color:we(e)}}function qe(e){return{hover_effect:e}}function Ke({persist:e,showHint:t=!0}){const{cardShadow:o,setCardShadow:i,shadowColor:c,setShadowColor:r,hoverEffect:p,setHoverEffect:h}=S();return w(x,{children:[n(X,{value:o,onChange:a=>{i(a),e(Ue(a),!0)},showHint:t}),n(q,{value:c,onChange:a=>{r(a),e(Xe(a),a===null)},showHint:t}),n(M,{value:p,onChange:a=>{h(a),e(qe(a),!0)},showHint:t})]})}function Me(e){return{photography_grayscale:e}}function $e({persist:e,showHint:t}){const{photographyGrayscale:o,setPhotographyGrayscale:i}=S();return n($,{value:o,onChange:r=>{i(r),e(Me(r),!0)},showHint:t})}function Ve({persist:e,showHint:t=!0}){return n(x,{children:n($e,{persist:e,showHint:t})})}function Je(e){return{share_button_on_posts:e}}function Qe({persist:e,showHint:t=!0}){const{shareButtonOnPosts:o,setShareButtonOnPosts:i}=S();return n(V,{value:o,onChange:r=>{i(r),e(Je(r),!0)},showHint:t})}function Ze(){const{websiteName:e}=S();return e?.trim()||ge}function Ot(){const e=Ze();return n(se,{content:f("{name} — renamed in the Console: {place}.",{name:e,place:f("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:n("span",{className:"sf-panel-site",children:e})})}function De({themeFromDocument:e=!1,tokenRef:t,siteId:o,onNotify:i,tab:c,onTabChange:r,initialTab:p,revealPageGroup:h=!1,onPageGroupRevealed:a}){const{persist:l}=pe({themeFromDocument:e,tokenRef:t,siteId:o,onResult:b=>{const P=fe(b);P&&i?.(P.msg,P.tone)}}),[g,m]=E(p??I[0].id),u=c!==void 0,d=u?c:g,T=u?r??(()=>{}):m,y=I.find(b=>b.id===d)??I[0],[C,F]=E(Pe);return w(x,{children:[n(nt,{activeId:y.id,onSelect:T}),w("div",{id:ce(H,y.id),className:be,role:"tabpanel","aria-labelledby":ae(H,y.id),children:[d===O&&w(x,{children:[n(ke,{themeFromDocument:e,persist:l,showHint:C}),!e&&n(Ke,{persist:l,showHint:C}),!e&&n(je,{persist:l,showHint:C}),!e&&n(Ve,{persist:l,showHint:C}),!e&&n(Qe,{persist:l,showHint:C}),n(et,{reveal:h,onRevealed:a}),n(Re,{shown:C,onChange:F})]}),d==="theme"&&n(Ie,{themeFromDocument:e,persist:l}),d==="text"&&n(Fe,{themeFromDocument:e,persist:l})]})]})}function et({reveal:e,onRevealed:t}){const[o,i]=E(!0),c=Y(t);return c.current=t,z(()=>{if(!e)return;i(!0);const r=requestAnimationFrame(()=>{document.getElementById(N)?.scrollIntoView({block:"start"}),c.current?.()});return()=>cancelAnimationFrame(r)},[e]),n(v,{title:f("This page"),open:o,onToggle:i,id:N,children:n(tt,{})})}function tt(){const{fields:e,values:t,readOnly:o,onChange:i}=G(),c=Object.fromEntries(me.filter(r=>r in e).map(r=>[r,e[r]]));return Object.keys(c).length===0?n(re,{variant:"none",icon:!1,message:f("This page has no look of its own to set.")}):n(W,{fields:c,values:t,onChange:i,readOnly:o,tabs:!1,idPrefix:"this-page",ariaLabel:f("This page")})}function nt({activeId:e,onSelect:t}){return n("div",{className:"es-insp-tabs",children:n(ie,{variant:"underline",block:!0,labelsFit:!0,"aria-label":f("Styles"),idPrefix:H,value:e,onChange:t,items:I.map(o=>{const i=f(o.label);return{id:o.id,icon:o.icon,label:i}})})})}export{Ke as CardLookFields,Re as HintsToggle,je as PageGroupFields,Ve as PhotographyGroupFields,Pe as SHOW_HINTS_DEFAULT,O as SITE_STYLES_BASICS_TAB,H as SITE_STYLES_ID_PREFIX,I as SITE_STYLES_TABS,Bt as SITE_STYLES_TEXT_TAB,Qe as ShareButtonRootField,nt as SiteStylesTabStrip,be as TABPANEL_CLASS,N as THIS_PAGE_GROUP_ID,Ot as WebsiteNameReadonly,We as blockGapPatch,Ue as cardShadowPatch,De as default,qe as hoverEffectPatch,Me as photographyPatch,Xe as shadowColourPatch,Je as shareButtonPatch,ve as siteGutterPatch,Le as siteWidthPatch,Ze as useWebsiteName};
1
+ "use client";import{jsx as o,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as H,useRootFields as W}from"efficient-easel/easel";import{Inspector as z}from"efficient-easel/fields";import{SettingsGroup as Y}from"efficient-easel/panel";import{useEffect as j,useRef as U,useState as R}from"react";import X from"./ThemeField.js";import q from"./CornersField.js";import K from"./CardShadowField.js";import M from"./ShadowColourField.js";import $,{blockGapRow as V}from"./BlockGapField.js";import J from"./HoverEffectField.js";import Q from"./PhotographyField.js";import Z from"./ShareButtonField.js";import{usePreviewDevice as v}from"efficient-easel/draw/client";import D,{sideSpaceRow as ee}from"./SideSpaceField.js";import{BackgroundWidthRow as te,ContentWidthRow as oe,SITE_BACKGROUND_HINT as ne,SITE_CONTENT_HINT as re}from"./SectionWidthRows.js";import ie from"./SiteAccentField.js";import se from"./SiteTextStylesField.js";import{usePreviewHeader as m}from"../../render/components/PreviewHeaderContext.js";import{Button as ae,EmptyState as ce,Tabs as le,Tooltip as ue,tabButtonId as de,tabPanelId as he}from"efficient-shell/ui";import{ContrastIcon as pe,NoteIcon as fe,SettingsIcon as ge,TypeIcon as me}from"efficient-easel/icons";import{useThemeRowPersist as Se}from"../lib/theme-row-persist.js";import{themeSaveNotice as _e}from"../../format/lib/theme-save-message.js";import{say as p}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as we}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as xe}from"../lib/document/page-root-fields.js";import{previewFrame as Te}from"efficient-easel/screen/lib/document/preview-dom";import{useSiteTextStylesWriter as Ce}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as be,normalizeCornerRadius as ye,normalizeCornerStyle as Pe,normalizeShadowColor as Re,selectedThemeColors as Ee}from"../../format/lib/theme.js";const F="sf-site-styles",ke="sf-site-styles-tabpanel",Ie=!1,ve="Show hints";function Fe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ae,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(fe,{size:13}),onClick:()=>t(!e),children:p(ve)})})}const Wt="text",A="basics",B="this-page-group",k=[{id:A,label:"Basics",icon:o(ge,{})},{id:"theme",label:"Theme",icon:o(pe,{})},{id:"text",label:"Text",icon:o(me,{})}];function Ge({themeFromDocument:e,persist:t}){const{appState:n,dispatch:r}=H(d=>d),{theme:l,setTheme:s}=m(),u=n.data,h=u.root?.props??{},i=d=>{if(e){const f={...h,theme:d};r({type:"replaceRoot",root:{...u.root,props:f},recordHistory:!0})}else s(d);t({selected_preset:d.selected,theme_presets:d.themes})};return o(X,{value:e?h.theme:l,onChange:i})}function He({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=m(),i=Ce({themeFromDocument:e,persist:t}),{old:d,saved:f,writeRoot:g}=i,S=i.fonts,a=i.sizes,x=i.typography,b=c=>c.values.size??Le(Be[c.id]??"body")??Oe[c.kind],_=c=>i.write(c),I=Ae(l),y=c=>{const w={...S,accent:c};e?g({fonts:w}):s(w),t({accent_font:c})},P=c=>{u({...a,accent:c}),t({accent_size_px:c})},N=c=>{const w={...x,weightStrong:c};e?g({headingTypography:w}):h(w),t({heading_weight_strong:c})},L=c=>{const w={...x,italicStrong:c};e?g({headingTypography:w}):h(w),t({accent_italic:c})};return C(T,{children:[o(se,{saved:f,old:d,colours:I,sizeOf:b,onChange:_,openId:n===G?null:n,onOpenChange:r,withoutSize:e}),o(ie,{font:S.accent,size:a.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===G,onOpenChange:c=>r(c?G:null),onChange:c=>{c.key==="font"?y(c.value):c.key==="size"?P(c.value):c.key==="weight"?N(c.value):L(c.value)},withoutSize:e})]})}const G="accent";function Ae(e){const t=Ee(e);return[{key:"accent",name:p("Accent"),value:t.accent},{key:"text",name:p("Text"),value:t.text},{key:"labels",name:p("Labels"),value:t.muted??t.text}]}const Be={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Oe={heading:32,body:14},Ne={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Le(e){if(typeof document>"u")return null;const n=(Te()?.contentDocument??document).querySelector(Ne[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function We({themeFromDocument:e,persist:t,showHint:n}){const{appState:r,dispatch:l}=H(a=>a),{cornerRadiusPx:s,setCornerRadiusPx:u}=m(),h=r.data,i=h.root?.props??{},d=i.cornerRadiusPx===void 0?be[Pe(i.cornerStyle)]:ye(i.cornerRadiusPx),f=e?d:s,g=a=>l({type:"replaceRoot",root:{...h.root,props:{...i,...a}},recordHistory:!0});return o(q,{value:f,onChange:a=>{e?g({cornerRadiusPx:a}):u(a),t({corner_radius_px:a})},showHint:n})}function ze(e){return{site_width:e}}function Ye({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=m();if(v()!=="desktop")return null;const d=typeof n=="number"?n:E.default,f=a=>{r(a),e(ze(a),a===null)},g=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return C(T,{children:[o(te,{value:l??"full",changed:l!==null,detail:p("Full width"),onChange:g,onReset:()=>g(null),hint:t?ne:void 0}),o(oe,{mode:u??"content",px:d,min:E.min,max:E.max,changed:typeof n=="number"||u!==null,detail:`${p("Content width")} ${E.default}px`,onMode:S,onPx:a=>f(a),onReset:()=>{S(null),f(null)},hint:t?re:void 0})]})}function je(e){return{block_gap:e}}function Ue(e){return{block_gap_phone:e}}function Xe(e){return{site_gutter:e}}function qe(e){return{site_gutter_phone:e}}function O(e,[t,n],r){t(e),r(n(e),e===null)}function Ke({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=m(),u=ee(v(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,qe]:[l,Xe];return o(D,{value:u.value,onChange:i=>O(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function Me({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=m(),u=V(v(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,Ue]:[l,je];return o($,{value:u.value,onChange:i=>O(i,h,e),showHint:t,followsPx:u.followsPx})}function $e({persist:e,showHint:t=!0}){return C(T,{children:[o(Ye,{persist:e,showHint:t}),o(Ke,{persist:e,showHint:t}),o(Me,{persist:e,showHint:t})]})}function Ve(e){return{card_shadow:e}}function Je(e){return e===null?{shadow_color:null}:{shadow_color:Re(e)}}function Qe(e){return{hover_effect:e}}function Ze({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=m();return C(T,{children:[o(K,{value:n,onChange:i=>{r(i),e(Ve(i),!0)},showHint:t}),o(M,{value:l,onChange:i=>{s(i),e(Je(i),i===null)},showHint:t}),o(J,{value:u,onChange:i=>{h(i),e(Qe(i),!0)},showHint:t})]})}function De(e){return{photography_grayscale:e}}function et({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=m();return o(Q,{value:n,onChange:s=>{r(s),e(De(s),!0)},showHint:t})}function tt({persist:e,showHint:t=!0}){return o(T,{children:o(et,{persist:e,showHint:t})})}function ot(e){return{share_button_on_posts:e}}function nt({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=m();return o(Z,{value:n,onChange:s=>{r(s),e(ot(s),!0)},showHint:t})}function rt(){const{websiteName:e}=m();return e?.trim()||we}function zt(){const e=rt();return o(ue,{content:p("{name} — renamed in the Console: {place}.",{name:e,place:p("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:o("span",{className:"sf-panel-site",children:e})})}function it({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=Se({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=_e(y);P&&r?.(P.msg,P.tone)}}),[f,g]=R(u??k[0].id),S=l!==void 0,a=S?l:f,x=S?s??(()=>{}):g,b=k.find(y=>y.id===a)??k[0],[_,I]=R(Ie);return C(T,{children:[o(ct,{activeId:b.id,onSelect:x}),C("div",{id:he(F,b.id),className:ke,role:"tabpanel","aria-labelledby":de(F,b.id),children:[a===A&&C(T,{children:[o(We,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(Ze,{persist:d,showHint:_}),!e&&o($e,{persist:d,showHint:_}),!e&&o(tt,{persist:d,showHint:_}),!e&&o(nt,{persist:d,showHint:_}),o(st,{reveal:h,onRevealed:i}),o(Fe,{shown:_,onChange:I})]}),a==="theme"&&o(Ge,{themeFromDocument:e,persist:d}),a==="text"&&o(He,{themeFromDocument:e,persist:d})]})]})}function st({reveal:e,onRevealed:t}){const[n,r]=R(!0),l=U(t);return l.current=t,j(()=>{if(!e)return;r(!0);const s=requestAnimationFrame(()=>{document.getElementById(B)?.scrollIntoView({block:"start"}),l.current?.()});return()=>cancelAnimationFrame(s)},[e]),o(Y,{title:p("This page"),open:n,onToggle:r,id:B,children:o(at,{})})}function at(){const{fields:e,values:t,readOnly:n,onChange:r}=W(),l=Object.fromEntries(xe.filter(s=>s in e).map(s=>[s,e[s]]));return Object.keys(l).length===0?o(ce,{variant:"none",icon:!1,message:p("This page has no look of its own to set.")}):o(z,{fields:l,values:t,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:p("This page")})}function ct({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(le,{variant:"underline",block:!0,labelsFit:!0,"aria-label":p("Styles"),idPrefix:F,value:e,onChange:t,items:k.map(n=>{const r=p(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Me as BlockGapRootField,Ze as CardLookFields,Fe as HintsToggle,$e as PageGroupFields,tt as PhotographyGroupFields,Ie as SHOW_HINTS_DEFAULT,A as SITE_STYLES_BASICS_TAB,F as SITE_STYLES_ID_PREFIX,k as SITE_STYLES_TABS,Wt as SITE_STYLES_TEXT_TAB,nt as ShareButtonRootField,Ke as SideSpaceRootField,ct as SiteStylesTabStrip,ke as TABPANEL_CLASS,B as THIS_PAGE_GROUP_ID,zt as WebsiteNameReadonly,je as blockGapPatch,Ue as blockGapPhonePatch,Ve as cardShadowPatch,it as default,Qe as hoverEffectPatch,De as photographyPatch,Je as shadowColourPatch,ot as shareButtonPatch,Xe as siteGutterPatch,qe as siteGutterPhonePatch,ze as siteWidthPatch,rt as useWebsiteName};
@@ -0,0 +1,10 @@
1
+ import { type AnimationTabKind } from "../lib/animation/fields.js";
2
+ export type PartMotionRows = {
3
+ part: string;
4
+ fields: Record<string, unknown>;
5
+ values: Record<string, unknown>;
6
+ keys: ReadonlySet<string>;
7
+ onChange: (key: string, value: unknown) => void;
8
+ };
9
+ export type PartMotionKind = Extract<AnimationTabKind, "textPart" | "block">;
10
+ export declare function usePartMotion(nodeId: string, part: string, kind: PartMotionKind): PartMotionRows;
@@ -0,0 +1 @@
1
+ "use client";import{useMemo as O}from"react";import{useEasel as w}from"efficient-easel/easel";import{useSectionOps as E}from"efficient-easel/screen/lib/document/use-section-ops";import{animationTabFields as P}from"../lib/animation/fields.js";import{PART_MOTION_KEYS as c,propsWithPartMotion as x,readPartMotion as y}from"../../render/lib/animation/part-motion.js";import{assignSectionGroups as K}from"../lib/document/field-groups.js";const i=new Map,T=o=>{let t=i.get(o);return t||i.set(o,t=K(P(o),`part:${o}`)),t},b=new Set(c);function R(o,t,m){const{getItemById:n,getSelectorForId:a}=w(e=>e),f=E(),u=n(o)?.props??{},p=y(u,t),l=JSON.stringify(p),S=O(()=>Object.fromEntries(c.map(e=>[e,p[e]])),[l]);return{part:t,fields:T(m),values:S,keys:b,onChange:(e,g)=>{const r=a(o),s=n(o);if(!r||!s)return;const M=x(s.props??{},t,e,g);f.replaceComponent(r.zone,r.index,{...s,props:M})}}}export{R as usePartMotion};
@@ -7,8 +7,8 @@ export declare function useSocialSettings({ token, siteId, enabled, }: {
7
7
  siteId: string | null;
8
8
  enabled: boolean;
9
9
  }): {
10
- links: Partial<Record<"facebook" | "instagram" | "pinterest" | "telegram" | "tiktok" | "whatsapp" | "youtube" | "x" | "linkedin" | "line" | "wechat", string>>;
11
- rows: Record<"facebook" | "instagram" | "pinterest" | "telegram" | "tiktok" | "whatsapp" | "youtube" | "x" | "linkedin" | "line" | "wechat", SocialRowState>;
10
+ links: Partial<Record<"facebook" | "instagram" | "pinterest" | "telegram" | "tiktok" | "whatsapp" | "youtube" | "line" | "x" | "linkedin" | "wechat", string>>;
11
+ rows: Record<"facebook" | "instagram" | "pinterest" | "telegram" | "tiktok" | "whatsapp" | "youtube" | "line" | "x" | "linkedin" | "wechat", SocialRowState>;
12
12
  canSave: boolean;
13
13
  saveLink: (platform: SocialPlatform, value: string) => Promise<SocialSaveOutcome>;
14
14
  };
@@ -1,3 +1,7 @@
1
1
  import { type TimedMotionGroup } from "efficient-shell/format";
2
2
  export declare function animationDurationField(group: TimedMotionGroup): import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
3
3
  export declare function animationDelayField(group: TimedMotionGroup): import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
4
+ export declare function loopDurationField({ readsSpeed }: {
5
+ readsSpeed: boolean;
6
+ }): import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
7
+ export declare function loopDelayField(): import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{ClockIcon as s,DurationIcon as u}from"efficient-easel/icons";import{MOTION_TIMING as e}from"efficient-shell/format";import{slider as m}from"../document/box-fields.js";function d(t){const{min:o,max:n,step:i,default:r}=e[t].duration;return m("Duration",a(u,{}),o,n,i,r,"s")}function x(t){const{min:o,max:n,step:i,default:r}=e[t].delay;return m("Delay",a(s,{}),o,n,i,r,"s")}export{x as animationDelayField,d as animationDurationField};
1
+ import{jsx as i}from"react/jsx-runtime";import{ClockIcon as m,DurationIcon as p}from"efficient-easel/icons";import{MOTION_TIMING as a}from"efficient-shell/format";import{slider as s}from"../document/box-fields.js";import{useSelectedHost as d}from"efficient-easel/easel";import{loopDelayOf as c,loopSecondsOf as f}from"../../../format/lib/animation/loop.js";function x(o){const{min:t,max:n,step:r,default:e}=a[o].duration;return s("Duration",i(p,{}),t,n,r,e,"s")}function D(o){const{min:t,max:n,step:r,default:e}=a[o].delay;return s("Delay",i(m,{}),t,n,r,e,"s")}function u(o,t){const n=o.render,r=e=>{const l=d();return n({...e,value:t(e.value,l?.values)})};return{...o,render:e=>i(r,{...e})}}function w({readsSpeed:o}){return u(x("loop"),(t,n)=>f({loopDuration:t,speed:o?n?.speed:void 0}))}function g(){return u(D("loop"),o=>c({loopDelay:o}))}export{D as animationDelayField,x as animationDurationField,g as loopDelayField,w as loopDurationField};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import{phoneKey as s}from"efficient-easel/draw";import{SettingsDefaultReset as K,SettingsField as N}from"efficient-easel/panel";import{AnimationIcon as R,ClockIcon as O,DirectionDownIcon as w,DirectionIcon as A,DirectionLeftIcon as T,DirectionRightIcon as L,DirectionUpIcon as S,DurationIcon as P}from"efficient-easel/icons";import{deviceField as p}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as B,noControlField as j}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as G,phoneTwinFields as U}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as W,ENTRANCE_FROM_DEFAULT as g,ENTRANCE_KINDS as h,ENTRANCE_KINDS_WITH_FROM as I,MOTION_TIMING as H,entranceAttrs as Y,playEntrance as z,readEntrance as V}from"efficient-shell/format";import{IconPicker as q}from"efficient-shell/ui";import{segmented as J}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as v}from"../document/controls.js";import{withRowRules as Q}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as X,say as a}from"../../../format/lib/editor-words.js";import{animationDelayField as Z,animationDurationField as $}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as o,LEGACY_ENTRANCE_KEY as D,entranceOf as x}from"../../../render/lib/animation/entrance.js";const m={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},ee={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ne={top:()=>e(w,{}),bottom:()=>e(S,{}),left:()=>e(L,{}),right:()=>e(T,{})},u="Entrance",C=h.filter(n=>n!=="none"),y=n=>({any:[{field:o.kind,in:n},{all:[{field:o.kind,set:!1},{field:D,in:n}]}]}),b=n=>({any:[{field:s(o.kind),in:n},{all:[{field:s(o.kind),set:!1},y(n)]}]}),te=[[[o.from],y(I)],[[s(o.from)],b(I)],[[o.duration,o.delay],y(C)],[[s(o.duration),s(o.delay)],b(C)]],c=({children:n})=>e("svg",{viewBox:"0 0 40 40",width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n}),r=({x:n=12,y:t=12,o:i=1})=>e("rect",{x:n,y:t,width:"16",height:"16",rx:"2",opacity:i}),oe={none:e(c,{children:e(r,{})}),fade:l(c,{children:[e(r,{x:6,o:.3}),e(r,{x:18})]}),rise:l(c,{children:[e(r,{y:20,o:.3}),e(r,{y:8}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),scale:l(c,{children:[e("rect",{x:"16",y:"16",width:"8",height:"8",rx:"1",opacity:".35"}),e(r,{}),e("path",{d:"M6 6l4 4M34 34l-4-4"})]}),glide:l(c,{children:[e(r,{x:2,o:.3}),e(r,{x:20}),e("path",{d:"M4 33h12m-2-2 2 2-2 2"})]}),bounce:l(c,{children:[e(r,{y:6}),e("path",{d:"M8 34c3-6 5-6 8 0s5 6 8 0 5-6 8 0"})]}),flip:l(c,{children:[e("path",{d:"M12 12l16 4v8l-16 4z",opacity:".35"}),e(r,{}),e("path",{d:"M20 4v32",strokeDasharray:"2 2"})]}),reveal:l(c,{children:[e("rect",{x:"12",y:"12",width:"16",height:"16",rx:"2",strokeDasharray:"2 2",opacity:".5"}),e("path",{d:"M12 22h16v4a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z",fill:"currentColor",opacity:".35"}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),spin:l(c,{children:[e(r,{}),e("path",{d:"M33 14a14 14 0 0 1 0 12m0 0-3-1m3 1 1-3"})]})};function ie({kind:n}){const{attrs:t}=Y(V(n,g));return l("span",{className:"sf-entrance-pic",children:[e("span",{className:"sf-entrance-stage",children:e("i",{...t,children:oe[n]})}),e("span",{className:"sf-entrance-cap",children:a(m[n])})]})}const re=(n,t)=>{const i=t.querySelector(".sf-entrance-stage > i");i&&z(i)},ae={width:"3.5rem",height:"4.25rem"};function F({value:n,onChange:t}){return e(q,{label:a(u),value:n,emptyValue:"none",columns:3,cell:ae,onChange:t,onPreview:re,tooltips:!1,options:h.map(i=>({value:i,label:a(m[i]),icon:e(ie,{kind:i})}))})}const E="Effect";function le({value:n,onChange:t}){const i=v(),d=x({...i,[o.kind]:n},"desktop").kind;return e(N,{label:a(E),icon:e(R,{}),value:a(m[d]),children:e(F,{value:d,onChange:t})})}function ce({value:n,onChange:t}){const i=v(),d=typeof n=="string"&&h.includes(n),f=x(i,"desktop").kind;return e(N,{label:a(E),icon:e(R,{}),value:a(m[d?n:f]),changed:d,action:e(K,{words:X()?.panel,label:a(E),changed:d,detail:a("{value} on desktop",{value:a(m[f])}),onReset:()=>t(void 0)}),children:e(F,{value:d?n:f,onChange:t})})}const M={type:"select",label:u,options:h.map(n=>({value:n,label:m[n]}))},se=()=>k({type:"custom",render:({value:n,onChange:t})=>e(le,{value:n,onChange:t})},M),de=()=>k({type:"custom",render:({value:n,onChange:t})=>e(ce,{value:n,onChange:t})},M),pe=W.map(n=>({label:ee[n],value:n,picture:ne[n]()}));function Ce(){const{duration:n,delay:t}=H.entrance,i={_gEntrance:G(u),[o.kind]:p("desktop",se()),[D]:j({type:"custom",render:()=>e(B,{})},"always"),[s(o.kind)]:p("mobile",de()),...U(o.from,J("From",e(A,{}),pe,g)),[o.duration]:p("desktop",$("entrance")),[s(o.duration)]:p("mobile",_({label:"Duration",desktopKey:o.duration,icon:e(P,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"})),[o.delay]:p("desktop",Z("entrance")),[s(o.delay)]:p("mobile",_({label:"Delay",desktopKey:o.delay,icon:e(O,{}),min:t.min,max:t.max,step:t.step,fallback:t.default,unit:"s"}))};return Q(i,te)}export{oe as ENTRANCE_PICTURE,Ce as entranceFields};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{phoneKey as s}from"efficient-easel/draw";import{SettingsDefaultReset as O,SettingsField as R}from"efficient-easel/panel";import{AnimationIcon as N,ClockIcon as w,DirectionDownIcon as A,DirectionIcon as T,DirectionLeftIcon as L,DirectionRightIcon as P,DirectionUpIcon as S,DurationIcon as B}from"efficient-easel/icons";import{deviceField as p}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as G,noControlField as U}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as j,phoneTwinFields as W}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as Y,ENTRANCE_FROM_DEFAULT as I,ENTRANCE_KINDS as h,ENTRANCE_KINDS_WITH_FROM as g,MOTION_TIMING as H,entranceAttrs as z,playEntrance as V,readEntrance as q}from"efficient-shell/format";import{IconPicker as J}from"efficient-shell/ui";import{segmented as Q}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as v}from"../document/controls.js";import{withRowRules as X}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as Z,say as l}from"../../../format/lib/editor-words.js";import{animationDelayField as $,animationDurationField as ee}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as D,entranceOf as C}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as ne}from"../../../format/lib/animation/index.js";const m={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},oe={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},te={top:()=>e(A,{}),bottom:()=>e(S,{}),left:()=>e(P,{}),right:()=>e(L,{})},u="Entrance",x=h.filter(n=>n!=="none"),y=n=>({any:[{field:t.kind,in:n},{all:[{field:t.kind,set:!1},{field:D,in:n}]}]}),b=n=>({any:[{field:s(t.kind),in:n},{all:[{field:s(t.kind),set:!1},y(n)]}]}),ie=[[[t.from],y(g)],[[s(t.from)],b(g)],[[t.duration,t.delay],y(x)],[[s(t.duration),s(t.delay)],b(x)]],c=({children:n})=>e("svg",{viewBox:"0 0 40 40",width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n}),r=({x:n=12,y:o=12,o:i=1})=>e("rect",{x:n,y:o,width:"16",height:"16",rx:"2",opacity:i}),re={none:e(c,{children:e(r,{})}),fade:a(c,{children:[e(r,{x:6,o:.3}),e(r,{x:18})]}),rise:a(c,{children:[e(r,{y:20,o:.3}),e(r,{y:8}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),scale:a(c,{children:[e("rect",{x:"16",y:"16",width:"8",height:"8",rx:"1",opacity:".35"}),e(r,{}),e("path",{d:"M6 6l4 4M34 34l-4-4"})]}),glide:a(c,{children:[e(r,{x:2,o:.3}),e(r,{x:20}),e("path",{d:"M4 33h12m-2-2 2 2-2 2"})]}),bounce:a(c,{children:[e(r,{y:6}),e("path",{d:"M8 34c3-6 5-6 8 0s5 6 8 0 5-6 8 0"})]}),flip:a(c,{children:[e("path",{d:"M12 12l16 4v8l-16 4z",opacity:".35"}),e(r,{}),e("path",{d:"M20 4v32",strokeDasharray:"2 2"})]}),reveal:a(c,{children:[e("rect",{x:"12",y:"12",width:"16",height:"16",rx:"2",strokeDasharray:"2 2",opacity:".5"}),e("path",{d:"M12 22h16v4a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z",fill:"currentColor",opacity:".35"}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),spin:a(c,{children:[e(r,{}),e("path",{d:"M33 14a14 14 0 0 1 0 12m0 0-3-1m3 1 1-3"})]})};function ae({kind:n}){const{attrs:o}=z(q(n,I));return a("span",{className:"sf-entrance-pic",children:[e("span",{className:"sf-entrance-stage",children:e("i",{...o,children:re[n]})}),e("span",{className:"sf-entrance-cap",children:l(m[n])})]})}const le=(n,o)=>{const i=o.querySelector(".sf-entrance-stage > i");i&&V(i)},ce={width:"3.5rem",height:"4.25rem"};function F({value:n,onChange:o}){return e(J,{label:l(u),value:n,emptyValue:"none",columns:3,cell:ce,onChange:o,onPreview:le,tooltips:!1,options:h.map(i=>({value:i,label:l(m[i]),icon:e(ae,{kind:i})}))})}const E="Effect",M=n=>n==="none"?void 0:l(m[n]);function se({value:n,onChange:o}){const i=v(),d=C({...i,[t.kind]:n},"desktop").kind;return e(R,{label:l(E),icon:e(N,{}),value:M(d),children:e(F,{value:d,onChange:o})})}function de({value:n,onChange:o}){const i=v(),d=typeof n=="string"&&h.includes(n),f=C(i,"desktop").kind;return e(R,{label:l(E),icon:e(N,{}),value:M(d?n:f),changed:d,action:e(O,{words:Z()?.panel,label:l(E),changed:d,detail:l("{value} on desktop",{value:l(m[f])}),onReset:()=>o(void 0)}),children:e(F,{value:d?n:f,onChange:o})})}const K={type:"select",label:u,options:h.map(n=>({value:n,label:m[n]}))},pe=()=>k({type:"custom",render:({value:n,onChange:o})=>e(se,{value:n,onChange:o})},K),me=()=>k({type:"custom",render:({value:n,onChange:o})=>e(de,{value:n,onChange:o})},K),he=Y.map(n=>({label:oe[n],value:n,picture:te[n]()}));function Me(){const{duration:n,delay:o}=H.entrance,i={[ne]:j(u),[t.kind]:p("desktop",pe()),[D]:U({type:"custom",render:()=>e(G,{})},"always"),[s(t.kind)]:p("mobile",me()),...W(t.from,Q("From",e(T,{}),he,I)),[t.duration]:p("desktop",ee("entrance")),[s(t.duration)]:p("mobile",_({label:"Duration",desktopKey:t.duration,icon:e(B,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"})),[t.delay]:p("desktop",$("entrance")),[s(t.delay)]:p("mobile",_({label:"Delay",desktopKey:t.delay,icon:e(w,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"}))};return X(i,ie)}export{re as ENTRANCE_PICTURE,Me as entranceFields};
@@ -1,2 +1,2 @@
1
- export type AnimationTabKind = "section" | "block" | "box" | "marquee";
1
+ export type AnimationTabKind = "section" | "block" | "box" | "marquee" | "textPart";
2
2
  export declare function animationTabFields(kind: AnimationTabKind): Record<string, unknown>;
@@ -1 +1 @@
1
- import{animationDelayField as e,animationDurationField as r}from"./AnimationDurationRow.js";import{entranceFields as o}from"./entrance-fields.js";import{loopDirectionField as n,loopFields as t}from"./loop-fields.js";function m(i){switch(i){case"section":case"block":return o();case"box":return{...o(),...t()};case"marquee":return{...o(),scrollDirection:n(),loopDuration:r("loop"),loopDelay:e("loop")}}}export{m as animationTabFields};
1
+ import{loopDelayField as r,loopDurationField as i}from"./AnimationDurationRow.js";import{entranceFields as e}from"./entrance-fields.js";import{hoverFields as t}from"./hover-fields.js";import{loopDirectionField as l,loopFields as a}from"./loop-fields.js";function m(o){switch(o){case"section":case"block":return e();case"box":return{...e(),...a()};case"textPart":return{...e(),...t()};case"marquee":return{...e(),scrollDirection:l(),loopDuration:i({readsSpeed:!0}),loopDelay:r()}}}export{m as animationTabFields};
@@ -0,0 +1 @@
1
+ export declare function hoverFields(): Record<string, unknown>;
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{HoverIcon as e}from"efficient-easel/icons";import{group as t}from"efficient-easel/screen/lib/document/box-fields";import{HOVER_EFFECT_LABELS as p}from"../../components/HoverEffectField.js";import{segmented as m}from"../document/box-fields.js";import{HOVER_KEY as i,PART_HOVER_KINDS as n}from"../../../format/lib/animation/hover.js";const s="_gHover",E="What this does when a shopper points at it, or taps it on a phone.";function h(){return{[s]:t("Hover"),[i]:{...m("Hover effect",r(e,{}),n.map(o=>({label:p[o],value:o})),"none"),description:E}}}export{h as hoverFields};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{DirectionIcon as n,LoopIcon as t}from"efficient-easel/icons";import{select as e}from"../document/box-fields.js";import{EDGE_ARROWS as l,edgePad as O}from"../document/controls.js";import{withShowWhen as o}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as p,animationDurationField as m}from"./AnimationDurationRow.js";import{DEFAULT_LOOP_DIRECTION as a,LOOP_DIRECTION_OPTIONS as c,LOOP_NONE as D,LOOP_OPTIONS as s,LOOP_SCROLLS as r}from"../../../format/lib/animation/loop.js";function L(){return O("Scroll direction",c,a,"A marquee cannot run diagonally, so the corners are not answers.",i(n,{}),l)}function E(){return{loop:e("Loop",i(t,{}),s,D),scrollDirection:o(L(),r),loopDuration:o(m("loop"),r),loopDelay:o(p("loop"),r)}}export{L as loopDirectionField,E as loopFields};
1
+ import{jsx as e}from"react/jsx-runtime";import{DirectionIcon as i,LoopIcon as t}from"efficient-easel/icons";import{select as n}from"../document/box-fields.js";import{EDGE_ARROWS as l,edgePad as p}from"../document/controls.js";import{withShowWhen as o}from"../../../format/lib/document/show-when-attach.js";import{loopDelayField as O,loopDurationField as m}from"./AnimationDurationRow.js";import{DEFAULT_LOOP_DIRECTION as a,LOOP_DIRECTION_OPTIONS as c,LOOP_NONE as s,LOOP_OPTIONS as D,LOOP_SCROLLS as r}from"../../../format/lib/animation/loop.js";function d(){return p("Scroll direction",c,a,"A marquee cannot run diagonally, so the corners are not answers.",e(i,{}),l)}function E(){return{loop:n("Loop",e(t,{}),D,s),scrollDirection:o(d(),r),loopDuration:o(m({readsSpeed:!1}),r),loopDelay:o(O(),r)}}export{d as loopDirectionField,E as loopFields};
@@ -1,2 +1,3 @@
1
1
  import type { AddTarget } from "efficient-easel/screen/lib/document/add-target-types";
2
- export declare function canAddTo(nodeType: string, nestDepth?: number): AddTarget | null;
2
+ import type { ScreenNodeAt } from "efficient-easel/screen/lib/screen-parts";
3
+ export declare function canAddTo(nodeType: string, nestDepth?: number, at?: ScreenNodeAt): AddTarget | null;
@@ -1 +1 @@
1
- import{blockOfferOf as t}from"./block-offer.js";import{containerBlocksFor as s}from"../../../format/lib/document/container-blocks.js";import{blockChoicesFor as l,FOOTER_BLOCKS_SLOT as i}from"./footer-blocks.js";import{SLOT_SECTION_SPECS as f}from"../../../render/lib/document/slot-specs.js";function T(o,e=0){const c=h(o,e),r=c?t():null;return c&&r?u(c,r):c}function u(o,e){if(o.spec)return e.offers(o.spec.childType)?o:null;const c=o.choices??[],r=c.filter(n=>e.offers(n.type));return r.length===c.length?o:r.length>0?{...o,choices:r}:null}function h(o,e){const c=f[o];if(c)return{source:"section",slot:c.slot,choices:null,spec:c};const r=s(o,e);if(r)return{source:"container",slot:r.slot,choices:r.choices,spec:null};const n=l(o);return n?{source:"footer",slot:i,choices:n,spec:null}:null}export{T as canAddTo};
1
+ import{cardTemplateBlocks as i,cardTemplateOwner as f,cardTemplatesNameBlocks as u}from"../../../format/lib/content/card-template.js";import{blockOfferOf as p}from"./block-offer.js";import{containerBlocksFor as h}from"../../../format/lib/document/container-blocks.js";import{blockChoicesFor as m,FOOTER_BLOCKS_SLOT as a}from"./footer-blocks.js";import{SLOT_SECTION_SPECS as d}from"../../../render/lib/document/slot-specs.js";function _(o,n=0,c){const e=T(y(o,n),c),r=e?p():null;return e&&r?O(e,r):e}function O(o,n){if(o.spec)return n.offers(o.spec.childType)?o:null;const c=o.choices??[],e=c.filter(r=>n.offers(r.type));return e.length===c.length?o:e.length>0?{...o,choices:e}:null}function T(o,n){if(!o||o.source!=="container"||!n||!u())return o;const c=f({data:n.data},n.id),e=typeof c?.type=="string"?i(c.type):[],r=o.choices??[],s=e.filter(t=>!r.some(l=>l.type===t.type));return s.length?{...o,choices:[...r,...s.map(t=>({type:t.type,label:t.label}))]}:o}function y(o,n){const c=d[o];if(c)return{source:"section",slot:c.slot,choices:null,spec:c};const e=h(o,n);if(e)return{source:"container",slot:e.slot,choices:e.choices,spec:null};const r=m(o);return r?{source:"footer",slot:a,choices:r,spec:null}:null}export{_ as canAddTo};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as B}from"react/jsx-runtime";import{ButtonIcon as C,ButtonIconIcon as S,IconAfterTextIcon as T,IconBeforeTextIcon as w}from"efficient-easel/icons";import{SettingsField as k}from"efficient-easel/panel";import{useSelectedFields as m}from"efficient-easel/easel";import{buttonFieldSet as F}from"efficient-easel/screen/lib/document/button-fields";import{IconPicker as v,Segmented as O}from"efficient-shell/ui";import{shellGlyphOf as P}from"../../../shell-glyph.js";import{StorefrontTextLinkField as _}from"../../../../../components/StorefrontLinkField.js";import{usePreviewHeader as a}from"../../../../../../render/components/PreviewHeaderContext.js";import{BUTTON_ICONS as N,buttonIconChoice as R,buttonIconSide as j,buttonWidth as L}from"../../../../../../format/lib/content/button-icon.js";import{BUTTON_PAD_BUILT_IN as W,buttonLook as u}from"../../../../../../render/lib/content/button-look.js";import{nonEmptyString as z}from"../../../../../../format/lib/non-empty-string.js";import{selectedThemeColors as A,siteButtonPaint as d,siteButtonRadiusPx as E}from"../../../../../../format/lib/theme.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{backTo as D,buttonWordsEntryField as U,inOwnBox as G,linkField as H,plainText as K,useSelectedSibling as f}from"../../../controls.js";import{useThemePresets as V}from"../../../ColourControl.js";import{keptByRow as c}from"efficient-easel/screen/lib/document/style-fields";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import{rowSay as q}from"../../../box-fields.js";import{CARD_ROW_FACTS as J,cardRowField as h,cardRowFields as M}from"../../../card-row-fields.js";import{consentWordsKept as Q,withConsentWordsRow as X}from"../../../consent-words-field.js";const b=o=>P(o==="none"?"no-symbol":o),Y=N.map(o=>({value:o,icon:b(o)}));function Z({value:o,onChange:n}){const t=m(),i=t.values.href,s=typeof o=="string"?o:o&&typeof o=="object"&&"text"in o?String(o.text??""):"";return e(_,{label:"Button",icon:e(C,{size:18}),text:s,onTextChange:n,link:typeof i=="string"?i:"",onLinkChange:l=>t.onChange("href",l)})}function $({value:o,onChange:n}){const t=m(),i=R(o,t.values.arrow),s=j(t.values.iconPosition),l=L(t.values.widthFit)==="fill",I=b("icon-at-end");return e(k,{label:r("Icon"),icon:e(S,{size:18}),children:B("div",{className:"flex items-center gap-2",children:[e(v,{label:r("Icon"),value:i,emptyValue:"none",options:Y,onChange:n}),i!=="none"&&e(O,{size:"sm",block:!0,label:r("Icon position"),value:s==="end"&&!l?"after":s,onChange:g=>t.onChange("iconPosition",g),options:[{value:"before",icon:e(w,{size:16}),label:e("span",{className:"sr-only",children:r("Icon before text")}),title:r("Icon before text")},{value:"after",icon:e(T,{size:16}),label:e("span",{className:"sr-only",children:r("Icon after text")}),title:r("Icon after text")},...l?[{value:"end",icon:I,label:e("span",{className:"sr-only",children:r("Icon at the far end")}),title:r("Icon at the far end")}]:[]]})]})})}const x=()=>d(a().theme),y=F({follows:{useFill:()=>x().fill,useText:()=>x().ink,useBorder:()=>{const[o]=f("variant"),[n]=f("buttonColor"),{theme:t}=a(),i=u({variant:o,buttonColor:n}).border.width,s=z(n)??(o==="ghost"?A(t).text:d(t).fill);return{width:i,color:s}},useCorners:()=>E(a().cornerRadiusPx),useFillOpacity:()=>u({variant:f("variant")[0]}).fillOpacity},usePresets:V,resetTo:o=>D(o,r("Styles")),padding:{fallback:W},say:q});function oo(o,n){const t=Object.keys(o);return Object.fromEntries(t.slice(0,t.indexOf(n)+1).map(i=>[i,o[i]]))}const So={fields:{label:G(K("Button"),o=>e(Z,{value:o.value,onChange:o.onChange})),labelText:U("label"),href:{...H("Button link"),...c("label")},consentWords:Q("label"),_gButton:p("Button"),rowField:h("Shows","text"),rowLinkField:h("Link from","link"),...oo(y,"_dDesign"),_gStyle:p("Style"),variant:c("buttonColor"),icon:{type:"custom",render:o=>e($,{value:o.value,onChange:o.onChange})},iconPosition:c("icon"),arrow:c("icon"),...y},resolveFields:(o,n)=>X(M(n.fields,o,n),o.props,"label",["href"]),showWhenFacts:J};export{So as ButtonBlockFields};
1
+ import{jsx as e,jsxs as B}from"react/jsx-runtime";import{ButtonIcon as C,ButtonIconIcon as S,IconAfterTextIcon as T,IconBeforeTextIcon as w}from"efficient-easel/icons";import{SettingsField as k}from"efficient-easel/panel";import{useSelectedFields as m}from"efficient-easel/easel";import{buttonFieldSet as F}from"efficient-easel/screen/lib/document/button-fields";import{IconPicker as v,Segmented as O}from"efficient-shell/ui";import{shellGlyphOf as P}from"../../../shell-glyph.js";import{StorefrontTextLinkField as _}from"../../../../../components/StorefrontLinkField.js";import{usePreviewHeader as a}from"../../../../../../render/components/PreviewHeaderContext.js";import{BUTTON_ICONS as N,buttonIconChoice as R,buttonIconSide as j,buttonWidth as L}from"../../../../../../format/lib/content/button-icon.js";import{BUTTON_PAD_BUILT_IN as W,buttonLook as u}from"../../../../../../render/lib/content/button-look.js";import{nonEmptyString as z}from"../../../../../../format/lib/non-empty-string.js";import{selectedThemeColors as A,siteButtonPaint as d,siteButtonRadiusPx as E}from"../../../../../../format/lib/theme.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{backTo as D,buttonWordsEntryField as U,inOwnBox as G,linkField as H,plainText as K,useSelectedSibling as f}from"../../../controls.js";import{useThemePresets as V}from"../../../ColourControl.js";import{keptByRow as c}from"efficient-easel/screen/lib/document/style-fields";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import{rowSay as q}from"../../../box-fields.js";import{CARD_ROW_FACTS as J,cardRowField as h,cardRowFields as M}from"../../../card-row-fields.js";import{consentWordsKept as Q,withConsentWordsRow as X}from"../../../consent-words-field.js";const b=o=>P(o==="none"?"no-symbol":o),Y=N.map(o=>({value:o,icon:b(o)}));function Z({value:o,onChange:n}){const t=m(),i=t.values.href,s=typeof o=="string"?o:o&&typeof o=="object"&&"text"in o?String(o.text??""):"";return e(_,{label:"Button",icon:e(C,{size:18}),text:s,onTextChange:n,link:typeof i=="string"?i:"",onLinkChange:l=>t.onChange("href",l)})}function $({value:o,onChange:n}){const t=m(),i=R(o,t.values.arrow),s=j(t.values.iconPosition),l=L(t.values.widthFit)==="fill",I=b("icon-at-end");return e(k,{label:r("Icon"),icon:e(S,{size:18}),children:B("div",{className:"flex items-center gap-2",children:[e(v,{label:r("Icon"),value:i,emptyValue:"none",options:Y,onChange:n}),i!=="none"&&e(O,{size:"sm",block:!0,label:r("Icon position"),value:s==="end"&&!l?"after":s,onChange:g=>t.onChange("iconPosition",g),options:[{value:"before",icon:e(w,{size:16}),label:e("span",{className:"sr-only",children:r("Icon before text")}),title:r("Icon before text")},{value:"after",icon:e(T,{size:16}),label:e("span",{className:"sr-only",children:r("Icon after text")}),title:r("Icon after text")},...l?[{value:"end",icon:I,label:e("span",{className:"sr-only",children:r("Icon at the far end")}),title:r("Icon at the far end")}]:[]]})]})})}const x=()=>d(a().theme),y=F({follows:{useFill:()=>x().fill,useText:()=>x().ink,useBorder:()=>{const[o]=f("variant"),[n]=f("buttonColor"),{theme:t}=a(),i=u({variant:o,buttonColor:n}).border.width,s=z(n)??(o==="ghost"?A(t).text:d(t).fill);return{width:i,color:s}},useCorners:()=>E(a().cornerRadiusPx),useFillOpacity:()=>u({variant:f("variant")[0]}).fillOpacity},usePresets:V,resetTo:o=>D(o,r("Styles")),padding:{fallback:W,tablet:!0},say:q});function oo(o,n){const t=Object.keys(o);return Object.fromEntries(t.slice(0,t.indexOf(n)+1).map(i=>[i,o[i]]))}const So={fields:{label:G(K("Button"),o=>e(Z,{value:o.value,onChange:o.onChange})),labelText:U("label"),href:{...H("Button link"),...c("label")},consentWords:Q("label"),_gButton:p("Button"),rowField:h("Shows","text"),rowLinkField:h("Link from","link"),...oo(y,"_dDesign"),_gStyle:p("Style"),variant:c("buttonColor"),icon:{type:"custom",render:o=>e($,{value:o.value,onChange:o.onChange})},iconPosition:c("icon"),arrow:c("icon"),...y},resolveFields:(o,n)=>X(M(n.fields,o,n),o.props,"label",["href"]),showWhenFacts:J};export{So as ButtonBlockFields};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{EyeOffIcon as r,StylesIcon as d,WeightIcon as p,WidthIcon as c}from"efficient-easel/icons";import{deviceField as m}from"efficient-easel/screen/lib/document/device-fields";import{swapPadding as f,toggle as a}from"../../../controls.js";import{keptByRow as g}from"efficient-easel/screen/lib/document/style-fields";import{select as I,sidesPaddingFields as D,slider as o}from"../../../box-fields.js";import{DEFAULT_DIVIDER_STYLE as s,DIVIDER_SPACE_PX as E,DIVIDER_STYLE_OPTIONS as _,parseDividerSpacing as h}from"../../../../../../format/lib/sections/divider-style.js";import{withRowRules as y}from"../../../../../../render/lib/document/show-when.js";const S={any:[{field:"style",set:!1},{field:"style",is:s}]},P={not:{field:"style",is:"none"}},v={fields:y({style:I("Style",e(d,{}),_,s),spacing:g("sectionPaddingTop"),thickness:o("Thickness",e(p,{}),1,8,1,1,"px"),lengthPct:o("Length",e(c,{}),10,100,1,100,"%"),hideOnMobile:m("mobile",a("Hide",!1,e(r,{})))},[[["thickness"],S],[["lengthPct"],P]]),resolveFields:(t,{fields:n})=>{const i=E[h(t.props.spacing)],l=D({fallback:{top:i,bottom:i}});return f(n,l)}};export{v as DividerFields};
1
+ import{jsx as e}from"react/jsx-runtime";import{EyeOffIcon as r,StylesIcon as d,WeightIcon as p,WidthIcon as c}from"efficient-easel/icons";import{deviceField as m}from"efficient-easel/screen/lib/document/device-fields";import{swapPadding as f,toggle as a}from"../../../controls.js";import{keptByRow as g}from"efficient-easel/screen/lib/document/style-fields";import{select as I,sidesPaddingFields as D,slider as t}from"../../../box-fields.js";import{DEFAULT_DIVIDER_STYLE as o,DIVIDER_SPACE_PX as E,DIVIDER_STYLE_OPTIONS as _,parseDividerSpacing as h}from"../../../../../../format/lib/sections/divider-style.js";import{withRowRules as y}from"../../../../../../render/lib/document/show-when.js";const S={any:[{field:"style",set:!1},{field:"style",is:o}]},P={not:{field:"style",is:"none"}},v={fields:y({style:I("Style",e(d,{}),_,o),spacing:g("sectionPaddingTop"),thickness:t("Thickness",e(p,{}),1,8,1,1,"px"),lengthPct:t("Length",e(c,{}),10,100,1,100,"%"),hideOnMobile:m("mobile",a("Hide",!1,e(r,{})))},[[["thickness"],S],[["lengthPct"],P]]),resolveFields:(s,{fields:n})=>{const i=E[h(s.props.spacing)],l=D({fallback:{top:i,bottom:i},tablet:!0});return f(n,l)}};export{v as DividerFields};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{phoneKey as t}from"efficient-easel/draw";import{BOX_CARD_PAD as a,BOX_DARKEN as i,BOX_DARKEN_STYLES as d,isBackgroundBox as k}from"../../../../../../format/lib/content/box-background.js";import{containerDirectionPoints as u}from"../../../../../../format/lib/content/container-direction.js";import{BOX_TAB_SHAPES as I,REEL_SHAPE_LABELS as w}from"../../../../../../format/lib/reel.js";import{deviceField as l}from"efficient-easel/screen/lib/document/device-fields";import{ClockIcon as F,CropIcon as c,LineBetweenIcon as O,LineSolidIcon as A,OpacityIcon as B,ShadowIcon as E,StylesIcon as m,TargetIcon as L}from"efficient-easel/icons";import{boxBlockSpacingField as H,boxFillField as R,boxPhoneRowField as y,boxShareField as P,boxSharePhoneField as T,containerGapRows as N,linkField as C,plainText as D,swapPadding as h,toggle as r,upload as g,withPanelOnly as j}from"../../../controls.js";import{BOX_SHAPE_OPTIONS as S,boxShapeOf as K}from"../../../../../../format/lib/content/box-shape.js";import{group as n,phoneTwinFields as X}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as G,boxJustifyField as W,boxWrapField as M,placementField as v,segmented as U,select as p,sidesPaddingFields as f,slider as z}from"../../../box-fields.js";import{withRowRules as J}from"../../../../../../render/lib/document/show-when.js";import{separatorField as V}from"../../../separator-field.js";import{LOOP_SCROLLS as Y}from"../../../../../../format/lib/animation/index.js";import{FlexSlots as q}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const Q={field:"bgImage",set:!0},Z={field:"phoneRow",in:[2,3]},$={field:"direction",is:"tabs"},ee={field:"line",in:[!0,!1]},oe={field:"anchor",set:!0},b=["fixed","screen"],te={not:{any:[{field:"sectionHeightMode",in:b},{field:"sectionHeightModePhone",in:b}]}},ie={context:"parent.line",is:!0},ne={field:"direction",is:"row",default:"row"},ae={not:Y},Ie={fields:J({_gContent:n("Content"),content:q.content,_gLayout:n("Layout"),direction:{type:"radio",options:u("Flex")},tabShape:p("Tab shape",e(m,{}),I.map(o=>({label:w[o],value:o})),"tabs"),label:j(D("Tab name")),...N("Flex"),justify:W(),align:G(),wrap:M(),boxShape:l("desktop",p("Box shape",e(c,{}),[...S],"auto")),[t("boxShape")]:X("boxShape",U("Box shape",e(c,{}),[...S],"auto",{phoneRest:o=>K(o)}))[t("boxShape")],separator:V(e(O,{size:18}),"none"),share:l("desktop",P()),[t("share")]:T(),phoneRow:y(),blockSpacing:H(),line:r("Line",!1,e(A,{}),"A line across the blocks, with a dot on each."),upcoming:r("Upcoming",!1,e(F,{}),"Still to come: a hollow dot, and the gold line stops before it."),_gShadow:n("Shadow"),shadow:r("Shadow",!1,e(E,{})),fillColor:R(),_gBackground:n("Background image"),bgImage:l("desktop",g("Image","image/*")),bgImagePhone:l("mobile",g("Image","image/*")),darken:z("Darken",e(B,{}),i.min,i.max,i.step,i.fallback,i.unit),darkenStyle:p("Darken style",e(m,{}),d,d[0].value),placement:v("Content position"),_gLink:n("Link"),link:C("Link to"),jumpHighlight:r("Highlight when a link jumps here",!1,e(L,{}),"When a link lands on this Box's anchor, the Box gets an accent outline and its first block turns accent.")},[[["darken","darkenStyle","placement"],Q],[[t("share")],Z],[["tabShape"],$],[["separator"],ne],[["justify","wrap"],ae],[["line"],ee],[["upcoming"],ie],[["jumpHighlight"],oe],[["boxShape",t("boxShape")],te]]),resolveFields:(o,{fields:s})=>{const x=o.props;if(k(x.bgImage)){const _=f({fallback:{top:a.desktop,bottom:a.desktop,left:a.side,right:a.side}});return h(s,_)}return o.props.padV2!==!0?h(s,f({fallback:{top:24,bottom:24}})):s}};export{Ie as FlexFields};
1
+ import{jsx as o}from"react/jsx-runtime";import{phoneKey as n,tabletKey as m}from"efficient-easel/draw";import{BOX_CARD_PAD as r,BOX_DARKEN as a,BOX_DARKEN_STYLES as h,isBackgroundBox as R}from"../../../../../../format/lib/content/box-background.js";import{BOX_TAB_SHAPES as y,REEL_SHAPE_LABELS as E}from"../../../../../../format/lib/reel.js";import{deviceField as s}from"efficient-easel/screen/lib/document/device-fields";import{ClockIcon as T,CropIcon as g,LineBetweenIcon as N,LineSolidIcon as C,OpacityIcon as P,ShadowIcon as H,StylesIcon as f,TargetIcon as D}from"efficient-easel/icons";import{boxBlockSpacingField as X,boxFillField as M,boxColumnsFields as W,boxShareField as j,boxSharePhoneField as v,containerDirectionField as K,containerGapRows as U,linkField as G,plainText as z,swapPadding as S,toggle as p,upload as _,withPanelOnly as J}from"../../../controls.js";import{BOX_SHAPE_OPTIONS as u,boxShapeOf as V}from"../../../../../../format/lib/content/box-shape.js";import{BOX_COLUMNS_MAX as Y,BOX_COLUMNS_MIN as q,boxPhoneRowOneLine as Q}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as b}from"../../../../../../format/lib/content/box-separator.js";import{group as i,phoneTwinFields as O}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as Z,boxJustifyField as $,boxWrapField as x,placementField as ee,select as d,sidesPaddingFields as k,slider as oe}from"../../../box-fields.js";import{withRowRules as te}from"../../../../../../render/lib/document/show-when.js";import{separatorField as ne}from"../../../separator-field.js";import{LOOP_SCROLLS as ie}from"../../../../../../format/lib/animation/index.js";import{FlexSlots as ae}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{CARD_BOX_FACTS as le,cardDisplayField as re}from"../../../card-display-chips.js";const se={field:"bgImage",set:!0},A={field:"phoneRow",in:[2,3]},pe={field:"direction",is:"tabs"},de={field:"line",in:[!0,!1]},ce={field:"anchor",set:!0},w=["fixed","screen"],me={not:{any:[{field:"sectionHeightMode",in:w},{field:"sectionHeightModePhone",in:w}]}},he={context:"parent.line",is:!0},c={field:"direction",is:"row",default:"row"},l={not:ie},F={all:[c,l,{not:{field:"separator",in:b.map(e=>e.value)}},{not:{field:"line",is:!0}}]},ge={all:[l,{not:{all:[c,{field:"separator",in:b.map(e=>e.value)}]}}]},I={not:{all:[F,{field:"columns",in:Array.from({length:Y},(e,t)=>t+q)}]}};function fe(e){return{...e,render:t=>e.render({...t,value:Q(t.value)?"nowrap":"wrap"})}}const Ce={fields:te({_gContent:i("Content"),content:ae.content,_gCardDisplay:i("Display"),cardDisplay:re(),_gLayout:i("Layout"),direction:K("Flex"),tabShape:d("Tab shape",o(f,{}),y.map(e=>({label:E[e],value:e})),"tabs"),label:J(z("Tab name")),...U("Flex"),justify:$(),align:Z(),...O("wrap",x(),void 0,{phoneRow:fe(x())}),boxShape:s("desktop",d("Box shape",o(g,{}),[...u],"auto")),[n("boxShape")]:O("boxShape",d("Box shape",o(g,{}),[...u],"auto",{phoneRest:e=>V(e)}))[n("boxShape")],separator:ne(o(N,{size:18}),"none"),share:s("desktop",j()),[n("share")]:v(),...W(),blockSpacing:X(),line:p("Line",!1,o(C,{}),"A line across the blocks, with a dot on each."),upcoming:p("Upcoming",!1,o(T,{}),"Still to come: a hollow dot, and the gold line stops before it."),_gShadow:i("Shadow"),shadow:p("Shadow",!1,o(H,{})),fillColor:M(),_gBackground:i("Background image"),bgImage:s("desktop",_("Image","image/*")),bgImagePhone:s("mobile",_("Image","image/*")),darken:oe("Darken",o(P,{}),a.min,a.max,a.step,a.fallback,a.unit),darkenStyle:d("Darken style",o(f,{}),h,h[0].value),placement:ee("Content position"),_gLink:i("Link"),link:G("Link to"),jumpHighlight:p("Highlight when a link jumps here",!1,o(D,{}),"When a link lands on this Box's anchor, the Box gets an accent outline and its first block turns accent.")},[[["darken","darkenStyle","placement"],se],[[n("share")],A],[[n("wrap")],{all:[A,l]}],[["tabShape"],pe],[["separator"],c],[["columns",m("columns")],F],[[m("gap")],ge],[["justify"],l],[["wrap"],{all:[l,I]}],[["share"],I],[["line"],de],[["upcoming"],he],[["jumpHighlight"],ce],[["boxShape",n("boxShape")],me]]),resolveFields:(e,{fields:t})=>{const L=e.props;if(R(L.bgImage)){const B=k({fallback:{top:r.desktop,bottom:r.desktop,left:r.side,right:r.side},tablet:!0});return S(t,B)}return e.props.padV2!==!0?S(t,k({fallback:{top:24,bottom:24},tablet:!0})):t},showWhenFacts:le};export{Ce as FlexFields};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{HERO_GROUP_NUDGE_LIMIT as n,HERO_GROUP_WIDTH_DEFAULT as u,HERO_GROUP_WIDTH_MAX as p,HERO_GROUP_WIDTH_MIN as m,HERO_GROUP_WIDTH_NESTED_DEFAULT as _,heroGroupNestDepth as f}from"../../../../../../format/lib/hero-group-placement.js";import{WidthIcon as s}from"efficient-easel/icons";import{containerDirectionField as c,containerGapRows as h,heroGroupPlacementPoints as G,plainText as H,withIdentifier as g,withOffPage as R,withPanelOnly as x}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as F,boxJustifyField as O,boxWrapField as P,placementField as D,positionFields as E,sidesPaddingFields as w,slider as d}from"../../../box-fields.js";import{PH as I}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as T}from"../../../../../../render/lib/document/show-when.js";import{HeroGroupSlots as y}from"../../../../../../format/lib/document/blocks/general/HeroGroup/meta.js";const S={fields:T({_gContent:o("Content"),name:x(g(R(H("Box name",I.boxName)))),content:y.content,_gLayout:o("Layout"),placement:D("Placement",{pointsFor:G}),width:d("Width",r(s,{}),m,p,5,u,"%"),direction:c("HeroGroup"),...h("HeroGroup"),justify:O(),align:F(),wrap:P(),_gNudge:o("Nudge"),...E({keys:{x:"nudgeX",y:"nudgeY"},min:-n,max:n,label:null}),...w()},[[["placement"],{context:"heroGroupDepth",is:0}]]),resolveFields:(e,{fields:t,appState:l})=>{const a=typeof e.props.id=="string"?e.props.id:"";if(f(l?.data,a)===0)return t;const i={...t};return i.width=d("Width",r(s,{}),m,p,5,_,"%"),i}};export{S as HeroGroupFields};
1
+ import{jsx as r}from"react/jsx-runtime";import{HERO_GROUP_NUDGE_LIMIT as n,HERO_GROUP_WIDTH_DEFAULT as u,HERO_GROUP_WIDTH_MAX as p,HERO_GROUP_WIDTH_MIN as l,HERO_GROUP_WIDTH_NESTED_DEFAULT as _,heroGroupNestDepth as f}from"../../../../../../format/lib/hero-group-placement.js";import{WidthIcon as m}from"efficient-easel/icons";import{containerDirectionField as c,containerGapRows as h,heroGroupPlacementPoints as G,plainText as H,withIdentifier as g,withOffPage as R,withPanelOnly as x}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as F,boxJustifyField as O,boxWrapField as P,placementField as D,positionFields as E,sidesPaddingFields as w,slider as s}from"../../../box-fields.js";import{PH as I}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as T}from"../../../../../../render/lib/document/show-when.js";import{HeroGroupSlots as y}from"../../../../../../format/lib/document/blocks/general/HeroGroup/meta.js";const S={fields:T({_gContent:o("Content"),name:x(g(R(H("Box name",I.boxName)))),content:y.content,_gLayout:o("Layout"),placement:D("Placement",{pointsFor:G}),width:s("Width",r(m,{}),l,p,5,u,"%"),direction:c("HeroGroup"),...h("HeroGroup"),justify:O(),align:F(),wrap:P(),_gNudge:o("Nudge"),...E({keys:{x:"nudgeX",y:"nudgeY"},min:-n,max:n,label:null}),...w({tablet:!0})},[[["placement"],{context:"heroGroupDepth",is:0}]]),resolveFields:(e,{fields:t,appState:d})=>{const a=typeof e.props.id=="string"?e.props.id:"";if(f(d?.data,a)===0)return t;const i={...t};return i.width=s("Width",r(m,{}),l,p,5,_,"%"),i}};export{S as HeroGroupFields};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{FieldGlyph as i}from"../../../../../components/FieldGlyph.js";import{CARD_ROW_FACTS as n,cardRowField as s,cardRowFields as a}from"../../../card-row-fields.js";import{textarea as p}from"../../../controls.js";import{group as m}from"efficient-easel/screen/lib/document/box-fields";import{select as h}from"../../../box-fields.js";import{PH as d}from"../../../../../../format/lib/document/blocks/placeholders.js";import{toneField as g}from"../../shared-fields.js";import{blockAlignmentFields as f}from"../../../box-fields.js";import{consentWordsKept as u,withConsentWordsRow as c}from"../../../consent-words-field.js";function x(e,o){const t=o?.textStyle;if(typeof t!="string"||!t.startsWith("heading-"))return e;const{align:F,alignPhone:b,...l}=e;return l}const C={fields:{text:p("Body",d.body),consentWords:u("text"),...f(),tone:g(),_gText:m("Text"),rowField:s("Shows","text"),tag:h("HTML tag",r(i,{noun:"heading"}),[{label:"Paragraph",value:"p"},{label:"H1",value:"h1"},{label:"H2",value:"h2"},{label:"H3",value:"h3"},{label:"H4",value:"h4"},{label:"H5",value:"h5"},{label:"H6",value:"h6"}],"p")},resolveFields:(e,o)=>x(c(a(o.fields,e,o),e.props,"text"),e.props),showWhenFacts:n};export{C as TextFields};
1
+ import{jsx as l}from"react/jsx-runtime";import{FieldGlyph as i}from"../../../../../components/FieldGlyph.js";import{COUNT_KEY_PROP as n}from"../../../../../../format/lib/content/block-sources.js";import{CARD_ROW_FACTS as s,cardRowField as m,cardRowFields as p}from"../../../card-row-fields.js";import{textarea as a}from"../../../controls.js";import{group as h}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as f}from"efficient-easel/screen/lib/document/style-fields";import{select as d}from"../../../box-fields.js";import{PH as g}from"../../../../../../format/lib/document/blocks/placeholders.js";import{toneField as u}from"../../shared-fields.js";import{blockAlignmentFields as x}from"../../../box-fields.js";import{consentWordsKept as c,withConsentWordsRow as w}from"../../../consent-words-field.js";import{withLiveNumberRow as b}from"../../../live-number-field.js";function F(e,o){const t=o?.textStyle;if(typeof t!="string"||!t.startsWith("heading-"))return e;const{align:v,alignPhone:H,...r}=e;return r}const K={fields:{text:a("Body",g.body),consentWords:c("text"),[n]:f("text"),...x(),tone:u(),_gText:h("Text"),rowField:m("Shows","text"),tag:d("HTML tag",l(i,{noun:"heading"}),[{label:"Paragraph",value:"p"},{label:"H1",value:"h1"},{label:"H2",value:"h2"},{label:"H3",value:"h3"},{label:"H4",value:"h4"},{label:"H5",value:"h5"},{label:"H6",value:"h6"}],"p")},resolveFields:(e,o)=>F(b(w(p(o.fields,e,o),e.props,"text"),e.props),e.props),showWhenFacts:s};export{K as TextFields};
@@ -1,2 +1,2 @@
1
- export declare const assembleGeneralBlocks: () => Record<"Grid" | "Flex" | "HeroGroup" | "Ticker" | "Prose" | "Logos" | "Divider" | "LogoBlock" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Series" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "DocMetaCards" | "FAQ" | "ContactLocations" | "SectionHeader" | "CustomHTML" | "Manifesto" | "Split" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Heading" | "Eyebrow" | "ImageBlock" | "LocationMap" | "ButtonBlock" | "PostCard" | "HeroSlide" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
2
- export declare const generalBlocks: Record<"Grid" | "Flex" | "HeroGroup" | "Ticker" | "Prose" | "Logos" | "Divider" | "LogoBlock" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Series" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "DocMetaCards" | "FAQ" | "ContactLocations" | "SectionHeader" | "CustomHTML" | "Manifesto" | "Split" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Heading" | "Eyebrow" | "ImageBlock" | "LocationMap" | "ButtonBlock" | "PostCard" | "HeroSlide" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
1
+ export declare const assembleGeneralBlocks: () => Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Series" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "DocMetaCards" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
2
+ export declare const generalBlocks: Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Series" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "DocMetaCards" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;