efficient-storefront-blocks 0.86.0 → 0.88.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 +37 -0
- package/dist/chunks/{EditorPreviewCheckout-4LNXFNN7.js → EditorPreviewCheckout-ZGPS3Q3X.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-A2HMVDKS.js → SiteEditorProvider-HZ47WOEX.js} +1 -1
- package/dist/chunks/{chunk-TGBNREUJ.js → chunk-7C2YH2AQ.js} +1 -1
- package/dist/chunks/chunk-O7GCI2MP.js +1 -0
- package/dist/chunks/chunk-RHNDIM7Z.js +382 -0
- package/dist/chunks/chunk-VOK5N3IB.js +1 -0
- package/dist/chunks/{fitment-data-TSYW6AFA.js → fitment-data-SH4US3BV.js} +1 -1
- package/dist/contract.js +32 -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/ProductBuy/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductBuy/fields.js +1 -0
- 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/ProductEyebrow/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductEyebrow/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.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductName/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/ProductSpecs/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductSpecs/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/RelatedProducts/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/document/section-text-regions.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 +7 -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 +40 -12
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/fitment.js +1 -1
- package/dist/index.js +136 -83
- package/dist/links.js +1 -1
- package/dist/render/app/fonts/fallbacks.css +8 -0
- package/dist/render/app/fonts/jost/OFL.txt +93 -0
- package/dist/render/app/fonts/jost/cyrillic-italic.woff2 +0 -0
- package/dist/render/app/fonts/jost/cyrillic.woff2 +0 -0
- package/dist/render/app/fonts/jost/latin-ext-italic.woff2 +0 -0
- package/dist/render/app/fonts/jost/latin-ext.woff2 +0 -0
- package/dist/render/app/fonts/jost/latin-italic.woff2 +0 -0
- package/dist/render/app/fonts/jost/latin.woff2 +0 -0
- package/dist/render/app/globals.css +122 -11
- 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/Events.js +1 -1
- package/dist/render/components/FitmentTable.d.ts +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterMenu.d.ts +5 -1
- package/dist/render/components/FooterMenu.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 +40 -0
- package/dist/render/components/GridCardTemplate.js +1 -0
- package/dist/render/components/MenuLinkBlock.d.ts +5 -1
- package/dist/render/components/MenuLinkBlock.js +1 -1
- package/dist/render/components/ProductCardChrome.d.ts +1 -1
- package/dist/render/components/ProductCardChrome.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +9 -15
- 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/StorefrontProviders.d.ts +1 -1
- package/dist/render/components/StorefrontProviders.js +1 -1
- package/dist/render/components/TyreCard.js +1 -1
- package/dist/render/components/TyreFitVerdicts.d.ts +2 -1
- package/dist/render/components/TyreFitVerdicts.js +1 -1
- package/dist/render/components/TyrePlpCard.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/CardEyebrow.d.ts +3 -1
- package/dist/render/components/card-pieces/CardEyebrow.js +1 -1
- package/dist/render/components/card-pieces/CardName.d.ts +4 -1
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.d.ts +2 -6
- 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 +13 -0
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -0
- 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/card-pieces/card-text-region.d.ts +18 -0
- package/dist/render/components/card-pieces/card-text-region.js +1 -0
- 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/fitment/StockFitmentPart.d.ts +8 -1
- package/dist/render/components/fitment/StockFitmentPart.js +1 -1
- package/dist/render/components/fitment/fitment-answer-source.d.ts +12 -0
- package/dist/render/components/fitment/fitment-answer-source.js +1 -0
- package/dist/render/components/pdp-dynamic/DynamicFitmentTable.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.d.ts +10 -12
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicTyreSizes.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpActiveChips.js +1 -1
- package/dist/render/components/wheels-plp/PlpCard.d.ts +1 -1
- package/dist/render/components/wheels-plp/PlpCard.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/field-usage.d.ts +1 -0
- package/dist/render/lib/content/field-usage.js +1 -1
- 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 +34 -0
- package/dist/render/lib/content/product-card-seed.js +1 -0
- package/dist/render/lib/content/tab-strip.d.ts +17 -0
- package/dist/render/lib/content/tab-strip.js +1 -0
- 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/ProductBuy/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuy/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuy/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuy/render.js +1 -0
- 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/ProductEyebrow/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductEyebrow/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.d.ts +4 -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/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductName/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductName/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductName/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductPicture/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductPicture/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductPicture/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductSpecs/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductSpecs/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.d.ts +0 -4
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/StockFitment/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/metas.d.ts +8 -0
- package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
- package/dist/render/lib/document/blocks/commerce/renders.d.ts +8 -0
- package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +0 -16
- 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/footer-page-blocks.js +1 -1
- 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/font-table.json +209 -1
- package/dist/render/lib/links/link-rules.js +1 -1
- package/dist/render/lib/menu-link.d.ts +2 -0
- package/dist/render/lib/menu-link.js +1 -1
- package/dist/render/lib/next-fonts.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 +4 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -1
- package/dist/render/lib/sections/product-card-text-regions.d.ts +3 -0
- package/dist/render/lib/sections/product-card-text-regions.js +1 -0
- package/dist/render/lib/sections/product-grid-columns.d.ts +13 -1
- package/dist/render/lib/sections/product-grid-columns.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/related-to-grid.d.ts +8 -0
- package/dist/render/lib/sections/related-to-grid.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/storefront-page-groups.d.ts +0 -4
- package/dist/render/lib/storefront-page-groups.js +1 -1
- package/dist/render/lib/tyres/tyre-vehicle-fitment.d.ts +1 -0
- package/dist/render/lib/tyres/tyre-vehicle-fitment.js +1 -1
- 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 +92 -15
- package/dist/words.js +6 -6
- package/package.json +4 -4
- package/dist/chunks/chunk-EUKK2IN6.js +0 -1
- package/dist/chunks/chunk-FJRKNPNN.js +0 -340
- package/dist/chunks/chunk-SLRULFYY.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-ALMIS7CK.js → chunk-NQLVRCTI.js} +0 -0
- /package/dist/chunks/{chunk-FJRKNPNN.js.LEGAL.txt → chunk-RHNDIM7Z.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import{useContext as
|
|
1
|
+
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import{useContext as H,useEffect as P,useRef as w,useState as v}from"react";import{Button as N}from"efficient-shell/ui";import I from"efficient-web-builder/editor/components/SearchSelectField";import{ScreenDocumentContext as q}from"efficient-easel/screen/components/ScreenDocumentContext";import{loadStorefrontForms as A}from"./useStorefrontForms.js";import{onStorefrontFormsChanged as J}from"efficient-web-builder/format/lib/editor-events";import{openFormBuilder as G,requestFormEdit as O}from"efficient-web-builder/format/lib/editor-form-window";import{useEaselHost as W}from"efficient-easel/screen/lib/host";import{say as s,sayCount as K}from"efficient-web-builder/format/lib/editor-words";import{InertHint as E}from"efficient-easel/panel";const j="__create-a-new-form__";function M({value:e,forms:n,loadFailed:r,emptyLabel:m}){const d=n??[],b=e?d.some(i=>i.slug===e):!0,u=n===null&&!r,g={value:"",label:u?s("Loading…"):r?s("Forms couldn’t be loaded"):m===void 0?s("No form yet"):s(m)},_=e&&!b?[{value:e,label:u||r?e:s("{slug} — no form with this name",{slug:e})}]:[],f=d.map(i=>({value:i.slug,label:i.is_active?i.title:s("{title} (switched off)",{title:i.title})})),k=u?[]:[{value:j,label:s("Create a new form")}];return[g,..._,...f,...k]}function Q(e){return e===j?{action:"create"}:{action:"store",slug:e}}function U({value:e,pickedId:n,forms:r}){if(!e||!n||r.some(d=>d.slug===e))return null;const m=r.find(d=>d.id===n);return m&&m.slug&&m.slug!==e?m.slug:null}function V(e){const n=[s("Goes to {place}",{place:s("Storefront → Forms")})],r=(e.notify_email??"").trim();return r&&n.push(s("Emails a copy to {email}",{email:r})),e.mailing_list_name&&n.push(e.subscribe_mode==="checkbox"?s("Joins the “{audience}” audience, but only when the consent box is ticked",{audience:e.mailing_list_name}):s("Joins the “{audience}” audience",{audience:e.mailing_list_name})),e.kind==="account_signup"&&n.push(e.signup_customer_type==="importer"?s("Creates a wholesale account"):s("Creates a retail account")),n}function X({value:e,onChange:n,label:r="Form",emptyLabel:m}){const d=W(),b=H(q),u=b?b.capabilities.hasForms:!0,[g,_]=v(null),[f,k]=v(!1),[i,R]=v(!1),[z,F]=v(!1),h=w(!0),x=w(e);x.current=e;const C=w(n);C.current=n;const S=w(null),y=(o=!1)=>A(o).then(c=>{if(h.current){_(c),k(!1);const p=U({value:x.current,pickedId:S.current,forms:c});p&&C.current(p)}return c},()=>(h.current&&k(!0),[]));P(()=>(h.current=!0,u&&y(),()=>{h.current=!1}),[u]),P(()=>u?J(()=>{y(!0)}):void 0,[u]);const a=e?(g??[]).find(o=>o.slug===e)??null:null;a?S.current=a.id:e||(S.current=null);const L=!!e&&!a&&g!==null&&!f,$=M({value:e,forms:g,loadFailed:f,emptyLabel:m}),T=async()=>{R(!0),F(!1);try{const o=await O(d,{mode:"create"}),c=await y(!0);if(!h.current)return;if(o.status==="timeout"){F(!0);return}if(o.status!=="saved")return;const{form:p}=o;p.slug!==x.current&&C.current(p.slug),c.some(D=>D.id===p.id)||y(!0)}finally{h.current&&R(!1)}},B=o=>{const c=Q(o);c.action==="create"?T():(F(!1),n(c.slug))};return u?l("div",{className:"sf-formpicker",children:[t(I,{label:r,options:$,fallback:"",value:e??"",onChange:B,placeholder:s("Search forms…")}),z&&t("p",{className:"sf-formsummary-warn",children:s("That didn’t come back — pick the form from the list, or try again.")}),a?l("div",{className:"sf-blogsource sf-formsummary",children:[l("div",{children:[t("div",{className:"sf-formsummary-caption",children:K("{n} field","{n} fields",a.fields.length)}),a.fields.length?t("ol",{className:"sf-formsummary-fields",children:a.fields.map((o,c)=>t("li",{children:o.label},o.key||`${o.label}-${c}`))}):t(E,{children:s("This form has no fields yet, so there is nothing for a visitor to fill in.")})]}),l("div",{children:[t("div",{className:"sf-formsummary-caption",children:s("Where the answers go")}),t("ul",{className:"sf-formsummary-fields",children:V(a).map(o=>t("li",{children:o},o))})]}),!a.is_active&&t("p",{className:"sf-formsummary-warn",children:s("This form is switched off, so it won’t appear on the published page. Turn it back on in {place}.",{place:s("Storefront → Forms")})}),l("div",{className:"sf-formsummary-actions",children:[t(N,{variant:"secondary",size:"md",onClick:()=>G(d,a.id),children:s("Edit form ✎")}),t(N,{variant:"secondary",size:"md",disabled:i,onClick:()=>{T()},children:s("New form +")})]}),t("p",{className:"es-field-hint",children:s("The questions, the button text and the thank-you message all come from {place}. Edit them there — this section updates to match.",{place:s("Storefront → Forms")})})]}):l("div",{className:"sf-blogsource sf-formsummary",children:[f?l(E,{children:[s("This website’s forms couldn’t be loaded, so there is nothing to choose from yet."),e?` ${s("This section still points at “{slug}”, and that is unchanged.",{slug:e})}`:""]}):L&&t("p",{className:"sf-formsummary-warn",children:s("This section points at “{slug}”, and this website has no form with that name. Pick one from the list above, or leave it — nothing has been changed.",{slug:e??""})}),l("div",{className:"sf-formsummary-actions",children:[f&&t(N,{variant:"secondary",size:"md",disabled:i,onClick:()=>{y(!0)},children:s("Try again")}),t(N,{variant:"secondary",size:"md",disabled:i,onClick:()=>{T()},children:s("New form +")})]}),!f&&t("p",{className:"es-field-hint",children:s("Pick a form to show here, or build a new one. Forms are made once in {place} and can be shown on any number of pages.",{place:s("Storefront → Forms")})})]})]}):t("div",{className:"sf-formpicker",children:t("div",{className:"sf-blogsource sf-formsummary",children:l("div",{children:[t("div",{className:"sf-formsummary-caption",children:s(r)}),l(E,{children:[s("Forms aren’t available in this editor, so there is nothing to choose here."),e?` ${s("This section still points at “{slug}”, and that is unchanged.",{slug:e})}`:""]})]})})})}export{j as CREATE_SENTINEL,X as default,U as followRenamedForm,V as formDestinationLines,M as formPickerOptions,Q as resolveFormPick};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as G,jsxs as J}from"react/jsx-runtime";import{mediaGroupVehicle as K}from"../../render/lib/content/source-values.js";import{useEffect as R,useMemo as Q,useRef as
|
|
1
|
+
"use client";import{jsx as G,jsxs as J}from"react/jsx-runtime";import{mediaGroupVehicle as K}from"../../render/lib/content/source-values.js";import{useEffect as R,useMemo as Q,useRef as b,useState as k}from"react";import{storefrontAdmin as U}from"../../render/lib/api/index.js";import{useEaselHost as X}from"efficient-easel/screen/lib/host";import{getEditorToken as Y}from"efficient-web-builder/render/lib/editor-auth";import{getEditorSiteId as Z}from"efficient-web-builder/render/lib/editor-site";import{loadProductCatalog as F}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as v}from"./useStorefrontCategories.js";import{useCategoryFilter as ee}from"./useCategoryFilter.js";import te from"./CategoryProductFields.js";import{snapshotChanged as re}from"efficient-web-builder/editor/components/useSnapshotSource";import se from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as H}from"efficient-web-builder/format/lib/editor-words";const a="__all__";function oe(e,r){return r===a?e:e.filter(o=>o.process===r)}function m(e,r){return e.map(o=>({image:o.items[0]?.url,photos:o.items.map(s=>({src:s.url})),href:`/wheels/${r.slug}`,process:r.process,eyebrow:K(o),name:r.name,meta:o.finish})).filter(o=>!!o.image)}function W(e){const r=Y();return r?U.getWheelDetail(r,e,{siteId:Z()}):Promise.reject(new Error("editor not authenticated"))}async function ne(e){const r=await W(e),o={slug:r.slug,name:r.name,process:r.process},s=r.mediaGroups??{photos:[],lifestyle:[],videos:[],accessories:[],others:[]};return{...o,vehicleCards:m(s.lifestyle??[],o),wheelCards:m(s.photos??[],o),othersCards:m(s.others??[],o)}}async function ae(e,r){const o=await Promise.all(e.map(i=>W(i.slug).catch(()=>null))),s=[],h=[],p=[];for(const i of o){if(!i)continue;const l={slug:i.slug,name:i.name,process:i.process},d=i.mediaGroups??{photos:[],lifestyle:[],videos:[],accessories:[],others:[]};s.push(...m(d.lifestyle??[],l)),h.push(...m(d.photos??[],l)),p.push(...m(d.others??[],l))}return{slug:a,name:r===a?"All products":r,process:"",vehicleCards:s,wheelCards:h,othersCards:p,category:r}}function ie({value:e,onChange:r}){const o=X(),[s,h]=k(null),[p,i]=k(null),[l,d]=k(!1),[L,P]=k(!1),u=b(!0),g=b(e);g.current=e;const O=b(r);O.current=r;const x=(t,f=!1)=>{d(!0),f||P(!1),t().then(B=>{u.current&&(re(B,g.current)&&O.current(B),P(!1))}).catch(()=>{u.current&&!f&&P(!0)}).finally(()=>{u.current&&d(!1)})},A=(t,f=!1)=>x(()=>ne(t),f),y=(t,f=!1)=>x(()=>ae(oe(s??[],t),t),f);R(()=>(u.current=!0,F().then(t=>{u.current&&h(t)}),v().then(t=>{u.current&&i(t)}),()=>{u.current=!1}),[]);const C=b(!1);R(()=>{if(C.current)return;const t=g.current;if(!t?.slug){C.current=!0;return}if(t.slug===a){if(s===null)return;C.current=!0,y(t.category??a,!0)}else C.current=!0,A(t.slug,!0)},[s]);const c=e?.slug===a,w=Q(()=>s&&e?.slug&&!c?s.find(t=>t.slug===e.slug)??null:null,[s,e?.slug,c]),{category:N,setCategory:E,categoryNames:D,filtered:T}=ee(s,p);R(()=>{c?e?.category&&E(e.category):w?.process&&E(w.process)},[w,c,e?.category]);const S=s===null,_=!!e?.slug&&!c&&s!==null&&!w,I=t=>{if(!t){r(null);return}if(t===a){y(N);return}A(t)},M=t=>{E(t),g.current?.slug===a&&y(t)},V=()=>{e?.slug&&(F(!0).then(t=>{u.current&&h(t)}),c?y(e.category??a):A(e.slug))},$=()=>{e?.slug&&o.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},j=(e?.vehicleCards.length??0)+(e?.wheelCards.length??0)+(e?.othersCards?.length??0),q=L?"error":l?"loading":"idle",z=L?n("Couldn’t reach the product catalog."):l?n("Syncing media from the catalog…"):_?n("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):c?H("Linked to “{name}” · {n} card from all products’ media groups.","Linked to “{name}” · {n} cards from all products’ media groups.",j,{name:e?.name??""}):H("Linked to “{name}” · {n} card from its media groups.","Linked to “{name}” · {n} cards from its media groups.",j,{name:e?.name??""});return J("div",{children:[G(te,{category:N,onChange:M,categoryNames:D,readOnly:S,products:T,allProducts:s??[],product:e?.slug??"",onProductChange:I,productReadOnly:S||l,emptyLabel:S?n("Loading…"):n("None (write the cards yourself)"),extraOptions:[{label:n("All products"),value:a},..._?[{label:n("{name} (unavailable)",{name:e.name}),value:e.slug}]:[]]}),e?.slug?G(se,{status:q,statusText:z,onRefresh:V,busy:l,edit:c?void 0:{label:n("Edit product ✎"),onClick:$},hint:c?n("Pools every product’s grouped media: each one’s Relative / lifestyle photos feed Gallery A, its Product photos Gallery B and its Others the Others gallery. Every media group becomes a card, attributed to its own product (title, link and tag). Narrow the set with the Category filter above. Headings, intro copy and stats stay yours."):n("Gallery A comes from the product’s Relative / lifestyle photos, Gallery B from its Product photos and the Others gallery from its Others — edit those in the product’s Media tab and refresh. Each media group is a card: its name is the eyebrow, its finish the meta line; the card’s title is the product name and its tag the category. Headings, intro copy and stats stay yours.")}):G("p",{className:"es-field-hint",children:n("Pick a product — or All products — to build the galleries from media groups, or keep “None” to author the cards yourself.")})]})}export{ie as default};
|
|
@@ -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
|
+
import{jsx as o}from"react/jsx-runtime";import{CartIcon as r,LinkIcon as e}from"efficient-easel/icons";import{toggle as t}from"efficient-web-builder/editor/lib/document/controls";const n={fields:{buy:t("Buy button",!0,o(r,{})),page:t("Product page link",!0,o(e,{}))}};export{n as ProductBuyFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t={fields:{}};export{t as ProductBuyButtonFields};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={fields:{}};export{e as ProductEyebrowFields};
|
|
@@ -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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{HashIcon as o}from"efficient-easel/icons";import{toggle as e}from"efficient-web-builder/editor/lib/document/controls";const m={fields:{sizes:e("Sizes",!1,s(o,{}))}};export{m as ProductSpecsFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{RELATED_CARDS_MIN as a,RELATED_CARDS_MAX as l,RELATED_CARDS_DEFAULT as n}from"../../../../../../render/lib/catalog/related-cards.js";import{RELATIONSHIP_OPTIONS as p,DEFAULT_RELATIONSHIP as t,RELATIONSHIPS as R,CARD_ROWS_NOT_ON_A_TYRE as _}from"../../../../../../render/lib/catalog/relationships.js";import{EyeIcon as f,HashIcon as T,ColumnsIcon as A}from"efficient-easel/icons";import{text as E,textarea as r}from"efficient-web-builder/editor/lib/document/controls";import{group as m}from"efficient-easel/screen/lib/document/box-fields";import{select as S,slider as i}from"efficient-web-builder/editor/lib/document/box-fields";import{headFieldsForPlacement as c,SPLITTABLE_SECTIONS as I}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as s}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{PRODUCTGRID_PH as u}from"../../../../../../render/lib/document/blocks/commerce/placeholders.js";import{withRowsShownWhen as P}from"efficient-web-builder/render/lib/document/show-when";import{ProductGridSlots as D}from"../../../../../../render/lib/document/blocks/commerce/ProductGrid/meta.js";const h={not:{field:"relationship",in:R.filter(o=>o.to==="tyre").map(o=>o.key),default:t}},j={fields:{_gHeader:m("Header"),num:E("Number",u.num),title:r("Heading",s.sectionHeading),description:r("Body",s.body),template:D.template,_gLayout:m("Grid"),relationship:S("Show",e(f,{}),p,t),cardCount:i("Cards to show",e(T,{}),a,l,1,n),columns:i("Columns",e(A,{}),2,4,1,3)},resolveFields:(o,{fields:d,parent:C})=>c(P(d,_,h),o.props.headPlacement,I.RelatedProducts.headRows)};export{j as RelatedProductsFields};
|
|
@@ -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 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
|
|
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 G,jsxs as U}from"react/jsx-runtime";import{assignSectionGroups as k,reseatBucketTabs as F}from"efficient-web-builder/editor/lib/document/field-groups";import{buildBlockCategories as K}from"efficient-web-builder/format/lib/document/section-catalog";import{FONT_ROLES as W,FONT_ROLE_LABELS as j}from"efficient-web-builder/format/lib/fonts";import{CONTAINER_DIRECTION_LABELS as E}from"efficient-web-builder/format/lib/content/container-direction";import{SITE_FOOTER_TYPE as Y,SITE_HEADER_TYPE as q}from"efficient-web-builder/format/lib/document/section-groups";import z from"../../components/MenuLinkRangeField.js";import V from"../../components/EditorPreviewChat.js";import X from"../../components/EditorPreviewSurface.js";import{isSystemPageSlug as Q,POPUP_DAYS_RANGE as O,POPUP_DELAY_RANGE as _,POPUP_HIDE_AFTER as J,POPUP_SCROLL_RANGE as L,POPUP_SHOW_ON as Z,POPUP_TRIGGERS as C,SUBSCRIBE_POPUP_DEFAULTS as $,SUBSCRIBE_POPUP_KIND as ee}from"efficient-web-builder/format/lib/content/subscribe";import{shownForOption as b,withRowRules as te}from"efficient-web-builder/render/lib/document/show-when";import{POPUP_KIND_PROP as oe,POPUP_TEXT_KIND_LABELS as v,POPUP_TEXT_KINDS as re}from"efficient-web-builder/format/lib/popup/text-kinds";import{loadPages as ie}from"efficient-web-builder/editor/components/StorefrontLinkField";import{pagePath as ae}from"../../../render/lib/links/link-rules.js";import{getEditorSiteId as le}from"efficient-web-builder/render/lib/editor-site";import{CART_DRAWER_DEFAULTS as ne,CART_DRAWER_KIND as f}from"efficient-web-builder/format/lib/content/cart-drawer";import{POPUP_PAGE_KIND as A}from"efficient-web-builder/format/lib/popup/look";import{popupLookFields as se}from"./popup-look-fields.js";import{CONSENT_BANNER_KIND as R}from"efficient-web-builder/format/lib/content/consent-banner";import{consentBannerLayoutField as ce}from"../../components/ConsentBannerLayoutTiles.js";import{CategoryIcon as me,CheckIcon as ue,ClockIcon as S,ColumnsIcon as de,DirectionIcon as pe,EyeIcon as ge,ListIcon as Pe,PageIcon as be,PlacementIcon as fe,ScrollPointIcon as Se,TriggerIcon as he}from"efficient-easel/icons";import{deviceField as D}from"efficient-easel/screen/lib/document/device-fields";import{FieldGlyph as Te}from"efficient-web-builder/editor/components/FieldGlyph";import{multiSelect as ye,panelNote as Be,plainText as a,plainTextarea as u,sectionShapeFields as ke,sectionThemeFields as Fe,textList as h,toggle as w}from"efficient-web-builder/editor/lib/document/controls";import{group as c}from"efficient-easel/screen/lib/document/box-fields";import{segmented as p,select as I,slider as T}from"efficient-web-builder/editor/lib/document/box-fields";import{blockAlignRow as Ee}from"./block-align-row.js";import{formPicker as Oe}from"./blocks/service/controls.js";import{SECTION_THEME_FOLLOW_LABEL as _e}from"efficient-web-builder/editor/components/SectionThemePicker";import{nestedAccentValue as Le}from"efficient-web-builder/format/lib/content/section-surface";import{isEditorOnDynamicPage as Ce}from"efficient-web-builder/format/lib/document/editor-page-context";import{TEMPLATE_PRODUCT_TYPE_PROP as ve}from"efficient-web-builder/format/lib/content/product-page";import{PRODUCT_KIND_OPTIONS as Ae}from"../../../render/lib/catalog/plp-item.js";import{PH as y}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{textKindGlyph as Re}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 r}from"./blocks/commerce/index.js";import{serviceBlocks as i}from"./blocks/service/index.js";import{EditorThemedBody as De,suppressPreviewNav as we}from"efficient-web-builder/editor/lib/document/page-root";import Ie from"../../components/HeaderSection.js";import{addPageBlocksFromFooter as xe,PAGE_MENU_DIRECTION_DEFAULT as Ne}from"../../../render/lib/document/footer-page-blocks.js";import{drawPopupPage as He,drawPublishedStorefrontRoot as Me,drawSystemPage as Ge,StorefrontPageProviders as Ue}from"../../../render/lib/document/storefront-root.js";import{GENERAL_ROOT_FIELDS as Ke}from"efficient-web-builder/editor/lib/document/page-root-fields";import{finishRegistry as We}from"efficient-web-builder/editor/lib/document/registry";const je="Newsletter (built in)",Zt=[{value:"00",label:y.label},{value:"00",label:y.label},{value:"00",label:y.label}],t=$,g={field:"autoOpen",is:!0},Ye={all:[b("hideAfter",J,t.hideAfter,["days"]),{not:{all:[{field:"hideAfter",is:null,default:null},{field:"oncePerSession",in:[!0,!1]}]}}]},qe=[[["trigger","showOn","hideAfter"],g],[["autoOpenDelaySec"],{all:[g,b("trigger",C,t.trigger,["delay","exit"])]}],[["scrollPercent"],{all:[g,b("trigger",C,t.trigger,["scroll"])]}],[["showOnPages"],{all:[g,b("showOn",Z,t.showOn,["chosen"])]}],[["hideDays"],{all:[g,Ye]}]],ze=te({formSlug:Oe(void 0,je),_gLeft:c("Left panel"),metaLabel:a("Meta label",t.metaLabel),issueLabel:a("Issue label",t.issueLabel),issueNumber:a("Issue number",t.issueNumber),kicker:a("Eyebrow",t.kicker),heading:u("Heading",t.heading),deck:u("Deck",t.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",t.formLabel),formHeading:a("Heading",t.formHeading),formIntro:u("Intro",t.formIntro),firstNameLabel:a("First-name label",t.firstNameLabel),firstNamePlaceholder:a("First-name placeholder",t.firstNamePlaceholder),emailLabel:a("Email label",t.emailLabel),emailPlaceholder:a("Email placeholder",t.emailPlaceholder),_gChoices:c("Right panel · choices"),interestsLabel:a("Interests label",t.interestsLabel),interests:h("Interest chips",l(Te,{noun:"tag"}),"Chip label","verbatim"),frequencyLabel:a("Frequency label",t.frequencyLabel),frequencies:h("Frequency options",l(Pe,{}),"Option label","verbatim"),_gActions:c("Right panel · actions"),submitText:a("Submit button",t.submitText),finePrint:a("Fine print",t.finePrint),dismissText:a("Dismiss link",t.dismissText),emailInvalidText:a("Invalid-email error",t.emailInvalidText),submitErrorText:a("Submit-failed error",t.submitErrorText),_gSuccess:c("Success state"),successHeading:a("Heading",t.successHeading),successBody:u("Message",t.successBody),keepBrowsingText:a("Dismiss button",t.keepBrowsingText),...Fe(Le,_e),...ke(),_gTextStyle:c("Text style"),...Object.fromEntries(re.map(o=>[oe[o],I(v[o],Re(v[o]),[{label:"Popup's own",value:""},...W.map(n=>({label:j[n],value:n}))],"")])),_gBehaviour:c("Behavior"),autoOpen:w("Show by itself",t.autoOpen,l(ge,{})),trigger:p("Trigger",l(he,{}),[{label:"Delay",value:"delay"},{label:"Scroll",value:"scroll"},{label:"Exit",value:"exit"}],t.trigger),autoOpenDelaySec:T("Delay",l(S,{}),_.min,_.max,1,t.autoOpenDelaySec,"s"),scrollPercent:T("Scroll",l(Se,{}),L.min,L.max,5,t.scrollPercent,"%"),showOn:p("Pages",l(be,{}),[{label:"All",value:"all"},{label:"Chosen",value:"chosen"}],t.showOn),showOnPages:ye("Chosen pages",[],"None"),hideAfter:p("After close",l(S,{}),[{label:"This visit",value:"visit"},{label:"Days",value:"days"},{label:"Never",value:"never"}],t.hideAfter),hideDays:T("Days",l(S,{}),O.min,O.max,1,t.hideDays),_gArrangement:c("Arrangement"),formSide:p("Form side",l(fe,{}),[{label:"Right",value:"right"},{label:"Left",value:"left"}],t.formSide),_gPhone:D("mobile",c("On a phone")),valuePanelOnPhone:D("mobile",w("Left panel",t.valuePanelOnPhone,l(de,{})))},qe),x=k(ze,"SubscribePopup");async function Ve(){return(await ie(le()??"")).filter(n=>!Q(n.slug)).map(n=>({label:n.label,value:ae(n.slug)}))}async function Xe(){return F({...x,showOnPages:{...x.showOnPages,options:await Ve().catch(()=>[])}})}const m=ne,Qe={_gHeader:c("Header"),kickerBadge:a("Eyebrow badge",m.kickerBadge),kickerText:a("Eyebrow text",m.kickerText),titleLead:a("Heading",m.titleLead),titleAccent:a("Heading accent",m.titleAccent),subtitleEmpty:u("Sub-line · empty",m.subtitleEmpty),subtitleOne:u("Sub-line · one set",m.subtitleOne),subtitleMany:u("Sub-line · several sets",m.subtitleMany,"{count} becomes the number of sets"),_gStatus:c("Status rail"),leadTimeValue:a("Lead time",m.leadTimeValue),shipsToFallback:a("Ships to · fallback",m.shipsToFallback,"Shown only while the site serves no countries — otherwise the site's default country is stated"),_gPromises:c("Promise row"),promises:h("Trust markers",l(ue,{}),"Marker","verbatim"),_gEmpty:c("Empty basket"),emptyKicker:a("Eyebrow",m.emptyKicker),emptyBody:u("Message",m.emptyBody)},N=(o,n,s)=>F({...o,...k(se(n),s)}),Je=N(Qe,f,"CartDrawer"),Ze={layout:ce,_nConsentWhere:Be("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 $e({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===f?"This is the cart drawer — edit its copy in the Settings panel →":o===R?"This is the cookie banner — pick its layout in the Settings panel →":"This is the site popup — edit it in the Settings panel →"})}const P={root:{fields:{...Ke},resolveFields:async(o,{fields:n})=>{if(o?.props?.kind===ee)return Xe();if(o?.props?.kind===A)return N(n,A,"PopupPage");if(o?.props?.kind===f)return Je;if(o?.props?.kind===R)return Ze;const s=n;return Ce()?{[ve]:I("Product type",l(me,{}),Ae,"alloy-wheel"),...s}:s},render:o=>{const{editor:n,pageBackground:s,theme:d,fonts:H}=o;if(!n?.isEditing)return Me(o);const B=Ge(o,l($e,{kind:o.kind}));if(B)return B;const M=He(o,!0);return l(De,{propsTheme:d,propsFonts:H,pageBackground:typeof s=="string"?s:void 0,suppressPreviewNav:we,overlay:U(G,{children:[l(V,{}),l(X,{})]}),children:M??l(Ue,{rootProps:o,children:o.children})})}},categories:K(),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:r.Collections,CollectionCard:r.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:r.Gallery,GalleryB:r.GalleryB,SpecStrip:e.SpecStrip,GalleryItem:r.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:r.CatalogFilterBar,AlloyWheelsListing:r.AlloyWheelsListing,ProductGrid:r.ProductGrid,ProductHero:r.ProductHero,ProductGallery:r.ProductGallery,SpecTable:r.SpecTable,ProcessSteps:e.ProcessSteps,DetailRows:r.DetailRows,FitmentTable:r.FitmentTable,RelatedProducts:r.RelatedProducts,BundleOffer:r.BundleOffer,CompatibleTyres:r.CompatibleTyres,TyreSizes:r.TyreSizes,TyreFitment:r.TyreFitment,EuTyreLabel:r.EuTyreLabel,EuTyreLabelBlock:r.EuTyreLabelBlock,ProductSize:r.ProductSize,ProductColour:r.ProductColour,ProductPrice:r.ProductPrice,FitmentFinder:r.FitmentFinder,FitmentPicker:r.FitmentPicker,StockFitment:r.StockFitment,OrderSummary:e.OrderSummary,DeliveryOptions:r.DeliveryOptions,PaymentBadges:e.PaymentBadges,CheckoutCTA:r.CheckoutCTA,ProductRef:r.ProductRef,CustomHTML:e.CustomHTML,Header:r.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:r.SearchBlock,CartBlock:r.CartBlock,CountrySwitchBlock:r.CountrySwitchBlock,AccountBlock:r.AccountBlock,ThemeSwitchBlock:r.ThemeSwitchBlock,[q]:i.SiteHeader,[Y]:i.SiteFooter}};xe(P.components);{const o=P.components.MenuBlock;o.fields={...o.fields,direction:p("Direction",l(pe,{}),[{label:E.column,value:"column"},{label:E.row,value:"row"}],Ne)};const n={type:"custom",render:({value:s,onChange:d})=>l(z,{value:s,onChange:d})};o.fields=Object.fromEntries(Object.entries(o.fields).flatMap(([s,d])=>s==="menu"?[[s,d],["linkRange",n]]:[[s,d]])),o.fields={...o.fields,linkAlign:Ee({label:"Link alignment"})}}{const o=P.components.Header,n=o.render;o.render=s=>s.editor?.isEditing?l(Ie,{editing:!0}):n(s)}const et=We(P),$t=et.sectionGroupAllow;var eo=P;export{$t as SECTION_GROUP_ALLOW,P as config,eo as default,ze 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerSectionTextRegions as r}from"efficient-web-builder/format/lib/sections/section-text-regions";import{PRODUCT_PRICE_TEXT_REGIONS as o}from"../../../render/lib/sections/product-price-text-regions.js";r({ProductPrice:o});
|
|
1
|
+
import{registerSectionTextRegions as r}from"efficient-web-builder/format/lib/sections/section-text-regions";import{PRODUCT_PRICE_TEXT_REGIONS as o}from"../../../render/lib/sections/product-price-text-regions.js";import{PRODUCT_EYEBROW_TEXT_REGIONS as E,PRODUCT_NAME_TEXT_REGIONS as T}from"../../../render/lib/sections/product-card-text-regions.js";r({ProductPrice:o,ProductEyebrow:E,ProductName:T});
|