efficient-storefront-blocks 0.87.0 → 0.89.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 +34 -0
- package/dist/chunks/{EditorPreviewCheckout-GD4IJ4WK.js → EditorPreviewCheckout-R7XG75DW.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-2UVCJZXS.js → SiteEditorProvider-YNUCDQ2D.js} +1 -1
- package/dist/chunks/chunk-BYBBZS7L.js +1 -0
- package/dist/chunks/{chunk-H4IHUSCU.js → chunk-E54FFOUS.js} +1 -1
- package/dist/chunks/chunk-G4Y7XXRV.js +1 -0
- package/dist/chunks/chunk-WRDUOJZO.js +382 -0
- package/dist/chunks/{fitment-data-5GBUMO2O.js → fitment-data-URBK335I.js} +1 -1
- package/dist/contract.js +14 -2
- package/dist/editor/components/CategorySource.d.ts +8 -1
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FinishPicker.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/ProductHeroSource.js +1 -1
- package/dist/editor/components/ProductPicker.js +1 -1
- package/dist/editor/components/ReviewsProductSource.js +1 -1
- package/dist/editor/components/SocialLinksDoor.js +1 -1
- package/dist/editor/components/SpecTableSource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/BundleOffer/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/FilterBlock/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/FilterBlock/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/FilterChipsBlock/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/FilterChipsBlock/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductBuyButton/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductBuyButton/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductName/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/controls.d.ts +4 -0
- package/dist/editor/lib/document/blocks/commerce/controls.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/editor-words-kept.d.ts +1 -0
- package/dist/editor/lib/editor-words-kept.js +1 -0
- package/dist/editor/lib/efficient-backend.d.ts +6 -1
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/editor/lib/storefront-document.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +33 -4
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +134 -81
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +111 -0
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BundleCard.d.ts +2 -1
- package/dist/render/components/BundleCard.js +1 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +11 -1
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GridCardTemplate.d.ts +7 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +5 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ProductRef.d.ts +8 -2
- package/dist/render/components/ProductRef.js +1 -1
- package/dist/render/components/SectionBand.d.ts +3 -2
- package/dist/render/components/SectionBand.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.d.ts +8 -1
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardName.d.ts +2 -1
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/CardProductBadge.d.ts +2 -1
- package/dist/render/components/card-pieces/CardProductBadge.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.d.ts +5 -0
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/card-pieces/CardSpecs.js +1 -1
- package/dist/render/components/card-pieces/HostPart.js +1 -1
- package/dist/render/components/card-pieces/ProductCardState.d.ts +25 -6
- package/dist/render/components/card-pieces/ProductCardState.js +1 -1
- package/dist/render/components/catalog/CatalogFilterContext.d.ts +4 -1
- package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
- package/dist/render/components/catalog/ClearAllButton.d.ts +4 -0
- package/dist/render/components/catalog/ClearAllButton.js +1 -0
- package/dist/render/components/catalog/FilterPill.d.ts +4 -2
- package/dist/render/components/catalog/FilterPill.js +1 -1
- package/dist/render/components/catalog/ShopperChips.d.ts +13 -0
- package/dist/render/components/catalog/ShopperChips.js +1 -0
- package/dist/render/components/catalog/ShopperFilters.d.ts +20 -0
- package/dist/render/components/catalog/ShopperFilters.js +1 -0
- package/dist/render/components/catalog/ShopperScope.d.ts +72 -0
- package/dist/render/components/catalog/ShopperScope.js +3 -0
- package/dist/render/components/catalog/SortSelect.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/components/wheels-plp/PlpActiveChips.js +1 -1
- package/dist/render/components/wheels-plp/PlpPagination.d.ts +2 -1
- package/dist/render/components/wheels-plp/PlpPagination.js +1 -1
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.d.ts +2 -0
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.js +1 -1
- package/dist/render/lib/api/index.d.ts +6 -0
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/catalog/related-cards.d.ts +4 -1
- package/dist/render/lib/catalog/relationships.d.ts +9 -2
- package/dist/render/lib/catalog/relationships.js +1 -1
- package/dist/render/lib/commerce.d.ts +2 -0
- package/dist/render/lib/commerce.js +1 -1
- package/dist/render/lib/content/article-body.js +1 -5
- package/dist/render/lib/content/filter-card-seed.d.ts +10 -0
- package/dist/render/lib/content/filter-card-seed.js +1 -0
- package/dist/render/lib/content/product-card-seed.d.ts +5 -0
- package/dist/render/lib/content/product-card-seed.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +8 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/meta.d.ts +8 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/GalleryB/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductName/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/metas.d.ts +3 -0
- package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
- package/dist/render/lib/document/blocks/commerce/renders.d.ts +3 -0
- package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
- package/dist/render/lib/document/card-templates.d.ts +1 -0
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/document-nodes.d.ts +24 -0
- package/dist/render/lib/document/document-nodes.js +1 -0
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/links/link-rules.js +1 -1
- package/dist/render/lib/sections/bundle-to-grid.d.ts +8 -0
- package/dist/render/lib/sections/bundle-to-grid.js +1 -0
- package/dist/render/lib/sections/catalog-text-size.d.ts +2 -0
- package/dist/render/lib/sections/catalog-text-size.js +1 -1
- package/dist/render/lib/sections/filter-option-rows.d.ts +37 -0
- package/dist/render/lib/sections/filter-option-rows.js +1 -0
- package/dist/render/lib/sections/gallery-toolbar.d.ts +27 -0
- package/dist/render/lib/sections/gallery-toolbar.js +1 -0
- package/dist/render/lib/sections/grid-no-hole.d.ts +3 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -1
- package/dist/render/lib/sections/product-grid-pages.d.ts +42 -0
- package/dist/render/lib/sections/product-grid-pages.js +1 -0
- package/dist/render/lib/sections/shopper-filters.d.ts +45 -0
- package/dist/render/lib/sections/shopper-filters.js +1 -0
- package/dist/render/lib/wheels/plp-filters.d.ts +6 -3
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.d.ts +5 -3
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/render/lib/wheels/selected-ranges.d.ts +16 -0
- package/dist/render/lib/wheels/selected-ranges.js +1 -0
- package/dist/render/lib/wheels/set-mode.d.ts +10 -0
- package/dist/render/lib/wheels/set-mode.js +1 -1
- package/dist/render/lib/wheels/shopper-first-paint.d.ts +28 -0
- package/dist/render/lib/wheels/shopper-first-paint.js +1 -0
- package/dist/render/lib/wheels/shopper-scope.d.ts +11 -0
- package/dist/render/lib/wheels/shopper-scope.js +1 -0
- package/dist/words.d.ts +46 -6
- package/dist/words.js +6 -6
- package/package.json +4 -4
- package/dist/chunks/chunk-QLR6IVWJ.js +0 -369
- package/dist/chunks/chunk-SYK5QPNV.js +0 -1
- package/dist/chunks/chunk-XZ46W3NV.js +0 -1
- package/dist/render/components/pdp-dynamic/DynamicBundleOffer.d.ts +0 -13
- package/dist/render/components/pdp-dynamic/DynamicBundleOffer.js +0 -1
- /package/dist/chunks/{chunk-QLR6IVWJ.js.LEGAL.txt → chunk-WRDUOJZO.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-DLWIDJS5.js → chunk-ZA3ULZOA.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as u,Fragment as B}from"react/jsx-runtime";import{useCallback as C,useEffect as W,useRef as Y,useState as P}from"react";import{ApiError as Pe,storefrontAdmin as N}from"../../render/lib/api/index.js";import{requestMediaPick as Ne}from"efficient-easel/screen/lib/media-picker";import{refreshSiteLiveState as Ie}from"efficient-web-builder/editor/lib/site-live-state";import{useEaselHost as ge}from"efficient-easel/screen/lib/host";import{onHeaderMenusChanged as Oe}from"efficient-web-builder/format/lib/editor-events";import{loadAllSitesMenus as Me,refreshAllSitesMenus as Re}from"../../render/lib/menu-source.js";import{headerMenuMissingWarning as De}from"../../render/lib/content/menu-placeholder.js";import{say as n,sayCount as Be}from"efficient-web-builder/format/lib/editor-words";import{sayWith as te}from"../lib/say-with.js";import{NEUTRAL_SITE_NAME as ze}from"../../render/lib/content/site.js";import{SECTION_WIDTH_CHOICES as Ge,WIDTH_CHOICE_LABEL as We}from"efficient-web-builder/format/lib/content/section-width";import{usePreviewHeader as Fe}from"efficient-web-builder/render/components/PreviewHeaderContext";import{HEADER_LOGO_PX as be,HEADER_LOGO_PX_MIN as Ue,HEADER_LOGO_PX_MAX as Xe}from"efficient-web-builder/render/components/Logo";import{HEADER_HEIGHT_PX as Z,HEADER_MENU_GAP_PX as $}from"efficient-web-builder/render/lib/document/header-clearance";import Ve from"efficient-web-builder/editor/components/SectionThemePicker";import{HEADER_THEME_FOLLOW as fe}from"../../render/lib/content/header-theme.js";import{resolveHeaderInkMode as je}from"efficient-web-builder/render/lib/document/header-ink";import{absolutizeApiUrl as $e}from"efficient-web-builder/render/lib/media";import{loadHeaderSettings as Ke,primeHeaderSettings as qe,clearHeaderSettingsCache as Ye,toPreviewHeaderSettings as Ze}from"../lib/header-settings-source.js";import{Banner as Je,Button as le,Drawer as Qe,InputNumber as eo,LoadingSpinner as oo,MediaUploadField as no,ShowWhen as K,Slider as to,Tabs as lo,tabButtonId as ao,tabPanelId as io}from"efficient-shell/ui";import{CountryShowAsTiles as ro}from"./CountryShowAsTiles.js";import{truthy as so,visibleFields as co}from"efficient-web-builder/render/lib/document/show-when";const uo={field:"country_selector_enabled",is:!0},ae={not:{context:"placeholderMode",is:!0}},ho={field:"menu_position",is:"beside"},mo={all:[{field:"logo_position",is:"center"},{not:{field:"menu_position",is:"center"}}]},po={all:[ae,so("country_selector_enabled")]};import{SettingsDefaultReset as ie,SettingsField as s,SettingsSwitch as F}from"efficient-easel/panel";import{FieldSelect as re}from"efficient-easel/fields";import{useEaselStrings as go}from"efficient-easel/strings";import{AccountIcon as bo,AlignLeftIcon as fo,AlignSeparateIcon as _o,BorderAllIcon as vo,CartIcon as wo,CaseIcon as xo,FullWidthIcon as So,GapIcon as yo,GlobeIcon as Co,GridIcon as Lo,HeightIcon as _e,LayoutIcon as Eo,ListIcon as Ho,LogoIcon as To,MenuIcon as ko,PhoneIcon as Ao,PlacementIcon as ve,SearchIcon as Po,SettingsIcon as No,StickyIcon as Io,StylesIcon as we,SwapIcon as Oo,TextColorIcon as Mo}from"efficient-easel/icons";import{PanelBand as Ro}from"efficient-web-builder/editor/lib/document/controls";import{Segmented as I}from"efficient-web-builder/editor/lib/document/box-fields";import{HintsToggle as se,SHOW_HINTS_DEFAULT as Do}from"efficient-web-builder/editor/components/WebsiteSettingsPanel";const ce="sf-header",xe="sf-header-size-label",Se="sf-header-gap-label",ye="sf-header-height-label",Ce=[{id:"logo",label:"Logo",icon:e(To,{})},{id:"menu",label:"Menu",icon:e(Ho,{}),showWhen:ae},{id:"tools",label:"Tools",icon:e(No,{})},{id:"look",label:"Look",icon:e(we,{})}];function Bo({tokenRef:l,siteId:a,onClose:L,onAuthExpired:v,inline:O,placeholderMode:y,websiteName:_,onOpenWebsiteSettings:x}){const k=ge(),p=go(),[t,b]=P(null),[E,S]=P(null),[M,q]=P(!1),[h,H]=P(Ce[0].id),[c,A]=P(Do),U=t,J={placeholderMode:y},Q=Object.values(co(Object.fromEntries(Ce.map(o=>[o.id,o])),U,J)),R=Q.find(o=>o.id===h)??Q[0],[Le,Ee]=P(0),{setSettings:ue}=Fe(),X=Y(null),V=Y(null),j=Y(null);W(()=>{let o=!1,i=null,m=null;const d=3,T=(G,D=0)=>{o||S(null),Ke(G,a,D>0).then(Ae=>!o&&b(Ae)).catch(()=>{o||(D+1<d?m=setTimeout(()=>T(G,D+1),600*(D+1)):S(n("Could not load header settings.")))})},pe=l.current;if(pe)T(pe);else{let G=0;i=setInterval(()=>{const D=l.current;if(D){i&&clearInterval(i),i=null,o||S(null),T(D);return}G+=250,G===5e3&&!o&&S(n("Waiting for editor authorization…")),G>=3e4&&(i&&clearInterval(i),i=null,o||S(n("Not authorized yet — reopen once the editor has loaded.")))},250)}return()=>{o=!0,i&&clearInterval(i),m&&clearTimeout(m)}},[l,Le,a]),W(()=>{t&&ue(Ze(t))},[t,ue]),W(()=>()=>{X.current&&clearTimeout(X.current),V.current&&clearTimeout(V.current),j.current&&clearTimeout(j.current)},[]);const f=C(async(o,i)=>{const m=l.current;if(!m||!t)return;const d=t;i&&b({...t,...i}),q(!0),S(null);try{const T=await o(m);b(T),qe(T,a),Ie()}catch(T){b(d),T instanceof Pe&&T.status===401?(Ye(a),v?.(),S(n("Authorization expired — try again in a moment."))):S(n("Could not save. Please retry."))}finally{q(!1)}},[t,l,v,a]),g=C(o=>f(i=>N.updateHeaderSettings(o,i,a??void 0),o),[f,a]),he=C(o=>{f(i=>N.setHeaderLogoFromAsset(o,i,a??void 0))},[f,a]),He=C(()=>{Ne(k,{accept:"image/svg+xml",title:n("Logo (SVG)")}).then(o=>{o&&he(o.id)})},[he]),ee=C((o,i=!0)=>{b(d=>d&&{...d,logo_size_px:o}),X.current&&clearTimeout(X.current);const m=()=>{f(d=>N.updateHeaderSettings({logo_size_px:o},d,a??void 0))};i?m():X.current=setTimeout(m,400)},[f,a]),oe=C((o,i=!0)=>{b(d=>d&&{...d,height_px:o}),V.current&&clearTimeout(V.current);const m=()=>{f(d=>N.updateHeaderSettings({height_px:o},d,a??void 0))};i?m():V.current=setTimeout(m,400)},[f,a]),ne=C((o,i=!0)=>{b(d=>d&&{...d,menu_gap_px:o}),j.current&&clearTimeout(j.current);const m=()=>{f(d=>N.updateHeaderSettings({menu_gap_px:o},d,a??void 0))};i?m():j.current=setTimeout(m,400)},[f,a]),Te=C(()=>{f(async o=>{const i=await N.clearHeaderLogo(o,a??void 0);return i.reverse_logo?N.updateHeaderSettings({reverse_logo:!1},o,a??void 0):i})},[f,a]),ke=C(o=>{b(i=>i&&{...i,menu:o?.id??null,menu_handle:o?.handle??null,menu_name:o?.name??null,menu_items:o?o.items.map(m=>({label:m.label,url:m.url,dropdown_menu:m.dropdown_menu??null,dropdown_items:m.dropdown_items??[]})):[]}),f(i=>N.updateHeaderSettings({menu:o?.id??null},i,a??void 0))},[f,a]),me=u(B,{children:[E&&e(Je,{tone:"danger",className:"mx-4 mt-3",action:t?void 0:e(le,{variant:"secondary",size:"md",onClick:()=>Ee(o=>o+1),children:n("Retry")}),children:E}),t?u(B,{children:[e(qo,{tabs:Q,activeId:R.id,onSelect:H}),u("div",{id:io(ce,R.id),role:"tabpanel","aria-labelledby":ao(ce,R.id),className:"es-insp-body flex flex-col py-4 [&>*+*]:mt-3",children:[R.id==="logo"&&u(B,{children:[u(w,{label:"Image",children:[e(K,{rule:ae,values:U,context:J,children:e(zo,{settings:t,websiteName:_,onPick:He,onClear:Te,showHint:c})}),e(s,{label:n("Reverse the Logo"),icon:e(Oo,{}),action:e(F,{checked:t.reverse_logo,onChange:o=>g({reverse_logo:o}),ariaLabel:n("Reverse the Logo")})}),e(z,{shown:c,children:n("Keeps the logo readable on any header — flips just its black & white parts to contrast the bar behind it (in both light and dark themes). Any other colors are kept as-is.")})]}),u(w,{label:"Placement",children:[e(s,{label:n("Position"),icon:e(ve,{}),value:(()=>{const o=r.logoPosition.options.find(i=>i.value===r.logoPosition.choose(t.logo_position))?.label;return o?n(o):void 0})(),children:e(I,{value:r.logoPosition.choose(t.logo_position),options:r.logoPosition.options,onChange:o=>g({logo_position:o}),ariaLabel:r.logoPosition.label})}),e(s,{label:n("Size"),icon:e(_e,{}),labelId:xe,value:`${t.logo_size_px??be[t.logo_size]}px`,changed:t.logo_size_px!=null,action:e(ie,{label:n("Size"),words:p.panel,changed:t.logo_size_px!=null,onReset:()=>ee(null)}),hint:c?n("Sets the logo’s height; the width follows the logo’s own proportions."):void 0,children:e(de,{labelledBy:xe,min:Ue,max:Xe,step:2,value:t.logo_size_px??be[t.logo_size],onCommit:o=>ee(o,!0),onPreview:o=>ee(o,!1)})})]}),e(se,{shown:c,onChange:A})]}),R.id==="menu"&&e(B,{children:u(w,{label:"Links",children:[e(Go,{token:l.current,menuId:t.menu,menuName:t.menu_name,itemCount:t.menu_items?.length??0,onPick:ke}),e(s,{label:n(r.menuAlign.label),icon:e(fo,{}),children:e(I,{value:r.menuAlign.choose(t.menu_position),options:r.menuAlign.options.filter(o=>o.value!=="beside"||t.logo_position!=="center"),onChange:o=>g({menu_position:o}),ariaLabel:r.menuAlign.label})}),e(K,{rule:ho,values:U,children:e(s,{label:n("Space from the logo"),icon:e(yo,{}),labelId:Se,value:`${t.menu_gap_px??$.default}px`,changed:t.menu_gap_px!=null,action:e(ie,{label:n("Space from the logo"),words:p.panel,changed:t.menu_gap_px!=null,onReset:()=>ne(null)}),hint:c?n("How much room the menu leaves the logo. Only the logo moves away; the space between the menu words stays as it is."):void 0,children:e(de,{labelledBy:Se,min:$.min,max:$.max,step:$.step,value:t.menu_gap_px??$.default,onCommit:o=>ne(o,!0),onPreview:o=>ne(o,!1)})})}),e(s,{label:n(r.menuRow.label),icon:e(Eo,{}),children:e(I,{value:r.menuRow.choose(t.menu_row),options:r.menuRow.options,onChange:o=>g({menu_row:o}),ariaLabel:r.menuRow.label})}),e(K,{rule:mo,values:U,children:e(s,{label:n("Left items"),icon:e(_o,{}),children:e("div",{className:"w-16",children:e(re,{value:t.menu_split??3,ariaLabel:n("Left items"),onChange:o=>g({menu_split:o}),options:[1,2,3,4].map(o=>({label:String(o),value:o}))})})})}),e(s,{label:n(r.navTextCase.label),icon:e(xo,{}),children:e(I,{value:r.navTextCase.choose(t.nav_text_case),options:r.navTextCase.options,onChange:o=>g({nav_text_case:o}),ariaLabel:r.navTextCase.label})}),e(z,{shown:c,children:te(n("{uppercase} draws SEARCH and BAG; {capitalised} draws Search and Bag. It covers the menu links and the Tools words together, and it leaves a name like FusionForge exactly as you typed it."),{uppercase:e("strong",{children:n("Uppercase")}),capitalised:e("strong",{children:n("Capitalised")})})})]})}),R.id==="tools"&&u(B,{children:[u(w,{label:"Style",children:[e(s,{label:n(r.utilStyle.label),icon:e(we,{}),children:e(I,{value:r.utilStyle.choose(t.util_style),options:r.utilStyle.options,onChange:o=>g({util_style:o}),ariaLabel:r.utilStyle.label})}),e(z,{shown:c,children:te(n("{text} draws the words — Search, Account, Bag — instead of the little pictures. It changes how they look, not whether they are shown: that stays with the switches below."),{text:e("strong",{children:n("Text")})})})]}),u(w,{label:"Search",children:[e(s,{label:n("Search"),icon:e(Po,{}),action:e(F,{checked:t.search_enabled,onChange:o=>g({search_enabled:o}),ariaLabel:n("Search")})}),e(s,{label:n(r.searchPosition.label),icon:e(ve,{}),children:e(I,{value:r.searchPosition.choose(t.search_position),options:r.searchPosition.options,onChange:o=>g({search_position:o}),ariaLabel:r.searchPosition.label})})]}),u(w,{label:"Country selector",children:[e(s,{label:n("Show selector"),icon:e(Co,{}),action:e(F,{checked:t.country_selector_enabled,onChange:o=>g({country_selector_enabled:o}),ariaLabel:n("Show selector")})}),e(K,{rule:uo,values:{country_selector_enabled:t.country_selector_enabled},children:e(s,{label:n("Show as"),icon:e(Lo,{}),children:e(ro,{value:t.country_selector_show_as,onChange:o=>g({country_selector_show_as:o})})})}),e(K,{rule:po,values:U,context:J,children:e(z,{shown:c,children:te(n("Which countries this website serves — and each region's own URL — is set in the admin console under {place}. Whether the picker is SHOWN stays here: that is header chrome, but the served-country list has tax consequences and belongs with commerce configuration."),{place:e("strong",{children:n("Storefront › Settings › Regions & currencies")})})})})]}),u(w,{label:"Account and cart",children:[e(s,{label:n("Account"),icon:e(bo,{}),action:e(F,{checked:t.account_enabled??!0,onChange:o=>g({account_enabled:o}),ariaLabel:n("Account")})}),e(s,{label:n("Cart"),icon:e(wo,{}),action:e(F,{checked:t.cart_enabled??!0,onChange:o=>g({cart_enabled:o}),ariaLabel:n("Cart")})})]}),u(w,{label:"Call",children:[e(s,{label:n("Call button"),icon:e(Ao,{}),action:e(F,{checked:t.call_button??!1,onChange:o=>g({call_button:o}),ariaLabel:n("Call button")})}),e(z,{shown:c,children:n("Calls the phone of the location this website shows, as its Set-up keeps it. With no phone there, the button is not shown.")})]}),e(se,{shown:c,onChange:A})]}),R.id==="look"&&u(B,{children:[u(w,{label:"Dimensions",children:[e(s,{label:n(r.width.label),icon:e(So,{}),children:e(I,{value:r.width.choose(t.width),options:r.width.options,onChange:o=>g({width:o}),ariaLabel:r.width.label})}),e(s,{label:n("Height"),icon:e(_e,{}),labelId:ye,value:`${t.height_px??Z.default}px`,changed:t.height_px!=null,action:e(ie,{label:n("Height"),words:p.panel,changed:t.height_px!=null,onReset:()=>oe(null)}),hint:c?n("Sets how tall the header bar is; the content below it shifts down to match."):void 0,children:e(de,{labelledBy:ye,min:Z.min,max:Z.max,step:2,value:t.height_px??Z.default,onCommit:o=>oe(o,!0),onPreview:o=>oe(o,!1)})}),e(s,{label:n("Border thickness"),icon:e(vo,{}),children:e("div",{className:"w-24",children:e(eo,{value:t.border_thickness,min:0,max:20,precision:0,size:"md",suffix:"px","aria-label":n("Border thickness"),onChange:o=>g({border_thickness:Math.max(0,o??0)})})})})]}),u(w,{label:"Color",children:[e(Ve,{value:t.theme??fe,onChange:o=>g({theme:o===fe?null:o}),followLabel:n("Follow the site theme"),hint:c?n("The color the bar paints once it is solid — after any scroll, and on every product page from the first paint. Follow the site theme keeps it on whatever palette the site is on."):void 0}),e(s,{label:n(r.topTextColor.label),icon:e(Mo,{}),children:e(I,{value:r.topTextColor.choose(t.top_text_color),options:r.topTextColor.options,onChange:o=>g({top_text_color:o}),ariaLabel:r.topTextColor.label})}),e(z,{shown:c,children:n("Auto reads what the first section on each page says it is — dark, light or accent — and picks the text that can be read on it. Set Light or Dark to decide it yourself when Auto reads a page wrong.")})]}),e(w,{label:"Behavior",children:e(s,{label:n("Sticky header"),icon:e(Io,{}),children:e("div",{className:"w-32",children:e(re,{value:t.sticky,ariaLabel:n("Sticky header"),onChange:o=>g({sticky:o}),options:[{label:n("None"),value:"none"},{label:n("Always"),value:"always"},{label:n("On scroll up"),value:"on_scroll_up"}]})})})}),x&&e(B,{children:u(w,{label:"Display mode",children:[e("p",{className:"text-[12px] text-[var(--ink-faint)]",children:n("Set the default Light / Dark / Auto mode and show or hide the light↔dark switch in Appearance.")}),e(le,{variant:"link",size:"sm",className:"self-start",onClick:x,children:n("Set up display mode →")})]})}),e(se,{shown:c,onChange:A})]})]})]}):E?null:e(oo,{size:"sm",padding:"p-4",label:n("Loading…")})]});return O?u("div",{className:"flex flex-col",children:[M&&e("div",{className:"px-4 pt-2 text-[11px] text-[var(--ink-faintest)]",children:n("Saving…")}),me]}):u(Qe,{open:!0,onClose:L??(()=>{}),side:"right",size:"sm",title:n("Header"),children:[M&&e("div",{className:"pb-2 text-[11px] text-[var(--ink-faintest)]",children:n("Saving…")}),me]})}function zo({settings:l,websiteName:a,onPick:L,onClear:v,showHint:O}){const y=!!l.logo_url,_=!y&&!!l.default_logo_url,x=$e(l.effective_logo_url),k=a&&a.trim()?a.trim():ze;return u("div",{className:"flex flex-col gap-2",children:[e(no,{value:x||"",onChange:p=>{p||v()},onPick:L,accept:"image/svg+xml,.svg",acceptHint:"SVG",fit:"contain",height:80,placeholder:n("No logo — “{name}” wordmark shown",{name:k}),replaceLabel:y?n("Replace SVG logo"):n("Upload SVG logo"),allowRemove:y,removeLabel:n("Use company default")}),e(z,{shown:O,children:y?n("Custom SVG logo uploaded for this store."):_?n("Using your company logo from the database."):n("No company logo on file — upload an SVG or the wordmark is used.")})]})}function Go({token:l,menuId:a,menuName:L,itemCount:v,onPick:O}){const y=ge(),[_,x]=P(null),[k,p]=P(!1),t=C(h=>{x(h),p(!0)},[]);W(()=>{let h=!1;return Me(l).then(H=>!h&&t(H)).catch(()=>!h&&x([])),()=>{h=!0}},[l,t]),W(()=>{let h=!1;const H=Oe(()=>{Re(l).then(c=>!h&&t(c)).catch(()=>{})});return()=>{h=!0,H()}},[l,t]);const b=_===null,E=!b&&(_?.length??0)===0,S=!b&&(_??[]).some(h=>h.id===a),M=S?a:"",q=k&&!!a&&!S;return u("div",{className:"flex flex-col gap-2",children:[e(s,{label:n("Menu"),icon:e(ko,{}),children:e("div",{className:"w-[170px] max-w-full",children:e(re,{value:M,ariaLabel:n("Menu"),readOnly:b||E,onChange:h=>{const H=h?(_??[]).find(c=>c.id===h):null;O(H?{...H,items:H.items.map(c=>({...c,dropdown_items:(_??[]).find(A=>A.id===c.dropdown_menu)?.items.map(A=>({label:A.label,url:A.url}))??[]}))}:null)},options:[{label:b?n("Loading…"):E?n("No menus"):n("Default links"),value:""},...(_??[]).map(h=>({label:`${h.name} (${h.item_count??h.items.length})`,value:h.id}))]})})}),q?e("p",{className:"text-[12px] text-[var(--warning-text)]",children:De()}):e("p",{className:"text-[12px] text-[var(--ink-faint)]",children:M?Be("Header shows “{name}” — {n} link.","Header shows “{name}” — {n} links.",v,{name:L??n("the linked menu")}):E?n("No menus yet. Create one in {place}, then pick it here.",{place:n("Storefront → Menus")}):n("Pick a menu to drive the header links, or keep the built-in default links.")}),e(le,{variant:"link",size:"sm",className:"self-start",onClick:()=>y.send("storefront-editor:open-menus",{menuId:M||null}),children:M?n("Edit menu →"):n("Manage menus →")})]})}function z({shown:l,children:a}){return l?e("p",{className:"text-[11px] text-[var(--sf-muted)]",children:a}):null}function de({labelledBy:l,value:a,min:L,max:v,step:O,onPreview:y,onCommit:_}){const x=`${l}-range`,k=Y(_);return k.current=_,W(()=>{const p=document.getElementById(x);if(!(p instanceof HTMLInputElement))return;const t=()=>k.current?.(Number(p.value)),b=E=>{/^(Arrow|Home|End|Page)/.test(E.key)&&t()};return p.addEventListener("pointerup",t),p.addEventListener("keyup",b),()=>{p.removeEventListener("pointerup",t),p.removeEventListener("keyup",b)}},[x]),e(to,{id:x,value:a,min:L,max:v,step:O,showInput:!1,size:"sm",className:"sf-slider","aria-labelledby":l,valueText:p=>n("{n} pixels",{n:p}),onChange:p=>{p!=null&&y(p)}})}function w({label:l,children:a}){return e(Ro,{title:n(l),children:e("div",{className:"flex flex-col gap-3",children:a})})}const Wo=[{label:"Left",value:"left"},{label:"Center",value:"center"}],Fo=[{label:"Left",value:"left"},{label:"Right",value:"right"}],Uo=[{label:"Right",value:"left"},{label:"Centered",value:"center"},{label:"Beside logo",value:"beside"}],Xo=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],Vo=Ge.map(l=>({label:We[l],value:l})),jo=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],$o=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],Ko=[{label:"Auto",value:"auto"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}],r={logoPosition:{label:"Position",options:Wo,choose:l=>l==="right"?"center":l},menuAlign:{label:"Alignment",options:Uo,choose:l=>l==="center"?"center":l==="beside"?"beside":"left"},menuRow:{label:"Row",options:Xo,choose:l=>l==="inline"?"inline":"top"},searchPosition:{label:"Position",options:Fo,choose:l=>l},width:{label:"Width",options:Vo,choose:l=>l},navTextCase:{label:"Letters",options:$o,choose:l=>l==="capitalised"?"capitalised":"uppercase"},utilStyle:{label:"Show as",options:jo,choose:l=>l==="text"?"text":"icon"},topTextColor:{label:"Text color at the top",options:Ko,choose:l=>je(l)}};function qo({tabs:l,activeId:a,onSelect:L}){return e("div",{className:"es-insp-tabs",children:e(lo,{variant:"underline",block:!0,labelsFit:!0,"aria-label":n("Header settings"),idPrefix:ce,value:a,onChange:L,items:l.map(v=>({id:v.id,icon:v.icon,label:n(v.label)}))})})}export{r as HEADER_SEGMENTED,Ce as HEADER_TABS,ce as HEADER_TABS_ID_PREFIX,qo as HeaderTabStrip,ae as OFF_PLACEHOLDER,de as PxSlider,Bo as default};
|
|
1
|
+
"use client";import{jsx as e,jsxs as m,Fragment as D}from"react/jsx-runtime";import{useCallback as C,useEffect as G,useRef as $,useState as B}from"react";import{ApiError as He,storefrontAdmin as P}from"../../render/lib/api/index.js";import{requestMediaPick as Ae}from"efficient-easel/screen/lib/media-picker";import{refreshSiteLiveState as Pe}from"efficient-web-builder/editor/lib/site-live-state";import{useEaselHost as de}from"efficient-easel/screen/lib/host";import{onHeaderMenusChanged as Ie}from"efficient-web-builder/format/lib/editor-events";import{loadAllSitesMenus as Ne,refreshAllSitesMenus as Oe}from"../../render/lib/menu-source.js";import{headerMenuMissingWarning as Me}from"../../render/lib/content/menu-placeholder.js";import{say as t,sayCount as Re}from"efficient-web-builder/format/lib/editor-words";import{sayWith as ee}from"../lib/say-with.js";import{NEUTRAL_SITE_NAME as De}from"../../render/lib/content/site.js";import{SECTION_WIDTH_CHOICES as Be,WIDTH_CHOICE_LABEL as ze}from"efficient-web-builder/format/lib/content/section-width";import{usePreviewHeader as Ge}from"efficient-web-builder/render/components/PreviewHeaderContext";import{HEADER_LOGO_PX as he,HEADER_LOGO_PX_MIN as We,HEADER_LOGO_PX_MAX as Fe}from"efficient-web-builder/render/components/Logo";import{HEADER_HEIGHT_PX as K,HEADER_MENU_GAP_PX as V}from"efficient-web-builder/render/lib/document/header-clearance";import Ue from"efficient-web-builder/editor/components/SectionThemePicker";import{HEADER_THEME_FOLLOW as me}from"../../render/lib/content/header-theme.js";import{resolveHeaderInkMode as Xe}from"efficient-web-builder/render/lib/document/header-ink";import{absolutizeApiUrl as Ve}from"efficient-web-builder/render/lib/media";import{loadHeaderSettings as je,primeHeaderSettings as $e,clearHeaderSettingsCache as Ke,toPreviewHeaderSettings as qe}from"../lib/header-settings-source.js";import{Banner as Ye,Button as oe,Drawer as Ze,InputNumber as Je,LoadingSpinner as Qe,MediaUploadField as eo,ShowWhen as q,Slider as oo,Tabs as to,tabButtonId as no,tabPanelId as lo}from"efficient-shell/ui";import{CountryShowAsTiles as ao}from"./CountryShowAsTiles.js";import{truthy as io,visibleFields as pe}from"efficient-web-builder/render/lib/document/show-when";const ro={field:"country_selector_enabled",is:!0},te={not:{context:"placeholderMode",is:!0}},so={field:"menu_position",is:"beside"},co={all:[{field:"logo_position",is:"center"},{not:{field:"menu_position",is:"center"}}]},uo={all:[te,io("country_selector_enabled")]};import{SettingsDefaultReset as ne,SettingsField as s,SettingsSwitch as W}from"efficient-easel/panel";import{FieldSelect as le}from"efficient-easel/fields";import{useEaselStrings as ho}from"efficient-easel/strings";import{AccountIcon as mo,AlignLeftIcon as po,AlignSeparateIcon as go,BorderAllIcon as bo,CartIcon as fo,CaseIcon as _o,FullWidthIcon as vo,GapIcon as wo,GlobeIcon as xo,GridIcon as So,HeightIcon as ge,LayoutIcon as yo,ListIcon as Co,LogoIcon as Lo,MenuIcon as Eo,PhoneIcon as ko,PlacementIcon as be,SearchIcon as To,SettingsIcon as Ho,StickyIcon as Ao,StylesIcon as fe,SwapIcon as Po,TextColorIcon as Io}from"efficient-easel/icons";import{PanelBand as No}from"efficient-web-builder/editor/lib/document/controls";import{Segmented as I}from"efficient-web-builder/editor/lib/document/box-fields";const ae="sf-header",_e="sf-header-size-label",ve="sf-header-gap-label",we="sf-header-height-label",xe=[{id:"logo",label:"Logo",icon:e(Lo,{})},{id:"menu",label:"Menu",icon:e(Co,{}),showWhen:te},{id:"tools",label:"Tools",icon:e(Ho,{})},{id:"look",label:"Look",icon:e(fe,{})}];function Oo({tokenRef:l,siteId:a,onClose:L,onAuthExpired:_,inline:y,placeholderMode:N,websiteName:f,onOpenWebsiteSettings:x}){const H=de(),p=ho(),[n,g]=B(null),[E,S]=B(null),[O,j]=B(!1),[u,k]=B(xe[0].id),v=n,A={placeholderMode:N},Y=Object.values(pe(Object.fromEntries(xe.map(o=>[o.id,o])),v,A)),M=Y.find(o=>o.id===u)??Y[0],Se="regions"in pe({regions:{showWhen:uo}},v,A),[ye,Ce]=B(0),{setSettings:re}=Ge(),F=$(null),U=$(null),X=$(null);G(()=>{let o=!1,i=null,d=null;const c=3,T=(z,R=0)=>{o||S(null),je(z,a,R>0).then(Te=>!o&&g(Te)).catch(()=>{o||(R+1<c?d=setTimeout(()=>T(z,R+1),600*(R+1)):S(t("Could not load header settings.")))})},ue=l.current;if(ue)T(ue);else{let z=0;i=setInterval(()=>{const R=l.current;if(R){i&&clearInterval(i),i=null,o||S(null),T(R);return}z+=250,z===5e3&&!o&&S(t("Waiting for editor authorization…")),z>=3e4&&(i&&clearInterval(i),i=null,o||S(t("Not authorized yet — reopen once the editor has loaded.")))},250)}return()=>{o=!0,i&&clearInterval(i),d&&clearTimeout(d)}},[l,ye,a]),G(()=>{n&&re(qe(n))},[n,re]),G(()=>()=>{F.current&&clearTimeout(F.current),U.current&&clearTimeout(U.current),X.current&&clearTimeout(X.current)},[]);const b=C(async(o,i)=>{const d=l.current;if(!d||!n)return;const c=n;i&&g({...n,...i}),j(!0),S(null);try{const T=await o(d);g(T),$e(T,a),Pe()}catch(T){g(c),T instanceof He&&T.status===401?(Ke(a),_?.(),S(t("Authorization expired — try again in a moment."))):S(t("Could not save. Please retry."))}finally{j(!1)}},[n,l,_,a]),h=C(o=>b(i=>P.updateHeaderSettings(o,i,a??void 0),o),[b,a]),se=C(o=>{b(i=>P.setHeaderLogoFromAsset(o,i,a??void 0))},[b,a]),Le=C(()=>{Ae(H,{accept:"image/svg+xml",title:t("Logo (SVG)")}).then(o=>{o&&se(o.id)})},[se]),Z=C((o,i=!0)=>{g(c=>c&&{...c,logo_size_px:o}),F.current&&clearTimeout(F.current);const d=()=>{b(c=>P.updateHeaderSettings({logo_size_px:o},c,a??void 0))};i?d():F.current=setTimeout(d,400)},[b,a]),J=C((o,i=!0)=>{g(c=>c&&{...c,height_px:o}),U.current&&clearTimeout(U.current);const d=()=>{b(c=>P.updateHeaderSettings({height_px:o},c,a??void 0))};i?d():U.current=setTimeout(d,400)},[b,a]),Q=C((o,i=!0)=>{g(c=>c&&{...c,menu_gap_px:o}),X.current&&clearTimeout(X.current);const d=()=>{b(c=>P.updateHeaderSettings({menu_gap_px:o},c,a??void 0))};i?d():X.current=setTimeout(d,400)},[b,a]),Ee=C(()=>{b(async o=>{const i=await P.clearHeaderLogo(o,a??void 0);return i.reverse_logo?P.updateHeaderSettings({reverse_logo:!1},o,a??void 0):i})},[b,a]),ke=C(o=>{g(i=>i&&{...i,menu:o?.id??null,menu_handle:o?.handle??null,menu_name:o?.name??null,menu_items:o?o.items.map(d=>({label:d.label,url:d.url,dropdown_menu:d.dropdown_menu??null,dropdown_items:d.dropdown_items??[]})):[]}),b(i=>P.updateHeaderSettings({menu:o?.id??null},i,a??void 0))},[b,a]),ce=m(D,{children:[E&&e(Ye,{tone:"danger",className:"mx-4 mt-3",action:n?void 0:e(oe,{variant:"secondary",size:"md",onClick:()=>Ce(o=>o+1),children:t("Retry")}),children:E}),n?m(D,{children:[e(jo,{tabs:Y,activeId:M.id,onSelect:k}),m("div",{id:lo(ae,M.id),role:"tabpanel","aria-labelledby":no(ae,M.id),className:"es-insp-body flex flex-col py-4 [&>*+*]:mt-3",children:[M.id==="logo"&&m(D,{children:[m(w,{label:"Image",children:[e(q,{rule:te,values:v,context:A,children:e(Mo,{settings:n,websiteName:f,onPick:Le,onClear:Ee})}),e(s,{label:t("Reverse the Logo"),icon:e(Po,{}),hint:t("Keeps the logo readable on any header — flips just its black & white parts to contrast the bar behind it (in both light and dark themes). Any other colors are kept as-is."),action:e(W,{checked:n.reverse_logo,onChange:o=>h({reverse_logo:o}),ariaLabel:t("Reverse the Logo")})})]}),m(w,{label:"Placement",children:[e(s,{label:t("Position"),icon:e(be,{}),value:(()=>{const o=r.logoPosition.options.find(i=>i.value===r.logoPosition.choose(n.logo_position))?.label;return o?t(o):void 0})(),children:e(I,{value:r.logoPosition.choose(n.logo_position),options:r.logoPosition.options,onChange:o=>h({logo_position:o}),ariaLabel:r.logoPosition.label})}),e(s,{label:t("Size"),icon:e(ge,{}),labelId:_e,value:`${n.logo_size_px??he[n.logo_size]}px`,changed:n.logo_size_px!=null,action:e(ne,{label:t("Size"),words:p.panel,changed:n.logo_size_px!=null,onReset:()=>Z(null)}),hint:t("Sets the logo’s height; the width follows the logo’s own proportions."),children:e(ie,{labelledBy:_e,min:We,max:Fe,step:2,value:n.logo_size_px??he[n.logo_size],onCommit:o=>Z(o,!0),onPreview:o=>Z(o,!1)})})]})]}),M.id==="menu"&&e(D,{children:m(w,{label:"Links",children:[e(Ro,{token:l.current,menuId:n.menu,menuName:n.menu_name,itemCount:n.menu_items?.length??0,onPick:ke}),e(s,{label:t(r.menuAlign.label),icon:e(po,{}),children:e(I,{value:r.menuAlign.choose(n.menu_position),options:r.menuAlign.options.filter(o=>o.value!=="beside"||n.logo_position!=="center"),onChange:o=>h({menu_position:o}),ariaLabel:r.menuAlign.label})}),e(q,{rule:so,values:v,children:e(s,{label:t("Space from the logo"),icon:e(wo,{}),labelId:ve,value:`${n.menu_gap_px??V.default}px`,changed:n.menu_gap_px!=null,action:e(ne,{label:t("Space from the logo"),words:p.panel,changed:n.menu_gap_px!=null,onReset:()=>Q(null)}),hint:t("How much room the menu leaves the logo. Only the logo moves away; the space between the menu words stays as it is."),children:e(ie,{labelledBy:ve,min:V.min,max:V.max,step:V.step,value:n.menu_gap_px??V.default,onCommit:o=>Q(o,!0),onPreview:o=>Q(o,!1)})})}),e(s,{label:t(r.menuRow.label),icon:e(yo,{}),children:e(I,{value:r.menuRow.choose(n.menu_row),options:r.menuRow.options,onChange:o=>h({menu_row:o}),ariaLabel:r.menuRow.label})}),e(q,{rule:co,values:v,children:e(s,{label:t("Left items"),icon:e(go,{}),children:e("div",{className:"w-16",children:e(le,{value:n.menu_split??3,ariaLabel:t("Left items"),onChange:o=>h({menu_split:o}),options:[1,2,3,4].map(o=>({label:String(o),value:o}))})})})}),e(s,{label:t(r.navTextCase.label),icon:e(_o,{}),hint:ee(t("{uppercase} draws SEARCH and BAG; {capitalised} draws Search and Bag. It covers the menu links and the Tools words together, and it leaves a name like FusionForge exactly as you typed it."),{uppercase:e("strong",{children:t("Uppercase")}),capitalised:e("strong",{children:t("Capitalised")})}),children:e(I,{value:r.navTextCase.choose(n.nav_text_case),options:r.navTextCase.options,onChange:o=>h({nav_text_case:o}),ariaLabel:r.navTextCase.label})})]})}),M.id==="tools"&&m(D,{children:[e(w,{label:"Style",children:e(s,{label:t(r.utilStyle.label),icon:e(fe,{}),hint:ee(t("{text} draws the words — Search, Account, Bag — instead of the little pictures. It changes how they look, not whether they are shown: that stays with the switches below."),{text:e("strong",{children:t("Text")})}),children:e(I,{value:r.utilStyle.choose(n.util_style),options:r.utilStyle.options,onChange:o=>h({util_style:o}),ariaLabel:r.utilStyle.label})})}),m(w,{label:"Search",children:[e(s,{label:t("Search"),icon:e(To,{}),action:e(W,{checked:n.search_enabled,onChange:o=>h({search_enabled:o}),ariaLabel:t("Search")})}),e(s,{label:t(r.searchPosition.label),icon:e(be,{}),children:e(I,{value:r.searchPosition.choose(n.search_position),options:r.searchPosition.options,onChange:o=>h({search_position:o}),ariaLabel:r.searchPosition.label})})]}),m(w,{label:"Country selector",children:[e(s,{label:t("Show selector"),icon:e(xo,{}),action:e(W,{checked:n.country_selector_enabled,onChange:o=>h({country_selector_enabled:o}),ariaLabel:t("Show selector")})}),e(q,{rule:ro,values:{country_selector_enabled:n.country_selector_enabled},children:e(s,{label:t("Show as"),icon:e(So,{}),hint:Se?ee(t("Which countries this website serves — and each region's own URL — is set in the admin console under {place}. Whether the picker is SHOWN stays here: that is header chrome, but the served-country list has tax consequences and belongs with commerce configuration."),{place:e("strong",{children:t("Storefront › Settings › Regions & currencies")})}):void 0,children:e(ao,{value:n.country_selector_show_as,onChange:o=>h({country_selector_show_as:o})})})})]}),m(w,{label:"Account and cart",children:[e(s,{label:t("Account"),icon:e(mo,{}),action:e(W,{checked:n.account_enabled??!0,onChange:o=>h({account_enabled:o}),ariaLabel:t("Account")})}),e(s,{label:t("Cart"),icon:e(fo,{}),action:e(W,{checked:n.cart_enabled??!0,onChange:o=>h({cart_enabled:o}),ariaLabel:t("Cart")})})]}),e(w,{label:"Call",children:e(s,{label:t("Call button"),icon:e(ko,{}),hint:t("Calls the phone of the location this website shows, as its Set-up keeps it. With no phone there, the button is not shown."),action:e(W,{checked:n.call_button??!1,onChange:o=>h({call_button:o}),ariaLabel:t("Call button")})})})]}),M.id==="look"&&m(D,{children:[m(w,{label:"Dimensions",children:[e(s,{label:t(r.width.label),icon:e(vo,{}),children:e(I,{value:r.width.choose(n.width),options:r.width.options,onChange:o=>h({width:o}),ariaLabel:r.width.label})}),e(s,{label:t("Height"),icon:e(ge,{}),labelId:we,value:`${n.height_px??K.default}px`,changed:n.height_px!=null,action:e(ne,{label:t("Height"),words:p.panel,changed:n.height_px!=null,onReset:()=>J(null)}),hint:t("Sets how tall the header bar is; the content below it shifts down to match."),children:e(ie,{labelledBy:we,min:K.min,max:K.max,step:2,value:n.height_px??K.default,onCommit:o=>J(o,!0),onPreview:o=>J(o,!1)})}),e(s,{label:t("Border thickness"),icon:e(bo,{}),children:e("div",{className:"w-24",children:e(Je,{value:n.border_thickness,min:0,max:20,precision:0,size:"md",suffix:"px","aria-label":t("Border thickness"),onChange:o=>h({border_thickness:Math.max(0,o??0)})})})})]}),m(w,{label:"Color",children:[e(Ue,{value:n.theme??me,onChange:o=>h({theme:o===me?null:o}),followLabel:t("Follow the site theme"),hint:t("The color the bar paints once it is solid — after any scroll, and on every product page from the first paint. Follow the site theme keeps it on whatever palette the site is on.")}),e(s,{label:t(r.topTextColor.label),icon:e(Io,{}),hint:t("Auto reads what the first section on each page says it is — dark, light or accent — and picks the text that can be read on it. Set Light or Dark to decide it yourself when Auto reads a page wrong."),children:e(I,{value:r.topTextColor.choose(n.top_text_color),options:r.topTextColor.options,onChange:o=>h({top_text_color:o}),ariaLabel:r.topTextColor.label})})]}),e(w,{label:"Behavior",children:e(s,{label:t("Sticky header"),icon:e(Ao,{}),children:e("div",{className:"w-32",children:e(le,{value:n.sticky,ariaLabel:t("Sticky header"),onChange:o=>h({sticky:o}),options:[{label:t("None"),value:"none"},{label:t("Always"),value:"always"},{label:t("On scroll up"),value:"on_scroll_up"}]})})})}),x&&e(D,{children:m(w,{label:"Display mode",children:[e("p",{className:"text-[12px] text-[var(--ink-faint)]",children:t("Set the default Light / Dark / Auto mode and show or hide the light↔dark switch in Appearance.")}),e(oe,{variant:"link",size:"sm",className:"self-start",onClick:x,children:t("Set up display mode →")})]})})]})]})]}):E?null:e(Qe,{size:"sm",padding:"p-4",label:t("Loading…")})]});return y?m("div",{className:"flex flex-col",children:[O&&e("div",{className:"px-4 pt-2 text-[11px] text-[var(--ink-faintest)]",children:t("Saving…")}),ce]}):m(Ze,{open:!0,onClose:L??(()=>{}),side:"right",size:"sm",title:t("Header"),children:[O&&e("div",{className:"pb-2 text-[11px] text-[var(--ink-faintest)]",children:t("Saving…")}),ce]})}function Mo({settings:l,websiteName:a,onPick:L,onClear:_}){const y=!!l.logo_url,N=!y&&!!l.default_logo_url,f=Ve(l.effective_logo_url),x=a&&a.trim()?a.trim():De;return m("div",{children:[e(eo,{value:f||"",onChange:H=>{H||_()},onPick:L,accept:"image/svg+xml,.svg",acceptHint:"SVG",fit:"contain",height:80,placeholder:t("No logo — “{name}” wordmark shown",{name:x}),replaceLabel:y?t("Replace SVG logo"):t("Upload SVG logo"),allowRemove:y,removeLabel:t("Use company default")}),e(Do,{children:y?t("Custom SVG logo uploaded for this store."):N?t("Using your company logo from the database."):t("No company logo on file — upload an SVG or the wordmark is used.")})]})}function Ro({token:l,menuId:a,menuName:L,itemCount:_,onPick:y}){const N=de(),[f,x]=B(null),[H,p]=B(!1),n=C(u=>{x(u),p(!0)},[]);G(()=>{let u=!1;return Ne(l).then(k=>!u&&n(k)).catch(()=>!u&&x([])),()=>{u=!0}},[l,n]),G(()=>{let u=!1;const k=Ie(()=>{Oe(l).then(v=>!u&&n(v)).catch(()=>{})});return()=>{u=!0,k()}},[l,n]);const g=f===null,E=!g&&(f?.length??0)===0,S=!g&&(f??[]).some(u=>u.id===a),O=S?a:"",j=H&&!!a&&!S;return m("div",{className:"flex flex-col gap-2",children:[e(s,{label:t("Menu"),icon:e(Eo,{}),children:e("div",{className:"w-[170px] max-w-full",children:e(le,{value:O,ariaLabel:t("Menu"),readOnly:g||E,onChange:u=>{const k=u?(f??[]).find(v=>v.id===u):null;y(k?{...k,items:k.items.map(v=>({...v,dropdown_items:(f??[]).find(A=>A.id===v.dropdown_menu)?.items.map(A=>({label:A.label,url:A.url}))??[]}))}:null)},options:[{label:g?t("Loading…"):E?t("No menus"):t("Default links"),value:""},...(f??[]).map(u=>({label:`${u.name} (${u.item_count??u.items.length})`,value:u.id}))]})})}),j?e("p",{className:"text-[12px] text-[var(--warning-text)]",children:Me()}):e("p",{className:"text-[12px] text-[var(--ink-faint)]",children:O?Re("Header shows “{name}” — {n} link.","Header shows “{name}” — {n} links.",_,{name:L??t("the linked menu")}):E?t("No menus yet. Create one in {place}, then pick it here.",{place:t("Storefront → Menus")}):t("Pick a menu to drive the header links, or keep the built-in default links.")}),e(oe,{variant:"link",size:"sm",className:"self-start",onClick:()=>N.send("storefront-editor:open-menus",{menuId:O||null}),children:O?t("Edit menu →"):t("Manage menus →")})]})}function Do({children:l}){return e("p",{className:"es-field-hint",children:l})}function ie({labelledBy:l,value:a,min:L,max:_,step:y,onPreview:N,onCommit:f}){const x=`${l}-range`,H=$(f);return H.current=f,G(()=>{const p=document.getElementById(x);if(!(p instanceof HTMLInputElement))return;const n=()=>H.current?.(Number(p.value)),g=E=>{/^(Arrow|Home|End|Page)/.test(E.key)&&n()};return p.addEventListener("pointerup",n),p.addEventListener("keyup",g),()=>{p.removeEventListener("pointerup",n),p.removeEventListener("keyup",g)}},[x]),e(oo,{id:x,value:a,min:L,max:_,step:y,showInput:!1,size:"sm",className:"sf-slider","aria-labelledby":l,valueText:p=>t("{n} pixels",{n:p}),onChange:p=>{p!=null&&N(p)}})}function w({label:l,children:a}){return e(No,{title:t(l),children:e("div",{className:"flex flex-col gap-3",children:a})})}const Bo=[{label:"Left",value:"left"},{label:"Center",value:"center"}],zo=[{label:"Left",value:"left"},{label:"Right",value:"right"}],Go=[{label:"Right",value:"left"},{label:"Centered",value:"center"},{label:"Beside logo",value:"beside"}],Wo=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],Fo=Be.map(l=>({label:ze[l],value:l})),Uo=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],Xo=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],Vo=[{label:"Auto",value:"auto"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}],r={logoPosition:{label:"Position",options:Bo,choose:l=>l==="right"?"center":l},menuAlign:{label:"Alignment",options:Go,choose:l=>l==="center"?"center":l==="beside"?"beside":"left"},menuRow:{label:"Row",options:Wo,choose:l=>l==="inline"?"inline":"top"},searchPosition:{label:"Position",options:zo,choose:l=>l},width:{label:"Width",options:Fo,choose:l=>l},navTextCase:{label:"Letters",options:Xo,choose:l=>l==="capitalised"?"capitalised":"uppercase"},utilStyle:{label:"Show as",options:Uo,choose:l=>l==="text"?"text":"icon"},topTextColor:{label:"Text color at the top",options:Vo,choose:l=>Xe(l)}};function jo({tabs:l,activeId:a,onSelect:L}){return e("div",{className:"es-insp-tabs",children:e(to,{variant:"underline",block:!0,labelsFit:!0,"aria-label":t("Header settings"),idPrefix:ae,value:a,onChange:L,items:l.map(_=>({id:_.id,icon:_.icon,label:t(_.label)}))})})}export{r as HEADER_SEGMENTED,xe as HEADER_TABS,ae as HEADER_TABS_ID_PREFIX,jo as HeaderTabStrip,te as OFF_PLACEHOLDER,ie as PxSlider,Oo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as b,jsxs as H}from"react/jsx-runtime";import{useEffect as I,useMemo as L,useState as $}from"react";import{useEaselHost as z}from"efficient-easel/screen/lib/host";import{formatPrice as N}from"../../render/lib/commerce.js";import{resolveWheelPrice as K}from"../../render/lib/wheels/price-display.js";import{isRenderableFinish as O}from"../../render/lib/wheels/renderable-finishes.js";import{loadUnifiedProductCatalog as _}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as w}from"./useStorefrontCategories.js";import{filterByCategory as M,useCategoryFilter as U}from"./useCategoryFilter.js";import{CategoryField as V}from"./CategoryProductFields.js";import{useSnapshotSource as q}from"efficient-web-builder/editor/components/useSnapshotSource";import{useCurrency as D}from"../../render/components/CurrencyContext.js";import G from"efficient-web-builder/editor/components/SearchSelectField";import J from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as Q}from"efficient-web-builder/format/lib/editor-words";const R=e=>e.kind==="tyre"?"tyre":"alloy-wheel",m=e=>`${e.kind}:${e.slug}`;function
|
|
1
|
+
"use client";import{jsx as b,jsxs as H}from"react/jsx-runtime";import{useEffect as I,useMemo as L,useState as $}from"react";import{useEaselHost as z}from"efficient-easel/screen/lib/host";import{formatPrice as N}from"../../render/lib/commerce.js";import{resolveWheelPrice as K}from"../../render/lib/wheels/price-display.js";import{isRenderableFinish as O}from"../../render/lib/wheels/renderable-finishes.js";import{loadUnifiedProductCatalog as _}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as w}from"./useStorefrontCategories.js";import{filterByCategory as M,useCategoryFilter as U}from"./useCategoryFilter.js";import{CategoryField as V}from"./CategoryProductFields.js";import{useSnapshotSource as q}from"efficient-web-builder/editor/components/useSnapshotSource";import{useCurrency as D}from"../../render/components/CurrencyContext.js";import G from"efficient-web-builder/editor/components/SearchSelectField";import J from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as Q}from"efficient-web-builder/format/lib/editor-words";const R=e=>e.kind==="tyre"?"tyre":"alloy-wheel",m=e=>`${e.kind}:${e.slug}`;function E(e){return e.kind==="tyre"?{kind:"tyre",slug:e.slug,name:e.name,description:e.description??"",eyebrow:e.brand??"",image:e.coverImage??null,finishes:[],prices:e.prices,href:`/tyres/${e.slug}`}:{kind:"wheel",slug:e.slug,name:e.name,description:e.description??"",eyebrow:e.process,image:e.coverImage??null,finishes:e.finishes.filter(O).map(o=>({name:o.name,color:o.color,src:o.src})),prices:e.prices,href:`/wheels/${e.slug}`}}function C(e,o){const s=R(o);return e.find(t=>t.kind===s&&t.slug===o.slug)}function X(e){return T(e)?n("Category — wheels only"):n("Category")}const T=e=>!!(e?.some(o=>o.kind==="tyre")&&e.some(o=>o.kind==="alloy-wheel")),Y=e=>Q("{n} size","{n} sizes",e);function Z({rows:e,category:o,value:s,loading:t,currency:l}){const a=e??[],u=a.filter(r=>r.kind==="alloy-wheel"),p=a.filter(r=>r.kind==="tyre"),h=u.length>0&&p.length>0,S={value:"",label:t?n("Loading…"):n("Pick a product…")},g=s&&!(e!==null&&C(e,s))?[{value:m({kind:R(s),slug:s.slug}),label:t?s.name:n("{name} (unavailable)",{name:s.name})}]:[],c=M(u,o),d=s&&e!==null?C(e,s):void 0,x=[...d&&d.kind==="alloy-wheel"&&!c.includes(d)?[d]:[],...c].map(r=>{const y=K(r.prices[l],r.msrpPrices?.[l]);return{value:m({kind:"alloy-wheel",slug:r.slug}),label:r.name,...h?{group:n("Wheels")}:{},thumb:r.coverImage??null,...y.priced?{meta:N(y.unit,l)}:{}}}),P=p.map(r=>({value:m(r),label:r.name,...h?{group:n("Tyres")}:{},thumb:r.coverImage??null,meta:Y(r.variantCount)}));return[S,...g,...x,...P]}function v({value:e,onChange:o}){const s=z(),{rows:t,loading:l,refreshing:a,errored:u,refresh:p}=q({load:_,resolve:C,snapshot:E,value:e,onChange:o}),[h,S]=$(null);I(()=>{let i=!1;return w().then(k=>{i||S(k)}),()=>{i=!0}},[]);const{currency:g}=D(),c=L(()=>t&&e?C(t,e)??null:null,[t,e]),d=L(()=>(t??[]).filter(i=>i.kind==="alloy-wheel"),[t]),{category:f,setCategory:x,categoryNames:P}=U(d,h,c?.kind==="alloy-wheel"?c:null),r=!!e?.slug&&t!==null&&!c,y=L(()=>Z({rows:t,category:f,value:e,loading:l,currency:g}),[t,f,e,l,g]),W=i=>{if(!i){o(null);return}const k=(t??[]).find(F=>m(F)===i);k&&o(E(k))},j=()=>{e?.slug&&s.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},A=u?"error":a?"loading":"idle",B=u?n("Couldn’t reach the product catalog."):a?n("Syncing from the catalog…"):r?n("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):n("Linked to “{name}” · title, description, category, price & image follow the product.",{name:e?.name??""});return H("div",{children:[b(G,{label:"Product",options:y,fallback:"",value:e?m({kind:R(e),slug:e.slug}):"",onChange:W,placeholder:"Search products…"}),b(V,{label:X(t),allLabel:T(t)?n("All wheel categories"):n("All products"),category:f,onChange:x,categoryNames:P,readOnly:l}),e?.slug?b(J,{status:A,statusText:B,onRefresh:p,busy:a,edit:{label:n("Edit product ✎"),onClick:j},hint:n("The whole hero comes from the product record — title, price, pictures, options and Add to Cart. Edit the product in the Products database and this hero updates to match.")}):b("p",{className:"es-field-hint",children:n("This hero always shows a real product. Pick one to fill the title, price, pictures, options and Add to Cart from the catalog.")})]})}export{v as default,X as heroCategoryLabel,Z as heroPickerOptions,C as heroResolve,E as heroSnapshot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as c,jsxs as k}from"react/jsx-runtime";import{useEffect as P,useMemo as x,useState as d}from"react";import{loadProductCatalog as N}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as b}from"./useStorefrontCategories.js";import{useCategoryFilter as j}from"./useCategoryFilter.js";import S from"./CategoryProductFields.js";import{useGridSourceLock as L}from"./useGridSourceLock.js";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{sayWith as T}from"../lib/say-with.js";import{InertHint as W}from"efficient-easel/panel";function w({value:r,onChange:u}){const[e,m]=d(null),[f,g]=d(null);P(()=>{let t=!1;return N().then(n=>{t||m(n)}),b().then(n=>{t||g(n)}),()=>{t=!0}},[]);const h=x(()=>e&&r?e.find(t=>t.slug===r)??null:null,[e,r]),{category:p,setCategory:y,categoryNames:C,filtered:a}=j(e,f,h),l=e===null,i=L(),s=i!==null;return k("div",{children:[s&&c(W,{children:T(o("Disabled because this grid’s {source} is set to “{name}”. The grid fills itself from that source automatically. To pick wheels here, set {source} back to “Manual”.",{name:i??""}),{source:c("strong",{children:o("Product content")})})}),c("div",{className:s?"sf-locked":void 0,children:c(S,{category:p,onChange:y,categoryNames:C,readOnly:l||s,products:a,allProducts:e??[],product:r??"",onProductChange:u,productReadOnly:l||s,emptyLabel:l?o("Loading…"):a.length===0?o("No products in this category"):o("Select a product…")})})]})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as p,jsxs as _}from"react/jsx-runtime";import{useEffect as x,useMemo as g,useState as v}from"react";import{useProductCatalog as S}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as b}from"./useStorefrontCategories.js";import{useCategoryFilter as D}from"./useCategoryFilter.js";import F from"./CategoryProductFields.js";import{useEasel as N}from"efficient-easel/easel";import{isEditorOnDynamicPage as T}from"efficient-web-builder/format/lib/document/editor-page-context";import{editorPageDrawsOtherRecord as j}from"../../render/lib/document/current-record.js";import{say as u}from"efficient-web-builder/format/lib/editor-words";import{REVIEWS_OF_CHOSEN_PRODUCT as f,REVIEWS_OF_EVERY_PRODUCT as C}from"../../render/lib/sections/reviews.js";const o={all:"",this:"@this",pick:"@pick",kept:"@kept"},a=e=>typeof e=="string"?e.trim():"",m=e=>(e??[]).filter(s=>a(s.designCode)!=="");function I(e,s,n){const l=e?.product;if(l===C)return o.all;const c=a(e?.designCode);if(l===f||!n&&c!==""){if(c==="")return o.pick;const r=m(s).find(t=>a(t.designCode)===c);return r?r.slug:o.kept}return n?o.this:o.all}function V(e){return T()&&!j({appState:e})}function W(e,s,n){const{product:l,designCode:c,...r}=n??{};if(e===o.kept)return{...n??{}};if(e===o.all)return{...r,product:C};if(e===o.this)return r;const t=e===o.pick?null:m(s).find(i=>i.slug===e);return t?{...r,product:f,designCode:a(t.designCode)}:{...r,product:f}}function H(e,s,n){return[...e?[{label:u("This product"),value:o.this}]:[],{label:u("Choose a product"),value:o.pick},...s!==null?[{label:n?s:u("{name} (unavailable)",{name:s}),value:o.kept}]:[]]}function L({value:e,onChange:s,wheels:n,categories:l,onProductPage:c,loading:r}){const t=g(()=>m(n),[n]),i=I(e,t,c),h=g(()=>t.find(d=>d.slug===i)??null,[t,i]),{category:y,setCategory:w,categoryNames:P,filtered:O}=D(t,l,h),
|
|
1
|
+
"use client";import{jsx as p,jsxs as _}from"react/jsx-runtime";import{useEffect as x,useMemo as g,useState as v}from"react";import{useProductCatalog as S}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as b}from"./useStorefrontCategories.js";import{useCategoryFilter as D}from"./useCategoryFilter.js";import F from"./CategoryProductFields.js";import{useEasel as N}from"efficient-easel/easel";import{isEditorOnDynamicPage as T}from"efficient-web-builder/format/lib/document/editor-page-context";import{editorPageDrawsOtherRecord as j}from"../../render/lib/document/current-record.js";import{say as u}from"efficient-web-builder/format/lib/editor-words";import{REVIEWS_OF_CHOSEN_PRODUCT as f,REVIEWS_OF_EVERY_PRODUCT as C}from"../../render/lib/sections/reviews.js";const o={all:"",this:"@this",pick:"@pick",kept:"@kept"},a=e=>typeof e=="string"?e.trim():"",m=e=>(e??[]).filter(s=>a(s.designCode)!=="");function I(e,s,n){const l=e?.product;if(l===C)return o.all;const c=a(e?.designCode);if(l===f||!n&&c!==""){if(c==="")return o.pick;const r=m(s).find(t=>a(t.designCode)===c);return r?r.slug:o.kept}return n?o.this:o.all}function V(e){return T()&&!j({appState:e})}function W(e,s,n){const{product:l,designCode:c,...r}=n??{};if(e===o.kept)return{...n??{}};if(e===o.all)return{...r,product:C};if(e===o.this)return r;const t=e===o.pick?null:m(s).find(i=>i.slug===e);return t?{...r,product:f,designCode:a(t.designCode)}:{...r,product:f}}function H(e,s,n){return[...e?[{label:u("This product"),value:o.this}]:[],{label:u("Choose a product"),value:o.pick},...s!==null?[{label:n?s:u("{name} (unavailable)",{name:s}),value:o.kept}]:[]]}function L({value:e,onChange:s,wheels:n,categories:l,onProductPage:c,loading:r}){const t=g(()=>m(n),[n]),i=I(e,t,c),h=g(()=>t.find(d=>d.slug===i)??null,[t,i]),{category:y,setCategory:w,categoryNames:P,filtered:O}=D(t,l,h),E=i!==o.all&&i!==o.this,R=i===o.kept,k=a(e?.designCode);return _("div",{children:[p(F,{category:y,onChange:w,categoryNames:P,allLabel:u("All categories"),categoryHidden:!E,readOnly:r,products:O,allProducts:t,product:i,onProductChange:d=>s(W(d,t,e)),productReadOnly:r,emptyLabel:r?u("Loading…"):u("All products"),extraOptions:H(c,R?k:null,r),showPicked:!0}),i===o.pick&&!r?p("p",{className:"es-field-hint",style:{marginTop:"var(--space-8)"},children:u("No product chosen yet, so reviews of every product show.")}):null]})}function U({value:e,onChange:s}){const n=N(t=>V(t.appState)),l=S(),[c,r]=v(null);return x(()=>{let t=!1;return b().then(i=>{t||r(i)}),()=>{t=!0}},[]),p(L,{value:e,onChange:s,wheels:l,categories:c,onProductPage:n,loading:l===null})}export{o as REVIEWS_PRODUCT_CHOICE,L as ReviewsProductRows,U as default,V as reviewsOnProductPage,I as reviewsProductChoice,W as reviewsSourceOptionsFor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as t}from"react/jsx-runtime";import{Button as o}from"efficient-shell/ui";import{usePreviewSocial as r}from"efficient-web-builder/render/components/PreviewSocialContext";import{say as i}from"efficient-web-builder/format/lib/editor-words";import{PanelBand as l}from"efficient-web-builder/editor/lib/document/controls";function a(){const{openPanel:n}=r();return e(t,{children:s(l,{title:i("Social links"),children:[e("p",{className:"es-field-hint
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as t}from"react/jsx-runtime";import{Button as o}from"efficient-shell/ui";import{usePreviewSocial as r}from"efficient-web-builder/render/components/PreviewSocialContext";import{say as i}from"efficient-web-builder/format/lib/editor-words";import{PanelBand as l}from"efficient-web-builder/editor/lib/document/controls";function a(){const{openPanel:n}=r();return e(t,{children:s(l,{title:i("Social links"),children:[e("p",{className:"es-field-hint",children:i("The links are typed once for the whole website, in Site settings.")}),e(o,{variant:"link",size:"sm",onClick:n,children:i("Edit social links →")})]})})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as c,jsxs as N}from"react/jsx-runtime";import{useEffect as j,useMemo as
|
|
1
|
+
"use client";import{jsx as c,jsxs as N}from"react/jsx-runtime";import{useEffect as j,useMemo as F,useState as O}from"react";import{resolveMedia as T}from"efficient-web-builder/render/lib/media";import{useEaselHost as B}from"efficient-easel/screen/lib/host";import{loadProductCatalog as H}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as M}from"./useStorefrontCategories.js";import{useCategoryFilter as R}from"./useCategoryFilter.js";import _ from"./CategoryProductFields.js";import{useSnapshotSource as z}from"efficient-web-builder/editor/components/useSnapshotSource";import W from"efficient-web-builder/editor/components/SourceStatus";import{say as t}from"efficient-web-builder/format/lib/editor-words";function p(e){return{slug:e.slug,name:e.name,process:e.process,spokes:e.spokes,mesh:e.mesh,spec:e.spec,finishes:e.finishes.map(s=>({name:s.name,image:T(s.angles?.[0]??s.src)??null}))}}function Y({value:e,onChange:s}){const f=B(),{rows:r,loading:a,refreshing:i,errored:u,refresh:g}=z({load:H,resolve:(o,n)=>o.find(l=>l.slug===n.slug),snapshot:p,value:e,onChange:s}),[h,y]=O(null);j(()=>{let o=!1;return M().then(n=>{o||y(n)}),()=>{o=!0}},[]);const d=F(()=>r&&e?.slug?r.find(o=>o.slug===e.slug)??null:null,[r,e?.slug]),{category:b,setCategory:S,categoryNames:k,filtered:x}=R(r,h,d),m=!!e?.slug&&r!==null&&!d,C=o=>{if(!o){s(null);return}const n=(r??[]).find(l=>l.slug===o);n&&s(p(n))},P=()=>{e?.slug&&f.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},w=!!e?.spec,E=u?"error":i?"loading":"idle",L=u?t("Couldn’t reach the product catalog."):i?t("Syncing from the catalog…"):m?t("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):w?t("Linked to “{name}” · every spec row follows the product.",{name:e?.name??""}):t("Linked to “{name}” — this product has no spec data yet.",{name:e?.name??""});return N("div",{children:[c(_,{category:b,onChange:S,categoryNames:k,readOnly:a,products:x,allProducts:r??[],product:e?.slug??"",onProductChange:C,productReadOnly:a,emptyLabel:a?t("Loading…"):t("None (write the rows yourself)"),extraOptions:m?[{label:t("{name} (unavailable)",{name:e.name}),value:e.slug}]:[]}),e?.slug?c(W,{status:E,statusText:L,onRefresh:g,busy:i,edit:{label:t("Edit product ✎"),onClick:P},hint:t("Every spec row (lug count, bolt pattern, offset, center bore, load rating, bump profile…) comes from the product record — edit its part numbers in the Products database and this table updates to match. You still choose which finish to picture and an optional size.")}):c("p",{className:"es-field-hint",children:t("Pick a product to fill the spec table from the catalog, or keep “None” to write the rows yourself.")})]})}export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{ColumnsIcon as d}from"efficient-easel/icons";import{text as s,textarea as e}from"efficient-web-builder/editor/lib/document/controls";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{slider as l}from"efficient-web-builder/editor/lib/document/box-fields";import{headFieldsForPlacement as a,SPLITTABLE_SECTIONS as p}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as r}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{PRODUCTGRID_PH as f}from"../../../../../../render/lib/document/blocks/commerce/placeholders.js";import{ProductGridSlots as n}from"../../../../../../render/lib/document/blocks/commerce/ProductGrid/meta.js";const C={fields:{_gHeader:o("Header"),num:s("Number",f.num),title:e("Heading",r.sectionHeading),description:e("Body",r.body),template:n.template,_gLayout:o("Layout"),columns:l("Columns",i(d,{}),2,3,1,3)},resolveFields:(t,{fields:m})=>a(m,t.props.headPlacement,p.BundleOffer.headRows)};export{C as BundleOfferFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{phoneKey as n}from"efficient-easel/draw";import{FilterIcon as O,LayoutIcon as _,MoveDownIcon as p,SortIcon as e}from"efficient-easel/icons";import{group as t}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as i}from"efficient-easel/screen/lib/document/device-fields";import{multiSelect as S,toggle as l}from"efficient-web-builder/editor/lib/document/controls";import{select as r}from"efficient-web-builder/editor/lib/document/box-fields";import{truthy as f,withRowRules as F}from"efficient-web-builder/render/lib/document/show-when";import{facetNote as L}from"../controls.js";import{FilterBlockSlots as T}from"../../../../../../render/lib/document/blocks/commerce/FilterBlock/meta.js";import{DEFAULT_FILTER_LOOK as c,DEFAULT_FILTER_LOOK_PHONE as E,DEFAULT_OPENING_SORT as I,FILTER_LOOK_OPTIONS as h,FILTER_LOOK_PHONE_OPTIONS as g,SHOWN_FILTER_OPTIONS as N}from"../../../../../../render/lib/sections/shopper-filters.js";import{PLP_SORT_LABELS as R}from"../../../../../../render/lib/wheels/plp-filters.js";const w=Object.entries(R).map(([s,m])=>({value:s,label:m})),P="follow the product type. Set them in Product types.",x={fields:F({...T,_gFilters:t("Filters shown"),filtersShown:S("Filters shown",N,"None — Product types only"),_nFieldFilters:L(["size","finish"],P),_gBehavior:t("Behavior"),showSort:l("Sort",!0,o(e,{})),openingSort:r("Opening sort",o(e,{}),w,I),filtersBelow:l("Also filters the grids below",!1,o(p,{})),_gArrangement:t("Arrangement"),look:i("desktop",r("Look",o(_,{}),h,c)),[n("look")]:i("mobile",r("Look",o(O,{}),g,E))},[[["openingSort"],f("showSort")]])};export{x as FilterBlockFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{EraserIcon as t,HashIcon as s,SortIcon as l}from"efficient-easel/icons";import{group as e}from"efficient-easel/screen/lib/document/box-fields";import{toggle as r}from"efficient-web-builder/editor/lib/document/controls";import{FilterChipsBlockSlots as i}from"../../../../../../render/lib/document/blocks/commerce/FilterChipsBlock/meta.js";const h={fields:{...i,_gDisplay:e("Display"),showCount:r("Result count",!0,o(s,{})),showClear:r("Clear all",!0,o(t,{})),showSort:r("Sort",!1,o(l,{}))}};export{h as FilterChipsBlockFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import u from"../../../../../components/GalleryProductBinding.js";import{ProductFieldIcon as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import u from"../../../../../components/GalleryProductBinding.js";import{ProductFieldIcon as s,SquareIcon as n,PlacementIcon as p}from"efficient-easel/icons";import{upload as l,text as a,linkField as c}from"efficient-web-builder/editor/lib/document/controls";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{segmented as d,select as i}from"efficient-web-builder/editor/lib/document/box-fields";import{withRowRules as g}from"efficient-web-builder/render/lib/document/show-when";const m={field:"fromProduct",is:!0},P={fields:g({_gSource:o("Content source"),fromProduct:d("Image content",e(s,{}),[{label:"Manual",value:!1},{label:"Choose a product",value:!0}],!1),product:{type:"custom",render:({value:t,onChange:r})=>e(u,{value:t,onChange:r})},_gMedia:o("Media"),image:l("Cover image","image/*"),photos:{type:"array",label:"More images",arrayFields:{src:l("Image","image/*")},getItemSummary:(t,r)=>`Image ${(r??0)+1}`},_gText:o("Text"),process:a("Tag"),eyebrow:a("Eyebrow"),name:a("Title"),meta:a("Meta"),_gLink:o("Link"),href:c("Product link"),ratio:i("Shape",e(n,{}),[{label:"Square",value:"square"},{label:"Wide (2:1)",value:"wide"},{label:"Landscape (4:3)",value:"landscape"},{label:"Portrait (4:5)",value:"portrait"},{label:"The photo's own shape",value:"auto"}],"square"),captionPlace:i("Card text",e(p,{}),[{label:"On the photo",value:"overlay"},{label:"Below the photo",value:"below"}],"overlay")},[[["_gMedia","image","photos","_gText","process","eyebrow","name","meta","_gLink","href"],{not:m}],[["product"],m]])};export{P as GalleryItemFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t={fields:{}};export{t as ProductBuyButtonFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import A from"../../../../../components/CategorySource.js";import{headerKeysOfPlace as G,LAYOUT_FIELD_KEYS as N,SECTION_THEME_FIELD_KEYS as k,SECTION_SHAPE_FIELD_KEYS as w,SECTION_ANIM_FIELD_KEYS as y}from"efficient-web-builder/editor/lib/document/field-groups";import{TITLE_SIZES as H}from"../../../../../../render/components/ProductGridSection.js";import{DEFAULT_TITLE_SIZE as b}from"../../../../../../render/lib/sections/product-grid-title.js";import{TextSizeIcon as x,ColumnsIcon as l,ListIcon as M,HashIcon as d,PageIcon as B}from"efficient-easel/icons";import{toggle as K,text as p,textarea as a,sourceField as Y,linkField as j,containerGapRows as u,spacingFields as z}from"efficient-web-builder/editor/lib/document/controls";import{VIEW_KEY_ACCESS as W,group as e,phoneTwinFields as _}from"efficient-easel/screen/lib/document/box-fields";import{PRODUCT_GRID_COLUMNS as r,PRODUCT_GRID_PHONE_COLUMNS as i,PRODUCT_GRID_TABLET_COLUMNS as P,builtInTabletColumns as Z}from"../../../../../../render/lib/sections/product-grid-columns.js";import{select as E,slider as t}from"efficient-web-builder/editor/lib/document/box-fields";import{isEditorOnDynamicPage as v}from"efficient-web-builder/format/lib/document/editor-page-context";import{productKindsField as V}from"../shared-fields.js";import{ALL_PRODUCTS_SLUG as q}from"../../../../../../render/lib/wheels/grid-source.js";import{headFieldsForPlacement as J,SPLITTABLE_SECTIONS as Q}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as f}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{slotRowsField as X}from"efficient-web-builder/editor/lib/document/blocks/shared-fields";import{PRODUCTGRID_PH as T}from"../../../../../../render/lib/document/blocks/commerce/placeholders.js";import{DEFAULT_MORE_PRODUCTS as $,DEFAULT_PER_PAGE as oo,MORE_PRODUCTS_OPTIONS as to,PER_PAGE_RANGE as m}from"../../../../../../render/lib/sections/product-grid-pages.js";import{truthy as c,withRowRules as O}from"efficient-web-builder/render/lib/document/show-when";import{BOUND_TO_THE_RECORD as eo,OFF_DYNAMIC_PAGE as S}from"../page-rules.js";import{ProductGridSlots as I}from"../../../../../../render/lib/document/blocks/commerce/ProductGrid/meta.js";const R=z({top:120,keys:{top:"padTop",bottom:"padBottom"},group:!1,only:"top"}),ro=new Set([...G("Content"),"_gProducts","source","_gHeader","num","title","titleSize","description","_gLayout","columns","columnsTablet","columnsPhone","limit",...Object.keys(u("ProductGrid")),"template",...Object.keys(R),...N,...k,...w,...y]),io={not:eo},C={field:"moreProducts",is:"pages"},L=t("Columns",o(l,{}),r.min,r.max,1,r.fallback),{columns:so,columnsTablet:no}=_("columns",L,W,{phoneRow:t("Columns",o(l,{}),P.min,P.max,1,r.fallback,"",{clear:{phoneFollows:!1,hint:s=>Z(s.follows)}})}),{columnsPhone:lo}=_("columns",L,void 0,{phoneRow:t("Columns",o(l,{}),i.min,i.max,1,i.min,"",{clear:{phoneFollows:!1,hint:i.min}})}),mo={columns:so,columnsTablet:no,columnsPhone:lo},No={fields:O({_gHeader:e("Header"),num:p("Number",T.num),title:a("Heading",f.sectionHeading),titleSize:E("Heading size",o(x,{}),H,b),description:a("Body",f.body),_gProducts:e("Products"),source:Y(A),kinds:V(),productList:X("ProductGrid"),products:I.products,template:I.template,_gLink:e("Link"),linkText:p("Button",T.link),linkHref:j("Link"),_gLayout:e("Grid"),...mo,moreProducts:E("More products",o(B,{}),to,$),perPage:t("Products per page",o(d,{}),m.min,m.max,m.step,oo),showAll:K("Show all items",!1,o(M,{})),limit:t("Items to display",o(d,{}),1,12,1,8),...u("ProductGrid"),...R},[[["kinds"],{field:"source.slug",is:q}],[["products","productList"],{not:c("source.slug")}],[["limit"],{any:[S,{not:c("showAll")}]}],[["perPage"],C],[["showAll","limit"],{not:C}],[["linkHref"],{any:[S,{not:c("linkText.hidden")}]}]]),resolveFields:(s,{fields:D,parent:co})=>{const g=D,h=s.props,n=J(g,h.headPlacement,Q.ProductGrid.headRows);if(!v())return n;const F=Object.keys(n).filter(U=>!ro.has(U));return O(n,[[F,io]])}};export{No as ProductGridFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{HeightIcon as t}from"efficient-easel/icons";import{segmented as i}from"efficient-web-builder/editor/lib/document/box-fields";import{say as s}from"efficient-web-builder/format/lib/editor-words";import{withHint as m}from"../controls.js";const h={fields:{fixedHeight:m(i("Name height",e(t,{}),[{label:"Always 2 lines",value:!0},{label:"Fit the name",value:!1}],!0),s("Always 2 lines keeps every name in a row the same height. Fit the name uses only the lines the name needs."))}};export{h as ProductNameFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cardMediaFields as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{BlockLayeredImagesIcon as t,CropIcon as r}from"efficient-easel/icons";import{cardMediaFields as o,cardStyleFields as i}from"efficient-web-builder/editor/lib/document/controls";import{segmented as s,select as l}from"efficient-web-builder/editor/lib/document/box-fields";import{say as d}from"efficient-web-builder/format/lib/editor-words";import{withHint as m}from"../controls.js";import{DEFAULT_PICTURE_FRAME as a}from"../../../../../../render/components/card-pieces/CardProductPicture.js";import{SET_PICTURE_DEFAULT as c,SET_PICTURE_POINTS as p}from"../../../../../../render/lib/wheels/set-mode.js";const{indexBadge:n,showBadge:f}=i(),u=[{label:"Inset",value:"well"},{label:"Fill to edges",value:"full"}],S={fields:{...o(),frame:m(l("Picture fit",e(r,{}),u,a),d("Inset keeps the picture inside the card with space around it. Fill to edges runs it to the card's edges.")),setPicture:s("Set picture",e(t,{}),[...p],c),indexBadge:n,showBadge:f}};export{S as ProductPictureFields};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import type { CustomField } from "efficient-web-builder/editor/lib/document/controls";
|
|
2
3
|
import type { CatalogFilterFacet } from "../../../../../render/lib/content/catalog-filter-labels.js";
|
|
3
4
|
export declare function FacetSwitchRow({ facet, fallback, value, onChange, fieldId, }: {
|
|
@@ -13,3 +14,6 @@ export declare function FacetNoteLine({ facets, rest }: {
|
|
|
13
14
|
facets: readonly CatalogFilterFacet[];
|
|
14
15
|
rest: string;
|
|
15
16
|
}): import("react").JSX.Element;
|
|
17
|
+
export declare function withHint<F extends {
|
|
18
|
+
render: (props: never) => ReactNode;
|
|
19
|
+
}>(field: F, hint: string): F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as l}from"react/jsx-runtime";import{cloneElement as u,isValidElement as d}from"react";import{useCatalogFilterLabels as s}from"../../../../../render/components/catalog/CatalogFilterLabels.js";import{SettingsField as c,SettingsSwitch as b}from"efficient-easel/panel";import{PanelNoteLine as g}from"efficient-web-builder/editor/lib/document/controls";import{say as m}from"efficient-web-builder/format/lib/editor-words";function h({facet:e,fallback:t,value:r,onChange:n,fieldId:o}){const f=s()[e],p=typeof r=="boolean"?r:t,i=`${o}-label`;return l(c,{label:f,labelId:i,action:l(b,{checked:p,onChange:n,ariaLabelledBy:i})})}function C(e,t){return{type:"custom",render:({value:r,onChange:n,id:o,name:a})=>l(h,{facet:e,fallback:t,value:r,onChange:n,fieldId:String(o??a??e)})}}function I(e,t){return{type:"custom",render:()=>l(x,{facets:e,rest:t})}}function x({facets:e,rest:t}){const r=s(),n=e.map(a=>r[a]),o=n.length>1?m("{list} and {last}",{list:n.slice(0,-1).join(", "),last:n[n.length-1]}):n.join("");return l(g,{text:t.includes("{names}")?m(t,{names:o}):`${o} ${t}`})}function N(e,t){const r=e.render;return{...e,render:n=>{const o=r(n);return d(o)&&o.type===c?u(o,{hint:t}):o}}}export{x as FacetNoteLine,h as FacetSwitchRow,I as facetNote,C as facetToggle,N as withHint};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const commerceBlocks: Record<"
|
|
1
|
+
export declare const commerceBlocks: Record<"FilterBlock" | "FilterChipsBlock" | "ProductGrid" | "AlloyWheelsListing" | "CatalogFilterBar" | "StockFitment" | "ProductPrice" | "ProductEyebrow" | "ProductName" | "Gallery" | "GalleryB" | "Header" | "ProductHero" | "ProductPicture" | "ProductSpecs" | "ProductBuy" | "ProductColour" | "ProductSize" | "SpecTable" | "DetailRows" | "RelatedProducts" | "BundleOffer" | "SearchBlock" | "CountrySwitchBlock" | "ThemeSwitchBlock" | "AccountBlock" | "CartBlock" | "Collections" | "CollectionCard" | "ProductRef" | "GalleryItem" | "CompatibleTyres" | "DeliveryOptions" | "FitmentFinder" | "FitmentTable" | "ProductBuyButton" | "TyreFitment" | "TyreSizes" | "EuTyreLabel" | "CheckoutCTA" | "EuTyreLabelBlock" | "ProductGallery" | "FitmentPicker", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{assembleBlocks as
|
|
1
|
+
import{assembleBlocks as o}from"efficient-web-builder/format/lib/document/blocks/block-types";import{AccountBlockFields as r}from"./AccountBlock/fields.js";import{AlloyWheelsListingFields as e}from"./AlloyWheelsListing/fields.js";import{BundleOfferFields as i}from"./BundleOffer/fields.js";import{CartBlockFields as t}from"./CartBlock/fields.js";import{CatalogFilterBarFields as l}from"./CatalogFilterBar/fields.js";import{CheckoutCTAFields as m}from"./CheckoutCTA/fields.js";import{CollectionCardFields as d}from"./CollectionCard/fields.js";import{CollectionsFields as c}from"./Collections/fields.js";import{CompatibleTyresFields as s}from"./CompatibleTyres/fields.js";import{CountrySwitchBlockFields as F}from"./CountrySwitchBlock/fields.js";import{DeliveryOptionsFields as p}from"./DeliveryOptions/fields.js";import{DetailRowsFields as f}from"./DetailRows/fields.js";import{EuTyreLabelFields as u}from"./EuTyreLabel/fields.js";import{EuTyreLabelBlockFields as a}from"./EuTyreLabelBlock/fields.js";import{FitmentFinderFields as P}from"./FitmentFinder/fields.js";import{FitmentPickerFields as n}from"./FitmentPicker/fields.js";import{FitmentTableFields as y}from"./FitmentTable/fields.js";import{GalleryFields as B}from"./Gallery/fields.js";import{GalleryBFields as C}from"./GalleryB/fields.js";import{GalleryItemFields as k}from"./GalleryItem/fields.js";import{HeaderFields as S}from"./Header/fields.js";import{ProductGalleryFields as T}from"./ProductGallery/fields.js";import{ProductGridFields as h}from"./ProductGrid/fields.js";import{ProductHeroFields as b}from"./ProductHero/fields.js";import{ProductRefFields as E}from"./ProductRef/fields.js";import{RelatedProductsFields as G}from"./RelatedProducts/fields.js";import{SearchBlockFields as R}from"./SearchBlock/fields.js";import{SpecTableFields as w}from"./SpecTable/fields.js";import{ThemeSwitchBlockFields as L}from"./ThemeSwitchBlock/fields.js";import{TyreFitmentFields as A}from"./TyreFitment/fields.js";import{TyreSizesFields as D}from"./TyreSizes/fields.js";import{ProductSizeFields as O}from"./ProductSize/fields.js";import{ProductColourFields as g}from"./ProductColour/fields.js";import{ProductBuyButtonFields as z}from"./ProductBuyButton/fields.js";import{ProductPriceFields as H}from"./ProductPrice/fields.js";import{FilterBlockFields as M}from"./FilterBlock/fields.js";import{FilterChipsBlockFields as I}from"./FilterChipsBlock/fields.js";import{StockFitmentFields as N}from"./StockFitment/fields.js";import{ProductPictureFields as v}from"./ProductPicture/fields.js";import{ProductSpecsFields as W}from"./ProductSpecs/fields.js";import{ProductBuyFields as _}from"./ProductBuy/fields.js";import{ProductEyebrowFields as x}from"./ProductEyebrow/fields.js";import{ProductNameFields as j}from"./ProductName/fields.js";import{COMMERCE_RENDERS as q}from"../../../../../render/lib/document/blocks/commerce/renders.js";const J={AccountBlock:r,AlloyWheelsListing:e,BundleOffer:i,CartBlock:t,CatalogFilterBar:l,CheckoutCTA:m,CollectionCard:d,Collections:c,CompatibleTyres:s,CountrySwitchBlock:F,DeliveryOptions:p,DetailRows:f,EuTyreLabel:u,EuTyreLabelBlock:a,FitmentFinder:P,FitmentTable:y,Gallery:B,GalleryB:C,GalleryItem:k,Header:S,ProductGallery:T,ProductGrid:h,ProductHero:b,ProductRef:E,RelatedProducts:G,SearchBlock:R,SpecTable:w,ThemeSwitchBlock:L,TyreFitment:A,TyreSizes:D,ProductSize:O,ProductColour:g,ProductPrice:H,ProductBuyButton:z,FilterBlock:M,FilterChipsBlock:I,FitmentPicker:n,StockFitment:N,ProductPicture:v,ProductSpecs:W,ProductBuy:_,ProductEyebrow:x,ProductName:j},No=o(q,J);export{No as commerceBlocks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l,Fragment as Y,jsxs as j}from"react/jsx-runtime";import{assignSectionGroups as L,reseatBucketTabs as O}from"efficient-web-builder/editor/lib/document/field-groups";import{buildBlockCategories as q}from"efficient-web-builder/format/lib/document/section-catalog";import{FONT_ROLES as z,FONT_ROLE_LABELS as V}from"efficient-web-builder/format/lib/fonts";import{CONTAINER_DIRECTION_LABELS as C}from"efficient-web-builder/format/lib/content/container-direction";import{SITE_FOOTER_TYPE as X,SITE_HEADER_TYPE as Q}from"efficient-web-builder/format/lib/document/section-groups";import J from"../../components/MenuLinkRangeField.js";import Z from"../../components/EditorPreviewChat.js";import $ from"../../components/EditorPreviewSurface.js";import{isSystemPageSlug as ee,POPUP_DAYS_RANGE as R,POPUP_DELAY_RANGE as A,POPUP_HIDE_AFTER as te,POPUP_SCROLL_RANGE as v,POPUP_SHOW_ON as oe,POPUP_TRIGGERS as w,SUBSCRIBE_POPUP_DEFAULTS as re,SUBSCRIBE_POPUP_KIND as ie}from"efficient-web-builder/format/lib/content/subscribe";import{shownForOption as b,withRowRules as ae,withShowWhen as h}from"efficient-web-builder/render/lib/document/show-when";import{POPUP_KIND_PROP as le,POPUP_TEXT_KIND_LABELS as D,POPUP_TEXT_KINDS as ne}from"efficient-web-builder/format/lib/popup/text-kinds";import{loadPages as se}from"efficient-web-builder/editor/components/StorefrontLinkField";import{pagePath as ce}from"../../../render/lib/links/link-rules.js";import{getEditorSiteId as me}from"efficient-web-builder/render/lib/editor-site";import{CART_DRAWER_DEFAULTS as ue,CART_DRAWER_KIND as T}from"efficient-web-builder/format/lib/content/cart-drawer";import{POPUP_PAGE_KIND as I}from"efficient-web-builder/format/lib/popup/look";import{popupLookFields as de}from"./popup-look-fields.js";import{CONSENT_BANNER_KIND as N}from"efficient-web-builder/format/lib/content/consent-banner";import{consentBannerLayoutField as pe}from"../../components/ConsentBannerLayoutTiles.js";import{CategoryIcon as ge,CheckIcon as Pe,ClockIcon as B,ColumnsIcon as fe,DirectionIcon as be,EyeIcon as Se,ListIcon as ye,PageIcon as he,PlacementIcon as Te,ScrollPointIcon as Be,TabsIcon as ke,TriggerIcon as Ee}from"efficient-easel/icons";import{deviceField as x}from"efficient-easel/screen/lib/document/device-fields";import{FieldGlyph as _e}from"efficient-web-builder/editor/components/FieldGlyph";import{DisplayRow as Fe,multiSelect as Le,panelNote as Oe,plainText as a,plainTextarea as p,sectionShapeFields as Ce,sectionThemeFields as Re,textList as k,toggle as H}from"efficient-web-builder/editor/lib/document/controls";import{group as c}from"efficient-easel/screen/lib/document/box-fields";import{segmented as g,select as M,slider as E}from"efficient-web-builder/editor/lib/document/box-fields";import{blockAlignRow as Ae}from"./block-align-row.js";import{formPicker as ve}from"./blocks/service/controls.js";import{SECTION_THEME_FOLLOW_LABEL as we}from"efficient-web-builder/editor/components/SectionThemePicker";import{nestedAccentValue as De}from"efficient-web-builder/format/lib/content/section-surface";import{isEditorOnDynamicPage as Ie}from"efficient-web-builder/format/lib/document/editor-page-context";import{TEMPLATE_PRODUCT_TYPE_PROP as Ne}from"efficient-web-builder/format/lib/content/product-page";import{PRODUCT_KIND_OPTIONS as xe}from"../../../render/lib/catalog/plp-item.js";import{PH as _}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{textKindGlyph as He}from"efficient-web-builder/editor/lib/document/blocks/shared-fields";import"../efficient-backend.js";import"../../../render/lib/document/slot-seeds.js";import"../../../render/lib/document/card-templates.js";import"../../../render/lib/document/section-to-box-rows-reviews.js";import"../../../render/lib/document/section-to-box-rows-spec.js";import"../../../render/lib/document/section-to-box-rows-detail.js";import"./section-text-regions.js";import{generalBlocks as e}from"efficient-web-builder/editor/lib/document/blocks/general/index";import{commerceBlocks as t}from"./blocks/commerce/index.js";import{serviceBlocks as i}from"./blocks/service/index.js";import{EditorThemedBody as Me,suppressPreviewNav as Ge}from"efficient-web-builder/editor/lib/document/page-root";import Ue from"../../components/HeaderSection.js";import{addPageBlocksFromFooter as Ke,PAGE_MENU_DIRECTION_DEFAULT as F}from"../../../render/lib/document/footer-page-blocks.js";import{MENU_STYLE_PLAIN as G,MENU_STYLE_TABS as U}from"../../../render/components/FooterMenu.js";import{drawPopupPage as We,drawPublishedStorefrontRoot as Ye,drawSystemPage as je,StorefrontPageProviders as qe}from"../../../render/lib/document/storefront-root.js";import{GENERAL_ROOT_FIELDS as ze}from"efficient-web-builder/editor/lib/document/page-root-fields";import{finishRegistry as Ve}from"efficient-web-builder/editor/lib/document/registry";const Xe="Newsletter (built in)",Qe=[{id:"currentPage",label:"Current page"}],ao=[{value:"00",label:_.label},{value:"00",label:_.label},{value:"00",label:_.label}],r=re,P={field:"autoOpen",is:!0},Je={all:[b("hideAfter",te,r.hideAfter,["days"]),{not:{all:[{field:"hideAfter",is:null,default:null},{field:"oncePerSession",in:[!0,!1]}]}}]},Ze=[[["trigger","showOn","hideAfter"],P],[["autoOpenDelaySec"],{all:[P,b("trigger",w,r.trigger,["delay","exit"])]}],[["scrollPercent"],{all:[P,b("trigger",w,r.trigger,["scroll"])]}],[["showOnPages"],{all:[P,b("showOn",oe,r.showOn,["chosen"])]}],[["hideDays"],{all:[P,Je]}]],$e=ae({formSlug:ve(void 0,Xe),_gLeft:c("Left panel"),metaLabel:a("Meta label",r.metaLabel),issueLabel:a("Issue label",r.issueLabel),issueNumber:a("Issue number",r.issueNumber),kicker:a("Eyebrow",r.kicker),heading:p("Heading",r.heading),deck:p("Deck",r.deck),stats:{type:"array",label:"Stats",arrayFields:{label:a("Label"),value:a("Value")},getItemSummary:o=>o?.label||o?.value||"Stat"},_gForm:c("Right panel · form"),formLabel:a("Section label",r.formLabel),formHeading:a("Heading",r.formHeading),formIntro:p("Intro",r.formIntro),firstNameLabel:a("First-name label",r.firstNameLabel),firstNamePlaceholder:a("First-name placeholder",r.firstNamePlaceholder),emailLabel:a("Email label",r.emailLabel),emailPlaceholder:a("Email placeholder",r.emailPlaceholder),_gChoices:c("Right panel · choices"),interestsLabel:a("Interests label",r.interestsLabel),interests:k("Interest chips",l(_e,{noun:"tag"}),"Chip label","verbatim"),frequencyLabel:a("Frequency label",r.frequencyLabel),frequencies:k("Frequency options",l(ye,{}),"Option label","verbatim"),_gActions:c("Right panel · actions"),submitText:a("Submit button",r.submitText),finePrint:a("Fine print",r.finePrint),dismissText:a("Dismiss link",r.dismissText),emailInvalidText:a("Invalid-email error",r.emailInvalidText),submitErrorText:a("Submit-failed error",r.submitErrorText),_gSuccess:c("Success state"),successHeading:a("Heading",r.successHeading),successBody:p("Message",r.successBody),keepBrowsingText:a("Dismiss button",r.keepBrowsingText),...Re(De,we),...Ce(),_gTextStyle:c("Text style"),...Object.fromEntries(ne.map(o=>[le[o],M(D[o],He(D[o]),[{label:"Popup's own",value:""},...z.map(n=>({label:V[n],value:n}))],"")])),_gBehaviour:c("Behavior"),autoOpen:H("Show by itself",r.autoOpen,l(Se,{})),trigger:g("Trigger",l(Ee,{}),[{label:"Delay",value:"delay"},{label:"Scroll",value:"scroll"},{label:"Exit",value:"exit"}],r.trigger),autoOpenDelaySec:E("Delay",l(B,{}),A.min,A.max,1,r.autoOpenDelaySec,"s"),scrollPercent:E("Scroll",l(Be,{}),v.min,v.max,5,r.scrollPercent,"%"),showOn:g("Pages",l(he,{}),[{label:"All",value:"all"},{label:"Chosen",value:"chosen"}],r.showOn),showOnPages:Le("Chosen pages",[],"None"),hideAfter:g("After close",l(B,{}),[{label:"This visit",value:"visit"},{label:"Days",value:"days"},{label:"Never",value:"never"}],r.hideAfter),hideDays:E("Days",l(B,{}),R.min,R.max,1,r.hideDays),_gArrangement:c("Arrangement"),formSide:g("Form side",l(Te,{}),[{label:"Right",value:"right"},{label:"Left",value:"left"}],r.formSide),_gPhone:x("mobile",c("On a phone")),valuePanelOnPhone:x("mobile",H("Left panel",r.valuePanelOnPhone,l(fe,{})))},Ze),K=L($e,"SubscribePopup");async function et(){return(await se(me()??"")).filter(n=>!ee(n.slug)).map(n=>({label:n.label,value:ce(n.slug)}))}async function tt(){return O({...K,showOnPages:{...K.showOnPages,options:await et().catch(()=>[])}})}const u=ue,ot={_gHeader:c("Header"),kickerBadge:a("Eyebrow badge",u.kickerBadge),kickerText:a("Eyebrow text",u.kickerText),titleLead:a("Heading",u.titleLead),titleAccent:a("Heading accent",u.titleAccent),subtitleEmpty:p("Sub-line · empty",u.subtitleEmpty),subtitleOne:p("Sub-line · one set",u.subtitleOne),subtitleMany:p("Sub-line · several sets",u.subtitleMany,"{count} becomes the number of sets"),_gStatus:c("Status rail"),leadTimeValue:a("Lead time",u.leadTimeValue),shipsToFallback:a("Ships to · fallback",u.shipsToFallback,"Shown only while the site serves no countries — otherwise the site's default country is stated"),_gPromises:c("Promise row"),promises:k("Trust markers",l(Pe,{}),"Marker","verbatim"),_gEmpty:c("Empty basket"),emptyKicker:a("Eyebrow",u.emptyKicker),emptyBody:p("Message",u.emptyBody)},W=(o,n,m)=>O({...o,...L(de(n),m)}),rt=W(ot,T,"CartDrawer"),it={layout:pe,_nConsentWhere:Oe("The banner's words follow each visitor's country. Turn consent on or off, and pick the privacy page, in Admin › Storefront › Marketing › Privacy.")};function at({kind:o}){return l("div",{style:{padding:"14px 18px",fontFamily:"var(--font-mono, monospace)",fontSize:12,letterSpacing:"0.18em",textTransform:"uppercase",color:"var(--fg-dim)",borderBottom:"1px solid var(--site-line)"},children:o===T?"This is the cart drawer — edit its copy in the Settings panel →":o===N?"This is the cookie banner — pick its layout in the Settings panel →":"This is the site popup — edit it in the Settings panel →"})}const f={root:{fields:{...ze},resolveFields:async(o,{fields:n})=>{if(o?.props?.kind===ie)return tt();if(o?.props?.kind===I)return W(n,I,"PopupPage");if(o?.props?.kind===T)return rt;if(o?.props?.kind===N)return it;const m=n;return Ie()?{[Ne]:M("Product type",l(ge,{}),xe,"alloy-wheel"),...m}:m},render:o=>{const{editor:n,pageBackground:m,theme:s,fonts:d}=o;if(!n?.isEditing)return Ye(o);const S=je(o,l(at,{kind:o.kind}));if(S)return S;const y=We(o,!0);return l(Me,{propsTheme:s,propsFonts:d,pageBackground:typeof m=="string"?m:void 0,suppressPreviewNav:Ge,overlay:j(Y,{children:[l(Z,{}),l($,{})]}),children:y??l(qe,{rootProps:o,children:o.children})})}},categories:q(),components:{Heading:e.Heading,Text:e.Text,Eyebrow:e.Eyebrow,ImageBlock:e.ImageBlock,LogoBlock:e.LogoBlock,ButtonBlock:e.ButtonBlock,Spacer:e.Spacer,Divider:e.Divider,Grid:e.Grid,Flex:e.Flex,Breadcrumb:e.Breadcrumb,Masthead:e.Masthead,CategoryBar:e.CategoryBar,FeaturedCover:e.FeaturedCover,LongRead:e.LongRead,Series:e.Series,Subscribe:i.Subscribe,SubscribeBlogs:i.SubscribeBlogs,Banner:e.Banner,ParagraphsA:e.ParagraphsA,StatsParagraph:e.StatsParagraph,Timeline:e.Timeline,Footprint:e.Footprint,TimelineTrack:e.TimelineTrack,TitleWithButtons:e.TitleWithButtons,Stats:e.Stats,Integrations:e.Integrations,Mockup:e.Mockup,Chart:e.Chart,KeyFeatures:e.KeyFeatures,Testimonials:e.Testimonials,Reviews:i.Reviews,RatingBlock:i.RatingBlock,Prose:e.Prose,Cards:e.Cards,Logos:e.Logos,Ticker:e.Ticker,ContactRouting:i.ContactRouting,ContactLocations:e.ContactLocations,HeroSingle:e.HeroSingle,Hero:e.Hero,HeroSlide:e.HeroSlide,HeroGroup:e.HeroGroup,Collections:t.Collections,CollectionCard:t.CollectionCard,Events:i.Events,RateTable:i.RateTable,MessagingCards:i.MessagingCards,ContactCards:i.ContactCards,OpeningHours:i.OpeningHours,PostCard:e.PostCard,DocMetaCards:e.DocMetaCards,DocTabs:e.DocTabs,DocMasthead:e.DocMasthead,DocBody:e.DocBody,Contents:e.Contents,FAQ:e.FAQ,Gallery:t.Gallery,GalleryB:t.GalleryB,SpecStrip:e.SpecStrip,GalleryItem:t.GalleryItem,Manifesto:e.Manifesto,SectionHeader:e.SectionHeader,IntroBleed:e.IntroBleed,Split:e.Split,SubmitBuild:i.SubmitBuild,SubmitBox:i.SubmitBox,ReviewForm:i.ReviewForm,Form:i.Form,AppointmentBooking:i.AppointmentBooking,BookingBox:i.BookingBox,CatalogFilterBar:t.CatalogFilterBar,AlloyWheelsListing:t.AlloyWheelsListing,ProductGrid:t.ProductGrid,ProductHero:t.ProductHero,ProductGallery:t.ProductGallery,SpecTable:t.SpecTable,ProcessSteps:e.ProcessSteps,DetailRows:t.DetailRows,FitmentTable:t.FitmentTable,RelatedProducts:t.RelatedProducts,BundleOffer:t.BundleOffer,CompatibleTyres:t.CompatibleTyres,TyreSizes:t.TyreSizes,TyreFitment:t.TyreFitment,EuTyreLabel:t.EuTyreLabel,EuTyreLabelBlock:t.EuTyreLabelBlock,ProductSize:t.ProductSize,ProductColour:t.ProductColour,ProductPrice:t.ProductPrice,ProductPicture:t.ProductPicture,ProductSpecs:t.ProductSpecs,ProductBuy:t.ProductBuy,ProductEyebrow:t.ProductEyebrow,ProductName:t.ProductName,FitmentFinder:t.FitmentFinder,FitmentPicker:t.FitmentPicker,StockFitment:t.StockFitment,OrderSummary:e.OrderSummary,DeliveryOptions:t.DeliveryOptions,PaymentBadges:e.PaymentBadges,CheckoutCTA:t.CheckoutCTA,ProductRef:t.ProductRef,CustomHTML:e.CustomHTML,CardList:e.CardList,Header:t.Header,Footer:i.Footer,FooterLogo:i.FooterLogo,FooterMenu:i.FooterMenu,ArticleBody:i.ArticleBody,MenuLinkBlock:i.MenuLinkBlock,FooterDivider:i.FooterDivider,FooterGroup:i.FooterGroup,FooterText:i.FooterText,FooterEmailSignup:i.FooterEmailSignup,FooterSocial:i.FooterSocial,FooterMessaging:i.FooterMessaging,FooterPayment:i.FooterPayment,LegalLineBlock:i.LegalLineBlock,SearchBlock:t.SearchBlock,CartBlock:t.CartBlock,CountrySwitchBlock:t.CountrySwitchBlock,AccountBlock:t.AccountBlock,ThemeSwitchBlock:t.ThemeSwitchBlock,[Q]:i.SiteHeader,[X]:i.SiteFooter}};Ke(f.components);{const o=f.components.MenuBlock;o.fields={...o.fields,direction:g("Direction",l(be,{}),[{label:C.column,value:"column"},{label:C.row,value:"row"}],F)};const n={type:"custom",render:({value:s,onChange:d})=>l(J,{value:s,onChange:d})},m=h({type:"custom",render:({value:s,onChange:d})=>l(Fe,{parts:Qe,changed:s===!0,shown:()=>s===!0,onPress:(S,y)=>d(y),onReset:()=>d(void 0)})},{not:{field:"direction",is:"column",default:F}});o.fields=Object.fromEntries(Object.entries(o.fields).flatMap(([s,d])=>s==="menu"?[[s,d],["linkRange",n],["currentPage",m]]:[[s,d]])),o.fields={...o.fields,linkAlign:Ae({label:"Link alignment"}),menuStyle:h(g("Menu style",l(ke,{}),[{label:"Plain",value:G},{label:"Tabs",value:U}],G),{not:{field:"direction",is:"column",default:F}})};for(const s of["linkRange","linkAlign"])o.fields[s]=h(o.fields[s],{not:{field:"menuStyle",is:U}})}{const o=f.components.Header,n=o.render;o.render=m=>m.editor?.isEditing?l(Ue,{editing:!0}):n(m)}const lt=Ve(f),lo=lt.sectionGroupAllow;var no=f;export{lo as SECTION_GROUP_ALLOW,f as config,no as default,$e as subscribePopupFields};
|
|
1
|
+
import{jsx as l,Fragment as Y,jsxs as j}from"react/jsx-runtime";import{assignSectionGroups as L,reseatBucketTabs as O}from"efficient-web-builder/editor/lib/document/field-groups";import{buildBlockCategories as q}from"efficient-web-builder/format/lib/document/section-catalog";import{FONT_ROLES as z,FONT_ROLE_LABELS as V}from"efficient-web-builder/format/lib/fonts";import{CONTAINER_DIRECTION_LABELS as C}from"efficient-web-builder/format/lib/content/container-direction";import{SITE_FOOTER_TYPE as X,SITE_HEADER_TYPE as Q}from"efficient-web-builder/format/lib/document/section-groups";import J from"../../components/MenuLinkRangeField.js";import Z from"../../components/EditorPreviewChat.js";import $ from"../../components/EditorPreviewSurface.js";import{isSystemPageSlug as ee,POPUP_DAYS_RANGE as R,POPUP_DELAY_RANGE as A,POPUP_HIDE_AFTER as te,POPUP_SCROLL_RANGE as v,POPUP_SHOW_ON as oe,POPUP_TRIGGERS as w,SUBSCRIBE_POPUP_DEFAULTS as re,SUBSCRIBE_POPUP_KIND as ie}from"efficient-web-builder/format/lib/content/subscribe";import{shownForOption as b,withRowRules as ae,withShowWhen as h}from"efficient-web-builder/render/lib/document/show-when";import{POPUP_KIND_PROP as le,POPUP_TEXT_KIND_LABELS as D,POPUP_TEXT_KINDS as ne}from"efficient-web-builder/format/lib/popup/text-kinds";import{loadPages as se}from"efficient-web-builder/editor/components/StorefrontLinkField";import{pagePath as ce}from"../../../render/lib/links/link-rules.js";import{getEditorSiteId as me}from"efficient-web-builder/render/lib/editor-site";import{CART_DRAWER_DEFAULTS as ue,CART_DRAWER_KIND as T}from"efficient-web-builder/format/lib/content/cart-drawer";import{POPUP_PAGE_KIND as I}from"efficient-web-builder/format/lib/popup/look";import{popupLookFields as de}from"./popup-look-fields.js";import{CONSENT_BANNER_KIND as N}from"efficient-web-builder/format/lib/content/consent-banner";import{consentBannerLayoutField as pe}from"../../components/ConsentBannerLayoutTiles.js";import{CategoryIcon as ge,CheckIcon as Pe,ClockIcon as B,ColumnsIcon as fe,DirectionIcon as be,EyeIcon as Se,ListIcon as ye,PageIcon as he,PlacementIcon as Te,ScrollPointIcon as Be,TabsIcon as ke,TriggerIcon as Ee}from"efficient-easel/icons";import{deviceField as x}from"efficient-easel/screen/lib/document/device-fields";import{FieldGlyph as Fe}from"efficient-web-builder/editor/components/FieldGlyph";import{DisplayRow as _e,multiSelect as Le,panelNote as Oe,plainText as a,plainTextarea as p,sectionShapeFields as Ce,sectionThemeFields as Re,textList as k,toggle as H}from"efficient-web-builder/editor/lib/document/controls";import{group as c}from"efficient-easel/screen/lib/document/box-fields";import{segmented as g,select as M,slider as E}from"efficient-web-builder/editor/lib/document/box-fields";import{blockAlignRow as Ae}from"./block-align-row.js";import{formPicker as ve}from"./blocks/service/controls.js";import{SECTION_THEME_FOLLOW_LABEL as we}from"efficient-web-builder/editor/components/SectionThemePicker";import{nestedAccentValue as De}from"efficient-web-builder/format/lib/content/section-surface";import{isEditorOnDynamicPage as Ie}from"efficient-web-builder/format/lib/document/editor-page-context";import{TEMPLATE_PRODUCT_TYPE_PROP as Ne}from"efficient-web-builder/format/lib/content/product-page";import{PRODUCT_KIND_OPTIONS as xe}from"../../../render/lib/catalog/plp-item.js";import{PH as F}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{textKindGlyph as He}from"efficient-web-builder/editor/lib/document/blocks/shared-fields";import"../efficient-backend.js";import"../../../render/lib/document/slot-seeds.js";import"../../../render/lib/document/card-templates.js";import"../../../render/lib/document/section-to-box-rows-reviews.js";import"../../../render/lib/document/section-to-box-rows-spec.js";import"../../../render/lib/document/section-to-box-rows-detail.js";import"./section-text-regions.js";import{generalBlocks as e}from"efficient-web-builder/editor/lib/document/blocks/general/index";import{commerceBlocks as t}from"./blocks/commerce/index.js";import{serviceBlocks as i}from"./blocks/service/index.js";import{EditorThemedBody as Me,suppressPreviewNav as Ge}from"efficient-web-builder/editor/lib/document/page-root";import Ue from"../../components/HeaderSection.js";import{addPageBlocksFromFooter as Ke,PAGE_MENU_DIRECTION_DEFAULT as _}from"../../../render/lib/document/footer-page-blocks.js";import{MENU_STYLE_PLAIN as G,MENU_STYLE_TABS as U}from"../../../render/components/FooterMenu.js";import{drawPopupPage as We,drawPublishedStorefrontRoot as Ye,drawSystemPage as je,StorefrontPageProviders as qe}from"../../../render/lib/document/storefront-root.js";import{GENERAL_ROOT_FIELDS as ze}from"efficient-web-builder/editor/lib/document/page-root-fields";import{finishRegistry as Ve}from"efficient-web-builder/editor/lib/document/registry";const Xe="Newsletter (built in)",Qe=[{id:"currentPage",label:"Current page"}],ao=[{value:"00",label:F.label},{value:"00",label:F.label},{value:"00",label:F.label}],r=re,P={field:"autoOpen",is:!0},Je={all:[b("hideAfter",te,r.hideAfter,["days"]),{not:{all:[{field:"hideAfter",is:null,default:null},{field:"oncePerSession",in:[!0,!1]}]}}]},Ze=[[["trigger","showOn","hideAfter"],P],[["autoOpenDelaySec"],{all:[P,b("trigger",w,r.trigger,["delay","exit"])]}],[["scrollPercent"],{all:[P,b("trigger",w,r.trigger,["scroll"])]}],[["showOnPages"],{all:[P,b("showOn",oe,r.showOn,["chosen"])]}],[["hideDays"],{all:[P,Je]}]],$e=ae({formSlug:ve(void 0,Xe),_gLeft:c("Left panel"),metaLabel:a("Meta label",r.metaLabel),issueLabel:a("Issue label",r.issueLabel),issueNumber:a("Issue number",r.issueNumber),kicker:a("Eyebrow",r.kicker),heading:p("Heading",r.heading),deck:p("Deck",r.deck),stats:{type:"array",label:"Stats",arrayFields:{label:a("Label"),value:a("Value")},getItemSummary:o=>o?.label||o?.value||"Stat"},_gForm:c("Right panel · form"),formLabel:a("Section label",r.formLabel),formHeading:a("Heading",r.formHeading),formIntro:p("Intro",r.formIntro),firstNameLabel:a("First-name label",r.firstNameLabel),firstNamePlaceholder:a("First-name placeholder",r.firstNamePlaceholder),emailLabel:a("Email label",r.emailLabel),emailPlaceholder:a("Email placeholder",r.emailPlaceholder),_gChoices:c("Right panel · choices"),interestsLabel:a("Interests label",r.interestsLabel),interests:k("Interest chips",l(Fe,{noun:"tag"}),"Chip label","verbatim"),frequencyLabel:a("Frequency label",r.frequencyLabel),frequencies:k("Frequency options",l(ye,{}),"Option label","verbatim"),_gActions:c("Right panel · actions"),submitText:a("Submit button",r.submitText),finePrint:a("Fine print",r.finePrint),dismissText:a("Dismiss link",r.dismissText),emailInvalidText:a("Invalid-email error",r.emailInvalidText),submitErrorText:a("Submit-failed error",r.submitErrorText),_gSuccess:c("Success state"),successHeading:a("Heading",r.successHeading),successBody:p("Message",r.successBody),keepBrowsingText:a("Dismiss button",r.keepBrowsingText),...Re(De,we),...Ce(),_gTextStyle:c("Text style"),...Object.fromEntries(ne.map(o=>[le[o],M(D[o],He(D[o]),[{label:"Popup's own",value:""},...z.map(n=>({label:V[n],value:n}))],"")])),_gBehaviour:c("Behavior"),autoOpen:H("Show by itself",r.autoOpen,l(Se,{})),trigger:g("Trigger",l(Ee,{}),[{label:"Delay",value:"delay"},{label:"Scroll",value:"scroll"},{label:"Exit",value:"exit"}],r.trigger),autoOpenDelaySec:E("Delay",l(B,{}),A.min,A.max,1,r.autoOpenDelaySec,"s"),scrollPercent:E("Scroll",l(Be,{}),v.min,v.max,5,r.scrollPercent,"%"),showOn:g("Pages",l(he,{}),[{label:"All",value:"all"},{label:"Chosen",value:"chosen"}],r.showOn),showOnPages:Le("Chosen pages",[],"None"),hideAfter:g("After close",l(B,{}),[{label:"This visit",value:"visit"},{label:"Days",value:"days"},{label:"Never",value:"never"}],r.hideAfter),hideDays:E("Days",l(B,{}),R.min,R.max,1,r.hideDays),_gArrangement:c("Arrangement"),formSide:g("Form side",l(Te,{}),[{label:"Right",value:"right"},{label:"Left",value:"left"}],r.formSide),_gPhone:x("mobile",c("On a phone")),valuePanelOnPhone:x("mobile",H("Left panel",r.valuePanelOnPhone,l(fe,{})))},Ze),K=L($e,"SubscribePopup");async function et(){return(await se(me()??"")).filter(n=>!ee(n.slug)).map(n=>({label:n.label,value:ce(n.slug)}))}async function tt(){return O({...K,showOnPages:{...K.showOnPages,options:await et().catch(()=>[])}})}const u=ue,ot={_gHeader:c("Header"),kickerBadge:a("Eyebrow badge",u.kickerBadge),kickerText:a("Eyebrow text",u.kickerText),titleLead:a("Heading",u.titleLead),titleAccent:a("Heading accent",u.titleAccent),subtitleEmpty:p("Sub-line · empty",u.subtitleEmpty),subtitleOne:p("Sub-line · one set",u.subtitleOne),subtitleMany:p("Sub-line · several sets",u.subtitleMany,"{count} becomes the number of sets"),_gStatus:c("Status rail"),leadTimeValue:a("Lead time",u.leadTimeValue),shipsToFallback:a("Ships to · fallback",u.shipsToFallback,"Shown only while the site serves no countries — otherwise the site's default country is stated"),_gPromises:c("Promise row"),promises:k("Trust markers",l(Pe,{}),"Marker","verbatim"),_gEmpty:c("Empty basket"),emptyKicker:a("Eyebrow",u.emptyKicker),emptyBody:p("Message",u.emptyBody)},W=(o,n,m)=>O({...o,...L(de(n),m)}),rt=W(ot,T,"CartDrawer"),it={layout:pe,_nConsentWhere:Oe("The banner's words follow each visitor's country. Turn consent on or off, and pick the privacy page, in Admin › Storefront › Marketing › Privacy.")};function at({kind:o}){return l("div",{style:{padding:"14px 18px",fontFamily:"var(--font-mono, monospace)",fontSize:12,letterSpacing:"0.18em",textTransform:"uppercase",color:"var(--fg-dim)",borderBottom:"1px solid var(--site-line)"},children:o===T?"This is the cart drawer — edit its copy in the Settings panel →":o===N?"This is the cookie banner — pick its layout in the Settings panel →":"This is the site popup — edit it in the Settings panel →"})}const f={root:{fields:{...ze},resolveFields:async(o,{fields:n})=>{if(o?.props?.kind===ie)return tt();if(o?.props?.kind===I)return W(n,I,"PopupPage");if(o?.props?.kind===T)return rt;if(o?.props?.kind===N)return it;const m=n;return Ie()?{[Ne]:M("Product type",l(ge,{}),xe,"alloy-wheel"),...m}:m},render:o=>{const{editor:n,pageBackground:m,theme:s,fonts:d}=o;if(!n?.isEditing)return Ye(o);const S=je(o,l(at,{kind:o.kind}));if(S)return S;const y=We(o,!0);return l(Me,{propsTheme:s,propsFonts:d,pageBackground:typeof m=="string"?m:void 0,suppressPreviewNav:Ge,overlay:j(Y,{children:[l(Z,{}),l($,{})]}),children:y??l(qe,{rootProps:o,children:o.children})})}},categories:q(),components:{Heading:e.Heading,Text:e.Text,Eyebrow:e.Eyebrow,ImageBlock:e.ImageBlock,LogoBlock:e.LogoBlock,ButtonBlock:e.ButtonBlock,Spacer:e.Spacer,Divider:e.Divider,Grid:e.Grid,Flex:e.Flex,Breadcrumb:e.Breadcrumb,Masthead:e.Masthead,CategoryBar:e.CategoryBar,FeaturedCover:e.FeaturedCover,LongRead:e.LongRead,Series:e.Series,Subscribe:i.Subscribe,SubscribeBlogs:i.SubscribeBlogs,Banner:e.Banner,ParagraphsA:e.ParagraphsA,StatsParagraph:e.StatsParagraph,Timeline:e.Timeline,Footprint:e.Footprint,TimelineTrack:e.TimelineTrack,TitleWithButtons:e.TitleWithButtons,Stats:e.Stats,Integrations:e.Integrations,Mockup:e.Mockup,Chart:e.Chart,KeyFeatures:e.KeyFeatures,Testimonials:e.Testimonials,Reviews:i.Reviews,RatingBlock:i.RatingBlock,Prose:e.Prose,Cards:e.Cards,Logos:e.Logos,Ticker:e.Ticker,ContactRouting:i.ContactRouting,ContactLocations:e.ContactLocations,HeroSingle:e.HeroSingle,Hero:e.Hero,HeroSlide:e.HeroSlide,HeroGroup:e.HeroGroup,Collections:t.Collections,CollectionCard:t.CollectionCard,Events:i.Events,RateTable:i.RateTable,MessagingCards:i.MessagingCards,ContactCards:i.ContactCards,OpeningHours:i.OpeningHours,PostCard:e.PostCard,DocMetaCards:e.DocMetaCards,DocTabs:e.DocTabs,DocMasthead:e.DocMasthead,DocBody:e.DocBody,Contents:e.Contents,FAQ:e.FAQ,Gallery:t.Gallery,GalleryB:t.GalleryB,SpecStrip:e.SpecStrip,GalleryItem:t.GalleryItem,Manifesto:e.Manifesto,SectionHeader:e.SectionHeader,IntroBleed:e.IntroBleed,Split:e.Split,SubmitBuild:i.SubmitBuild,SubmitBox:i.SubmitBox,ReviewForm:i.ReviewForm,Form:i.Form,AppointmentBooking:i.AppointmentBooking,BookingBox:i.BookingBox,CatalogFilterBar:t.CatalogFilterBar,AlloyWheelsListing:t.AlloyWheelsListing,ProductGrid:t.ProductGrid,ProductHero:t.ProductHero,ProductGallery:t.ProductGallery,SpecTable:t.SpecTable,ProcessSteps:e.ProcessSteps,DetailRows:t.DetailRows,FitmentTable:t.FitmentTable,RelatedProducts:t.RelatedProducts,BundleOffer:t.BundleOffer,CompatibleTyres:t.CompatibleTyres,TyreSizes:t.TyreSizes,TyreFitment:t.TyreFitment,EuTyreLabel:t.EuTyreLabel,EuTyreLabelBlock:t.EuTyreLabelBlock,ProductSize:t.ProductSize,ProductColour:t.ProductColour,ProductPrice:t.ProductPrice,ProductBuyButton:t.ProductBuyButton,FilterBlock:t.FilterBlock,FilterChipsBlock:t.FilterChipsBlock,ProductPicture:t.ProductPicture,ProductSpecs:t.ProductSpecs,ProductBuy:t.ProductBuy,ProductEyebrow:t.ProductEyebrow,ProductName:t.ProductName,FitmentFinder:t.FitmentFinder,FitmentPicker:t.FitmentPicker,StockFitment:t.StockFitment,OrderSummary:e.OrderSummary,DeliveryOptions:t.DeliveryOptions,PaymentBadges:e.PaymentBadges,CheckoutCTA:t.CheckoutCTA,ProductRef:t.ProductRef,CustomHTML:e.CustomHTML,CardList:e.CardList,Header:t.Header,Footer:i.Footer,FooterLogo:i.FooterLogo,FooterMenu:i.FooterMenu,ArticleBody:i.ArticleBody,MenuLinkBlock:i.MenuLinkBlock,FooterDivider:i.FooterDivider,FooterGroup:i.FooterGroup,FooterText:i.FooterText,FooterEmailSignup:i.FooterEmailSignup,FooterSocial:i.FooterSocial,FooterMessaging:i.FooterMessaging,FooterPayment:i.FooterPayment,LegalLineBlock:i.LegalLineBlock,SearchBlock:t.SearchBlock,CartBlock:t.CartBlock,CountrySwitchBlock:t.CountrySwitchBlock,AccountBlock:t.AccountBlock,ThemeSwitchBlock:t.ThemeSwitchBlock,[Q]:i.SiteHeader,[X]:i.SiteFooter}};Ke(f.components);{const o=f.components.MenuBlock;o.fields={...o.fields,direction:g("Direction",l(be,{}),[{label:C.column,value:"column"},{label:C.row,value:"row"}],_)};const n={type:"custom",render:({value:s,onChange:d})=>l(J,{value:s,onChange:d})},m=h({type:"custom",render:({value:s,onChange:d})=>l(_e,{parts:Qe,changed:s===!0,shown:()=>s===!0,onPress:(S,y)=>d(y),onReset:()=>d(void 0)})},{not:{field:"direction",is:"column",default:_}});o.fields=Object.fromEntries(Object.entries(o.fields).flatMap(([s,d])=>s==="menu"?[[s,d],["linkRange",n],["currentPage",m]]:[[s,d]])),o.fields={...o.fields,linkAlign:Ae({label:"Link alignment"}),menuStyle:h(g("Menu style",l(ke,{}),[{label:"Plain",value:G},{label:"Tabs",value:U}],G),{not:{field:"direction",is:"column",default:_}})};for(const s of["linkRange","linkAlign"])o.fields[s]=h(o.fields[s],{not:{field:"menuStyle",is:U}})}{const o=f.components.Header,n=o.render;o.render=m=>m.editor?.isEditing?l(Ue,{editing:!0}):n(m)}const lt=Ve(f),lo=lt.sectionGroupAllow;var no=f;export{lo as SECTION_GROUP_ALLOW,f as config,no as default,$e as subscribePopupFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const KEPT_EDITOR_PHRASES: Readonly<Record<string, string>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const l={galleryItemFillFromProduct:"Fill from a product"};export{l as KEPT_EDITOR_PHRASES};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AdminRecordType, type EditorPortalAudience } from "../../render/lib/api/index.js";
|
|
2
2
|
import { PAGE_CONFLICT_CODE } from "efficient-easel/screen/lib/failure";
|
|
3
|
-
import { type PageLiveState, type WebsiteBackend } from "efficient-web-builder/format/lib/web-backend";
|
|
3
|
+
import { type PageLiveState, type VideoFrames, type WebsiteBackend } from "efficient-web-builder/format/lib/web-backend";
|
|
4
4
|
export { PAGE_CONFLICT_CODE };
|
|
5
5
|
export declare const pageVersion: (page: {
|
|
6
6
|
layout_updated_at?: string;
|
|
@@ -11,6 +11,11 @@ export declare const liveOf: (page: {
|
|
|
11
11
|
}) => {
|
|
12
12
|
live?: PageLiveState;
|
|
13
13
|
};
|
|
14
|
+
export declare const framesOf: (page: {
|
|
15
|
+
video_frames?: VideoFrames | null;
|
|
16
|
+
}) => {
|
|
17
|
+
videoFrames?: VideoFrames;
|
|
18
|
+
};
|
|
14
19
|
export declare function toBackendError(err: unknown): unknown;
|
|
15
20
|
export declare function publishRefusal(data: unknown): string | null;
|
|
16
21
|
export declare function registerServedRecordTypes(served: readonly AdminRecordType[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readLockHolder as
|
|
1
|
+
import{readLockHolder as x}from"efficient-easel/edit-lock";import{AmbiguousPageSlugError as H,ApiError as k,SERVER_UNREACHABLE_MESSAGE as U,STATUS_NETWORK_ERROR as N,setEditorLanguage as K,setEditorPortalAudience as D,storefrontAdmin as o}from"../../render/lib/api/index.js";import{AdminSectionTemplateStore as G}from"./api/section-templates.js";import{registerServedBlockSources as z}from"./efficient-block-sources.js";import{registerRecordTypes as $}from"efficient-web-builder/format/lib/content/record-types";import{uploadLimits as V}from"../../render/lib/api/upload-limits.js";import{SITE_FOOTER_SLUG as W}from"efficient-web-builder/format/lib/content/footer";import{SOCIAL_PLATFORMS as v,socialUrlField as E}from"efficient-web-builder/format/lib/content/social-links";import{EFFICIENT_BACKEND as Y,currentEaselSession as P,provideDefaultBackend as q}from"efficient-easel/screen/lib/session";import{loadEditorSiteSlug as J}from"efficient-web-builder/editor/lib/editor-site-slug";import{editorPreviewHref as Q,originIsSiteAmbiguous as X}from"efficient-web-builder/format/lib/editor/preview-href";import{postPath as Z}from"../../render/lib/links/link-rules.js";import{absolutizeApiUrl as ee,efficientMediaResolve as te}from"efficient-web-builder/render/lib/media";import{HOME_PAGE_SLUG as ne}from"efficient-web-builder/format/lib/document/home-page";import{groupPagesForMenu as ae,pageMenuLabel as T}from"../../render/lib/storefront-page-groups.js";import{PAGE_CONFLICT_CODE as L}from"efficient-easel/screen/lib/failure";import{HINTS_PREFERENCE_KEY as R}from"efficient-easel/screen/lib/hints";import{shopRouteBase as se}from"efficient-web-builder/format/lib/web-runtime";import{WebsiteBackendError as f,provideHostFailures as ie}from"efficient-easel/screen/lib/backend-error";const A=n=>n.layout_updated_at??n.updated_at??null,oe=["live","changed","never"],B=n=>oe.includes(n.live_state)?{live:n.live_state}:{},j=n=>n.video_frames?{videoFrames:n.video_frames}:{};function re(n){if(!n||typeof n!="object")return null;const i=n;return i.code!==L?null:{savedBy:typeof i.saved_by=="string"?i.saved_by:"",savedByYou:i.saved_by_you===!0,secondsAgo:typeof i.seconds_ago=="number"?i.seconds_ago:0}}function le(n){return n===401||n===403?"unauthorized":n===404?"not-found":n===N||n>=500?"unavailable":"invalid"}function ce(n){if(!(n instanceof k))return n;if(n.status===409){const i=re(n.data);if(i)return new f("changed-elsewhere",n.message,{conflict:i,cause:n});const r=x(n.data);if(r)return new f("lock-taken",n.message,{holder:r,cause:n})}return new f(le(n.status),n.message,{cause:n})}function ue(n){if(!n||typeof n!="object"||Array.isArray(n))return null;const i=r=>{if(typeof r=="string")return r.trim()||null;const d=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];for(const c of d){const m=i(c);if(m)return m}return null};for(const[r,d]of Object.entries(n)){if(r==="detail")continue;const c=i(d);if(c)return`${r}: ${c}`}return null}const I=new WeakMap;function de(n,i){const r=se(),d=r?new URL(r).hostname:typeof window<"u"?window.location?.hostname??null:null;let c=null;const m=i.siteId(),w=i.token();if(X(d)&&m&&w){const p=J(w,m);I.has(p)?c=I.get(p)??null:p.then(S=>I.set(p,S))}const y=Q({pageSlug:n,siteSlug:c,hostname:d});return r?`${r}${y}`:y}const ge={group:"Template pages",groupKey:"template"},C=n=>({id:n.id,slug:n.slug,label:n.title||n.slug,...ge,draft:!1});function M(n){const i=async t=>{const e=n.token();if(!e)throw new f("unauthorized","The editor has no sign-in yet.");try{return await t(e)}catch(a){throw ce(a)}},r={list:t=>i(async e=>{const a=await o.listPages(e,t?.siteId);return ae(a.filter(s=>s.slug!==W)).flatMap(s=>s.pages.map(l=>({id:l.id,slug:l.slug,label:T(l),group:s.group,groupKey:s.key,draft:!l.is_published,kind:l.kind??null})))}),load:t=>i(async e=>{const a="id"in t?t.id:(await o.findPageBySlug(t.slug,e,t.siteId))?.id,s=a?await o.getPageById(a,e):null;return s?{id:s.id,layout:s.layout,kind:s.kind,version:A(s),...B(s),...j(s)}:null}),save:(t,e,a)=>{const{version:s}=a;return s?i(async l=>{const g=await o.saveLayout(t,e.layout,l,s,a.clientId||void 0);return{version:A(g),...B(g),...j(g)}}):Promise.reject(new Error("Refusing to save this page: the editor does not know which version it is replacing. Reload the page and try again."))},version:t=>i(e=>o.getPageById(t,e).then(A)),linkTargets:t=>i(async e=>(await o.listPages(e,t?.siteId)).map(a=>({id:a.id,slug:a.slug,label:T(a),layout:a.layout??null}))),duplicate:(t,e)=>i(async a=>{const s=await o.duplicatePage(t,{title:e.title,slug:e.slug},a);return{id:s.id,slug:s.slug,label:T(s),group:s.group||null,draft:!s.is_published,kind:s.kind??null}})},d=t=>({list:()=>i(async e=>(await o.listTemplatePages(t,e)).map(C)),load:e=>i(async a=>{const s=u=>"id"in e?u.id===e.id:u.slug===e.slug,l=u=>({id:u.id,layout:u.layout,version:null}),g=await o.listTemplatePages(t,a);if(g.length)return l(g.find(s)??g[0]);const b=await o.getTemplate(t,a).catch(()=>null);try{return l(await o.createTemplatePage(t,{slug:ne,title:"Home",layout:b?.layout??{}},a))}catch{const u=await o.listTemplatePages(t,a),h=u.find(s)??u[0];return h?l(h):null}}),save:(e,a)=>i(async s=>(await o.saveTemplatePageLayout(e,a.layout,s),{version:null})),create:e=>i(async a=>C(await o.createTemplatePage(t,{slug:e.slug,title:e.title,layout:e.layout},a))),remove:(e,a)=>i(s=>o.deleteTemplatePage(e,s,a))}),c=t=>{const e=t?.siteId??n.siteId();if(!e)throw new f("not-found","This editor is not connected to a website.");return e},m=t=>({name:t.name,slug:t.slug}),w=t=>Object.fromEntries(v.map(e=>[e,t[E(e)]??""])),y={launcherColor:"launcher_color",launcherIcon:"launcher_icon",launcherPosition:"launcher_position",launcherLabel:"launcher_label",showOnPhones:"show_on_phones"},p=Object.keys(y),S=t=>{const e={enabled:t.enabled,title:t.title,subtitle:t.subtitle,greeting:t.greeting};for(const a of p){const s=t[y[a]];s!==void 0&&Object.assign(e,{[a]:s})}return e},F=t=>{const e={};for(const[a,s]of Object.entries(t))e[y[a]??a]=s;return e},O={pages:r,lock:{claim:(t,e,a)=>i(async s=>({heartbeatSeconds:(await o.claimPageEditLock(t,s,e,a)).heartbeat_seconds})),release:t=>i(e=>o.releasePageEditLock(t,e))},site:{get:t=>i(async e=>m(await o.getSite(c(t),e))),publish:t=>i(async e=>{try{const{state:a,published:s}=await o.publishSite(c(t),e);return{state:a,published:s}}catch(a){const s=a instanceof k&&a.status===400?ue(a.data):null;throw s?new f("invalid",s,{cause:a}):a}}),liveState:t=>i(async e=>{const{state:a,changes:s}=await o.getSiteLiveState(c(t),e);return{state:a,changes:s}})},media:{resolve:te,maxUploadBytes:V("POST /api/storefront/media/","file").maxSizeBytes},sectionTemplates:new G(n.token),social:{get:t=>i(async e=>w(await o.getSocialSettings(e,c(t)))),update:(t,e)=>i(async a=>{const s=Object.fromEntries(v.filter(l=>l in t).map(l=>[E(l),t[l]]));try{return w(await o.updateSocialSettings(s,a,c(e)))}catch(l){if(l instanceof k&&l.status===400){const g=l.data??{},b={};for(const u of v){const h=g[E(u)],_=Array.isArray(h)?h[0]:h;typeof _=="string"&&_.trim()&&(b[u]=_)}if(Object.keys(b).length>0)throw new f("invalid",l.message,{fields:b,cause:l})}throw l}})},theme:{get:t=>i(e=>o.getThemeSettings(e,t?.siteId)),update:(t,e)=>i(a=>o.updateThemeSettings(t,a,e?.siteId))},geocode:{locate:(t,e)=>i(async a=>{const s=await o.geocode(t,a,e?.country);if(s.status==="not_found")return null;if(s.status!=="found"||s.lat===null||s.lng===null)throw new f("unavailable","The geocoder could not answer just now.");return{lat:s.lat,lng:s.lng,label:s.label}})},preferences:{get:()=>i(async t=>{const e=(await o.getMyPreferences(t))[R];return typeof e=="boolean"?{showHints:e}:{}}),update:t=>i(async e=>{typeof t.showHints=="boolean"&&await o.updateMyPreferences({[R]:t.showHints},e)})},chat:{get:t=>i(async e=>S(await o.getChatSettings(e,t?.siteId))),update:(t,e)=>i(async a=>S(await o.updateChatSettings(F(t),a,e?.siteId)))},blog:{posts:t=>i(async e=>(await o.listBlogPosts(e,{visibleOnly:!0,siteId:t?.siteId})).map(a=>({slug:a.slug,title:a.title,excerpt:a.excerpt,category:a.category,coverImage:a.cover_image?ee(a.cover_image)??"":"",publishedAt:a.published_at,href:Z(a.slug)})))},templates:{get:t=>i(async e=>{const a=await o.getTemplate(t,e);return{id:a.id,name:a.name}}),pages:d},preview:{href:t=>de(t,n),draftLink:t=>i(async e=>({url:(await o.createPagePreviewLink(t,e)).url??null}))}};return O[Y]=!0,O}const fe=["text","date","images"],me=n=>n.replace(/_([a-z0-9])/g,(i,r)=>r.toUpperCase());function ye(n){if(Array.isArray(n))for(const i of n){const d=(Array.isArray(i?.fields)?i.fields:[]).filter(c=>fe.includes(c.kind)).map(c=>({key:me(c.key),label:c.label,kind:c.kind}));try{$([{key:i.key,label:i.label,fields:d}])}catch{}}}function Me(n){return P().cache("efficient:editor-offerings",()=>Promise.all([o.listBlockSources(n).then(z).catch(()=>{}),o.listRecordTypes(n).then(ye).catch(()=>{})]).then(()=>{}))}ie({read:n=>n instanceof k?{status:n.status,data:n.data,message:n.message}:null,unreachableMessage:U,loadRefusal:(n,{slug:i})=>n instanceof H?`“${i}” exists on more than one website. Open it from the site you want to edit.`:null}),q(n=>M({token:()=>n.auth.token,siteId:()=>n.siteId()}));function Fe(n={}){return n.portalAudience!==void 0&&D(n.portalAudience),n.language!==void 0&&K(n.language),M({token:()=>P().auth.token,siteId:()=>n.siteId??P().siteId()})}export{L as PAGE_CONFLICT_CODE,Fe as createEfficientBackend,j as framesOf,B as liveOf,Me as loadEditorOfferings,A as pageVersion,ue as publishRefusal,ye as registerServedRecordTypes,ce as toBackendError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loadProductCatalog as
|
|
1
|
+
import{loadProductCatalog as d,loadUnifiedProductCatalog as l}from"../../render/components/useProductCatalog.js";import{WHEELS_PAGE_SLUG as i,ensureWheelsCatalogSections as c}from"../../render/lib/wheels/catalog-default-layout.js";import{dehydrateWheelsListing as h,dehydrateWheelsListingNode as C,hydrateWheelsListing as m,pageHasHydratedValues as f,pageHasWheelsListing as L}from"../../render/lib/wheels/plp-hydrate.js";import{normalizeCatalogRows as W}from"../../render/lib/wheels/wheel-summary-casing.js";const P={opening({slug:t,isTemplate:e,capabilities:a}){const r=a.hasCatalog&&!e&&t===i?d().catch(()=>[]):Promise.resolve([]);return async n=>{const g=await r,o=c(e||!a.hasCatalog?"":t,n,g);if(a.hasCatalog&&L(o)){const s=await l().catch(()=>[]);if(s.length)return m(o,W(s))}return o}},stored:t=>f(t)?h(t):t,storedNode:t=>C(t)};export{P as STOREFRONT_DOCUMENT_HOOKS};
|