efficient-web-builder 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +7 -0
  3. package/dist/components/BlogPostSource.js +1 -1
  4. package/dist/components/Breadcrumb.js +1 -1
  5. package/dist/components/Btn.js +1 -1
  6. package/dist/components/CardShadowField.js +1 -1
  7. package/dist/components/CategoryBar.js +1 -1
  8. package/dist/components/ChartSection.js +1 -1
  9. package/dist/components/ChatSettingsPanel.js +1 -1
  10. package/dist/components/ClearColoursDialog.js +1 -1
  11. package/dist/components/ContactLocations.js +5 -5
  12. package/dist/components/CornersField.js +1 -1
  13. package/dist/components/DocBody.js +1 -1
  14. package/dist/components/DuplicateToPageMenu.js +1 -1
  15. package/dist/components/FeaturedCover.js +1 -1
  16. package/dist/components/FieldGlyph.js +1 -1
  17. package/dist/components/Footprint.js +1 -1
  18. package/dist/components/HeadingAudit.js +1 -1
  19. package/dist/components/HeroSection.js +1 -1
  20. package/dist/components/HoverEffectField.js +1 -1
  21. package/dist/components/ImageBlock.js +1 -1
  22. package/dist/components/ImageFocusRow.js +1 -1
  23. package/dist/components/LocationsGroupedField.js +1 -1
  24. package/dist/components/LongRead.js +1 -1
  25. package/dist/components/MediaUploadField.js +1 -1
  26. package/dist/components/MockupSection.js +1 -1
  27. package/dist/components/PagesPanel.js +1 -1
  28. package/dist/components/PartInkControl.js +1 -1
  29. package/dist/components/PartResetDot.js +1 -1
  30. package/dist/components/PartSettingsPanel.js +1 -1
  31. package/dist/components/PostCard.js +1 -1
  32. package/dist/components/ProcessSteps.js +1 -1
  33. package/dist/components/RMark.js +1 -1
  34. package/dist/components/Reel.js +1 -1
  35. package/dist/components/SectionEditor.js +1 -1
  36. package/dist/components/SectionHeader.js +1 -1
  37. package/dist/components/SectionThumbnail.js +1 -1
  38. package/dist/components/SlotChildRows.js +1 -1
  39. package/dist/components/SourceStatus.js +1 -1
  40. package/dist/components/Split.js +1 -1
  41. package/dist/components/StandaloneSectionEditor.js +1 -1
  42. package/dist/components/StylesPanel.js +1 -1
  43. package/dist/components/SwitchToBoxFooter.js +1 -1
  44. package/dist/components/Testimonials.js +1 -1
  45. package/dist/components/TextStyleRow.js +1 -1
  46. package/dist/components/TextStylesField.js +1 -1
  47. package/dist/components/ThemeCard.js +1 -1
  48. package/dist/components/ThemeColourField.js +1 -1
  49. package/dist/components/ThemeField.js +1 -1
  50. package/dist/components/TickerSettingsPanel.js +1 -1
  51. package/dist/components/Timeline.js +1 -1
  52. package/dist/components/TimelineTrack.js +1 -1
  53. package/dist/components/TitleWithButtons.js +1 -1
  54. package/dist/components/WebsiteScreenParts.js +1 -1
  55. package/dist/components/WebsiteSettingsPanel.d.ts +5 -9
  56. package/dist/components/WebsiteSettingsPanel.js +1 -1
  57. package/dist/components/goldPhrases.js +1 -1
  58. package/dist/components/storefront-editor.css +262 -542
  59. package/dist/lib/content/contact.js +3 -3
  60. package/dist/lib/content/subscribe.js +1 -1
  61. package/dist/lib/puck/ColourControl.d.ts +5 -0
  62. package/dist/lib/puck/ColourControl.js +1 -1
  63. package/dist/lib/puck/MarkupToolbar.js +1 -1
  64. package/dist/lib/puck/blocks/general/CategoryBar/fields.js +1 -1
  65. package/dist/lib/puck/blocks/general/Chart/fields.js +1 -1
  66. package/dist/lib/puck/blocks/general/FAQ/render.js +1 -1
  67. package/dist/lib/puck/blocks/general/FeaturedCover/render.js +1 -1
  68. package/dist/lib/puck/blocks/general/Footprint/fields.js +1 -1
  69. package/dist/lib/puck/blocks/general/IntroBleed/render.js +1 -1
  70. package/dist/lib/puck/blocks/general/LogoBlock/fields.js +1 -1
  71. package/dist/lib/puck/blocks/general/LongRead/render.js +1 -1
  72. package/dist/lib/puck/blocks/general/Masthead/render.js +1 -1
  73. package/dist/lib/puck/blocks/general/Mockup/fields.js +1 -1
  74. package/dist/lib/puck/blocks/general/OrderSummary/render.js +1 -1
  75. package/dist/lib/puck/blocks/general/ParagraphsA/render.js +1 -1
  76. package/dist/lib/puck/blocks/general/PostCard/render.js +1 -1
  77. package/dist/lib/puck/blocks/general/ProcessSteps/render.js +1 -1
  78. package/dist/lib/puck/blocks/general/Series/render.js +1 -1
  79. package/dist/lib/puck/blocks/general/Split/render.js +1 -1
  80. package/dist/lib/puck/blocks/general/Testimonials/fields.js +1 -1
  81. package/dist/lib/puck/blocks/general/Testimonials/render.js +1 -1
  82. package/dist/lib/puck/blocks/general/TimelineTrack/render.js +1 -1
  83. package/dist/lib/puck/blocks/placeholders.js +1 -1
  84. package/dist/lib/puck/controls.d.ts +0 -10
  85. package/dist/lib/puck/controls.js +1 -1
  86. package/dist/lib/puck/field-groups.js +1 -1
  87. package/dist/lib/puck/footer-block-row-name.js +1 -1
  88. package/dist/lib/puck/geocode-resolve.js +1 -1
  89. package/dist/lib/puck/locations-tree.js +2 -2
  90. package/dist/lib/puck/neutralization-contracts.js +1 -1
  91. package/dist/lib/puck/part-rows.js +1 -1
  92. package/dist/lib/puck/section-catalog.js +1 -1
  93. package/dist/lib/puck/section-descriptions.js +1 -1
  94. package/dist/lib/sections/divider-style.js +1 -1
  95. package/dist/lib/sections/product-card-style.js +1 -1
  96. package/dist/lib/sections/ticker-style.js +1 -1
  97. package/dist/lib/source-rules/accent-token-name.js +2 -2
  98. package/dist/lib/source-rules/button-corners.js +1 -1
  99. package/dist/lib/source-rules/editor-chrome-note.js +2 -2
  100. package/dist/lib/source-rules/editor-context-menu.js +2 -2
  101. package/dist/lib/source-rules/editor-puck-drag-off.js +2 -2
  102. package/dist/lib/source-rules/efficient-easel-version.js +1 -1
  103. package/dist/lib/source-rules/every-button-follows-the-button-colour.js +4 -4
  104. package/dist/lib/source-rules/flat-theme-palette.js +2 -2
  105. package/dist/lib/source-rules/full-width-means-full.js +1 -1
  106. package/dist/lib/source-rules/heading-ceiling-sweep.js +3 -3
  107. package/dist/lib/source-rules/label-hints.js +4 -4
  108. package/dist/lib/source-rules/label-vocabulary.js +5 -5
  109. package/dist/lib/source-rules/mirrored-rows-agree.js +4 -4
  110. package/dist/lib/source-rules/no-comment-in-jsx.js +2 -2
  111. package/dist/lib/source-rules/no-glyph-rows.js +2 -2
  112. package/dist/lib/source-rules/one-colour-control.js +2 -2
  113. package/dist/lib/source-rules/one-dropdown.js +2 -2
  114. package/dist/lib/source-rules/one-editable-list.js +3 -3
  115. package/dist/lib/source-rules/one-editor-list.js +1 -1
  116. package/dist/lib/source-rules/one-right-click.js +2 -2
  117. package/dist/lib/source-rules/one-switch.js +1 -1
  118. package/dist/lib/source-rules/one-up-level-link.js +7 -7
  119. package/dist/lib/source-rules/panel-colour-tokens.js +7 -7
  120. package/dist/lib/source-rules/panel-no-divider-lines.js +5 -5
  121. package/dist/lib/source-rules/panel-one-arrow.js +1 -1
  122. package/dist/lib/source-rules/panel-one-hover.js +2 -2
  123. package/dist/lib/source-rules/panel-rows-use-the-shared-row.js +5 -5
  124. package/dist/lib/source-rules/part-slider-fills-row.js +8 -8
  125. package/dist/lib/source-rules/part-style-naming.js +1 -1
  126. package/dist/lib/source-rules/puck-document-surfaces.js +6 -6
  127. package/dist/lib/source-rules/reduced-motion.js +2 -2
  128. package/dist/lib/source-rules/route-content-width.js +2 -2
  129. package/dist/lib/source-rules/rule.js +1 -1
  130. package/dist/lib/source-rules/section-theme-preview.js +2 -2
  131. package/dist/lib/source-rules/site-square-by-default.js +1 -1
  132. package/dist/lib/source-rules/site-width.js +2 -2
  133. package/dist/lib/source-rules/size-token-paints.js +2 -2
  134. package/dist/lib/source-rules/social-icons-import.js +1 -1
  135. package/dist/lib/source-rules/source-status-is-shared.js +1 -1
  136. package/dist/lib/source-rules/style-face-matches-size.js +3 -3
  137. package/dist/lib/source-rules/support/label-extraction.js +5 -5
  138. package/dist/lib/source-rules/support/part-slider-call-sites.js +4 -4
  139. package/dist/lib/source-rules/support/registry-source.js +1 -1
  140. package/dist/lib/source-rules/theme-mode-controls-gone.js +3 -3
  141. package/dist/lib/source-rules/upload-intake-guard.js +2 -2
  142. package/dist/lib/source-rules/word-styles.js +2 -2
  143. package/package.json +7 -7
  144. package/dist/lib/puck/slider-typing.d.ts +0 -9
  145. package/dist/lib/puck/slider-typing.js +0 -1
