efficient-web-builder 2.0.0 → 2.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 (134) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/BlogPostSource.js +1 -1
  3. package/dist/components/Breadcrumb.js +1 -1
  4. package/dist/components/Btn.js +1 -1
  5. package/dist/components/CardShadowField.js +1 -1
  6. package/dist/components/CategoryBar.js +1 -1
  7. package/dist/components/ChartSection.js +1 -1
  8. package/dist/components/ChatSettingsPanel.js +1 -1
  9. package/dist/components/ClearColoursDialog.js +1 -1
  10. package/dist/components/ContactLocations.js +5 -5
  11. package/dist/components/CornersField.js +1 -1
  12. package/dist/components/DocBody.js +1 -1
  13. package/dist/components/DuplicateToPageMenu.js +1 -1
  14. package/dist/components/FeaturedCover.js +1 -1
  15. package/dist/components/FieldGlyph.js +1 -1
  16. package/dist/components/Footprint.js +1 -1
  17. package/dist/components/HeadingAudit.js +1 -1
  18. package/dist/components/HeroSection.js +1 -1
  19. package/dist/components/HoverEffectField.js +1 -1
  20. package/dist/components/ImageBlock.js +1 -1
  21. package/dist/components/ImageFocusRow.js +1 -1
  22. package/dist/components/LocationsGroupedField.js +1 -1
  23. package/dist/components/LongRead.js +1 -1
  24. package/dist/components/MediaUploadField.js +1 -1
  25. package/dist/components/MockupSection.js +1 -1
  26. package/dist/components/PagesPanel.js +1 -1
  27. package/dist/components/PartResetDot.js +1 -1
  28. package/dist/components/PartSettingsPanel.js +1 -1
  29. package/dist/components/PostCard.js +1 -1
  30. package/dist/components/ProcessSteps.js +1 -1
  31. package/dist/components/RMark.js +1 -1
  32. package/dist/components/Reel.js +1 -1
  33. package/dist/components/SectionEditor.js +1 -1
  34. package/dist/components/SectionHeader.js +1 -1
  35. package/dist/components/SectionThumbnail.js +1 -1
  36. package/dist/components/SlotChildRows.js +1 -1
  37. package/dist/components/SourceStatus.js +1 -1
  38. package/dist/components/Split.js +1 -1
  39. package/dist/components/StandaloneSectionEditor.js +1 -1
  40. package/dist/components/StylesPanel.js +1 -1
  41. package/dist/components/Testimonials.js +1 -1
  42. package/dist/components/TextStylesField.js +1 -1
  43. package/dist/components/ThemeCard.js +1 -1
  44. package/dist/components/ThemeColourField.js +1 -1
  45. package/dist/components/ThemeField.js +1 -1
  46. package/dist/components/TickerSettingsPanel.js +1 -1
  47. package/dist/components/Timeline.js +1 -1
  48. package/dist/components/TimelineTrack.js +1 -1
  49. package/dist/components/TitleWithButtons.js +1 -1
  50. package/dist/components/WebsiteScreenParts.js +1 -1
  51. package/dist/components/WebsiteSettingsPanel.js +1 -1
  52. package/dist/components/goldPhrases.js +1 -1
  53. package/dist/components/storefront-editor.css +25 -212
  54. package/dist/lib/content/contact.js +3 -3
  55. package/dist/lib/content/subscribe.js +1 -1
  56. package/dist/lib/puck/MarkupToolbar.js +1 -1
  57. package/dist/lib/puck/blocks/general/CategoryBar/fields.js +1 -1
  58. package/dist/lib/puck/blocks/general/Chart/fields.js +1 -1
  59. package/dist/lib/puck/blocks/general/FAQ/render.js +1 -1
  60. package/dist/lib/puck/blocks/general/FeaturedCover/render.js +1 -1
  61. package/dist/lib/puck/blocks/general/Footprint/fields.js +1 -1
  62. package/dist/lib/puck/blocks/general/IntroBleed/render.js +1 -1
  63. package/dist/lib/puck/blocks/general/LogoBlock/fields.js +1 -1
  64. package/dist/lib/puck/blocks/general/LongRead/render.js +1 -1
  65. package/dist/lib/puck/blocks/general/Masthead/render.js +1 -1
  66. package/dist/lib/puck/blocks/general/Mockup/fields.js +1 -1
  67. package/dist/lib/puck/blocks/general/OrderSummary/render.js +1 -1
  68. package/dist/lib/puck/blocks/general/ParagraphsA/render.js +1 -1
  69. package/dist/lib/puck/blocks/general/PostCard/render.js +1 -1
  70. package/dist/lib/puck/blocks/general/ProcessSteps/render.js +1 -1
  71. package/dist/lib/puck/blocks/general/Series/render.js +1 -1
  72. package/dist/lib/puck/blocks/general/Split/render.js +1 -1
  73. package/dist/lib/puck/blocks/general/Testimonials/fields.js +1 -1
  74. package/dist/lib/puck/blocks/general/Testimonials/render.js +1 -1
  75. package/dist/lib/puck/blocks/general/TimelineTrack/render.js +1 -1
  76. package/dist/lib/puck/blocks/placeholders.js +1 -1
  77. package/dist/lib/puck/controls.js +1 -1
  78. package/dist/lib/puck/field-groups.js +1 -1
  79. package/dist/lib/puck/footer-block-row-name.js +1 -1
  80. package/dist/lib/puck/geocode-resolve.js +1 -1
  81. package/dist/lib/puck/locations-tree.js +2 -2
  82. package/dist/lib/puck/neutralization-contracts.js +1 -1
  83. package/dist/lib/puck/part-rows.js +1 -1
  84. package/dist/lib/puck/section-catalog.js +1 -1
  85. package/dist/lib/puck/section-descriptions.js +1 -1
  86. package/dist/lib/sections/divider-style.js +1 -1
  87. package/dist/lib/sections/product-card-style.js +1 -1
  88. package/dist/lib/sections/ticker-style.js +1 -1
  89. package/dist/lib/source-rules/accent-token-name.js +2 -2
  90. package/dist/lib/source-rules/button-corners.js +1 -1
  91. package/dist/lib/source-rules/editor-chrome-note.js +2 -2
  92. package/dist/lib/source-rules/editor-context-menu.js +2 -2
  93. package/dist/lib/source-rules/editor-puck-drag-off.js +2 -2
  94. package/dist/lib/source-rules/efficient-easel-version.js +1 -1
  95. package/dist/lib/source-rules/every-button-follows-the-button-colour.js +4 -4
  96. package/dist/lib/source-rules/flat-theme-palette.js +2 -2
  97. package/dist/lib/source-rules/full-width-means-full.js +1 -1
  98. package/dist/lib/source-rules/heading-ceiling-sweep.js +3 -3
  99. package/dist/lib/source-rules/label-hints.js +4 -4
  100. package/dist/lib/source-rules/label-vocabulary.js +4 -4
  101. package/dist/lib/source-rules/mirrored-rows-agree.js +4 -4
  102. package/dist/lib/source-rules/no-comment-in-jsx.js +2 -2
  103. package/dist/lib/source-rules/no-glyph-rows.js +2 -2
  104. package/dist/lib/source-rules/one-colour-control.js +2 -2
  105. package/dist/lib/source-rules/one-dropdown.js +2 -2
  106. package/dist/lib/source-rules/one-editable-list.js +3 -3
  107. package/dist/lib/source-rules/one-editor-list.js +1 -1
  108. package/dist/lib/source-rules/one-right-click.js +2 -2
  109. package/dist/lib/source-rules/one-switch.js +1 -1
  110. package/dist/lib/source-rules/one-up-level-link.js +7 -7
  111. package/dist/lib/source-rules/panel-colour-tokens.js +7 -7
  112. package/dist/lib/source-rules/panel-no-divider-lines.js +5 -5
  113. package/dist/lib/source-rules/panel-one-arrow.js +1 -1
  114. package/dist/lib/source-rules/panel-one-hover.js +2 -2
  115. package/dist/lib/source-rules/panel-rows-use-the-shared-row.js +5 -5
  116. package/dist/lib/source-rules/part-slider-fills-row.js +8 -8
  117. package/dist/lib/source-rules/part-style-naming.js +1 -1
  118. package/dist/lib/source-rules/puck-document-surfaces.js +6 -6
  119. package/dist/lib/source-rules/reduced-motion.js +2 -2
  120. package/dist/lib/source-rules/route-content-width.js +2 -2
  121. package/dist/lib/source-rules/rule.js +1 -1
  122. package/dist/lib/source-rules/section-theme-preview.js +2 -2
  123. package/dist/lib/source-rules/site-square-by-default.js +1 -1
  124. package/dist/lib/source-rules/site-width.js +2 -2
  125. package/dist/lib/source-rules/size-token-paints.js +2 -2
  126. package/dist/lib/source-rules/social-icons-import.js +1 -1
  127. package/dist/lib/source-rules/source-status-is-shared.js +1 -1
  128. package/dist/lib/source-rules/style-face-matches-size.js +3 -3
  129. package/dist/lib/source-rules/support/part-slider-call-sites.js +4 -4
  130. package/dist/lib/source-rules/support/registry-source.js +1 -1
  131. package/dist/lib/source-rules/theme-mode-controls-gone.js +3 -3
  132. package/dist/lib/source-rules/upload-intake-guard.js +2 -2
  133. package/dist/lib/source-rules/word-styles.js +2 -2
  134. package/package.json +5 -5
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as $}from"react/jsx-runtime";import{renderGold as te,renderHeadline as ae}from"./goldPhrases.js";const C="#ffffff",d="#16181d",o="#5b6470",u="#9aa3ae",p="#f4f6f8",m="#e3e7ec",g="#1f9d55";function re({rows:n}){return e("div",{className:"flex flex-col gap-3",children:n.map((l,c)=>{const a=l.state??"ok",s=a==="no";return r("div",{className:"flex items-center gap-3 rounded-lg border px-4 py-3",style:{background:s?"#fbfbfc":p,borderColor:m},children:[a==="no"?e("span",{"aria-hidden":!0,className:"text-[15px] font-bold",style:{color:u},children:"\u2715"}):e("span",{"aria-hidden":!0,className:"h-[11px] w-[11px] flex-shrink-0 rounded-full",style:{background:a==="warn"?"var(--accent)":g}}),e("span",{className:"text-[14px] font-semibold",style:{color:s?u:d},children:l.lead}),e("span",{className:"text-[13px]",style:{color:s?u:o},children:l.detail}),(l.status??"").trim()&&e("span",{className:"ml-auto whitespace-nowrap text-[12px] font-bold",style:{color:a==="ok"?g:a==="warn"?"var(--accent)":u},children:l.status})]},c)})})}const I=["#c7cdd5","var(--accent)","#c7cdd5",g];function ne({columns:n}){return e("div",{className:"grid gap-2 rounded-xl p-3",style:{background:p,gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`},children:n.map((l,c)=>r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-baseline justify-between px-1",children:[e("span",{className:"font-mono text-[9px] font-semibold uppercase tracking-[0.14em]",style:{color:o},children:l.title}),e("span",{className:"font-mono text-[9px] font-bold",style:{color:"var(--accent)"},children:l.cards.length})]}),l.cards.map((a,s)=>r("div",{className:"rounded-md border px-2.5 py-2",style:{background:C,borderColor:c===n.length-1?"#bfe3ce":m},children:[e("span",{"aria-hidden":!0,className:"mb-1.5 block h-[8px] w-[8px] rounded-full",style:{background:I[c%I.length]}}),e("span",{className:"block text-[11px] font-semibold leading-snug",style:{color:d},children:a})]},s))]},c))})}function se({heading:n,bars:l}){const c=Math.max(...l.map(s=>s.value),0)||1,a=l.findIndex(s=>s.value===c);return r("div",{className:"border-t pt-4",style:{borderColor:m},children:[n.trim()&&e("div",{className:"mb-3 font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:n}),e("div",{className:"flex flex-col gap-2.5",children:l.map((s,i)=>r("div",{className:"flex items-center gap-3",children:[e("span",{className:"w-[84px] flex-shrink-0 text-[12px] font-bold",style:{color:d},children:s.label}),e("span",{className:"h-[12px] rounded-full",style:{width:`${Math.max(s.value/c*60,4)}%`,background:i===a?"var(--accent)":i%2?"#c7cdd5":"#9aa3ae"}}),r("span",{className:"text-[12px]",style:{color:o},children:[s.value,"%"]})]},i))})]})}function E({size:n}){const l=n/2;return r("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:[e("circle",{cx:l,cy:l,r:l*.82,fill:"none",stroke:"#9aa3ae",strokeWidth:"2.5"}),e("circle",{cx:l,cy:l,r:l*.5,fill:"none",stroke:"var(--accent)",strokeWidth:"2"}),e("circle",{cx:l,cy:l,r:l*.14,fill:"var(--accent)"})]})}function ce({header:n,lines:l}){return r("div",{style:{background:"#0c0e11"},children:[r("div",{className:"relative flex items-center gap-2 px-4 py-3",style:{background:"#161a20"},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"absolute inset-x-0 text-center font-mono text-[11px]",style:{color:"rgba(244,246,242,0.45)"},children:n})]}),r("div",{className:"flex flex-col gap-1.5 px-5 py-5 font-mono text-[13px] leading-relaxed",children:[l.map((c,a)=>c.startsWith("$ ")?r("div",{children:[e("span",{style:{color:"var(--accent)"},children:"$ "}),e("span",{style:{color:"#f4f6f2"},children:c.slice(2)})]},a):c.startsWith("\u2713")?e("div",{style:{color:"#6fcf7e"},children:c},a):e("div",{style:{color:"rgba(244,246,242,0.55)"},children:c},a)),e("div",{"aria-hidden":!0,className:"mt-1 h-[15px] w-[8px]",style:{background:"var(--accent)"}})]})]})}function de({urlText:n,heroTitle:l,heroButton:c,products:a}){return r("div",{children:[r("div",{className:"flex items-center gap-2 px-4 py-3",style:{background:p},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"mx-auto rounded border px-6 py-1 text-[11px]",style:{background:C,borderColor:m,color:o},children:n}),e("span",{className:"w-[54px]","aria-hidden":!0})]}),r("div",{className:"relative overflow-hidden px-5 py-6",style:{background:d},children:[e("div",{className:"absolute -right-4 top-1/2 -translate-y-1/2 opacity-90",children:e(E,{size:104})}),l.trim()&&e("div",{className:"max-w-[240px] text-[15px] font-bold uppercase leading-snug tracking-wide text-white",children:l}),c.trim()&&e("div",{className:"mt-3 inline-block rounded px-3.5 py-1.5 text-[11px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:c})]}),a.length>0&&e("div",{className:"grid grid-cols-3 gap-3 p-4",children:a.map((s,i)=>r("div",{className:"overflow-hidden rounded-lg border",style:{borderColor:m},children:[e("div",{className:"flex items-center justify-center py-3",style:{background:p},children:e(E,{size:56})}),r("div",{className:"flex flex-col gap-1 p-2.5",children:[e("span",{className:"text-[10.5px] font-bold leading-tight",style:{color:d},children:s.name}),e("span",{className:"text-[11px] font-bold",style:{color:"var(--accent)"},children:s.price}),e("span",{className:"mt-0.5 rounded px-2 py-1 text-center text-[9px] font-bold text-white",style:{background:d},"aria-hidden":!0,children:"Add to cart"})]})]},i))})]})}function ie({eyebrow:n,title:l,body:c,variant:a="spec-card",cardHeader:s,badge:i,cardTitle:f,cardSubtitle:b,pills:F,tiles:W,rows:K,button:_,footnote:j,col1Title:T,col1Cards:G,col2Title:L,col2Cards:O,col3Title:P,col3Cards:z,col4Title:U,col4Cards:q,barsHeading:J,bars:Q,termLines:S,urlText:V,heroTitle:A,heroButton:X,products:Y,align:Z="right",editing:x=!1}={}){const y=(F??[]).filter(t=>x||(t.value??"").trim()),v=(W??[]).filter(t=>x||(t.label??"").trim()),N=(K??[]).filter(t=>x||(t.lead??"").trim()),k=[[T,G],[L,O],[P,z],[U,q]].map(([t,h])=>({title:(t??"").trim(),cards:(h??[]).map(le=>(le.text??"").trim()).filter(Boolean)})).filter(t=>t.title||t.cards.length>0),w=(Q??[]).map(t=>({label:(t.label??"").trim(),value:parseFloat(t.value??"")})).filter(t=>t.label&&Number.isFinite(t.value)),R=(S??[]).map(t=>t.text??"").filter(t=>x||t.trim()),D=(Y??[]).map(t=>({name:(t.name??"").trim(),price:(t.price??"").trim()})).filter(t=>t.name),H=!!(n??"").trim()||!!(l??"").trim(),ee=!!(s??"").trim()||!!(f??"").trim()||y.length>0||v.length>0||N.length>0||k.length>0||w.length>0||D.length>0||R.length>0||!!(A??"").trim();if(!x&&!H&&!ee)return null;const M=r("div",{className:`w-full overflow-hidden rounded-2xl shadow-[0_24px_60px_rgba(0,0,0,0.35)] ${a==="kanban"||a==="browser"||a==="terminal"?"max-w-[600px]":"max-w-[520px]"}`,style:{background:C},children:[a!=="terminal"&&(s??"").trim()&&r("div",{className:"flex items-center justify-between px-6 py-4",style:{background:d},children:[e("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-white",children:s}),(i??"").trim()&&r("span",{className:"flex items-center gap-2 font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-white",children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] rounded-full",style:{background:g}}),i]})]}),a==="terminal"?e(ce,{header:s??"",lines:R}):a==="browser"?e(de,{urlText:V??"",heroTitle:A??"",heroButton:X??"",products:D}):r("div",{className:"flex flex-col gap-5 p-6",children:[((f??"").trim()||(b??"").trim())&&r("div",{children:[(f??"").trim()&&e("div",{className:"text-[22px] font-bold leading-tight",style:{color:d},children:f}),(b??"").trim()&&e("div",{className:"mt-1 text-[14px]",style:{color:o},children:b})]}),a==="fitment"&&y.length>0&&e("div",{className:"flex flex-wrap gap-2.5",children:y.map((t,h)=>r("span",{className:"flex items-baseline gap-2 rounded border px-4 py-2",style:{background:p,borderColor:m},children:[e("span",{className:"text-[11px]",style:{color:o},children:t.label}),e("span",{className:"text-[13px] font-bold",style:{color:d},children:t.value})]},h))}),a!=="fitment"&&v.length>0&&e("div",{className:"grid grid-cols-2 gap-3",children:v.map((t,h)=>r("div",{className:"rounded-lg px-4 py-3",style:{background:p},children:[e("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:t.label}),e("div",{className:"mt-1 text-[17px] font-bold",style:{color:d},children:t.value})]},h))}),N.length>0&&e(re,{rows:N}),(_??"").trim()&&e("div",{className:"self-start rounded-lg px-6 py-2.5 text-[14px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:_}),a==="kanban"&&k.length>0&&e(ne,{columns:k}),a==="claims"&&w.length>0&&e(se,{heading:J??"",bars:w}),(j??"").trim()&&e("div",{className:"border-t pt-4",style:{borderColor:m},children:e("span",{className:"text-[15px] font-bold",style:{color:"var(--accent)"},children:j})})]})]}),B=r("div",{children:[(n??"").trim()&&e("span",{className:"inline-block bg-accent px-3.5 py-1.5 font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-bg",children:te(n??"")}),(l??"").trim()&&e("h2",{className:"mt-5 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:ae(l??"",!1)}),(c??"").trim()&&e("p",{className:"mt-5 max-w-[46ch] text-[15px] leading-relaxed text-fg/65",children:c})]});return e("section",{className:"relative z-[2] border-y border-line bg-surface",children:e("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] items-center gap-14 px-[var(--sf-site-gutter,40px)] py-[76px] min-[960px]:grid-cols-2 max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:Z==="left"?r($,{children:[e("div",{className:"flex justify-center min-[960px]:justify-start",children:M}),B]}):r($,{children:[B,e("div",{className:"flex justify-center min-[960px]:justify-end",children:M})]})})})}export{ie as default};
1
+ import{jsx as e,jsxs as r,Fragment as $}from"react/jsx-runtime";import{renderGold as te,renderHeadline as ae}from"./goldPhrases.js";const C="#ffffff",d="#16181d",o="#5b6470",u="#9aa3ae",p="#f4f6f8",m="#e3e7ec",g="#1f9d55";function re({rows:n}){return e("div",{className:"flex flex-col gap-3",children:n.map((l,c)=>{const a=l.state??"ok",s=a==="no";return r("div",{className:"flex items-center gap-3 rounded-lg border px-4 py-3",style:{background:s?"#fbfbfc":p,borderColor:m},children:[a==="no"?e("span",{"aria-hidden":!0,className:"text-[15px] font-bold",style:{color:u},children:"✕"}):e("span",{"aria-hidden":!0,className:"h-[11px] w-[11px] flex-shrink-0 rounded-full",style:{background:a==="warn"?"var(--accent)":g}}),e("span",{className:"text-[14px] font-semibold",style:{color:s?u:d},children:l.lead}),e("span",{className:"text-[13px]",style:{color:s?u:o},children:l.detail}),(l.status??"").trim()&&e("span",{className:"ml-auto whitespace-nowrap text-[12px] font-bold",style:{color:a==="ok"?g:a==="warn"?"var(--accent)":u},children:l.status})]},c)})})}const I=["#c7cdd5","var(--accent)","#c7cdd5",g];function ne({columns:n}){return e("div",{className:"grid gap-2 rounded-xl p-3",style:{background:p,gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`},children:n.map((l,c)=>r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-baseline justify-between px-1",children:[e("span",{className:"font-mono text-[9px] font-semibold uppercase tracking-[0.14em]",style:{color:o},children:l.title}),e("span",{className:"font-mono text-[9px] font-bold",style:{color:"var(--accent)"},children:l.cards.length})]}),l.cards.map((a,s)=>r("div",{className:"rounded-md border px-2.5 py-2",style:{background:C,borderColor:c===n.length-1?"#bfe3ce":m},children:[e("span",{"aria-hidden":!0,className:"mb-1.5 block h-[8px] w-[8px] rounded-full",style:{background:I[c%I.length]}}),e("span",{className:"block text-[11px] font-semibold leading-snug",style:{color:d},children:a})]},s))]},c))})}function se({heading:n,bars:l}){const c=Math.max(...l.map(s=>s.value),0)||1,a=l.findIndex(s=>s.value===c);return r("div",{className:"border-t pt-4",style:{borderColor:m},children:[n.trim()&&e("div",{className:"mb-3 font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:n}),e("div",{className:"flex flex-col gap-2.5",children:l.map((s,i)=>r("div",{className:"flex items-center gap-3",children:[e("span",{className:"w-[84px] flex-shrink-0 text-[12px] font-bold",style:{color:d},children:s.label}),e("span",{className:"h-[12px] rounded-full",style:{width:`${Math.max(s.value/c*60,4)}%`,background:i===a?"var(--accent)":i%2?"#c7cdd5":"#9aa3ae"}}),r("span",{className:"text-[12px]",style:{color:o},children:[s.value,"%"]})]},i))})]})}function E({size:n}){const l=n/2;return r("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,"aria-hidden":!0,children:[e("circle",{cx:l,cy:l,r:l*.82,fill:"none",stroke:"#9aa3ae",strokeWidth:"2.5"}),e("circle",{cx:l,cy:l,r:l*.5,fill:"none",stroke:"var(--accent)",strokeWidth:"2"}),e("circle",{cx:l,cy:l,r:l*.14,fill:"var(--accent)"})]})}function ce({header:n,lines:l}){return r("div",{style:{background:"#0c0e11"},children:[r("div",{className:"relative flex items-center gap-2 px-4 py-3",style:{background:"#161a20"},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"absolute inset-x-0 text-center font-mono text-[11px]",style:{color:"rgba(244,246,242,0.45)"},children:n})]}),r("div",{className:"flex flex-col gap-1.5 px-5 py-5 font-mono text-[13px] leading-relaxed",children:[l.map((c,a)=>c.startsWith("$ ")?r("div",{children:[e("span",{style:{color:"var(--accent)"},children:"$ "}),e("span",{style:{color:"#f4f6f2"},children:c.slice(2)})]},a):c.startsWith("✓")?e("div",{style:{color:"#6fcf7e"},children:c},a):e("div",{style:{color:"rgba(244,246,242,0.55)"},children:c},a)),e("div",{"aria-hidden":!0,className:"mt-1 h-[15px] w-[8px]",style:{background:"var(--accent)"}})]})]})}function de({urlText:n,heroTitle:l,heroButton:c,products:a}){return r("div",{children:[r("div",{className:"flex items-center gap-2 px-4 py-3",style:{background:p},children:[e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#e85d5d"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#efc65a"}}),e("span",{"aria-hidden":!0,className:"h-[10px] w-[10px] rounded-full",style:{background:"#6fcf7e"}}),n.trim()&&e("span",{className:"mx-auto rounded border px-6 py-1 text-[11px]",style:{background:C,borderColor:m,color:o},children:n}),e("span",{className:"w-[54px]","aria-hidden":!0})]}),r("div",{className:"relative overflow-hidden px-5 py-6",style:{background:d},children:[e("div",{className:"absolute -right-4 top-1/2 -translate-y-1/2 opacity-90",children:e(E,{size:104})}),l.trim()&&e("div",{className:"max-w-[240px] text-[15px] font-bold uppercase leading-snug tracking-wide text-white",children:l}),c.trim()&&e("div",{className:"mt-3 inline-block rounded px-3.5 py-1.5 text-[11px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:c})]}),a.length>0&&e("div",{className:"grid grid-cols-3 gap-3 p-4",children:a.map((s,i)=>r("div",{className:"overflow-hidden rounded-lg border",style:{borderColor:m},children:[e("div",{className:"flex items-center justify-center py-3",style:{background:p},children:e(E,{size:56})}),r("div",{className:"flex flex-col gap-1 p-2.5",children:[e("span",{className:"text-[10.5px] font-bold leading-tight",style:{color:d},children:s.name}),e("span",{className:"text-[11px] font-bold",style:{color:"var(--accent)"},children:s.price}),e("span",{className:"mt-0.5 rounded px-2 py-1 text-center text-[9px] font-bold text-white",style:{background:d},"aria-hidden":!0,children:"Add to cart"})]})]},i))})]})}function ie({eyebrow:n,title:l,body:c,variant:a="spec-card",cardHeader:s,badge:i,cardTitle:f,cardSubtitle:b,pills:F,tiles:W,rows:K,button:_,footnote:j,col1Title:T,col1Cards:G,col2Title:L,col2Cards:O,col3Title:P,col3Cards:z,col4Title:U,col4Cards:q,barsHeading:J,bars:Q,termLines:S,urlText:V,heroTitle:A,heroButton:X,products:Y,align:Z="right",editing:x=!1}={}){const y=(F??[]).filter(t=>x||(t.value??"").trim()),v=(W??[]).filter(t=>x||(t.label??"").trim()),N=(K??[]).filter(t=>x||(t.lead??"").trim()),k=[[T,G],[L,O],[P,z],[U,q]].map(([t,h])=>({title:(t??"").trim(),cards:(h??[]).map(le=>(le.text??"").trim()).filter(Boolean)})).filter(t=>t.title||t.cards.length>0),w=(Q??[]).map(t=>({label:(t.label??"").trim(),value:parseFloat(t.value??"")})).filter(t=>t.label&&Number.isFinite(t.value)),R=(S??[]).map(t=>t.text??"").filter(t=>x||t.trim()),D=(Y??[]).map(t=>({name:(t.name??"").trim(),price:(t.price??"").trim()})).filter(t=>t.name),H=!!(n??"").trim()||!!(l??"").trim(),ee=!!(s??"").trim()||!!(f??"").trim()||y.length>0||v.length>0||N.length>0||k.length>0||w.length>0||D.length>0||R.length>0||!!(A??"").trim();if(!x&&!H&&!ee)return null;const M=r("div",{className:`w-full overflow-hidden rounded-2xl shadow-[0_24px_60px_rgba(0,0,0,0.35)] ${a==="kanban"||a==="browser"||a==="terminal"?"max-w-[600px]":"max-w-[520px]"}`,style:{background:C},children:[a!=="terminal"&&(s??"").trim()&&r("div",{className:"flex items-center justify-between px-6 py-4",style:{background:d},children:[e("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-white",children:s}),(i??"").trim()&&r("span",{className:"flex items-center gap-2 font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-white",children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] rounded-full",style:{background:g}}),i]})]}),a==="terminal"?e(ce,{header:s??"",lines:R}):a==="browser"?e(de,{urlText:V??"",heroTitle:A??"",heroButton:X??"",products:D}):r("div",{className:"flex flex-col gap-5 p-6",children:[((f??"").trim()||(b??"").trim())&&r("div",{children:[(f??"").trim()&&e("div",{className:"text-[22px] font-bold leading-tight",style:{color:d},children:f}),(b??"").trim()&&e("div",{className:"mt-1 text-[14px]",style:{color:o},children:b})]}),a==="fitment"&&y.length>0&&e("div",{className:"flex flex-wrap gap-2.5",children:y.map((t,h)=>r("span",{className:"flex items-baseline gap-2 rounded border px-4 py-2",style:{background:p,borderColor:m},children:[e("span",{className:"text-[11px]",style:{color:o},children:t.label}),e("span",{className:"text-[13px] font-bold",style:{color:d},children:t.value})]},h))}),a!=="fitment"&&v.length>0&&e("div",{className:"grid grid-cols-2 gap-3",children:v.map((t,h)=>r("div",{className:"rounded-lg px-4 py-3",style:{background:p},children:[e("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.18em]",style:{color:o},children:t.label}),e("div",{className:"mt-1 text-[17px] font-bold",style:{color:d},children:t.value})]},h))}),N.length>0&&e(re,{rows:N}),(_??"").trim()&&e("div",{className:"self-start rounded-lg px-6 py-2.5 text-[14px] font-bold text-white",style:{background:"var(--accent)"},"aria-hidden":!0,children:_}),a==="kanban"&&k.length>0&&e(ne,{columns:k}),a==="claims"&&w.length>0&&e(se,{heading:J??"",bars:w}),(j??"").trim()&&e("div",{className:"border-t pt-4",style:{borderColor:m},children:e("span",{className:"text-[15px] font-bold",style:{color:"var(--accent)"},children:j})})]})]}),B=r("div",{children:[(n??"").trim()&&e("span",{className:"inline-block bg-accent px-3.5 py-1.5 font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-bg",children:te(n??"")}),(l??"").trim()&&e("h2",{className:"mt-5 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:ae(l??"",!1)}),(c??"").trim()&&e("p",{className:"mt-5 max-w-[46ch] text-[15px] leading-relaxed text-fg/65",children:c})]});return e("section",{className:"relative z-[2] border-y border-line bg-surface",children:e("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] items-center gap-14 px-[var(--sf-site-gutter,40px)] py-[76px] min-[960px]:grid-cols-2 max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:Z==="left"?r($,{children:[e("div",{className:"flex justify-center min-[960px]:justify-start",children:M}),B]}):r($,{children:[B,e("div",{className:"flex justify-center min-[960px]:justify-end",children:M})]})})})}export{ie as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useCallback as ee,useEffect as q,useMemo as F,useState as c}from"react";import{useStorefrontDocument as te}from"./StorefrontDocumentContext.js";import g from"./UiIcon.js";import se from"./SidePanelHead.js";import{useWebsiteName as ae}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as ne}from"efficient-easel/chrome";import{AddIcon as le}from"efficient-easel/icons";import{PagesIcon as re}from"efficient-easel/rail";import{useEditorHost as oe}from"../lib/editor-host.js";import{bucketEditorPageRows as ie,isDynamicPageRow as ce}from"../lib/editor-page-rows.js";import{useEditorSession as de}from"../lib/editor-session-context.js";const G="sf-editor-pages-collapsed-groups",pe=r=>r.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),M=(r,b)=>{const o=pe(r)||"page";if(!b.has(o))return o;let p=2;for(;b.has(`${o}-${p}`);)p+=1;return`${o}-${p}`};function ue({onNavigate:r,onClose:b,activeSurface:o,onPreviewSurface:p}){const y=de().chrome?.pageRows,D=oe(),{adapter:d,capabilities:w,ready:N,currentSlug:L}=te(),J=ae(),[l,x]=c(null),[C,K]=c(""),[u,k]=c(!1),[v,m]=c(null),[R,h]=c(!1),[f,P]=c(""),S=ee(async()=>{if(N)try{x(await d.listPages())}catch{x([])}},[d,N]);q(()=>{x(null),S()},[S]);const[z,U]=c(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(G);return new Set(e?JSON.parse(e):[])}catch{return new Set}});q(()=>{try{window.localStorage.setItem(G,JSON.stringify([...z]))}catch{}},[z]);const Q=e=>U(s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a}),V=F(()=>ie(l??[]),[l]),$=C.trim().toLowerCase(),O=e=>!$||e.toLowerCase().includes($),Y=e=>$?!0:!z.has(e),j=F(()=>new Set((l??[]).map(e=>e.slug)),[l]),W=()=>{if(w.pageCreationInAdminForm){D.send("storefront-editor:new-page");return}P(""),m(null),h(!0)},B=async()=>{const e=f.trim();if(!(!e||!N||u||!d.createPage)){k(!0),m(null);try{const s=await d.createPage({slug:M(e,j),title:e,layout:{}});await S(),h(!1),P(""),r(s.slug)}catch{m("Couldn\u2019t add the page \u2014 please retry.")}finally{k(!1)}}},T=async e=>{if(!(!N||u||!d.deletePage||(l??[]).length<=1)){k(!0);try{await d.deletePage(e.id);const s=(l??[]).filter(a=>a.id!==e.id);x(s),m(null),e.slug===L&&s[0]&&r(s[0].slug)}catch{m("Couldn\u2019t delete the page \u2014 please retry.")}finally{k(!1)}}},X=e=>D.send("storefront-editor:open-page",{slug:e}),Z=e=>{if(!O(e.label))return null;const s=!o&&e.slug===L,a=w.canDeletePagesInline&&(l??[]).length>1;return n("div",{className:`sf-row sf-prow ${s?"is-selected":""}`,onClick:()=>r(e.slug),children:[t("span",{className:"sf-chip",children:t(me,{})}),t("span",{className:"sf-row-name",children:e.label}),ce(e)&&t("span",{className:"sf-badge-dynamic",children:"Dynamic"}),e.kind==="lightbox"&&t("span",{className:"sf-badge-lightbox",children:"Lightbox"}),e.draft&&t("span",{className:"sf-page-draft",children:"draft"}),w.pageCreationInAdminForm&&t("button",{type:"button",className:"sf-page-edit",title:`Edit \u201C${e.label}\u201D in the admin`,"aria-label":`Edit ${e.label} in the admin`,onClick:i=>{i.stopPropagation(),X(e.slug)},children:t(g,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})}),a&&t("button",{type:"button",className:"sf-page-edit sf-page-edit--danger",disabled:u,title:`Delete \u201C${e.label}\u201D`,"aria-label":`Delete ${e.label}`,onClick:i=>{i.stopPropagation(),T(e)},children:t(g,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]},e.id)},A=(e,s,a)=>{const i=a.filter(Boolean);if(i.length===0)return null;const E=Y(e);return n("div",{className:"sf-pgroup",children:[n("button",{type:"button",className:"sf-pgroup-head","aria-expanded":E,onClick:()=>Q(e),children:[t(g,{name:"chevron-right",size:10,strokeWidth:2.6,rounded:!0,style:{transform:E?"rotate(90deg)":"none",transition:"transform 0.14s"}}),t("span",{className:"sf-pgroup-label",children:s}),t("span",{className:"sf-pgroup-count",children:i.length})]}),E&&t("div",{className:"sf-pgroup-body",children:i})]},e)},H=(y?.rows??[]).filter(e=>O(e.label)).map(e=>{const s=o===e.key;return n("div",{className:`sf-row sf-prow sf-prow--shop ${s?"is-selected":""}`,onClick:()=>p(e.key),title:`Preview the ${e.label} in the canvas`,children:[t("span",{className:"sf-chip",children:e.icon}),t("span",{className:"sf-row-name",children:e.label}),t("span",{className:"sf-badge-preview",children:"Preview"}),t("a",{className:"sf-page-edit",href:e.href,target:"_blank",rel:"noopener noreferrer",title:`Open the ${e.label} in a new tab`,"aria-label":`Open the ${e.label} in a new tab`,onClick:a=>a.stopPropagation(),children:t(g,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})})]},e.key)}),_=w.hasSiteSettings&&!!y,I=(()=>{if(l===null)return null;const e=[];let s=!1;for(const a of V)_&&!s&&a.key.startsWith("system:")&&(e.push(A("shop",y.title,H)),s=!0),e.push(A(a.key,a.label,a.rows.map(Z)));return _&&!s&&e.push(A("shop",y.title,H)),e})();return n("div",{className:"sf-pages",children:[t(se,{icon:t(re,{}),title:"Pages",context:J,actions:t(ne,{label:"New page",onClick:W,children:t(le,{size:15})}),onHide:b}),n("div",{className:"sf-pages-search",children:[t(g,{name:"search",size:14,rounded:!0}),t("input",{type:"search",className:"sf-pages-search-input",placeholder:"Search all pages\u2026",value:C,onChange:e=>K(e.target.value),"aria-label":"Search all pages"})]}),n("div",{className:"sf-pages-list sf-scroll",children:[v&&!R&&t("div",{className:"sf-note sf-note--error",role:"alert",children:v}),I===null?t("div",{className:"sf-note",children:"Loading\u2026"}):I.some(Boolean)?I:t("div",{className:"sf-note",children:C.trim()?"No pages match your search":"No pages yet"})]}),n("button",{type:"button",className:"sf-pages-new",onClick:W,children:[t("span",{className:"sf-plus",children:"+"}),"New page"]}),R&&t("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/30 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"sf-add-page-title",onClick:()=>h(!1),children:n("div",{className:"w-full max-w-sm rounded-lg bg-white p-5 shadow-xl",onClick:e=>e.stopPropagation(),children:[t("h2",{id:"sf-add-page-title",className:"text-[15px] font-semibold text-zinc-900",children:"Add a page"}),t("p",{className:"mt-1 text-[13px] leading-relaxed text-zinc-600",children:"Give the new template page a name. It starts blank \u2014 add sections once it opens."}),t("input",{autoFocus:!0,value:f,onChange:e=>P(e.target.value),onKeyDown:e=>{e.key==="Enter"&&B(),e.key==="Escape"&&h(!1)},placeholder:"e.g. About",className:"mt-3 w-full rounded-md border border-zinc-300 px-3 py-2 text-[13px] text-zinc-900 outline-none focus:border-blue-500"}),f.trim()&&n("p",{className:"mt-1.5 text-[12px] text-zinc-400",children:["URL: /",M(f,j)]}),v&&t("p",{className:"mt-2 text-[12px] text-red-600",role:"alert",children:v}),n("div",{className:"mt-4 flex justify-end gap-2",children:[t("button",{type:"button",onClick:()=>h(!1),className:"rounded-md border border-zinc-300 px-3 py-[7px] text-[13px] font-medium text-zinc-700 transition-colors hover:bg-zinc-100",children:"Cancel"}),t("button",{type:"button",onClick:()=>{B()},disabled:u||!f.trim(),className:"rounded-md bg-blue-600 px-3 py-[7px] text-[13px] font-medium text-white transition-colors hover:bg-blue-700 disabled:opacity-60",children:u?"Adding\u2026":"Add page"})]})]})})]})}function me(){return n("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 3v5h5"})]})}export{ue as default};
1
+ "use client";import{jsx as t,jsxs as a,Fragment as ne}from"react/jsx-runtime";import{useCallback as ae,useEffect as G,useId as re,useMemo as M,useState as c}from"react";import{useStorefrontDocument as oe}from"./StorefrontDocumentContext.js";import f from"./UiIcon.js";import le from"./SidePanelHead.js";import{useWebsiteName as ie}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as ce}from"efficient-easel/chrome";import{Button as J,Dialog as de,FormField as pe,Input as ue,Tooltip as L}from"efficient-shell/ui";import{AddIcon as he}from"efficient-easel/icons";import{PagesIcon as me}from"efficient-easel/rail";import{useEditorHost as fe}from"../lib/editor-host.js";import{bucketEditorPageRows as ge,isDynamicPageRow as be}from"../lib/editor-page-rows.js";import{useEditorSession as we}from"../lib/editor-session-context.js";const K="sf-editor-pages-collapsed-groups",ye=o=>o.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),U=(o,g)=>{const l=ye(o)||"page";if(!g.has(l))return l;let u=2;for(;g.has(`${l}-${u}`);)u+=1;return`${l}-${u}`};function Ne({onNavigate:o,onClose:g,activeSurface:l,onPreviewSurface:u}){const b=we().chrome?.pageRows,R=fe(),{adapter:d,capabilities:w,ready:y,currentSlug:z}=oe(),Q=ie(),[r,N]=c(null),[P,T]=c(""),[p,k]=c(!1),[v,h]=c(null),[O,C]=c(!1),[m,S]=c(""),F=re(),I=ae(async()=>{if(y)try{N(await d.listPages())}catch{N([])}},[d,y]);G(()=>{N(null),I()},[I]);const[$,V]=c(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(K);return new Set(e?JSON.parse(e):[])}catch{return new Set}});G(()=>{try{window.localStorage.setItem(K,JSON.stringify([...$]))}catch{}},[$]);const Y=e=>V(s=>{const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n}),X=M(()=>ge(r??[]),[r]),x=P.trim().toLowerCase(),W=e=>!x||e.toLowerCase().includes(x),Z=e=>x?!0:!$.has(e),B=M(()=>new Set((r??[]).map(e=>e.slug)),[r]),j=()=>{if(w.pageCreationInAdminForm){R.send("storefront-editor:new-page");return}S(""),h(null),C(!0)},H=async()=>{const e=m.trim();if(!(!e||!y||p||!d.createPage)){k(!0),h(null);try{const s=await d.createPage({slug:U(e,B),title:e,layout:{}});await I(),C(!1),S(""),o(s.slug)}catch{h("Couldn’t add the page — please retry.")}finally{k(!1)}}},ee=async e=>{if(!(!y||p||!d.deletePage||(r??[]).length<=1)){k(!0);try{await d.deletePage(e.id);const s=(r??[]).filter(n=>n.id!==e.id);N(s),h(null),e.slug===z&&s[0]&&o(s[0].slug)}catch{h("Couldn’t delete the page — please retry.")}finally{k(!1)}}},te=e=>R.send("storefront-editor:open-page",{slug:e}),se=e=>{if(!W(e.label))return null;const s=!l&&e.slug===z,n=w.canDeletePagesInline&&(r??[]).length>1;return a("div",{className:`sf-row sf-prow ${s?"is-selected":""}`,onClick:()=>o(e.slug),children:[t("span",{className:"sf-chip",children:t(ke,{})}),t("span",{className:"sf-row-name",children:e.label}),be(e)&&t("span",{className:"sf-badge-dynamic",children:"Dynamic"}),e.kind==="lightbox"&&t("span",{className:"sf-badge-lightbox",children:"Lightbox"}),e.draft&&t("span",{className:"sf-page-draft",children:"draft"}),w.pageCreationInAdminForm&&t(L,{content:`Edit “${e.label}” in the admin`,children:t("button",{type:"button",className:"sf-page-edit","aria-label":`Edit ${e.label} in the admin`,onClick:i=>{i.stopPropagation(),te(e.slug)},children:t(f,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})})}),n&&t(L,{content:`Delete “${e.label}”`,children:t("button",{type:"button",className:"sf-page-edit sf-page-edit--danger",disabled:p,"aria-label":`Delete ${e.label}`,onClick:i=>{i.stopPropagation(),ee(e)},children:t(f,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})})]},e.id)},A=(e,s,n)=>{const i=n.filter(Boolean);if(i.length===0)return null;const E=Z(e);return a("div",{className:"sf-pgroup",children:[a("button",{type:"button",className:"sf-pgroup-head","aria-expanded":E,onClick:()=>Y(e),children:[t(f,{name:"chevron-right",size:10,strokeWidth:2.6,rounded:!0,style:{transform:E?"rotate(90deg)":"none",transition:"transform 0.14s"}}),t("span",{className:"sf-pgroup-label",children:s}),t("span",{className:"sf-pgroup-count",children:i.length})]}),E&&t("div",{className:"sf-pgroup-body",children:i})]},e)},_=(b?.rows??[]).filter(e=>W(e.label)).map(e=>{const s=l===e.key;return a("div",{className:`sf-row sf-prow sf-prow--shop ${s?"is-selected":""}`,onClick:()=>u(e.key),children:[t("span",{className:"sf-chip",children:e.icon}),t("span",{className:"sf-row-name",children:e.label}),t("span",{className:"sf-badge-preview",children:"Preview"}),t(L,{content:`Open the ${e.label} in a new tab`,children:t("a",{className:"sf-page-edit",href:e.href,target:"_blank",rel:"noopener noreferrer","aria-label":`Open the ${e.label} in a new tab`,onClick:n=>n.stopPropagation(),children:t(f,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})})})]},e.key)}),q=w.hasSiteSettings&&!!b,D=(()=>{if(r===null)return null;const e=[];let s=!1;for(const n of X)q&&!s&&n.key.startsWith("system:")&&(e.push(A("shop",b.title,_)),s=!0),e.push(A(n.key,n.label,n.rows.map(se)));return q&&!s&&e.push(A("shop",b.title,_)),e})();return a("div",{className:"sf-pages",children:[t(le,{icon:t(me,{}),title:"Pages",context:Q,actions:t(ce,{label:"New page",onClick:j,children:t(he,{size:15})}),onHide:g}),a("div",{className:"sf-pages-search",children:[t(f,{name:"search",size:14,rounded:!0}),t("input",{type:"search",className:"sf-pages-search-input",placeholder:"Search all pages…",value:P,onChange:e=>T(e.target.value),"aria-label":"Search all pages"})]}),a("div",{className:"sf-pages-list sf-scroll",children:[v&&!O&&t("div",{className:"sf-note sf-note--error",role:"alert",children:v}),D===null?t("div",{className:"sf-note",children:"Loading…"}):D.some(Boolean)?D:t("div",{className:"sf-note",children:P.trim()?"No pages match your search":"No pages yet"})]}),a("button",{type:"button",className:"sf-pages-new",onClick:j,children:[t("span",{className:"sf-plus",children:"+"}),"New page"]}),t(de,{open:O,onClose:()=>C(!1),size:"sm",title:"Add a page",description:"Give the new template page a name. It starts blank — add sections once it opens.",footer:a(ne,{children:[t(J,{variant:"secondary",onClick:()=>C(!1),children:"Cancel"}),t(J,{onClick:()=>{H()},disabled:p||!m.trim(),loading:p,children:p?"Adding…":"Add page"})]}),children:t(pe,{label:"Page name",htmlFor:F,hint:m.trim()?`URL: /${U(m,B)}`:void 0,error:v??void 0,children:t(ue,{id:F,value:m,invalid:!!v,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key==="Enter"&&H()},placeholder:"e.g. About"})})})]})}function ke(){return a("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 3v5h5"})]})}export{Ne as default};
@@ -1 +1 @@
1
- import{jsx as r,jsxs as t}from"react/jsx-runtime";function l({label:a,onClear:s,what:e="override"}){return r("button",{type:"button",className:"sf-part-mark",title:`Clear ${e}`,"aria-label":`Clear ${e}: ${a}`,onClick:s,children:r(o,{})})}function o(){return t("svg",{width:"12",height:"12",viewBox:"0 0 16 16","aria-hidden":"true",children:[r("circle",{className:"sf-part-mark-dot",cx:"8",cy:"8",r:"3",fill:"currentColor"}),t("g",{className:"sf-part-mark-arrow",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),r("path",{d:"M13 2.5V5h-2.6"})]})]})}export{l as PartResetDot};
1
+ import{jsx as r,jsxs as t}from"react/jsx-runtime";import{Tooltip as s}from"efficient-shell/ui";function c({label:o,onClear:a,what:e="override"}){return r(s,{content:`Clear ${e}`,children:r("button",{type:"button",className:"sf-part-mark","aria-label":`Clear ${e}: ${o}`,onClick:a,children:r(i,{})})})}function i(){return t("svg",{width:"12",height:"12",viewBox:"0 0 16 16","aria-hidden":"true",children:[r("circle",{className:"sf-part-mark-dot",cx:"8",cy:"8",r:"3",fill:"currentColor"}),t("g",{className:"sf-part-mark-arrow",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),r("path",{d:"M13 2.5V5h-2.6"})]})]})}export{c as PartResetDot};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as r,Fragment as O}from"react/jsx-runtime";import{useEffect as M,useId as _e,useRef as J,useState as Q}from"react";import{PartResetDot as fe}from"./PartResetDot.js";import{FieldSelect as pe,InspectorField as $e}from"efficient-easel/fields";import{SettingsField as me,SettingsGroup as Ae}from"efficient-easel/panel";import{InspectorUpLevel as G}from"efficient-easel/chrome";import{StylesIcon as Le,TextColorIcon as ze,TypeIcon as he}from"efficient-easel/icons";import{useEasel as Be}from"efficient-easel/easel";import{PartInkControl as De}from"./PartInkControl.js";import{PartTextBox as Ve}from"./PartTextBox.js";import ye from"./UiIcon.js";import{usePreviewHeader as Me}from"./PreviewHeaderContext.js";import{usePartStyle as Ge}from"./PreviewPartStyleContext.js";import{readHidable as W,textFieldOffPage as We}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as je}from"../lib/puck/field-markers.js";import{useSectionOps as He}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as Ue,FONT_ROLES as Z,FONT_ROLE_LABELS as ee,fontOption as _}from"../lib/fonts.js";import{isMultilineKind as Ke,partPlaceholder as Xe,typeInPlaceKind as Ye}from"../lib/puck/part-text.js";import{partRowField as qe}from"../lib/puck/part-row-field.js";import{decodePartKey as Je,partPropsWithRowValue as Qe,partRowValue as Ze}from"../lib/puck/part-rows.js";import{PART_WIDTH_MAX as et,propsWithPartStyleValue as te,propsWithoutPartStyle as tt,readPartStyle as ge}from"../lib/puck/part-styles.js";import{partInks as nt}from"../lib/puck/part-inks.js";import{styleKeyForPart as ot,TEXT_KIND_LABELS as st}from"../lib/sections/section-text-kinds.js";import{commitPartText as lt}from"../lib/puck/part-typing.js";import{useEditorHost as rt}from"../lib/editor-host.js";import{SOURCE_LINES as it,SOURCE_ACTIONS as at,SOURCE_ACTION_LABEL as ct,partSourceOf as dt,sourceSlugOf as be}from"../lib/puck/source-bound-parts.js";import{encodePartId as ut,holdsAuthoredText as ft}from"../lib/puck/text-parts.js";import{regionsForSection as pt}from"../lib/sections/section-text-regions.js";import{textRegionOfPartKey as mt}from"../lib/sections/text-regions.js";const ht={400:"Regular",500:"Medium",600:"Semibold",700:"Bold"},Se=[{key:"font",label:"Font",group:"Style"},{key:"color",label:"Color",group:"Style"}],yt=[...new Set(Se.map(e=>e.group))],gt={font:t(he,{}),color:t(ze,{})};function $(e){return e.kind==="role"?ee[e.role]:e.kind==="custom"?"Custom":null}const bt=e=>e.kind==="role"?`role:${e.role}`:e.kind;function St(e){const n=e.role;return n&&Z.includes(n)?{kind:"role",role:n}:null}function xt(e,n){if(!e)return{kind:"unread"};const{faceRole:s,base:l}=e;if(n[s]===l.fontKey)return{kind:"role",role:s};const a=Object.keys(n).filter(c=>n[c]===l.fontKey);return a.length===1?{kind:"role",role:a[0]}:{kind:"custom"}}function ne(e,n,s,l){return St(ge(e,n))??xt(s,l)}function cn(e,n,s,l){return $(ne(e,n,s,l))}function oe(e,n){if(!e.length)return null;const s=n(e[0]);return e.every(l=>n(l)===s)?s:null}function Nt(e){return Object.values(e).filter(n=>n!==void 0).length}function vt(e,n){const s=e.style[n];return n==="color"?s??"":s!==void 0?String(s):e.base.fontKey}function Pt({face:e,base:n,onPick:s}){const[l,a]=Q(!1),c=J(null),h=J(null),y=_e();M(()=>{if(!l)return;const i=T=>{c.current&&!c.current.contains(T.target)&&a(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[l]);const u=e.kind==="role"?e.role:null,v=i=>{s(i),a(!1),h.current?.focus()};return r("div",{className:"sf-part-style-pick",ref:c,children:[r("button",{ref:h,type:"button",className:"sf-part-style-trigger","aria-expanded":l,"aria-controls":y,"aria-label":`Follows ${$(e)??"no style"} \u2014 change`,onClick:()=>a(i=>!i),onKeyDown:i=>{i.key==="Escape"&&l&&(i.preventDefault(),a(!1))},children:[t("span",{className:"sf-part-style-name",style:{fontFamily:n?.fontKey?`var(${_(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:$(e)}),t("span",{className:"sf-part-style-sign","aria-hidden":"true"})]}),l&&r("div",{className:"sf-multi-menu sf-part-style-menu",id:y,role:"listbox",onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),a(!1),h.current?.focus())},children:[r("button",{type:"button",role:"option","aria-selected":u===null,className:`sf-part-style-option${u===null?" is-on":""}`,onClick:()=>v(null),children:[t("span",{className:"sf-part-style-option-name",children:"No style"}),t("span",{className:"sf-note",children:"Section\u2019s own"})]}),Z.map(i=>t("button",{type:"button",role:"option","aria-selected":u===i,className:`sf-part-style-option${u===i?" is-on":""}`,onClick:()=>v(i),children:t("span",{className:"sf-part-style-option-name",style:{fontFamily:`var(--font-role-${i})`},children:ee[i]})},i))]})]})}const j="";function kt({face:e,base:n,onPick:s}){const l=e.kind==="role"?e.role:j,a=[{label:"No style",value:j},...Z.map(c=>({label:ee[c],value:c}))];return t(pe,{ariaLabel:"Style",value:l,options:a,inline:!0,onChange:c=>s(c===j?null:c),renderOption:c=>c.value===j?r(O,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:c.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:"Section\u2019s own"})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${c.value})`},children:c.label}),renderValue:()=>t("span",{style:{fontFamily:n?.fontKey?`var(${_(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:$(e)})})}function wt({parts:e,onEditStyle:n,onClearAll:s,onFollowStyle:l,kindLabel:a}){const h=oe(e,T=>bt(T.face))?e[0].face:null,y=h?$(h):null,u=h&&h.kind!=="unread"?e[0].base:null,v=e.reduce((T,A)=>T+Nt(A.style),0),i=u?_(u.fontKey)?.label:void 0;return r("div",{className:`sf-part-style${v?" has-overrides":""}`,children:[t("div",{className:"sf-part-style-caption",children:"Style"}),e.length>1&&r("div",{className:"sf-part-style-count",children:[e.length," selected"]}),e.length===1&&a&&r("div",{className:"sf-part-style-count",children:[a," \xB7 every row"]}),y&&u?r(O,{children:[l&&h?t(Pt,{face:h,base:u,onPick:l}):t("div",{className:"sf-part-style-name",style:{fontFamily:i?`var(${_(u.fontKey)?.cssVar})`:void 0,fontWeight:u.weight},children:y}),t("div",{className:"sf-part-style-meta",children:[i,`${Math.round(u.sizePx)} px`,ht[u.weight]].filter(Boolean).join(" \xB7 ")})]}):t("div",{className:"sf-part-style-name",children:"Mixed styles"}),r("div",{className:"sf-part-style-top",children:[y?v?r(O,{children:[r("span",{className:"sf-part-chip",children:[v," changed"]}),t("button",{type:"button",className:"sf-part-link",onClick:s,children:"Clear"})]}):t("span",{className:"sf-part-style-state",children:"This text follows the site style."}):t("span",{className:"sf-part-style-state",children:"Changes apply to all selected."}),t("span",{className:"sf-part-style-gap"}),y&&n&&t("button",{type:"button",className:"sf-part-link",onClick:n,children:"Edit"})]})]})}function Tt({sectionName:e,onBack:n,textEditor:s,styleRow:l,children:a}){return r("div",{className:"sf-part-panel",children:[t(G,{inline:!0,name:e,onSelect:n}),s,l,a]})}function xe({source:e,slug:n}){const s=rt(),l=at[e],a=!l.needsSlug||!!n;return t("div",{className:"sf-note sf-note--source",children:r("p",{className:"es-field-hint sf-hint-keep",children:[it[e],a?r(O,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{l.type==="storefront-editor:open-menus"?s.send(l.type):n&&s.send(l.type,{slug:n})},children:ct})]}):null]})})}const Ne=4,Et=120;function Rt({region:e,sizePx:n,face:s,base:l,onFollowStyle:a,source:c,slug:h,onBack:y}){const u=e.follows;return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:e.label})}),r("p",{children:["Its size follows Site styles \u25B8 ",u,n?` \u2014 ${Math.round(n)}px right now`:"","."]}),a?t(O,{children:t(me,{label:"Style",icon:t(Le,{}),hint:r(O,{children:["Every ",e.label.toLowerCase()," in this section follows it. The face and the size change; the letter case is the section\u2019s own and stays as it is."]}),children:t(kt,{face:s,base:l,onPick:a})})}):t("p",{className:"es-field-hint sf-hint-keep",children:"Only the size follows a site style. This section sets its own font, weight and letter case."}),c?t(xe,{source:c,slug:h}):null,t(G,{inline:!0,name:"Page",onSelect:y})]})}function Ct({onBack:e}){return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:"This part is no longer here."})}),t("p",{children:"The section it belonged to has been changed or removed."}),t(G,{inline:!0,name:"Page",onSelect:e})]})}function Ft({onBack:e,partId:n,why:s}){return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:"This part's settings did not open."})}),t("p",{children:"The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead."}),t("p",{className:"sf-note-detail",children:r("code",{children:[n," \u2014 ",s]})}),t(G,{inline:!0,name:"Page",onSelect:e})]})}function Ot({nodeId:e,propKey:n,onBack:s,onEditStyle:l}){const{getItemById:a,getSelectorForId:c,config:h}=Be(o=>o),y=He(),{partStyle:u}=Ge(),{fonts:v}=Me(),[i,T]=Q({}),A=J(null),g=a(e),S=c(e),se=g?h.components[g.type]:void 0,{key:E,row:P}=Je(n),le=se?.fields?.[E],k=P?qe(le,P):le,I=ut(e,n),p=g?.props??{},w=Ye(k),ve=We(k),Pe=ft(k),H=g?dt(g.type):null,U=P?Ze(p[E],P):p[E],re=!!P&&!(Array.isArray(p[E])&&P.index<p[E].length);M(()=>{A.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[I]);const[K,ie]=Q(0);M(()=>ie(0),[I]);const X=!!g&&!re&&(!S||!k);M(()=>{if(!X||K>=Ne)return;const o=setTimeout(()=>ie(d=>d+1),Et);return()=>clearTimeout(o)},[X,K]);const ke=X&&K<Ne;if(!g||re)return t(Ct,{onBack:s});const L=pt(g.type),ae=L?mt(L,n):null;if(L&&ae){const o=u?.partId===I?u:null,d=L[ae],m=d.writable===!0&&!!S,b=f=>{S&&y.replaceComponent(S.zone,S.index,{...g,props:te(p,n,"role",f)})};return t(Rt,{region:d,sizePx:o?.base.sizePx??null,face:ne(p,n,o,v),base:o?.base??null,onFollowStyle:m?b:void 0,source:H,slug:be(p),onBack:s})}if(!S||!k)return ke?t("div",{className:"sf-note","aria-busy":"true"}):t(Ft,{onBack:s,partId:I,why:S?"no field":"no selector"});const z=o=>{y.replaceComponent(S.zone,S.index,{...g,props:o})},Y=o=>{if(W(o).hidden!==W(U).hidden||!w){const m=P?Qe(p,E,P,o):{...p,[E]:o};m&&z(m);return}lt({node:g,propKey:n,kind:w,zone:S.zone,index:S.index},W(o).text,y.replaceComponent)},we=U,B=ot(g?.type,n),Te=ge(p,B),D=u?.partId===I?u:null,x=[{partKey:B,face:ne(p,B,D,v),sizeGroup:D?.sizeGroup??null,base:D?.base??It,style:Te}],Ee=oe(x,o=>o.sizeGroup),ce=nt(D?.inks),V=(o,d)=>{let m=p;for(const b of x)m=te(m,b.partKey,o,d);z(m)},Re=o=>V("role",o),Ce=()=>{let o=p;for(const d of x)o=tt(o,d.partKey);z(o)},Fe=o=>{let d=p;for(const m of x)for(const[b,f]of Object.entries(o))d=te(d,m.partKey,b,f??null);z(d)},Oe=(o,d)=>{const m=x.some(N=>N.style[o]!==void 0),b=oe(x,N=>vt(N,o)),f=b===null,F=`sf-part-${e}-${n}-${o}`;return o==="color"?t(De,{value:f?null:String(b),label:d,colors:ce,onChange:N=>V("color",N)},o):t(me,{label:d,icon:gt[o],className:"sf-part-field",changed:m,htmlFor:F,action:m?t(fe,{label:d,onClear:()=>V(o,null)}):void 0,children:o==="font"?t(pe,{id:F,ariaLabel:d,value:!f&&_(String(b))?String(b):void 0,placeholder:f?"Mixed":"Site style",options:Ue.map(N=>({label:N.label,value:N.key})),onChange:N=>V("font",N||null)}):null},o)},de=w==="text"||w==="textarea",{text:ue,hidden:R}=W(U),C=k?.[je]?.label??n,Ie=r("div",{className:"sf-field-head",children:[t(he,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:C}),de&&t("button",{type:"button",className:"sf-field-eye","aria-pressed":R,"aria-label":R?`Show ${C} on the slide`:`Hide ${C} on the slide`,title:R?`Show ${C} on the slide`:`Hide ${C} on the slide`,onClick:()=>Y({text:ue,hidden:!R}),children:R?t(ye,{name:"eye-off",size:14}):t(ye,{name:"eye",size:14})})]}),q=!ve&&Pe;return r(Tt,{sectionName:se?.label??g.type,onBack:s,textEditor:r("div",{ref:A,className:"sf-part-text",children:[w?t(Ve,{text:ue,onTextChange:o=>Y(de?{text:o,hidden:R}:o),multiline:Ke(w),markup:w!=="plainText",styled:q,style:x[0].style,base:x[0].base,setValue:Fe,colors:ce.map(o=>({name:o.key,label:o.name,value:o.value})),placeholder:Xe(k),ariaLabel:C,head:Ie}):t($e,{field:k,name:n,value:we,onChange:Y,id:`sf-part-${e}-${n}`}),q&&w&&Ee===null&&t("p",{className:"es-field-hint sf-hint-keep",children:"Fixed size \u2014 the site\u2019s Text setting doesn\u2019t resize this."})]}),children:[H&&t(xe,{source:H,slug:be(p)}),q&&yt.map(o=>{const d=Se.filter(f=>f.group===o),m=d.filter(f=>x.some(F=>F.style[f.key]!==void 0)).length,b=`sf-part-g-${e}-${n}-${o.replace(/\W+/g,"-")}`;return r(Ae,{id:b,title:o,open:i[o]!==!0,onToggle:f=>T(F=>({...F,[o]:!f})),count:m,children:[t(wt,{parts:x,onEditStyle:l,onClearAll:Ce,onFollowStyle:Re,kindLabel:st[B]}),d.map(f=>Oe(f.key,f.label))]},o)})]})}const It={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:et};export{Se as PART_FIELDS,Tt as PartPanelBody,fe as PartResetDot,xe as PartSourceNote,wt as PartStyleCard,kt as PartStyleSelect,Ot as default,ne as partFace,cn as partStyleName};
1
+ "use client";import{jsx as t,jsxs as r,Fragment as O}from"react/jsx-runtime";import{useEffect as M,useId as _e,useRef as J,useState as Q}from"react";import{PartResetDot as fe}from"./PartResetDot.js";import{FieldSelect as pe,InspectorField as $e}from"efficient-easel/fields";import{SettingsField as me,SettingsGroup as Ae}from"efficient-easel/panel";import{InspectorUpLevel as G}from"efficient-easel/chrome";import{StylesIcon as Le,TextColorIcon as ze,TypeIcon as he}from"efficient-easel/icons";import{useEasel as Be}from"efficient-easel/easel";import{Tooltip as De}from"efficient-shell/ui";import{PartInkControl as Ve}from"./PartInkControl.js";import{PartTextBox as Me}from"./PartTextBox.js";import ye from"./UiIcon.js";import{usePreviewHeader as Ge}from"./PreviewHeaderContext.js";import{usePartStyle as We}from"./PreviewPartStyleContext.js";import{readHidable as W,textFieldOffPage as je}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as He}from"../lib/puck/field-markers.js";import{useSectionOps as Ue}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as Ke,FONT_ROLES as Z,FONT_ROLE_LABELS as ee,fontOption as _}from"../lib/fonts.js";import{isMultilineKind as Xe,partPlaceholder as Ye,typeInPlaceKind as qe}from"../lib/puck/part-text.js";import{partRowField as Je}from"../lib/puck/part-row-field.js";import{decodePartKey as Qe,partPropsWithRowValue as Ze,partRowValue as et}from"../lib/puck/part-rows.js";import{PART_WIDTH_MAX as tt,propsWithPartStyleValue as te,propsWithoutPartStyle as nt,readPartStyle as ge}from"../lib/puck/part-styles.js";import{partInks as ot}from"../lib/puck/part-inks.js";import{styleKeyForPart as st,TEXT_KIND_LABELS as lt}from"../lib/sections/section-text-kinds.js";import{commitPartText as rt}from"../lib/puck/part-typing.js";import{useEditorHost as it}from"../lib/editor-host.js";import{SOURCE_LINES as at,SOURCE_ACTIONS as ct,SOURCE_ACTION_LABEL as dt,partSourceOf as ut,sourceSlugOf as be}from"../lib/puck/source-bound-parts.js";import{encodePartId as ft,holdsAuthoredText as pt}from"../lib/puck/text-parts.js";import{regionsForSection as mt}from"../lib/sections/section-text-regions.js";import{textRegionOfPartKey as ht}from"../lib/sections/text-regions.js";const yt={400:"Regular",500:"Medium",600:"Semibold",700:"Bold"},Se=[{key:"font",label:"Font",group:"Style"},{key:"color",label:"Color",group:"Style"}],gt=[...new Set(Se.map(e=>e.group))],bt={font:t(he,{}),color:t(ze,{})};function $(e){return e.kind==="role"?ee[e.role]:e.kind==="custom"?"Custom":null}const St=e=>e.kind==="role"?`role:${e.role}`:e.kind;function xt(e){const n=e.role;return n&&Z.includes(n)?{kind:"role",role:n}:null}function Nt(e,n){if(!e)return{kind:"unread"};const{faceRole:s,base:l}=e;if(n[s]===l.fontKey)return{kind:"role",role:s};const a=Object.keys(n).filter(c=>n[c]===l.fontKey);return a.length===1?{kind:"role",role:a[0]}:{kind:"custom"}}function ne(e,n,s,l){return xt(ge(e,n))??Nt(s,l)}function un(e,n,s,l){return $(ne(e,n,s,l))}function oe(e,n){if(!e.length)return null;const s=n(e[0]);return e.every(l=>n(l)===s)?s:null}function vt(e){return Object.values(e).filter(n=>n!==void 0).length}function Pt(e,n){const s=e.style[n];return n==="color"?s??"":s!==void 0?String(s):e.base.fontKey}function kt({face:e,base:n,onPick:s}){const[l,a]=Q(!1),c=J(null),h=J(null),y=_e();M(()=>{if(!l)return;const i=T=>{c.current&&!c.current.contains(T.target)&&a(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[l]);const u=e.kind==="role"?e.role:null,v=i=>{s(i),a(!1),h.current?.focus()};return r("div",{className:"sf-part-style-pick",ref:c,children:[r("button",{ref:h,type:"button",className:"sf-part-style-trigger","aria-expanded":l,"aria-controls":y,"aria-label":`Follows ${$(e)??"no style"} — change`,onClick:()=>a(i=>!i),onKeyDown:i=>{i.key==="Escape"&&l&&(i.preventDefault(),a(!1))},children:[t("span",{className:"sf-part-style-name",style:{fontFamily:n?.fontKey?`var(${_(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:$(e)}),t("span",{className:"sf-part-style-sign","aria-hidden":"true"})]}),l&&r("div",{className:"sf-multi-menu sf-part-style-menu",id:y,role:"listbox",onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),a(!1),h.current?.focus())},children:[r("button",{type:"button",role:"option","aria-selected":u===null,className:`sf-part-style-option${u===null?" is-on":""}`,onClick:()=>v(null),children:[t("span",{className:"sf-part-style-option-name",children:"No style"}),t("span",{className:"sf-note",children:"Section’s own"})]}),Z.map(i=>t("button",{type:"button",role:"option","aria-selected":u===i,className:`sf-part-style-option${u===i?" is-on":""}`,onClick:()=>v(i),children:t("span",{className:"sf-part-style-option-name",style:{fontFamily:`var(--font-role-${i})`},children:ee[i]})},i))]})]})}const j="";function wt({face:e,base:n,onPick:s}){const l=e.kind==="role"?e.role:j,a=[{label:"No style",value:j},...Z.map(c=>({label:ee[c],value:c}))];return t(pe,{ariaLabel:"Style",value:l,options:a,inline:!0,onChange:c=>s(c===j?null:c),renderOption:c=>c.value===j?r(O,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:c.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:"Section’s own"})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${c.value})`},children:c.label}),renderValue:()=>t("span",{style:{fontFamily:n?.fontKey?`var(${_(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:$(e)})})}function Tt({parts:e,onEditStyle:n,onClearAll:s,onFollowStyle:l,kindLabel:a}){const h=oe(e,T=>St(T.face))?e[0].face:null,y=h?$(h):null,u=h&&h.kind!=="unread"?e[0].base:null,v=e.reduce((T,A)=>T+vt(A.style),0),i=u?_(u.fontKey)?.label:void 0;return r("div",{className:`sf-part-style${v?" has-overrides":""}`,children:[t("div",{className:"sf-part-style-caption",children:"Style"}),e.length>1&&r("div",{className:"sf-part-style-count",children:[e.length," selected"]}),e.length===1&&a&&r("div",{className:"sf-part-style-count",children:[a," · every row"]}),y&&u?r(O,{children:[l&&h?t(kt,{face:h,base:u,onPick:l}):t("div",{className:"sf-part-style-name",style:{fontFamily:i?`var(${_(u.fontKey)?.cssVar})`:void 0,fontWeight:u.weight},children:y}),t("div",{className:"sf-part-style-meta",children:[i,`${Math.round(u.sizePx)} px`,yt[u.weight]].filter(Boolean).join(" · ")})]}):t("div",{className:"sf-part-style-name",children:"Mixed styles"}),r("div",{className:"sf-part-style-top",children:[y?v?r(O,{children:[r("span",{className:"sf-part-chip",children:[v," changed"]}),t("button",{type:"button",className:"sf-part-link",onClick:s,children:"Clear"})]}):t("span",{className:"sf-part-style-state",children:"This text follows the site style."}):t("span",{className:"sf-part-style-state",children:"Changes apply to all selected."}),t("span",{className:"sf-part-style-gap"}),y&&n&&t("button",{type:"button",className:"sf-part-link",onClick:n,children:"Edit"})]})]})}function Et({sectionName:e,onBack:n,textEditor:s,styleRow:l,children:a}){return r("div",{className:"sf-part-panel",children:[t(G,{inline:!0,name:e,onSelect:n}),s,l,a]})}function xe({source:e,slug:n}){const s=it(),l=ct[e],a=!l.needsSlug||!!n;return t("div",{className:"sf-note sf-note--source",children:r("p",{className:"es-field-hint sf-hint-keep",children:[at[e],a?r(O,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{l.type==="storefront-editor:open-menus"?s.send(l.type):n&&s.send(l.type,{slug:n})},children:dt})]}):null]})})}const Ne=4,Rt=120;function Ct({region:e,sizePx:n,face:s,base:l,onFollowStyle:a,source:c,slug:h,onBack:y}){const u=e.follows;return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:e.label})}),r("p",{children:["Its size follows Site styles ▸ ",u,n?` — ${Math.round(n)}px right now`:"","."]}),a?t(O,{children:t(me,{label:"Style",icon:t(Le,{}),hint:r(O,{children:["Every ",e.label.toLowerCase()," in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is."]}),children:t(wt,{face:s,base:l,onPick:a})})}):t("p",{className:"es-field-hint sf-hint-keep",children:"Only the size follows a site style. This section sets its own font, weight and letter case."}),c?t(xe,{source:c,slug:h}):null,t(G,{inline:!0,name:"Page",onSelect:y})]})}function Ft({onBack:e}){return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:"This part is no longer here."})}),t("p",{children:"The section it belonged to has been changed or removed."}),t(G,{inline:!0,name:"Page",onSelect:e})]})}function Ot({onBack:e,partId:n,why:s}){return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:"This part's settings did not open."})}),t("p",{children:"The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead."}),t("p",{className:"sf-note-detail",children:r("code",{children:[n," — ",s]})}),t(G,{inline:!0,name:"Page",onSelect:e})]})}function It({nodeId:e,propKey:n,onBack:s,onEditStyle:l}){const{getItemById:a,getSelectorForId:c,config:h}=Be(o=>o),y=Ue(),{partStyle:u}=We(),{fonts:v}=Ge(),[i,T]=Q({}),A=J(null),g=a(e),S=c(e),se=g?h.components[g.type]:void 0,{key:E,row:P}=Qe(n),le=se?.fields?.[E],k=P?Je(le,P):le,I=ft(e,n),p=g?.props??{},w=qe(k),ve=je(k),Pe=pt(k),H=g?ut(g.type):null,U=P?et(p[E],P):p[E],re=!!P&&!(Array.isArray(p[E])&&P.index<p[E].length);M(()=>{A.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[I]);const[K,ie]=Q(0);M(()=>ie(0),[I]);const X=!!g&&!re&&(!S||!k);M(()=>{if(!X||K>=Ne)return;const o=setTimeout(()=>ie(d=>d+1),Rt);return()=>clearTimeout(o)},[X,K]);const ke=X&&K<Ne;if(!g||re)return t(Ft,{onBack:s});const L=mt(g.type),ae=L?ht(L,n):null;if(L&&ae){const o=u?.partId===I?u:null,d=L[ae],m=d.writable===!0&&!!S,b=f=>{S&&y.replaceComponent(S.zone,S.index,{...g,props:te(p,n,"role",f)})};return t(Ct,{region:d,sizePx:o?.base.sizePx??null,face:ne(p,n,o,v),base:o?.base??null,onFollowStyle:m?b:void 0,source:H,slug:be(p),onBack:s})}if(!S||!k)return ke?t("div",{className:"sf-note","aria-busy":"true"}):t(Ot,{onBack:s,partId:I,why:S?"no field":"no selector"});const z=o=>{y.replaceComponent(S.zone,S.index,{...g,props:o})},Y=o=>{if(W(o).hidden!==W(U).hidden||!w){const m=P?Ze(p,E,P,o):{...p,[E]:o};m&&z(m);return}rt({node:g,propKey:n,kind:w,zone:S.zone,index:S.index},W(o).text,y.replaceComponent)},we=U,B=st(g?.type,n),Te=ge(p,B),D=u?.partId===I?u:null,x=[{partKey:B,face:ne(p,B,D,v),sizeGroup:D?.sizeGroup??null,base:D?.base??_t,style:Te}],Ee=oe(x,o=>o.sizeGroup),ce=ot(D?.inks),V=(o,d)=>{let m=p;for(const b of x)m=te(m,b.partKey,o,d);z(m)},Re=o=>V("role",o),Ce=()=>{let o=p;for(const d of x)o=nt(o,d.partKey);z(o)},Fe=o=>{let d=p;for(const m of x)for(const[b,f]of Object.entries(o))d=te(d,m.partKey,b,f??null);z(d)},Oe=(o,d)=>{const m=x.some(N=>N.style[o]!==void 0),b=oe(x,N=>Pt(N,o)),f=b===null,F=`sf-part-${e}-${n}-${o}`;return o==="color"?t(Ve,{value:f?null:String(b),label:d,colors:ce,onChange:N=>V("color",N)},o):t(me,{label:d,icon:bt[o],className:"sf-part-field",changed:m,htmlFor:F,action:m?t(fe,{label:d,onClear:()=>V(o,null)}):void 0,children:o==="font"?t(pe,{id:F,ariaLabel:d,value:!f&&_(String(b))?String(b):void 0,placeholder:f?"Mixed":"Site style",options:Ke.map(N=>({label:N.label,value:N.key})),onChange:N=>V("font",N||null)}):null},o)},de=w==="text"||w==="textarea",{text:ue,hidden:R}=W(U),C=k?.[He]?.label??n,Ie=r("div",{className:"sf-field-head",children:[t(he,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:C}),de&&t(De,{content:R?`Show ${C} on the slide`:`Hide ${C} on the slide`,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":R,"aria-label":R?`Show ${C} on the slide`:`Hide ${C} on the slide`,onClick:()=>Y({text:ue,hidden:!R}),children:R?t(ye,{name:"eye-off",size:14}):t(ye,{name:"eye",size:14})})})]}),q=!ve&&Pe;return r(Et,{sectionName:se?.label??g.type,onBack:s,textEditor:r("div",{ref:A,className:"sf-part-text",children:[w?t(Me,{text:ue,onTextChange:o=>Y(de?{text:o,hidden:R}:o),multiline:Xe(w),markup:w!=="plainText",styled:q,style:x[0].style,base:x[0].base,setValue:Fe,colors:ce.map(o=>({name:o.key,label:o.name,value:o.value})),placeholder:Ye(k),ariaLabel:C,head:Ie}):t($e,{field:k,name:n,value:we,onChange:Y,id:`sf-part-${e}-${n}`}),q&&w&&Ee===null&&t("p",{className:"es-field-hint sf-hint-keep",children:"Fixed size — the site’s Text setting doesn’t resize this."})]}),children:[H&&t(xe,{source:H,slug:be(p)}),q&&gt.map(o=>{const d=Se.filter(f=>f.group===o),m=d.filter(f=>x.some(F=>F.style[f.key]!==void 0)).length,b=`sf-part-g-${e}-${n}-${o.replace(/\W+/g,"-")}`;return r(Ae,{id:b,title:o,open:i[o]!==!0,onToggle:f=>T(F=>({...F,[o]:!f})),count:m,children:[t(Tt,{parts:x,onEditStyle:l,onClearAll:Ce,onFollowStyle:Re,kindLabel:lt[B]}),d.map(f=>Oe(f.key,f.label))]},o)})]})}const _t={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:tt};export{Se as PART_FIELDS,Et as PartPanelBody,fe as PartResetDot,xe as PartSourceNote,Tt as PartStyleCard,wt as PartStyleSelect,It as default,ne as partFace,un as partStyleName};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as l}from"react/jsx-runtime";import{SiteLink as d}from"../lib/site-runtime.js";import{boxDarkenStyle as p,boxPlacementClasses as N,CARD_SHADOW_CLASS as L}from"../lib/content/box-background.js";import c from"./Placeholder.js";import{renderGold as r,renderHeadline as s}from"./goldPhrases.js";const y=[{label:"Card",value:"card"},{label:"Photo behind the words",value:"cover"}],P="card",k={min:200,max:700,step:10,fallback:330,unit:"px"};function z({post:e,scaffold:n=!1,layout:m,showCover:o=!0,placement:x,darken:h,darkenStyle:g,href:f,minHeight:v}){const t=f||(n?"#":`/journal/${e.slug}`),b=m==="cover",u=(e.meta||e.dateLabel||e.read)&&l("div",{className:"flex gap-3.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:[e.meta&&a("span",{className:"text-accent",children:r(e.meta)}),e.dateLabel&&a("span",{children:r(e.dateLabel)}),e.read&&a("span",{children:r(e.read)})]});if(b){const i=p(h,g);return l(d,{href:t,className:`${L} group relative isolate flex overflow-hidden`,style:{minHeight:`${v??k.fallback}px`},"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[a("div",{className:"absolute inset-0",children:a(c,{label:`post-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 100vw, 56vw"})}),i&&a("div",{className:"absolute inset-0 z-0",style:i,"aria-hidden":!0}),l("div",{className:`relative z-[1] flex w-full flex-col gap-2 p-8 text-overlay-fg max-[800px]:p-5 ${N(x??"bottom-left","column")}`,children:[e.meta&&a("div",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-accent",children:r(e.meta)}),a("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,30px)] font-medium leading-[1.2] tracking-[-0.02em]",children:s(e.title,!1)}),e.excerpt&&a("p",{className:"max-w-[46ch] text-[length:var(--size-body,14px)] leading-[1.55] opacity-80",children:r(e.excerpt)}),(e.dateLabel||e.read)&&l("div",{className:"flex gap-3.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] opacity-75",children:[e.dateLabel&&a("span",{children:r(e.dateLabel)}),e.read&&a("span",{children:r(e.read)})]})]})]})}return l(d,{href:t,style:{"--card-bg":"var(--surface)","--card-bg-hover":"var(--surface-2)"},className:"sf-card sf-card-fill group block bg-[var(--card-bg)] transition-colors duration-300 hover:bg-[var(--card-bg-hover)]","aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[o&&a("div",{className:"sf-card-image relative aspect-[16/10] overflow-hidden bg-bg",children:a(c,{label:`event-${e.slug}`,src:e.cover||void 0})}),l("div",{className:"flex flex-col gap-2.5 px-7 pb-8 pt-6",children:[u,a("h3",{className:"mt-1 font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.2] tracking-[-0.02em]",children:s(e.title,!1)}),e.excerpt&&a("p",{className:"text-[length:var(--size-body,14px)] leading-[1.55] text-fg-dim",children:r(e.excerpt)}),l("span",{className:"mt-1.5 inline-flex items-center gap-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] transition-colors group-hover:text-accent",children:["Read more",a("span",{"aria-hidden":!0,children:"\u2192"})]})]})]})}export{k as POST_CARD_HEIGHT,y as POST_CARD_LAYOUTS,P as POST_CARD_LAYOUT_FALLBACK,z as default};
1
+ import{jsx as a,jsxs as l}from"react/jsx-runtime";import{SiteLink as d}from"../lib/site-runtime.js";import{boxDarkenStyle as p,boxPlacementClasses as N,CARD_SHADOW_CLASS as L}from"../lib/content/box-background.js";import c from"./Placeholder.js";import{renderGold as r,renderHeadline as s}from"./goldPhrases.js";const y=[{label:"Card",value:"card"},{label:"Photo behind the words",value:"cover"}],P="card",k={min:200,max:700,step:10,fallback:330,unit:"px"};function z({post:e,scaffold:n=!1,layout:m,showCover:o=!0,placement:x,darken:h,darkenStyle:g,href:f,minHeight:v}){const t=f||(n?"#":`/journal/${e.slug}`),b=m==="cover",u=(e.meta||e.dateLabel||e.read)&&l("div",{className:"flex gap-3.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:[e.meta&&a("span",{className:"text-accent",children:r(e.meta)}),e.dateLabel&&a("span",{children:r(e.dateLabel)}),e.read&&a("span",{children:r(e.read)})]});if(b){const i=p(h,g);return l(d,{href:t,className:`${L} group relative isolate flex overflow-hidden`,style:{minHeight:`${v??k.fallback}px`},"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[a("div",{className:"absolute inset-0",children:a(c,{label:`post-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 100vw, 56vw"})}),i&&a("div",{className:"absolute inset-0 z-0",style:i,"aria-hidden":!0}),l("div",{className:`relative z-[1] flex w-full flex-col gap-2 p-8 text-overlay-fg max-[800px]:p-5 ${N(x??"bottom-left","column")}`,children:[e.meta&&a("div",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-accent",children:r(e.meta)}),a("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,30px)] font-medium leading-[1.2] tracking-[-0.02em]",children:s(e.title,!1)}),e.excerpt&&a("p",{className:"max-w-[46ch] text-[length:var(--size-body,14px)] leading-[1.55] opacity-80",children:r(e.excerpt)}),(e.dateLabel||e.read)&&l("div",{className:"flex gap-3.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] opacity-75",children:[e.dateLabel&&a("span",{children:r(e.dateLabel)}),e.read&&a("span",{children:r(e.read)})]})]})]})}return l(d,{href:t,style:{"--card-bg":"var(--surface)","--card-bg-hover":"var(--surface-2)"},className:"sf-card sf-card-fill group block bg-[var(--card-bg)] transition-colors duration-300 hover:bg-[var(--card-bg-hover)]","aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[o&&a("div",{className:"sf-card-image relative aspect-[16/10] overflow-hidden bg-bg",children:a(c,{label:`event-${e.slug}`,src:e.cover||void 0})}),l("div",{className:"flex flex-col gap-2.5 px-7 pb-8 pt-6",children:[u,a("h3",{className:"mt-1 font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.2] tracking-[-0.02em]",children:s(e.title,!1)}),e.excerpt&&a("p",{className:"text-[length:var(--size-body,14px)] leading-[1.55] text-fg-dim",children:r(e.excerpt)}),l("span",{className:"mt-1.5 inline-flex items-center gap-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] transition-colors group-hover:text-accent",children:["Read more",a("span",{"aria-hidden":!0,children:"→"})]})]})]})}export{k as POST_CARD_HEIGHT,y as POST_CARD_LAYOUTS,P as POST_CARD_LAYOUT_FALLBACK,z as default};
@@ -1 +1 @@
1
- import{jsx as t,Fragment as G,jsxs as r}from"react/jsx-runtime";import{sectionRunsFullWidth as I}from"../lib/content/section-width.js";import{cardImageShapeTokens as R}from"../lib/content/card-image-shape.js";import{SiteLink as A}from"../lib/site-runtime.js";import E from"./EditorialSectionHead.js";import D from"./Placeholder.js";import{withRMark as l}from"./RMark.js";import{renderGold as n}from"./goldPhrases.js";const y={2:"grid-cols-2 max-[900px]:grid-cols-1",3:"grid-cols-3 max-[1100px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1"},d="sf-itc-boxes",N="sf-itc-steps";function H({num:z,title:x,description:g,boxes:m,steps:k,columns:S=3,cta:p,padTop:f,padBottom:h,editing:w=!1,omitHead:$=!1,cardImage:C,cardText:L,..._}){const j=typeof f=="number"?f:120,F=typeof h=="number"?h:120,b=(k??[]).filter(e=>(e?.tag??"").trim()||(e?.meta??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.image??"").trim()||(e?.specs??[]).some(o=>(o?.label??"").trim()||(o?.value??"").trim())),u=b.length>0?b:w&&!m?[{tag:"Column 1"},{tag:"Column 2"},{tag:"Column 3"}]:[],v=y[S]??y[3],i=L==="on-image";return r("section",{className:I(_)?"relative z-[2] border-b border-line bg-bg px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":"relative z-[2] mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line bg-bg px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",style:{paddingTop:j,paddingBottom:F,...R(C)},children:[$?null:t(E,{num:z,title:x?.trim()?n(x,!0):void 0,desc:g?.trim()?n(g,!1):void 0}),m?r(G,{children:[t("style",{children:`.${d}:empty{display:none}.${d}:not(:empty)~.${N}{display:none}`}),t(m,{className:`${d} sf-card grid ${v} gap-[2px] border border-line bg-line [&>*]:min-h-[560px] [&>*]:bg-bg`,minEmptyHeight:260})]}):null,u.length>0&&t("div",{className:`${N} sf-card grid ${v} gap-[2px] border border-line bg-line`,children:u.map((e,o)=>{const s=(e.specs??[]).filter(a=>(a?.label??"").trim()||(a?.value??"").trim());return r("article",{className:i?"flex flex-col bg-bg":"flex min-h-[560px] flex-col bg-bg",children:[r("div",{className:i?"sf-card-image relative aspect-[5/3] overflow-hidden bg-surface max-[700px]:aspect-[4/3]":"sf-card-image relative aspect-[5/3] overflow-hidden border-b border-line bg-surface",children:[t(D,{label:e.tag?.trim()||e.title?.trim()||`column-${o+1}`,src:e.image||void 0,sizes:"(max-width: 1100px) 100vw, 33vw",...m?{deferFetch:!0}:{}}),t("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg, rgba(10,10,10,0.55) 0%, transparent 30%, transparent 70%, rgba(10,10,10,0.65) 100%)"}}),i&&t("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 z-[1] h-[78%]",style:{background:"linear-gradient(180deg, transparent 0%, rgba(10,10,10,0.73) 55%, rgba(10,10,10,0.92) 100%)"}}),e.tag?.trim()&&t("span",{className:"absolute left-5 top-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:l(e.tag)}),e.meta?.trim()&&t("span",{className:i?"absolute right-5 top-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-overlay-fg/80":"absolute right-5 bottom-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-overlay-fg/80",children:l(e.meta)}),i&&(e.title?.trim()||e.copy?.trim())&&r("div",{className:"absolute inset-x-0 bottom-0 z-[2] flex flex-col gap-2.5 px-8 pb-7 pt-14 max-[700px]:px-6 max-[700px]:pb-6",children:[e.title?.trim()&&t("h3",{className:"flex min-h-[2em] flex-col justify-end font-heading3 text-[length:var(--size-headingSmall,28px)] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg max-[700px]:text-[length:var(--size-headingSmall,26px)]",children:n(e.title,!0)}),e.copy?.trim()&&t("p",{className:"min-h-[3em] font-display text-[length:var(--size-body,15px)] leading-[1.5] text-overlay-fg/85",children:n(e.copy,!1)})]})]}),i?s.length>0&&t("div",{className:"grid grid-cols-2 gap-2 border-t border-line px-8 py-7 max-[700px]:px-6 max-[700px]:py-6",children:s.map((a,c)=>r("div",{className:"flex flex-col gap-1",children:[a.label?.trim()&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-fg-dim",children:l(a.label)}),a.value?.trim()&&t("span",{className:"font-display text-[length:var(--size-body,18px)] font-medium tracking-[-0.01em] text-fg",children:l(a.value)})]},c))}):r("div",{className:"flex flex-1 flex-col gap-4 px-8 py-9 max-[700px]:px-6 max-[700px]:py-7",children:[e.title?.trim()&&t("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,34px)] font-medium uppercase leading-none tracking-[-0.02em] max-[700px]:text-[length:var(--size-headingSmall,28px)]",children:n(e.title,!0)}),e.copy?.trim()&&t("p",{className:"font-display text-[length:var(--size-body,15px)] leading-[1.55] text-fg-dim",children:n(e.copy,!1)}),s.length>0&&t("div",{className:"mt-auto grid grid-cols-2 gap-2 border-t border-line pt-4",children:s.map((a,c)=>r("div",{className:"flex flex-col gap-1",children:[a.label?.trim()&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-fg-dim",children:l(a.label)}),a.value?.trim()&&t("span",{className:"font-display text-[length:var(--size-body,18px)] font-medium tracking-[-0.01em] text-fg",children:l(a.value)})]},c))})]})]},o)})}),p?.text&&t("div",{className:"mt-12 flex justify-end border-t border-line pt-8",children:r(A,{href:p.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(p.text),t("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"\u2192"})]})})]})}export{H as default};
1
+ import{jsx as t,Fragment as G,jsxs as r}from"react/jsx-runtime";import{sectionRunsFullWidth as I}from"../lib/content/section-width.js";import{cardImageShapeTokens as R}from"../lib/content/card-image-shape.js";import{SiteLink as A}from"../lib/site-runtime.js";import E from"./EditorialSectionHead.js";import D from"./Placeholder.js";import{withRMark as l}from"./RMark.js";import{renderGold as n}from"./goldPhrases.js";const y={2:"grid-cols-2 max-[900px]:grid-cols-1",3:"grid-cols-3 max-[1100px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1"},d="sf-itc-boxes",N="sf-itc-steps";function H({num:z,title:x,description:g,boxes:m,steps:k,columns:S=3,cta:p,padTop:f,padBottom:h,editing:w=!1,omitHead:$=!1,cardImage:C,cardText:L,..._}){const j=typeof f=="number"?f:120,F=typeof h=="number"?h:120,b=(k??[]).filter(e=>(e?.tag??"").trim()||(e?.meta??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.image??"").trim()||(e?.specs??[]).some(o=>(o?.label??"").trim()||(o?.value??"").trim())),u=b.length>0?b:w&&!m?[{tag:"Column 1"},{tag:"Column 2"},{tag:"Column 3"}]:[],v=y[S]??y[3],i=L==="on-image";return r("section",{className:I(_)?"relative z-[2] border-b border-line bg-bg px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":"relative z-[2] mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line bg-bg px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",style:{paddingTop:j,paddingBottom:F,...R(C)},children:[$?null:t(E,{num:z,title:x?.trim()?n(x,!0):void 0,desc:g?.trim()?n(g,!1):void 0}),m?r(G,{children:[t("style",{children:`.${d}:empty{display:none}.${d}:not(:empty)~.${N}{display:none}`}),t(m,{className:`${d} sf-card grid ${v} gap-[2px] border border-line bg-line [&>*]:min-h-[560px] [&>*]:bg-bg`,minEmptyHeight:260})]}):null,u.length>0&&t("div",{className:`${N} sf-card grid ${v} gap-[2px] border border-line bg-line`,children:u.map((e,o)=>{const s=(e.specs??[]).filter(a=>(a?.label??"").trim()||(a?.value??"").trim());return r("article",{className:i?"flex flex-col bg-bg":"flex min-h-[560px] flex-col bg-bg",children:[r("div",{className:i?"sf-card-image relative aspect-[5/3] overflow-hidden bg-surface max-[700px]:aspect-[4/3]":"sf-card-image relative aspect-[5/3] overflow-hidden border-b border-line bg-surface",children:[t(D,{label:e.tag?.trim()||e.title?.trim()||`column-${o+1}`,src:e.image||void 0,sizes:"(max-width: 1100px) 100vw, 33vw",...m?{deferFetch:!0}:{}}),t("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg, rgba(10,10,10,0.55) 0%, transparent 30%, transparent 70%, rgba(10,10,10,0.65) 100%)"}}),i&&t("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 z-[1] h-[78%]",style:{background:"linear-gradient(180deg, transparent 0%, rgba(10,10,10,0.73) 55%, rgba(10,10,10,0.92) 100%)"}}),e.tag?.trim()&&t("span",{className:"absolute left-5 top-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:l(e.tag)}),e.meta?.trim()&&t("span",{className:i?"absolute right-5 top-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-overlay-fg/80":"absolute right-5 bottom-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-overlay-fg/80",children:l(e.meta)}),i&&(e.title?.trim()||e.copy?.trim())&&r("div",{className:"absolute inset-x-0 bottom-0 z-[2] flex flex-col gap-2.5 px-8 pb-7 pt-14 max-[700px]:px-6 max-[700px]:pb-6",children:[e.title?.trim()&&t("h3",{className:"flex min-h-[2em] flex-col justify-end font-heading3 text-[length:var(--size-headingSmall,28px)] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg max-[700px]:text-[length:var(--size-headingSmall,26px)]",children:n(e.title,!0)}),e.copy?.trim()&&t("p",{className:"min-h-[3em] font-display text-[length:var(--size-body,15px)] leading-[1.5] text-overlay-fg/85",children:n(e.copy,!1)})]})]}),i?s.length>0&&t("div",{className:"grid grid-cols-2 gap-2 border-t border-line px-8 py-7 max-[700px]:px-6 max-[700px]:py-6",children:s.map((a,c)=>r("div",{className:"flex flex-col gap-1",children:[a.label?.trim()&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-fg-dim",children:l(a.label)}),a.value?.trim()&&t("span",{className:"font-display text-[length:var(--size-body,18px)] font-medium tracking-[-0.01em] text-fg",children:l(a.value)})]},c))}):r("div",{className:"flex flex-1 flex-col gap-4 px-8 py-9 max-[700px]:px-6 max-[700px]:py-7",children:[e.title?.trim()&&t("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,34px)] font-medium uppercase leading-none tracking-[-0.02em] max-[700px]:text-[length:var(--size-headingSmall,28px)]",children:n(e.title,!0)}),e.copy?.trim()&&t("p",{className:"font-display text-[length:var(--size-body,15px)] leading-[1.55] text-fg-dim",children:n(e.copy,!1)}),s.length>0&&t("div",{className:"mt-auto grid grid-cols-2 gap-2 border-t border-line pt-4",children:s.map((a,c)=>r("div",{className:"flex flex-col gap-1",children:[a.label?.trim()&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-fg-dim",children:l(a.label)}),a.value?.trim()&&t("span",{className:"font-display text-[length:var(--size-body,18px)] font-medium tracking-[-0.01em] text-fg",children:l(a.value)})]},c))})]})]},o)})}),p?.text&&t("div",{className:"mt-12 flex justify-end border-t border-line pt-8",children:r(A,{href:p.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(p.text),t("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"→"})]})})]})}export{H as default};
@@ -1 +1 @@
1
- import{jsx as t,Fragment as o}from"react/jsx-runtime";function c({className:r=""}){return t("sup",{className:`text-accent tracking-normal ${r}`,children:"\xAE"})}function i(r){if(!r.includes("\xAE"))return r;const e=r.split("\xAE"),n=[];return e.forEach((s,a)=>{s&&n.push(s),a<e.length-1&&n.push(t(c,{},`r${a}`))}),t(o,{children:n})}var f=c;export{c as RMark,f as default,i as withRMark};
1
+ import{jsx as t,Fragment as o}from"react/jsx-runtime";function c({className:r=""}){return t("sup",{className:`text-accent tracking-normal ${r}`,children:"®"})}function i(r){if(!r.includes("®"))return r;const e=r.split("®"),n=[];return e.forEach((s,a)=>{s&&n.push(s),a<e.length-1&&n.push(t(c,{},`r${a}`))}),t(o,{children:n})}var f=c;export{c as RMark,f as default,i as withRMark};
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as c,Fragment as s}from"react/jsx-runtime";import{normaliseReelShape as u,reelRailClass as p,reelSurfaceRailClass as h}from"../lib/reel.js";function g({slides:t,active:r,shape:o,placement:e,ref:n,tone:i="media",label:m}){const l=u(o),d=i==="surface"?{"--overlay-fg":"var(--fg)","--overlay-chrome":"var(--fg)","--overlay-scrim":"var(--surface-2)"}:void 0;return c("aside",{ref:n,"aria-label":m??"Featured slides",className:i==="surface"?h(l):p(l,e),style:{color:"var(--overlay-fg)",...d},children:[l==="cards"&&a(x,{slides:t,active:r}),l==="dots"&&a(f,{count:t.length,active:r}),l==="numbers"&&a(b,{count:t.length,active:r}),l==="bar"&&a(v,{count:t.length,active:r}),l==="tabs"&&a(y,{slides:t,active:r})]})}function x({slides:t,active:r}){return c(s,{children:[a("span",{className:"mb-1 font-mono text-[length:var(--size-label,10px)] uppercase tracking-[0.28em] text-overlay-chrome/55",children:"Reel \xB7 pick a slide"}),t.map((o,e)=>{const n=e===r;return c("button",{type:"button","data-idx":e,"aria-pressed":n,"aria-label":`Go to ${o.name||`slide ${e+1}`}`,className:["group flex w-[170px] cursor-pointer flex-col items-start gap-0.5 border bg-overlay-scrim/55 px-3 py-2.5 text-left transition-all motion-reduce:transition-none max-[1100px]:w-[140px]",n?"border-accent bg-overlay-scrim/70":"border-overlay-chrome/15 hover:border-overlay-chrome/45 hover:bg-overlay-scrim/70"].join(" "),children:[a("span",{className:["font-display text-[length:var(--size-body,13px)] font-medium uppercase leading-tight tracking-[-0.01em]",n?"text-accent":"text-overlay-fg"].join(" "),children:o.name||`Slide ${e+1}`}),a("span",{className:"font-mono text-[length:var(--size-label,9px)] uppercase tracking-[0.2em] text-overlay-chrome/55",children:n?"\u25B6 Now playing":o.process||" "})]},e)})]})}function f({count:t,active:r}){return a(s,{children:Array.from({length:t},(o,e)=>a("button",{type:"button","data-idx":e,"aria-pressed":e===r,"aria-label":`Go to slide ${e+1}`,className:`h-2 cursor-pointer rounded-full transition-all motion-reduce:transition-none ${e===r?"w-5 bg-accent":"w-2 bg-overlay-chrome/45 hover:bg-overlay-chrome/70"}`},e))})}function b({count:t,active:r}){return a(s,{children:Array.from({length:t},(o,e)=>a("button",{type:"button","data-idx":e,"aria-pressed":e===r,"aria-label":`Go to slide ${e+1}`,className:`cursor-pointer font-mono text-[length:var(--size-label,11px)] leading-none tracking-[0.06em] transition-colors ${e===r?"text-overlay-fg":"text-overlay-chrome/45 hover:text-overlay-chrome/80"}`,children:String(e+1).padStart(2,"0")},e))})}function v({count:t,active:r}){return a(s,{children:Array.from({length:t},(o,e)=>a("button",{type:"button","data-idx":e,"aria-pressed":e===r,"aria-label":`Go to slide ${e+1}`,className:`h-full flex-1 cursor-pointer transition-colors ${e<=r?"bg-overlay-fg":"bg-overlay-chrome/25"}`},e))})}function y({slides:t,active:r}){return a(s,{children:t.map((o,e)=>{const n=e===r;return a("button",{type:"button","data-idx":e,"aria-pressed":n,className:["flex min-w-[140px] flex-1 cursor-pointer items-end px-6 py-7 text-left transition-colors",e>0?"border-l border-overlay-chrome/15":"",n?"bg-overlay-scrim/70":"hover:bg-overlay-scrim/40"].join(" "),children:a("span",{className:["font-heading3 text-[length:var(--size-headingSmall,24px)] font-medium uppercase leading-tight tracking-[-0.02em]",n?"text-overlay-fg":"text-overlay-chrome/55"].join(" "),children:o.name})},e)})})}export{g as default};
1
+ "use client";import{jsx as a,jsxs as c,Fragment as s}from"react/jsx-runtime";import{normaliseReelShape as u,reelRailClass as p,reelSurfaceRailClass as h}from"../lib/reel.js";function g({slides:t,active:r,shape:o,placement:e,ref:n,tone:i="media",label:m}){const l=u(o),d=i==="surface"?{"--overlay-fg":"var(--fg)","--overlay-chrome":"var(--fg)","--overlay-scrim":"var(--surface-2)"}:void 0;return c("aside",{ref:n,"aria-label":m??"Featured slides",className:i==="surface"?h(l):p(l,e),style:{color:"var(--overlay-fg)",...d},children:[l==="cards"&&a(x,{slides:t,active:r}),l==="dots"&&a(f,{count:t.length,active:r}),l==="numbers"&&a(b,{count:t.length,active:r}),l==="bar"&&a(v,{count:t.length,active:r}),l==="tabs"&&a(y,{slides:t,active:r})]})}function x({slides:t,active:r}){return c(s,{children:[a("span",{className:"mb-1 font-mono text-[length:var(--size-label,10px)] uppercase tracking-[0.28em] text-overlay-chrome/55",children:"Reel · pick a slide"}),t.map((o,e)=>{const n=e===r;return c("button",{type:"button","data-idx":e,"aria-pressed":n,"aria-label":`Go to ${o.name||`slide ${e+1}`}`,className:["group flex w-[170px] cursor-pointer flex-col items-start gap-0.5 border bg-overlay-scrim/55 px-3 py-2.5 text-left transition-all motion-reduce:transition-none max-[1100px]:w-[140px]",n?"border-accent bg-overlay-scrim/70":"border-overlay-chrome/15 hover:border-overlay-chrome/45 hover:bg-overlay-scrim/70"].join(" "),children:[a("span",{className:["font-display text-[length:var(--size-body,13px)] font-medium uppercase leading-tight tracking-[-0.01em]",n?"text-accent":"text-overlay-fg"].join(" "),children:o.name||`Slide ${e+1}`}),a("span",{className:"font-mono text-[length:var(--size-label,9px)] uppercase tracking-[0.2em] text-overlay-chrome/55",children:n?"▶ Now playing":o.process||" "})]},e)})]})}function f({count:t,active:r}){return a(s,{children:Array.from({length:t},(o,e)=>a("button",{type:"button","data-idx":e,"aria-pressed":e===r,"aria-label":`Go to slide ${e+1}`,className:`h-2 cursor-pointer rounded-full transition-all motion-reduce:transition-none ${e===r?"w-5 bg-accent":"w-2 bg-overlay-chrome/45 hover:bg-overlay-chrome/70"}`},e))})}function b({count:t,active:r}){return a(s,{children:Array.from({length:t},(o,e)=>a("button",{type:"button","data-idx":e,"aria-pressed":e===r,"aria-label":`Go to slide ${e+1}`,className:`cursor-pointer font-mono text-[length:var(--size-label,11px)] leading-none tracking-[0.06em] transition-colors ${e===r?"text-overlay-fg":"text-overlay-chrome/45 hover:text-overlay-chrome/80"}`,children:String(e+1).padStart(2,"0")},e))})}function v({count:t,active:r}){return a(s,{children:Array.from({length:t},(o,e)=>a("button",{type:"button","data-idx":e,"aria-pressed":e===r,"aria-label":`Go to slide ${e+1}`,className:`h-full flex-1 cursor-pointer transition-colors ${e<=r?"bg-overlay-fg":"bg-overlay-chrome/25"}`},e))})}function y({slides:t,active:r}){return a(s,{children:t.map((o,e)=>{const n=e===r;return a("button",{type:"button","data-idx":e,"aria-pressed":n,className:["flex min-w-[140px] flex-1 cursor-pointer items-end px-6 py-7 text-left transition-colors",e>0?"border-l border-overlay-chrome/15":"",n?"bg-overlay-scrim/70":"hover:bg-overlay-scrim/40"].join(" "),children:a("span",{className:["font-heading3 text-[length:var(--size-headingSmall,24px)] font-medium uppercase leading-tight tracking-[-0.02em]",n?"text-overlay-fg":"text-overlay-chrome/55"].join(" "),children:o.name})},e)})})}export{g as default};
@@ -1 +1 @@
1
- "use client";import{jsxs as l,jsx as n,Fragment as w}from"react/jsx-runtime";import{useState as ce}from"react";import{useEasel as de}from"efficient-easel/easel";import{InspectorHead as me,InspectorIconButton as F}from"efficient-easel/chrome";import{DuplicateIcon as fe,TrashIcon as ue}from"efficient-easel/icons";import{panelFieldsOf as he}from"../lib/puck/panel-fields.js";import{TICKER_PART_LABEL as x}from"./PreviewTickerContext.js";import Se from"./SectionIcon.js";import{PanelHideButton as B}from"./SidePanelHead.js";import{useEditorSession as be}from"../lib/editor-session-context.js";import ge,{HintsToggle as ke,SHOW_HINTS_DEFAULT as we}from"./WebsiteSettingsPanel.js";import ve from"./ChatSettingsPanel.js";import Pe from"./SocialLinksPanel.js";import ye from"./TickerSettingsPanel.js";import Ie,{PartSourceNote as Ee,partStyleName as Te}from"./PartSettingsPanel.js";import Le from"./DuplicateToPageMenu.js";import{useStorefrontDocument as Ne}from"./StorefrontDocumentContext.js";import{usePreviewHeader as Oe}from"./PreviewHeaderContext.js";import{usePartStyle as He}from"./PreviewPartStyleContext.js";import{useSectionOps as _e}from"../lib/puck/use-section-ops.js";import{SELECTION_MODE as Re}from"../lib/editor-screen.js";import{usePreviewParts as Ce}from"./PreviewPartsContext.js";import{SectionTextEntries as De}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ae}from"../lib/puck/section-text-suppress.js";import{HEADER_TYPE as Fe,ROOT_ZONE as z}from"../lib/puck/content-tree.js";import{duplicateBlocked as xe}from"../lib/hero-group-placement.js";import{FOOTER_TYPE as v}from"../lib/puck/footer-blocks.js";import Be from"./SwitchToBoxFooter.js";import{SiteFields as K}from"./SiteFields.js";import{SITE_FOOTER_SLUG as ze}from"../lib/content/footer.js";import{SettingsSwitch as Ke}from"efficient-easel/panel";import{foldTopTier as Me}from"../lib/puck/field-groups.js";import{FoldHeadingScope as We}from"../lib/puck/panel-heading-scope.js";import{partRowField as $e}from"../lib/puck/part-row-field.js";import{decodePartKey as je,partRowHeadLabel as Ue}from"../lib/puck/part-rows.js";import{encodePartId as M,partHeadLabel as Ye,partLabel as Ge,sectionTextParts as Ze}from"../lib/puck/text-parts.js";import{partSourceOf as qe,sourceSlugOf as Je}from"../lib/puck/source-bound-parts.js";const Kt=Re,Mt={kind:"header"},Wt={kind:"website"},$t={kind:"chat"},jt={kind:"social"},f="Part";function Qe(t,o,i){const p=t.describeNode(o);return{name:i,kindLabel:p?`${f} of ${p.label}`:f}}function W({what:t}){return l("div",{className:"sf-note",children:[n("p",{children:l("strong",{children:[t," settings belong to a website."]})}),l("p",{children:["A template is a blueprint \u2014 it has no website of its own, so there is nothing here to change. Each website created from this template sets its own ",t.toLowerCase()," afterwards."]})]})}const Ve={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(t,o)=>{const i=o.hostPanels?.header;return i?n(i,{placeholderMode:o.capabilities.placeholderFrames,tokenRef:o.tokenRef,siteId:o.siteId,websiteName:o.websiteName,onOpenWebsiteSettings:o.onOpenWebsiteSettings,onAuthExpired:()=>o.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(t,o)=>n(ge,{themeFromDocument:!o.capabilities.hasSiteTheme,tokenRef:o.tokenRef,siteId:o.siteId,onNotify:o.onNotify})},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>n(ve,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>n(Pe,{unavailable:n(W,{what:"Social link"})})},ticker:{name:x,kindLabel:f,icon:"ticker",head:(t,o)=>t.kind==="ticker"?Qe(o,t.heroId,x):null,render:t=>n(ye,{heroId:t.kind==="ticker"?t.heroId:""})},part:{name:f,kindLabel:f,icon:"Text",head:(t,o)=>{if(t.kind!=="part")return null;const i=o.describeNode(t.nodeId);if(!i)return null;const{key:p,row:u}=je(t.propKey),b=u?$e(i.fields[p],u):i.fields[p],m=Ue(Ye(Ge(b??{},p)),u);return{name:o.styleNameOfPart(t.nodeId,t.propKey)??m,kindLabel:`${f} of ${i.label}`}},render:(t,o)=>t.kind==="part"?n(Ie,{nodeId:t.nodeId,propKey:t.propKey,onBack:()=>o.onSelectNode(t.nodeId),onEditStyle:o.onOpenSiteStyles}):null}},Xe=new Set(["header","website","chat"]);function et(t,o){if(t==="puck")return null;const i=Ve[t];return Xe.has(t)&&!o.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>n(W,{what:i.name})}:i}function tt({mode:t,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:p,hideNodeActions:u=!1,onNotify:b,onHidePanel:m}){const{capabilities:h,tokenRef:P,notifyParent:$,currentSlug:y,siteId:I,runAuthed:j}=Ne(),{websiteName:U,fonts:Y}=Oe(),{partStyle:E}=He(),g=_e(),{select:G}=Ce(),{selectedItem:e,getItemById:T,getSelectorForId:Z,config:c,appState:q}=de(a=>a),J=he(c,e?{type:e.type,props:e.props}:null),Q=a=>c.components[a]?.label??a,r=e?Z(e.props.id):void 0,s=et(t.kind,h),L=be(),N=L.chrome?.panels?.chromePage,O={capabilities:h,tokenRef:P,hostPanels:L.chrome?.panels,describeNode:a=>{const d=T(a);if(!d)return null;const S=c.components[d.type];return{type:d.type,label:S?.label??d.type,fields:S?.fields??{}}},styleNameOfPart:(a,d)=>{const S=T(a);if(!S)return null;const le=M(a,d),pe=E?.partId===le?E:null;return Te(S.props,d,pe,Y)},siteId:I,websiteName:U??null,notifyParent:$,onNotify:b,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:p},H=s?.head?.(t,O)??null,V=H?.name??(s?s.name:e?Q(e.type):"Page settings"),X=H?.kindLabel??(s?s.kindLabel:e?r&&r.zone!==z?"Block":"Section":"Page"),ee=s?s.icon:e?e.type:"page",_=s?null:e?c.components[e.type]?.fields??null:c.root?.fields??null,te=_?Me(_):2,R=t.kind==="puck"&&e?qe(e.type):null,ne=!!e&&!!r&&r.zone===z&&e.type!==v&&e.type!==Fe,k=xe(q?.data,e),oe=()=>{k||r&&g.duplicateComponent(r.zone,r.index)},ie=()=>{r&&(g.removeComponent(r.zone,r.index),g.select(null))},re=e?c.components[e.type]?.defaultProps?.previewHover:void 0,C=t.kind==="puck"&&!!e&&!!r&&re!==void 0,D=C&&e.props.previewHover===!0,se=()=>{!e||!r||g.replaceComponent(r.zone,r.index,{...e,props:{...e.props,previewHover:!D}})},[A,ae]=ce(we);return l("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${A||!(!s&&!!e)?"":" sf-hints-folded"}`,children:[n(me,{icon:n(Se,{type:ee,size:15}),name:V,kind:X,actions:!u&&t.kind==="puck"&&e&&e.type!==v?l(w,{children:[n(F,{label:"Duplicate section",title:k??void 0,disabled:k!==null,onClick:oe,children:n(fe,{size:15})}),ne&&h.hasSiteSettings&&n(Le,{node:e,currentSlug:y,siteId:I??void 0,tokenRef:P,runAuthed:j,onNotify:b}),n(F,{label:"Remove section",danger:!0,onClick:ie,children:n(ue,{size:15})}),m?n(B,{side:"right",onHide:m,divider:!0}):null]}):m?n(B,{side:"right",onHide:m}):void 0}),C&&l("div",{className:"sf-preview-pin",children:[l("div",{className:"sf-preview-pin-text",children:[n("span",{className:"sf-preview-pin-label",children:"Preview hover state"}),n("span",{className:"sf-preview-pin-hint",children:"not shown live"})]}),n(Ke,{checked:D,onChange:se,ariaLabel:"Preview hover state"})]}),n(We,{tier:te,children:n("div",{className:"sf-insp-body sf-scroll",children:s?s.render(t,O):e?l(w,{children:[n(Ae,{children:n(K,{entries:n(De,{parts:Ze(J??c.components[e.type]?.fields,e.props),onOpen:a=>G(M(e.props.id,a))})})}),e.type===v&&h.hasSiteSettings&&n(Be,{}),R&&n(Ee,{source:R,slug:Je(e?.props)}),n(ke,{shown:A,onChange:ae})]}):l(w,{children:[n(K,{}),y===ze&&h.hasSiteSettings&&N&&n(N,{})]})})})]})}export{$t as CHAT_MODE,Mt as HEADER_MODE,Kt as PUCK_MODE,jt as SOCIAL_MODE,Wt as WEBSITE_MODE,tt as default,et as resolvePanel};
1
+ "use client";import{jsxs as l,jsx as n,Fragment as w}from"react/jsx-runtime";import{useState as ce}from"react";import{useEasel as de}from"efficient-easel/easel";import{InspectorHead as me,InspectorIconButton as F}from"efficient-easel/chrome";import{DuplicateIcon as fe,TrashIcon as ue}from"efficient-easel/icons";import{panelFieldsOf as he}from"../lib/puck/panel-fields.js";import{TICKER_PART_LABEL as x}from"./PreviewTickerContext.js";import Se from"./SectionIcon.js";import{PanelHideButton as B}from"./SidePanelHead.js";import{useEditorSession as be}from"../lib/editor-session-context.js";import ge,{HintsToggle as ke,SHOW_HINTS_DEFAULT as we}from"./WebsiteSettingsPanel.js";import ve from"./ChatSettingsPanel.js";import Pe from"./SocialLinksPanel.js";import ye from"./TickerSettingsPanel.js";import Ie,{PartSourceNote as Ee,partStyleName as Te}from"./PartSettingsPanel.js";import Le from"./DuplicateToPageMenu.js";import{useStorefrontDocument as Ne}from"./StorefrontDocumentContext.js";import{usePreviewHeader as Oe}from"./PreviewHeaderContext.js";import{usePartStyle as He}from"./PreviewPartStyleContext.js";import{useSectionOps as _e}from"../lib/puck/use-section-ops.js";import{SELECTION_MODE as Re}from"../lib/editor-screen.js";import{usePreviewParts as Ce}from"./PreviewPartsContext.js";import{SectionTextEntries as De}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ae}from"../lib/puck/section-text-suppress.js";import{HEADER_TYPE as Fe,ROOT_ZONE as z}from"../lib/puck/content-tree.js";import{duplicateBlocked as xe}from"../lib/hero-group-placement.js";import{FOOTER_TYPE as v}from"../lib/puck/footer-blocks.js";import Be from"./SwitchToBoxFooter.js";import{SiteFields as K}from"./SiteFields.js";import{SITE_FOOTER_SLUG as ze}from"../lib/content/footer.js";import{SettingsSwitch as Ke}from"efficient-easel/panel";import{foldTopTier as Me}from"../lib/puck/field-groups.js";import{FoldHeadingScope as We}from"../lib/puck/panel-heading-scope.js";import{partRowField as $e}from"../lib/puck/part-row-field.js";import{decodePartKey as je,partRowHeadLabel as Ue}from"../lib/puck/part-rows.js";import{encodePartId as M,partHeadLabel as Ye,partLabel as Ge,sectionTextParts as Ze}from"../lib/puck/text-parts.js";import{partSourceOf as qe,sourceSlugOf as Je}from"../lib/puck/source-bound-parts.js";const Kt=Re,Mt={kind:"header"},Wt={kind:"website"},$t={kind:"chat"},jt={kind:"social"},f="Part";function Qe(t,o,i){const p=t.describeNode(o);return{name:i,kindLabel:p?`${f} of ${p.label}`:f}}function W({what:t}){return l("div",{className:"sf-note",children:[n("p",{children:l("strong",{children:[t," settings belong to a website."]})}),l("p",{children:["A template is a blueprint — it has no website of its own, so there is nothing here to change. Each website created from this template sets its own ",t.toLowerCase()," afterwards."]})]})}const Ve={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(t,o)=>{const i=o.hostPanels?.header;return i?n(i,{placeholderMode:o.capabilities.placeholderFrames,tokenRef:o.tokenRef,siteId:o.siteId,websiteName:o.websiteName,onOpenWebsiteSettings:o.onOpenWebsiteSettings,onAuthExpired:()=>o.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(t,o)=>n(ge,{themeFromDocument:!o.capabilities.hasSiteTheme,tokenRef:o.tokenRef,siteId:o.siteId,onNotify:o.onNotify})},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>n(ve,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>n(Pe,{unavailable:n(W,{what:"Social link"})})},ticker:{name:x,kindLabel:f,icon:"ticker",head:(t,o)=>t.kind==="ticker"?Qe(o,t.heroId,x):null,render:t=>n(ye,{heroId:t.kind==="ticker"?t.heroId:""})},part:{name:f,kindLabel:f,icon:"Text",head:(t,o)=>{if(t.kind!=="part")return null;const i=o.describeNode(t.nodeId);if(!i)return null;const{key:p,row:u}=je(t.propKey),b=u?$e(i.fields[p],u):i.fields[p],m=Ue(Ye(Ge(b??{},p)),u);return{name:o.styleNameOfPart(t.nodeId,t.propKey)??m,kindLabel:`${f} of ${i.label}`}},render:(t,o)=>t.kind==="part"?n(Ie,{nodeId:t.nodeId,propKey:t.propKey,onBack:()=>o.onSelectNode(t.nodeId),onEditStyle:o.onOpenSiteStyles}):null}},Xe=new Set(["header","website","chat"]);function et(t,o){if(t==="puck")return null;const i=Ve[t];return Xe.has(t)&&!o.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>n(W,{what:i.name})}:i}function tt({mode:t,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:p,hideNodeActions:u=!1,onNotify:b,onHidePanel:m}){const{capabilities:h,tokenRef:P,notifyParent:$,currentSlug:y,siteId:I,runAuthed:j}=Ne(),{websiteName:U,fonts:Y}=Oe(),{partStyle:E}=He(),g=_e(),{select:G}=Ce(),{selectedItem:e,getItemById:T,getSelectorForId:Z,config:c,appState:q}=de(a=>a),J=he(c,e?{type:e.type,props:e.props}:null),Q=a=>c.components[a]?.label??a,r=e?Z(e.props.id):void 0,s=et(t.kind,h),L=be(),N=L.chrome?.panels?.chromePage,O={capabilities:h,tokenRef:P,hostPanels:L.chrome?.panels,describeNode:a=>{const d=T(a);if(!d)return null;const S=c.components[d.type];return{type:d.type,label:S?.label??d.type,fields:S?.fields??{}}},styleNameOfPart:(a,d)=>{const S=T(a);if(!S)return null;const le=M(a,d),pe=E?.partId===le?E:null;return Te(S.props,d,pe,Y)},siteId:I,websiteName:U??null,notifyParent:$,onNotify:b,onOpenWebsiteSettings:o,onOpenSiteStyles:i,onSelectNode:p},H=s?.head?.(t,O)??null,V=H?.name??(s?s.name:e?Q(e.type):"Page settings"),X=H?.kindLabel??(s?s.kindLabel:e?r&&r.zone!==z?"Block":"Section":"Page"),ee=s?s.icon:e?e.type:"page",_=s?null:e?c.components[e.type]?.fields??null:c.root?.fields??null,te=_?Me(_):2,R=t.kind==="puck"&&e?qe(e.type):null,ne=!!e&&!!r&&r.zone===z&&e.type!==v&&e.type!==Fe,k=xe(q?.data,e),oe=()=>{k||r&&g.duplicateComponent(r.zone,r.index)},ie=()=>{r&&(g.removeComponent(r.zone,r.index),g.select(null))},re=e?c.components[e.type]?.defaultProps?.previewHover:void 0,C=t.kind==="puck"&&!!e&&!!r&&re!==void 0,D=C&&e.props.previewHover===!0,se=()=>{!e||!r||g.replaceComponent(r.zone,r.index,{...e,props:{...e.props,previewHover:!D}})},[A,ae]=ce(we);return l("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${A||!(!s&&!!e)?"":" sf-hints-folded"}`,children:[n(me,{icon:n(Se,{type:ee,size:15}),name:V,kind:X,actions:!u&&t.kind==="puck"&&e&&e.type!==v?l(w,{children:[n(F,{label:"Duplicate section",title:k??void 0,disabled:k!==null,onClick:oe,children:n(fe,{size:15})}),ne&&h.hasSiteSettings&&n(Le,{node:e,currentSlug:y,siteId:I??void 0,tokenRef:P,runAuthed:j,onNotify:b}),n(F,{label:"Remove section",danger:!0,onClick:ie,children:n(ue,{size:15})}),m?n(B,{side:"right",onHide:m,divider:!0}):null]}):m?n(B,{side:"right",onHide:m}):void 0}),C&&l("div",{className:"sf-preview-pin",children:[l("div",{className:"sf-preview-pin-text",children:[n("span",{className:"sf-preview-pin-label",children:"Preview hover state"}),n("span",{className:"sf-preview-pin-hint",children:"not shown live"})]}),n(Ke,{checked:D,onChange:se,ariaLabel:"Preview hover state"})]}),n(We,{tier:te,children:n("div",{className:"sf-insp-body sf-scroll",children:s?s.render(t,O):e?l(w,{children:[n(Ae,{children:n(K,{entries:n(De,{parts:Ze(J??c.components[e.type]?.fields,e.props),onOpen:a=>G(M(e.props.id,a))})})}),e.type===v&&h.hasSiteSettings&&n(Be,{}),R&&n(Ee,{source:R,slug:Je(e?.props)}),n(ke,{shown:A,onChange:ae})]}):l(w,{children:[n(K,{}),y===ze&&h.hasSiteSettings&&N&&n(N,{})]})})})]})}export{$t as CHAT_MODE,Mt as HEADER_MODE,Kt as PUCK_MODE,jt as SOCIAL_MODE,Wt as WEBSITE_MODE,tt as default,et as resolvePanel};
@@ -1 +1 @@
1
- import{jsx as a,Fragment as k,jsxs as n}from"react/jsx-runtime";import{SiteLink as O}from"../lib/site-runtime.js";import{media as U}from"../lib/media.js";import{DEFAULT_SECTION_NUMBER_STYLE as L,OUTLINED_NUMBER_CLASS as B,OUTLINED_NUMBER_CSS as R,OUTLINED_NUMBER_LAYOUT as j,parseSectionNumberStyle as D}from"../lib/sections/section-number-style.js";import{DEFAULT_SECTION_EYEBROW_LOOK as I}from"../lib/sections/section-eyebrow-look.js";import{renderGold as C,renderHeadline as F}from"./goldPhrases.js";import m from"./SectionEyebrow.js";const g=(e,t=!1)=>typeof e=="string"?F(e,t):e,d=(e,t=!1)=>typeof e=="string"?C(e,t):e;function A({num:e,title:t,link:c,logo:o,description:s,accent:f,accentNum:_,numStyle:u=L,look:r="standard",titleAccent:v,accentTracking:E="-0.02em",spaceBelow:y,rowGap:z,descriptionSize:$,className:l="",eyebrowLook:h=I}){const x=y??(r==="editorial"?"mb-[60px]":"");if(r==="editorial"){const i=!!t||!!v;return n("header",{className:`${x} grid grid-cols-[auto_1fr_auto] items-end gap-10 border-b border-line pb-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-3.5 ${l}`.trim(),children:[e&&(typeof e=="string"?a(m,{text:e,className:"pb-2"}):a("span",{className:"pb-2",children:e})),i&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5.5vw,80px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:[t,v&&n(k,{children:[" ",a("em",{className:"font-serif font-normal italic text-accent",style:{letterSpacing:E},children:v})]})]}),s&&a("p",{className:"max-w-[360px] pb-1 text-right font-display text-[length:var(--size-body,14px)] leading-[1.5] text-fg-dim max-[1100px]:max-w-full max-[1100px]:text-left",children:s})]})}if(r==="simple"){const i=`${x} ${l}`.trim();return n("div",{className:i||void 0,children:[e&&(typeof e=="string"?a(m,{text:e,look:h,className:"mb-4 block"}):a("span",{className:"mb-4 block",children:e})),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(t)})]})}if(r==="statement"){const i=`${x} ${l}`.trim();return n("div",{className:i||void 0,children:[e&&(typeof e=="string"?a(m,{text:e,look:h,className:"mb-4 block"}):a("span",{className:"mb-4 block",children:e})),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5vw,72px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em] text-fg",children:g(t,!0)})]})}if(r==="natural"){const i=`flex max-w-[680px] flex-col ${z??"gap-5"} ${x} ${l}`.replace(/\s+/g," ").trim();return n("div",{className:i,children:[e&&(typeof e=="string"?a(m,{text:e,look:h}):a("span",{children:e})),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(t)}),s&&a("p",{className:`${$??"text-[length:var(--size-body,16px)]"} leading-[1.6] opacity-85`,children:s})]})}if(r==="essay"){const i=`${x} ${l}`.trim();return n("div",{className:i||void 0,children:[e&&(typeof e=="string"?a(m,{text:e,look:h,className:"mb-4 block"}):a("span",{className:"mb-4 block",children:e})),t&&a("h2",{className:"font-heading2 text-[length:var(--sf-heading-max,var(--size-headingMedium,38px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-none tracking-[-0.02em] text-fg max-[800px]:text-[length:var(--size-headingSmall,28px)]",children:g(t)})]})}const M=!!s||!!c,S=!!t,N=D(u)==="outlined",b="font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.3em]";let p=null;if(e)if(N)p=a("span",{className:`${j} text-fg-dim ${B}`,children:d(e)});else if(_&&!f&&typeof e=="string"){const i=e.indexOf("/"),T=i===-1?e:e.slice(0,i),w=i===-1?"":e.slice(i);p=n("span",{className:b,children:[a("span",{className:"text-accent",children:d(T)}),w&&a("span",{className:"text-fg-dim",children:d(w)})]})}else p=a("span",{className:`${b} ${f?"text-accent":"text-fg-dim"}`,children:d(e)});return n("div",{className:"mb-16 grid grid-cols-[auto_1fr_auto] items-end gap-10 border-b border-line pb-6 max-[800px]:mb-9 max-[800px]:grid-cols-1 max-[800px]:gap-3 max-[800px]:pb-5",children:[N&&e&&a("style",{children:R}),n("div",{className:"flex flex-col items-start gap-3",children:[o?.src&&a("img",{src:U(o.src),alt:o.alt,className:"h-8 w-auto object-contain"}),p]}),S&&a("h2",{className:f?"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,5vw,64px)),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.95] tracking-[-0.025em]":"font-heading2 text-[length:min(var(--size-headingMedium,56px),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-none tracking-[-0.03em] whitespace-pre-line max-[800px]:text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))] max-[800px]:leading-[1]",children:g(t)}),M&&n("div",{className:"flex flex-col items-end gap-3 max-[800px]:items-start",children:[s&&a("p",{className:"max-w-[340px] font-display text-[length:var(--size-body,14px)] leading-[1.5] text-fg-dim text-right max-[800px]:max-w-full max-[800px]:text-left",children:d(s)}),c&&n(O,{href:c.href,className:"inline-flex items-center gap-2 whitespace-nowrap font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg",children:[d(c.text),a("span",{"aria-hidden":!0,children:"\u2192"})]})]})]})}export{A as default};
1
+ import{jsx as a,Fragment as k,jsxs as n}from"react/jsx-runtime";import{SiteLink as O}from"../lib/site-runtime.js";import{media as U}from"../lib/media.js";import{DEFAULT_SECTION_NUMBER_STYLE as L,OUTLINED_NUMBER_CLASS as B,OUTLINED_NUMBER_CSS as R,OUTLINED_NUMBER_LAYOUT as j,parseSectionNumberStyle as D}from"../lib/sections/section-number-style.js";import{DEFAULT_SECTION_EYEBROW_LOOK as I}from"../lib/sections/section-eyebrow-look.js";import{renderGold as C,renderHeadline as F}from"./goldPhrases.js";import m from"./SectionEyebrow.js";const g=(e,t=!1)=>typeof e=="string"?F(e,t):e,d=(e,t=!1)=>typeof e=="string"?C(e,t):e;function A({num:e,title:t,link:c,logo:o,description:s,accent:f,accentNum:_,numStyle:u=L,look:r="standard",titleAccent:v,accentTracking:E="-0.02em",spaceBelow:y,rowGap:z,descriptionSize:$,className:l="",eyebrowLook:h=I}){const x=y??(r==="editorial"?"mb-[60px]":"");if(r==="editorial"){const i=!!t||!!v;return n("header",{className:`${x} grid grid-cols-[auto_1fr_auto] items-end gap-10 border-b border-line pb-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-3.5 ${l}`.trim(),children:[e&&(typeof e=="string"?a(m,{text:e,className:"pb-2"}):a("span",{className:"pb-2",children:e})),i&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5.5vw,80px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:[t,v&&n(k,{children:[" ",a("em",{className:"font-serif font-normal italic text-accent",style:{letterSpacing:E},children:v})]})]}),s&&a("p",{className:"max-w-[360px] pb-1 text-right font-display text-[length:var(--size-body,14px)] leading-[1.5] text-fg-dim max-[1100px]:max-w-full max-[1100px]:text-left",children:s})]})}if(r==="simple"){const i=`${x} ${l}`.trim();return n("div",{className:i||void 0,children:[e&&(typeof e=="string"?a(m,{text:e,look:h,className:"mb-4 block"}):a("span",{className:"mb-4 block",children:e})),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(t)})]})}if(r==="statement"){const i=`${x} ${l}`.trim();return n("div",{className:i||void 0,children:[e&&(typeof e=="string"?a(m,{text:e,look:h,className:"mb-4 block"}):a("span",{className:"mb-4 block",children:e})),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(40px,5vw,72px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em] text-fg",children:g(t,!0)})]})}if(r==="natural"){const i=`flex max-w-[680px] flex-col ${z??"gap-5"} ${x} ${l}`.replace(/\s+/g," ").trim();return n("div",{className:i,children:[e&&(typeof e=="string"?a(m,{text:e,look:h}):a("span",{children:e})),t&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium leading-[1.05] tracking-[-0.03em] max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:g(t)}),s&&a("p",{className:`${$??"text-[length:var(--size-body,16px)]"} leading-[1.6] opacity-85`,children:s})]})}if(r==="essay"){const i=`${x} ${l}`.trim();return n("div",{className:i||void 0,children:[e&&(typeof e=="string"?a(m,{text:e,look:h,className:"mb-4 block"}):a("span",{className:"mb-4 block",children:e})),t&&a("h2",{className:"font-heading2 text-[length:var(--sf-heading-max,var(--size-headingMedium,38px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-none tracking-[-0.02em] text-fg max-[800px]:text-[length:var(--size-headingSmall,28px)]",children:g(t)})]})}const M=!!s||!!c,S=!!t,N=D(u)==="outlined",b="font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.3em]";let p=null;if(e)if(N)p=a("span",{className:`${j} text-fg-dim ${B}`,children:d(e)});else if(_&&!f&&typeof e=="string"){const i=e.indexOf("/"),T=i===-1?e:e.slice(0,i),w=i===-1?"":e.slice(i);p=n("span",{className:b,children:[a("span",{className:"text-accent",children:d(T)}),w&&a("span",{className:"text-fg-dim",children:d(w)})]})}else p=a("span",{className:`${b} ${f?"text-accent":"text-fg-dim"}`,children:d(e)});return n("div",{className:"mb-16 grid grid-cols-[auto_1fr_auto] items-end gap-10 border-b border-line pb-6 max-[800px]:mb-9 max-[800px]:grid-cols-1 max-[800px]:gap-3 max-[800px]:pb-5",children:[N&&e&&a("style",{children:R}),n("div",{className:"flex flex-col items-start gap-3",children:[o?.src&&a("img",{src:U(o.src),alt:o.alt,className:"h-8 w-auto object-contain"}),p]}),S&&a("h2",{className:f?"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,5vw,64px)),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.95] tracking-[-0.025em]":"font-heading2 text-[length:min(var(--size-headingMedium,56px),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-none tracking-[-0.03em] whitespace-pre-line max-[800px]:text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))] max-[800px]:leading-[1]",children:g(t)}),M&&n("div",{className:"flex flex-col items-end gap-3 max-[800px]:items-start",children:[s&&a("p",{className:"max-w-[340px] font-display text-[length:var(--size-body,14px)] leading-[1.5] text-fg-dim text-right max-[800px]:max-w-full max-[800px]:text-left",children:d(s)}),c&&n(O,{href:c.href,className:"inline-flex items-center gap-2 whitespace-nowrap font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg",children:[d(c.text),a("span",{"aria-hidden":!0,children:"→"})]})]})]})}export{A as default};