efficient-web-builder 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +169 -0
- package/README.md +42 -0
- package/dist/components/ApplyCornersToSiblings.js +1 -1
- package/dist/components/Banner.js +1 -1
- package/dist/components/BlockGapField.js +1 -1
- package/dist/components/BlogPostSource.js +1 -1
- package/dist/components/Breadcrumb.js +1 -1
- package/dist/components/CardShadowField.js +1 -1
- package/dist/components/CategoryBar.js +1 -1
- package/dist/components/ChatSettingsPanel.js +1 -1
- package/dist/components/ClearColoursDialog.js +1 -1
- package/dist/components/CornersField.js +1 -1
- package/dist/components/DocBody.js +5 -5
- package/dist/components/DuplicateToPageMenu.js +1 -1
- package/dist/components/FAQ.js +1 -1
- package/dist/components/Flex.js +1 -1
- package/dist/components/Footprint.js +3 -3
- package/dist/components/HeadingAudit.js +1 -1
- package/dist/components/HeroImageField.js +1 -1
- package/dist/components/HeroSection.js +2 -2
- package/dist/components/HeroSingle.js +1 -1
- package/dist/components/HeroSlide.js +1 -1
- package/dist/components/HoverEffectField.js +1 -1
- package/dist/components/ImageFocusRow.js +1 -1
- package/dist/components/IntegrationsSection.js +1 -1
- package/dist/components/IntroBleed.js +1 -1
- package/dist/components/KeyFeatures.js +1 -1
- package/dist/components/LocationsGroupedField.js +1 -1
- package/dist/components/MediaUploadField.js +1 -1
- package/dist/components/MultiSelectField.js +1 -1
- package/dist/components/PagesPanel.js +1 -1
- package/dist/components/PartInkControl.js +1 -1
- package/dist/components/PartResetDot.js +1 -1
- package/dist/components/PartSettingsPanel.js +1 -1
- package/dist/components/PartTextBox.js +1 -1
- package/dist/components/PhotographyField.js +1 -1
- package/dist/components/ProcessSteps.js +1 -1
- package/dist/components/SearchSelectField.d.ts +1 -1
- package/dist/components/SearchSelectField.js +1 -1
- package/dist/components/SectionEditor.js +1 -1
- package/dist/components/SectionTextEntries.js +1 -1
- package/dist/components/SectionThemePicker.js +1 -1
- package/dist/components/Series.js +1 -1
- package/dist/components/ShadowColourField.js +1 -1
- package/dist/components/SideSpaceField.js +1 -1
- package/dist/components/SiteFields.js +1 -1
- package/dist/components/SiteWidthField.js +1 -1
- package/dist/components/SlotChildRows.js +1 -1
- package/dist/components/SocialLinksPanel.js +1 -1
- package/dist/components/SourceStatus.js +1 -1
- package/dist/components/SpecStrip.js +1 -1
- package/dist/components/Split.js +1 -1
- package/dist/components/StandaloneSectionEditor.js +1 -1
- package/dist/components/StatsParagraph.js +1 -1
- package/dist/components/StorefrontLinkField.js +1 -1
- package/dist/components/StylesPanel.js +1 -1
- package/dist/components/SwitchToBoxFooter.js +1 -1
- package/dist/components/Testimonials.js +1 -1
- package/dist/components/TextStyleRow.js +1 -1
- package/dist/components/TextStylesField.js +1 -1
- package/dist/components/ThemeCard.js +1 -1
- package/dist/components/ThemeColourField.js +1 -1
- package/dist/components/ThemeField.js +1 -1
- package/dist/components/TickerSection.js +1 -1
- package/dist/components/TickerSettingsPanel.js +1 -1
- package/dist/components/TitleWithButtons.js +1 -1
- package/dist/components/WebsiteScreenParts.js +1 -1
- package/dist/components/WebsiteSettingsPanel.js +1 -1
- package/dist/components/WidthFollowField.js +1 -1
- package/dist/components/preview-devices.js +1 -1
- package/dist/components/storefront-editor.css +43 -37
- package/dist/components/useLocationsTree.js +1 -1
- package/dist/lib/content/ink.d.ts +36 -0
- package/dist/lib/content/ink.js +1 -0
- package/dist/lib/content/section-surface.js +1 -1
- package/dist/lib/editor-words-catalogue.d.ts +1184 -0
- package/dist/lib/editor-words-catalogue.js +11 -0
- package/dist/lib/editor-words.d.ts +15 -0
- package/dist/lib/editor-words.js +1 -0
- package/dist/lib/links/link-picker-setup.js +1 -1
- package/dist/lib/puck/ColourControl.js +1 -1
- package/dist/lib/puck/MarkupToolbar.js +1 -1
- package/dist/lib/puck/apply-card-corners.js +1 -1
- package/dist/lib/puck/blocks/general/Breadcrumb/render.js +1 -1
- package/dist/lib/puck/blocks/general/Cards/render.js +1 -1
- package/dist/lib/puck/blocks/general/CategoryBar/render.js +1 -1
- package/dist/lib/puck/blocks/general/Chart/render.js +2 -2
- package/dist/lib/puck/blocks/general/DocBody/render.js +1 -1
- package/dist/lib/puck/blocks/general/DocMasthead/render.js +1 -1
- package/dist/lib/puck/blocks/general/DocTabs/render.js +1 -1
- package/dist/lib/puck/blocks/general/FAQ/render.js +1 -1
- package/dist/lib/puck/blocks/general/Footprint/render.js +2 -2
- package/dist/lib/puck/blocks/general/KeyFeatures/render.js +1 -1
- package/dist/lib/puck/blocks/general/Logos/render.js +1 -1
- package/dist/lib/puck/blocks/general/Masthead/render.js +1 -1
- package/dist/lib/puck/blocks/general/OrderSummary/render.js +1 -1
- package/dist/lib/puck/blocks/general/PaymentBadges/render.js +1 -1
- package/dist/lib/puck/blocks/general/ProcessSteps/render.js +1 -1
- package/dist/lib/puck/blocks/general/Series/render.js +1 -1
- package/dist/lib/puck/blocks/general/StatsParagraph/render.js +1 -1
- package/dist/lib/puck/blocks/general/Testimonials/render.js +1 -1
- package/dist/lib/puck/blocks/general/Timeline/render.js +2 -2
- package/dist/lib/puck/blocks/general/TimelineTrack/render.js +1 -1
- package/dist/lib/puck/blocks/scaffold.js +1 -1
- package/dist/lib/puck/controls.js +1 -1
- package/dist/lib/puck/footer-block-row-name.js +1 -1
- package/dist/lib/puck/page-root-fields.js +1 -1
- package/dist/lib/puck/theme-swatches.js +1 -1
- package/dist/lib/source-rules/editor-words.d.ts +26 -0
- package/dist/lib/source-rules/editor-words.js +3 -0
- package/dist/lib/source-rules/mirrored-rows-agree.js +1 -1
- package/dist/lib/source-rules/part-style-naming.js +1 -1
- package/dist/lib/source-rules/support/label-extraction.js +2 -2
- package/dist/lib/theme-save-message.js +1 -1
- package/package.json +6 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s,jsxs as R}from"react/jsx-runtime";import{useCallback as p,useEffect as f,useId as Oe,useRef as i,useState as b}from"react";import{markOverlayPortal as N}from"../lib/puck/overlay-portal.js";import Te from"./Ticker.js";import{HeroSlideStyleContext as He}from"./HeroSlide.js";import Le from"./HeroArrows.js";import Ae from"./Reel.js";import{usePreviewTicker as Ce}from"./PreviewTickerContext.js";import{useReducedMotion as Ne}from"./useReducedMotion.js";import{tk as Z}from"./floating-editor/tokens.js";import{hasSectionHeight as Ie,resolveSectionHeight as ee}from"../lib/content/section-height.js";import{HEADER_HEIGHT_CSS as Me}from"../lib/puck/header-clearance.js";import{nextReel as Pe,normaliseHeroReelShape as De,reelShown as $e}from"../lib/reel.js";import{arrowsShown as Ve,arrowStep as ze}from"../lib/hero-arrows.js";import{swipeEnabled as Xe,swipeStep as qe}from"../lib/hero-swipe.js";import{videoControlShown as Ge,videoHeld as je}from"../lib/hero-video-control.js";import{HERO_SLIDER_GOTO_EVENT as I}from"../lib/puck/preview-events.js";import{say as te}from"../lib/editor-words.js";const Be=`
|
|
2
2
|
.hero-ticker-pick { cursor: pointer; }
|
|
3
3
|
.hero-ticker-pick:hover {
|
|
4
4
|
outline: 2px solid color-mix(in srgb, ${Z.accent} 45%, transparent);
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
outline: 2px solid ${Z.accent};
|
|
9
9
|
outline-offset: -2px;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,Ye="Play video",Fe="Hold video",Ke="flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-overlay-chrome/25 bg-overlay-scrim/80 px-[11px] font-mono text-[11px] leading-none tracking-[0.05em] text-overlay-fg",Ue=()=>te("item"),Je=["","","","","",""],re=new Map;function Qe(O,w){const h=O?.ownerDocument?.defaultView;if(h)return h.addEventListener(I,w),()=>h.removeEventListener(I,w)}function We({slides:O,alignment:w,textureOpacity:h,showTexture:oe,textureColor:ne,phoneUpDown:ce,phoneSideways:se,autoplay:M,autoplayInterval:T,showTicker:ae,tickerItems:ie,heightDesktop:P,heightMobile:D,showPicker:le,pickerShape:ue,pickerPlacement:de,showArrows:me,arrowsShape:pe,arrowsPlacement:fe,editing:n}){const $=Ie(P,D),he=$?"h-[var(--sf-hero-h-m)] min-[720px]:h-[var(--sf-hero-h-d)]":"h-screen min-h-[680px]",ve=$?{"--sf-hero-h-d":ee(P),"--sf-hero-h-m":ee(D)}:void 0,H=(ie??Je.map(e=>({text:e}))).map(e=>e?.text?.trim()?e.text:n?Ue():"").filter(Boolean),V=ae!==!1,u=i(null),z=i(null),X=i(null),q=i(null),G=i(null),j=Oe(),y=i(j),[E,xe]=b([]),[ke,B]=b(0),v=i(0),[Y,F]=b(!1),[g,be]=b(!1),[K,we]=b(null),L=Ne(),{selectedHeroId:ye,select:U}=Ce(),S=p(()=>u.current?.querySelector(".hero-track")??null,[]),l=p((e,t=!1)=>{B(e),v.current=e,re.set(y.current,e);const r=u.current?.querySelector(".hero-track");if(r)if(t){const o=r.style.transition;r.style.transition="none",r.style.transform=`translateX(-${Math.max(0,e)*100}%)`,r.offsetHeight,r.style.transition=o}else r.style.transform=`translateX(-${Math.max(0,e)*100}%)`},[]);f(()=>{const e=u.current,t=e?.getAttribute("data-puck-component")||e?.closest("[data-puck-component]")?.getAttribute("data-puck-component")||j;y.current=t,we(t);const r=re.get(t);typeof r=="number"&&(B(r),v.current=r)},[]),f(()=>{const e=S();if(!e)return;const t=()=>{xe(o=>Pe(o,e.querySelectorAll("[data-slide-name]")))};t();const r=new MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-slide-name","data-slide-process","data-slide-media"]}),()=>{r.disconnect()}},[S]),f(()=>{if(!n)return;const e=t=>{const r=t.detail;if(!r||typeof r.index!="number")return;const o=u.current,a=o?.getAttribute("data-puck-component")||o?.closest("[data-puck-component]")?.getAttribute("data-puck-component")||y.current;r.id&&r.id!==a||l(r.index,!0)};return Qe(u.current,e)},[n,l]);const c=E.length,d=Math.min(Math.max(ke,0),Math.max(0,c-1)),A=$e({shown:le,count:c}),J=Ve({shown:me,count:c}),Q=Ge({editing:n,shown:d,slides:E}),Ee=je({editing:n,playing:g,controlShown:Q}),_=Xe({count:c,editing:n}),m=i(null),x=i(null),ge=p(e=>{if(m.current=null,x.current=null,!_||e.touches.length!==1)return;const t=e.touches[0];m.current={x:t.clientX,y:t.clientY},x.current={x:t.clientX,y:t.clientY}},[_]),Se=p(e=>{if(!m.current)return;if(e.touches.length!==1){m.current=null;return}const t=e.touches[0];x.current={x:t.clientX,y:t.clientY}},[]),_e=p(()=>{const e=m.current,t=x.current;if(m.current=null,x.current=null,!_||!e||!t)return;const r=qe(t.x-e.x,t.y-e.y,v.current,c);r!==v.current&&l(r)},[_,c,l]);f(()=>{if(n||!M||Y||L||c<=1)return;const t=Math.max(1,typeof T=="number"?T:6)*1e3,r=window.setTimeout(()=>l((d+1)%c),t);return()=>window.clearTimeout(r)},[n,M,T,Y,L,c,d,l]),f(()=>{const e=[z.current,X.current,q.current].filter(Boolean),t=e.map(o=>N(o)),r=o=>{const a=o.target,k=a.closest("[data-hero-nav]"),W=k??a.closest("[data-idx]");if(!W)return;o.stopPropagation(),o.preventDefault();const C=k?ze(k.dataset.heroNav,v.current,c):Number(W.dataset.idx);Number.isNaN(C)||(l(C,n),S()?.querySelectorAll("[data-slide-name]")[C]?.click())};return e.forEach(o=>o.addEventListener("click",r,{capture:!0})),()=>{t.forEach(o=>o?.()),e.forEach(o=>o.removeEventListener("click",r,{capture:!0}))}},[c,l,S,n]),f(()=>{if(!n)return;const e=G.current;if(!e)return;const t=N(e),r=o=>{o.stopPropagation(),o.preventDefault();const a=u.current,k=a?.getAttribute("data-puck-component")||a?.closest("[data-puck-component]")?.getAttribute("data-puck-component")||y.current;U(k)};return e.addEventListener("click",r,{capture:!0}),()=>{t?.(),e.removeEventListener("click",r,{capture:!0})}},[n,U,V,H.length]);const Re=p(e=>{if(!e)return;const t=N(e),r=o=>{o.stopPropagation(),o.preventDefault(),be(a=>!a)};return e.addEventListener("click",r,{capture:!0}),()=>{t?.(),e.removeEventListener("click",r,{capture:!0})}},[]);return s(He.Provider,{value:{alignment:w,textureOpacity:h,textureOn:oe,textureColor:ne,quietVideo:Ee,phoneUpDown:ce,phoneSideways:se},children:R("div",{ref:u,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${he} max-w-[var(--sf-hero-cap,none)] overflow-hidden`,style:ve,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),onTouchStart:ge,onTouchMove:Se,onTouchEnd:_e,children:[s(O,{className:"hero-track flex h-full [&>*]:h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full",style:{transform:`translateX(-${d*100}%)`,transition:L?"none":"transform 600ms cubic-bezier(.22,.61,.36,1)"},minEmptyHeight:400}),Q&&s("div",{ref:Re,"data-hero-video-control":g?"playing":"held",className:"sf-hero-video-control absolute left-6 z-[7]",style:{top:`calc(${Me} + 16px)`},children:R("button",{type:"button",className:Ke,children:[s("span",{"aria-hidden":"true",children:g?"❚❚":"▶"}),te(g?Fe:Ye)]})}),(A||J)&&R("div",{className:"pointer-events-none absolute inset-y-0 left-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] right-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] z-[6] mx-auto max-w-[var(--sf-hero-chrome-cap,calc(min(var(--sf-page-cap,var(--sf-site-width,1600px)),var(--sf-site-width,1600px))_-_var(--sf-site-gutter,40px)*2))]",children:[A&&s(Ae,{ref:z,slides:E,active:d,shape:De(ue),placement:de}),J&&s(Le,{ref:q,shape:pe,placement:fe})]}),A&&s("div",{ref:X,className:"sf-hero-phone-dots absolute bottom-[80px] left-1/2 z-[6] hidden -translate-x-1/2 items-center gap-2",children:E.map((e,t)=>s("button",{type:"button","data-idx":t,"aria-label":`Go to slide ${t+1}`,className:`h-2 rounded-full transition-all motion-reduce:transition-none ${t===d?"w-5 bg-accent":"w-2 bg-white/45 hover:bg-white/70"}`},t))}),V&&H.length>0&&R("div",{ref:G,className:`sf-hero-ticker absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10 py-3.5${n?" hero-ticker-pick":""}`,"data-selected":n&&K!=null&&ye===K?"":void 0,style:{background:"rgba(10,10,10,.55)"},children:[n&&s("style",{children:Be}),s(Te,{items:H,backdrop:"dark-media"})]})]})})}export{Je as DEFAULT_TICKER_ITEMS,I as HERO_SLIDER_GOTO_EVENT,Fe as HERO_VIDEO_HOLD_LABEL,Ye as HERO_VIDEO_PLAY_LABEL,We as default,Qe as subscribeSliderGoto};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as N}from"react/jsx-runtime";import{useRef as S}from"react";import
|
|
1
|
+
"use client";import{jsx as e,jsxs as N}from"react/jsx-runtime";import{useRef as S}from"react";import E from"./HeroPoster.js";import{resolveMedia as s}from"../lib/media.js";import{hasSectionHeight as j,resolveSectionHeight as c}from"../lib/content/section-height.js";import{DEFAULT_OVERLAY_COLOR as z,DEFAULT_OVERLAY_POSITION as L,overlayGradient as O}from"../lib/sections/hero-overlay.js";import{ON_MEDIA_INK_STYLE as A}from"../lib/content/ink.js";function H({overlay:h=100,overlayColor:f=z,overlayPosition:d=L,mediaType:p="image",mediaSrc:r,poster:t,objectPosition:v,tintColor:u="#000000",tintOpacity:i=0,heightDesktop:a,heightMobile:n,boxes:m,editing:x=!1}){const l=j(a,n),g=l?"h-[var(--sf-hero-h-m)] min-[720px]:h-[var(--sf-hero-h-d)]":"h-screen min-h-[680px]",_=l?{"--sf-hero-h-d":c(a),"--sf-hero-h-m":c(n)}:void 0,o=p==="video",b=o?s(r):void 0,w=o?s(t):s(r)??s(t),y=S(null);return N("section",{ref:y,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${g} max-w-[var(--sf-hero-cap,none)] overflow-hidden`,style:_,children:[e("div",{className:"absolute inset-0 z-[1]",children:e(E,{videoSrc:b,posterSrc:w,showVideo:o,objectPosition:v})}),i>0&&e("div",{className:"pointer-events-none absolute inset-0 z-[2]",style:{background:u,opacity:Math.min(Math.max(i,0),100)/100}}),e("div",{className:"pointer-events-none absolute inset-0 z-[2]",style:{background:O(f,d),opacity:Math.min(Math.max(h,0),100)/100}}),m&&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",x?"sf-hero-group-layer-edit":""].filter(Boolean).join(" "),style:A,children:e(m,{className:"sf-hero-group-zone",minEmptyHeight:160})})]})}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as j}from"react/jsx-runtime";import{createContext as N,useContext as k}from"react";import H from"./HeroPoster.js";import{resolveMedia as o}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=N({});function V({name:i,process:t,mediaType:u="video",mediaSrc:s,videoSpeed:a,poster:l,objectPosition:f,tintColor:x="#000000",tintOpacity:n=0,groups:d,editing:h=!1,themeClassName:p,themeStyle:y}){const{alignment:I="left",textureOpacity:c,textureOn:v,textureColor:S,quietVideo:g,phoneUpDown:w,phoneSideways:b}=k(T),r=u==="video",m=r?o(s):void 0,_=r?o(l):o(s)??o(l),E=typeof a=="number"?a/100:1;return j("section",{className:p?`relative h-full w-full overflow-hidden ${p}`:"relative h-full w-full overflow-hidden",style:y,"data-slide-name":i??"","data-slide-process":t??"","data-slide-media":m?"video":"still",children:[e(H,{videoSrc:m,posterSrc:_,showVideo:r,playbackRate:E,objectPosition:f,quiet:g}),n>0&&e("div",{className:"absolute inset-0 z-[2]",style:{background:x,opacity:Math.min(Math.max(n,0),100)/100}}),D(v)&&e("div",{className:"absolute inset-0 z-[2]",style:{background:C(S),...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",h?"sf-hero-group-layer-edit":""].filter(Boolean).join(" "),style:{...M,...z(w,b)},children:d&&e(d,{className:"sf-hero-group-zone",minEmptyHeight:160})})]})}const B=Array.from({length:3},(i,t)=>({name:`Slide ${t+1}`,process:"Category",mediaType:"image",mediaVideo:"",poster:""}));export{B as HERO_SLIDE_SEEDS,T as HeroSlideStyleContext,V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as c,SettingsField as d,SettingsSegmented as h}from"efficient-easel/panel";import{HoverIcon as p}from"efficient-easel/icons";import{say as e,editorEaselWords as u}from"../lib/editor-words.js";import{HOVER_EFFECTS as E,DEFAULT_HOVER_EFFECT as s}from"../lib/theme.js";const o={none:"None",lift:"Lift",highlight:"Highlight"},g="What a card does when a shopper points at it — or taps it, on a phone. Highlight is the effect your cards already use.";function m({value:i,onChange:n,showHint:f=!0}){const r=i===null,a=i??s;return t(d,{label:e("Hover effect"),icon:t(p,{}),value:e(o[a]),changed:!r,action:t(c,{words:u()?.panel,label:e("Hover effect"),changed:!r,detail:e(o[s]),onReset:()=>n(null)}),hint:f?e(g):void 0,children:t(h,{options:E.map(l=>({id:l,label:e(o[l])})),value:a,ariaLabel:e("Hover effect"),onChange:n})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{useState as l}from"react";import{Button as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useState as l}from"react";import{Button as u,ImageFocusPoint as c}from"efficient-shell/ui";import f from"./TextStyleRow.js";import{say as o}from"../lib/editor-words.js";function p({label:t,value:n,onChange:s,image:i}){const[a,r]=l(!1);return e(f,{styleKey:"imageFocal",label:t,value:n,sampleStyle:{fontSize:11,fontVariantNumeric:"tabular-nums"},open:a,onToggle:()=>r(m=>!m),children:a?e(c,{label:o(t),value:n,onChange:s,image:i,emptyText:o("Choose a background image first — there’s nothing to focus yet."),actions:e(u,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:o("Done")})}):null})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{integrationIcon as g}from"./integrationIcons.js";import{renderGold as f,renderHeadline as u}from"./goldPhrases.js";import{say as v}from"../lib/editor-words.js";function N(a,t){const r=Array.from({length:t},()=>[]);return a.forEach((n,i)=>r[i%t].push(n)),r.filter(n=>n.length>0)}function w({name:a}){const t=g(a);return s("span",{className:"flex flex-shrink-0 items-center gap-2.5 whitespace-nowrap rounded border border-line bg-bg px-5 py-2.5",children:[t&&e("svg",{viewBox:"0 0 24 24",className:"h-[16px] w-[16px] flex-shrink-0 fill-current text-fg/85","aria-hidden":!0,children:e("path",{d:t.path})}),e("span",{className:"text-[13px] font-medium tracking-wide text-fg/75",children:a})]})}function b({names:a,reverse:t}){return e("div",{className:"overflow-hidden","aria-hidden":!1,children:e("div",{className:"flex w-max gap-3 pr-3 [animation:sf-marquee_var(--sf-marquee-t)_linear_infinite] motion-reduce:[animation:none]",style:{"--sf-marquee-t":`${Math.max(a.length*6,30)}s`,animationDirection:t?"reverse":"normal"},children:[0,1].map(r=>e("div",{className:"flex gap-3","aria-hidden":r===1,children:a.map((n,i)=>e(w,{name:n},i))},r))})})}function k({eyebrow:a,title:t,body:r,apps:n,statValue:i,statLabel:l,note:x,editing:c=!1}={}){const p=(n??[]).map(m=>(m.text??"").trim()).filter(m=>c||m).map(m=>m||v("App")),h=!!(a??"").trim()||!!(t??"").trim();if(!c&&!h&&p.length===0)return null;const d=N(p,3);return s("section",{className:"relative z-[2] overflow-hidden border-y border-line bg-surface py-[76px]",children:[s("div",{className:"mx-auto mb-12 max-w-[860px] px-10 text-center max-[960px]:px-6",children:[(a??"").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:f(a??"")}),(t??"").trim()&&e("h2",{className:"mt-5 font-display text-[40px] font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg max-[800px]:text-[30px]",children:u(t??"",!1)}),(r??"").trim()&&e("p",{className:"mx-auto mt-5 max-w-[60ch] text-[15px] leading-relaxed text-fg/65",children:r})]}),d.length>0&&e("div",{className:"flex flex-col gap-3",children:d.map((m,o)=>e(b,{names:m,reverse:o%2===1},o))}),((i??"").trim()||(x??"").trim())&&s("div",{className:"mx-auto mt-12 max-w-[860px] px-10 text-center max-[960px]:px-6",children:[(i??"").trim()&&e("div",{className:"font-display text-[min(64px,var(--sf-heading-max,9999px))] font-medium uppercase leading-none text-accent max-[800px]:text-[min(46px,var(--sf-heading-max,9999px))]",children:i}),(l??"").trim()&&e("div",{className:"mt-2 font-display text-[18px] font-medium uppercase tracking-[0.06em] text-fg",children:f(l??"")}),(x??"").trim()&&e("p",{className:"mx-auto mt-4 max-w-[52ch] text-[13px] leading-relaxed text-fg/50",children:x})]})]})}export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as Q}from"react/jsx-runtime";import U from"./Btn.js";import u from"./Placeholder.js";import V from"./SectionEyebrow.js";import{renderGold as N,renderHeadline as W,splitParagraphs as X}from"./goldPhrases.js";import{resolveTypeSize as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as Q}from"react/jsx-runtime";import U from"./Btn.js";import u from"./Placeholder.js";import V from"./SectionEyebrow.js";import{renderGold as N,renderHeadline as W,splitParagraphs as X}from"./goldPhrases.js";import{resolveTypeSize as i}from"../lib/content/section-type-size.js";import{HEADER_HEIGHT_CSS as j}from"../lib/puck/header-clearance.js";import{resolveSectionHeight as k}from"../lib/content/section-height.js";import{INTRO_BLEED_COPY_SHARE as _,parseIntroBleedLayout as Z,resolveCopyShare as E}from"../lib/sections/intro-bleed-layout.js";import{ON_MEDIA_INK_STYLE as ee}from"../lib/content/ink.js";function te({eyebrow:a,title:l,body:s,cta:o,imageLabel:d,imageSrc:c,imageSrcMobile:I,layout:w,copyShareDesktop:z,copyShareMobile:D,sticky:m=!0,heightDesktop:H,heightMobile:S,overlay:p,titleSizeDesktop:B,titleSizeMobile:T,bodySizeDesktop:C,bodySizeMobile:L,buttonColor:M,buttonTextColor:A,uppercase:F=!1,capStyle:h}){const r=Z(w)==="stacked",x=n=>r?`calc(${k(n)} - ${j})`:k(n),O=x(H),P=x(S),R=i(B,"clamp(48px,7vw,96px)","heading","headingLarge"),$=i(T,"clamp(36px,7vw,96px)","heading","headingLarge"),G=i(C,"17px","body","body"),Y=i(L,"16px","body","body"),K=p!=null?p/100:r?0:.6,v=M||"var(--btn)",q=A||"var(--btn-ink)",f={"--intro-h-d":O,"--intro-h-m":P,"--intro-title-d":R,"--intro-title-m":$,"--intro-body-d":G,"--intro-body-m":Y,...r?{"--intro-copy-d":E(z,_.desktop),"--intro-copy-m":E(D,_.mobile),marginTop:j}:{}},g=h?"px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]":"px-[60px] max-[960px]:px-6",b=t(Q,{children:[t("div",{className:"absolute inset-0",children:[e("div",{className:"absolute inset-0 hidden min-[960px]:block",children:e(u,{label:d,src:c})}),e("div",{className:"absolute inset-0 min-[960px]:hidden",children:e(u,{label:d,src:I||c})}),e("div",{className:"pointer-events-none absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent 0 80px, rgba(201,164,97,.04) 80px 81px)"}})]}),e("div",{className:"absolute inset-0",style:{background:`rgba(0,0,0,${K})`}})]}),y=t("div",{style:h,className:"flex flex-col gap-6",children:[a&&e(V,{text:a,size:14}),l&&e("h2",{className:["font-display font-medium leading-[0.95] tracking-[-0.03em]","text-[length:var(--intro-title-m)] min-[960px]:text-[length:var(--intro-title-d)]",F?"uppercase":""].join(" "),children:W(l,!1)}),s&&X(s).map((n,J)=>e("p",{className:"max-w-[560px] leading-[1.6] opacity-85 text-[length:var(--intro-body-m)] min-[960px]:text-[length:var(--intro-body-d)]",children:N(n)},J)),o.text&&e("div",{className:"mt-2 self-start",children:e(U,{href:o.href,variant:"ghost",style:{background:v,color:q,borderColor:v},children:N(o.text)})})]});return r?t("section",{style:f,className:[m?"sticky top-0":"relative","flex flex-col","h-[var(--intro-h-m)] min-[960px]:h-[var(--intro-h-d)] min-h-[420px]","overflow-hidden p-0 z-[1]"].join(" "),children:[e("div",{className:["relative z-[2] flex shrink-0 flex-col justify-center bg-bg py-10","min-h-[var(--intro-copy-m)] min-[960px]:min-h-[var(--intro-copy-d)]",g].join(" "),style:{color:"var(--fg)"},children:y}),e("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:b})]}):t("section",{style:f,className:[m?"sticky top-0":"relative","h-[var(--intro-h-m)] min-[960px]:h-[var(--intro-h-d)] min-h-[420px]","overflow-hidden p-0 z-[1]"].join(" "),children:[b,e("div",{className:["relative z-[2] flex h-full flex-col justify-center",g].join(" "),style:ee,children:y})]})}export{te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as c,Fragment as h}from"react/jsx-runtime";import{SiteLink as u}from"../lib/site-runtime.js";import b from"./SectionEyebrow.js";import{renderGold as v,renderHeadline as k}from"./goldPhrases.js";function
|
|
1
|
+
import{jsx as e,jsxs as c,Fragment as h}from"react/jsx-runtime";import{SiteLink as u}from"../lib/site-runtime.js";import b from"./SectionEyebrow.js";import{renderGold as v,renderHeadline as k}from"./goldPhrases.js";import{say as N}from"../lib/editor-words.js";function y({look:x,eyebrow:t,title:s,items:d,columns:f,editing:i=!1}={}){const g=Math.min(4,Math.max(2,f??3)),n=(d??[]).filter(r=>i||(r.label??"").trim()),o=!!(t??"").trim()||!!(s??"").trim();return!i&&!o&&n.length===0?null:e("section",{className:"relative z-[2] border-y border-line bg-surface",children:c("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:[o&&c("div",{className:"mb-11 flex flex-wrap items-baseline gap-5 max-[800px]:mb-8",children:[(t??"").trim()&&e(b,{text:t??"",look:x}),(s??"").trim()&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-[800px]:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:k(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(g)},children:n.map((r,l)=>{const m=c(h,{children:[e("span",{"aria-hidden":!0,className:"h-[9px] w-[9px] flex-shrink-0 rotate-45 bg-accent"}),e("span",{className:"font-display text-[length:var(--size-body,17px)] font-medium uppercase tracking-[0.06em] text-fg transition-colors group-hover/kf:text-accent",children:v((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(u,{href:a,className:p,children:m},l):e("a",{href:a,className:p,children:m},l)}return e("div",{className:"flex items-center gap-4 bg-bg px-7 py-[30px]",children:m},l)})})]})})}export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as
|
|
1
|
+
"use client";import{jsx as e,Fragment as O,jsxs as f}from"react/jsx-runtime";import{useId as $,useState as V}from"react";import{InspectorUpLevel as I}from"efficient-easel/chrome";import{useEasel as Y}from"efficient-easel/easel";import{ListField as E}from"efficient-easel/fields";import{SettingsField as F}from"efficient-easel/panel";import{ClockIcon as G,ContrastIcon as Z,GlobeIcon as J,LinkIcon as Q,LocationIcon as X,PhoneIcon as K,SquareIcon as ee,TypeIcon as A}from"efficient-easel/icons";import ne from"./MediaUploadField.js";import{useLocationsHasTree as te}from"./LocationsTreeContext.js";import{say as n,sayCount as H}from"../lib/editor-words.js";import{CoordsField as oe}from"../lib/puck/controls.js";import{useLocationsFocus as ie,setLocationsFocus as v}from"../lib/puck/locations-focus.js";import{groupKeyOf as k,groupLabelOf as re,NEW_CITY as W,writeGroupCities as le,writeGroupOrder as ae}from"../lib/puck/locations-tree.js";import{useSectionOps as se}from"../lib/puck/use-section-ops.js";import{ROOT_ZONE as ce}from"../lib/puck/content-tree.js";import{CONTACT_LOCATIONS_DEFAULTS as _,parseLocationTileShape as de}from"../lib/content/contact.js";const D=(a,t)=>t||a?re(a,t):n("Ungrouped");function pe(a){const t=[];return a.forEach((c,r)=>{const m=k(c);let s=t.find(i=>i.key===m);s||(s={key:m,name:String(c?.groupName??""),indices:[]},t.push(s)),s.indices.push(r)}),t}function z({children:a}){return e("div",{style:{fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim, #999)",margin:"14px 0 6px"},children:a})}const R={width:"100%",height:32,textAlign:"left",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"0 12px",fontSize:12,border:"1px solid var(--border-strong, #d0d0d0)",borderRadius:6,background:"transparent",color:"inherit",cursor:"inherit"},ue={padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer"},B={...ue,color:"#d85a30"};function b({label:a,value:t,placeholder:c,textarea:r,icon:m,onChange:s,onBlur:i,onKeyDown:h}){const x=$();return e(F,{label:a,icon:m??e(A,{}),htmlFor:x,children:r?e("textarea",{id:x,value:t,placeholder:c,onChange:g=>s(g.target.value)}):e("input",{id:x,type:"text",value:t,placeholder:c,onChange:g=>s(g.target.value),onBlur:i,onKeyDown:h})})}const me=[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],he=[{label:"Tall (3:4)",value:"tall"},{label:"Square",value:"square"},{label:"Wide (2:1)",value:"wide"}];function M({label:a,icon:t,options:c,value:r,onChange:m}){return e(F,{label:a,icon:t,children:e("div",{role:"group","aria-label":a,style:{display:"flex",gap:4,flex:1},children:c.map(s=>{const i=r===s.value;return e("button",{type:"button","aria-pressed":i,onClick:()=>m(s.value),style:{flex:1,padding:"6px 8px",fontSize:12,borderRadius:6,cursor:"pointer",border:`1px solid ${i?"var(--sf-accent, #2563eb)":"var(--border-strong, #d0d0d0)"}`,background:i?"var(--sf-accent, #2563eb)":"transparent",color:i?"#fff":"inherit",fontWeight:i?500:400},children:n(s.label)},s.value)})})})}function P({props:a,setSection:t,headOnly:c}){const r=i=>String(a[i]??""),m=a.mapTheme||_.mapTheme,s=_;return f(O,{children:[!c&&e(z,{children:n("Section")}),e(b,{label:n("Section number"),value:r("sectionNumber"),placeholder:s.sectionNumber,onChange:i=>t({sectionNumber:i})}),e(b,{label:n("Heading"),textarea:!0,value:r("heading"),placeholder:s.heading,onChange:i=>t({heading:i})}),e(b,{label:n("Body"),textarea:!0,value:r("tagline"),placeholder:s.tagline,onChange:i=>t({tagline:i})}),c?null:f(O,{children:[e(z,{children:n("City strip")}),e(b,{label:n("Eyebrow"),value:r("galleryKicker"),placeholder:s.galleryKicker,onChange:i=>t({galleryKicker:i})}),e(b,{label:n("Hint"),value:r("galleryHint"),placeholder:s.galleryHint,onChange:i=>t({galleryHint:i})}),e(M,{label:n("Shape"),icon:e(ee,{}),options:he,value:de(a.imageShape),onChange:i=>t({imageShape:i})}),e(z,{children:n("Map & Theme")}),e(M,{label:n("Map theme"),icon:e(Z,{}),options:me,value:m,onChange:i=>t({mapTheme:i})})]})]})}function ge({cards:a,groupKey:t,onChange:c,onBack:r,onOpenCity:m,onNavigate:s}){const i=a.map((l,u)=>k(l)===t?u:-1).filter(l=>l>=0),h=String(a[i[0]]?.groupName??""),x=new Set(a.map(k).filter(l=>l!==t)),[g,w]=V(t),C=l=>c(a.map(u=>k(u)===t?{...u,...l}:u)),L=()=>{const l=g;if(l!==t){if(x.has(l)){w(t);return}c(a.map(u=>k(u)===t?{...u,group:l}:u)),s(l)}};return f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:n("Section"),onSelect:r}),e("div",{style:{fontSize:14,fontWeight:500,margin:"6px 0 10px"},children:D(t,h)}),e(b,{label:n("Group heading"),value:g,placeholder:n("e.g. Americas"),onChange:w,onBlur:L,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()}}),x.has(g)&&g!==t&&e("p",{className:"sf-note sf-note--error",role:"alert",children:n("Another group already uses this heading — pick a different one.")}),e(b,{label:n("Group name"),value:h,placeholder:n("Shown beside the heading"),onChange:l=>C({groupName:l})}),e(E,{label:n("Cities in this group"),noun:n("city"),items:i.map(l=>a[l]),onChange:l=>c(le(a,t,l)),newItem:()=>({...W,group:t,groupName:h}),open:null,onOpen:()=>{},renderItem:()=>null,removeOnRow:!1,canDuplicate:()=>!1,renderRow:(l,u)=>f("button",{type:"button",style:R,onClick:()=>m(i[u]),children:[e("span",{children:l?.name||n("City")}),e("span",{"aria-hidden":"true",children:"›"})]})}),e("div",{style:{marginTop:12},children:e("button",{type:"button",style:B,onClick:()=>{c(a.filter(l=>k(l)!==t)),r()},children:H("Delete group ({n} city)","Delete group ({n} cities)",i.length)})})]})}function fe({value:a,onChange:t}){const c=Array.isArray(a)?a:[],r=ie(),m=te(),s=pe(c),{appState:i,selectedItem:h}=Y(o=>o),x=se(),g=h?.props??{},w=o=>{if(!h)return;const p=(i.data.content??[]).findIndex(y=>y.props.id===h.props.id);p<0||x.replaceComponent(ce,p,{type:h.type,props:{...h.props,...o}})},C=(o,d)=>t(c.map((p,y)=>y===o?{...p,...d}:p)),L=()=>{const o=new Set(s.map(y=>y.key));let d=s.length+1,p=`Group ${d}`;for(;o.has(p);)p=`Group ${++d}`;return p};if(r.level==="texts")return f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:n("Locations"),onSelect:()=>v({level:"groups"})}),e("div",{style:{fontSize:14,fontWeight:500,margin:"6px 0 10px"},children:n("Texts")}),e(P,{props:g,setSection:w,headOnly:!0})]});if(r.level==="image"){const o=c[r.index];return o?f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:String(o.name??"")||n("City"),onSelect:()=>v({level:"city",index:r.index})}),e("div",{style:{fontSize:14,fontWeight:500,margin:"6px 0 10px"},children:n("Image")}),e(ne,{value:o.photo||"",onChange:d=>C(r.index,{photo:d}),label:"Image",accept:"image/*"})]}):l()}if(r.level==="map"){const o=c[r.index];return o?f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:String(o.name??"")||n("City"),onSelect:()=>v({level:"city",index:r.index})}),e("div",{style:{fontSize:14,fontWeight:500,margin:"6px 0 10px"},children:n("Map")}),e(oe,{value:o.geocode,onChange:d=>C(r.index,{geocode:d}),label:"Coordinates"}),e(b,{label:n("Directions link"),icon:e(Q,{}),value:String(o.mapsUrl??""),onChange:d=>C(r.index,{mapsUrl:d})})]}):l()}if(r.level==="city"){const o=r.index,d=c[o];if(!d)return l();const p=k(d),y=(T,N)=>C(o,{[T]:N}),S=(T,N,U,j=!1)=>e(b,{label:N,icon:U,textarea:j,value:String(d[T]??""),onChange:q=>y(T,q)});return f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:D(p,String(d.groupName??"")),onSelect:()=>v({level:"group",key:p})}),e("div",{style:{fontSize:14,fontWeight:500,margin:"6px 0 10px"},children:d.name||n("City")}),S("name",n("Location name"),e(A,{})),S("state",n("State / Province"),e(A,{})),S("country",n("Country"),e(J,{})),S("address",n("Address"),e(X,{}),!0),S("phone",n("Phone"),e(K,{})),S("hours",n("Opening hours"),e(G,{})),S("timezone",n("Timezone chip"),e(G,{})),e("div",{style:{marginTop:12},children:e("button",{type:"button",style:B,onClick:()=>{t(c.filter((T,N)=>N!==o)),v({level:"group",key:p})},children:n("Delete city")})})]})}if(r.level==="group")return s.some(o=>o.key===r.key)?e(ge,{cards:c,groupKey:r.key,onChange:t,onBack:()=>v({level:"groups"}),onOpenCity:o=>v({level:"city",index:o}),onNavigate:o=>v({level:"group",key:o})},r.key):l();function l(){return f("div",{className:"sf-locations-view",children:[e(P,{props:g,setSection:w}),!m&&e(O,{children:u()})]})}function u(){return e(E,{label:n("Locations"),noun:n("group"),items:s,onChange:o=>{const d=o.find(p=>!s.some(y=>y.key===p.key));t(ae(c,o.map(p=>p.key),p=>[{...W,group:p,groupName:""}])),d&&v({level:"group",key:d.key})},newItem:()=>({key:L(),name:"",indices:[]}),open:null,onOpen:()=>{},renderItem:()=>null,removeOnRow:!1,canDuplicate:()=>!1,above:s.length===0?e("div",{style:{fontSize:12,color:"var(--fg-dim, #999)",padding:"4px 0"},children:n("No locations yet.")}):void 0,renderRow:o=>f("button",{type:"button",style:R,onClick:()=>v({level:"group",key:o.key}),children:[e("span",{style:{fontWeight:500},children:D(o.key,o.name)}),f("span",{style:{color:"var(--fg-dim, #999)"},children:[H("{n} city","{n} cities",o.indices.length)," ›"]})]})})}return l()}export{fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as w}from"react/jsx-runtime";import{SettingsField as h}from"efficient-easel/panel";import{ImageIcon as y,PlayIcon as v}from"efficient-easel/icons";import{ImageBox as N}from"efficient-easel/pick";import{useEaselStrings as B}from"efficient-easel/strings";import{useContext as F,useState as b}from"react";import{FileIntakeAlert as C,useFileIntake as O}from"efficient-shell/file-intake";import{StorefrontDocumentContext as P}from"./StorefrontDocumentContext.js";import{say as s}from"../lib/editor-words.js";import{requestMediaPick as k}from"../lib/editor-media-picker.js";import{useEditorHost as z}from"../lib/editor-host.js";import{backendOf as A}from"../lib/website-session.js";import{useEditorSession as H}from"../lib/editor-session-context.js";function L({value:x,onChange:m,label:j,accept:o,placeholder:d}){const c=z(),E=H(),I=B(),t=s(j),[a,f]=b(!1),[u,n]=b(null),i=o.startsWith("video"),p=F(P),r=O({accept:o,maxSizeBytes:A(E).media.maxUploadBytes,acceptHint:i?s("videos only"):s("images only"),multiple:!1,disabled:a,onAccept:([l])=>{n(null),f(!0),k(c,{accept:o,title:t,file:l}).then(g=>{g&&m(g.url)}).catch(()=>n(s("Couldn’t open the media picker — please try again."))).finally(()=>f(!1))}}),S=()=>(r.clearRejections(),n(null),k(c,{accept:o,title:t}).then(l=>l?.url??null));return p&&!p.capabilities.mediaEditing?e(h,{label:t,icon:i?e(v,{}):e(y,{}),children:e("div",{className:"sf-image-slot-inert",children:i?s("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):s("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})}):w("div",{children:[e(h,{label:t,icon:i?e(v,{}):e(y,{}),children:e("div",{className:`sf-image-drop${r.dragOver?" is-dragover":""}`,...r.zoneProps,children:e(N,{value:x,onChange:m,label:t,kind:i?"video":"image",placeholder:d===void 0?void 0:s(d),openLibrary:a?void 0:S,words:I.pick.image})})}),a&&e("div",{className:"sf-image-status",role:"status",children:s("Opening the picker…")}),u&&e("div",{className:"sf-image-status sf-image-status--error",role:"alert",children:u}),e(C,{rejections:r.rejections,className:"sf-image-status sf-image-status--error"})]})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as u}from"react/jsx-runtime";import{useId as p}from"react";import{FieldSelect as f}from"efficient-easel/fields";import{SettingsField as b}from"efficient-easel/panel";import{say as l}from"../lib/editor-words.js";function h(i){return i.map(({value:o,label:e,note:t})=>({value:o,label:e,...t?{meta:t}:{}}))}function x({label:i,options:o,value:e,onChange:t,emptyLabel:n,icon:c,hint:s}){const r=p(),d=`${r}-label`,a=`${r}-button`,m=Array.isArray(e)?e:[];return u(b,{label:l(i),labelId:d,icon:c,hint:s,children:u(f,{id:a,multiple:!0,value:m,options:h(o),onChange:t,placeholder:n===void 0?l("None"):l(n),ariaLabelledBy:`${d} ${a}`,inline:!0})})}export{x as default,h as multiSelectOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as l,Fragment as se}from"react/jsx-runtime";import{useCallback as le,useEffect as U,useId as oe,useMemo as q,useState as d}from"react";import{useStorefrontDocument as re}from"./StorefrontDocumentContext.js";import f from"./UiIcon.js";import ie from"./SidePanelHead.js";import{useWebsiteName as ce}from"./WebsiteSettingsPanel.js";import{InspectorIconButton as de}from"efficient-easel/chrome";import{Button as K,Dialog as pe,FormField as ue,Input as me,Tooltip as O}from"efficient-shell/ui";import{AddIcon as he}from"efficient-easel/icons";import{PagesIcon as ge}from"efficient-easel/rail";import{useEditorHost as fe}from"../lib/editor-host.js";import{bucketEditorPageRows as be,DYNAMIC_PAGES_GROUP_KEY as ye,isDynamicPageRow as we,MAIN_PAGES_GROUP as Ne}from"../lib/editor-page-rows.js";import{useEditorSession as ke}from"../lib/editor-session-context.js";import{say as a}from"../lib/editor-words.js";const Y="sf-editor-pages-collapsed-groups",ve=i=>i.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),J=(i,b)=>{const c=ve(i)||"page";if(!b.has(c))return c;let m=2;for(;b.has(`${c}-${m}`);)m+=1;return`${c}-${m}`};function Ce({onNavigate:i,onClose:b,activeSurface:c,onPreviewSurface:m}){const y=ke().chrome?.pageRows,_=fe(),{adapter:p,capabilities:w,ready:N,currentSlug:z}=re(),Q=ce(),[r,k]=d(null),[S,T]=d(""),[u,v]=d(!1),[C,h]=d(null),[F,P]=d(!1),[g,I]=d(""),G=oe(),A=le(async()=>{if(N)try{k(await p.listPages())}catch{k([])}},[p,N]);U(()=>{k(null),A()},[A]);const[x,V]=d(()=>{if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(Y);return new Set(e?JSON.parse(e):[])}catch{return new Set}});U(()=>{try{window.localStorage.setItem(Y,JSON.stringify([...x]))}catch{}},[x]);const X=e=>V(s=>{const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n}),Z=q(()=>be(r??[]),[r]),E=S.trim().toLowerCase(),W=e=>!E||e.toLowerCase().includes(E),ee=e=>E?!0:!x.has(e),$=q(()=>new Set((r??[]).map(e=>e.slug)),[r]),B=()=>{if(w.pageCreationInAdminForm){_.send("storefront-editor:new-page");return}I(""),h(null),P(!0)},j=async()=>{const e=g.trim();if(!(!e||!N||u||!p.createPage)){v(!0),h(null);try{const s=await p.createPage({slug:J(e,$),title:e,layout:{}});await A(),P(!1),I(""),i(s.slug)}catch{h(a("Couldn’t add the page — please retry."))}finally{v(!1)}}},te=async e=>{if(!(!N||u||!p.deletePage||(r??[]).length<=1)){v(!0);try{await p.deletePage(e.id);const s=(r??[]).filter(n=>n.id!==e.id);k(s),h(null),e.slug===z&&s[0]&&i(s[0].slug)}catch{h(a("Couldn’t delete the page — please retry."))}finally{v(!1)}}},ae=e=>_.send("storefront-editor:open-page",{slug:e}),ne=e=>{if(!W(e.label))return null;const s=!c&&e.slug===z,n=w.canDeletePagesInline&&(r??[]).length>1;return l("div",{className:`sf-row sf-prow ${s?"is-selected":""}`,onClick:()=>i(e.slug),children:[t("span",{className:"sf-chip",children:t(Pe,{})}),t("span",{className:"sf-row-name",children:e.label}),we(e)&&t("span",{className:"sf-badge-dynamic",children:a("Dynamic")}),e.kind==="lightbox"&&t("span",{className:"sf-badge-lightbox",children:a("Lightbox")}),e.draft&&t("span",{className:"sf-page-draft",children:a("draft")}),w.pageCreationInAdminForm&&t(O,{content:a("Edit “{name}” in {place}",{name:e.label,place:a("the admin")}),children:t("button",{type:"button",className:"sf-page-edit","aria-label":a("Edit {name} in {place}",{name:e.label,place:a("the admin")}),onClick:o=>{o.stopPropagation(),ae(e.slug)},children:t(f,{name:"pencil",size:13,strokeWidth:1.7,rounded:!0})})}),n&&t(O,{content:a("Delete “{name}”",{name:e.label}),children:t("button",{type:"button",className:"sf-page-edit sf-page-edit--danger",disabled:u,"aria-label":a("Delete {name}",{name:e.label}),onClick:o=>{o.stopPropagation(),te(e)},children:t(f,{name:"trash",size:13,strokeWidth:1.7,rounded:!0})})})]},e.id)},D=(e,s,n)=>{const o=n.filter(Boolean);if(o.length===0)return null;const L=ee(e);return l("div",{className:"sf-pgroup",children:[l("button",{type:"button",className:"sf-pgroup-head","aria-expanded":L,onClick:()=>X(e),children:[t(f,{name:"chevron-right",size:10,strokeWidth:2.6,rounded:!0,style:{transform:L?"rotate(90deg)":"none",transition:"transform 0.14s"}}),t("span",{className:"sf-pgroup-label",children:s}),t("span",{className:"sf-pgroup-count",children:o.length})]}),L&&t("div",{className:"sf-pgroup-body",children:o})]},e)},H=(y?.rows??[]).filter(e=>W(e.label)).map(e=>{const s=c===e.key;return l("div",{className:`sf-row sf-prow sf-prow--shop ${s?"is-selected":""}`,onClick:()=>m(e.key),children:[t("span",{className:"sf-chip",children:e.icon}),t("span",{className:"sf-row-name",children:e.label}),t("span",{className:"sf-badge-preview",children:a("Preview")}),t(O,{content:a("Open the {name} in a new tab",{name:e.label}),children:t("a",{className:"sf-page-edit",href:e.href,target:"_blank",rel:"noopener noreferrer","aria-label":a("Open the {name} in a new tab",{name:e.label}),onClick:n=>n.stopPropagation(),children:t(f,{name:"external-link",size:13,strokeWidth:1.7,rounded:!0})})})]},e.key)}),M=w.hasSiteSettings&&!!y,R=(()=>{if(r===null)return null;const e=[];let s=!1;for(const n of Z){M&&!s&&n.key.startsWith("system:")&&(e.push(D("shop",y.title,H)),s=!0);const o=n.key===ye||n.label===Ne?a(n.label):n.label;e.push(D(n.key,o,n.rows.map(ne)))}return M&&!s&&e.push(D("shop",y.title,H)),e})();return l("div",{className:"sf-pages",children:[t(ie,{icon:t(ge,{}),title:a("Pages"),context:Q,actions:t(de,{label:a("New page"),onClick:B,children:t(he,{size:15})}),onHide:b}),l("div",{className:"sf-pages-search",children:[t(f,{name:"search",size:14,rounded:!0}),t("input",{type:"search",className:"sf-pages-search-input",placeholder:a("Search all pages…"),value:S,onChange:e=>T(e.target.value),"aria-label":a("Search all pages")})]}),l("div",{className:"sf-pages-list sf-scroll",children:[C&&!F&&t("div",{className:"sf-note sf-note--error",role:"alert",children:C}),R===null?t("div",{className:"sf-note",children:a("Loading…")}):R.some(Boolean)?R:t("div",{className:"sf-note",children:S.trim()?a("No pages match your search"):a("No pages yet")})]}),l("button",{type:"button",className:"sf-pages-new",onClick:B,children:[t("span",{className:"sf-plus",children:"+"}),a("New page")]}),t(pe,{open:F,onClose:()=>P(!1),size:"sm",title:a("Add a page"),description:a("Give the new template page a name. It starts blank — add sections once it opens."),footer:l(se,{children:[t(K,{variant:"secondary",onClick:()=>P(!1),children:a("Cancel")}),t(K,{onClick:()=>{j()},disabled:u||!g.trim(),loading:u,children:u?a("Adding…"):a("Add page")})]}),children:t(ue,{label:a("Page name"),htmlFor:G,hint:g.trim()?a("URL: /{slug}",{slug:J(g,$)}):void 0,error:C??void 0,children:t(me,{id:G,value:g,invalid:!!C,onChange:e=>I(e.target.value),onKeyDown:e=>{e.key==="Enter"&&j()},placeholder:a("e.g. About")})})})]})}function Pe(){return l("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),t("path",{d:"M14 3v5h5"})]})}export{Ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{ColorSwatch as c,Tooltip as f}from"efficient-shell/ui";import{say as s}from"../lib/editor-words.js";import{AnyColourSwatch as k}from"../lib/puck/ColourControl.js";function v({value:t,label:i,colors:p,onChange:d}){const m=t===null,a=t||void 0,l=p.find(e=>e.key===a),o=l?l.value:a&&/^#[0-9a-f]{6}$/i.test(a)?a:void 0;return r("div",{className:"sf-part-ink",children:[r("div",{className:"sf-part-ink-top",children:[n("span",{className:"sf-part-ink-label",children:s(i)}),n("span",{className:"sf-part-ink-read",children:o?o.toUpperCase():m?s("Mixed"):s("Follows the style")})]}),r("div",{className:"sf-part-ink-swatches",role:"group","aria-label":s(i),children:[p.map(e=>n(f,{content:`${s(e.name)} · ${e.value.toUpperCase()}`,children:n(c,{color:e.value,"aria-label":s(e.name),size:"sm",selected:a===e.key,onClick:()=>d(a===e.key?null:e.key)})},e.key)),k({value:l?"":(o??"").toLowerCase(),label:"Any color",onChange:d})]})]})}export{v as PartInkControl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Tooltip as c}from"efficient-shell/ui";import{say as e}from"../lib/editor-words.js";function f({label:t,onClear:n,what:r="override"}){const l=e(t),i=r==="override"?e("Clear override"):r==="change"?e("Clear change"):e("Clear {what}",{what:r}),s=r==="override"?e("Clear override: {label}",{label:l}):r==="change"?e("Clear change: {label}",{label:l}):e("Clear {what}: {label}",{what:r,label:l});return a(c,{content:i,children:a("button",{type:"button",className:"sf-part-mark","aria-label":s,onClick:n,children:a(d,{})})})}function d(){return o("svg",{width:"12",height:"12",viewBox:"0 0 16 16","aria-hidden":"true",children:[a("circle",{className:"sf-part-mark-dot",cx:"8",cy:"8",r:"3",fill:"currentColor"}),o("g",{className:"sf-part-mark-arrow",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",children:[a("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a("path",{d:"M13 2.5V5h-2.6"})]})]})}export{f as PartResetDot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as r,Fragment as O}from"react/jsx-runtime";import{useEffect as M,useId as _e,useRef as J,useState as Q}from"react";import{PartResetDot as fe}from"./PartResetDot.js";import{FieldSelect as pe,InspectorField as $e}from"efficient-easel/fields";import{SettingsField as me,SettingsGroup as Ae}from"efficient-easel/panel";import{InspectorUpLevel as G}from"efficient-easel/chrome";import{StylesIcon as Le,TextColorIcon as ze,TypeIcon as he}from"efficient-easel/icons";import{useEasel as Be}from"efficient-easel/easel";import{Tooltip as De}from"efficient-shell/ui";import{PartInkControl as Ve}from"./PartInkControl.js";import{PartTextBox as Me}from"./PartTextBox.js";import ye from"./UiIcon.js";import{usePreviewHeader as Ge}from"./PreviewHeaderContext.js";import{usePartStyle as We}from"./PreviewPartStyleContext.js";import{readHidable as W,textFieldOffPage as je}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as He}from"../lib/puck/field-markers.js";import{useSectionOps as Ue}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as Ke,FONT_ROLES as Z,FONT_ROLE_LABELS as ee,fontOption as $}from"../lib/fonts.js";import{isMultilineKind as Xe,partPlaceholder as Ye,typeInPlaceKind as qe}from"../lib/puck/part-text.js";import{partRowField as Je}from"../lib/puck/part-row-field.js";import{decodePartKey as Qe,partPropsWithRowValue as Ze,partRowValue as et}from"../lib/puck/part-rows.js";import{PART_WIDTH_MAX as tt,propsWithPartStyleValue as te,propsWithoutPartStyle as nt,readPartStyle as ge}from"../lib/puck/part-styles.js";import{partInks as ot}from"../lib/puck/part-inks.js";import{styleKeyForPart as st,TEXT_KIND_LABELS as lt}from"../lib/sections/section-text-kinds.js";import{commitPartText as rt}from"../lib/puck/part-typing.js";import{useEditorHost as it}from"../lib/editor-host.js";import{SOURCE_LINES as at,SOURCE_ACTIONS as ct,SOURCE_ACTION_LABEL as dt,partSourceOf as ut,sourceSlugOf as be}from"../lib/puck/source-bound-parts.js";import{encodePartId as ft,holdsAuthoredText as pt}from"../lib/puck/text-parts.js";import{regionsForSection as mt}from"../lib/sections/section-text-regions.js";import{textRegionOfPartKey as ht}from"../lib/sections/text-regions.js";const yt={400:"Regular",500:"Medium",600:"Semibold",700:"Bold"},Se=[{key:"font",label:"Font",group:"Style"},{key:"color",label:"Color",group:"Style"}],gt=[...new Set(Se.map(e=>e.group))],bt={font:t(he,{}),color:t(ze,{})};function I(e){return e.kind==="role"?ee[e.role]:e.kind==="custom"?"Custom":null}const St=e=>e.kind==="role"?`role:${e.role}`:e.kind;function xt(e){const n=e.role;return n&&Z.includes(n)?{kind:"role",role:n}:null}function vt(e,n){if(!e)return{kind:"unread"};const{faceRole:s,base:l}=e;if(n[s]===l.fontKey)return{kind:"role",role:s};const c=Object.keys(n).filter(i=>n[i]===l.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function ne(e,n,s,l){return xt(ge(e,n))??vt(s,l)}function un(e,n,s,l){return I(ne(e,n,s,l))}function oe(e,n){if(!e.length)return null;const s=n(e[0]);return e.every(l=>n(l)===s)?s:null}function Nt(e){return Object.values(e).filter(n=>n!==void 0).length}function Pt(e,n){const s=e.style[n];return n==="color"?s??"":s!==void 0?String(s):e.base.fontKey}function kt({face:e,base:n,onPick:s}){const[l,c]=Q(!1),i=J(null),h=J(null),y=_e();M(()=>{if(!l)return;const a=T=>{i.current&&!i.current.contains(T.target)&&c(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[l]);const u=e.kind==="role"?e.role:null,N=a=>{s(a),c(!1),h.current?.focus()};return r("div",{className:"sf-part-style-pick",ref:i,children:[r("button",{ref:h,type:"button",className:"sf-part-style-trigger","aria-expanded":l,"aria-controls":y,"aria-label":`Follows ${I(e)??"no style"} — change`,onClick:()=>c(a=>!a),onKeyDown:a=>{a.key==="Escape"&&l&&(a.preventDefault(),c(!1))},children:[t("span",{className:"sf-part-style-name",style:{fontFamily:n?.fontKey?`var(${$(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:I(e)}),t("span",{className:"sf-part-style-sign","aria-hidden":"true"})]}),l&&r("div",{className:"sf-multi-menu sf-part-style-menu",id:y,role:"listbox",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),c(!1),h.current?.focus())},children:[r("button",{type:"button",role:"option","aria-selected":u===null,className:`sf-part-style-option${u===null?" is-on":""}`,onClick:()=>N(null),children:[t("span",{className:"sf-part-style-option-name",children:"No style"}),t("span",{className:"sf-note",children:"Section’s own"})]}),Z.map(a=>t("button",{type:"button",role:"option","aria-selected":u===a,className:`sf-part-style-option${u===a?" is-on":""}`,onClick:()=>N(a),children:t("span",{className:"sf-part-style-option-name",style:{fontFamily:`var(--font-role-${a})`},children:ee[a]})},a))]})]})}const j="";function wt({face:e,base:n,onPick:s}){const l=e.kind==="role"?e.role:j,c=[{label:"No style",value:j},...Z.map(i=>({label:ee[i],value:i}))];return t(pe,{ariaLabel:"Style",value:l,options:c,inline:!0,onChange:i=>s(i===j?null:i),renderOption:i=>i.value===j?r(O,{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:"Section’s own"})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${i.value})`},children:i.label}),renderValue:()=>t("span",{style:{fontFamily:n?.fontKey?`var(${$(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:I(e)}),valueText:i=>I(e)??i?.label??""})}function Tt({parts:e,onEditStyle:n,onClearAll:s,onFollowStyle:l,kindLabel:c}){const h=oe(e,T=>St(T.face))?e[0].face:null,y=h?I(h):null,u=h&&h.kind!=="unread"?e[0].base:null,N=e.reduce((T,A)=>T+Nt(A.style),0),a=u?$(u.fontKey)?.label:void 0;return r("div",{className:`sf-part-style${N?" has-overrides":""}`,children:[t("div",{className:"sf-part-style-caption",children:"Style"}),e.length>1&&r("div",{className:"sf-part-style-count",children:[e.length," selected"]}),e.length===1&&c&&r("div",{className:"sf-part-style-count",children:[c," · every row"]}),y&&u?r(O,{children:[l&&h?t(kt,{face:h,base:u,onPick:l}):t("div",{className:"sf-part-style-name",style:{fontFamily:a?`var(${$(u.fontKey)?.cssVar})`:void 0,fontWeight:u.weight},children:y}),t("div",{className:"sf-part-style-meta",children:[a,`${Math.round(u.sizePx)} px`,yt[u.weight]].filter(Boolean).join(" · ")})]}):t("div",{className:"sf-part-style-name",children:"Mixed styles"}),r("div",{className:"sf-part-style-top",children:[y?N?r(O,{children:[r("span",{className:"sf-part-chip",children:[N," changed"]}),t("button",{type:"button",className:"sf-part-link",onClick:s,children:"Clear"})]}):t("span",{className:"sf-part-style-state",children:"This text follows the site style."}):t("span",{className:"sf-part-style-state",children:"Changes apply to all selected."}),t("span",{className:"sf-part-style-gap"}),y&&n&&t("button",{type:"button",className:"sf-part-link",onClick:n,children:"Edit"})]})]})}function Et({sectionName:e,onBack:n,textEditor:s,styleRow:l,children:c}){return r("div",{className:"sf-part-panel",children:[t(G,{inline:!0,name:e,onSelect:n}),s,l,c]})}function xe({source:e,slug:n}){const s=it(),l=ct[e],c=!l.needsSlug||!!n;return t("div",{className:"sf-note sf-note--source",children:r("p",{className:"es-field-hint sf-hint-keep",children:[at[e],c?r(O,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{l.type==="storefront-editor:open-menus"?s.send(l.type):n&&s.send(l.type,{slug:n})},children:dt})]}):null]})})}const ve=4,Rt=120;function Ct({region:e,sizePx:n,face:s,base:l,onFollowStyle:c,source:i,slug:h,onBack:y}){const u=e.follows;return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:e.label})}),r("p",{children:["Its size follows Site styles ▸ ",u,n?` — ${Math.round(n)}px right now`:"","."]}),c?t(O,{children:t(me,{label:"Style",icon:t(Le,{}),hint:r(O,{children:["Every ",e.label.toLowerCase()," in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is."]}),children:t(wt,{face:s,base:l,onPick:c})})}):t("p",{className:"es-field-hint sf-hint-keep",children:"Only the size follows a site style. This section sets its own font, weight and letter case."}),i?t(xe,{source:i,slug:h}):null,t(G,{inline:!0,name:"Page",onSelect:y})]})}function Ft({onBack:e}){return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:"This part is no longer here."})}),t("p",{children:"The section it belonged to has been changed or removed."}),t(G,{inline:!0,name:"Page",onSelect:e})]})}function Ot({onBack:e,partId:n,why:s}){return r("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:"This part's settings did not open."})}),t("p",{children:"The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead."}),t("p",{className:"sf-note-detail",children:r("code",{children:[n," — ",s]})}),t(G,{inline:!0,name:"Page",onSelect:e})]})}function It({nodeId:e,propKey:n,onBack:s,onEditStyle:l}){const{getItemById:c,getSelectorForId:i,config:h}=Be(o=>o),y=Ue(),{partStyle:u}=We(),{fonts:N}=Ge(),[a,T]=Q({}),A=J(null),g=c(e),S=i(e),se=g?h.components[g.type]:void 0,{key:E,row:P}=Qe(n),le=se?.fields?.[E],k=P?Je(le,P):le,_=ft(e,n),p=g?.props??{},w=qe(k),Ne=je(k),Pe=pt(k),H=g?ut(g.type):null,U=P?et(p[E],P):p[E],re=!!P&&!(Array.isArray(p[E])&&P.index<p[E].length);M(()=>{A.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[_]);const[K,ie]=Q(0);M(()=>ie(0),[_]);const X=!!g&&!re&&(!S||!k);M(()=>{if(!X||K>=ve)return;const o=setTimeout(()=>ie(d=>d+1),Rt);return()=>clearTimeout(o)},[X,K]);const ke=X&&K<ve;if(!g||re)return t(Ft,{onBack:s});const L=mt(g.type),ae=L?ht(L,n):null;if(L&&ae){const o=u?.partId===_?u:null,d=L[ae],m=d.writable===!0&&!!S,b=f=>{S&&y.replaceComponent(S.zone,S.index,{...g,props:te(p,n,"role",f)})};return t(Ct,{region:d,sizePx:o?.base.sizePx??null,face:ne(p,n,o,N),base:o?.base??null,onFollowStyle:m?b:void 0,source:H,slug:be(p),onBack:s})}if(!S||!k)return ke?t("div",{className:"sf-note","aria-busy":"true"}):t(Ot,{onBack:s,partId:_,why:S?"no field":"no selector"});const z=o=>{y.replaceComponent(S.zone,S.index,{...g,props:o})},Y=o=>{if(W(o).hidden!==W(U).hidden||!w){const m=P?Ze(p,E,P,o):{...p,[E]:o};m&&z(m);return}rt({node:g,propKey:n,kind:w,zone:S.zone,index:S.index},W(o).text,y.replaceComponent)},we=U,B=st(g?.type,n),Te=ge(p,B),D=u?.partId===_?u:null,x=[{partKey:B,face:ne(p,B,D,N),sizeGroup:D?.sizeGroup??null,base:D?.base??_t,style:Te}],Ee=oe(x,o=>o.sizeGroup),ce=ot(D?.inks),V=(o,d)=>{let m=p;for(const b of x)m=te(m,b.partKey,o,d);z(m)},Re=o=>V("role",o),Ce=()=>{let o=p;for(const d of x)o=nt(o,d.partKey);z(o)},Fe=o=>{let d=p;for(const m of x)for(const[b,f]of Object.entries(o))d=te(d,m.partKey,b,f??null);z(d)},Oe=(o,d)=>{const m=x.some(v=>v.style[o]!==void 0),b=oe(x,v=>Pt(v,o)),f=b===null,F=`sf-part-${e}-${n}-${o}`;return o==="color"?t(Ve,{value:f?null:String(b),label:d,colors:ce,onChange:v=>V("color",v)},o):t(me,{label:d,icon:bt[o],className:"sf-part-field",changed:m,htmlFor:F,action:m?t(fe,{label:d,onClear:()=>V(o,null)}):void 0,children:o==="font"?t(pe,{id:F,ariaLabel:d,value:!f&&$(String(b))?String(b):void 0,placeholder:f?"Mixed":"Site style",options:Ke.map(v=>({label:v.label,value:v.key})),onChange:v=>V("font",v||null)}):null},o)},de=w==="text"||w==="textarea",{text:ue,hidden:R}=W(U),C=k?.[He]?.label??n,Ie=r("div",{className:"sf-field-head",children:[t(he,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:C}),de&&t(De,{content:R?`Show ${C} on the slide`:`Hide ${C} on the slide`,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":R,"aria-label":R?`Show ${C} on the slide`:`Hide ${C} on the slide`,onClick:()=>Y({text:ue,hidden:!R}),children:R?t(ye,{name:"eye-off",size:14}):t(ye,{name:"eye",size:14})})})]}),q=!Ne&&Pe;return r(Et,{sectionName:se?.label??g.type,onBack:s,textEditor:r("div",{ref:A,className:"sf-part-text",children:[w?t(Me,{text:ue,onTextChange:o=>Y(de?{text:o,hidden:R}:o),multiline:Xe(w),markup:w!=="plainText",styled:q,style:x[0].style,base:x[0].base,setValue:Fe,colors:ce.map(o=>({name:o.key,label:o.name,value:o.value})),placeholder:Ye(k),ariaLabel:C,head:Ie}):t($e,{field:k,name:n,value:we,onChange:Y,id:`sf-part-${e}-${n}`}),q&&w&&Ee===null&&t("p",{className:"es-field-hint sf-hint-keep",children:"Fixed size — the site’s Text setting doesn’t resize this."})]}),children:[H&&t(xe,{source:H,slug:be(p)}),q&>.map(o=>{const d=Se.filter(f=>f.group===o),m=d.filter(f=>x.some(F=>F.style[f.key]!==void 0)).length,b=`sf-part-g-${e}-${n}-${o.replace(/\W+/g,"-")}`;return r(Ae,{id:b,title:o,open:a[o]!==!0,onToggle:f=>T(F=>({...F,[o]:!f})),count:m,children:[t(Tt,{parts:x,onEditStyle:l,onClearAll:Ce,onFollowStyle:Re,kindLabel:lt[B]}),d.map(f=>Oe(f.key,f.label))]},o)})]})}const _t={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:tt};export{Se as PART_FIELDS,Et as PartPanelBody,fe as PartResetDot,xe as PartSourceNote,Tt as PartStyleCard,wt as PartStyleSelect,It as default,ne as partFace,un as partStyleName};
|
|
1
|
+
"use client";import{jsx as t,jsxs as f,Fragment as _}from"react/jsx-runtime";import{useEffect as G,useId as ze,useRef as Z,useState as ee}from"react";import{PartResetDot as he}from"./PartResetDot.js";import{FieldSelect as ye,InspectorField as $e}from"efficient-easel/fields";import{SettingsField as ge,SettingsGroup as De}from"efficient-easel/panel";import{InspectorUpLevel as j}from"efficient-easel/chrome";import{StylesIcon as Ve,TextColorIcon as Be,TypeIcon as be}from"efficient-easel/icons";import{useEasel as Me}from"efficient-easel/easel";import{Tooltip as We}from"efficient-shell/ui";import{PartInkControl as Ge}from"./PartInkControl.js";import{PartTextBox as je}from"./PartTextBox.js";import Se from"./UiIcon.js";import{usePreviewHeader as Ue}from"./PreviewHeaderContext.js";import{usePartStyle as He}from"./PreviewPartStyleContext.js";import{say as o}from"../lib/editor-words.js";import{readHidable as U,textFieldOffPage as Ke}from"../lib/puck/controls.js";import{TEXT_FIELD_MARKER as Xe}from"../lib/puck/field-markers.js";import{useSectionOps as Ye}from"../lib/puck/use-section-ops.js";import{FONT_OPTIONS as qe,FONT_ROLES as te,FONT_ROLE_LABELS as ne,fontOption as L}from"../lib/fonts.js";import{isMultilineKind as Je,partPlaceholder as Qe,typeInPlaceKind as Ze}from"../lib/puck/part-text.js";import{partRowField as et}from"../lib/puck/part-row-field.js";import{decodePartKey as tt,partPropsWithRowValue as nt,partRowValue as ot}from"../lib/puck/part-rows.js";import{PART_WIDTH_MAX as st,propsWithPartStyleValue as oe,propsWithoutPartStyle as lt,readPartStyle as xe}from"../lib/puck/part-styles.js";import{partInks as rt}from"../lib/puck/part-inks.js";import{styleKeyForPart as at,TEXT_KIND_LABELS as it}from"../lib/sections/section-text-kinds.js";import{commitPartText as ct}from"../lib/puck/part-typing.js";import{useEditorHost as dt}from"../lib/editor-host.js";import{SOURCE_LINES as ut,SOURCE_ACTIONS as ft,SOURCE_ACTION_LABEL as pt,partSourceOf as mt,sourceSlugOf as ve}from"../lib/puck/source-bound-parts.js";import{encodePartId as ht,holdsAuthoredText as yt}from"../lib/puck/text-parts.js";import{regionsForSection as gt}from"../lib/sections/section-text-regions.js";import{textRegionOfPartKey as bt}from"../lib/sections/text-regions.js";const St={400:"Regular",500:"Medium",600:"Semibold",700:"Bold"},Ne=[{key:"font",label:"Font",group:"Style"},{key:"color",label:"Color",group:"Style"}],xt=[...new Set(Ne.map(e=>e.group))],vt={font:t(be,{}),color:t(Be,{})};function A(e){return e?o(e):null}function F(e){return e.kind==="role"?ne[e.role]:e.kind==="custom"?"Custom":null}const Nt=e=>e.kind==="role"?`role:${e.role}`:e.kind;function kt(e){const n=e.role;return n&&te.includes(n)?{kind:"role",role:n}:null}function wt(e,n){if(!e)return{kind:"unread"};const{faceRole:l,base:r}=e;if(n[l]===r.fontKey)return{kind:"role",role:l};const c=Object.keys(n).filter(a=>n[a]===r.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function se(e,n,l,r){return kt(xe(e,n))??wt(l,r)}function hn(e,n,l,r){return F(se(e,n,l,r))}function le(e,n){if(!e.length)return null;const l=n(e[0]);return e.every(r=>n(r)===l)?l:null}function Pt(e){return Object.values(e).filter(n=>n!==void 0).length}function Tt(e,n){const l=e.style[n];return n==="color"?l??"":l!==void 0?String(l):e.base.fontKey}function Et({face:e,base:n,onPick:l}){const[r,c]=ee(!1),a=Z(null),y=Z(null),g=ze();G(()=>{if(!r)return;const i=E=>{a.current&&!a.current.contains(E.target)&&c(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);const d=e.kind==="role"?e.role:null,k=i=>{l(i),c(!1),y.current?.focus()};return f("div",{className:"sf-part-style-pick",ref:a,children:[f("button",{ref:y,type:"button",className:"sf-part-style-trigger","aria-expanded":r,"aria-controls":g,"aria-label":F(e)?o("Follows {name} — change",{name:A(F(e))}):o("Follows no style — change"),onClick:()=>c(i=>!i),onKeyDown:i=>{i.key==="Escape"&&r&&(i.preventDefault(),c(!1))},children:[t("span",{className:"sf-part-style-name",style:{fontFamily:n?.fontKey?`var(${L(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:A(F(e))}),t("span",{className:"sf-part-style-sign","aria-hidden":"true"})]}),r&&f("div",{className:"sf-multi-menu sf-part-style-menu",id:g,role:"listbox",onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),c(!1),y.current?.focus())},children:[f("button",{type:"button",role:"option","aria-selected":d===null,className:`sf-part-style-option${d===null?" is-on":""}`,onClick:()=>k(null),children:[t("span",{className:"sf-part-style-option-name",children:o("No style")}),t("span",{className:"sf-note",children:o("Section’s own")})]}),te.map(i=>t("button",{type:"button",role:"option","aria-selected":d===i,className:`sf-part-style-option${d===i?" is-on":""}`,onClick:()=>k(i),children:t("span",{className:"sf-part-style-option-name",style:{fontFamily:`var(--font-role-${i})`},children:o(ne[i])})},i))]})]})}const H="";function Rt({face:e,base:n,onPick:l}){const r=e.kind==="role"?e.role:H,c=[{label:o("No style"),value:H},...te.map(a=>({label:o(ne[a]),value:a}))];return t(ye,{ariaLabel:o("Style"),value:r,options:c,inline:!0,onChange:a=>l(a===H?null:a),renderOption:a=>a.value===H?f(_,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:a.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:o("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${a.value})`},children:a.label}),renderValue:()=>t("span",{style:{fontFamily:n?.fontKey?`var(${L(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:A(F(e))}),valueText:a=>A(F(e))??a?.label??""})}function Ft({parts:e,onEditStyle:n,onClearAll:l,onFollowStyle:r,kindLabel:c}){const y=le(e,E=>Nt(E.face))?e[0].face:null,g=y?F(y):null,d=y&&y.kind!=="unread"?e[0].base:null,k=e.reduce((E,z)=>E+Pt(z.style),0),i=d?L(d.fontKey)?.label:void 0;return f("div",{className:`sf-part-style${k?" has-overrides":""}`,children:[t("div",{className:"sf-part-style-caption",children:o("Style")}),e.length>1&&t("div",{className:"sf-part-style-count",children:o("{n} selected",{n:e.length})}),e.length===1&&c&&t("div",{className:"sf-part-style-count",children:o("{kind} · every row",{kind:o(c)})}),g&&d?f(_,{children:[r&&y?t(Et,{face:y,base:d,onPick:r}):t("div",{className:"sf-part-style-name",style:{fontFamily:i?`var(${L(d.fontKey)?.cssVar})`:void 0,fontWeight:d.weight},children:o(g)}),t("div",{className:"sf-part-style-meta",children:[i,`${Math.round(d.sizePx)} px`,o(St[d.weight])].filter(Boolean).join(" · ")})]}):t("div",{className:"sf-part-style-name",children:o("Mixed styles")}),f("div",{className:"sf-part-style-top",children:[g?k?f(_,{children:[t("span",{className:"sf-part-chip",children:o("{n} changed",{n:k})}),t("button",{type:"button",className:"sf-part-link",onClick:l,children:o("Clear")})]}):t("span",{className:"sf-part-style-state",children:o("This text follows the site style.")}):t("span",{className:"sf-part-style-state",children:o("Changes apply to all selected.")}),t("span",{className:"sf-part-style-gap"}),g&&n&&t("button",{type:"button",className:"sf-part-link",onClick:n,children:o("Edit")})]})]})}function Ct({sectionName:e,onBack:n,textEditor:l,styleRow:r,children:c}){return f("div",{className:"sf-part-panel",children:[t(j,{inline:!0,name:o(e),onSelect:n}),l,r,c]})}function ke({source:e,slug:n}){const l=dt(),r=ft[e],c=!r.needsSlug||!!n;return t("div",{className:"sf-note sf-note--source",children:f("p",{className:"es-field-hint sf-hint-keep",children:[o(ut[e]),c?f(_,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{r.type==="storefront-editor:open-menus"?l.send(r.type):n&&l.send(r.type,{slug:n})},children:o(pt)})]}):null]})})}const we=4,Ot=120;function It({region:e,sizePx:n,face:l,base:r,onFollowStyle:c,source:a,slug:y,onBack:g}){const d=e.follows;return f("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:o(e.label)})}),t("p",{children:n?o("Its size follows Site styles ▸ {follows} — {px}px right now.",{follows:o(d),px:Math.round(n)}):o("Its size follows Site styles ▸ {follows}.",{follows:o(d)})}),c?t(_,{children:t(ge,{label:o("Style"),icon:t(Ve,{}),hint:o("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:o(e.label).toLowerCase()}),children:t(Rt,{face:l,base:r,onPick:c})})}):t("p",{className:"es-field-hint sf-hint-keep",children:o("Only the size follows a site style. This section sets its own font, weight and letter case.")}),a?t(ke,{source:a,slug:y}):null,t(j,{inline:!0,name:o("Page"),onSelect:g})]})}function _t({onBack:e}){return f("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:o("This part is no longer here.")})}),t("p",{children:o("The section it belonged to has been changed or removed.")}),t(j,{inline:!0,name:o("Page"),onSelect:e})]})}function Lt({onBack:e,partId:n,why:l}){return f("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:o("This part's settings did not open.")})}),t("p",{children:o("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:f("code",{children:[n," — ",l]})}),t(j,{inline:!0,name:o("Page"),onSelect:e})]})}function At({nodeId:e,propKey:n,onBack:l,onEditStyle:r}){const{getItemById:c,getSelectorForId:a,config:y}=Me(s=>s),g=Ye(),{partStyle:d}=He(),{fonts:k}=Ue(),[i,E]=ee({}),z=Z(null),b=c(e),x=a(e),re=b?y.components[b.type]:void 0,{key:R,row:w}=tt(n),ae=re?.fields?.[R],P=w?et(ae,w):ae,O=ht(e,n),m=b?.props??{},T=Ze(P),Pe=Ke(P),Te=yt(P),K=b?mt(b.type):null,X=w?ot(m[R],w):m[R],ie=!!w&&!(Array.isArray(m[R])&&w.index<m[R].length);G(()=>{z.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[O]);const[Y,ce]=ee(0);G(()=>ce(0),[O]);const q=!!b&&!ie&&(!x||!P);G(()=>{if(!q||Y>=we)return;const s=setTimeout(()=>ce(u=>u+1),Ot);return()=>clearTimeout(s)},[q,Y]);const Ee=q&&Y<we;if(!b||ie)return t(_t,{onBack:l});const $=gt(b.type),de=$?bt($,n):null;if($&&de){const s=d?.partId===O?d:null,u=$[de],h=u.writable===!0&&!!x,S=p=>{x&&g.replaceComponent(x.zone,x.index,{...b,props:oe(m,n,"role",p)})};return t(It,{region:u,sizePx:s?.base.sizePx??null,face:se(m,n,s,k),base:s?.base??null,onFollowStyle:h?S:void 0,source:K,slug:ve(m),onBack:l})}if(!x||!P)return Ee?t("div",{className:"sf-note","aria-busy":"true"}):t(Lt,{onBack:l,partId:O,why:x?"no field":"no selector"});const D=s=>{g.replaceComponent(x.zone,x.index,{...b,props:s})},J=s=>{if(U(s).hidden!==U(X).hidden||!T){const h=w?nt(m,R,w,s):{...m,[R]:s};h&&D(h);return}ct({node:b,propKey:n,kind:T,zone:x.zone,index:x.index},U(s).text,g.replaceComponent)},Re=X,V=at(b?.type,n),Fe=xe(m,V),B=d?.partId===O?d:null,v=[{partKey:V,face:se(m,V,B,k),sizeGroup:B?.sizeGroup??null,base:B?.base??zt,style:Fe}],Ce=le(v,s=>s.sizeGroup),ue=rt(B?.inks),M=(s,u)=>{let h=m;for(const S of v)h=oe(h,S.partKey,s,u);D(h)},Oe=s=>M("role",s),Ie=()=>{let s=m;for(const u of v)s=lt(s,u.partKey);D(s)},_e=s=>{let u=m;for(const h of v)for(const[S,p]of Object.entries(s))u=oe(u,h.partKey,S,p??null);D(u)},Le=(s,u)=>{const h=v.some(N=>N.style[s]!==void 0),S=le(v,N=>Tt(N,s)),p=S===null,C=`sf-part-${e}-${n}-${s}`;return s==="color"?t(Ge,{value:p?null:String(S),label:u,colors:ue,onChange:N=>M("color",N)},s):t(ge,{label:o(u),icon:vt[s],className:"sf-part-field",changed:h,htmlFor:C,action:h?t(he,{label:u,onClear:()=>M(s,null)}):void 0,children:s==="font"?t(ye,{id:C,ariaLabel:o(u),value:!p&&L(String(S))?String(S):void 0,placeholder:p?o("Mixed"):o("Site style"),options:qe.map(N=>({label:N.label,value:N.key})),onChange:N=>M("font",N||null)}):null},s)},fe=T==="text"||T==="textarea",{text:pe,hidden:I}=U(X),W=P?.[Xe]?.label??n,me=I?o("Show {label} on the slide",{label:o(W)}):o("Hide {label} on the slide",{label:o(W)}),Ae=f("div",{className:"sf-field-head",children:[t(be,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:o(W)}),fe&&t(We,{content:me,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":I,"aria-label":me,onClick:()=>J({text:pe,hidden:!I}),children:I?t(Se,{name:"eye-off",size:14}):t(Se,{name:"eye",size:14})})})]}),Q=!Pe&&Te;return f(Ct,{sectionName:re?.label??b.type,onBack:l,textEditor:f("div",{ref:z,className:"sf-part-text",children:[T?t(je,{text:pe,onTextChange:s=>J(fe?{text:s,hidden:I}:s),multiline:Je(T),markup:T!=="plainText",styled:Q,style:v[0].style,base:v[0].base,setValue:_e,colors:ue.map(s=>({name:s.key,label:o(s.name),value:s.value})),placeholder:A(Qe(P))??void 0,ariaLabel:o(W),head:Ae}):t($e,{field:P,name:n,value:Re,onChange:J,id:`sf-part-${e}-${n}`}),Q&&T&&Ce===null&&t("p",{className:"es-field-hint sf-hint-keep",children:o("Fixed size — the site’s Text setting doesn’t resize this.")})]}),children:[K&&t(ke,{source:K,slug:ve(m)}),Q&&xt.map(s=>{const u=Ne.filter(p=>p.group===s),h=u.filter(p=>v.some(C=>C.style[p.key]!==void 0)).length,S=`sf-part-g-${e}-${n}-${s.replace(/\W+/g,"-")}`;return f(De,{id:S,title:o(s),open:i[s]!==!0,onToggle:p=>E(C=>({...C,[s]:!p})),count:h,children:[t(Ft,{parts:v,onEditStyle:r,onClearAll:Ie,onFollowStyle:Oe,kindLabel:it[V]}),u.map(p=>Le(p.key,p.label))]},s)})]})}const zt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:st};export{Ne as PART_FIELDS,Ct as PartPanelBody,he as PartResetDot,ke as PartSourceNote,Ft as PartStyleCard,Rt as PartStyleSelect,At as default,se as partFace,hn as partStyleName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,jsxs as
|
|
1
|
+
"use client";import{jsx as o,jsxs as S}from"react/jsx-runtime";import{COPY_CELLS as a,CopyBox as T}from"efficient-easel/copy";import{PaddingYIcon as A,WidthIcon as C}from"efficient-easel/icons";import{say as u}from"../lib/editor-words.js";import{SHOP_MARKUP as I}from"../lib/markup.js";import{PART_PADDING_MAX as R,PART_PADDING_MIN as D,PART_PADDING_STEP as O,PART_WIDTH_MAX as v,PART_WIDTH_MIN as H,PART_WIDTH_STEP as L,partSpacingOf as z}from"../lib/puck/part-styles.js";const N=["left","center","right","justify"],M=["bold","italic","underline","strike","link","sup","sub"],W=["bullet","number"];function y({text:c,onTextChange:d,multiline:r,markup:g=!0,styled:t=!0,style:e,base:l,setValue:i,colors:s,placeholder:h,ariaLabel:P,head:m}){const p=z(e),_=e.size??l.sizePx,f=[{...a.fontSize,value:e.size,styleValue:Math.round(l.sizePx),onChange:n=>i({size:n??null})},{...a.lineHeight,value:p.lineHeight,styleValue:l.lineRatio,onChange:n=>i(n===void 0?{lineHeight:null,line:null}:{lineHeight:n})},{...a.letterSpacing,scale:_,value:p.letterSpacingEm,styleValue:l.letterEm,onChange:n=>i(n===void 0?{letterSpacing:null,letter:null}:{letterSpacing:n})},{...a.paragraphSpacing,value:e.paragraphSpacing,styleValue:0,onChange:n=>i({paragraphSpacing:n??null})},{key:"padding",name:u("Padding"),icon:o(A,{}),unit:"px",step:O,shiftStep:10,min:D,max:R,value:e.padding,styleValue:l.paddingPx,onChange:n=>i({padding:n??null})},{key:"width",name:u("Width"),icon:o(C,{}),unit:"px",step:L,shiftStep:100,min:H,max:v,value:e.width,styleValue:l.widthPx,onChange:n=>i({width:n??null})}],x=g?[...M,...r?W:[]]:[];return S("div",{className:"sf-part-textbox",children:[m,o(T,{value:c,onChange:d,multiline:r,placeholder:h,ariaLabel:P,rules:I,tools:x,colors:g?s:[],align:t?{value:e.align??l.align,allow:N,onChange:n=>i({align:n})}:void 0,letterCase:t?{value:e.case??"",onChange:n=>i({case:n||null})}:void 0,cells:t?f:void 0})]})}export{y as PartTextBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{SettingsDefaultReset as d,SettingsField as f,SettingsSegmented as p}from"efficient-easel/panel";import{DropIcon as g}from"efficient-easel/icons";import{say as e,editorEaselWords as u}from"../lib/editor-words.js";const o="Photography",c={shot:"As shot",mono:"Black and white"},l=[{grayscale:!1,label:c.shot},{grayscale:!0,label:c.mono}],m="Black and white photographs return to color on hover. Wheels and tyres keep their real finish either way.";function y({value:n,onChange:r,showHint:h=!0}){const s=n===null,i=n??!1;return a(f,{label:e(o),icon:a(g,{}),value:e(l.find(t=>t.grayscale===i).label),changed:!s,action:a(d,{words:u()?.panel,label:e(o),changed:!s,detail:e(l.find(t=>!t.grayscale).label),onReset:()=>r(null)}),hint:h?e(m):void 0,children:a(p,{options:l.map(t=>({id:t.grayscale,label:e(t.label)})),value:i,ariaLabel:e(o),onChange:r})})}export{o as SITE_PHOTOGRAPHY_LABEL,y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as G,jsxs as r}from"react/jsx-runtime";import{sectionRunsFullWidth as I}from"../lib/content/section-width.js";import{cardImageShapeTokens as R}from"../lib/content/card-image-shape.js";import{SiteLink as A}from"../lib/site-runtime.js";import E from"./EditorialSectionHead.js";import D from"./Placeholder.js";import{withRMark as
|
|
1
|
+
import{jsx as t,Fragment as G,jsxs as r}from"react/jsx-runtime";import{sectionRunsFullWidth as I}from"../lib/content/section-width.js";import{cardImageShapeTokens as R}from"../lib/content/card-image-shape.js";import{SiteLink as A}from"../lib/site-runtime.js";import E from"./EditorialSectionHead.js";import D from"./Placeholder.js";import{withRMark as i}from"./RMark.js";import{renderGold as n}from"./goldPhrases.js";import{say as H}from"../lib/editor-words.js";const y={2:"grid-cols-2 max-[900px]:grid-cols-1",3:"grid-cols-3 max-[1100px]:grid-cols-1",4:"grid-cols-4 max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1"},d="sf-itc-boxes",N="sf-itc-steps";function O({num:z,title:x,description:g,boxes:m,steps:k,columns:S=3,cta:p,padTop:f,padBottom:h,editing:w=!1,omitHead:$=!1,cardImage:L,cardText:_,...j}){const C=typeof f=="number"?f:120,F=typeof h=="number"?h:120,b=(k??[]).filter(e=>(e?.tag??"").trim()||(e?.meta??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.image??"").trim()||(e?.specs??[]).some(o=>(o?.label??"").trim()||(o?.value??"").trim())),u=b.length>0?b:w&&!m?[1,2,3].map(e=>({tag:H("Column {n}",{n:e})})):[],v=y[S]??y[3],l=_==="on-image";return r("section",{className:I(j)?"relative z-[2] border-b border-line bg-bg px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]":"relative z-[2] mx-auto max-w-[var(--sf-site-width,1600px)] border-b border-line bg-bg px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",style:{paddingTop:C,paddingBottom:F,...R(L)},children:[$?null:t(E,{num:z,title:x?.trim()?n(x,!0):void 0,desc:g?.trim()?n(g,!1):void 0}),m?r(G,{children:[t("style",{children:`.${d}:empty{display:none}.${d}:not(:empty)~.${N}{display:none}`}),t(m,{className:`${d} sf-card grid ${v} gap-[2px] border border-line bg-line [&>*]:min-h-[560px] [&>*]:bg-bg`,minEmptyHeight:260})]}):null,u.length>0&&t("div",{className:`${N} sf-card grid ${v} gap-[2px] border border-line bg-line`,children:u.map((e,o)=>{const s=(e.specs??[]).filter(a=>(a?.label??"").trim()||(a?.value??"").trim());return r("article",{className:l?"flex flex-col bg-bg":"flex min-h-[560px] flex-col bg-bg",children:[r("div",{className:l?"sf-card-image relative aspect-[5/3] overflow-hidden bg-surface max-[700px]:aspect-[4/3]":"sf-card-image relative aspect-[5/3] overflow-hidden border-b border-line bg-surface",children:[t(D,{label:e.tag?.trim()||e.title?.trim()||`column-${o+1}`,src:e.image||void 0,sizes:"(max-width: 1100px) 100vw, 33vw",...m?{deferFetch:!0}:{}}),t("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg, rgba(10,10,10,0.55) 0%, transparent 30%, transparent 70%, rgba(10,10,10,0.65) 100%)"}}),l&&t("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 z-[1] h-[78%]",style:{background:"linear-gradient(180deg, transparent 0%, rgba(10,10,10,0.73) 55%, rgba(10,10,10,0.92) 100%)"}}),e.tag?.trim()&&t("span",{className:"absolute left-5 top-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:i(e.tag)}),e.meta?.trim()&&t("span",{className:l?"absolute right-5 top-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-overlay-fg/80":"absolute right-5 bottom-[18px] z-[2] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-overlay-fg/80",children:i(e.meta)}),l&&(e.title?.trim()||e.copy?.trim())&&r("div",{className:"absolute inset-x-0 bottom-0 z-[2] flex flex-col gap-2.5 px-8 pb-7 pt-14 max-[700px]:px-6 max-[700px]:pb-6",children:[e.title?.trim()&&t("h3",{className:"flex min-h-[2em] flex-col justify-end font-heading3 text-[length:var(--size-headingSmall,28px)] font-medium uppercase leading-none tracking-[-0.02em] text-overlay-fg max-[700px]:text-[length:var(--size-headingSmall,26px)]",children:n(e.title,!0)}),e.copy?.trim()&&t("p",{className:"min-h-[3em] font-display text-[length:var(--size-body,15px)] leading-[1.5] text-overlay-fg/85",children:n(e.copy,!1)})]})]}),l?s.length>0&&t("div",{className:"grid grid-cols-2 gap-2 border-t border-line px-8 py-7 max-[700px]:px-6 max-[700px]:py-6",children:s.map((a,c)=>r("div",{className:"flex flex-col gap-1",children:[a.label?.trim()&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-fg-dim",children:i(a.label)}),a.value?.trim()&&t("span",{className:"font-display text-[length:var(--size-body,18px)] font-medium tracking-[-0.01em] text-fg",children:i(a.value)})]},c))}):r("div",{className:"flex flex-1 flex-col gap-4 px-8 py-9 max-[700px]:px-6 max-[700px]:py-7",children:[e.title?.trim()&&t("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,34px)] font-medium uppercase leading-none tracking-[-0.02em] max-[700px]:text-[length:var(--size-headingSmall,28px)]",children:n(e.title,!0)}),e.copy?.trim()&&t("p",{className:"font-display text-[length:var(--size-body,15px)] leading-[1.55] text-fg-dim",children:n(e.copy,!1)}),s.length>0&&t("div",{className:"mt-auto grid grid-cols-2 gap-2 border-t border-line pt-4",children:s.map((a,c)=>r("div",{className:"flex flex-col gap-1",children:[a.label?.trim()&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-fg-dim",children:i(a.label)}),a.value?.trim()&&t("span",{className:"font-display text-[length:var(--size-body,18px)] font-medium tracking-[-0.01em] text-fg",children:i(a.value)})]},c))})]})]},o)})}),p?.text&&t("div",{className:"mt-12 flex justify-end border-t border-line pt-8",children:r(A,{href:p.href,className:"group inline-flex items-center gap-3.5 border border-line px-6 py-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[i(p.text),t("span",{"aria-hidden":!0,className:"text-accent transition-transform group-hover:translate-x-[3px]",children:"→"})]})})]})}export{O as default};
|
|
@@ -18,5 +18,5 @@ interface Props {
|
|
|
18
18
|
bare?: boolean;
|
|
19
19
|
icon?: ReactNode;
|
|
20
20
|
}
|
|
21
|
-
export default function SearchSelectField({ label, options, fallback, value, onChange, placeholder, bare, icon, }: Props): import("react").JSX.Element;
|
|
21
|
+
export default function SearchSelectField({ label, options, fallback, value, onChange, placeholder: placeholderKey, bare, icon, }: Props): import("react").JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import{useId as I}from"react";import{FieldSelect as $}from"efficient-easel/fields";import{SettingsField as F}from"efficient-easel/panel";import{say as h}from"../lib/editor-words.js";function g(r){return r.map(({value:n,label:l,group:t,thumb:o,meta:e})=>({value:n,label:l,...t!==void 0?{group:t}:{},...o!==void 0?{thumb:o}:{},...e!==void 0?{meta:e}:{}}))}function j({label:r,options:n,fallback:l,value:t,onChange:o,placeholder:e,bare:i=!1,icon:b}){const a=I(),c=`${a}-label`,d=`${a}-button`,s=t??"",S=n.some(x=>x.value===s)?s:l,u=h(r),f=e===void 0?void 0:h(e),m=p($,{id:d,value:S,options:g(n),onChange:o,placeholder:f,searchPlaceholder:f,...i?{ariaLabel:u}:{ariaLabelledBy:`${c} ${d}`},searchable:!0,groupCount:!0,inline:!0});return i?m:p(F,{label:u,labelId:c,icon:b,children:m})}export{j as default,g as searchSelectOptions};
|