efficient-web-builder 21.0.0 → 22.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.
- package/CHANGELOG.md +196 -0
- package/dist/components/AnimatedStat.js +1 -1
- package/dist/components/Banner.js +1 -1
- package/dist/components/Cards.js +1 -1
- package/dist/components/CategoryBar.js +1 -1
- package/dist/components/ChartSection.js +1 -1
- package/dist/components/Countdown.js +1 -1
- package/dist/components/DealerFinder.d.ts +12 -0
- package/dist/components/DealerFinder.js +1 -0
- package/dist/components/DocMasthead.js +1 -1
- package/dist/components/DocMetaCards.js +1 -1
- package/dist/components/DocTabs.js +1 -1
- package/dist/components/FeaturedCover.js +1 -1
- package/dist/components/Footprint.d.ts +8 -1
- package/dist/components/Footprint.js +5 -5
- package/dist/components/HeroPoster.d.ts +2 -1
- package/dist/components/HeroPoster.js +1 -1
- package/dist/components/HeroSingle.d.ts +3 -1
- package/dist/components/HeroSingle.js +4 -4
- package/dist/components/HeroSlide.d.ts +2 -1
- package/dist/components/HeroSlide.js +1 -1
- package/dist/components/ImageBlock.d.ts +2 -1
- package/dist/components/ImageBlock.js +1 -1
- package/dist/components/KeyFeatures.js +1 -1
- package/dist/components/LocationGroupHeader.js +1 -1
- package/dist/components/Logos.js +1 -1
- package/dist/components/LongRead.js +1 -1
- package/dist/components/Manifesto.js +1 -1
- package/dist/components/Masthead.js +1 -1
- package/dist/components/MediaUploadField.d.ts +3 -1
- package/dist/components/MediaUploadField.js +1 -1
- package/dist/components/MockupSection.js +1 -1
- package/dist/components/OrderSummary.js +1 -1
- package/dist/components/PagesPanel.js +1 -1
- package/dist/components/ParagraphsA.js +1 -1
- package/dist/components/PartSettingsPanel.d.ts +2 -1
- package/dist/components/PartSettingsPanel.js +1 -1
- package/dist/components/PinnedChromeLoadNotice.d.ts +12 -2
- package/dist/components/PinnedChromeLoadNotice.js +1 -1
- package/dist/components/PostCard.js +1 -1
- package/dist/components/ProcessSteps.js +1 -1
- package/dist/components/Prose.js +1 -1
- package/dist/components/SectionEditor.js +1 -1
- package/dist/components/SectionEyebrow.js +1 -1
- package/dist/components/SectionHeader.js +1 -1
- package/dist/components/Series.js +1 -1
- package/dist/components/SiteTextStylesField.js +1 -1
- package/dist/components/Split.js +1 -1
- package/dist/components/Stats.js +1 -1
- package/dist/components/StatsParagraph.js +1 -1
- package/dist/components/Testimonials.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/ThemeField.js +1 -1
- package/dist/components/Timeline.js +1 -1
- package/dist/components/TimelineTrack.js +1 -1
- package/dist/components/WebsiteScreenParts.js +1 -1
- package/dist/components/storefront-editor.css +96 -271
- package/dist/components/useLocationsTree.js +1 -1
- package/dist/components/usePinnedChromeState.d.ts +3 -0
- package/dist/components/usePinnedChromeState.js +1 -0
- package/dist/components/useWebsiteMainAction.js +1 -1
- package/dist/lib/content/phone-focus.d.ts +7 -0
- package/dist/lib/content/phone-focus.js +1 -0
- package/dist/lib/dealer-source.d.ts +34 -0
- package/dist/lib/dealer-source.js +1 -0
- package/dist/lib/editor-words-catalogue.d.ts +14 -5
- package/dist/lib/editor-words-catalogue.js +4 -4
- package/dist/lib/page-live-state.d.ts +2 -1
- package/dist/lib/page-live-state.js +1 -1
- package/dist/lib/puck/MarkupToolbar.d.ts +1 -1
- package/dist/lib/puck/MarkupToolbar.js +1 -1
- package/dist/lib/puck/blocks/general/Footprint/fields.js +1 -1
- package/dist/lib/puck/blocks/general/Footprint/render.js +2 -2
- package/dist/lib/puck/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/lib/puck/blocks/general/HeroSingle/render.js +1 -1
- package/dist/lib/puck/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/lib/puck/blocks/general/HeroSlide/render.js +1 -1
- package/dist/lib/puck/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/lib/puck/blocks/general/ImageBlock/render.js +1 -1
- package/dist/lib/puck/blocks/general/text-part-shapes.json +2162 -0
- package/dist/lib/puck/controls.d.ts +5 -2
- package/dist/lib/puck/controls.js +1 -1
- package/dist/lib/puck/field-groups.js +1 -1
- package/dist/lib/puck/media-manifest.json +7 -2
- package/dist/lib/puck/passes/clickable-parts.js +1 -1
- package/dist/lib/puck/passes/inspector.js +1 -1
- package/dist/lib/puck/passes/section-width.js +1 -1
- package/dist/lib/puck/passes/types.d.ts +3 -1
- package/dist/lib/puck/registry.d.ts +1 -1
- package/dist/lib/puck/registry.js +1 -1
- package/dist/lib/puck/render-registry.d.ts +3 -0
- package/dist/lib/puck/render-registry.js +1 -0
- package/dist/lib/puck/source-bound-parts.d.ts +2 -0
- package/dist/lib/puck/source-bound-parts.js +1 -1
- package/dist/lib/puck/text-part-shape.d.ts +18 -0
- package/dist/lib/puck/text-part-shape.js +2 -0
- package/dist/lib/sections/collection-card-text-regions.d.ts +9 -1
- package/dist/lib/sections/collection-card-text-regions.js +1 -1
- package/dist/lib/sections/text-regions.d.ts +1 -0
- package/dist/lib/sections/text-regions.js +1 -1
- package/dist/lib/site-text-styles.d.ts +1 -0
- package/dist/lib/site-text-styles.js +2 -2
- package/dist/lib/source-rules/heading-ceiling-sweep.js +3 -3
- package/dist/lib/source-rules/part-style-naming.js +2 -2
- package/dist/lib/source-rules/rule.d.ts +1 -0
- package/dist/lib/source-rules/rule.js +3 -1
- package/dist/lib/source-rules/size-token-paints.js +4 -4
- package/dist/lib/source-rules/style-face-matches-size.js +3 -3
- package/dist/lib/source-rules/support/registry-source.d.ts +1 -1
- package/dist/lib/source-rules/support/registry-source.js +3 -3
- package/package.json +9 -6
- package/dist/components/ImageFocusRow.d.ts +0 -7
- package/dist/components/ImageFocusRow.js +0 -1
- package/dist/components/TemplateGlyph.d.ts +0 -6
- package/dist/components/TemplateGlyph.js +0 -1
- package/dist/components/TextStyleRow.d.ts +0 -13
- package/dist/components/TextStyleRow.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as m}from"react/jsx-runtime";import{useEffect as Z,useRef as $,useState as z}from"react";import N from"./HeroPoster.js";import{HeroVideoBackdrop as ee,HeroVideoPlayer as oe}from"./HeroVideoPlay.js";import{resolveMedia as l}from"../lib/media.js";import{hasSectionHeight as re,resolveSectionHeight as M}from"../lib/content/section-height.js";import{DEFAULT_OVERLAY_COLOR as te,DEFAULT_OVERLAY_POSITION as se,overlayGradient as ne}from"../lib/sections/hero-overlay.js";import{ON_MEDIA_INK_STYLE as ie}from"../lib/content/ink.js";import{usePreviewHeroPart as ae}from"./PreviewHeroPartContext.js";import{tk as C}from"./floating-editor/tokens.js";import{HERO_PART_ATTR as ce,heroPartId as le,readHeroPartId as de}from"../lib/puck/hero-media-parts.js";import{markOverlayPortal as pe}from"../lib/puck/overlay-portal.js";import{hidableText as me}from"../lib/puck/hidable.js";import{normaliseVideoPlayback as ue,normaliseVideoSource as fe,parseYouTubeId as he}from"../lib/hero-video.js";import{heroPictureCount as xe,normaliseMediaLayout as ve,resolvePhoneLayout as ge}from"../lib/hero-media-layout.js";const D=`
|
|
2
2
|
.hero-part-pick { cursor: pointer; }
|
|
3
3
|
.hero-part-pick:hover {
|
|
4
|
-
outline: 2px solid color-mix(in srgb, ${
|
|
4
|
+
outline: 2px solid color-mix(in srgb, ${C.accent} 45%, transparent);
|
|
5
5
|
outline-offset: -2px;
|
|
6
6
|
}
|
|
7
7
|
.hero-part-pick[data-selected] {
|
|
8
|
-
outline: 2px solid ${
|
|
8
|
+
outline: 2px solid ${C.accent};
|
|
9
9
|
outline-offset: -2px;
|
|
10
10
|
}
|
|
11
|
-
`;function
|
|
11
|
+
`;function Pe({overlay:r=100,overlayColor:o=te,overlayPosition:y=se,mediaType:u="image",mediaSrc:i,poster:f,objectPosition:d,objectPositionPhone:p,tintColor:h="#000000",tintOpacity:n=0,heightDesktop:x,heightMobile:t,boxes:a,videoSource:k,youtubeUrl:v,videoPlayback:g,mediaLayout:S,mediaLayoutPhone:T,mediaImage2:F,objectPosition2:G,objectPosition2Phone:K,tintColor2:U="#000000",tintOpacity2:B=0,editing:s=!1}){const E=re(x,t),q=E?"h-[var(--sf-hero-h-m)] min-[720px]:h-[var(--sf-hero-h-d)]":"h-screen min-h-[680px]",J=E?{"--sf-hero-h-d":M(x),"--sf-hero-h-m":M(t)}:void 0,c=u==="video",R=c?l(i):void 0,O=c?l(f):l(i)??l(f),P=c&&fe(k)==="youtube",w=c&&ue(g)==="click",V=P?he(me(v)):null,A=c&&!P&&!w,[L,Q]=z(!1),_=!L,W=$(null),X=u==="video"?"media":"image",b=ve(S),I=ge(T,b),j=!c&&xe({mediaLayout:S,mediaLayoutPhone:T})>1;return m("section",{ref:W,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${q} max-w-[var(--sf-hero-cap,none)] overflow-hidden`,style:J,children:[j?m("div",{className:`absolute inset-0 z-[1] grid ${be[I]} ${ye[b]}`,"data-hero-layout":b,"data-hero-layout-phone":I,children:[s&&e("style",{children:D}),m(H,{part:"image",editing:s,className:"relative overflow-hidden",children:[e(N,{posterSrc:l(i),showVideo:!1,objectPosition:d,objectPositionPhone:p}),e(Y,{color:h,opacity:n})]}),m(H,{part:"image2",editing:s,className:`relative overflow-hidden${I==="one"?" max-[719px]:hidden":""}${b==="one"?" min-[720px]:hidden":""}`,children:[e(N,{posterSrc:l(F),showVideo:!1,objectPosition:G,objectPositionPhone:K}),e(Y,{color:U,opacity:B})]})]}):m(H,{part:X,editing:s,className:"absolute inset-0 z-[1]",children:[s&&e("style",{children:D}),e(N,{videoSrc:A?R:void 0,posterSrc:O,showVideo:A,objectPosition:d,objectPositionPhone:p}),P&&e(ee,{youTubeId:V,ownPoster:!!O,background:!w,editing:s})]}),w&&e(oe,{youTubeId:V,fileSrc:P?void 0:R,playing:L,onPlay:()=>Q(!0),editing:s}),_&&!j&&n>0&&e("div",{className:"pointer-events-none absolute inset-0 z-[2]",style:{background:h,opacity:Math.min(Math.max(n,0),100)/100}}),_&&e("div",{className:"pointer-events-none absolute inset-0 z-[2]",style:{background:ne(o,y),opacity:Math.min(Math.max(r,0),100)/100}}),_&&a&&e("div",{className:["sf-hero-group-layer absolute inset-0 z-[3] mx-auto","max-w-[min(var(--sf-page-cap,var(--sf-site-width,1600px)),var(--sf-site-width,1600px))]","px-[var(--sf-site-gutter,40px)] pt-[140px] pb-14",s?"sf-hero-group-layer-edit":""].filter(Boolean).join(" "),style:ie,children:e(a,{className:"sf-hero-group-zone",minEmptyHeight:160})})]})}const be={one:"max-[719px]:grid-cols-1 max-[719px]:grid-rows-1",side:"max-[719px]:grid-cols-2 max-[719px]:grid-rows-1",stacked:"max-[719px]:grid-cols-1 max-[719px]:grid-rows-2"},ye={one:"min-[720px]:grid-cols-1 min-[720px]:grid-rows-1",side:"min-[720px]:grid-cols-2 min-[720px]:grid-rows-1",stacked:"min-[720px]:grid-cols-1 min-[720px]:grid-rows-2"};function Y({color:r,opacity:o}){return o>0?e("div",{className:"pointer-events-none absolute inset-0 z-[2]",style:{background:r,opacity:Math.min(Math.max(o,0),100)/100}}):null}function H({part:r,editing:o,className:y,children:u}){const i=$(null),{selectedHeroPart:f,select:d}=ae(),[p,h]=z(null);Z(()=>{if(!o)return;const t=i.current;if(!t)return;const a=t.closest("[data-puck-component]")?.getAttribute("data-puck-component")??null;h(a);const k=pe(t),v=g=>{a&&(g.stopPropagation(),g.preventDefault(),d(le(a,r)))};return t.addEventListener("click",v,{capture:!0}),()=>{k(),t.removeEventListener("click",v,{capture:!0})}},[o,r,d]);const n=de(f),x=o&&p!=null&&n?.nodeId===p&&(n.part===r||n.part==="media");return e("div",{ref:i,className:`${y}${o?" hero-part-pick":""}`,...o?{[ce]:r}:{},"data-selected":x?"":void 0,children:u})}export{Pe as default};
|
|
@@ -19,6 +19,7 @@ export interface HeroSlideProps {
|
|
|
19
19
|
videoSpeed?: number;
|
|
20
20
|
poster?: string;
|
|
21
21
|
objectPosition?: string;
|
|
22
|
+
objectPositionPhone?: string;
|
|
22
23
|
tintColor?: string;
|
|
23
24
|
tintOpacity?: number;
|
|
24
25
|
themeClassName?: string;
|
|
@@ -26,5 +27,5 @@ export interface HeroSlideProps {
|
|
|
26
27
|
groups?: SlotComponent;
|
|
27
28
|
editing?: boolean;
|
|
28
29
|
}
|
|
29
|
-
export default function HeroSlide({ name, process, mediaType, mediaSrc, videoSpeed, poster, objectPosition, tintColor, tintOpacity, groups: Groups, editing, themeClassName, themeStyle, }: HeroSlideProps): import("react").JSX.Element;
|
|
30
|
+
export default function HeroSlide({ name, process, mediaType, mediaSrc, videoSpeed, poster, objectPosition, objectPositionPhone, tintColor, tintOpacity, groups: Groups, editing, themeClassName, themeStyle, }: HeroSlideProps): import("react").JSX.Element;
|
|
30
31
|
export declare const HERO_SLIDE_SEEDS: Record<string, unknown>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as N}from"react/jsx-runtime";import{createContext as k,useContext as H}from"react";import P from"./HeroPoster.js";import{resolveMedia as t}from"../lib/media.js";import{heroPhoneStackStyle as z}from"../lib/hero-phone-stack.js";import{heroTextureGradient as C,heroTextureShown as D}from"../lib/hero-texture.js";import{ON_MEDIA_INK_STYLE as M}from"../lib/content/ink.js";const T=k({});function V({name:i,process:r,mediaType:u="video",mediaSrc:s,videoSpeed:a,poster:n,objectPosition:f,objectPositionPhone:h,tintColor:x="#000000",tintOpacity:l=0,groups:d,editing:y=!1,themeClassName:p,themeStyle:v}){const{alignment:I="left",textureOpacity:c,textureOn:S,textureColor:g,quietVideo:b,phoneUpDown:w,phoneSideways:_}=H(T),o=u==="video",m=o?t(s):void 0,j=o?t(n):t(s)??t(n),E=typeof a=="number"?a/100:1;return N("section",{className:p?`relative h-full w-full overflow-hidden ${p}`:"relative h-full w-full overflow-hidden",style:v,"data-slide-name":i??"","data-slide-process":r??"","data-slide-media":m?"video":"still",children:[e(P,{videoSrc:m,posterSrc:j,showVideo:o,playbackRate:E,objectPosition:f,objectPositionPhone:o?void 0:h,quiet:b}),l>0&&e("div",{className:"absolute inset-0 z-[2]",style:{background:x,opacity:Math.min(Math.max(l,0),100)/100}}),D(S)&&e("div",{className:"absolute inset-0 z-[2]",style:{background:C(g),...c!==void 0?{opacity:c/100}:null}}),e("div",{className:["sf-hero-group-layer absolute inset-0 z-[3] mx-auto max-w-[min(var(--sf-page-cap,var(--sf-site-width,1600px)),var(--sf-site-width,1600px))] px-[var(--sf-site-gutter,40px)] pt-[140px] pb-14",y?"sf-hero-group-layer-edit":""].filter(Boolean).join(" "),style:{...M,...z(w,_)},children:d&&e(d,{className:"sf-hero-group-zone",minEmptyHeight:160})})]})}const K=Array.from({length:3},(i,r)=>({name:`Slide ${r+1}`,process:"Category",mediaType:"image",mediaVideo:"",poster:""}));export{K as HERO_SLIDE_SEEDS,T as HeroSlideStyleContext,V as default};
|
|
@@ -11,8 +11,9 @@ interface ImageBlockProps {
|
|
|
11
11
|
href?: string;
|
|
12
12
|
fit?: ImageFit;
|
|
13
13
|
focal?: string;
|
|
14
|
+
focalPhone?: string;
|
|
14
15
|
corners?: number;
|
|
15
16
|
cornerSides?: string[] | null;
|
|
16
17
|
}
|
|
17
|
-
export default function ImageBlock({ src, alt, aspect, contained, grayscale, href, width, fit, focal, corners, cornerSides, }: ImageBlockProps): import("react").JSX.Element;
|
|
18
|
+
export default function ImageBlock({ src, alt, aspect, contained, grayscale, href, width, fit, focal, focalPhone, corners, cornerSides, }: ImageBlockProps): import("react").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{SiteLink as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{SiteLink as I}from"../lib/site-runtime.js";import w from"./BlockFrame.js";import{useSitePhotography as $}from"./SitePhotographyContext.js";import{media as j}from"../lib/media.js";import{CONTENT_SIZES as C,sizedImage as F}from"../lib/sized-image.js";import{imageCornerStyle as z}from"../lib/content/image-corners.js";import{imageFitClass as T,imageIsCropped as E,parseImageFit as P}from"../lib/content/image-fit.js";import{resolveImageTreatment as B}from"../lib/content/image-treatment.js";import{imageWidthStyle as L}from"../lib/content/image-width.js";import{phoneFocus as O}from"../lib/content/phone-focus.js";const W={auto:"","21/9":"aspect-[21/9]","16/9":"aspect-[16/9]","4/3":"aspect-[4/3]","1/1":"aspect-square"};function _({src:t,alt:h,aspect:o,contained:u,grayscale:g,href:y,width:S,fit:N,focal:m,focalPhone:b,corners:k,cornerSides:v}){const l=B(g,$()),c=L(S),n=P(N,"cover"),f=z(k,v),d=E(o,n),a=O(d?b:void 0),p={...l.style??{},...m&&d?{objectPosition:m}:{},...a.style},s=t?F(j(t)):null,i=t&&s?e("img",{src:s.src,...s.srcSet?{srcSet:s.srcSet,sizes:C}:{},alt:h,className:`h-full w-full ${o==="auto"?"":T(n)}${l.className?` ${l.className}`:""}${a.className?` ${a.className}`:""}`,...Object.keys(p).length?{style:p}:{}}):e("div",{className:"flex aspect-[16/9] items-center justify-center border border-dashed border-line font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim",children:"Image — set a path"}),r=(y??"").trim(),x=r&&t?r.startsWith("/")?e(I,{href:r,className:"block h-full w-full",children:i}):e("a",{href:r,className:"block h-full w-full",children:i}):i;return e(w,{contained:u,className:"py-6",children:e("figure",{...c?{style:c}:{},children:e("div",{className:`relative w-full overflow-hidden bg-surface ${W[o]}`,...f?{style:f}:{},children:x})})})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as u}from"react/jsx-runtime";import{SiteLink as b}from"../lib/site-runtime.js";import v from"./SectionEyebrow.js";import{renderGold as k,renderHeadline as y}from"./goldPhrases.js";import{say as N}from"../lib/editor-words.js";const c={headingMediumUpTo800:"max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",body:"text-[length:var(--size-body,17px)]"};function M({look:x,eyebrow:t,title:s,items:f,columns:g,editing:i=!1}={}){const h=Math.min(4,Math.max(2,g??3)),n=(f??[]).filter(r=>i||(r.label??"").trim()),d=!!(t??"").trim()||!!(s??"").trim();return!i&&!d&&n.length===0?null:e("section",{className:"relative z-[2] border-y border-line bg-surface",children:o("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[76px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[d&&o("div",{className:"mb-11 flex flex-wrap items-baseline gap-5 max-[800px]:mb-8",children:[(t??"").trim()&&e(v,{text:t??"",look:x}),(s??"").trim()&&e("h2",{className:`font-heading2 ${c.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg ${c.headingMediumUpTo800}`,children:y(s??"",!1)})]}),n.length>0&&e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--kf-cols),minmax(0,1fr))]",style:{"--kf-cols":String(h)},children:n.map((r,m)=>{const l=o(u,{children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] flex-shrink-0 rotate-45 bg-accent"}),e("span",{className:`font-display ${c.body} font-medium uppercase tracking-[0.06em] text-fg transition-colors group-hover/kf:text-accent`,children:k((r.label??"").trim()||N("Feature"))})]}),a=(r.href??"").trim();if(a&&!i){const p="group/kf flex items-center gap-4 bg-bg px-7 py-[30px] transition-colors hover:bg-surface";return a.startsWith("/")?e(b,{href:a,className:p,children:l},m):e("a",{href:a,className:p,children:l},m)}return e("div",{className:"flex items-center gap-4 bg-bg px-7 py-[30px]",children:l},m)})})]})})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,jsxs as t}from"react/jsx-runtime";function i({groupKey:s,name:
|
|
1
|
+
import{jsx as n,jsxs as t}from"react/jsx-runtime";const e={headingSmall:"text-[length:var(--size-headingSmall,24px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function i({groupKey:s,name:a,count:l}){return t("div",{className:"mb-5 flex items-end justify-between gap-4 border-b border-line pb-4",children:[n("span",{className:`font-mono ${e.labelLarge} uppercase tracking-[0.3em] text-accent`,children:s}),a?n("span",{className:`font-heading3 ${e.headingSmall} font-medium uppercase tracking-[-0.01em]`,children:a}):null,t("span",{className:`font-mono ${e.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:[l," location",l===1?"":"s"]})]})}export{i as LocationGroupHeader};
|
package/dist/components/Logos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as f}from"react/jsx-runtime";import x from"./BlockFrame.js";import{renderChrome as u,renderHeadline as d}from"./goldPhrases.js";import{media as y}from"../lib/media.js";import{sizedImage as h}from"../lib/sized-image.js";const c={label:"text-[length:var(--size-label,13px)]"};function g({items:l,contained:e,heading:s,columns:n,grayscale:i,logoHeight:o,bandPadding:a}){const m=n!=null?{flex:`0 0 calc((100% - ${(n-1)*3.5}rem) / ${n})`}:void 0;return f(x,{contained:e,className:a==null?"py-10":"",style:a==null?void 0:{paddingTop:`${a}px`,paddingBottom:`${a}px`},children:[s!=null&&s!==""?t("h2",{className:`mb-8 text-center font-mono ${c.label} uppercase tracking-[0.2em] text-fg-dim`,children:d(s,!1)}):null,t("div",{className:"flex flex-wrap items-center justify-center gap-x-14 gap-y-8",children:(l??[]).map((r,p)=>t("div",{className:"text-center",style:m,children:r.src?t("img",{...$(y(r.src)),alt:r.alt,className:["mx-auto w-auto opacity-60 transition-opacity hover:opacity-100",o==null?"h-7":"",i===!1?"":"grayscale"].filter(Boolean).join(" "),style:o==null?void 0:{height:`${o}px`}}):t("span",{className:`font-mono ${c.label} uppercase tracking-[0.2em] text-fg-dim`,children:u(r.alt||"Logo")})},p))})]})}function $(l){const e=h(l,{fallbackWidth:640,maxWidth:960});return e.srcSet?{src:e.src,srcSet:e.srcSet,sizes:"240px"}:{src:l}}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as d}from"react/jsx-runtime";import{sectionRunsFullWidth as _}from"../lib/content/section-width.js";import{Fragment as k}from"react";import{SiteLink as E}from"../lib/site-runtime.js";import{stripMarkup as F}from"../lib/markup.js";import B from"./EditorialSectionHead.js";import C from"./Placeholder.js";import G from"./SectionEyebrow.js";import{renderGold as a,renderHeadline as w}from"./goldPhrases.js";const t={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,17px)]",bodyLarge:"text-[length:var(--size-body,22px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function I({headNum:z,headTitle:c,headDesc:f,category:g,metaMiddle:b,readLabel:h,title:l,dek:u,quote:i,quoteAttribution:s,ctaText:v,ctaHref:S,image:L,imageLabel:y,metaPublished:p,metaReads:o,omitHead:x=!1,...$}){const N=[g?e("span",{className:"text-accent",children:a(g)}):null,b?e("span",{children:a(b)}):null,h?e("span",{children:a(h)}):null].filter(Boolean),j=!!p||!!o;return r("section",{className:_($)?x?"border-b border-line px-[var(--sf-site-gutter,40px)] pt-0 pb-[120px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-0 max-[1100px]:pb-20":"border-b border-line px-[var(--sf-site-gutter,40px)] py-[120px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:py-20":x?"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] pt-0 pb-[120px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-0 max-[1100px]:pb-20":"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] py-[120px] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:py-20",children:[x?null:e(B,{num:z,title:c?w(c,!0):void 0,desc:f?a(f):void 0}),r("article",{className:"sf-card grid min-h-[640px] grid-cols-[1fr_1.2fr] border border-line max-[1100px]:grid-cols-1",children:[r("div",{className:"flex flex-col justify-center gap-7 border-r border-line bg-surface px-14 py-16 max-[1100px]:border-r-0 max-[1100px]:border-b max-[1100px]:px-7 max-[1100px]:py-12",children:[N.length>0&&e("div",{className:`flex items-center gap-3.5 font-mono ${t.labelSmall} uppercase tracking-[0.3em] text-fg-dim`,children:N.map((m,n)=>r(k,{children:[n>0&&e("span",{className:"opacity-40",children:"·"}),m]},n))}),l&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4.2vw,68px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.035em]",children:w(l,!0)}),u&&e("p",{className:`font-serif ${t.bodyLarge} italic leading-[1.45] text-fg`,children:a(u)}),(i||s)&&r("blockquote",{className:`max-w-[520px] border-l-2 border-accent py-1.5 pl-[22px] font-serif ${t.body} italic leading-[1.6] text-fg-dim`,children:[i&&r(d,{children:["“",a(i),"”"]}),s&&e("strong",{className:`mt-2.5 block font-display ${t.bodySmall} font-normal not-italic uppercase tracking-[0.22em] text-fg`,children:a(s)})]}),v&&r(E,{href:S||"#",className:`inline-flex items-center gap-3.5 self-start border border-btn px-7 py-4 font-mono ${t.labelLarge} uppercase tracking-[0.3em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,children:[a(v)," ",e("span",{children:"→"})]})]}),r("div",{className:"relative overflow-hidden bg-surface-2 max-[1100px]:aspect-[4/3]",children:[e(C,{label:"long-read",src:L||void 0,alt:F(l||"Long read"),sizes:"(max-width: 1100px) 100vw, 56vw"}),e("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg, rgba(10,10,10,0.55) 0%, transparent 25%, transparent 60%, rgba(10,10,10,0.7) 100%)"}}),y&&e(G,{text:y,size:12,className:"absolute right-6 top-6 z-[2]"}),j&&e("div",{className:`absolute bottom-6 left-6 z-[2] font-mono ${t.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-overlay-fg`,children:[p?r(d,{children:[e("strong",{className:"font-normal text-accent",children:"Published"})," ",a(p)]}):null,o?r(d,{children:[e("strong",{className:"font-normal text-accent",children:"Reads in"})," ",a(o)]}):null].filter(Boolean).map((m,n)=>r(k,{children:[n>0&&e("br",{}),m]},n))})]})]})]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import h from"./AnimatedStat.js";import b from"./Placeholder.js";import{useSitePhotography as v}from"./SitePhotographyContext.js";import y from"./SectionEyebrow.js";import{renderGold as w,renderHeadline as j,splitParagraphs as N}from"./goldPhrases.js";import{resolveImageTreatment as M}from"../lib/content/image-treatment.js";import{sectionRunsFullWidth as _}from"../lib/content/section-width.js";const i={headingMediumUpTo800:"max-[800px]:text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,56px),var(--sf-heading-max,9999px))]",body:"text-[length:var(--size-body,16px)]"};function T({eyebrow:s,heading:d,body:x,stats:p,imageSrc:c,grayscale:f,...g}={}){const u=M(f,v()),l=s||null,n=d||null,m=x||null,r=(p??[]).filter(a=>(a.value??"").trim()!==""||(a.label??"").trim()!=="");return e("section",{className:"relative z-[2] bg-bg p-0",children:o("div",{className:"grid h-screen min-h-[100vh] grid-cols-2 border-y border-line max-[960px]:h-auto max-[960px]:grid-cols-1",children:[e("div",{className:"flex flex-col justify-center border-r border-line px-[var(--sf-site-gutter,40px)] py-[100px] max-[960px]:order-2 max-[960px]:border-r-0 max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[960px]:py-[60px]",children:o("div",{className:_(g)?"flex w-full flex-col gap-7":"ml-auto flex w-full flex-col gap-7 max-w-[calc(var(--sf-site-width,1600px)/2_-_var(--sf-site-gutter,40px)*2_-_1px)] max-[960px]:ml-0 max-[960px]:max-w-none",children:[l!==null&&e(y,{text:l,size:14}),n!==null&&e("h2",{className:`font-heading2 ${i.headingMedium} font-normal leading-[1.05] tracking-[-0.03em] ${i.headingMediumUpTo800} max-[800px]:leading-[1]`,children:j(n,!0)}),m!==null&&N(m).map((a,t)=>e("p",{className:`max-w-[520px] ${i.body} leading-[1.7] text-fg-dim`,children:w(a)},t)),r.length>0&&e("div",{className:"mt-4 grid max-w-[520px] gap-6 border-t border-line pt-7",style:{gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`},children:r.map((a,t)=>e(h,{target:a.value??"",label:a.label??""},t))})]})}),e("div",{className:"sf-card relative flex items-center justify-center bg-surface overflow-hidden max-[960px]:aspect-[4/3]",children:e(b,{label:"manifesto",src:c||void 0,objectFit:"cover",objectPosition:"center",treatment:u})})]})})}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as u,jsxs as a}from"react/jsx-runtime";import{sectionRunsFullWidth as N}from"../lib/content/section-width.js";import w from"./SectionEyebrow.js";import{renderGold as l,renderHeadline as j,splitParagraphs as k}from"./goldPhrases.js";const s={body:"text-[length:var(--size-body,18px)]",headingSmall:"text-[length:var(--size-headingSmall,20px)]",label:"text-[length:var(--size-label,13px)]"};function S({eyebrow:n,issueMeta:c,lead:g,issueHeading:i,issueList:h,issueTotal:x,...f}){const p=(c??[]).filter(t=>(t?.lead??"").trim()||(t?.rest??"").trim()),o=(h??[]).map(t=>t?.text??"").filter(t=>t.trim()),m=k(g??""),b=!!n||p.length>0,d=!!i||o.length>0||!!x,v=m.length>0||d;return a("section",{className:N(f)?"border-b border-line px-[var(--sf-site-gutter,40px)] pt-20 pb-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-[60px] max-[1100px]:pb-8":"mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line px-[var(--sf-site-gutter,40px)] pt-20 pb-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-[60px] max-[1100px]:pb-8",children:[b&&a("div",{className:"flex items-end justify-between gap-[60px] pb-8 max-[1100px]:flex-col max-[1100px]:items-start max-[1100px]:gap-4",children:[n&&e(w,{text:n,size:14,className:"pb-3.5"}),p.length>0&&e("div",{className:`pb-3.5 text-right font-mono ${s.label} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-[1100px]:text-left`,children:p.map((t,r)=>a("div",{children:[e("strong",{className:"font-normal text-fg",children:l(t.lead??"")}),t.rest?.trim()?a(u,{children:[" ",l(t.rest)]}):null]},r))})]}),v&&a("div",{className:"grid grid-cols-[1fr_auto] items-start gap-[60px] border-t border-line pt-8 max-[1100px]:grid-cols-1 max-[1100px]:gap-4",children:[m.length>0&&e("div",{className:"max-w-[720px]",children:m.map((t,r)=>e("p",{className:`font-heading3 ${s.headingSmall} leading-[1.5] tracking-[-0.005em] text-fg [&:not(:first-child)]:mt-4`,children:l(t,!0)},r))}),d&&a("div",{className:`min-w-[240px] text-right font-mono ${s.label} uppercase leading-[1.9] tracking-[0.22em] text-fg-dim max-[1100px]:text-left`,children:[i&&e("strong",{className:`mb-1.5 block font-display ${s.body} font-normal tracking-[-0.01em] normal-case text-fg`,children:j(i,!1)}),o.map((t,r)=>a("span",{children:[l(t),e("br",{})]},r)),x&&e("span",{className:"text-accent",children:l(x)})]})]})]})}export{S as default};
|
|
@@ -4,6 +4,8 @@ interface Props {
|
|
|
4
4
|
label: string;
|
|
5
5
|
accept: string;
|
|
6
6
|
placeholder?: string;
|
|
7
|
+
focusKey?: string;
|
|
8
|
+
focusWhen?: (props: Record<string, unknown>) => boolean;
|
|
7
9
|
}
|
|
8
|
-
export default function MediaUploadField({ value, onChange, label, accept, placeholder }: Props): import("react").JSX.Element;
|
|
10
|
+
export default function MediaUploadField({ value, onChange, label, accept, placeholder, focusKey, focusWhen }: Props): import("react").JSX.Element;
|
|
9
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{SettingsDefaultReset as x,SettingsField as h}from"efficient-easel/panel";import{useSelectedFields as y}from"efficient-easel/easel";import{FOCAL_DEFAULT as C}from"efficient-shell/format";import{ImageIcon as v,PlayIcon as w}from"efficient-easel/icons";import{ImageBox as F}from"efficient-easel/pick";import{useEaselStrings as I}from"efficient-easel/strings";import{useContext as L}from"react";import{StorefrontDocumentContext as B}from"./StorefrontDocumentContext.js";import{editorEaselWords as D,say as a}from"../lib/editor-words.js";import{PHONE_CLEAR as P,phoneKey as A}from"../lib/puck/phone-override.js";import{usePreviewDevice as O}from"./PreviewDeviceContext.js";import{requestMediaPick as R}from"../lib/editor-media-picker.js";import{useEditorHost as T}from"../lib/editor-host.js";import{backendOf as U}from"../lib/website-session.js";import{useEditorSession as _}from"../lib/editor-session-context.js";function j(t,d){let e=null;try{e=y()}catch{e=null}const n=O()==="mobile";if(!t||!e||d&&!d(e.values??{}))return null;const r=typeof e.values?.[t]=="string"&&e.values[t]?String(e.values[t]):C,i=A(t),m=typeof e.values?.[i]=="string"&&e.values[i]?String(e.values[i]):void 0,c=e.onChange;return{phone:n,desktop:r,own:m,focus:n?m??r:r,set:p=>c(n?i:t,p),clear:()=>c(i,P)}}function H({value:t,onChange:d,label:e,accept:n,placeholder:r,focusKey:i,focusWhen:m}){const c=T(),p=_(),b=I(),u=a(e),l=n.startsWith("video"),s=j(l?void 0:i,m),f=L(B),E=g=>R(c,{accept:n,title:u,...g?{file:g}:{}}).then(S=>S?.url??null);if(f&&!f.capabilities.mediaEditing)return o(h,{label:u,icon:l?o(w,{}):o(v,{}),children:o("div",{className:"sf-image-slot-inert",children:l?a("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):a("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const k=s?.phone&&t?o(x,{words:D()?.panel,label:a("Image focus"),changed:!!s.own,detail:a("{value} on desktop",{value:s.desktop}),onReset:s.clear}):void 0;return o(h,{label:u,icon:l?o(w,{}):o(v,{}),action:k,children:o(F,{value:t,onChange:d,label:u,kind:l?"video":"image",placeholder:r===void 0?void 0:a(r),openLibrary:E,maxSizeBytes:U(p).media.maxUploadBytes,...s?{focus:s.focus,onFocusChange:s.set}:{},words:b.pick.image})})}export{H as default};
|
|
@@ -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:"✕"}):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
|
+
import{jsx as e,jsxs as r,Fragment as T}from"react/jsx-runtime";import{renderGold as te,renderHeadline as re}from"./goldPhrases.js";const B={headingMediumUpTo800:"max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]"},C="#ffffff",d="#16181d",o="#5b6470",u="#9aa3ae",p="#f4f6f8",m="#e3e7ec",g="#1f9d55";function ne({rows:n}){return e("div",{className:"flex flex-col gap-3",children:n.map((l,c)=>{const t=l.state??"ok",s=t==="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:[t==="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:t==="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:t==="ok"?g:t==="warn"?"var(--accent)":u},children:l.status})]},c)})})}const E=["#c7cdd5","var(--accent)","#c7cdd5",g];function se({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((t,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:E[c%E.length]}}),e("span",{className:"block text-[11px] font-semibold leading-snug",style:{color:d},children:t})]},s))]},c))})}function ce({heading:n,bars:l}){const c=Math.max(...l.map(s=>s.value),0)||1,t=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===t?"var(--accent)":i%2?"#c7cdd5":"#9aa3ae"}}),r("span",{className:"text-[12px]",style:{color:o},children:[s.value,"%"]})]},i))})]})}function I({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 de({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,t)=>c.startsWith("$ ")?r("div",{children:[e("span",{style:{color:"var(--accent)"},children:"$ "}),e("span",{style:{color:"#f4f6f2"},children:c.slice(2)})]},t):c.startsWith("✓")?e("div",{style:{color:"#6fcf7e"},children:c},t):e("div",{style:{color:"rgba(244,246,242,0.55)"},children:c},t)),e("div",{"aria-hidden":!0,className:"mt-1 h-[15px] w-[8px]",style:{background:"var(--accent)"}})]})]})}function ie({urlText:n,heroTitle:l,heroButton:c,products:t}){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(I,{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})]}),t.length>0&&e("div",{className:"grid grid-cols-3 gap-3 p-4",children:t.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(I,{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 oe({eyebrow:n,title:l,body:c,variant:t="spec-card",cardHeader:s,badge:i,cardTitle:f,cardSubtitle:b,pills:F,tiles:W,rows:K,button:_,footnote:M,col1Title:G,col1Cards:L,col2Title:U,col2Cards:O,col3Title:P,col3Cards:z,col4Title:S,col4Cards:X,barsHeading:Z,bars:q,termLines:J,urlText:Q,heroTitle:j,heroButton:V,products:Y,align:H="right",editing:x=!1}={}){const y=(F??[]).filter(a=>x||(a.value??"").trim()),v=(W??[]).filter(a=>x||(a.label??"").trim()),N=(K??[]).filter(a=>x||(a.lead??"").trim()),k=[[G,L],[U,O],[P,z],[S,X]].map(([a,h])=>({title:(a??"").trim(),cards:(h??[]).map(ae=>(ae.text??"").trim()).filter(Boolean)})).filter(a=>a.title||a.cards.length>0),w=(q??[]).map(a=>({label:(a.label??"").trim(),value:parseFloat(a.value??"")})).filter(a=>a.label&&Number.isFinite(a.value)),A=(J??[]).map(a=>a.text??"").filter(a=>x||a.trim()),R=(Y??[]).map(a=>({name:(a.name??"").trim(),price:(a.price??"").trim()})).filter(a=>a.name),ee=!!(n??"").trim()||!!(l??"").trim(),le=!!(s??"").trim()||!!(f??"").trim()||y.length>0||v.length>0||N.length>0||k.length>0||w.length>0||R.length>0||A.length>0||!!(j??"").trim();if(!x&&!ee&&!le)return null;const $=r("div",{className:`w-full overflow-hidden rounded-2xl shadow-[0_24px_60px_rgba(0,0,0,0.35)] ${t==="kanban"||t==="browser"||t==="terminal"?"max-w-[600px]":"max-w-[520px]"}`,style:{background:C},children:[t!=="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]})]}),t==="terminal"?e(de,{header:s??"",lines:A}):t==="browser"?e(ie,{urlText:Q??"",heroTitle:j??"",heroButton:V??"",products:R}):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})]}),t==="fitment"&&y.length>0&&e("div",{className:"flex flex-wrap gap-2.5",children:y.map((a,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:a.label}),e("span",{className:"text-[13px] font-bold",style:{color:d},children:a.value})]},h))}),t!=="fitment"&&v.length>0&&e("div",{className:"grid grid-cols-2 gap-3",children:v.map((a,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:a.label}),e("div",{className:"mt-1 text-[17px] font-bold",style:{color:d},children:a.value})]},h))}),N.length>0&&e(ne,{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:_}),t==="kanban"&&k.length>0&&e(se,{columns:k}),t==="claims"&&w.length>0&&e(ce,{heading:Z??"",bars:w}),(M??"").trim()&&e("div",{className:"border-t pt-4",style:{borderColor:m},children:e("span",{className:"text-[15px] font-bold",style:{color:"var(--accent)"},children:M})})]})]}),D=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 ${B.headingMedium} font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg ${B.headingMediumUpTo800}`,children:re(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:H==="left"?r(T,{children:[e("div",{className:"flex justify-center min-[960px]:justify-start",children:$}),D]}):r(T,{children:[D,e("div",{className:"flex justify-center min-[960px]:justify-end",children:$})]})})})}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import h from"./BlockFrame.js";import f from"./SectionEyebrow.js";import{renderGold as n,renderHeadline as u}from"./goldPhrases.js";const x={headingMediumUpTo800:"max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]"};function g({eyebrow:m,title:r,rows:c,subRows:d,totalLabel:l,totalAmount:s,note:p,contained:o}){return e(h,{contained:o,className:"py-6",children:i("div",{className:"sf-card mx-auto max-w-[560px] border border-line bg-surface px-8 py-9 max-[800px]:px-5 max-[800px]:py-6",children:[m&&e(f,{text:m,scaled:!1}),r&&e("h2",{className:`mt-2 font-heading2 ${x.headingMedium} font-medium leading-[1.1] tracking-[-0.02em] ${x.headingMediumUpTo800}`,children:u(r,!1)}),c.length>0&&e("ul",{className:"mt-6 flex flex-col",children:c.map((a,t)=>i("li",{className:"flex items-baseline justify-between gap-4 border-t border-line py-3 first:border-t-0",children:[i("span",{className:"min-w-0",children:[a.label&&e("span",{className:"block text-[15px]",children:n(a.label)}),a.meta&&e("span",{className:"block font-mono text-[12px] uppercase tracking-[0.12em] opacity-60",children:n(a.meta)})]}),a.amount&&e("span",{className:"text-[15px] tabular-nums",children:n(a.amount)})]},t))}),d.length>0&&e("ul",{className:"mt-1 flex flex-col border-t border-line pt-3",children:d.map((a,t)=>i("li",{className:"flex items-baseline justify-between gap-4 py-1",children:[e("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] opacity-70",children:a.label&&n(a.label)}),a.amount&&e("span",{className:"text-[14px] tabular-nums opacity-85",children:n(a.amount)})]},t))}),(l||s)&&i("div",{className:"mt-4 flex items-baseline justify-between gap-4 border-t border-line pt-4",children:[l&&e("span",{className:"font-mono text-[13px] uppercase tracking-[0.3em]",children:n(l)}),s&&e("span",{className:"font-display text-[26px] font-medium text-accent tabular-nums",children:n(s)})]}),p&&e("p",{className:"mt-4 text-[13px] leading-[1.6] opacity-60",children:n(p)})]})})}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,Fragment as F,jsxs as h}from"react/jsx-runtime";import{Fragment as ge,useEffect as fe,useId as he,useMemo as Y,useState as u}from"react";import{useStorefrontDocument as be}from"./StorefrontDocumentContext.js";import I from"./UiIcon.js";import ye from"./SidePanelHead.js";import{useWebsiteName as we}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as Pe}from"efficient-easel/chrome";import{Button as J,Dialog as ke,FormField as Se,Input as Q,toast as V}from"efficient-shell/ui";import{LayersTree as Ce,TreeGroupLabel as Ie,TreeRow as X,TreeRowAction as O}from"efficient-easel/tree";import{AddIcon as Ne,PageIcon as Ae}from"efficient-easel/icons";import{PagesIcon as Re}from"efficient-easel/rail";import{useEditorHost as ve}from"../lib/editor-host.js";import{bucketEditorPageRows as xe,DYNAMIC_PAGES_GROUP_KEY as Ee,isDynamicPageRow as Le,MAIN_PAGES_GROUP as De}from"../lib/editor-page-rows.js";import{useEditorSession as Fe}from"../lib/editor-session-context.js";import{holdPageRow as _,usePageRows as Oe}from"../lib/page-rows.js";import{say as t}from"../lib/editor-words.js";const Z="sf-editor-pages-collapsed-groups",_e=r=>r.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),ee=(r,b)=>{const d=_e(r)||"page";if(!b.has(d))return d;let m=2;for(;b.has(`${d}-${m}`);)m+=1;return`${d}-${m}`};function ze({onNavigate:r,onClose:b,activeSurface:d,onPreviewSurface:m}){const y=Fe().chrome?.pageRows,z=ve(),{adapter:N,capabilities:p,ready:G,currentSlug:B}=be(),ne=we(),{rows:c,reload:te,setRows:M,getRows:ae}=Oe(),[A,se]=u(""),[g,T]=u(!1),[w,P]=u(null),[U,k]=u(!1),[f,R]=u(""),W=he(),[v,oe]=u(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(Z);return new Set(e?JSON.parse(e):[])}catch{return new Set}});fe(()=>{try{window.localStorage.setItem(Z,JSON.stringify([...v]))}catch{}},[v]);const le=e=>oe(s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a}),re=Y(()=>xe(c??[]),[c]),x=A.trim().toLowerCase(),$=e=>!x||e.toLowerCase().includes(x),ie=e=>x?!0:!v.has(e),j=Y(()=>new Set((c??[]).map(e=>e.slug)),[c]),de=()=>{if(p.pageCreationInAdminForm){z.send("storefront-editor:new-page");return}R(""),P(null),k(!0)},H=async()=>{const e=f.trim();if(!(!e||!G||g||!N.createPage)){T(!0),P(null);try{const s=await N.createPage({slug:ee(e,j),title:e,layout:{}});await te(),k(!1),R(""),r(s.slug)}catch{P(t("Couldn’t add the page — please retry."))}finally{T(!1)}}},ce=e=>{const s=c??[],a=N.deletePage;if(!G||g||!a||s.length<=1)return;const o=s.findIndex(i=>i.id===e.id),l=s.filter(i=>i.id!==e.id),S=e.slug===B;_(e.id,!0),M(l),P(null),S&&l[0]&&r(l[0].slug);const C=()=>{_(e.id,!1);const i=ae()??[];if(i.some(pe=>pe.id===e.id))return;const D=[...i];D.splice(Math.max(0,Math.min(o,D.length)),0,e),M(D)};V.undoable(t("Deleted “{name}”",{name:e.label}),{actionLabel:t("Undo"),commit:async i=>{await a(e.id,i),_(e.id,!1)},undo:()=>{C(),S&&r(e.slug)},onFail:()=>{C(),V.error(t("Couldn’t delete the page — please retry."))}})},ue=e=>z.send("storefront-editor:open-page",{slug:e}),me=e=>{if(!$(e.label))return null;const s=!d&&e.slug===B,a=p.canDeletePagesInline&&(c??[]).length>1,o=Le(e),l=e.kind==="lightbox",S=o||l||e.draft?h(F,{children:[o&&n("span",{className:"sf-badge-dynamic",children:t("Dynamic")}),l&&n("span",{className:"sf-badge-lightbox",children:t("Lightbox")}),e.draft&&n("span",{className:"sf-page-draft",children:t("draft")})]}):void 0,C=p.pageCreationInAdminForm||a?h(F,{children:[p.pageCreationInAdminForm&&n(O,{kind:"plain",label:t("Edit “{name}” in {place}",{name:e.label,place:t("the admin")}),onClick:()=>ue(e.slug),children:n(I,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})}),a&&n(O,{kind:"delete",label:t("Delete “{name}”",{name:e.label}),disabled:g,onClick:()=>ce(e),children:n(I,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})]}):void 0;return n(X,{icon:n(Ae,{size:14}),name:e.label,selected:s,onSelect:()=>r(e.slug),preview:S,actions:C,rowProps:{"data-page-slug":e.slug}},e.id)},E=(e,s,a)=>{const o=a.filter(Boolean);if(o.length===0)return null;const l=ie(e);return h(ge,{children:[n(Ie,{count:o.length,expanded:l,onToggle:()=>le(e),children:s}),l&&o]},e)},q=(y?.rows??[]).filter(e=>$(e.label)).map(e=>{const s=d===e.key;return n(X,{icon:e.icon,name:e.label,selected:s,onSelect:()=>m(e.key),preview:n("span",{className:"sf-badge-preview",children:t("Preview")}),actions:n(O,{kind:"plain",label:t("Open the {name} in a new tab",{name:e.label}),onClick:()=>window.open(e.href,"_blank","noopener,noreferrer"),children:n(I,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})}),rowProps:{"data-shop-surface":e.key}},e.key)}),K=p.hasSiteSettings&&!!y,L=(()=>{if(c===null)return null;const e=[];let s=!1;for(const a of re){K&&!s&&a.key.startsWith("system:")&&(e.push(E("shop",y.title,q)),s=!0);const o=a.key===Ee||a.label===De?t(a.label):a.label;e.push(E(a.key,o,a.rows.map(me)))}return K&&!s&&e.push(E("shop",y.title,q)),e})();return h("div",{className:"sf-pages",children:[n(ye,{icon:n(Re,{}),title:t("Pages"),context:ne,actions:n(Pe,{label:t("New page"),onClick:de,children:n(Ne,{size:15})}),onHide:b}),n("div",{className:"sf-pages-find",children:n(Q,{type:"search",leftIcon:n(I,{name:"search",size:14,rounded:!0}),placeholder:t("Search all pages…"),value:A,onChange:e=>se(e.target.value),"aria-label":t("Search all pages")})}),w&&!U&&n("div",{className:"sf-note sf-note--error",role:"alert",children:w}),L===null?n("div",{className:"sf-note",children:t("Loading…")}):L.some(Boolean)?n(Ce,{ariaLabel:t("Pages"),className:"sf-scroll",children:L}):n("div",{className:"sf-note",children:A.trim()?t("No pages match your search"):t("No pages yet. Add one with + above.")}),n(ke,{open:U,onClose:()=>k(!1),size:"sm",title:t("Add a page"),description:t("Give the new template page a name. It starts blank — add sections once it opens."),footer:h(F,{children:[n(J,{variant:"secondary",onClick:()=>k(!1),children:t("Cancel")}),n(J,{onClick:()=>{H()},disabled:g||!f.trim(),loading:g,children:t("Add page")})]}),children:n(Se,{label:t("Page name"),htmlFor:W,hint:f.trim()?t("URL: /{slug}",{slug:ee(f,j)}):void 0,error:w??void 0,children:n(Q,{id:W,value:f,invalid:!!w,onChange:e=>R(e.target.value),onKeyDown:e=>{e.key==="Enter"&&H()},placeholder:t("e.g. About")})})})]})}export{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l,jsxs as n}from"react/jsx-runtime";import{renderGold as t,renderHeadline as S,splitParagraphs as u}from"./goldPhrases.js";const e={bodyUpTo720Small:"max-[720px]:text-[length:var(--size-body,12px)]",bodyUpTo720Large:"max-[720px]:text-[length:var(--size-body,16px)]",headingSmallUpTo720:"max-[720px]:text-[length:var(--size-headingSmall,20px)]",labelUpTo720:"max-[720px]:text-[length:var(--size-label,10px)]",bodySmall:"text-[length:var(--size-body,14px)]",bodyLarge:"text-[length:var(--size-body,18px)]",headingSmall:"text-[length:var(--size-headingSmall,22px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function N({eyebrow:i,stats:h,lead:r,foundersHeading:s,foundersBody:p,attribution:x,padTop:o,padBottom:g}={}){const b=typeof o=="number"?o:60,v=typeof g=="number"?g:80,m=(h??[]).filter(a=>(a.value??"").trim()!==""||(a.label??"").trim()!==""),f=!!i||m.length>0,c=!!(s||p||x);return l("section",{className:"relative z-[2] bg-bg",children:n("div",{className:"mx-auto max-w-[var(--sf-site-width,1600px)] overflow-hidden border-b border-line px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",style:{paddingTop:b,paddingBottom:v},children:[f&&n("div",{className:"mb-[40px] grid grid-cols-3 gap-[60px] border-b border-line pb-[40px] max-[1100px]:grid-cols-1 max-[1100px]:gap-6",children:[l("div",{className:"col-span-2 max-[1100px]:col-span-1",children:i&&l("span",{className:`font-mono ${e.labelSmall} uppercase tracking-[0.24em] text-fg-dim`,children:t(i)})}),m.length>0&&l("div",{className:`text-right font-mono ${e.labelLarge} uppercase leading-[1.8] tracking-[0.18em] text-fg-dim max-[1100px]:text-left`,children:m.map((a,d)=>n("div",{children:[a.value?l("strong",{className:"font-normal text-fg",children:t(a.value)}):null," ",a.label?t(a.label):null]},d))})]}),(r||c)&&n("div",{className:"grid grid-cols-3 gap-[60px] max-[1100px]:grid-cols-1 max-[1100px]:gap-7",children:[r&&l("div",{className:"col-span-2 max-[1100px]:col-span-1",children:u(r).map((a,d)=>l("p",{className:`max-w-[780px] font-heading3 ${e.headingSmall} leading-[1.45] tracking-[-0.005em] text-fg ${e.headingSmallUpTo720}`,children:t(a)},d))}),c&&n("div",{className:`self-end font-display ${e.bodySmall} leading-[1.7] text-fg-dim ${e.bodyUpTo720Small}`,children:[s&&l("strong",{className:`mb-1.5 block ${e.bodyLarge} font-medium tracking-[-0.01em] text-fg ${e.bodyUpTo720Large}`,children:S(s,!1)}),p?t(p):null,x&&l("span",{className:`mt-2 block font-mono ${e.labelSmall} uppercase not-italic tracking-[0.24em] text-accent ${e.labelUpTo720}`,children:t(x)})]})]})]})})}export{N as default};
|
|
@@ -36,9 +36,10 @@ export declare function PartPanelBody({ sectionName, onBack, textEditor, styleRo
|
|
|
36
36
|
styleRow?: ReactNode;
|
|
37
37
|
children?: ReactNode;
|
|
38
38
|
}): import("react").JSX.Element;
|
|
39
|
-
export declare function PartSourceNote({ source, slug }: {
|
|
39
|
+
export declare function PartSourceNote({ source, slug, menuId }: {
|
|
40
40
|
source: PartSource;
|
|
41
41
|
slug?: string;
|
|
42
|
+
menuId?: string;
|
|
42
43
|
}): import("react").JSX.Element;
|
|
43
44
|
export default function PartSettingsPanel({ nodeId, propKey, onBack, onEditStyle, }: {
|
|
44
45
|
nodeId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as ne,jsxs as h}from"react/jsx-runtime";import{useContext as Xe,useEffect as oe,useRef as Ye,useState as ke}from"react";import{PartResetDot as qe}from"./PartResetDot.js";import{FieldSelect as Je,InspectorField as Qe}from"efficient-easel/fields";import{SettingsField as Ze}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as et,TypeIcon as tt}from"efficient-easel/icons";import{useEasel as nt}from"efficient-easel/easel";import{TextPartPanel as ot}from"efficient-easel/copy";import{Tooltip as st}from"efficient-shell/ui";import{PartTextBox as lt,partTextCells as rt}from"./PartTextBox.js";import Re from"./UiIcon.js";import{usePreviewHeader as it}from"./PreviewHeaderContext.js";import{UpdateStyleDialog as at}from"./UpdateStyleDialog.js";import{StorefrontDocumentContext as ct}from"./StorefrontDocumentContext.js";import{hasStyleChange as dt,partStyleToTextStyleValues as ut,pushIntoStyle as ft,resolveTextStyles as pt,styleIdOfRole as Oe}from"../lib/site-text-styles.js";import{useSiteTextStylesWriter as mt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as ht}from"../lib/theme-row-persist.js";import{usePreviewDevice as yt}from"./PreviewDeviceContext.js";import{usePartStyle as gt}from"./PreviewPartStyleContext.js";import{say as s}from"../lib/editor-words.js";import{readHidable as U,textFieldOffPage as bt,textFieldPanelOnly as St}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as xt}from"../lib/puck/field-markers.js";import{useSectionOps as Pt}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as wt,FONT_ROLES as se,FONT_ROLE_LABELS as le,fontOption as re}from"../lib/fonts.js";import{isMultilineKind as Tt,partPlaceholder as vt,typeInPlaceKind as Ct}from"../lib/puck/part-text.js";import{partRowField as Nt}from"../lib/puck/part-row-field.js";import{decodePartKey as kt,partPropsWithRowValue as Rt,partRowValue as Ot}from"../lib/puck/part-rows.js";import{PART_WIDTH_MAX as Et,propsWithPartStyleValue as B,propsWithoutPartStyle as It,readPartStyle as Ee}from"../lib/puck/part-styles.js";import{partThemeColors as Ft}from"../lib/puck/part-inks.js";import{styleKeyForPart as _t}from"../lib/sections/section-text-kinds.js";import{commitPartText as zt}from"../lib/puck/part-typing.js";import{keysOnCanvas as At,useCanvasTypingPart as Vt}from"../lib/puck/canvas-typing.js";import{useEditorHost as Lt}from"../lib/editor-host.js";import{SOURCE_LINES as Kt,SOURCE_ACTIONS as Ut,SOURCE_ACTION_LABEL as Bt,partSourceOf as Dt,sourceSlugOf as Ie}from"../lib/puck/source-bound-parts.js";import{encodePartId as Wt,holdsAuthoredText as jt}from"../lib/puck/text-parts.js";import{regionsForSection as Gt}from"../lib/sections/section-text-regions.js";import{textRegionOfPartKey as Mt}from"../lib/sections/text-regions.js";function ie(n){return n?s(n):null}function Fe(n){return n.kind==="role"?le[n.role]:n.kind==="custom"?"Custom":null}function Ht(n){const o=n.role;return o&&se.includes(o)?{kind:"role",role:o}:null}function $t(n,o){if(!n)return{kind:"unread"};const{faceRole:l,base:r}=n;if(o[l]===r.fontKey)return{kind:"role",role:l};const c=Object.keys(o).filter(i=>o[i]===r.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function ae(n,o,l,r){return Ht(Ee(n,o))??$t(l,r)}function Xt(n,o){if(!n.length)return null;const l=o(n[0]);return n.every(r=>o(r)===l)?l:null}const D="";function Yt({face:n,base:o,onPick:l}){const r=n.kind==="role"?n.role:D,c=[{label:s("No style"),value:D},...se.map(i=>({label:s(le[i]),value:i}))];return t(Je,{ariaLabel:s("Style"),value:r,options:c,inline:!0,onChange:i=>l(i===D?null:i),renderOption:i=>i.value===D?h(ne,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:i.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:s("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${i.value})`},children:i.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${re(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:ie(Fe(n))}),valueText:i=>ie(Fe(n))??i?.label??""})}function qt({sectionName:n,onBack:o,textEditor:l,styleRow:r,children:c}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:s(n),onSelect:o}),l,r,c]})}function _e({source:n,slug:o}){const l=Lt(),r=Ut[n],c=!r.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[s(Kt[n]),c?h(ne,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{r.type==="storefront-editor:open-menus"?l.send(r.type):o&&l.send(r.type,{slug:o})},children:s(Bt)})]}):null]})})}const ze=4,Jt=120;function Qt({region:n,sizePx:o,face:l,base:r,onFollowStyle:c,source:i,slug:W,onBack:P}){const I=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s(n.label)})}),t("p",{children:o?s("Its size follows Site styles ▸ {follows} — {px}px right now.",{follows:s(I),px:Math.round(o)}):s("Its size follows Site styles ▸ {follows}.",{follows:s(I)})}),c?t(ne,{children:t(Ze,{label:s("Style"),icon:t(et,{}),hint:s("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:s(n.label).toLowerCase()}),children:t(Yt,{face:l,base:r,onPick:c})})}):t("p",{className:"es-field-hint sf-hint-keep",children:s("Only the size follows a site style. This section sets its own font, weight and letter case.")}),i?t(_e,{source:i,slug:W}):null,t(K,{inline:!0,name:s("Page"),onSelect:P})]})}function Zt({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part is no longer here.")})}),t("p",{children:s("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function en({onBack:n,partId:o,why:l}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part's settings did not open.")})}),t("p",{children:s("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:h("code",{children:[o," — ",l]})}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function tn({nodeId:n,propKey:o,onBack:l,onEditStyle:r}){const{getItemById:c,getSelectorForId:i,config:W}=nt(e=>e),P=Pt(),I=Vt(),{partStyle:F}=gt(),{fonts:_,textStyles:Ae}=it(),j=Xe(ct),ce=!j?.capabilities?.hasSiteTheme,{persist:Ve}=ht({themeFromDocument:ce,tokenRef:j?.tokenRef,siteId:j?.siteId??null}),R=mt({themeFromDocument:ce,persist:Ve}),[Le,G]=ke(!1),Ke=yt()==="mobile",de=Ye(null),d=c(n),p=i(n),ue=d?W.components[d.type]:void 0,{key:S,row:g}=kt(o),fe=ue?.fields?.[S],y=g?Nt(fe,g):fe,w=Wt(n,o),m=d?.props??{},b=Ct(y),pe=bt(y),me=jt(y),M=d?Dt(d.type):null,H=g?Ot(m[S],g):m[S],he=!!g&&!(Array.isArray(m[S])&&g.index<m[S].length);oe(()=>{if(At(document))return;de.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[w]);const[$,ye]=ke(0);oe(()=>ye(0),[w]);const X=!!d&&!he&&(!p||!y);oe(()=>{if(!X||$>=ze)return;const e=setTimeout(()=>ye(a=>a+1),Jt);return()=>clearTimeout(e)},[X,$]);const Ue=X&&$<ze;if(!d||he)return t(Zt,{onBack:l});const z=Gt(d.type),ge=z?Mt(z,o):null;if(z&&ge){const e=F?.partId===w?F:null,a=z[ge],f=a.writable===!0&&!!p,E=te=>{p&&P.replaceComponent(p.zone,p.index,{...d,props:B(m,o,"role",te)})};return t(Qt,{region:a,sizePx:e?.base.sizePx??null,face:ae(m,o,e,_),base:e?.base??null,onFollowStyle:f?E:void 0,source:M,slug:Ie(m),onBack:l})}if(!p||!y)return Ue?t("div",{className:"sf-note","aria-busy":"true"}):t(en,{onBack:l,partId:w,why:p?"no field":"no selector"});const be=e=>{P.replaceComponent(p.zone,p.index,{...d,props:e})},Y=e=>{if(U(e).hidden!==U(H).hidden||!b){const f=g?Rt(m,S,g,e):{...m,[S]:e};f&&be(f);return}zt({node:d,propKey:o,kind:b,zone:p.zone,index:p.index},U(e).text,P.replaceComponent)},Be=H,T=F?.partId===w?F:null,v=T?.styleOwner,A=v?c(v.owner):null,q=v&&A?i(v.owner):null,J=!!(v&&A&&q),C=J?A.props??{}:m,Q=J?e=>P.replaceComponent(q.zone,q.index,{...A,props:e}):be,V=J?v.kind:_t(d?.type,o),N=Ee(C,V),u=[{partKey:V,face:ae(C,V,T,_),sizeGroup:T?.sizeGroup??null,base:T?.base??on,style:N}],De=Xt(u,e=>e.sizeGroup),We=Ft(T?.inks),O=(e,a)=>{let f=C;for(const E of u)f=B(f,E.partKey,e,a);Q(f)},je=e=>O("role",e),Se=e=>{let a=C;for(const f of u)for(const[E,te]of Object.entries(e))a=B(a,f.partKey,E,te??null);Q(a)},Z=b==="text"||b==="textarea",{text:xe,hidden:k}=U(H),L=y?.[xt]?.label??o,Pe=k?s("Show {label} on the slide",{label:s(L)}):s("Hide {label} on the slide",{label:s(L)}),we=h("div",{className:"sf-field-head",children:[t(tt,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:s(L)}),Z&&t(st,{content:Pe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":k,"aria-label":Pe,onClick:()=>Y({text:xe,hidden:!k}),children:k?t(Re,{name:"eye-off",size:14}):t(Re,{name:"eye",size:14})})})]}),Te=!pe&&me,Ge=!!b&&(St(y)||pe||k||!me),ve=ae(C,V,T,_),ee=ve.kind==="role"?ve.role:null,Ce=Object.entries(N).filter(([e,a])=>e!=="role"&&a!==void 0).length,Ne=()=>{let e=C;for(const a of u){const f=a.style.role;e=It(e,a.partKey),f&&(e=B(e,a.partKey,"role",f))}Q(e)},x=Oe(ee),Me=dt(u[0].style),He=x?pt(R.saved,R.old).find(e=>e.id===x)?.name??x:"",$e=()=>{G(!1),x&&(R.write(ft({saved:R.saved,old:R.old,styleId:x,values:ut(u[0].style)}),!0),Ne())};return h(qt,{sectionName:ue?.label??d.type,onBack:l,textEditor:t("div",{ref:de,className:"sf-part-text",children:Ge?t(lt,{text:xe,onTextChange:e=>Y(Z?{text:e,hidden:k}:e),multiline:Tt(b),markup:b!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:Se,colors:We,placeholder:ie(vt(y))??void 0,ariaLabel:s(L),head:we,typedOnCanvas:I===w}):b?Z?we:null:t(Qe,{field:y,name:o,value:Be,onChange:Y,id:`sf-part-${n}-${o}`})}),children:[M&&t(_e,{source:M,slug:Ie(m)}),Te&&t(ot,{style:{value:ee??"",options:[{value:"",label:s("No style"),description:s("Section’s own")},...se.map(e=>({value:e,label:s(le[e]),description:re(_[e])?.label}))],onChange:e=>je(e||null),changed:Ce>0,onClearChanges:Ce>0?Ne:void 0,onEditStyles:r,onUpdateStyle:x&&Me?()=>G(!0):void 0},font:{value:N.font??"",styleValue:re(u[0].base.fontKey)?.label,options:wt.map(e=>({label:e.label,value:e.key})),onChange:e=>O("font",e||null)},italic:{value:N.italic,styleValue:nn(Ae,ee),onChange:e=>O("italic",e??null)},cells:rt(u[0].style,u[0].base,Se,{phone:Ke}),align:{value:N.align??"",styleValue:u[0].base.align,onChange:e=>O("align",e||null)},letterCase:{value:N.case??"",styleValue:u[0].base.case,onChange:e=>O("case",e||null)}}),Le&&x&&t(at,{styleName:He,onCancel:()=>G(!1),onConfirm:$e}),Te&&De===null&&t("p",{className:"es-field-hint sf-hint-keep",children:s("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function nn(n,o){const l=Oe(o);return!l||!Array.isArray(n)?!1:n.find(c=>c?.id===l)?.values?.italic===!0}const on={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:Et};export{qt as PartPanelBody,qe as PartResetDot,_e as PartSourceNote,Yt as PartStyleSelect,tn as default,ae as partFace};
|
|
1
|
+
"use client";import{jsx as t,Fragment as te,jsxs as h}from"react/jsx-runtime";import{useContext as Ye,useEffect as ne,useRef as qe,useState as ke}from"react";import{PartResetDot as Je}from"./PartResetDot.js";import{FieldSelect as Qe,InspectorField as Ze}from"efficient-easel/fields";import{SettingsField as et}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as tt,TypeIcon as nt}from"efficient-easel/icons";import{useEasel as ot}from"efficient-easel/easel";import{TextPartPanel as st}from"efficient-easel/copy";import{Tooltip as lt}from"efficient-shell/ui";import{PartTextBox as rt,partTextCells as it}from"./PartTextBox.js";import Oe from"./UiIcon.js";import{usePreviewHeader as at}from"./PreviewHeaderContext.js";import{UpdateStyleDialog as ct}from"./UpdateStyleDialog.js";import{StorefrontDocumentContext as dt}from"./StorefrontDocumentContext.js";import{hasStyleChange as ut,partStyleToTextStyleValues as ft,pushIntoStyle as pt,resolveTextStyles as mt,styleIdOfRole as Re}from"../lib/site-text-styles.js";import{useSiteTextStylesWriter as ht}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as yt}from"../lib/theme-row-persist.js";import{usePreviewDevice as gt}from"./PreviewDeviceContext.js";import{usePartStyle as St}from"./PreviewPartStyleContext.js";import{say as s}from"../lib/editor-words.js";import{readHidable as U,textFieldOffPage as bt,textFieldPanelOnly as xt}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as Pt}from"../lib/puck/field-markers.js";import{useSectionOps as wt}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as Tt,FONT_ROLES as oe,FONT_ROLE_LABELS as se,fontOption as le}from"../lib/fonts.js";import{isMultilineKind as vt,partPlaceholder as Nt,typeInPlaceKind as Ct}from"../lib/puck/part-text.js";import{partRowField as kt}from"../lib/puck/part-row-field.js";import{decodePartKey as Ot,partPropsWithRowValue as Rt,partRowValue as It}from"../lib/puck/part-rows.js";import{PART_WIDTH_MAX as Et,propsWithPartStyleValue as B,propsWithoutPartStyle as Ft,readPartStyle as Ie}from"../lib/puck/part-styles.js";import{partThemeColors as _t}from"../lib/puck/part-inks.js";import{styleKeyForPart as zt}from"../lib/sections/section-text-kinds.js";import{commitPartText as At}from"../lib/puck/part-typing.js";import{keysOnCanvas as Vt,useCanvasTypingPart as Lt}from"../lib/puck/canvas-typing.js";import{useEditorHost as Kt}from"../lib/editor-host.js";import{SOURCE_LINES as Ut,SOURCE_ACTIONS as Bt,SOURCE_ACTION_LABEL as Dt,partSourceNoteFor as Wt,partSourceOf as Mt,sourceMenuIdOf as jt,sourceSlugOf as Ee}from"../lib/puck/source-bound-parts.js";import{encodePartId as Gt,holdsAuthoredText as Ht}from"../lib/puck/text-parts.js";import{regionsForSection as $t}from"../lib/sections/section-text-regions.js";import{textRegionOfPartKey as Xt}from"../lib/sections/text-regions.js";function re(n){return n?s(n):null}function Fe(n){return n.kind==="role"?se[n.role]:n.kind==="custom"?"Custom":null}function Yt(n){const o=n.role;return o&&oe.includes(o)?{kind:"role",role:o}:null}function qt(n,o){if(!n)return{kind:"unread"};const{faceRole:l,base:a}=n;if(o[l]===a.fontKey)return{kind:"role",role:l};const i=Object.keys(o).filter(r=>o[r]===a.fontKey);return i.length===1?{kind:"role",role:i[0]}:{kind:"custom"}}function ie(n,o,l,a){return Yt(Ie(n,o))??qt(l,a)}function Jt(n,o){if(!n.length)return null;const l=o(n[0]);return n.every(a=>o(a)===l)?l:null}const D="";function Qt({face:n,base:o,onPick:l}){const a=n.kind==="role"?n.role:D,i=[{label:s("No style"),value:D},...oe.map(r=>({label:s(se[r]),value:r}))];return t(Qe,{ariaLabel:s("Style"),value:a,options:i,inline:!0,onChange:r=>l(r===D?null:r),renderOption:r=>r.value===D?h(te,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:s("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${le(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:re(Fe(n))}),valueText:r=>re(Fe(n))??r?.label??""})}function Zt({sectionName:n,onBack:o,textEditor:l,styleRow:a,children:i}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:s(n),onSelect:o}),l,a,i]})}function _e({source:n,slug:o,menuId:l}){const a=Kt(),i=Bt[n],r=!i.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[s(Ut[n]),r?h(te,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{i.type==="storefront-editor:open-menus"?a.send(i.type,{menuId:l??null}):o&&a.send(i.type,{slug:o})},children:s(Dt)})]}):null]})})}const ze=4,en=120;function tn({region:n,sizePx:o,face:l,base:a,onFollowStyle:i,source:r,slug:W,onBack:P}){const E=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s(n.label)})}),t("p",{children:o?s("Its size follows Site styles ▸ {follows} — {px}px right now.",{follows:s(E),px:Math.round(o)}):s("Its size follows Site styles ▸ {follows}.",{follows:s(E)})}),i?t(te,{children:t(et,{label:s("Style"),icon:t(tt,{}),hint:s("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:s(n.label).toLowerCase()}),children:t(Qt,{face:l,base:a,onPick:i})})}):t("p",{className:"es-field-hint sf-hint-keep",children:s("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r?t(_e,{source:r,slug:W}):null,t(K,{inline:!0,name:s("Page"),onSelect:P})]})}function nn({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part is no longer here.")})}),t("p",{children:s("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function on({onBack:n,partId:o,why:l}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:s("This part's settings did not open.")})}),t("p",{children:s("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:h("code",{children:[o," — ",l]})}),t(K,{inline:!0,name:s("Page"),onSelect:n})]})}function sn({nodeId:n,propKey:o,onBack:l,onEditStyle:a}){const{getItemById:i,getSelectorForId:r,config:W}=ot(e=>e),P=wt(),E=Lt(),{partStyle:F}=St(),{fonts:_,textStyles:Ae}=at(),M=Ye(dt),ae=!M?.capabilities?.hasSiteTheme,{persist:Ve}=yt({themeFromDocument:ae,tokenRef:M?.tokenRef,siteId:M?.siteId??null}),O=ht({themeFromDocument:ae,persist:Ve}),[Le,j]=ke(!1),Ke=gt()==="mobile",ce=qe(null),d=i(n),m=r(n),de=d?W.components[d.type]:void 0,{key:g,row:S}=Ot(o),ue=de?.fields?.[g],y=S?kt(ue,S):ue,w=Gt(n,o),p=d?.props??{},b=Ct(y),fe=bt(y),pe=Ht(y),Ue=d?Mt(d.type):null,me=d?Wt(d.type,g):null,G=S?It(p[g],S):p[g],he=!!S&&!(Array.isArray(p[g])&&S.index<p[g].length);ne(()=>{if(Vt(document))return;ce.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[w]);const[H,ye]=ke(0);ne(()=>ye(0),[w]);const $=!!d&&!he&&(!m||!y);ne(()=>{if(!$||H>=ze)return;const e=setTimeout(()=>ye(c=>c+1),en);return()=>clearTimeout(e)},[$,H]);const Be=$&&H<ze;if(!d||he)return t(nn,{onBack:l});const z=$t(d.type),ge=z?Xt(z,o):null;if(z&&ge){const e=F?.partId===w?F:null,c=z[ge],f=c.writable===!0&&!!m,I=ee=>{m&&P.replaceComponent(m.zone,m.index,{...d,props:B(p,o,"role",ee)})};return t(tn,{region:c,sizePx:e?.base.sizePx??null,face:ie(p,o,e,_),base:e?.base??null,onFollowStyle:f?I:void 0,source:Ue,slug:Ee(p),onBack:l})}if(!m||!y)return Be?t("div",{className:"sf-note","aria-busy":"true"}):t(on,{onBack:l,partId:w,why:m?"no field":"no selector"});const Se=e=>{P.replaceComponent(m.zone,m.index,{...d,props:e})},X=e=>{if(U(e).hidden!==U(G).hidden||!b){const f=S?Rt(p,g,S,e):{...p,[g]:e};f&&Se(f);return}At({node:d,propKey:o,kind:b,zone:m.zone,index:m.index},U(e).text,P.replaceComponent)},De=G,T=F?.partId===w?F:null,v=T?.styleOwner,A=v?i(v.owner):null,Y=v&&A?r(v.owner):null,q=!!(v&&A&&Y),N=q?A.props??{}:p,J=q?e=>P.replaceComponent(Y.zone,Y.index,{...A,props:e}):Se,V=q?v.kind:zt(d?.type,o),C=Ie(N,V),u=[{partKey:V,face:ie(N,V,T,_),sizeGroup:T?.sizeGroup??null,base:T?.base??rn,style:C}],We=Jt(u,e=>e.sizeGroup),Me=_t(T?.inks),R=(e,c)=>{let f=N;for(const I of u)f=B(f,I.partKey,e,c);J(f)},je=e=>R("role",e),be=e=>{let c=N;for(const f of u)for(const[I,ee]of Object.entries(e))c=B(c,f.partKey,I,ee??null);J(c)},Q=b==="text"||b==="textarea",{text:xe,hidden:k}=U(G),L=y?.[Pt]?.label??o,Pe=k?s("Show {label} on the slide",{label:s(L)}):s("Hide {label} on the slide",{label:s(L)}),we=h("div",{className:"sf-field-head",children:[t(nt,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:s(L)}),Q&&t(lt,{content:Pe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":k,"aria-label":Pe,onClick:()=>X({text:xe,hidden:!k}),children:k?t(Oe,{name:"eye-off",size:14}):t(Oe,{name:"eye",size:14})})})]}),Te=!fe&&pe,Ge=!!b&&(xt(y)||fe||k||!pe),ve=ie(N,V,T,_),Z=ve.kind==="role"?ve.role:null,Ne=Object.entries(C).filter(([e,c])=>e!=="role"&&c!==void 0).length,Ce=()=>{let e=N;for(const c of u){const f=c.style.role;e=Ft(e,c.partKey),f&&(e=B(e,c.partKey,"role",f))}J(e)},x=Re(Z),He=ut(u[0].style),$e=x?mt(O.saved,O.old).find(e=>e.id===x)?.name??x:"",Xe=()=>{j(!1),x&&(O.write(pt({saved:O.saved,old:O.old,styleId:x,values:ft(u[0].style)}),!0),Ce())};return h(Zt,{sectionName:de?.label??d.type,onBack:l,textEditor:t("div",{ref:ce,className:"sf-part-text",children:Ge?t(rt,{text:xe,onTextChange:e=>X(Q?{text:e,hidden:k}:e),multiline:vt(b),markup:b!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:be,colors:Me,placeholder:re(Nt(y))??void 0,ariaLabel:s(L),head:we,typedOnCanvas:E===w}):b?Q?we:null:t(Ze,{field:y,name:o,value:De,onChange:X,id:`sf-part-${n}-${o}`})}),children:[me&&t(_e,{source:me,slug:Ee(p),menuId:jt(p)}),Te&&t(st,{style:{value:Z??"",options:[{value:"",label:s("No style"),description:s("Section’s own")},...oe.map(e=>({value:e,label:s(se[e]),description:le(_[e])?.label}))],onChange:e=>je(e||null),changed:Ne>0,onClearChanges:Ne>0?Ce:void 0,onEditStyles:a,onUpdateStyle:x&&He?()=>j(!0):void 0},font:{value:C.font??"",styleValue:le(u[0].base.fontKey)?.label,options:Tt.map(e=>({label:e.label,value:e.key})),onChange:e=>R("font",e||null)},italic:{value:C.italic,styleValue:ln(Ae,Z),onChange:e=>R("italic",e??null)},cells:it(u[0].style,u[0].base,be,{phone:Ke}),align:{value:C.align??"",styleValue:u[0].base.align,onChange:e=>R("align",e||null)},letterCase:{value:C.case??"",styleValue:u[0].base.case,onChange:e=>R("case",e||null)}}),Le&&x&&t(ct,{styleName:$e,onCancel:()=>j(!1),onConfirm:Xe}),Te&&We===null&&t("p",{className:"es-field-hint sf-hint-keep",children:s("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function ln(n,o){const l=Re(o);return!l||!Array.isArray(n)?!1:n.find(i=>i?.id===l)?.values?.italic===!0}const rn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:Et};export{Zt as PartPanelBody,Je as PartResetDot,_e as PartSourceNote,Qt as PartStyleSelect,sn as default,ie as partFace};
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import type { PinnedChromeReport } from "../lib/editor-document-adapter.js";
|
|
2
|
-
export declare const
|
|
1
|
+
import type { PinnedChromeReport, PinnedChromeState } from "../lib/editor-document-adapter.js";
|
|
2
|
+
export declare const PINNED_CHROME_NOTES: {
|
|
3
|
+
readonly load: "The header and footer could not load. They are hidden for now and nothing in them is saved. Reload to try again.";
|
|
4
|
+
readonly lock: "{name} is editing the header and footer. Nothing you change in them here is saved.";
|
|
5
|
+
readonly conflict: "The header and footer were changed somewhere else. Nothing you change in them here is saved. Reload to get the latest.";
|
|
6
|
+
readonly save: "The header and footer did not save. They are sent again with your next change.";
|
|
7
|
+
};
|
|
8
|
+
export declare const PINNED_CHROME_LOAD_NOTICE: "The header and footer could not load. They are hidden for now and nothing in them is saved. Reload to try again.";
|
|
9
|
+
export declare const PINNED_CHROME_LOCK_NOTICE: "{name} is editing the header and footer. Nothing you change in them here is saved.";
|
|
10
|
+
export declare const PINNED_CHROME_CONFLICT_NOTICE: "The header and footer were changed somewhere else. Nothing you change in them here is saved. Reload to get the latest.";
|
|
11
|
+
export declare const PINNED_CHROME_SAVE_NOTICE: "The header and footer did not save. They are sent again with your next change.";
|
|
12
|
+
export declare function pinnedChromeNoticeWords(state: PinnedChromeState | null): string | null;
|
|
3
13
|
export declare function PinnedChromeLoadNotice({ report }: {
|
|
4
14
|
report: PinnedChromeReport | undefined;
|
|
5
15
|
}): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{useEffect as d,useState as s}from"react";import{Banner as c}from"efficient-shell/ui";import{useOpenPinnedChromeReport as l,usePinnedChromeState as h}from"./usePinnedChromeState.js";import{say as n}from"../lib/editor-words.js";const r={load:"The header and footer could not load. They are hidden for now and nothing in them is saved. Reload to try again.",lock:"{name} is editing the header and footer. Nothing you change in them here is saved.",conflict:"The header and footer were changed somewhere else. Nothing you change in them here is saved. Reload to get the latest.",save:"The header and footer did not save. They are sent again with your next change."},u=r.load,f=r.lock,m=r.conflict,N=r.save;function p(e){return e?e.loadFailed?n(u):e.lockHolder?n(f,{name:e.lockHolder.name||n("Somebody else")}):e.conflict?n(m):e.saveFailed?n(N):null:null}function C({report:e}){const o=p(h(e)),[a,i]=s(null);return d(()=>{o||i(null)},[o]),!o||a===o?null:t("aside",{className:"sf-canvas-notice",children:t(c,{tone:"warning",onDismiss:()=>i(o),children:o})})}function T(){return t(C,{report:l()})}export{T as OpenDocumentChromeLoadNotice,m as PINNED_CHROME_CONFLICT_NOTICE,u as PINNED_CHROME_LOAD_NOTICE,f as PINNED_CHROME_LOCK_NOTICE,r as PINNED_CHROME_NOTES,N as PINNED_CHROME_SAVE_NOTICE,C as PinnedChromeLoadNotice,p as pinnedChromeNoticeWords};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as
|
|
1
|
+
import{jsx as a,jsxs as n}from"react/jsx-runtime";import{SiteLink as c}from"../lib/site-runtime.js";import{boxDarkenStyle as N,boxPlacementClasses as S,CARD_SHADOW_CLASS as $}from"../lib/content/box-background.js";import s from"./Placeholder.js";import{renderGold as l,renderHeadline as m}from"./goldPhrases.js";const r={body:"text-[length:var(--size-body,14px)]",headingSmall1:"text-[length:var(--size-headingSmall,22px)]",headingSmall2:"text-[length:var(--size-headingSmall,30px)]",label:"text-[length:var(--size-label,13px)]"},T=[{label:"Card",value:"card"},{label:"Photo behind the words",value:"cover"}],z="card",L={min:200,max:700,step:10,fallback:330,unit:"px"};function k({post:e,scaffold:i=!1,layout:o,showCover:h=!0,placement:g,darken:x,darkenStyle:b,href:f,minHeight:u}){const d=f||(i?"#":`/journal/${e.slug}`),v=o==="cover",p=(e.meta||e.dateLabel||e.read)&&n("div",{className:`flex gap-3.5 font-mono ${r.label} uppercase tracking-[0.18em] text-fg-dim`,children:[e.meta&&a("span",{className:"text-accent",children:l(e.meta)}),e.dateLabel&&a("span",{children:l(e.dateLabel)}),e.read&&a("span",{children:l(e.read)})]});if(v){const t=N(x,b);return n(c,{href:d,className:`${$} group relative isolate flex overflow-hidden`,style:{minHeight:`${u??L.fallback}px`},"aria-disabled":i||void 0,tabIndex:i?-1:void 0,children:[a("div",{className:"absolute inset-0",children:a(s,{label:`post-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 100vw, 56vw"})}),t&&a("div",{className:"absolute inset-0 z-0",style:t,"aria-hidden":!0}),n("div",{className:`relative z-[1] flex w-full flex-col gap-2 p-8 text-overlay-fg max-[800px]:p-5 ${S(g??"bottom-left","column")}`,children:[e.meta&&a("div",{className:`font-mono ${r.label} uppercase tracking-[0.18em] text-accent`,children:l(e.meta)}),a("h3",{className:`font-heading3 ${r.headingSmall2} font-medium leading-[1.2] tracking-[-0.02em]`,children:m(e.title,!1)}),e.excerpt&&a("p",{className:`max-w-[46ch] ${r.body} leading-[1.55] opacity-80`,children:l(e.excerpt)}),(e.dateLabel||e.read)&&n("div",{className:`flex gap-3.5 font-mono ${r.label} uppercase tracking-[0.18em] opacity-75`,children:[e.dateLabel&&a("span",{children:l(e.dateLabel)}),e.read&&a("span",{children:l(e.read)})]})]})]})}return n(c,{href:d,style:{"--card-bg":"var(--site-surface)","--card-bg-hover":"var(--site-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":i||void 0,tabIndex:i?-1:void 0,children:[h&&a("div",{className:"sf-card-image relative aspect-[16/10] overflow-hidden bg-bg",children:a(s,{label:`event-${e.slug}`,src:e.cover||void 0})}),n("div",{className:"flex flex-col gap-2.5 px-7 pb-8 pt-6",children:[p,a("h3",{className:`mt-1 font-heading3 ${r.headingSmall1} font-medium leading-[1.2] tracking-[-0.02em]`,children:m(e.title,!1)}),e.excerpt&&a("p",{className:`${r.body} leading-[1.55] text-fg-dim`,children:l(e.excerpt)}),n("span",{className:`mt-1.5 inline-flex items-center gap-2 font-mono ${r.label} uppercase tracking-[0.2em] transition-colors group-hover:text-accent`,children:["Read more",a("span",{"aria-hidden":!0,children:"→"})]})]})]})}export{L as POST_CARD_HEIGHT,T as POST_CARD_LAYOUTS,z as POST_CARD_LAYOUT_FALLBACK,k as default};
|