efficient-web-builder 5.4.0 → 6.1.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 (141) hide show
  1. package/CHANGELOG.md +272 -0
  2. package/README.md +44 -0
  3. package/dist/components/ApplyCornersToSiblings.js +1 -1
  4. package/dist/components/Banner.js +1 -1
  5. package/dist/components/BlockGapField.js +1 -1
  6. package/dist/components/BlogPostSource.js +1 -1
  7. package/dist/components/Breadcrumb.js +1 -1
  8. package/dist/components/CardShadowField.js +1 -1
  9. package/dist/components/CategoryBar.js +1 -1
  10. package/dist/components/ChatSettingsPanel.js +1 -1
  11. package/dist/components/ClearColoursDialog.js +1 -1
  12. package/dist/components/CornersField.js +1 -1
  13. package/dist/components/DocBody.js +5 -5
  14. package/dist/components/DuplicateToPageMenu.js +1 -1
  15. package/dist/components/FAQ.js +1 -1
  16. package/dist/components/Flex.js +1 -1
  17. package/dist/components/Footprint.js +3 -3
  18. package/dist/components/HeadingAudit.js +1 -1
  19. package/dist/components/HeroImageField.js +1 -1
  20. package/dist/components/HeroSection.js +2 -2
  21. package/dist/components/HeroSingle.js +1 -1
  22. package/dist/components/HeroSlide.js +1 -1
  23. package/dist/components/HoverEffectField.js +1 -1
  24. package/dist/components/ImageFocusRow.js +1 -1
  25. package/dist/components/IntegrationsSection.js +1 -1
  26. package/dist/components/IntroBleed.js +1 -1
  27. package/dist/components/KeyFeatures.js +1 -1
  28. package/dist/components/LocationsGroupedField.js +1 -1
  29. package/dist/components/MediaUploadField.js +1 -1
  30. package/dist/components/MultiSelectField.js +1 -1
  31. package/dist/components/PagesPanel.js +1 -1
  32. package/dist/components/PartInkControl.js +1 -1
  33. package/dist/components/PartResetDot.js +1 -1
  34. package/dist/components/PartSettingsPanel.js +1 -1
  35. package/dist/components/PartTextBox.js +1 -1
  36. package/dist/components/PhotographyField.js +1 -1
  37. package/dist/components/ProcessSteps.js +1 -1
  38. package/dist/components/SearchSelectField.d.ts +1 -1
  39. package/dist/components/SearchSelectField.js +1 -1
  40. package/dist/components/SectionEditor.js +1 -1
  41. package/dist/components/SectionTextEntries.js +1 -1
  42. package/dist/components/SectionThemePicker.js +1 -1
  43. package/dist/components/Series.js +1 -1
  44. package/dist/components/ShadowColourField.js +1 -1
  45. package/dist/components/SideSpaceField.js +1 -1
  46. package/dist/components/SiteFields.js +1 -1
  47. package/dist/components/SiteWidthField.js +1 -1
  48. package/dist/components/SlotChildRows.js +1 -1
  49. package/dist/components/SocialLinksPanel.js +1 -1
  50. package/dist/components/SourceStatus.js +1 -1
  51. package/dist/components/SpecStrip.js +1 -1
  52. package/dist/components/Split.js +1 -1
  53. package/dist/components/StandaloneSectionEditor.js +1 -1
  54. package/dist/components/StatsParagraph.js +1 -1
  55. package/dist/components/StorefrontLinkField.js +1 -1
  56. package/dist/components/StylesPanel.js +1 -1
  57. package/dist/components/SwitchToBoxFooter.js +1 -1
  58. package/dist/components/Testimonials.js +1 -1
  59. package/dist/components/TextStyleRow.js +1 -1
  60. package/dist/components/TextStylesField.js +1 -1
  61. package/dist/components/ThemeCard.js +1 -1
  62. package/dist/components/ThemeColourField.js +1 -1
  63. package/dist/components/ThemeField.js +1 -1
  64. package/dist/components/TickerSection.js +1 -1
  65. package/dist/components/TickerSettingsPanel.js +1 -1
  66. package/dist/components/TitleWithButtons.js +1 -1
  67. package/dist/components/WebsiteScreenParts.js +1 -1
  68. package/dist/components/WebsiteSettingsPanel.js +1 -1
  69. package/dist/components/WidthFollowField.js +1 -1
  70. package/dist/components/preview-devices.js +1 -1
  71. package/dist/components/socialIcons.js +1 -1
  72. package/dist/components/storefront-editor.css +61 -157
  73. package/dist/components/useLocationsTree.js +1 -1
  74. package/dist/components/useSocialSettings.d.ts +2 -2
  75. package/dist/lib/content/block-sources.d.ts +20 -0
  76. package/dist/lib/content/block-sources.js +1 -0
  77. package/dist/lib/content/ink.d.ts +36 -0
  78. package/dist/lib/content/ink.js +1 -0
  79. package/dist/lib/content/product-page.js +1 -1
  80. package/dist/lib/content/record-types.d.ts +21 -0
  81. package/dist/lib/content/record-types.js +1 -0
  82. package/dist/lib/content/section-surface.js +1 -1
  83. package/dist/lib/content/social-links.d.ts +1 -1
  84. package/dist/lib/content/social-links.js +1 -1
  85. package/dist/lib/editor-words-catalogue.d.ts +1184 -0
  86. package/dist/lib/editor-words-catalogue.js +11 -0
  87. package/dist/lib/editor-words.d.ts +15 -0
  88. package/dist/lib/editor-words.js +1 -0
  89. package/dist/lib/links/link-picker-setup.d.ts +1 -1
  90. package/dist/lib/links/link-picker-setup.js +1 -1
  91. package/dist/lib/links/page-link-rules.d.ts +0 -1
  92. package/dist/lib/links/page-link-rules.js +1 -1
  93. package/dist/lib/puck/ColourControl.js +1 -1
  94. package/dist/lib/puck/MarkupToolbar.js +1 -1
  95. package/dist/lib/puck/apply-card-corners.js +1 -1
  96. package/dist/lib/puck/block-source-fields.d.ts +5 -0
  97. package/dist/lib/puck/block-source-fields.js +1 -0
  98. package/dist/lib/puck/blocks/general/Breadcrumb/render.js +1 -1
  99. package/dist/lib/puck/blocks/general/Cards/render.js +1 -1
  100. package/dist/lib/puck/blocks/general/CategoryBar/render.js +1 -1
  101. package/dist/lib/puck/blocks/general/Chart/render.js +2 -2
  102. package/dist/lib/puck/blocks/general/DocBody/render.js +1 -1
  103. package/dist/lib/puck/blocks/general/DocMasthead/render.js +1 -1
  104. package/dist/lib/puck/blocks/general/DocTabs/render.js +1 -1
  105. package/dist/lib/puck/blocks/general/FAQ/render.js +1 -1
  106. package/dist/lib/puck/blocks/general/Footprint/render.js +2 -2
  107. package/dist/lib/puck/blocks/general/HeroSingle/render.js +1 -1
  108. package/dist/lib/puck/blocks/general/HeroSlide/render.js +1 -1
  109. package/dist/lib/puck/blocks/general/KeyFeatures/render.js +1 -1
  110. package/dist/lib/puck/blocks/general/Logos/render.js +1 -1
  111. package/dist/lib/puck/blocks/general/Masthead/render.js +1 -1
  112. package/dist/lib/puck/blocks/general/OrderSummary/fields.js +1 -1
  113. package/dist/lib/puck/blocks/general/OrderSummary/render.js +1 -1
  114. package/dist/lib/puck/blocks/general/PaymentBadges/render.js +1 -1
  115. package/dist/lib/puck/blocks/general/ProcessSteps/render.js +1 -1
  116. package/dist/lib/puck/blocks/general/Series/render.js +1 -1
  117. package/dist/lib/puck/blocks/general/StatsParagraph/render.js +1 -1
  118. package/dist/lib/puck/blocks/general/Testimonials/render.js +1 -1
  119. package/dist/lib/puck/blocks/general/Timeline/render.js +2 -2
  120. package/dist/lib/puck/blocks/general/TimelineTrack/render.js +1 -1
  121. package/dist/lib/puck/blocks/scaffold.js +1 -1
  122. package/dist/lib/puck/controls.d.ts +1 -1
  123. package/dist/lib/puck/controls.js +1 -1
  124. package/dist/lib/puck/editor-page-context.d.ts +1 -0
  125. package/dist/lib/puck/editor-page-context.js +1 -1
  126. package/dist/lib/puck/footer-block-row-name.js +1 -1
  127. package/dist/lib/puck/page-root-fields.d.ts +4 -1
  128. package/dist/lib/puck/page-root-fields.js +1 -1
  129. package/dist/lib/puck/registry.js +1 -1
  130. package/dist/lib/puck/theme-swatches.js +1 -1
  131. package/dist/lib/source-rules/editor-chrome-note.js +1 -1
  132. package/dist/lib/source-rules/editor-words.d.ts +26 -0
  133. package/dist/lib/source-rules/editor-words.js +3 -0
  134. package/dist/lib/source-rules/mirrored-rows-agree.js +1 -1
  135. package/dist/lib/source-rules/part-style-naming.js +1 -1
  136. package/dist/lib/source-rules/social-icons-import.js +4 -4
  137. package/dist/lib/source-rules/support/label-extraction.js +2 -2
  138. package/dist/lib/theme-save-message.js +1 -1
  139. package/package.json +7 -6
  140. package/dist/lib/image-focus.d.ts +0 -16
  141. package/dist/lib/image-focus.js +0 -1
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import b from"./Ticker.js";import{TICKER_JOIN_BOX_CLASS as x,tickerJoinSide as S,tickerJoinStripClass as h}from"../lib/sections/ticker-join.js";const k="item";function v({items:s,durationSec:l=50,tone:c="scrim",borders:a=!0,size:d,separator:m,scroll:p,join:f,editing:u}){const r=(s??[]).map(n=>n?.text?.trim()?n.text:u?k:"").filter(Boolean);if(r.length===0)return null;const i=c!=="plain",e=S(f),o=t("div",{className:[e?`absolute inset-x-0 ${h(e)}`:"relative z-[2]","py-3.5 max-[800px]:py-3",i?"bg-bg":"",a?"border-y border-line":""].filter(Boolean).join(" "),children:t(b,{items:r,durationSec:l,size:d,separator:m,scroll:p,backdrop:i?"themed-band":"themed-section"})});return e?t("div",{className:x,children:o}):o}export{v as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import b from"./Ticker.js";import{TICKER_JOIN_BOX_CLASS as x,tickerJoinSide as h,tickerJoinStripClass as S}from"../lib/sections/ticker-join.js";import{say as k}from"../lib/editor-words.js";const v=()=>k("item");function y({items:s,durationSec:l=50,tone:a="scrim",borders:c=!0,size:d,separator:m,scroll:p,join:f,editing:u}){const t=(s??[]).map(n=>n?.text?.trim()?n.text:u?v():"").filter(Boolean);if(t.length===0)return null;const i=a!=="plain",e=h(f),o=r("div",{className:[e?`absolute inset-x-0 ${S(e)}`:"relative z-[2]","py-3.5 max-[800px]:py-3",i?"bg-bg":"",c?"border-y border-line":""].filter(Boolean).join(" "),children:r(b,{items:t,durationSec:l,size:d,separator:m,scroll:p,backdrop:i?"themed-band":"themed-section"})});return e?r("div",{className:x,children:o}):o}export{y as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as h}from"react/jsx-runtime";import{useId as f,useMemo as T}from"react";import{useEasel as I}from"efficient-easel/easel";import{SettingsField as k,SettingsSwitch as x}from"efficient-easel/panel";import{EyeIcon as b}from"efficient-easel/icons";import{DEFAULT_TICKER_ITEMS as E}from"./HeroSection.js";import{GroupLabel as S,TextListField as g,TICKER_ITEMS_ROW as a}from"../lib/puck/controls.js";const w="root:default-zone";function _({heroId:c}){const{appState:l,dispatch:p}=I(e=>e),n=l.data.content??[],r=n.findIndex(e=>e.props.id===c),t=r>=0?n[r]:null,d=t?t.props.showTicker??!0:!0,m=T(()=>{const e=t?.props.tickerItems;return Array.isArray(e)?e:E.map(u=>({text:u}))},[t]),s=f();if(!t)return o("p",{className:"sf-note",children:"This ticker’s hero is no longer on the page."});const i=e=>p({type:"replace",destinationZone:w,destinationIndex:r,data:{...t,props:{...t.props,...e}}});return h("div",{children:[o(S,{label:"Ticker"}),o(k,{label:"Show ticker",labelId:s,icon:o(b,{}),action:o(x,{checked:d,onChange:e=>i({showTicker:e}),ariaLabelledBy:s})}),o(g,{label:a.label,icon:a.icon,items:m,placeholder:"item",onChange:e=>i({tickerItems:e}),markup:!0})]})}export{_ as default};
1
+ "use client";import{jsx as o,jsxs as f}from"react/jsx-runtime";import{useId as T,useMemo as I}from"react";import{useEasel as k}from"efficient-easel/easel";import{SettingsField as x,SettingsSwitch as b}from"efficient-easel/panel";import{EyeIcon as E}from"efficient-easel/icons";import{DEFAULT_TICKER_ITEMS as S}from"./HeroSection.js";import{GroupLabel as g,TextListField as w,TICKER_ITEMS_ROW as a}from"../lib/puck/controls.js";import{say as c}from"../lib/editor-words.js";const _="root:default-zone";function y({heroId:p}){const{appState:l,dispatch:m}=k(e=>e),s=l.data.content??[],r=s.findIndex(e=>e.props.id===p),t=r>=0?s[r]:null,d=t?t.props.showTicker??!0:!0,h=I(()=>{const e=t?.props.tickerItems;return Array.isArray(e)?e:S.map(u=>({text:u}))},[t]),n=T();if(!t)return o("p",{className:"sf-note",children:c("This ticker’s hero is no longer on the page.")});const i=e=>m({type:"replace",destinationZone:_,destinationIndex:r,data:{...t,props:{...t.props,...e}}});return f("div",{children:[o(g,{label:"Ticker"}),o(x,{label:c("Show ticker"),labelId:n,icon:o(E,{}),action:o(b,{checked:d,onChange:e=>i({showTicker:e}),ariaLabelledBy:n})}),o(w,{label:a.label,icon:a.icon,items:h,placeholder:"item",onChange:e=>i({tickerItems:e}),markup:!0})]})}export{y as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as l}from"react/jsx-runtime";import{SiteLink as b}from"../lib/site-runtime.js";import{renderHeadline as v}from"./goldPhrases.js";function w({title:s,buttons:m,padTop:x,padBottom:o,buttonsAlign:a,editing:p=!1}={}){const d=typeof x=="number"?x:140,c=typeof o=="number"?o:140,r=(m??[]).filter(e=>p||(e.label??"").trim()),i=!!(s??"").trim(),n=!i&&(a==="center"||a==="left")?a:null;return!p&&!i&&r.length===0?null:t("section",{className:"relative z-[2] bg-bg",children:l("div",{className:n==="center"?"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-1 items-center justify-items-center gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":n==="left"?"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-1 items-center justify-items-start gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_auto] items-center gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",style:{paddingTop:d,paddingBottom:c},children:[n===null&&!i&&r.length>0&&t("div",{"aria-hidden":!0,className:"max-[1100px]:hidden"}),i&&t("h2",{className:"max-w-[1000px] font-display text-[length:min(var(--size-headingLarge,clamp(48px,7vw,108px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-[0.94] tracking-[-0.035em] text-fg",children:v(s??"")}),r.length>0&&t("div",{className:"flex min-w-[280px] flex-col gap-3.5 max-[1100px]:min-w-0",children:r.map((e,f)=>{const g=(e.label??"").trim()||"Button label",h=e.href||"#",u=e.variant==="primary";return l(b,{href:h,className:["flex items-center justify-between gap-6 px-7 py-5","font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.3em] transition-colors",u?"border border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg":"border border-line text-fg hover:border-accent hover:text-accent"].join(" "),children:[g," ",t("span",{"aria-hidden":!0,children:"→"})]},f)})})]})})}export{w as default};
1
+ import{jsx as t,jsxs as l}from"react/jsx-runtime";import{SiteLink as b}from"../lib/site-runtime.js";import{renderHeadline as v}from"./goldPhrases.js";import{say as w}from"../lib/editor-words.js";function y({title:n,buttons:m,padTop:x,padBottom:o,buttonsAlign:a,editing:p=!1}={}){const d=typeof x=="number"?x:140,c=typeof o=="number"?o:140,r=(m??[]).filter(e=>p||(e.label??"").trim()),i=!!(n??"").trim(),s=!i&&(a==="center"||a==="left")?a:null;return!p&&!i&&r.length===0?null:t("section",{className:"relative z-[2] bg-bg",children:l("div",{className:s==="center"?"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-1 items-center justify-items-center gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":s==="left"?"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-1 items-center justify-items-start gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_auto] items-center gap-[60px] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:grid-cols-1 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",style:{paddingTop:d,paddingBottom:c},children:[s===null&&!i&&r.length>0&&t("div",{"aria-hidden":!0,className:"max-[1100px]:hidden"}),i&&t("h2",{className:"max-w-[1000px] font-display text-[length:min(var(--size-headingLarge,clamp(48px,7vw,108px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-[0.94] tracking-[-0.035em] text-fg",children:v(n??"")}),r.length>0&&t("div",{className:"flex min-w-[280px] flex-col gap-3.5 max-[1100px]:min-w-0",children:r.map((e,f)=>{const g=(e.label??"").trim()||w("Button label"),h=e.href||"#",u=e.variant==="primary";return l(b,{href:h,className:["flex items-center justify-between gap-6 px-7 py-5","font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.3em] transition-colors",u?"border border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg":"border border-line text-fg hover:border-accent hover:text-accent"].join(" "),children:[g," ",t("span",{"aria-hidden":!0,children:"→"})]},f)})})]})})}export{y as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as b}from"react/jsx-runtime";import{useCallback as k,useEffect as f,useState as Y}from"react";import{ExternalIcon as F}from"efficient-easel/icons";import{Button as G,Tooltip as O,buttonClasses as j}from"efficient-shell/ui";import{SettingsSwitch as z}from"efficient-easel/panel";import{PagesIcon as K,StylesIcon as U}from"efficient-easel/rail";import{TreeRow as Z}from"efficient-easel/tree";import q from"./HeadingAudit.js";import{LocationsTreeContext as X}from"./LocationsTreeContext.js";import J from"./PagesPanel.js";import{usePreviewChat as Q}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as $}from"./preview-devices.js";import{PreviewDeviceContext as ee}from"./PreviewDeviceContext.js";import{usePreviewHeader as te}from"./PreviewHeaderContext.js";import{usePreviewSocial as oe}from"./PreviewSocialContext.js";import{usePreviewSurface as re}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as ie,usePreviewTicker as se}from"./PreviewTickerContext.js";import ne,{CHAT_MODE as ae,HEADER_MODE as y,SOCIAL_MODE as ce,WEBSITE_MODE as B}from"./SectionEditor.js";import g from"./SectionIcon.js";import le from"./SectionThumbnail.js";import{useStorefrontDocument as I}from"./StorefrontDocumentContext.js";import de from"./StylesPanel.js";import pe from"./TemplateGlyph.js";import{useFooterFocus as me}from"./useFooterFocus.js";import{LOCATIONS_TYPE as fe,useLocationsTree as ue}from"./useLocationsTree.js";import{usePinnedChromeSeed as Se}from"./usePinnedChromeSeed.js";import{usePreviewHref as Ee}from"./usePreviewHref.js";import{SITE_STYLES_TABS as Te,SITE_STYLES_TEXT_TAB as he,useWebsiteName as we}from"./WebsiteSettingsPanel.js";import{HERO_GROUP_TYPE as Pe,duplicateBlocked as ve,heroGroupNestDepth as be}from"../lib/hero-group-placement.js";import{stripMarkup as ke}from"../lib/markup.js";import{categoryShortLabel as ge,PINNED_SECTION_TYPE as Ie}from"../lib/puck/add-palette.js";import{canAddTo as Ce}from"../lib/puck/add-target.js";import{blockIsOffered as _e}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Le,setBookingPreview as Oe}from"../lib/puck/booking-preview.js";import{footerBlockRowName as ye}from"../lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as Be,HEADER_TYPE as A}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as Ae,readLeftView as Ne,resolveLeftView as Re,writeLeftView as He}from"../lib/puck/left-view.js";import{isLockedBlock as De}from"../lib/puck/locked-blocks.js";import{scrollPreviewToSection as xe,scrollPreviewToTop as N}from"../lib/puck/preview-dom.js";import{SiteCanvas as Ve}from"../lib/puck/overrides.js";import{labelAtLevel as We}from"../lib/puck/section-catalog.js";import{SECTION_DESCRIPTIONS as Me}from"../lib/puck/section-descriptions.js";import{isSectionGroupType as Ye,sectionGroupZone as Fe,SITE_FOOTER_TYPE as Ge,SITE_HEADER_TYPE as je}from"../lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as ze,SAVE_AS_TEMPLATE_EVENT as Ke}from"../lib/save-as-template-action.js";import{newSectionNode as Ue}from"../lib/sections/new-section-node.js";import{useHostProducts as Ze}from"../lib/use-host-products.js";function R({mode:t,open:o}){const{setSelectedHeroId:r,setSelectHandler:c}=se(),l=t,n=l.kind==="ticker"?l.heroId:null,a=k(i=>{if(!i)return;o({kind:"ticker",heroId:i}),xe(i)},[o]);return f(()=>{r(n)},[n,r]),f(()=>{c(a)},[c,a]),{partRows:(i,{rowClick:m})=>{const s=String(i.props.id);return i.type==="Hero"&&e(Z,{icon:e(g,{type:"ticker",size:13}),name:ie,onSelect:()=>a(s),selected:n===s,rowProps:{onClick:m(()=>a(s))}})}}}function qe(){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,hasUnsavedEdits:l,bridgeCapabilities:n,notifyParent:a,token:i}=I(),{hasPreviewLink:m}=o,s=ze({hasTrustedConsole:!!i,canCreatePlatformTemplate:n.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:l}),T=k(()=>{!c||!r||a(Ke,{siteId:c,slug:r})},[a,c,r]),u=Ee({pageSlug:r,siteId:c,token:i}),S=t.previewHref?.(r)??u;return{barLead:()=>s.visible&&e(O,{side:"bottom",content:s.enabled?"Save this website as a platform template":s.disabledReason,children:e("span",{className:"sf-tip-disabled",tabIndex:s.enabled?void 0:0,children:e(G,{variant:"secondary",disabled:!s.enabled,onClick:T,rightIcon:e(pe,{}),children:"Save as Template"})})}),barTrail:()=>m&&r&&e(O,{content:"Preview the live site (opens in a new tab)",children:b("a",{className:j({variant:"secondary"}),href:S,target:"_blank",rel:"noopener noreferrer","aria-label":"Preview the live site in a new tab",children:["Preview",e(F,{size:15})]})})}}function Xe(){return b("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[e("path",{d:"M12 3a9 9 0 0 0 0 18 2.3 2.3 0 0 0 2.3-2.3c0-.55-.22-1.05-.57-1.42-.34-.37-.56-.87-.56-1.43A2.35 2.35 0 0 1 15.6 13.5H18a3 3 0 0 0 3-3c0-4.14-4-7.5-9-7.5z"}),e("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),e("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),e("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function Je(t,o){const{capabilities:r,templateId:c,siteId:l,tokenRef:n,navigate:a}=I(),{hasSiteTheme:i,explainsSiteSettings:m}=r,s=d=>o.setView(d),[T,u]=Y(Te[0].id),{surface:S,setSurface:w}=re(),P=()=>{if(i){s("styles"),o.reveal(),N();return}t.show(B),t.reveal(),N()},v={id:"pages",label:"Pages",icon:e(K,{}),panel:({onHide:d})=>e(J,{activeSurface:S,onPreviewSurface:w,onNavigate:p=>{w(null),a(c?{kind:"template",id:c,pageSlug:p}:{kind:"page",slug:p,siteId:l??void 0})},onClose:d})},E=[];return!i&&m&&E.push({id:"appearance",label:"Appearance",icon:e(Xe,{}),active:t.kind==="website",onSelect:P}),i&&E.push({id:"styles",label:"Site styles",icon:e(U,{}),panel:({onHide:d,notify:p})=>e(de,{tokenRef:n,siteId:l??void 0,onClose:d,onNotify:p,tab:T,onTabChange:u})}),{railLead:[v],railTrail:E,resolveLeftView:(d,p)=>Re(d,i,p),openSettings:P,openStyles:()=>{u(he),s("styles")}}}function Qe(t,o,r,c){const{kind:l,open:n}=t,{selected:a,zoneOf:i}=o,m=me(o,r);f(()=>{Oe(a?.type==="BookingBox"&&a.props.region==="confirm"?Le(i(String(a.props.id))):null)},[a?.props.id]);const s=ue(t,o),{capabilities:{hasSiteSettings:T}}=I(),{setSelected:u,setSelectHandler:S}=te(),{chat:w,setChat:P,setSelected:v,setSelectHandler:E}=Q(),d=l==="header";f(()=>{u(d)},[d,u]),f(()=>{S(()=>n(y))},[S,n]);const p=k(()=>n(ae),[n]),C=l==="chat";f(()=>{v(C)},[C,v]),f(()=>{E(p)},[E,p]);const{setOpenHandler:_}=oe(),L=k(()=>n(ce),[n]);f(()=>{_(L)},[_,L]);const D=R(t),x=qe(),V=Je(t,c),W=r.device;return{...m,...D,...x,...V,treeFoot:()=>e("div",{className:"sf-tree-tool",children:e(q,{})}),hasOwnRows:h=>h.type===fe,ownRows:s.renderLocationTree,sectionPressed:s.sectionPressed,wrap:h=>e(X.Provider,{value:!0,children:e(ee.Provider,{value:W,children:h})}),addPanelRow:h=>T?b("div",{className:"sf-addside-sitewide",children:[e("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:e(g,{type:"chat",size:16})}),b("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{h(),p()},children:["Live chat",e("span",{className:"sf-addside-sitewide-desc",children:"A chat bubble on every page"})]}),e(z,{checked:w.enabled,onChange:M=>P({enabled:M}),ariaLabel:"Show the chat bubble on the whole site"})]}):void 0}}const $e={isLockedBlock:De,duplicateBlocked:ve,nestDepth:(t,o,r)=>o===Pe?be(t,r):0,newSectionNode:Ue,canAddTo:Ce,blockIsOffered:_e},et={labelAtLevel:We,descriptions:Me,categoryLabel:ge,firstSection:Ie,blockRowName:ye,plainText:ke,Icon:g,Thumbnail:le,useProducts:Ze},tt={desktop:2e3,tablet:800,mobile:390},H="desktop",ot={options:$,initial:H,fluid:H,widths:tt},rt={read:Ne,write:t=>He(t),forSelection:(t,o)=>Ae(t,o)},it={first:A,last:Be,firstGroup:je,lastGroup:Ge,isSectionGroup:Ye,sectionGroupZone:Fe,panelOf:t=>t===A?y:null};function st(t){return{...R(t),openSettings:()=>t.show(B)}}const Qt={useOwnerName:we,useBridges:Qe,useStandaloneBridges:st,useDocumentPass:Se,blockRules:$e,blockLook:et,devices:ot,leftView:rt,pinned:it,Canvas:Ve,Inspector:ne};export{Qt as WEBSITE_SCREEN};
1
+ "use client";import{jsx as r,jsxs as k}from"react/jsx-runtime";import{useCallback as I,useEffect as S,useState as j}from"react";import{ExternalIcon as z}from"efficient-easel/icons";import{Button as K,Tooltip as A,buttonClasses as U}from"efficient-shell/ui";import{SettingsSwitch as Z}from"efficient-easel/panel";import{PagesIcon as q,StylesIcon as X}from"efficient-easel/rail";import{TreeRow as J}from"efficient-easel/tree";import{useEaselStrings as Q}from"efficient-easel/strings";import $ from"./HeadingAudit.js";import{LocationsTreeContext as ee}from"./LocationsTreeContext.js";import te from"./PagesPanel.js";import{usePreviewChat as oe}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as re}from"./preview-devices.js";import{PreviewDeviceContext as ie}from"./PreviewDeviceContext.js";import{usePreviewHeader as se}from"./PreviewHeaderContext.js";import{usePreviewSocial as ne}from"./PreviewSocialContext.js";import{usePreviewSurface as ae}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as ce,usePreviewTicker as le}from"./PreviewTickerContext.js";import de,{CHAT_MODE as pe,HEADER_MODE as B,SOCIAL_MODE as me,WEBSITE_MODE as N}from"./SectionEditor.js";import C from"./SectionIcon.js";import fe from"./SectionThumbnail.js";import{useStorefrontDocument as g}from"./StorefrontDocumentContext.js";import ue from"./StylesPanel.js";import Se from"./TemplateGlyph.js";import{useFooterFocus as Te}from"./useFooterFocus.js";import{LOCATIONS_TYPE as Ee,useLocationsTree as he}from"./useLocationsTree.js";import{usePinnedChromeSeed as we}from"./usePinnedChromeSeed.js";import{usePreviewHref as be}from"./usePreviewHref.js";import{SITE_STYLES_TABS as Pe,SITE_STYLES_TEXT_TAB as ve,useWebsiteName as ke}from"./WebsiteSettingsPanel.js";import{HERO_GROUP_TYPE as Ie,duplicateBlocked as Ce,heroGroupNestDepth as ge}from"../lib/hero-group-placement.js";import{stripMarkup as _e}from"../lib/markup.js";import{categoryShortLabel as Le,PINNED_SECTION_TYPE as ye}from"../lib/puck/add-palette.js";import{canAddTo as Oe}from"../lib/puck/add-target.js";import{blockIsOffered as Ae}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Be,setBookingPreview as Ne}from"../lib/puck/booking-preview.js";import{footerBlockRowName as Re}from"../lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as He,HEADER_TYPE as R}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as De,readLeftView as We,resolveLeftView as xe,writeLeftView as Ve}from"../lib/puck/left-view.js";import{isLockedBlock as Me}from"../lib/puck/locked-blocks.js";import{scrollPreviewToSection as Fe,scrollPreviewToTop as H}from"../lib/puck/preview-dom.js";import{SiteCanvas as Ye}from"../lib/puck/overrides.js";import{labelAtLevel as Ge}from"../lib/puck/section-catalog.js";import{editorWords as je,say as i}from"../lib/editor-words.js";import{SECTION_DESCRIPTIONS as ze}from"../lib/puck/section-descriptions.js";import{isSectionGroupType as Ke,sectionGroupZone as Ue,SITE_FOOTER_TYPE as Ze,SITE_HEADER_TYPE as qe}from"../lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as Xe,SAVE_AS_TEMPLATE_EVENT as Je}from"../lib/save-as-template-action.js";import{newSectionNode as Qe}from"../lib/sections/new-section-node.js";import{useHostProducts as $e}from"../lib/use-host-products.js";function D({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:s}=le(),f=Q().tree,c=e,l=c.kind==="ticker"?c.heroId:null,n=I(d=>{if(!d)return;t({kind:"ticker",heroId:d}),Fe(d)},[t]);return S(()=>{o(l)},[l,o]),S(()=>{s(n)},[s,n]),{partRows:(d,{rowClick:a})=>{const u=String(d.props.id);return d.type==="Hero"&&r(J,{icon:r(C,{type:"ticker",size:13}),name:i(ce),onSelect:()=>n(u),selected:l===u,rowProps:{onClick:a(()=>n(u))},words:f})}}}function et(){const{adapter:e,capabilities:t,currentSlug:o,siteId:s,hasUnsavedEdits:f,bridgeCapabilities:c,notifyParent:l,token:n}=g(),{hasPreviewLink:d}=t,a=Xe({hasTrustedConsole:!!n,canCreatePlatformTemplate:c.canCreatePlatformTemplate,capabilities:t,siteId:s,hasUnsavedEdits:f}),u=I(()=>{!s||!o||l(Je,{siteId:s,slug:o})},[l,s,o]),T=be({pageSlug:o,siteId:s,token:n}),E=e.previewHref?.(o)??T;return{barLead:()=>a.visible&&r(A,{side:"bottom",content:a.enabled?i("Save this website as a platform template"):i(a.disabledReason),children:r("span",{className:"sf-tip-disabled",tabIndex:a.enabled?void 0:0,children:r(K,{variant:"secondary",disabled:!a.enabled,onClick:u,rightIcon:r(Se,{}),children:i("Save as Template")})})}),barTrail:()=>d&&o&&r(A,{content:i("Preview the live site (opens in a new tab)"),children:k("a",{className:U({variant:"secondary"}),href:E,target:"_blank",rel:"noopener noreferrer","aria-label":i("Preview the live site in a new tab"),children:[i("Preview"),r(z,{size:15})]})})}}function tt(){return k("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M12 3a9 9 0 0 0 0 18 2.3 2.3 0 0 0 2.3-2.3c0-.55-.22-1.05-.57-1.42-.34-.37-.56-.87-.56-1.43A2.35 2.35 0 0 1 15.6 13.5H18a3 3 0 0 0 3-3c0-4.14-4-7.5-9-7.5z"}),r("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),r("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function ot(e,t){const{capabilities:o,templateId:s,siteId:f,tokenRef:c,navigate:l}=g(),{hasSiteTheme:n,explainsSiteSettings:d}=o,a=p=>t.setView(p),[u,T]=j(Pe[0].id),{surface:E,setSurface:b}=ae(),P=()=>{if(n){a("styles"),t.reveal(),H();return}e.show(N),e.reveal(),H()},v={id:"pages",label:i("Pages"),icon:r(q,{}),panel:({onHide:p})=>r(te,{activeSurface:E,onPreviewSurface:b,onNavigate:m=>{b(null),l(s?{kind:"template",id:s,pageSlug:m}:{kind:"page",slug:m,siteId:f??void 0})},onClose:p})},h=[];return!n&&d&&h.push({id:"appearance",label:i("Appearance"),icon:r(tt,{}),active:e.kind==="website",onSelect:P}),n&&h.push({id:"styles",label:i("Site styles"),icon:r(X,{}),panel:({onHide:p,notify:m})=>r(ue,{tokenRef:c,siteId:f??void 0,onClose:p,onNotify:m,tab:u,onTabChange:T})}),{railLead:[v],railTrail:h,resolveLeftView:(p,m)=>xe(p,n,m),openSettings:P,openStyles:()=>{T(ve),a("styles")}}}function rt(e,t,o,s){const{kind:f,open:c}=e,{selected:l,zoneOf:n}=t,d=Te(t,o);S(()=>{Ne(l?.type==="BookingBox"&&l.props.region==="confirm"?Be(n(String(l.props.id))):null)},[l?.props.id]);const a=he(e,t),{capabilities:{hasSiteSettings:u}}=g(),{setSelected:T,setSelectHandler:E}=se(),{chat:b,setChat:P,setSelected:v,setSelectHandler:h}=oe(),p=f==="header";S(()=>{T(p)},[p,T]),S(()=>{E(()=>c(B))},[E,c]);const m=I(()=>c(pe),[c]),L=f==="chat";S(()=>{v(L)},[L,v]),S(()=>{h(m)},[h,m]);const{setOpenHandler:y}=ne(),O=I(()=>c(me),[c]);S(()=>{y(O)},[y,O]);const V=D(e),M=et(),F=ot(e,s),Y=o.device;return{...d,...V,...M,...F,treeFoot:()=>r("div",{className:"sf-tree-tool",children:r($,{})}),hasOwnRows:w=>w.type===Ee,ownRows:a.renderLocationTree,sectionPressed:a.sectionPressed,wrap:w=>r(ee.Provider,{value:!0,children:r(ie.Provider,{value:Y,children:w})}),addPanelRow:w=>u?k("div",{className:"sf-addside-sitewide",children:[r("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:r(C,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{w(),m()},children:[i("Live chat"),r("span",{className:"sf-addside-sitewide-desc",children:i("A chat bubble on every page")})]}),r(Z,{checked:b.enabled,onChange:G=>P({enabled:G}),ariaLabel:i("Show the chat bubble on the whole site")})]}):void 0}}let W=null,_=new WeakMap;function it(e){const t=je();if(!e||!t)return e;W!==t&&(W=t,_=new WeakMap);let o=_.get(e);return o||(o={...e,choices:e.choices?e.choices.map(s=>({...s,label:i(s.label)})):null,spec:e.spec?{...e.spec,addLabel:i(e.spec.addLabel)}:null},_.set(e,o)),o}const st={isLockedBlock:Me,duplicateBlocked:Ce,nestDepth:(e,t,o)=>t===Ie?ge(e,o):0,newSectionNode:Qe,canAddTo:(e,t)=>it(Oe(e,t)),blockIsOffered:Ae},nt=new Proxy(ze,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?i(o):o}}),at={labelAtLevel:(e,t,o)=>i(Ge(e,t,o)),descriptions:nt,categoryLabel:e=>{const t=Le(e);return t===void 0?void 0:i(t)},firstSection:ye,blockRowName:Re,plainText:_e,Icon:C,Thumbnail:fe,useProducts:$e},ct={desktop:2e3,tablet:800,mobile:390},x="desktop",lt={options:re,initial:x,fluid:x,widths:ct},dt={read:We,write:e=>Ve(e),forSelection:(e,t)=>De(e,t)},pt={first:R,last:He,firstGroup:qe,lastGroup:Ze,isSectionGroup:Ke,sectionGroupZone:Ue,panelOf:e=>e===R?B:null};function mt(e){return{...D(e),openSettings:()=>e.show(N)}}const ao={useOwnerName:ke,useBridges:rt,useStandaloneBridges:mt,useDocumentPass:we,blockRules:st,blockLook:at,devices:lt,leftView:dt,pinned:pt,Canvas:Ye,Inspector:de};export{ao as WEBSITE_SCREEN};
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as y,Fragment as w}from"react/jsx-runtime";import{useEasel as P}from"efficient-easel/easel";import{useEffect as G,useRef as N,useState as x}from"react";import k from"./ThemeField.js";import B from"./CornersField.js";import W from"./CardShadowField.js";import v from"./ShadowColourField.js";import A from"./BlockGapField.js";import O from"./HoverEffectField.js";import j from"./HeroImageField.js";import Y from"./PhotographyField.js";import U from"./SideSpaceField.js";import X from"./SiteWidthField.js";import M from"./TextStylesField.js";import{usePreviewHeader as f}from"./PreviewHeaderContext.js";import{SettingsTabs as $}from"efficient-easel/panel";import{Tooltip as q,tabButtonId as J,tabPanelId as Z}from"efficient-shell/ui";import{ContrastIcon as K,NoteIcon as Q,SettingsIcon as V,TypeIcon as D}from"efficient-easel/icons";import{useThemeRowPersist as ee}from"../lib/theme-row-persist.js";import{themeSaveNotice as oe}from"../lib/theme-save-message.js";import{NEUTRAL_SITE_NAME as te}from"../lib/content/site-name.js";import{normalizeFonts as ne}from"../lib/fonts.js";import{previewFrame as re}from"../lib/puck/preview-dom.js";import{CORNER_STYLE_TO_PX as se,normalizeCornerRadius as ie,normalizeCornerStyle as ae,normalizeShadowColor as ce,headingTypographyToRow as le,normalizeHeadingCompression as de,normalizeHeadingTypography as pe,DEFAULT_SIZES as he}from"../lib/theme.js";const E="sf-site-styles",ue="sf-site-styles-tabpanel",ge=!1,fe="Show hints";function me({shown:e,onChange:o}){return n("div",{className:"sf-hints",children:y("button",{type:"button","aria-pressed":e,onClick:()=>o(!e),className:`sf-rung sf-hints-toggle${e?" is-active":""}`,children:[n(Q,{size:13}),fe]})})}const fo="text",b=[{id:"basics",label:"Basics",icon:n(V,{})},{id:"theme",label:"Theme",icon:n(K,{})},{id:"text",label:"Text",icon:n(D,{})}];function Se({themeFromDocument:e,persist:o}){const{appState:s,dispatch:r}=P(u=>u),{theme:a,setTheme:t}=f(),c=s.data,h=c.root?.props??{},i=u=>{if(e){const g={...h,theme:u};r({type:"replaceRoot",root:{...c.root,props:g},recordHistory:!0})}else t(u);o({selected_preset:u.selected,theme_presets:u.themes})};return n(k,{value:e?h.theme:a,onChange:i})}function Ce(e,o){const[s,r]=x(null),a=N(null),t=JSON.stringify(e),c=N(o);return c.current=o,G(()=>{if(a.current===null){a.current=t;return}if(a.current===t)return;a.current=t;const h=window.setTimeout(()=>r(c.current),700),i=window.setTimeout(()=>r(null),2200);return()=>{window.clearTimeout(h),window.clearTimeout(i)}},[t]),s}function ye({themeFromDocument:e,persist:o}){const{appState:s,dispatch:r}=P(d=>d),[a,t]=x(null),{fonts:c,setFonts:h,sizes:i,setSizes:u,headingCompression:g,setHeadingCompression:_,headingTypography:C,setHeadingTypography:l}=f(),T=s.data,m=T.root?.props??{},S=e?ne(m.fonts):c,F=e?he:i,z=e?de(m.headingCompression):g,I=e?pe(m.headingTypography):C,R=d=>r({type:"replaceRoot",root:{...T.root,props:{...m,...d}},recordHistory:!0}),L=Ce({curFonts:S,curCompression:z,curTypography:I},a);return n(M,{fonts:S,sizes:F,compression:z,headingTypography:I,openRole:a,onOpenRole:t,onFontChange:(d,H)=>{const p={...S,[d]:H};e?R({fonts:p}):h(p),o({heading_font:p.heading,body_font:p.body,accent_font:p.accent,label_font:p.label})},onSizeChange:e?void 0:(d,H)=>{const p={...F,[d]:H};u(p),o({heading_size_large_px:p.headingLarge,heading_size_medium_px:p.headingMedium,heading_size_small_px:p.headingSmall,accent_size_px:p.accent,body_size_px:p.body,label_size_px:p.label})},onCompressionChange:d=>{e?R({headingCompression:d}):_(d),o({heading_compression:d})},onHeadingTypographyChange:d=>{e?R({headingTypography:d}):l(d),o(le(d))},livePx:we,savedRole:L})}const _e={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 we(e){if(typeof document>"u")return null;const s=(re()?.contentDocument??document).querySelector(_e[e]);if(!s)return null;const r=parseFloat(getComputedStyle(s).fontSize);return Number.isFinite(r)?r:null}function Te({themeFromDocument:e,persist:o,showHint:s}){const{appState:r,dispatch:a}=P(l=>l),{cornerRadiusPx:t,setCornerRadiusPx:c}=f(),h=r.data,i=h.root?.props??{},u=i.cornerRadiusPx===void 0?se[ae(i.cornerStyle)]:ie(i.cornerRadiusPx),g=e?u:t,_=l=>a({type:"replaceRoot",root:{...h.root,props:{...i,...l}},recordHistory:!0});return n(B,{value:g,onChange:l=>{e?_({cornerRadiusPx:l}):c(l),o({corner_radius_px:l})},showHint:s})}function xe(e){return{site_width:e}}function be({persist:e,showHint:o}){const{siteWidth:s,setSiteWidth:r}=f();return n(X,{value:s,onChange:t=>{r(t),e(xe(t),t===null)},showHint:o})}function Re(e){return{block_gap:e}}function He(e){return{site_gutter:e}}function Pe({persist:e,showHint:o}){const{siteGutter:s,setSiteGutter:r}=f();return n(U,{value:s,onChange:t=>{r(t),e(He(t),t===null)},showHint:o})}function Ee({persist:e,showHint:o}){const{blockGap:s,setBlockGap:r}=f();return n(A,{value:s,onChange:t=>{r(t),e(Re(t),t===null)},showHint:o})}function Fe({persist:e,showHint:o}){const{heroBackgroundFollowsWidth:s,setHeroBackgroundFollowsWidth:r}=f();return n(j,{value:s,onChange:t=>{r(t),e({hero_background_follows_width:t},!0)},showHint:o})}function ze({persist:e,showHint:o=!0}){return y(w,{children:[n(be,{persist:e,showHint:o}),n(Pe,{persist:e,showHint:o}),n(Ee,{persist:e,showHint:o}),n(Fe,{persist:e,showHint:o})]})}function Ie(e){return{card_shadow:e}}function Ne(e){return e===null?{shadow_color:null}:{shadow_color:ce(e)}}function Le(e){return{hover_effect:e}}function Ge({persist:e,showHint:o=!0}){const{cardShadow:s,setCardShadow:r,shadowColor:a,setShadowColor:t,hoverEffect:c,setHoverEffect:h}=f();return y(w,{children:[n(W,{value:s,onChange:i=>{r(i),e(Ie(i),!0)},showHint:o}),n(v,{value:a,onChange:i=>{t(i),e(Ne(i),i===null)},showHint:o}),n(O,{value:c,onChange:i=>{h(i),e(Le(i),!0)},showHint:o})]})}function ke(e){return{photography_grayscale:e}}function Be({persist:e,showHint:o}){const{photographyGrayscale:s,setPhotographyGrayscale:r}=f();return n(Y,{value:s,onChange:t=>{r(t),e(ke(t),!0)},showHint:o})}function We({persist:e,showHint:o=!0}){return n(w,{children:n(Be,{persist:e,showHint:o})})}function ve(){const{websiteName:e}=f();return e?.trim()||te}function mo(){const e=ve();return n(q,{content:`${e} — renamed in the Console: Storefront ▸ Sites ▸ Settings.`,className:"sf-name-tip",children:n("span",{className:"sf-panel-site",children:e})})}function Ae({themeFromDocument:e=!1,tokenRef:o,siteId:s,onNotify:r,tab:a,onTabChange:t}){const{persist:c}=ee({themeFromDocument:e,tokenRef:o,siteId:s,onResult:m=>{const S=oe(m);S&&r?.(S.msg,S.tone)}}),[h,i]=x(b[0].id),u=a!==void 0,g=u?a:h,_=u?t??(()=>{}):i,C=b.find(m=>m.id===g)??b[0],[l,T]=x(ge);return y(w,{children:[n($,{items:b,activeId:C.id,onSelect:_,ariaLabel:"Site styles",idPrefix:E}),y("div",{id:Z(E,C.id),className:ue,role:"tabpanel","aria-labelledby":J(E,C.id),children:[g==="basics"&&y(w,{children:[n(Te,{themeFromDocument:e,persist:c,showHint:l}),!e&&n(Ge,{persist:c,showHint:l}),!e&&n(ze,{persist:c,showHint:l}),!e&&n(We,{persist:c,showHint:l}),n(me,{shown:l,onChange:T})]}),g==="theme"&&n(Se,{themeFromDocument:e,persist:c}),g==="text"&&n(ye,{themeFromDocument:e,persist:c})]})]})}export{Ge as CardLookFields,me as HintsToggle,ze as PageGroupFields,We as PhotographyGroupFields,ge as SHOW_HINTS_DEFAULT,E as SITE_STYLES_ID_PREFIX,b as SITE_STYLES_TABS,fo as SITE_STYLES_TEXT_TAB,ue as TABPANEL_CLASS,mo as WebsiteNameReadonly,Re as blockGapPatch,Ie as cardShadowPatch,Ae as default,Le as hoverEffectPatch,ke as photographyPatch,Ne as shadowColourPatch,He as siteGutterPatch,xe as siteWidthPatch,ve as useWebsiteName};
1
+ "use client";import{jsx as n,jsxs as y,Fragment as w}from"react/jsx-runtime";import{useEasel as E}from"efficient-easel/easel";import{useEffect as k,useRef as L,useState as b}from"react";import B from"./ThemeField.js";import W from"./CornersField.js";import v from"./CardShadowField.js";import A from"./ShadowColourField.js";import O from"./BlockGapField.js";import j from"./HoverEffectField.js";import Y from"./HeroImageField.js";import U from"./PhotographyField.js";import X from"./SideSpaceField.js";import M from"./SiteWidthField.js";import q from"./TextStylesField.js";import{usePreviewHeader as m}from"./PreviewHeaderContext.js";import{SettingsTabs as J}from"efficient-easel/panel";import{Tooltip as Z,tabButtonId as $,tabPanelId as K}from"efficient-shell/ui";import{ContrastIcon as Q,NoteIcon as V,SettingsIcon as D,TypeIcon as ee}from"efficient-easel/icons";import{useThemeRowPersist as oe}from"../lib/theme-row-persist.js";import{themeSaveNotice as te}from"../lib/theme-save-message.js";import{say as T}from"../lib/editor-words.js";import{NEUTRAL_SITE_NAME as ne}from"../lib/content/site-name.js";import{normalizeFonts as re}from"../lib/fonts.js";import{previewFrame as se}from"../lib/puck/preview-dom.js";import{CORNER_STYLE_TO_PX as ie,normalizeCornerRadius as ae,normalizeCornerStyle as ce,normalizeShadowColor as le,headingTypographyToRow as pe,normalizeHeadingCompression as de,normalizeHeadingTypography as he,DEFAULT_SIZES as ue}from"../lib/theme.js";const F="sf-site-styles",ge="sf-site-styles-tabpanel",fe=!1,me="Show hints";function Se({shown:e,onChange:o}){return n("div",{className:"sf-hints",children:y("button",{type:"button","aria-pressed":e,onClick:()=>o(!e),className:`sf-rung sf-hints-toggle${e?" is-active":""}`,children:[n(V,{size:13}),T(me)]})})}const So="text",R=[{id:"basics",label:"Basics",icon:n(D,{})},{id:"theme",label:"Theme",icon:n(Q,{})},{id:"text",label:"Text",icon:n(ee,{})}];function Ce({themeFromDocument:e,persist:o}){const{appState:s,dispatch:r}=E(u=>u),{theme:a,setTheme:t}=m(),c=s.data,h=c.root?.props??{},i=u=>{if(e){const f={...h,theme:u};r({type:"replaceRoot",root:{...c.root,props:f},recordHistory:!0})}else t(u);o({selected_preset:u.selected,theme_presets:u.themes})};return n(B,{value:e?h.theme:a,onChange:i})}function ye(e,o){const[s,r]=b(null),a=L(null),t=JSON.stringify(e),c=L(o);return c.current=o,k(()=>{if(a.current===null){a.current=t;return}if(a.current===t)return;a.current=t;const h=window.setTimeout(()=>r(c.current),700),i=window.setTimeout(()=>r(null),2200);return()=>{window.clearTimeout(h),window.clearTimeout(i)}},[t]),s}function _e({themeFromDocument:e,persist:o}){const{appState:s,dispatch:r}=E(p=>p),[a,t]=b(null),{fonts:c,setFonts:h,sizes:i,setSizes:u,headingCompression:f,setHeadingCompression:_,headingTypography:C,setHeadingTypography:l}=m(),x=s.data,g=x.root?.props??{},S=e?re(g.fonts):c,z=e?ue:i,I=e?de(g.headingCompression):f,N=e?he(g.headingTypography):C,H=p=>r({type:"replaceRoot",root:{...x.root,props:{...g,...p}},recordHistory:!0}),G=ye({curFonts:S,curCompression:I,curTypography:N},a);return n(q,{fonts:S,sizes:z,compression:I,headingTypography:N,openRole:a,onOpenRole:t,onFontChange:(p,P)=>{const d={...S,[p]:P};e?H({fonts:d}):h(d),o({heading_font:d.heading,body_font:d.body,accent_font:d.accent,label_font:d.label})},onSizeChange:e?void 0:(p,P)=>{const d={...z,[p]:P};u(d),o({heading_size_large_px:d.headingLarge,heading_size_medium_px:d.headingMedium,heading_size_small_px:d.headingSmall,accent_size_px:d.accent,body_size_px:d.body,label_size_px:d.label})},onCompressionChange:p=>{e?H({headingCompression:p}):_(p),o({heading_compression:p})},onHeadingTypographyChange:p=>{e?H({headingTypography:p}):l(p),o(pe(p))},livePx:Te,savedRole:G})}const we={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 Te(e){if(typeof document>"u")return null;const s=(se()?.contentDocument??document).querySelector(we[e]);if(!s)return null;const r=parseFloat(getComputedStyle(s).fontSize);return Number.isFinite(r)?r:null}function xe({themeFromDocument:e,persist:o,showHint:s}){const{appState:r,dispatch:a}=E(l=>l),{cornerRadiusPx:t,setCornerRadiusPx:c}=m(),h=r.data,i=h.root?.props??{},u=i.cornerRadiusPx===void 0?ie[ce(i.cornerStyle)]:ae(i.cornerRadiusPx),f=e?u:t,_=l=>a({type:"replaceRoot",root:{...h.root,props:{...i,...l}},recordHistory:!0});return n(W,{value:f,onChange:l=>{e?_({cornerRadiusPx:l}):c(l),o({corner_radius_px:l})},showHint:s})}function be(e){return{site_width:e}}function Re({persist:e,showHint:o}){const{siteWidth:s,setSiteWidth:r}=m();return n(M,{value:s,onChange:t=>{r(t),e(be(t),t===null)},showHint:o})}function He(e){return{block_gap:e}}function Pe(e){return{site_gutter:e}}function Ee({persist:e,showHint:o}){const{siteGutter:s,setSiteGutter:r}=m();return n(X,{value:s,onChange:t=>{r(t),e(Pe(t),t===null)},showHint:o})}function Fe({persist:e,showHint:o}){const{blockGap:s,setBlockGap:r}=m();return n(O,{value:s,onChange:t=>{r(t),e(He(t),t===null)},showHint:o})}function ze({persist:e,showHint:o}){const{heroBackgroundFollowsWidth:s,setHeroBackgroundFollowsWidth:r}=m();return n(Y,{value:s,onChange:t=>{r(t),e({hero_background_follows_width:t},!0)},showHint:o})}function Ie({persist:e,showHint:o=!0}){return y(w,{children:[n(Re,{persist:e,showHint:o}),n(Ee,{persist:e,showHint:o}),n(Fe,{persist:e,showHint:o}),n(ze,{persist:e,showHint:o})]})}function Ne(e){return{card_shadow:e}}function Le(e){return e===null?{shadow_color:null}:{shadow_color:le(e)}}function Ge(e){return{hover_effect:e}}function ke({persist:e,showHint:o=!0}){const{cardShadow:s,setCardShadow:r,shadowColor:a,setShadowColor:t,hoverEffect:c,setHoverEffect:h}=m();return y(w,{children:[n(v,{value:s,onChange:i=>{r(i),e(Ne(i),!0)},showHint:o}),n(A,{value:a,onChange:i=>{t(i),e(Le(i),i===null)},showHint:o}),n(j,{value:c,onChange:i=>{h(i),e(Ge(i),!0)},showHint:o})]})}function Be(e){return{photography_grayscale:e}}function We({persist:e,showHint:o}){const{photographyGrayscale:s,setPhotographyGrayscale:r}=m();return n(U,{value:s,onChange:t=>{r(t),e(Be(t),!0)},showHint:o})}function ve({persist:e,showHint:o=!0}){return n(w,{children:n(We,{persist:e,showHint:o})})}function Ae(){const{websiteName:e}=m();return e?.trim()||ne}function Co(){const e=Ae();return n(Z,{content:T("{name} — renamed in the Console: {place}.",{name:e,place:T("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:n("span",{className:"sf-panel-site",children:e})})}function Oe({themeFromDocument:e=!1,tokenRef:o,siteId:s,onNotify:r,tab:a,onTabChange:t}){const{persist:c}=oe({themeFromDocument:e,tokenRef:o,siteId:s,onResult:g=>{const S=te(g);S&&r?.(S.msg,S.tone)}}),[h,i]=b(R[0].id),u=a!==void 0,f=u?a:h,_=u?t??(()=>{}):i,C=R.find(g=>g.id===f)??R[0],[l,x]=b(fe);return y(w,{children:[n(J,{items:R.map(g=>({...g,label:T(g.label)})),activeId:C.id,onSelect:_,ariaLabel:T("Site styles"),idPrefix:F}),y("div",{id:K(F,C.id),className:ge,role:"tabpanel","aria-labelledby":$(F,C.id),children:[f==="basics"&&y(w,{children:[n(xe,{themeFromDocument:e,persist:c,showHint:l}),!e&&n(ke,{persist:c,showHint:l}),!e&&n(Ie,{persist:c,showHint:l}),!e&&n(ve,{persist:c,showHint:l}),n(Se,{shown:l,onChange:x})]}),f==="theme"&&n(Ce,{themeFromDocument:e,persist:c}),f==="text"&&n(_e,{themeFromDocument:e,persist:c})]})]})}export{ke as CardLookFields,Se as HintsToggle,Ie as PageGroupFields,ve as PhotographyGroupFields,fe as SHOW_HINTS_DEFAULT,F as SITE_STYLES_ID_PREFIX,R as SITE_STYLES_TABS,So as SITE_STYLES_TEXT_TAB,ge as TABPANEL_CLASS,Co as WebsiteNameReadonly,He as blockGapPatch,Ne as cardShadowPatch,Oe as default,Ge as hoverEffectPatch,Be as photographyPatch,Le as shadowColourPatch,Pe as siteGutterPatch,be as siteWidthPatch,Ae as useWebsiteName};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as c,SettingsField as u,SettingsSegmented as m}from"efficient-easel/panel";import{WidthIcon as h}from"efficient-easel/icons";import{WIDTH_CHOICE_LABEL as l}from"../lib/content/section-width.js";function g({value:i,resolved:d,onChange:o,label:n="Width",labelId:a,followsLabel:s,hint:f}){const e=i===void 0,r=e?d:i;return t(u,{label:n,labelId:a,icon:t(h,{}),value:e?s:void 0,changed:!e,action:t(c,{label:n,changed:!e,onReset:()=>o(void 0)}),hint:f,children:t(m,{options:[{label:l.page,id:"content"},{label:l.full,id:"full"}],value:r,ariaLabel:n,onChange:o})})}export{g as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as u,SettingsField as p,SettingsSegmented as h}from"efficient-easel/panel";import{WidthIcon as g}from"efficient-easel/icons";import{say as o,editorEaselWords as b}from"../lib/editor-words.js";import{WIDTH_CHOICE_LABEL as d}from"../lib/content/section-width.js";function W({value:l,resolved:a,onChange:i,label:s="Width",labelId:r,followsLabel:f,hint:c}){const e=l===void 0,m=e?a:l,n=o(s);return t(p,{label:n,labelId:r,icon:t(g,{}),value:e?f:void 0,changed:!e,action:t(u,{words:b()?.panel,label:n,changed:!e,onReset:()=>i(void 0)}),hint:c,children:t(h,{options:[{label:o(d.page),id:"content"},{label:o(d.full),id:"full"}],value:m,ariaLabel:n,onChange:i})})}export{W as default};
@@ -1 +1 @@
1
- "use client";import{jsx as E}from"react/jsx-runtime";import{DesktopIcon as I,PhoneIcon as t,TabletIcon as e}from"efficient-easel/icons";import{VIEW_TIERS as m,VIEW_TIER_LABEL as n}from"../lib/content/view-tiers.js";const s={desktop:E(I,{}),tablet:E(e,{}),mobile:E(t,{})},_=m.map(o=>({id:o,label:n[o],icon:s[o]}));export{_ as PREVIEW_DEVICES};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{DesktopIcon as E,PhoneIcon as I,TabletIcon as e}from"efficient-easel/icons";import{say as m}from"../lib/editor-words.js";import{VIEW_TIERS as n,VIEW_TIER_LABEL as r}from"../lib/content/view-tiers.js";const s={desktop:t(E,{}),tablet:t(e,{}),mobile:t(I,{})},l=n.map(o=>({id:o,get label(){return m(r[o])},icon:s[o]}));export{l as PREVIEW_DEVICES};
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{IconBrandFacebook as t,IconBrandFacebookFilled as d,IconBrandInstagram as l,IconBrandInstagramFilled as r,IconBrandLinkedin as s,IconBrandLinkedinFilled as c,IconBrandPinterest as I,IconBrandPinterestFilled as u,IconBrandTiktok as B,IconBrandTiktokFilled as k,IconBrandWhatsapp as p,IconBrandWhatsappFilled as F,IconBrandX as b,IconBrandXFilled as m,IconBrandYoutube as f,IconBrandYoutubeFilled as x}from"@tabler/icons-react";const T="outline",L={instagram:{outline:l,solid:r},facebook:{outline:t,solid:d},tiktok:{outline:B,solid:k},youtube:{outline:f,solid:x},x:{outline:b,solid:m},linkedin:{outline:s,solid:c},pinterest:{outline:I,solid:u},whatsapp:{outline:p,solid:F}};function _({platform:n,iconStyle:o,size:i}){const e=L[n][o];return a(e,{size:i,stroke:1.75,"aria-hidden":"true",focusable:"false"})}export{T as DEFAULT_SOCIAL_ICON_STYLE,_ as SocialMark};
1
+ import{jsx as d}from"react/jsx-runtime";import{IconBrandFacebook as t,IconBrandFacebookFilled as c,IconBrandInstagram as r,IconBrandInstagramFilled as s,IconBrandLine as I,IconBrandLinkedin as u,IconBrandLinkedinFilled as B,IconBrandPinterest as p,IconBrandPinterestFilled as k,IconBrandTelegram as h,IconBrandTiktok as M,IconBrandTiktokFilled as F,IconBrandWechat as f,IconBrandWhatsapp as z,IconBrandWhatsappFilled as m,IconBrandX as S,IconBrandXFilled as b,IconBrandYoutube as j,IconBrandYoutubeFilled as E,createReactComponent as n}from"@tabler/icons-react";const v="outline",L={fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},T={},o={fillRule:"evenodd"},g=[["path",{...L,d:"M21 4L3 11L7 13L9 19L12 15L17 20z"}],["path",{...o,d:"M21 4L3 11L7 13L9 19L12 15L17 20zM15.212 8.939 10.576 13.576 11.424 14.424 16.061 9.788z"}]],A=[["path",{...L,d:["M21 10.663c0 -4.224 -4.041 -7.663 -9 -7.663s-9 3.439 -9 7.663","c0 3.783 3.201 6.958 7.527 7.56c1.053 .239 .932 .644 .696 2.133","c-.039 .238 -.184 .932 .777 .512c.96 -.42 5.18 -3.201 7.073 -5.48","c1.304 -1.504 1.927 -3.029 1.927 -4.715v-.01z"].join("")}],["path",{...T,d:["M21 10.663c0 -4.224 -4.041 -7.663 -9 -7.663s-9 3.439 -9 7.663","c0 3.783 3.201 6.958 7.527 7.56c1.053 .239 .932 .644 .696 2.133","c-.039 .238 -.184 .932 .777 .512c.96 -.42 5.18 -3.201 7.073 -5.48","c1.304 -1.504 1.927 -3.029 1.927 -4.715v-.01z"].join("")}]],W=[["path",{...L,d:["M16.5 10c3.038 0 5.5 2.015 5.5 4.5c0 1.397 -.778 2.645 -2 3.47l0 2.03l-1.964 -1.178","a6.649 6.649 0 0 1 -1.536 .178c-3.038 0 -5.5 -2.015 -5.5 -4.5s2.462 -4.5 5.5 -4.5z"].join("")}],["path",{...L,d:["M8.319 15.972L7.84 15.918L7.349 15.832L6.865 15.715L6.388 15.568L4 17L4 14.199","L3.559 13.775L3.197 13.356L2.877 12.91L2.603 12.439L2.376 11.946L2.201 11.433","L2.079 10.902L2.016 10.405L2.001 9.897L2.036 9.386L2.12 8.889L2.25 8.405L2.425 7.937","L2.642 7.486L2.9 7.055L3.195 6.645L3.459 6.333L3.744 6.037L4.05 5.757L4.377 5.495","L4.723 5.25L5.086 5.025L5.467 4.819L5.864 4.634L6.275 4.471L6.701 4.331L7.139 4.214","L7.589 4.122L8.05 4.055L8.521 4.014L9.352 4.007L9.815 4.04L10.269 4.098L10.713 4.181","L11.146 4.287L11.567 4.416L11.975 4.567L12.369 4.739L12.748 4.932L13.112 5.143","L13.459 5.374L13.788 5.622L14.172 5.956L14.458 6.241L14.722 6.542L14.965 6.856","L15.217 7.237A8.35 7.35 0 0 0 8.319 15.972z"].join("")}],["path",{...o,d:["M8.319 15.972L7.84 15.918L7.349 15.832L6.865 15.715L6.388 15.568L4 17L4 14.199","L3.559 13.775L3.197 13.356L2.877 12.91L2.603 12.439L2.376 11.946L2.201 11.433","L2.079 10.902L2.016 10.405L2.001 9.897L2.036 9.386L2.12 8.889L2.25 8.405L2.425 7.937","L2.642 7.486L2.9 7.055L3.195 6.645L3.459 6.333L3.744 6.037L4.05 5.757L4.377 5.495","L4.723 5.25L5.086 5.025L5.467 4.819L5.864 4.634L6.275 4.471L6.701 4.331L7.139 4.214","L7.589 4.122L8.05 4.055L8.521 4.014L9.352 4.007L9.815 4.04L10.269 4.098L10.713 4.181","L11.146 4.287L11.567 4.416L11.975 4.567L12.369 4.739L12.748 4.932L13.112 5.143","L13.459 5.374L13.788 5.622L14.172 5.956L14.458 6.241L14.722 6.542L14.965 6.856","L15.217 7.237A8.35 7.35 0 0 0 8.319 15.972zM5.25 7.9a0.85 0.85 0 1 0 1.7 0","a0.85 0.85 0 1 0 -1.7 0zM8.25 7.9a0.85 0.85 0 1 0 1.7 0a0.85 0.85 0 1 0 -1.7 0z"].join("")}],["path",{...o,d:["M16.5 10c3.038 0 5.5 2.015 5.5 4.5c0 1.397 -.778 2.645 -2 3.47l0 2.03l-1.964 -1.178","a6.649 6.649 0 0 1 -1.536 .178c-3.038 0 -5.5 -2.015 -5.5 -4.5s2.462 -4.5 5.5 -4.5z","M14.15 14a0.85 0.85 0 1 0 1.7 0a0.85 0.85 0 1 0 -1.7 0zM17.15 14","a0.85 0.85 0 1 0 1.7 0a0.85 0.85 0 1 0 -1.7 0z"].join("")}]],_=n("filled","brand-telegram-filled","BrandTelegramFilled",g),O=n("filled","brand-line-filled","BrandLineFilled",A),x=n("filled","brand-wechat-filled","BrandWechatFilled",W),C={instagram:{outline:r,solid:s},facebook:{outline:t,solid:c},tiktok:{outline:M,solid:F},youtube:{outline:j,solid:E},x:{outline:S,solid:b},linkedin:{outline:u,solid:B},pinterest:{outline:p,solid:k},whatsapp:{outline:z,solid:m},telegram:{outline:h,solid:_},line:{outline:I,solid:O},wechat:{outline:f,solid:x}};function w({platform:e,iconStyle:a,size:l}){const i=C[e][a];return d(i,{size:l,stroke:1.75,"aria-hidden":"true",focusable:"false"})}export{v as DEFAULT_SOCIAL_ICON_STYLE,w as SocialMark};