@@ -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\u2019s 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 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 +1 @@
1
- import{jsx as e,Fragment as v,jsxs as n}from"react/jsx-runtime";import{SiteLink as T}from"../lib/site-runtime.js";import{stripMarkup as C}from"../lib/markup.js";import F from"./Placeholder.js";import H from"./SectionEyebrow.js";import{renderGold as s,renderHeadline as N,splitParagraphs as L}from"./goldPhrases.js";function w({eyebrow:t,title:a,intro:i,center:r=!1}){return n(v,{children:[t&&e(H,{text:t,size:12}),a&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5vw,76px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.94] tracking-[-0.03em] text-fg",children:N(a)}),i&&e("p",{className:["font-display text-[length:var(--size-body,14px)] leading-[1.6] text-fg-dim",r?"max-w-[520px]":"max-w-[360px]"].join(" "),children:s(i,!0)})]})}function z({cta:t,className:a=""}){return t?.text?n(T,{href:t.href,className:["group inline-flex items-center gap-3.5 border border-line px-5 py-4","font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.3em] text-fg","transition-colors hover:border-accent hover:text-accent",a].join(" "),children:[s(t.text),e("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"\u2192"})]}):null}function y({src:t,caption:a,meta:i,aspectClass:r,editing:p,sizes:m="100vw",className:c=""}){return!t&&!p?null:n("figure",{className:["relative overflow-hidden border border-line bg-surface",r,c].join(" "),children:[e(F,{label:a||"Image",src:t,alt:C(a??""),sizes:m}),e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg, transparent 55%, rgba(10,10,10,0.75) 100%)"}}),(a||i)&&n("figcaption",{className:"absolute inset-x-0 bottom-0 z-[1] flex items-center justify-between gap-3 px-4 py-3 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-overlay-fg/85",children:[e("span",{children:a?s(a):""}),i&&e("span",{className:"text-accent",children:s(i)})]})]})}function d({entry:t}){const a=L(t.body??"");return n(v,{children:[t.title&&e("h3",{className:"mb-3.5 font-heading3 text-[length:var(--size-headingSmall,24px)] font-medium uppercase tracking-[-0.02em] text-fg max-[800px]:text-[length:var(--size-headingSmall,20px)]",children:N(t.title)}),a.length>0&&e("div",{className:"space-y-3.5 font-display text-[length:var(--size-body,17px)] leading-[1.6] max-[800px]:text-[length:var(--size-body,16px)]",children:a.map((i,r)=>e("p",{className:r===0?"text-fg":"text-fg-dim",children:s(i,!0)},r))})]})}const k={boxShadow:"0 0 0 4px var(--bg)"};function E({layout:t="split",eyebrow:a,title:i,intro:r,imageSrc:p,imageCaption:m,imageMeta:c,cta:g,entries:j,padTop:f,padBottom:h,editing:u}={}){const _=typeof f=="number"?f:120,S=typeof h=="number"?h:120,o=(j??[]).filter(l=>(l.date??"").trim()||(l.title??"").trim()||(l.body??"").trim());return e("section",{className:"relative z-[2] bg-bg",children:e("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]",style:{paddingTop:_,paddingBottom:S},children:t==="split"?n("div",{className:"grid grid-cols-[1fr_1.4fr] gap-20 max-[1100px]:grid-cols-1 max-[1100px]:gap-12",children:[n("aside",{className:"sticky top-[120px] flex flex-col gap-6 self-start max-[1100px]:static",children:[e(w,{eyebrow:a,title:i,intro:r}),e(y,{src:p,caption:m,meta:c,aspectClass:"mt-1 aspect-[4/5]",sizes:"(max-width: 1100px) 100vw, 420px",editing:u}),e(z,{cta:g,className:"mt-2 self-start"})]}),e("ol",{className:"flex flex-col gap-12",children:o.map((l,x)=>n("li",{className:"grid grid-cols-[80px_1fr] items-start gap-6 max-[700px]:grid-cols-1 max-[700px]:gap-2",children:[e("span",{className:"pt-1.5 font-mono text-[length:var(--size-label,13px)] tracking-[0.24em] text-accent",children:l.date?s(l.date):""}),e("div",{className:"max-w-[640px]",children:e(d,{entry:l})})]},x))})]}):n("div",{children:[n("header",{className:"mx-auto flex max-w-[760px] flex-col items-center gap-6 text-center",children:[e(w,{eyebrow:a,title:i,intro:r,center:!0}),e(z,{cta:g})]}),e(y,{src:p,caption:m,meta:c,aspectClass:"mx-auto mt-12 aspect-[16/9] w-full max-w-[900px]",sizes:"(max-width: 900px) 100vw, 900px",editing:u}),t==="spine"?e("ol",{className:"relative mx-auto mt-16 max-w-[760px]",children:o.map((l,x)=>n("li",{className:"relative border-l border-line pb-12 pl-10 last:pb-0 max-[700px]:pl-8",children:[e("span",{className:"absolute left-[-5px] top-1.5 h-2.5 w-2.5 rounded-full bg-accent",style:k}),e("div",{className:"mb-2 font-mono text-[length:var(--size-label,13px)] tracking-[0.24em] text-accent",children:l.date?s(l.date):""}),e("div",{className:"max-w-[640px]",children:e(d,{entry:l})})]},x))}):n("ol",{className:"relative mx-auto mt-16 max-w-[1000px]",children:[e("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-0 h-full w-px bg-line left-[7px] min-[801px]:left-1/2 min-[801px]:-translate-x-1/2"}),o.map((l,x)=>{const b=x%2===0;return n("li",{className:"relative mb-14 pl-8 last:mb-0 min-[801px]:grid min-[801px]:grid-cols-2 min-[801px]:gap-16 min-[801px]:pl-0",children:[e("span",{className:"absolute top-1.5 h-2.5 w-2.5 rounded-full bg-accent left-[2px] min-[801px]:left-1/2 min-[801px]:-translate-x-1/2",style:k}),n("div",{className:b?"min-[801px]:col-start-1 min-[801px]:pr-8 min-[801px]:text-right":"min-[801px]:col-start-2 min-[801px]:pl-8",children:[e("div",{className:"mb-2 font-mono text-[length:var(--size-label,13px)] tracking-[0.24em] text-accent",children:l.date?s(l.date):""}),e("div",{className:["max-w-[520px] max-[800px]:max-w-none",b?"min-[801px]:ml-auto":""].join(" "),children:e(d,{entry:l})})]})]},x)})]})]})})})}export{E as default};
1
+ import{jsx as e,Fragment as v,jsxs as n}from"react/jsx-runtime";import{SiteLink as T}from"../lib/site-runtime.js";import{stripMarkup as C}from"../lib/markup.js";import F from"./Placeholder.js";import H from"./SectionEyebrow.js";import{renderGold as s,renderHeadline as N,splitParagraphs as L}from"./goldPhrases.js";function w({eyebrow:t,title:a,intro:i,center:r=!1}){return n(v,{children:[t&&e(H,{text:t,size:12}),a&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5vw,76px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.94] tracking-[-0.03em] text-fg",children:N(a)}),i&&e("p",{className:["font-display text-[length:var(--size-body,14px)] leading-[1.6] text-fg-dim",r?"max-w-[520px]":"max-w-[360px]"].join(" "),children:s(i,!0)})]})}function z({cta:t,className:a=""}){return t?.text?n(T,{href:t.href,className:["group inline-flex items-center gap-3.5 border border-line px-5 py-4","font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.3em] text-fg","transition-colors hover:border-accent hover:text-accent",a].join(" "),children:[s(t.text),e("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"→"})]}):null}function y({src:t,caption:a,meta:i,aspectClass:r,editing:p,sizes:m="100vw",className:c=""}){return!t&&!p?null:n("figure",{className:["relative overflow-hidden border border-line bg-surface",r,c].join(" "),children:[e(F,{label:a||"Image",src:t,alt:C(a??""),sizes:m}),e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg, transparent 55%, rgba(10,10,10,0.75) 100%)"}}),(a||i)&&n("figcaption",{className:"absolute inset-x-0 bottom-0 z-[1] flex items-center justify-between gap-3 px-4 py-3 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-overlay-fg/85",children:[e("span",{children:a?s(a):""}),i&&e("span",{className:"text-accent",children:s(i)})]})]})}function d({entry:t}){const a=L(t.body??"");return n(v,{children:[t.title&&e("h3",{className:"mb-3.5 font-heading3 text-[length:var(--size-headingSmall,24px)] font-medium uppercase tracking-[-0.02em] text-fg max-[800px]:text-[length:var(--size-headingSmall,20px)]",children:N(t.title)}),a.length>0&&e("div",{className:"space-y-3.5 font-display text-[length:var(--size-body,17px)] leading-[1.6] max-[800px]:text-[length:var(--size-body,16px)]",children:a.map((i,r)=>e("p",{className:r===0?"text-fg":"text-fg-dim",children:s(i,!0)},r))})]})}const k={boxShadow:"0 0 0 4px var(--bg)"};function E({layout:t="split",eyebrow:a,title:i,intro:r,imageSrc:p,imageCaption:m,imageMeta:c,cta:g,entries:j,padTop:f,padBottom:h,editing:u}={}){const _=typeof f=="number"?f:120,S=typeof h=="number"?h:120,o=(j??[]).filter(l=>(l.date??"").trim()||(l.title??"").trim()||(l.body??"").trim());return e("section",{className:"relative z-[2] bg-bg",children:e("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]",style:{paddingTop:_,paddingBottom:S},children:t==="split"?n("div",{className:"grid grid-cols-[1fr_1.4fr] gap-20 max-[1100px]:grid-cols-1 max-[1100px]:gap-12",children:[n("aside",{className:"sticky top-[120px] flex flex-col gap-6 self-start max-[1100px]:static",children:[e(w,{eyebrow:a,title:i,intro:r}),e(y,{src:p,caption:m,meta:c,aspectClass:"mt-1 aspect-[4/5]",sizes:"(max-width: 1100px) 100vw, 420px",editing:u}),e(z,{cta:g,className:"mt-2 self-start"})]}),e("ol",{className:"flex flex-col gap-12",children:o.map((l,x)=>n("li",{className:"grid grid-cols-[80px_1fr] items-start gap-6 max-[700px]:grid-cols-1 max-[700px]:gap-2",children:[e("span",{className:"pt-1.5 font-mono text-[length:var(--size-label,13px)] tracking-[0.24em] text-accent",children:l.date?s(l.date):""}),e("div",{className:"max-w-[640px]",children:e(d,{entry:l})})]},x))})]}):n("div",{children:[n("header",{className:"mx-auto flex max-w-[760px] flex-col items-center gap-6 text-center",children:[e(w,{eyebrow:a,title:i,intro:r,center:!0}),e(z,{cta:g})]}),e(y,{src:p,caption:m,meta:c,aspectClass:"mx-auto mt-12 aspect-[16/9] w-full max-w-[900px]",sizes:"(max-width: 900px) 100vw, 900px",editing:u}),t==="spine"?e("ol",{className:"relative mx-auto mt-16 max-w-[760px]",children:o.map((l,x)=>n("li",{className:"relative border-l border-line pb-12 pl-10 last:pb-0 max-[700px]:pl-8",children:[e("span",{className:"absolute left-[-5px] top-1.5 h-2.5 w-2.5 rounded-full bg-accent",style:k}),e("div",{className:"mb-2 font-mono text-[length:var(--size-label,13px)] tracking-[0.24em] text-accent",children:l.date?s(l.date):""}),e("div",{className:"max-w-[640px]",children:e(d,{entry:l})})]},x))}):n("ol",{className:"relative mx-auto mt-16 max-w-[1000px]",children:[e("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-0 h-full w-px bg-line left-[7px] min-[801px]:left-1/2 min-[801px]:-translate-x-1/2"}),o.map((l,x)=>{const b=x%2===0;return n("li",{className:"relative mb-14 pl-8 last:mb-0 min-[801px]:grid min-[801px]:grid-cols-2 min-[801px]:gap-16 min-[801px]:pl-0",children:[e("span",{className:"absolute top-1.5 h-2.5 w-2.5 rounded-full bg-accent left-[2px] min-[801px]:left-1/2 min-[801px]:-translate-x-1/2",style:k}),n("div",{className:b?"min-[801px]:col-start-1 min-[801px]:pr-8 min-[801px]:text-right":"min-[801px]:col-start-2 min-[801px]:pl-8",children:[e("div",{className:"mb-2 font-mono text-[length:var(--size-label,13px)] tracking-[0.24em] text-accent",children:l.date?s(l.date):""}),e("div",{className:["max-w-[520px] max-[800px]:max-w-none",b?"min-[801px]:ml-auto":""].join(" "),children:e(d,{entry:l})})]})]},x)})]})]})})})}export{E as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{SiteLink as w}from"../lib/site-runtime.js";import z from"./EditorialSectionHead.js";import c from"./PartStyledText.js";import{withRMark as l}from"./RMark.js";import{renderGold as f,renderHeadline as S}from"./goldPhrases.js";function B({eyebrow:g,title:o,intro:p,entries:u,cta:n,padTop:x,padBottom:s,background:b,editing:h,omitHead:d=!1}={}){const v=typeof x=="number"?x:120,N=typeof s=="number"?s:120,m=b??"var(--section-bg)",y=m!=="transparent",r=(u??[]).filter(e=>(e.date??"").trim()||(e.title??"").trim()||(e.blurb??"").trim());if(r.length===0&&!h)return null;const j=r.filter(e=>!e.future).length,k=r.length?j/r.length*100:0;return t("section",{className:"relative z-[2]",children:a("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]",style:{paddingTop:v,paddingBottom:N,...y?{backgroundColor:m}:{}},children:[d?null:t(z,{num:g,title:o?S(o):void 0,desc:p?f(p,!0):void 0,spaceBelow:"",className:"text-fg"}),a("div",{className:d?"relative mt-0 grid grid-cols-[repeat(var(--cols),minmax(0,1fr))] gap-0 border-t border-line pt-[60px] max-[1100px]:mt-0 max-[1100px]:grid-cols-1 max-[1100px]:gap-0 max-[1100px]:border-t-0 max-[1100px]:pt-0":"relative mt-[60px] grid grid-cols-[repeat(var(--cols),minmax(0,1fr))] gap-0 border-t border-line pt-[60px] max-[1100px]:mt-9 max-[1100px]:grid-cols-1 max-[1100px]:gap-0 max-[1100px]:border-t-0 max-[1100px]:pt-0",style:{"--cols":r.length},children:[t("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-line max-[1100px]:hidden",children:t("div",{className:"absolute -top-px left-0 h-[3px] bg-gradient-to-r from-accent to-transparent",style:{width:`${k}%`}})}),r.map((e,i)=>a("div",{className:["relative flex min-h-[280px] flex-col gap-3.5 px-3.5","border-l",e.future?"border-line":"max-[1100px]:border-accent border-line",i===0?"min-[1101px]:border-l-0":"","max-[1100px]:min-h-0 max-[1100px]:border-t-0 max-[1100px]:py-6 max-[1100px]:pl-7 max-[1100px]:ml-1.5"].join(" "),children:[t("span",{className:["pointer-events-none absolute h-2.5 w-2.5 rounded-full border-2 border-bg",e.future?"border-line bg-surface-2":"bg-accent",i===0?"-top-[66px] left-[-1px]":"-top-[66px] left-[-5px]","max-[1100px]:left-[-5px] max-[1100px]:top-7"].join(" ")}),t("span",{className:["font-mono text-[length:var(--size-label,13px)] tracking-[0.22em]",e.future?"text-fg-dim":"text-accent"].join(" "),children:e.date?t(c,{value:e.date,children:l(e.date)}):""}),e.title&&t("h3",{className:"whitespace-pre-line font-heading3 text-[length:var(--size-headingSmall,20px)] font-medium uppercase leading-[1.1] tracking-[-0.02em] text-fg",children:t(c,{value:e.title,children:l(e.title)})}),e.blurb&&t("p",{className:"mt-auto font-display text-[length:var(--size-body,13px)] leading-[1.55] text-fg-dim",children:f(e.blurb,!0)})]},i))]}),n?.text&&t("div",{className:"mt-12 flex justify-end border-t border-line pt-8",children:a(w,{href:n.href,className:"group inline-flex items-center gap-3.5 border border-line px-6 py-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[l(n.text),t("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"\u2192"})]})})]})})}export{B as default};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{SiteLink as w}from"../lib/site-runtime.js";import z from"./EditorialSectionHead.js";import c from"./PartStyledText.js";import{withRMark as l}from"./RMark.js";import{renderGold as f,renderHeadline as S}from"./goldPhrases.js";function B({eyebrow:g,title:o,intro:p,entries:u,cta:n,padTop:x,padBottom:s,background:b,editing:h,omitHead:d=!1}={}){const v=typeof x=="number"?x:120,N=typeof s=="number"?s:120,m=b??"var(--section-bg)",y=m!=="transparent",r=(u??[]).filter(e=>(e.date??"").trim()||(e.title??"").trim()||(e.blurb??"").trim());if(r.length===0&&!h)return null;const j=r.filter(e=>!e.future).length,k=r.length?j/r.length*100:0;return t("section",{className:"relative z-[2]",children:a("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]",style:{paddingTop:v,paddingBottom:N,...y?{backgroundColor:m}:{}},children:[d?null:t(z,{num:g,title:o?S(o):void 0,desc:p?f(p,!0):void 0,spaceBelow:"",className:"text-fg"}),a("div",{className:d?"relative mt-0 grid grid-cols-[repeat(var(--cols),minmax(0,1fr))] gap-0 border-t border-line pt-[60px] max-[1100px]:mt-0 max-[1100px]:grid-cols-1 max-[1100px]:gap-0 max-[1100px]:border-t-0 max-[1100px]:pt-0":"relative mt-[60px] grid grid-cols-[repeat(var(--cols),minmax(0,1fr))] gap-0 border-t border-line pt-[60px] max-[1100px]:mt-9 max-[1100px]:grid-cols-1 max-[1100px]:gap-0 max-[1100px]:border-t-0 max-[1100px]:pt-0",style:{"--cols":r.length},children:[t("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-line max-[1100px]:hidden",children:t("div",{className:"absolute -top-px left-0 h-[3px] bg-gradient-to-r from-accent to-transparent",style:{width:`${k}%`}})}),r.map((e,i)=>a("div",{className:["relative flex min-h-[280px] flex-col gap-3.5 px-3.5","border-l",e.future?"border-line":"max-[1100px]:border-accent border-line",i===0?"min-[1101px]:border-l-0":"","max-[1100px]:min-h-0 max-[1100px]:border-t-0 max-[1100px]:py-6 max-[1100px]:pl-7 max-[1100px]:ml-1.5"].join(" "),children:[t("span",{className:["pointer-events-none absolute h-2.5 w-2.5 rounded-full border-2 border-bg",e.future?"border-line bg-surface-2":"bg-accent",i===0?"-top-[66px] left-[-1px]":"-top-[66px] left-[-5px]","max-[1100px]:left-[-5px] max-[1100px]:top-7"].join(" ")}),t("span",{className:["font-mono text-[length:var(--size-label,13px)] tracking-[0.22em]",e.future?"text-fg-dim":"text-accent"].join(" "),children:e.date?t(c,{value:e.date,children:l(e.date)}):""}),e.title&&t("h3",{className:"whitespace-pre-line font-heading3 text-[length:var(--size-headingSmall,20px)] font-medium uppercase leading-[1.1] tracking-[-0.02em] text-fg",children:t(c,{value:e.title,children:l(e.title)})}),e.blurb&&t("p",{className:"mt-auto font-display text-[length:var(--size-body,13px)] leading-[1.55] text-fg-dim",children:f(e.blurb,!0)})]},i))]}),n?.text&&t("div",{className:"mt-12 flex justify-end border-t border-line pt-8",children:a(w,{href:n.href,className:"group inline-flex items-center gap-3.5 border border-line px-6 py-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[l(n.text),t("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"→"})]})})]})})}export{B 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:"\u2192"})]},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";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 +1 @@
1
- "use client";import{jsx as t,jsxs as w}from"react/jsx-runtime";import{useCallback as k,useEffect as f,useState as M}from"react";import{ExternalIcon as Y}from"efficient-easel/icons";import{SettingsSwitch as F}from"efficient-easel/panel";import{PagesIcon as G,StylesIcon as j}from"efficient-easel/rail";import{TreeRow as z}from"efficient-easel/tree";import K from"./HeadingAudit.js";import{LocationsTreeContext as U}from"./LocationsTreeContext.js";import Z from"./PagesPanel.js";import{usePreviewChat as q}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as X}from"./preview-devices.js";import{PreviewDeviceContext as J}from"./PreviewDeviceContext.js";import{usePreviewHeader as Q}from"./PreviewHeaderContext.js";import{usePreviewSocial as $}from"./PreviewSocialContext.js";import{usePreviewSurface as ee}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as te,usePreviewTicker as oe}from"./PreviewTickerContext.js";import re,{CHAT_MODE as ie,HEADER_MODE as O,SOCIAL_MODE as se,WEBSITE_MODE as y}from"./SectionEditor.js";import g from"./SectionIcon.js";import ne from"./SectionThumbnail.js";import{useStorefrontDocument as I}from"./StorefrontDocumentContext.js";import ae from"./StylesPanel.js";import ce from"./TemplateGlyph.js";import{useFooterFocus as le}from"./useFooterFocus.js";import{LOCATIONS_TYPE as de,useLocationsTree as pe}from"./useLocationsTree.js";import{usePinnedChromeSeed as me}from"./usePinnedChromeSeed.js";import{usePreviewHref as fe}from"./usePreviewHref.js";import{SITE_STYLES_TABS as ue,SITE_STYLES_TEXT_TAB as Se,useWebsiteName as Ee}from"./WebsiteSettingsPanel.js";import{HERO_GROUP_TYPE as Te,duplicateBlocked as he,heroGroupNestDepth as we}from"../lib/hero-group-placement.js";import{stripMarkup as Pe}from"../lib/markup.js";import{categoryShortLabel as be,PINNED_SECTION_TYPE as ve}from"../lib/puck/add-palette.js";import{canAddTo as ke}from"../lib/puck/add-target.js";import{blockIsOffered as ge}from"../lib/puck/block-offer.js";import{sectionIdOfBoxZone as Ie,setBookingPreview as Ce}from"../lib/puck/booking-preview.js";import{footerBlockRowName as _e}from"../lib/puck/footer-block-row-name.js";import{FOOTER_TYPE as Le,HEADER_TYPE as A}from"../lib/puck/footer-blocks.js";import{leftViewForSelection as Oe,readLeftView as ye,resolveLeftView as Ae,writeLeftView as Be}from"../lib/puck/left-view.js";import{isLockedBlock as Ne}from"../lib/puck/locked-blocks.js";import{scrollPreviewToSection as Re,scrollPreviewToTop as B}from"../lib/puck/preview-dom.js";import{SiteCanvas as He}from"../lib/puck/overrides.js";import{labelAtLevel as De}from"../lib/puck/section-catalog.js";import{SECTION_DESCRIPTIONS as Ve}from"../lib/puck/section-descriptions.js";import{isSectionGroupType as xe,sectionGroupZone as We,SITE_FOOTER_TYPE as Me,SITE_HEADER_TYPE as Ye}from"../lib/puck/section-groups.js";import{resolveSaveAsTemplateAction as Fe,SAVE_AS_TEMPLATE_EVENT as Ge}from"../lib/save-as-template-action.js";import{newSectionNode as je}from"../lib/sections/new-section-node.js";import{useHostProducts as ze}from"../lib/use-host-products.js";function N({mode:e,open:o}){const{setSelectedHeroId:r,setSelectHandler:c}=oe(),l=e,s=l.kind==="ticker"?l.heroId:null,n=k(i=>{if(!i)return;o({kind:"ticker",heroId:i}),Re(i)},[o]);return f(()=>{r(s)},[s,r]),f(()=>{c(n)},[c,n]),{partRows:(i,{rowClick:m})=>{const a=String(i.props.id);return i.type==="Hero"&&t(z,{icon:t(g,{type:"ticker",size:13}),name:te,onSelect:()=>n(a),selected:s===a,rowProps:{onClick:m(()=>n(a))}})}}}function Ke(){const{adapter:e,capabilities:o,currentSlug:r,siteId:c,hasUnsavedEdits:l,bridgeCapabilities:s,notifyParent:n,token:i}=I(),{hasPreviewLink:m}=o,a=Fe({hasTrustedConsole:!!i,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:l}),T=k(()=>{!c||!r||n(Ge,{siteId:c,slug:r})},[n,c,r]),u=fe({pageSlug:r,siteId:c,token:i}),S=e.previewHref?.(r)??u;return{barLead:()=>a.visible&&w("button",{type:"button",className:"es-btn-ghost",disabled:!a.enabled,title:a.enabled?"Save this website as a platform template":a.disabledReason,onClick:T,children:["Save as Template",t(ce,{})]}),barTrail:()=>m&&r&&w("a",{className:"es-btn-ghost",href:S,target:"_blank",rel:"noopener noreferrer",title:"Preview the live site (opens in a new tab)","aria-label":"Preview the live site in a new tab",children:["Preview",t(Y,{size:15})]})}}function Ue(){return w("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[t("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"}),t("circle",{cx:"7.7",cy:"11.3",r:"1.05",fill:"currentColor",stroke:"none"}),t("circle",{cx:"12",cy:"8",r:"1.05",fill:"currentColor",stroke:"none"}),t("circle",{cx:"16",cy:"11",r:"1.05",fill:"currentColor",stroke:"none"})]})}function Ze(e,o){const{capabilities:r,templateId:c,siteId:l,tokenRef:s,navigate:n}=I(),{hasSiteTheme:i,explainsSiteSettings:m}=r,a=d=>o.setView(d),[T,u]=M(ue[0].id),{surface:S,setSurface:P}=ee(),b=()=>{if(i){a("styles"),o.reveal(),B();return}e.show(y),e.reveal(),B()},v={id:"pages",label:"Pages",icon:t(G,{}),panel:({onHide:d})=>t(Z,{activeSurface:S,onPreviewSurface:P,onNavigate:p=>{P(null),n(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:t(Ue,{}),active:e.kind==="website",onSelect:b}),i&&E.push({id:"styles",label:"Site styles",icon:t(j,{}),panel:({onHide:d,notify:p})=>t(ae,{tokenRef:s,siteId:l??void 0,onClose:d,onNotify:p,tab:T,onTabChange:u})}),{railLead:[v],railTrail:E,resolveLeftView:(d,p)=>Ae(d,i,p),openSettings:b,openStyles:()=>{u(Se),a("styles")}}}function qe(e,o,r,c){const{kind:l,open:s}=e,{selected:n,zoneOf:i}=o,m=le(o,r);f(()=>{Ce(n?.type==="BookingBox"&&n.props.region==="confirm"?Ie(i(String(n.props.id))):null)},[n?.props.id]);const a=pe(e,o),{capabilities:{hasSiteSettings:T}}=I(),{setSelected:u,setSelectHandler:S}=Q(),{chat:P,setChat:b,setSelected:v,setSelectHandler:E}=q(),d=l==="header";f(()=>{u(d)},[d,u]),f(()=>{S(()=>s(O))},[S,s]);const p=k(()=>s(ie),[s]),C=l==="chat";f(()=>{v(C)},[C,v]),f(()=>{E(p)},[E,p]);const{setOpenHandler:_}=$(),L=k(()=>s(se),[s]);f(()=>{_(L)},[_,L]);const H=N(e),D=Ke(),V=Ze(e,c),x=r.device;return{...m,...H,...D,...V,treeFoot:()=>t("div",{className:"sf-tree-tool",children:t(K,{})}),hasOwnRows:h=>h.type===de,ownRows:a.renderLocationTree,sectionPressed:a.sectionPressed,wrap:h=>t(U.Provider,{value:!0,children:t(J.Provider,{value:x,children:h})}),addPanelRow:h=>T?w("div",{className:"sf-addside-sitewide",children:[t("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:t(g,{type:"chat",size:16})}),w("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{h(),p()},children:["Live chat",t("span",{className:"sf-addside-sitewide-desc",children:"A chat bubble on every page"})]}),t(F,{checked:P.enabled,onChange:W=>b({enabled:W}),ariaLabel:"Show the chat bubble on the whole site"})]}):void 0}}const Xe={isLockedBlock:Ne,duplicateBlocked:he,nestDepth:(e,o,r)=>o===Te?we(e,r):0,newSectionNode:je,canAddTo:ke,blockIsOffered:ge},Je={labelAtLevel:De,descriptions:Ve,categoryLabel:be,firstSection:ve,blockRowName:_e,plainText:Pe,Icon:g,Thumbnail:ne,useProducts:ze},Qe={desktop:2e3,tablet:800,mobile:390},R="desktop",$e={options:X,initial:R,fluid:R,widths:Qe},et={read:ye,write:e=>Be(e),forSelection:(e,o)=>Oe(e,o)},tt={first:A,last:Le,firstGroup:Ye,lastGroup:Me,isSectionGroup:xe,sectionGroupZone:We,panelOf:e=>e===A?O:null};function ot(e){return{...N(e),openSettings:()=>e.show(y)}}const Zt={useOwnerName:Ee,useBridges:qe,useStandaloneBridges:ot,useDocumentPass:me,blockRules:Xe,blockLook:Je,devices:$e,leftView:et,pinned:tt,Canvas:He,Inspector:re};export{Zt as WEBSITE_SCREEN};
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,20 +1,16 @@
1
- import { type ReactNode, type RefObject } from "react";
1
+ import { type RefObject } from "react";
2
+ import { type SettingsTabItem } from "efficient-easel/panel";
2
3
  import type { SiteThemeRowPatch } from "../lib/site-theme-row.js";
3
4
  import { type CardShadow, type HoverEffect } from "../lib/theme.js";
4
- export declare const TABPANEL_ID = "sf-site-styles-tabpanel";
5
+ export declare const SITE_STYLES_ID_PREFIX = "sf-site-styles";
6
+ export declare const TABPANEL_CLASS = "sf-site-styles-tabpanel";
5
7
  export declare const SHOW_HINTS_DEFAULT = false;
6
8
  export declare function HintsToggle({ shown, onChange, }: {
7
9
  shown: boolean;
8
10
  onChange: (v: boolean) => void;
9
11
  }): import("react").JSX.Element;
10
12
  export declare const SITE_STYLES_TEXT_TAB = "text";
11
- export declare const SITE_STYLES_TABS: {
12
- id: string;
13
- label: string;
14
- icon?: ReactNode;
15
- htmlId: string;
16
- panelId: string;
17
- }[];
13
+ export declare const SITE_STYLES_TABS: SettingsTabItem[];
18
14
  export declare function siteWidthPatch(v: number | null): SiteThemeRowPatch;
19
15
  export declare function blockGapPatch(v: number | null): SiteThemeRowPatch;
20
16
  export declare function siteGutterPatch(v: number | null): SiteThemeRowPatch;
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as y,Fragment as w}from"react/jsx-runtime";import{useEasel as F}from"efficient-easel/easel";import{useEffect as L,useRef as N,useState as x}from"react";import k from"./ThemeField.js";import W from"./CornersField.js";import v from"./CardShadowField.js";import B from"./ShadowColourField.js";import O from"./BlockGapField.js";import A from"./HoverEffectField.js";import j from"./HeroImageField.js";import U from"./PhotographyField.js";import Y from"./SideSpaceField.js";import M from"./SiteWidthField.js";import X from"./TextStylesField.js";import{usePreviewHeader as f}from"./PreviewHeaderContext.js";import{SettingsTabs as $}from"efficient-easel/panel";import{ContrastIcon as q,NoteIcon as J,SettingsIcon as Z,TypeIcon as K}from"efficient-easel/icons";import{useThemeRowPersist as Q}from"../lib/theme-row-persist.js";import{themeSaveNotice as V}from"../lib/theme-save-message.js";import{NEUTRAL_SITE_NAME as D}from"../lib/content/site-name.js";import{normalizeFonts as ee}from"../lib/fonts.js";import{previewFrame as oe}from"../lib/puck/preview-dom.js";import{CORNER_STYLE_TO_PX as te,normalizeCornerRadius as ne,normalizeCornerStyle as re,normalizeShadowColor as se,headingTypographyToRow as ie,normalizeHeadingCompression as ae,normalizeHeadingTypography as ce,DEFAULT_SIZES as le}from"../lib/theme.js";const b="sf-site-styles-tabpanel",de=!1,pe="Show hints";function he({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(J,{size:13}),pe]})})}const lo="text",R=[{id:"basics",label:"Basics",icon:n(Z,{}),htmlId:"sf-site-styles-tab-basics",panelId:b},{id:"theme",label:"Theme",icon:n(q,{}),htmlId:"sf-site-styles-tab-theme",panelId:b},{id:"text",label:"Text",icon:n(K,{}),htmlId:"sf-site-styles-tab-text",panelId:b}];function ue({themeFromDocument:e,persist:o}){const{appState:s,dispatch:r}=F(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 ge(e,o){const[s,r]=x(null),a=N(null),t=JSON.stringify(e),c=N(o);return c.current=o,L(()=>{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 fe({themeFromDocument:e,persist:o}){const{appState:s,dispatch:r}=F(d=>d),[a,t]=x(null),{fonts:c,setFonts:h,sizes:i,setSizes:u,headingCompression:g,setHeadingCompression:S,headingTypography:_,setHeadingTypography:l}=f(),T=s.data,m=T.root?.props??{},C=e?ee(m.fonts):c,E=e?le:i,z=e?ae(m.headingCompression):g,I=e?ce(m.headingTypography):_,H=d=>r({type:"replaceRoot",root:{...T.root,props:{...m,...d}},recordHistory:!0}),G=ge({curFonts:C,curCompression:z,curTypography:I},a);return n(X,{fonts:C,sizes:E,compression:z,headingTypography:I,openRole:a,onOpenRole:t,onFontChange:(d,P)=>{const p={...C,[d]:P};e?H({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,P)=>{const p={...E,[d]:P};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?H({headingCompression:d}):S(d),o({heading_compression:d})},onHeadingTypographyChange:d=>{e?H({headingTypography:d}):l(d),o(ie(d))},livePx:Ce,savedRole:G})}const me={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 Ce(e){if(typeof document>"u")return null;const s=(oe()?.contentDocument??document).querySelector(me[e]);if(!s)return null;const r=parseFloat(getComputedStyle(s).fontSize);return Number.isFinite(r)?r:null}function ye({themeFromDocument:e,persist:o,showHint:s}){const{appState:r,dispatch:a}=F(l=>l),{cornerRadiusPx:t,setCornerRadiusPx:c}=f(),h=r.data,i=h.root?.props??{},u=i.cornerRadiusPx===void 0?te[re(i.cornerStyle)]:ne(i.cornerRadiusPx),g=e?u:t,S=l=>a({type:"replaceRoot",root:{...h.root,props:{...i,...l}},recordHistory:!0});return n(W,{value:g,onChange:l=>{e?S({cornerRadiusPx:l}):c(l),o({corner_radius_px:l})},showHint:s})}function Se(e){return{site_width:e}}function _e({persist:e,showHint:o}){const{siteWidth:s,setSiteWidth:r}=f();return n(M,{value:s,onChange:t=>{r(t),e(Se(t),t===null)},showHint:o})}function we(e){return{block_gap:e}}function Te(e){return{site_gutter:e}}function xe({persist:e,showHint:o}){const{siteGutter:s,setSiteGutter:r}=f();return n(Y,{value:s,onChange:t=>{r(t),e(Te(t),t===null)},showHint:o})}function be({persist:e,showHint:o}){const{blockGap:s,setBlockGap:r}=f();return n(O,{value:s,onChange:t=>{r(t),e(we(t),t===null)},showHint:o})}function Re({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 He({persist:e,showHint:o=!0}){return y(w,{children:[n(_e,{persist:e,showHint:o}),n(xe,{persist:e,showHint:o}),n(be,{persist:e,showHint:o}),n(Re,{persist:e,showHint:o})]})}function Pe(e){return{card_shadow:e}}function Fe(e){return e===null?{shadow_color:null}:{shadow_color:se(e)}}function Ee(e){return{hover_effect:e}}function ze({persist:e,showHint:o=!0}){const{cardShadow:s,setCardShadow:r,shadowColor:a,setShadowColor:t,hoverEffect:c,setHoverEffect:h}=f();return y(w,{children:[n(v,{value:s,onChange:i=>{r(i),e(Pe(i),!0)},showHint:o}),n(B,{value:a,onChange:i=>{t(i),e(Fe(i),i===null)},showHint:o}),n(A,{value:c,onChange:i=>{h(i),e(Ee(i),!0)},showHint:o})]})}function Ie(e){return{photography_grayscale:e}}function Ne({persist:e,showHint:o}){const{photographyGrayscale:s,setPhotographyGrayscale:r}=f();return n(U,{value:s,onChange:t=>{r(t),e(Ie(t),!0)},showHint:o})}function Ge({persist:e,showHint:o=!0}){return n(w,{children:n(Ne,{persist:e,showHint:o})})}function Le(){const{websiteName:e}=f();return e?.trim()||D}function po(){const e=Le();return n("p",{className:"sf-panel-site",title:`${e} \u2014 renamed in the Console: Storefront \u25B8 Sites \u25B8 Settings.`,children:e})}function ke({themeFromDocument:e=!1,tokenRef:o,siteId:s,onNotify:r,tab:a,onTabChange:t}){const{persist:c}=Q({themeFromDocument:e,tokenRef:o,siteId:s,onResult:m=>{const C=V(m);C&&r?.(C.msg,C.tone)}}),[h,i]=x(R[0].id),u=a!==void 0,g=u?a:h,S=u?t??(()=>{}):i,_=R.find(m=>m.id===g)??R[0],[l,T]=x(de);return y(w,{children:[n($,{items:R,activeId:_.id,onSelect:S,ariaLabel:"Site styles"}),y("div",{id:b,role:"tabpanel","aria-labelledby":_.htmlId,children:[g==="basics"&&y(w,{children:[n(ye,{themeFromDocument:e,persist:c,showHint:l}),!e&&n(ze,{persist:c,showHint:l}),!e&&n(He,{persist:c,showHint:l}),!e&&n(Ge,{persist:c,showHint:l}),n(he,{shown:l,onChange:T})]}),g==="theme"&&n(ue,{themeFromDocument:e,persist:c}),g==="text"&&n(fe,{themeFromDocument:e,persist:c})]})]})}export{ze as CardLookFields,he as HintsToggle,He as PageGroupFields,Ge as PhotographyGroupFields,de as SHOW_HINTS_DEFAULT,R as SITE_STYLES_TABS,lo as SITE_STYLES_TEXT_TAB,b as TABPANEL_ID,po as WebsiteNameReadonly,we as blockGapPatch,Pe as cardShadowPatch,ke as default,Ee as hoverEffectPatch,Ie as photographyPatch,Fe as shadowColourPatch,Te as siteGutterPatch,Se as siteWidthPatch,Le as useWebsiteName};
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,2 +1,2 @@
1
- import{jsx as t,jsxs as u}from"react/jsx-runtime";import{Fragment as d}from"react";import{linePrefix as N,storefrontLines as L}from"../lib/markup.js";import{COLOUR_TOKEN as h,WORD_STYLE_ATTR as _,WORD_STYLE_BY_KIND as S}from"../lib/word-styles.js";import{isHexColour as g}from"../lib/puck/part-styles.js";import a from"./PartStyledText.js";import{withRMark as f}from"./RMark.js";function E(e,n=!1){const s=m(n),r=L(e);if(r.length===1){const[c]=r,l=N(c),b=l?w(l,c.children):c.children;return t(a,{value:e,children:o(b,s)})}const i=[];return r.forEach((c,l)=>{if(c.bullet){i.push(t("span",{"data-sf-bullet":"",className:T,children:o(c.children,s)},l));return}if(c.number!=null){i.push(u("span",{"data-sf-number":c.number,className:R,children:[u("span",{className:k,children:[c.number,"."]}),o(c.children,s)]},l));return}l>0&&!C(r[l-1])&&i.push(t("br",{},`br${l}`)),i.push(t(d,{children:o(c.children,s)},l))}),t(a,{value:e,children:i})}const T="relative block pl-6 before:absolute before:left-1.5 before:font-bold before:text-accent before:content-['\xB7']",R="relative block pl-[2em]",k="absolute left-0 w-[1.6em] text-right tabular-nums";function C(e){return e.bullet||e.number!=null}const O="text-accent underline underline-offset-[0.18em]";function w(e,n){const[s,...r]=n;return s?.kind==="text"?[{kind:"text",text:`${e}${s.text}`},...r]:[{kind:"text",text:e},...n]}function A(e){if(e)return g(e)?e:Object.hasOwn(h,e)?h[e]:void 0}function o(e,n){const s=[];let r=!1;return e.forEach((i,c)=>{if(i.kind==="text"){s.push(t("span",{children:f(i.text)},c)),r=!0;return}r||s.push(t("span",{},`e${c}`)),s.push(x(i,c,n)),r=!1}),r||s.push(t("span",{},"end")),s}function p(e,n){return e.length===1&&e[0].kind==="text"?f(e[0].text):e.map((s,r)=>s.kind==="text"?t(d,{children:f(s.text)},r):x(s,r,n))}function $(e,n=!1){return o(e,m(n))}function m(e){return e?"font-normal italic text-accent":"not-italic text-accent"}function D(e){return t(a,{value:e,children:t("span",{children:e})})}function x(e,n,s){if(e.kind==="link")return t("a",{href:e.href,className:O,children:p(e.children,s)},n);const r=p(e.children,s),i=S[e.kind];if(i)return t("span",{[_]:i,children:r},n);switch(e.kind){case"underline":return t("u",{children:r},n);case"sup":return t("sup",{children:r},n);case"sub":return t("sub",{children:r},n);case"color":{const c=A(e.color);return c?t("span",{style:{color:c},children:r},n):t("span",{children:r},n)}case"accent":case"highlight":return t("em",{className:s,children:r},n);case"bold":return t("strong",{className:"font-semibold",children:r},n);case"italic":return t("em",{className:"italic",children:r},n);case"strike":return t("s",{className:"line-through",children:r},n);default:return t("span",{children:r},n)}}function P(e,n=!0){const s=e.split(`
1
+ import{jsx as t,jsxs as u}from"react/jsx-runtime";import{Fragment as d}from"react";import{linePrefix as N,storefrontLines as L}from"../lib/markup.js";import{COLOUR_TOKEN as h,WORD_STYLE_ATTR as _,WORD_STYLE_BY_KIND as S}from"../lib/word-styles.js";import{isHexColour as g}from"../lib/puck/part-styles.js";import a from"./PartStyledText.js";import{withRMark as f}from"./RMark.js";function E(e,n=!1){const s=m(n),r=L(e);if(r.length===1){const[c]=r,l=N(c),b=l?w(l,c.children):c.children;return t(a,{value:e,children:o(b,s)})}const i=[];return r.forEach((c,l)=>{if(c.bullet){i.push(t("span",{"data-sf-bullet":"",className:T,children:o(c.children,s)},l));return}if(c.number!=null){i.push(u("span",{"data-sf-number":c.number,className:R,children:[u("span",{className:k,children:[c.number,"."]}),o(c.children,s)]},l));return}l>0&&!C(r[l-1])&&i.push(t("br",{},`br${l}`)),i.push(t(d,{children:o(c.children,s)},l))}),t(a,{value:e,children:i})}const T="relative block pl-6 before:absolute before:left-1.5 before:font-bold before:text-accent before:content-['·']",R="relative block pl-[2em]",k="absolute left-0 w-[1.6em] text-right tabular-nums";function C(e){return e.bullet||e.number!=null}const O="text-accent underline underline-offset-[0.18em]";function w(e,n){const[s,...r]=n;return s?.kind==="text"?[{kind:"text",text:`${e}${s.text}`},...r]:[{kind:"text",text:e},...n]}function A(e){if(e)return g(e)?e:Object.hasOwn(h,e)?h[e]:void 0}function o(e,n){const s=[];let r=!1;return e.forEach((i,c)=>{if(i.kind==="text"){s.push(t("span",{children:f(i.text)},c)),r=!0;return}r||s.push(t("span",{},`e${c}`)),s.push(x(i,c,n)),r=!1}),r||s.push(t("span",{},"end")),s}function p(e,n){return e.length===1&&e[0].kind==="text"?f(e[0].text):e.map((s,r)=>s.kind==="text"?t(d,{children:f(s.text)},r):x(s,r,n))}function $(e,n=!1){return o(e,m(n))}function m(e){return e?"font-normal italic text-accent":"not-italic text-accent"}function D(e){return t(a,{value:e,children:t("span",{children:e})})}function x(e,n,s){if(e.kind==="link")return t("a",{href:e.href,className:O,children:p(e.children,s)},n);const r=p(e.children,s),i=S[e.kind];if(i)return t("span",{[_]:i,children:r},n);switch(e.kind){case"underline":return t("u",{children:r},n);case"sup":return t("sup",{children:r},n);case"sub":return t("sub",{children:r},n);case"color":{const c=A(e.color);return c?t("span",{style:{color:c},children:r},n):t("span",{children:r},n)}case"accent":case"highlight":return t("em",{className:s,children:r},n);case"bold":return t("strong",{className:"font-semibold",children:r},n);case"italic":return t("em",{className:"italic",children:r},n);case"strike":return t("s",{className:"line-through",children:r},n);default:return t("span",{children:r},n)}}function P(e,n=!0){const s=e.split(`
2
2
  `);return t(a,{value:e,children:s.map((r,i)=>u("span",{children:[E(r,n),i<s.length-1?t("br",{}):null]},i))})}function Y(e){return e.split(/\n\s*\n/).map(n=>n.trim()).filter(Boolean)}export{D as renderChrome,E as renderGold,P as renderHeadline,$ as renderMarkupNodes,Y as splitParagraphs};