efficient-storefront-blocks 0.75.0 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/chunks/EditorPreviewCheckout-ANI7HUYX.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-N4T55FAV.js → SiteEditorProvider-AJUWZYHT.js} +1 -1
  4. package/dist/chunks/chunk-3IQQNZIM.js +311 -0
  5. package/dist/chunks/chunk-4F5CAFXO.js +1 -0
  6. package/dist/chunks/chunk-YAYHH5GY.js +1 -0
  7. package/dist/chunks/{chunk-K26JUDGZ.js → chunk-YFPWVNDB.js} +1 -1
  8. package/dist/chunks/{fitment-data-5ZSHENM3.js → fitment-data-IZYCNTET.js} +1 -1
  9. package/dist/contract.js +2 -2
  10. package/dist/editor/components/BlogSource.js +1 -1
  11. package/dist/editor/components/CategoryProductFields.d.ts +22 -0
  12. package/dist/editor/components/CategoryProductFields.js +1 -0
  13. package/dist/editor/components/CategorySource.d.ts +12 -0
  14. package/dist/editor/components/CategorySource.js +1 -1
  15. package/dist/editor/components/CollectionPicker.js +1 -1
  16. package/dist/editor/components/CountryShowAsTiles.js +1 -1
  17. package/dist/editor/components/EditorPreviewChat.js +1 -11
  18. package/dist/editor/components/EditorPreviewSurface.js +1 -1
  19. package/dist/editor/components/GalleryProductBinding.js +1 -1
  20. package/dist/editor/components/GalleryShowcaseSource.js +1 -1
  21. package/dist/editor/components/HeaderSettingsPanel.d.ts +8 -4
  22. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  23. package/dist/editor/components/MenuPicker.js +1 -1
  24. package/dist/editor/components/PreviewProductPicker.js +1 -1
  25. package/dist/editor/components/ProductHeroSource.js +1 -1
  26. package/dist/editor/components/ProductPicker.js +1 -1
  27. package/dist/editor/components/SocialLinksDoor.js +1 -1
  28. package/dist/editor/components/SpecTableSource.js +1 -1
  29. package/dist/editor/lib/document/block-align-row.d.ts +2 -0
  30. package/dist/editor/lib/document/block-align-row.js +1 -0
  31. package/dist/editor/lib/document/blocks/commerce/AccountBlock/fields.js +1 -1
  32. package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
  33. package/dist/editor/lib/document/blocks/commerce/BundleOffer/fields.js +1 -1
  34. package/dist/editor/lib/document/blocks/commerce/CartBlock/fields.js +1 -1
  35. package/dist/editor/lib/document/blocks/commerce/CatalogFilterBar/fields.js +1 -1
  36. package/dist/editor/lib/document/blocks/commerce/CheckoutCTA/fields.js +1 -1
  37. package/dist/editor/lib/document/blocks/commerce/CollectionCard/fields.js +1 -1
  38. package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
  39. package/dist/editor/lib/document/blocks/commerce/CompatibleTyres/fields.js +1 -1
  40. package/dist/editor/lib/document/blocks/commerce/CountrySwitchBlock/fields.js +1 -1
  41. package/dist/editor/lib/document/blocks/commerce/DeliveryOptions/fields.js +1 -1
  42. package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
  43. package/dist/editor/lib/document/blocks/commerce/EuTyreLabel/fields.js +1 -1
  44. package/dist/editor/lib/document/blocks/commerce/FitmentFinder/fields.js +1 -1
  45. package/dist/editor/lib/document/blocks/commerce/FitmentTable/fields.js +1 -1
  46. package/dist/editor/lib/document/blocks/commerce/Gallery/fields.js +1 -1
  47. package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
  48. package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
  49. package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.d.ts +2 -2
  50. package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
  51. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  52. package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
  53. package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
  54. package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
  55. package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
  56. package/dist/editor/lib/document/blocks/commerce/TyreFitment/fields.js +1 -1
  57. package/dist/editor/lib/document/blocks/commerce/TyreSizes/fields.js +1 -1
  58. package/dist/editor/lib/document/blocks/commerce/shared-fields.d.ts +1 -0
  59. package/dist/editor/lib/document/blocks/commerce/shared-fields.js +1 -1
  60. package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
  61. package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
  62. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
  63. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  64. package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
  65. package/dist/editor/lib/document/blocks/service/Footer/fields.js +1 -1
  66. package/dist/editor/lib/document/blocks/service/FooterDivider/fields.js +1 -1
  67. package/dist/editor/lib/document/blocks/service/FooterEmailSignup/fields.js +1 -1
  68. package/dist/editor/lib/document/blocks/service/FooterGroup/fields.js +1 -1
  69. package/dist/editor/lib/document/blocks/service/FooterLogo/fields.js +1 -1
  70. package/dist/editor/lib/document/blocks/service/FooterMenu/fields.js +1 -1
  71. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -1
  72. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -1
  73. package/dist/editor/lib/document/blocks/service/FooterSocial/fields.js +1 -1
  74. package/dist/editor/lib/document/blocks/service/FooterText/fields.js +1 -1
  75. package/dist/editor/lib/document/blocks/service/Form/fields.js +1 -1
  76. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -1
  77. package/dist/editor/lib/document/blocks/service/OpeningHours/fields.js +1 -1
  78. package/dist/editor/lib/document/blocks/service/RateTable/fields.js +1 -1
  79. package/dist/editor/lib/document/blocks/service/RatingBlock/fields.js +1 -1
  80. package/dist/editor/lib/document/blocks/service/ReviewForm/fields.js +1 -1
  81. package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
  82. package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
  83. package/dist/editor/lib/document/blocks/service/SubmitBox/fields.js +1 -1
  84. package/dist/editor/lib/document/blocks/service/SubmitBuild/fields.js +1 -1
  85. package/dist/editor/lib/document/blocks/service/Subscribe/fields.js +1 -1
  86. package/dist/editor/lib/document/blocks/service/SubscribeBlogs/fields.js +1 -1
  87. package/dist/editor/lib/document/box-header.js +1 -1
  88. package/dist/editor/lib/document/config.d.ts +16 -16
  89. package/dist/editor/lib/document/config.js +1 -1
  90. package/dist/editor/lib/editor-currency-source.js +1 -1
  91. package/dist/editor/lib/storefront-editor-words.d.ts +10 -13
  92. package/dist/editor/lib/storefront-editor-words.js +1 -1
  93. package/dist/editor.css +1 -1
  94. package/dist/index.js +214 -724
  95. package/dist/links.js +1 -1
  96. package/dist/render/app/globals.css +32 -79
  97. package/dist/render/built-with.json +1 -1
  98. package/dist/render/components/BoxHeaderBar.js +1 -1
  99. package/dist/render/components/CartContext.d.ts +1 -0
  100. package/dist/render/components/CartContext.js +1 -1
  101. package/dist/render/components/CartDrawer.js +2 -2
  102. package/dist/render/components/CatalogFilterBarSection.d.ts +1 -1
  103. package/dist/render/components/CatalogFilterBarSection.js +1 -1
  104. package/dist/render/components/Collections.js +1 -1
  105. package/dist/render/components/CompatibleTyres.js +1 -1
  106. package/dist/render/components/ConsentPanel.js +1 -1
  107. package/dist/render/components/ContactRouting.js +1 -1
  108. package/dist/render/components/CouponField.js +1 -1
  109. package/dist/render/components/CurrencyContext.js +1 -1
  110. package/dist/render/components/Events.js +1 -1
  111. package/dist/render/components/FitmentTable.js +1 -1
  112. package/dist/render/components/FooterGroup.d.ts +1 -1
  113. package/dist/render/components/FooterGroup.js +1 -1
  114. package/dist/render/components/FooterLogo.d.ts +2 -1
  115. package/dist/render/components/FooterMenu.js +1 -1
  116. package/dist/render/components/FooterPayment.d.ts +1 -2
  117. package/dist/render/components/FooterPayment.js +1 -1
  118. package/dist/render/components/FooterSocial.d.ts +1 -2
  119. package/dist/render/components/FooterSocial.js +1 -1
  120. package/dist/render/components/FormBlock.js +1 -1
  121. package/dist/render/components/GalleryItem.js +1 -1
  122. package/dist/render/components/GalleryShowcase.js +1 -1
  123. package/dist/render/components/Header.js +1 -1
  124. package/dist/render/components/HeaderTools.js +1 -1
  125. package/dist/render/components/Lightbox.d.ts +2 -2
  126. package/dist/render/components/Lightbox.js +1 -1
  127. package/dist/render/components/LinkedProductHero.d.ts +2 -0
  128. package/dist/render/components/PopupFrame.d.ts +17 -4
  129. package/dist/render/components/PopupFrame.js +1 -1
  130. package/dist/render/components/ProductGallery.js +1 -1
  131. package/dist/render/components/ProductGridSection.js +1 -1
  132. package/dist/render/components/ProductHeroPanel.d.ts +3 -1
  133. package/dist/render/components/ProductHeroPanel.js +1 -1
  134. package/dist/render/components/ProductLightbox.js +1 -1
  135. package/dist/render/components/ReviewForm.js +1 -1
  136. package/dist/render/components/SpecTable.d.ts +2 -1
  137. package/dist/render/components/SpecTable.js +1 -1
  138. package/dist/render/components/SubscribePopup.js +2 -2
  139. package/dist/render/components/TyreRenderSvg.js +1 -1
  140. package/dist/render/components/booking/BookingRegions.js +1 -1
  141. package/dist/render/components/catalog/CatalogFilterBar.d.ts +4 -4
  142. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  143. package/dist/render/components/catalog/CatalogFilterContext.d.ts +5 -3
  144. package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
  145. package/dist/render/components/catalog/FilterPill.d.ts +3 -1
  146. package/dist/render/components/catalog/FilterPill.js +1 -1
  147. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  148. package/dist/render/components/checkout/checkout-parts.js +1 -1
  149. package/dist/render/components/checkout/checkout-state.d.ts +12 -0
  150. package/dist/render/components/checkout/checkout-state.js +3 -3
  151. package/dist/render/components/fitment/StockFitmentCard.js +1 -1
  152. package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
  153. package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -0
  154. package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
  155. package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
  156. package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
  157. package/dist/render/components/product-hero/TyreHeroFitment.js +1 -1
  158. package/dist/render/components/product-hero/VehicleQuestion.d.ts +1 -2
  159. package/dist/render/components/product-hero/VehicleQuestion.js +1 -1
  160. package/dist/render/components/product-hero/WheelHeroFitment.js +1 -1
  161. package/dist/render/components/product-hero/trust-bullets.d.ts +5 -0
  162. package/dist/render/components/product-hero/trust-bullets.js +1 -0
  163. package/dist/render/components/useModalDismiss.d.ts +2 -1
  164. package/dist/render/components/useModalDismiss.js +1 -1
  165. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  166. package/dist/render/components/wheels-plp/PlpNotifyMeDialog.js +1 -1
  167. package/dist/render/lib/booking/appointment-time.d.ts +2 -0
  168. package/dist/render/lib/booking/appointment-time.js +1 -0
  169. package/dist/render/lib/catalog/from-wheel.js +1 -1
  170. package/dist/render/lib/catalog/plp-item.js +1 -1
  171. package/dist/render/lib/checkout/stripe-appearance.d.ts +10 -0
  172. package/dist/render/lib/checkout/stripe-appearance.js +1 -0
  173. package/dist/render/lib/checkout/wallet-return.d.ts +1 -1
  174. package/dist/render/lib/commerce.d.ts +1 -0
  175. package/dist/render/lib/commerce.js +1 -1
  176. package/dist/render/lib/content/legacy-block-align.d.ts +2 -0
  177. package/dist/render/lib/content/legacy-block-align.js +1 -0
  178. package/dist/render/lib/content/menu-row.d.ts +0 -3
  179. package/dist/render/lib/content/menu-row.js +1 -1
  180. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
  181. package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
  182. package/dist/render/lib/document/blocks/commerce/CheckoutCTA/meta.js +1 -1
  183. package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
  184. package/dist/render/lib/document/blocks/commerce/CompatibleTyres/meta.js +1 -1
  185. package/dist/render/lib/document/blocks/commerce/DeliveryOptions/meta.js +1 -1
  186. package/dist/render/lib/document/blocks/commerce/DetailRows/meta.js +1 -1
  187. package/dist/render/lib/document/blocks/commerce/EuTyreLabel/meta.js +1 -1
  188. package/dist/render/lib/document/blocks/commerce/FitmentFinder/meta.js +1 -1
  189. package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.js +1 -1
  190. package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
  191. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +6 -0
  192. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
  193. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  194. package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
  195. package/dist/render/lib/document/blocks/commerce/SpecTable/meta.js +1 -1
  196. package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
  197. package/dist/render/lib/document/blocks/commerce/TyreFitment/meta.js +1 -1
  198. package/dist/render/lib/document/blocks/commerce/TyreSizes/meta.js +1 -1
  199. package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -1
  200. package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
  201. package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -1
  202. package/dist/render/lib/document/blocks/service/FooterSocial/meta.js +1 -1
  203. package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -1
  204. package/dist/render/lib/document/blocks/service/OpeningHours/meta.js +1 -1
  205. package/dist/render/lib/document/blocks/service/RateTable/meta.js +1 -1
  206. package/dist/render/lib/document/blocks/service/SubmitBuild/meta.js +1 -1
  207. package/dist/render/lib/document/blocks/service/Subscribe/meta.js +1 -1
  208. package/dist/render/lib/document/blocks/service/SubscribeBlogs/meta.js +1 -1
  209. package/dist/render/lib/document/lazy-draws.js +1 -1
  210. package/dist/render/lib/document/render-client.d.ts +8 -3
  211. package/dist/render/lib/document/render-client.js +1 -1
  212. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
  213. package/dist/render/lib/document/storefront-root.d.ts +0 -2
  214. package/dist/render/lib/document/storefront-root.js +1 -1
  215. package/dist/render/lib/field-input.d.ts +1 -0
  216. package/dist/render/lib/field-input.js +1 -0
  217. package/dist/render/lib/sections/content-cap-gutter.d.ts +1 -0
  218. package/dist/render/lib/sections/content-cap-gutter.js +1 -0
  219. package/dist/render/lib/sections/hero-trust-bullets.d.ts +2 -0
  220. package/dist/render/lib/sections/hero-trust-bullets.js +1 -0
  221. package/dist/render/lib/tyres/spec-sheet.d.ts +17 -0
  222. package/dist/render/lib/tyres/spec-sheet.js +1 -1
  223. package/dist/render/lib/use-scope-class.d.ts +1 -0
  224. package/dist/render/lib/use-scope-class.js +1 -0
  225. package/dist/render/lib/wheels/catalog-default-layout.d.ts +3 -3
  226. package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
  227. package/dist/render/lib/wheels/catalog-filters.d.ts +2 -2
  228. package/dist/render/lib/wheels/catalog-filters.js +1 -1
  229. package/dist/render/lib/wheels/grid-source.d.ts +7 -1
  230. package/dist/render/lib/wheels/grid-source.js +1 -1
  231. package/dist/render/lib/wheels/plp-hydrate.js +1 -1
  232. package/dist/words.d.ts +46 -45
  233. package/dist/words.js +6 -6
  234. package/package.json +4 -4
  235. package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +0 -4
  236. package/dist/chunks/chunk-3TBLX25X.js +0 -1
  237. package/dist/chunks/chunk-4V6BLJSG.js +0 -1
  238. package/dist/chunks/chunk-WPHE7RI4.js +0 -246
  239. package/dist/render/components/product-hero/hero-content.d.ts +0 -7
  240. package/dist/render/components/product-hero/hero-content.js +0 -1
  241. package/dist/render/components/useIsLightTheme.d.ts +0 -1
  242. package/dist/render/components/useIsLightTheme.js +0 -1
  243. package/dist/render/lib/content/product-hero.d.ts +0 -14
  244. package/dist/render/lib/content/product-hero.js +0 -1
  245. package/dist/render/lib/wheels/collections.d.ts +0 -22
  246. package/dist/render/lib/wheels/collections.js +0 -1
  247. /package/dist/chunks/{chunk-WPHE7RI4.js.LEGAL.txt → chunk-3IQQNZIM.js.LEGAL.txt} +0 -0
  248. /package/dist/chunks/{chunk-SJODSVWU.js → chunk-5NXOTPHK.js} +0 -0
package/dist/contract.js CHANGED
@@ -1,4 +1,4 @@
1
- var u=["general","commerce","service"],i=[{key:"openers",title:"Hero & intros",defaultExpanded:!0,templateable:!0,sections:[{type:"Hero",label:"Hero Slideshow",set:"general"},{type:"HeroSingle",label:"Hero",set:"general"},{type:"IntroBleed",label:"Scroll-Over Text",set:"general"}]},{key:"shop",title:"Shop & galleries",templateable:!0,sections:[{type:"Collections",label:"Collections",set:"commerce"},{type:"AlloyWheelsListing",label:"List",set:"commerce"},{type:"CatalogFilterBar",label:"Catalog Filter Bar",set:"commerce"},{type:"ProductGrid",label:"Product Grid",set:"commerce"},{type:"FitmentFinder",label:"Fitment Form",set:"commerce"},{type:"Gallery",label:"Tabbed Gallery",set:"commerce"},{type:"GalleryB",label:"Customer Photo Grid",set:"commerce"},{type:"SpecStrip",label:"Spec Strip",set:"general"}]},{key:"product",title:"Product page",templateable:!0,sections:[{type:"ProductHero",label:"Product Hero",set:"commerce"},{type:"SpecTable",label:"Spec Table",set:"commerce"},{type:"ProcessSteps",label:"Image & Text Columns",set:"general"},{type:"DetailRows",label:"Feature Rows",set:"commerce"},{type:"FitmentTable",label:"Fitment Table",set:"commerce"},{type:"TyreSizes",label:"Tyre Sizes",set:"commerce"},{type:"TyreFitment",label:"Tyre Fitment Form",set:"commerce"},{type:"EuTyreLabel",label:"EU Tyre Label",set:"commerce"},{type:"RelatedProducts",label:"Related Products",set:"commerce"},{type:"BundleOffer",label:"Bundle Products",set:"commerce"}]},{key:"checkout",title:"Checkout & ordering",templateable:!0,sections:[{type:"OrderSummary",label:"Order Table",set:"general"},{type:"DeliveryOptions",label:"Delivery Options",set:"commerce"},{type:"PaymentBadges",label:"Payment Methods",set:"general"},{type:"CheckoutCTA",label:"Ready-to-Order Banner",set:"commerce"}]},{key:"about",title:"About & brand story",templateable:!0,sections:[{type:"Manifesto",label:"Brand Text",set:"general"},{type:"Timeline",label:"Story Timeline",set:"general"},{type:"Footprint",label:"Locations Map",set:"general"}]},{key:"content",title:"Text & content",templateable:!0,sections:[{type:"Prose",label:"Editorial Text",set:"general"},{type:"ParagraphsA",label:"Lead Text",set:"general"},{type:"Split",label:"Image & Text Split",set:"general"},{type:"Cards",label:"Cards",set:"general"}]},{key:"proof",title:"Stats & social proof",templateable:!0,sections:[{type:"Stats",label:"Stats",set:"general"},{type:"StatsParagraph",label:"Stats with Text",set:"general"},{type:"Chart",label:"Chart",set:"general"},{type:"Mockup",label:"Mockup Card",set:"general"},{type:"Testimonials",label:"Testimonials",set:"general"},{type:"Reviews",label:"Reviews",set:"service"},{type:"Logos",label:"Logos",set:"general"}]},{key:"promo",title:"Promotions & sign-ups",templateable:!0,sections:[{type:"Banner",label:"Banner",set:"general"},{type:"TitleWithButtons",label:"Call-to-Action Heading",set:"general"},{type:"Ticker",label:"Scrolling Bar",set:"general"},{type:"Countdown",label:"Countdown",set:"general"},{type:"Subscribe",label:"Signup Form",set:"service"}]},{key:"blog",title:"Blog & journal",templateable:!0,sections:[{type:"Masthead",label:"Issue Header",set:"general"},{type:"FeaturedCover",label:"Feature Banner",set:"general"},{type:"LongRead",label:"Article Text",set:"general"},{type:"Series",label:"Recurring Columns",set:"general"},{type:"Events",label:"Latest Posts",set:"service"}]},{key:"navigation",title:"Navigation & wayfinding",templateable:!0,sections:[{type:"Breadcrumb",label:"Breadcrumb",set:"general"},{type:"CategoryBar",label:"Category Bar",set:"general"},{type:"DocTabs",label:"Document Tabs",set:"general"}]},{key:"legal",title:"Legal & documents",templateable:!0,sections:[{type:"DocMasthead",label:"Document Header",set:"general"},{type:"DocBody",label:"Document Text",set:"general"},{type:"DocMetaCards",label:"Document Detail Cards",set:"general"}]},{key:"contact",title:"Contact, FAQ & forms",templateable:!0,sections:[{type:"FAQ",label:"Q&A",set:"general"},{type:"ContactRouting",label:"Contact Form",set:"service"},{type:"ContactLocations",label:"Contact / Locations",set:"general"},{type:"SubmitBuild",label:"Photo Submission Form",set:"service"},{type:"ReviewForm",label:"Review Form",set:"service"},{type:"Form",label:"Form",set:"service"},{type:"AppointmentBooking",label:"Booking Form",set:"service"}]},{key:"structure",title:"Layout, structure & embeds",templateable:!1,sections:[{type:"SectionHeader",label:"Section Header",set:"general"},{type:"Flex",label:"Box",set:"general"},{type:"Divider",label:"Divider",set:"general"},{type:"CustomHTML",label:"Custom HTML",set:"general"}]}];var b={Grid:'Lewis, 2026-09-14: Box and Grid duplicate each other and it feels confusing. 2026-09-15 he chose the order: give Box uneven widths FIRST, then merge Grid into Box. Shown three ways to pick the widths (mockup "Uneven Box Widths"), he chose A \u2014 shape pictures on the Box\'s `Block widths` row, the same "a row is a shape, pick a picture of it" rule he set for the photo wall on 2026-09-07.\n\nWHAT REPLACES IT: a Box set to One row, with `Block widths` at Equal or a shape (Big left, Big right, Bigger left, Bigger right) and its own `Columns` in the Phone view. Measured on PRODUCTION 2026-09-16 ~09:28 AEST (database `efficient-system`, all 10 tenant schemas, 128 storefront pages, both `layout` and `published_layout` \u2014 256 documents): 2 Grid nodes, and they are ONE Grid counted twice \u2014 the 9DIEM homepage on 9diem.com (`xtreme_mudder` schema), once as draft and once as published. It is top-level, holds three `ImageBlock`s at `columns` 3 \u2014 equal thirds \u2014 and NO block sets `Positions`. A Box draws that with `Block widths` at Equal.\n\n\u26A0\uFE0F THE COUNT MOVES; THE RULE MUST NOT DEPEND ON IT. This entry has already carried three different readings. A local-clone snapshot said no Grid used `Positions`. A PRODUCTION reading on 2026-09-15 ~13:15 AEST found 6 nodes on two sites, 4 of them spanned \u2014 hartesmetal.com.au homepage and about, 4 columns, spans 1 + 3. That one was TRUE when it was taken and stopped being true the same day: those two pages were rebuilt on Box (`Block widths: Bigger right`), and on 2026-09-16 they hold zero Grid nodes and are built from `Flex`. \u26D4 So the rule is NOT "there are still N spanned Grids". NEVER delete the Grid component or its `gridSpan` handling, whatever a census says \u2014 Grid still renders, still edits, still drags, and a merchant may rebuild a page either way on any day. Re-run the census on production before anyone PROPOSES deleting either, and read any number written here as the reading of its own day, not as the state of the world.\n\nWHAT A MERCHANT LOSES: a new Grid, and with it a fixed "N per row" that wraps by itself past three across, and the per-block `Positions` number. Box wraps with `Wrap`, but by content width, not by a fixed count.\n\nTHE TYPE KEY STAYS AND SO DOES THE COMPONENT. Every page holding a Grid still renders through it and can still be edited, dragged and added to; no document is rewritten and NO MIGRATION RUNS \u2014 the owner redoes live sections himself.\n\n\u26A0\uFE0F AND IT STAYS DROPPABLE WHERE IT LIVES. The drop rule in lib/document/config.tsx read the nestable containers off the catalogue\'s `structure` row, so leaving the catalogue would have made every open slot \u2014 a Box included \u2014 refuse a Grid already stored inside one. `scripts/test-retired-grid-stays-editable.tsx` \xA73 pins it.',CompatibleTyres:'Lewis, 2026-09-09: "Do not bother counting. Delete Compatible Tyres and use the new one. The new one needs complete settings \u2014 it must have every setting our cards have." Shown three ways to finish it, he chose C: retire from the menu now, and take styling the card text as its own card.\n\nWHAT REPLACES IT: `RelatedProducts` with its `Show` dropdown set to "Tyres that fit this product". That block is the GENERIC relationship section from card 1128 \u2014 it knows nothing about wheels or tyres, it asks the registry for a relationship by name. The two have rendered through the SAME renderer (`DynamicRelatedProducts`) since that card; this one is the pre-registry one-off that was never removed.\n\n\u26A0\uFE0F THE SWAP WAS NOT SAFE UNTIL #1305, AND SAYING SO IS THE POINT. The first old-versus-new table put in front of the owner was WRONG. `DynamicRelatedProducts` returns EARLY on a tyre answer and draws this component, so the seven card settings, the head split and the Width control all stopped at that call \u2014 nine settings, measured NO EFFECT, on precisely the relationship that replaces this block. #1283 gave the new block the card settings, #1299 the head split and its own Width, #1305 carried all of it onto the tyre branch. Only then was the claim true.\n\nWHAT WAS MEASURED BEFORE RETIRING, four ways, because the premise decides the card:\n \u2022 settable text kinds (SECTION_TEXT_KINDS): both blocks ABSENT \u2014 the map holds only TimelineTrack and Footprint, both AUTHORED lists\n \u2022 read-only text regions: neither `components/CompatibleTyres` nor `components/TyreCard` stamps one\n \u2022 panel rows through resolveFields: this block 31, `RelatedProducts` 42. This block\'s only style-ish key is `_sStyle`, the bucket HEADER, not a control\n \u2022 head text (num/title/description) is authored on both, so `_partStyles` reaches it identically\nSo on the CARD runs the two are zero against zero \u2014 neither can style them \u2014 and everywhere else the new block is ahead. Styling those runs needs a section-level prop family and a paint path for DERIVED text, which no section has yet: a part is anchored by matching an AUTHORED prop\'s string against the DOM, and `lib/document/source-bound-parts` keeps hydrated copy unreachable on purpose so a merchant cannot type into a copy of a product name and lose it at the next sync. That is its own card, and `lib/sections/text-regions` is the read-only half that already ships.\n\nTHE TYPE KEY STAYS AND SO DOES THE COMPONENT, the same contract Subscribe, Split and SubscribeBlogs have. Every page holding a `CompatibleTyres` still renders through it, no published document is rewritten, and NO MIGRATION RUNS \u2014 the owner\'s standing ruling of 2026-09-05: he redoes live sections himself and deletes the old ones when he does. He also said explicitly not to count them first.\n\n\u26A0\uFE0F AND THIS COMPONENT IS LOAD-BEARING FOR ITS OWN REPLACEMENT: `DynamicRelatedProducts` draws it for EVERY tyre answer. Deleting it would blank the block that replaces it, not just the pages still holding this one.',TimelineTrack:"Lewis, 2026-10-09/10 (decisions.md ND, approved): the horizontal year rail and the Story Timeline do one job, so the rail becomes the Story Timeline's fourth Display, Track. Retired by card [MERGE] One Text Block And Click Through Parts (2026-10-22).\n\nWHAT REPLACES IT: a Story Timeline (`Timeline`) with Display set to Track. It draws this section's own component (`components/TimelineTrack`), so for the same words it draws the same bytes: the band colour (`Background color`, the same built-in), the padding, the CTA and each milestone's `Upcoming` switch (shown on each entry under Track only). An entry's `Body` is the rail's blurb. `scripts/test-timeline-track-display.tsx` \xA72 holds the bytes.\n\nWHAT A MERCHANT LOSES on a NEW rail, said plainly: (1) the head cannot move into a box of its own (`headPlacement`); the layered rebuild puts a head in one Box with its content anyway. (2) The year and title of every milestone are not one text kind: each run is styled on its own. (3) The Width rows follow the Story Timeline's family (`background`), not the rail's (`capped`).\n\nTHE TYPE KEY STAYS AND SO DOES THE COMPONENT. Every page holding a Milestone Timeline still renders through it and can still be edited; no document is rewritten and NO MIGRATION RUNS.",Spacer:`Lewis, 2026-10-10 (section-merges.md group 19, approved): one Divider holds space and lines. Style = None (was Spacer) / Line / Stripes; the space above and below as number boxes. Retired by card [MERGE] Spacer Into Divider (2026-10-26).
1
+ var m=["general","commerce","service"],l=[{key:"openers",title:"Hero & intros",defaultExpanded:!0,templateable:!0,sections:[{type:"Hero",label:"Hero Slideshow",set:"general"},{type:"HeroSingle",label:"Hero",set:"general"},{type:"IntroBleed",label:"Scroll-Over Text",set:"general"}]},{key:"shop",title:"Shop & galleries",templateable:!0,sections:[{type:"Collections",label:"Collections",set:"commerce"},{type:"AlloyWheelsListing",label:"List",set:"commerce"},{type:"CatalogFilterBar",label:"Catalog Filter Bar",set:"commerce"},{type:"ProductGrid",label:"Product Grid",set:"commerce"},{type:"FitmentFinder",label:"Fitment Form",set:"commerce"},{type:"Gallery",label:"Tabbed Gallery",set:"commerce"},{type:"GalleryB",label:"Customer Photo Grid",set:"commerce"}]},{key:"product",title:"Product page",templateable:!0,sections:[{type:"ProductHero",label:"Product Hero",set:"commerce"},{type:"SpecTable",label:"Spec Table",set:"commerce"},{type:"ProcessSteps",label:"Image & Text Columns",set:"general"},{type:"DetailRows",label:"Feature Rows",set:"commerce"},{type:"FitmentTable",label:"Fitment Table",set:"commerce"},{type:"TyreSizes",label:"Tyre Sizes",set:"commerce"},{type:"TyreFitment",label:"Tyre Fitment Form",set:"commerce"},{type:"EuTyreLabel",label:"EU Tyre Label",set:"commerce"},{type:"RelatedProducts",label:"Related Products",set:"commerce"},{type:"BundleOffer",label:"Bundle Products",set:"commerce"}]},{key:"checkout",title:"Checkout & ordering",templateable:!0,sections:[{type:"OrderSummary",label:"Order Table",set:"general"},{type:"DeliveryOptions",label:"Delivery Options",set:"commerce"},{type:"PaymentBadges",label:"Payment Methods",set:"general"},{type:"CheckoutCTA",label:"Ready-to-Order Banner",set:"commerce"}]},{key:"about",title:"About & brand story",templateable:!0,sections:[{type:"Footprint",label:"Locations Map",set:"general"}]},{key:"content",title:"Text & content",templateable:!0,sections:[{type:"Prose",label:"Editorial Text",set:"general"},{type:"ParagraphsA",label:"Lead Text",set:"general"},{type:"Cards",label:"Cards",set:"general"}]},{key:"proof",title:"Stats & social proof",templateable:!0,sections:[{type:"Stats",label:"Stats",set:"general"},{type:"StatsParagraph",label:"Stats with Text",set:"general"},{type:"Chart",label:"Chart",set:"general"},{type:"Mockup",label:"Mockup Card",set:"general"},{type:"Testimonials",label:"Testimonials",set:"general"},{type:"Reviews",label:"Reviews",set:"service"},{type:"Logos",label:"Logos",set:"general"}]},{key:"promo",title:"Promotions & sign-ups",templateable:!0,sections:[{type:"Banner",label:"Banner",set:"general"},{type:"TitleWithButtons",label:"Call-to-Action Heading",set:"general"},{type:"Countdown",label:"Countdown",set:"general"}]},{key:"blog",title:"Blog & journal",templateable:!0,sections:[{type:"Masthead",label:"Issue Header",set:"general"},{type:"FeaturedCover",label:"Feature Banner",set:"general"},{type:"LongRead",label:"Article Text",set:"general"},{type:"Series",label:"Recurring Columns",set:"general"},{type:"Events",label:"Latest Posts",set:"service"}]},{key:"navigation",title:"Navigation & wayfinding",templateable:!0,sections:[{type:"Breadcrumb",label:"Breadcrumb",set:"general"},{type:"CategoryBar",label:"Category Bar",set:"general"},{type:"DocTabs",label:"Document Tabs",set:"general"}]},{key:"legal",title:"Legal & documents",templateable:!0,sections:[{type:"DocMasthead",label:"Document Header",set:"general"},{type:"DocBody",label:"Document Text",set:"general"},{type:"DocMetaCards",label:"Document Detail Cards",set:"general"}]},{key:"contact",title:"Contact, FAQ & forms",templateable:!0,sections:[{type:"FAQ",label:"Q&A",set:"general"},{type:"ContactRouting",label:"Contact Form",set:"service"},{type:"ContactLocations",label:"Contact / Locations",set:"general"},{type:"SubmitBuild",label:"Photo Submission Form",set:"service"},{type:"ReviewForm",label:"Review Form",set:"service"},{type:"Form",label:"Form",set:"service"},{type:"AppointmentBooking",label:"Booking Form",set:"service"}]},{key:"structure",title:"Layout, structure & embeds",templateable:!1,sections:[{type:"SectionHeader",label:"Section Header",set:"general"},{type:"Flex",label:"Box",set:"general"},{type:"Divider",label:"Divider",set:"general"},{type:"CustomHTML",label:"Custom HTML",set:"general"}]},{key:"layouts",title:"Layouts",templateable:!0,sections:[{type:"Manifesto",label:"Brand Text",set:"general"},{type:"Split",label:"Image & Text Split",set:"general"},{type:"Subscribe",label:"Signup Form",set:"service"},{type:"Ticker",label:"Scrolling Bar",set:"general"},{type:"SpecStrip",label:"Spec Strip",set:"general"},{type:"TimelineTrack",label:"Milestone Timeline",set:"general"},{type:"Timeline",label:"Story Timeline",set:"general"}]}];var b={Grid:'Lewis, 2026-09-14: Box and Grid duplicate each other and it feels confusing. 2026-09-15 he chose the order: give Box uneven widths FIRST, then merge Grid into Box. Shown three ways to pick the widths (mockup "Uneven Box Widths"), he chose A \u2014 shape pictures on the Box\'s `Block widths` row, the same "a row is a shape, pick a picture of it" rule he set for the photo wall on 2026-09-07.\n\nWHAT REPLACES IT: a Box set to One row, with `Block widths` at Equal or a shape (Big left, Big right, Bigger left, Bigger right) and its own `Columns` in the Phone view. Measured on PRODUCTION 2026-09-16 ~09:28 AEST (database `efficient-system`, all 10 tenant schemas, 128 storefront pages, both `layout` and `published_layout` \u2014 256 documents): 2 Grid nodes, and they are ONE Grid counted twice \u2014 the 9DIEM homepage on 9diem.com (`xtreme_mudder` schema), once as draft and once as published. It is top-level, holds three `ImageBlock`s at `columns` 3 \u2014 equal thirds \u2014 and NO block sets `Positions`. A Box draws that with `Block widths` at Equal.\n\n\u26A0\uFE0F THE COUNT MOVES; THE RULE MUST NOT DEPEND ON IT. This entry has already carried three different readings. A local-clone snapshot said no Grid used `Positions`. A PRODUCTION reading on 2026-09-15 ~13:15 AEST found 6 nodes on two sites, 4 of them spanned \u2014 hartesmetal.com.au homepage and about, 4 columns, spans 1 + 3. That one was TRUE when it was taken and stopped being true the same day: those two pages were rebuilt on Box (`Block widths: Bigger right`), and on 2026-09-16 they hold zero Grid nodes and are built from `Flex`. \u26D4 So the rule is NOT "there are still N spanned Grids". NEVER delete the Grid component or its `gridSpan` handling, whatever a census says \u2014 Grid still renders, still edits, still drags, and a merchant may rebuild a page either way on any day. Re-run the census on production before anyone PROPOSES deleting either, and read any number written here as the reading of its own day, not as the state of the world.\n\nWHAT A MERCHANT LOSES: a new Grid, and with it a fixed "N per row" that wraps by itself past three across, and the per-block `Positions` number. Box wraps with `Wrap`, but by content width, not by a fixed count.\n\nTHE TYPE KEY STAYS AND SO DOES THE COMPONENT. Every page holding a Grid still renders through it and can still be edited, dragged and added to; no document is rewritten and NO MIGRATION RUNS \u2014 the owner redoes live sections himself.\n\n\u26A0\uFE0F AND IT STAYS DROPPABLE WHERE IT LIVES. The drop rule in lib/document/config.tsx read the nestable containers off the catalogue\'s `structure` row, so leaving the catalogue would have made every open slot \u2014 a Box included \u2014 refuse a Grid already stored inside one. `scripts/test-retired-grid-stays-editable.tsx` \xA73 pins it.',CompatibleTyres:'Lewis, 2026-09-09: "Do not bother counting. Delete Compatible Tyres and use the new one. The new one needs complete settings \u2014 it must have every setting our cards have." Shown three ways to finish it, he chose C: retire from the menu now, and take styling the card text as its own card.\n\nWHAT REPLACES IT: `RelatedProducts` with its `Show` dropdown set to "Tyres that fit this product". That block is the GENERIC relationship section from card 1128 \u2014 it knows nothing about wheels or tyres, it asks the registry for a relationship by name. The two have rendered through the SAME renderer (`DynamicRelatedProducts`) since that card; this one is the pre-registry one-off that was never removed.\n\n\u26A0\uFE0F THE SWAP WAS NOT SAFE UNTIL #1305, AND SAYING SO IS THE POINT. The first old-versus-new table put in front of the owner was WRONG. `DynamicRelatedProducts` returns EARLY on a tyre answer and draws this component, so the seven card settings, the head split and the Width control all stopped at that call \u2014 nine settings, measured NO EFFECT, on precisely the relationship that replaces this block. #1283 gave the new block the card settings, #1299 the head split and its own Width, #1305 carried all of it onto the tyre branch. Only then was the claim true.\n\nWHAT WAS MEASURED BEFORE RETIRING, four ways, because the premise decides the card:\n \u2022 settable text kinds (SECTION_TEXT_KINDS): both blocks ABSENT \u2014 the map holds only TimelineTrack and Footprint, both AUTHORED lists\n \u2022 read-only text regions: neither `components/CompatibleTyres` nor `components/TyreCard` stamps one\n \u2022 panel rows through resolveFields: this block 31, `RelatedProducts` 42. This block\'s only style-ish key is `_sStyle`, the bucket HEADER, not a control\n \u2022 head text (num/title/description) is authored on both, so `_partStyles` reaches it identically\nSo on the CARD runs the two are zero against zero \u2014 neither can style them \u2014 and everywhere else the new block is ahead. Styling those runs needs a section-level prop family and a paint path for DERIVED text, which no section has yet: a part is anchored by matching an AUTHORED prop\'s string against the DOM, and `lib/document/source-bound-parts` keeps hydrated copy unreachable on purpose so a merchant cannot type into a copy of a product name and lose it at the next sync. That is its own card, and `lib/sections/text-regions` is the read-only half that already ships.\n\nTHE TYPE KEY STAYS AND SO DOES THE COMPONENT, the same contract Subscribe, Split and SubscribeBlogs have. Every page holding a `CompatibleTyres` still renders through it, no published document is rewritten, and NO MIGRATION RUNS \u2014 the owner\'s standing ruling of 2026-09-05: he redoes live sections himself and deletes the old ones when he does. He also said explicitly not to count them first.\n\n\u26A0\uFE0F AND THIS COMPONENT IS LOAD-BEARING FOR ITS OWN REPLACEMENT: `DynamicRelatedProducts` draws it for EVERY tyre answer. Deleting it would blank the block that replaces it, not just the pages still holding this one.',Spacer:`Lewis, 2026-10-10 (section-merges.md group 19, approved): one Divider holds space and lines. Style = None (was Spacer) / Line / Stripes; the space above and below as number boxes. Retired by card [MERGE] Spacer Into Divider (2026-10-26).
2
2
 
3
3
  WHAT REPLACES IT: a Divider with Style set to None. It draws no line, only its space, and that space is the Divider's Padding row (top and bottom, each with its phone value): the Spacer's 24 / 48 / 96 / 160 px are None with Padding 12 + 12, 24 + 24, 48 + 48, 80 + 80. \`scripts/test-divider-holds-the-spacer.tsx\` \xA75 holds it.
4
4
 
@@ -12,4 +12,4 @@ WHAT REPLACES IT: a Cards section with Card style set to Label only. It draws th
12
12
 
13
13
  WHAT A MERCHANT LOSES on a NEW Label only section: nothing this section had. It GAINS the Cards head split (its head can move into a box of its own), which Key Features never had: that head draws the shared \`simple\` head, eyebrow ABOVE the heading, where Key Features drew it beside.
14
14
 
15
- THE TYPE KEY STAYS AND SO DOES THE COMPONENT. Every page holding a Key Features still renders through it and can still be edited; no document is rewritten and NO MIGRATION RUNS.`,SubscribeBlogs:"card 66396 \u2014 folded into `Subscribe`, which now chooses its rail's content with a `Type` control (the newsletter's own issues, or live blog posts). The two shared 21 of their fields and rendered THE SAME BYTES from equivalent rows, so offering both asked a merchant to choose between two names for one section. The type key stays because it is stored on published pages, and the component stays because those pages still render through it."};var A=Array.from(new Set([...i.flatMap(e=>e.sections.map(t=>t.type)),...Object.keys(b)])),O=Object.fromEntries(i.flatMap(e=>e.sections.map(t=>[t.type,t.label]))),g={Heading:"general",Text:"general",Eyebrow:"general",ImageBlock:"general",LogoBlock:"general",ButtonBlock:"general",PostCard:"general",HeroSlide:"general",HeroGroup:"general",Integrations:"general",Grid:"general",TimelineTrack:"general",KeyFeatures:"general",Spacer:"general",CollectionCard:"commerce",GalleryItem:"commerce",ProductRef:"commerce",CompatibleTyres:"commerce",Header:"commerce",SearchBlock:"commerce",CartBlock:"commerce",CountrySwitchBlock:"commerce",AccountBlock:"commerce",ThemeSwitchBlock:"commerce",ProductGallery:"commerce",EuTyreLabelBlock:"commerce",SubmitBox:"service",BookingBox:"service",SubscribeBlogs:"service",RatingBlock:"service",Footer:"service",FooterLogo:"service",FooterMenu:"service",FooterDivider:"service",FooterGroup:"service",FooterText:"service",FooterEmailSignup:"service",FooterSocial:"service",FooterPayment:"service",MenuBlock:"service",EmailFormBlock:"service",SocialLogosBlock:"service",PaymentLogosBlock:"service",LegalLineBlock:"service",SiteHeader:"service",SiteFooter:"service"},r={...g,...Object.fromEntries(i.flatMap(e=>e.sections.map(t=>[t.type,t.set])))};function T(e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}function l(e){return Object.keys(r).filter(t=>r[t]===e).sort()}var S=l("general"),E=l("commerce"),f=l("service");var w="Box",k=`${w}es`;var h=e=>!!e&&typeof e=="object"&&!Array.isArray(e),p=e=>h(e)&&typeof e.type=="string"&&h(e.props);var s=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),c=e=>p(e)&&e.type!=="";function y(e,t,o){if(Array.isArray(e))for(let a of e)c(a)?d(a,t,o):s(a)&&typeof a.type=="string"&&a.type!==""&&t.add(a.type)}function n(e,t,o){if(Array.isArray(e)){if(o.has(e))return;o.add(e);for(let a of e)c(a)?d(a,t,o):n(a,t,o)}else if(s(e)&&!o.has(e)){o.add(e);for(let a of Object.values(e))n(a,t,o)}}function d(e,t,o){if(!o.has(e)){o.add(e),t.add(e.type);for(let a of Object.values(e.props))n(a,t,o)}}function m(e){let t=new Set,o=new Set;if(c(e))d(e,t,o);else if(s(e)){if(y(e.content,t,o),s(e.zones))for(let a of Object.values(e.zones))y(a,t,o);s(e.root)&&n(e.root,t,o)}return[...t].sort()}export{u as BLOCK_SETS,E as COMMERCE_BLOCKS,S as GENERAL_BLOCKS,f as SERVICE_BLOCKS,T as blockSetOf,m as blockTypesIn};
15
+ THE TYPE KEY STAYS AND SO DOES THE COMPONENT. Every page holding a Key Features still renders through it and can still be edited; no document is rewritten and NO MIGRATION RUNS.`,SubscribeBlogs:"card 66396 \u2014 folded into `Subscribe`, which now chooses its rail's content with a `Type` control (the newsletter's own issues, or live blog posts). The two shared 21 of their fields and rendered THE SAME BYTES from equivalent rows, so offering both asked a merchant to choose between two names for one section. The type key stays because it is stored on published pages, and the component stays because those pages still render through it."};var A=Array.from(new Set([...l.flatMap(e=>e.sections.map(t=>t.type)),...Object.keys(b)])),O=Object.fromEntries(l.flatMap(e=>e.sections.map(t=>[t.type,t.label]))),g={Heading:"general",Text:"general",Eyebrow:"general",ImageBlock:"general",LogoBlock:"general",LocationMap:"general",ButtonBlock:"general",PostCard:"general",HeroSlide:"general",HeroGroup:"general",Integrations:"general",Grid:"general",KeyFeatures:"general",Spacer:"general",CollectionCard:"commerce",GalleryItem:"commerce",ProductRef:"commerce",CompatibleTyres:"commerce",Header:"commerce",SearchBlock:"commerce",CartBlock:"commerce",CountrySwitchBlock:"commerce",AccountBlock:"commerce",ThemeSwitchBlock:"commerce",ProductGallery:"commerce",EuTyreLabelBlock:"commerce",SubmitBox:"service",BookingBox:"service",SubscribeBlogs:"service",RatingBlock:"service",Footer:"service",FooterLogo:"service",FooterMenu:"service",FooterDivider:"service",FooterGroup:"service",FooterText:"service",FooterEmailSignup:"service",FooterSocial:"service",FooterPayment:"service",MenuBlock:"service",EmailFormBlock:"service",SocialLogosBlock:"service",PaymentLogosBlock:"service",LegalLineBlock:"service",SiteHeader:"service",SiteFooter:"service"},r={...g,...Object.fromEntries(l.flatMap(e=>e.sections.map(t=>[t.type,t.set])))};function f(e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}function i(e){return Object.keys(r).filter(t=>r[t]===e).sort()}var S=i("general"),T=i("commerce"),E=i("service");var w="Box",v=`${w}es`;var h=e=>!!e&&typeof e=="object"&&!Array.isArray(e),p=e=>h(e)&&typeof e.type=="string"&&h(e.props);var s=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),c=e=>p(e)&&e.type!=="";function y(e,t,o){if(Array.isArray(e))for(let a of e)c(a)?d(a,t,o):s(a)&&typeof a.type=="string"&&a.type!==""&&t.add(a.type)}function n(e,t,o){if(Array.isArray(e)){if(o.has(e))return;o.add(e);for(let a of e)c(a)?d(a,t,o):n(a,t,o)}else if(s(e)&&!o.has(e)){o.add(e);for(let a of Object.values(e))n(a,t,o)}}function d(e,t,o){if(!o.has(e)){o.add(e),t.add(e.type);for(let a of Object.values(e.props))n(a,t,o)}}function u(e){let t=new Set,o=new Set;if(c(e))d(e,t,o);else if(s(e)){if(y(e.content,t,o),s(e.zones))for(let a of Object.values(e.zones))y(a,t,o);s(e.root)&&n(e.root,t,o)}return[...t].sort()}export{m as BLOCK_SETS,T as COMMERCE_BLOCKS,S as GENERAL_BLOCKS,E as SERVICE_BLOCKS,f as blockSetOf,u as blockTypesIn};
@@ -1 +1 @@
1
- "use client";import{jsx as d,jsxs as S}from"react/jsx-runtime";import{GroupLabel as x}from"efficient-web-builder/editor/lib/document/controls";import{say as o,sayCount as b}from"efficient-web-builder/format/lib/editor-words";import{useEffect as A,useRef as P,useState as T}from"react";import{storefrontAdmin as _}from"../../render/lib/api/index.js";import{absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{getEditorToken as E}from"efficient-web-builder/render/lib/editor-auth";import{getEditorSiteId as L}from"efficient-web-builder/render/lib/editor-site";import{snapshotChanged as N}from"efficient-web-builder/editor/components/useSnapshotSource";import j from"efficient-web-builder/editor/components/SourceStatus";const B=12;let n=null,p=null;function C(t=!1){const e=L();if((t||p!==e)&&(n=null),!n){const i=E();p=e,n=_.listBlogPosts(i,{visibleOnly:!0,siteId:e}).catch(()=>null)}return n}function D(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"})}function U(t){return{slug:t.slug,title:t.title,excerpt:t.excerpt,cover:t.cover_image?v(t.cover_image)??"":"",meta:t.category||void 0,dateLabel:D(t.published_at)||void 0}}function k({value:t,onChange:e,snapshotCount:i=B}){const[r,l]=T("idle"),u=Array.isArray(t),g=u?t.length:0,a=P(!0),c=y=>{l("loading"),C(y).then(f=>{if(!a.current)return;if(f===null){l("error");return}l("idle");const m=f.slice(0,i).map(U);N(m,t??null)&&e(m)})};A(()=>(a.current=!0,c(!1),()=>{a.current=!1}),[]);const s=o("Storefront → Blog"),h=r==="loading"?o("Syncing from {place}…",{place:s}):r==="error"?o("Couldn’t reach {place}.",{place:s}):u?b("Auto-synced from {place} · {n} post","Auto-synced from {place} · {n} posts",g,{place:s}):o("Linking to {place}…",{place:s});return S("div",{children:[d(x,{label:"Blog posts"}),d(j,{status:r,statusText:h,onRefresh:()=>c(!0),busy:r==="loading",spaced:!1,hint:o("Auto-refreshes from the most-recent visible posts each time you open the editor. Set how many appear with “Posts to display”.")})]})}export{k as default,C as loadPosts,U as toEventPost};
1
+ "use client";import{jsx as u}from"react/jsx-runtime";import{PanelBand as S}from"efficient-web-builder/editor/lib/document/controls";import{say as o,sayCount as x}from"efficient-web-builder/format/lib/editor-words";import{useEffect as A,useRef as P,useState as b}from"react";import{storefrontAdmin as T}from"../../render/lib/api/index.js";import{absolutizeApiUrl as _}from"efficient-web-builder/render/lib/media";import{getEditorToken as v}from"efficient-web-builder/render/lib/editor-auth";import{getEditorSiteId as B}from"efficient-web-builder/render/lib/editor-site";import{snapshotChanged as E}from"efficient-web-builder/editor/components/useSnapshotSource";import N from"efficient-web-builder/editor/components/SourceStatus";const C=12;let s=null,p=null;function D(t=!1){const e=B();if((t||p!==e)&&(s=null),!s){const i=v();p=e,s=T.listBlogPosts(i,{visibleOnly:!0,siteId:e}).catch(()=>null)}return s}function L(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"})}function U(t){return{slug:t.slug,title:t.title,excerpt:t.excerpt,cover:t.cover_image?_(t.cover_image)??"":"",meta:t.category||void 0,dateLabel:L(t.published_at)||void 0}}function k({value:t,onChange:e,snapshotCount:i=C}){const[r,l]=b("idle"),c=Array.isArray(t),g=c?t.length:0,a=P(!0),f=y=>{l("loading"),D(y).then(m=>{if(!a.current)return;if(m===null){l("error");return}l("idle");const d=m.slice(0,i).map(U);E(d,t??null)&&e(d)})};A(()=>(a.current=!0,f(!1),()=>{a.current=!1}),[]);const n=o("Storefront → Blog"),h=r==="loading"?o("Syncing from {place}…",{place:n}):r==="error"?o("Couldn’t reach {place}.",{place:n}):c?x("Auto-synced from {place} · {n} post","Auto-synced from {place} · {n} posts",g,{place:n}):o("Linking to {place}…",{place:n});return u("div",{children:u(S,{title:o("Blog posts"),children:u(N,{status:r,statusText:h,onRefresh:()=>f(!0),busy:r==="loading",spaced:!1,hint:o("Auto-refreshes from the most-recent visible posts each time you open the editor. Set how many appear with “Posts to display”.")})})})}export{k as default,D as loadPosts,U as toEventPost};
@@ -0,0 +1,22 @@
1
+ import { type WheelSummary } from "../../render/lib/api/index.js";
2
+ export interface CategoryFieldProps {
3
+ category: string;
4
+ onChange: (category: string) => void;
5
+ categoryNames: string[];
6
+ readOnly?: boolean;
7
+ label?: string;
8
+ allLabel?: string;
9
+ }
10
+ export declare function CategoryField({ category, onChange, categoryNames, readOnly, label, allLabel, }: CategoryFieldProps): import("react").JSX.Element;
11
+ export interface CategoryProductFieldsProps extends CategoryFieldProps {
12
+ products: WheelSummary[];
13
+ product: string;
14
+ onProductChange: (slug: string) => void;
15
+ emptyLabel: string;
16
+ extraOptions?: {
17
+ label: string;
18
+ value: string;
19
+ }[];
20
+ productReadOnly?: boolean;
21
+ }
22
+ export default function CategoryProductFields({ products, product, onProductChange, emptyLabel, extraOptions, productReadOnly, ...categoryRow }: CategoryProductFieldsProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e,Fragment as d,jsxs as p}from"react/jsx-runtime";import{SettingsField as s}from"efficient-easel/panel";import{FieldSelect as c}from"efficient-easel/fields";import{BlockProductIcon as g,CategoryIcon as f}from"efficient-easel/icons";import{ALL_CATEGORY as b}from"./useCategoryFilter.js";import{say as a}from"efficient-web-builder/format/lib/editor-words";function y({category:l,onChange:t,categoryNames:n,readOnly:i,label:o=a("Category"),allLabel:u=a("All products")}){return e(s,{label:o,icon:e(f,{}),children:e(c,{value:l,ariaLabel:o,onChange:t,readOnly:i,options:[{label:u,value:b},...n.map(r=>({label:r,value:r}))]})})}function C({products:l,product:t,onProductChange:n,emptyLabel:i,extraOptions:o=[],productReadOnly:u,...r}){return p(d,{children:[e(y,{...r}),e(s,{label:a("Product"),icon:e(g,{}),children:e(c,{value:t,ariaLabel:a("Product"),onChange:n,readOnly:u,options:[{label:i,value:""},...o,...l.map(m=>({label:m.name,value:m.slug}))]})})]})}export{y as CategoryField,C as default};
@@ -1,4 +1,16 @@
1
1
  import type { CategorySourceValue } from "../../render/lib/content/source-values.js";
2
+ import { type AdminStorefrontCategory } from "../../render/lib/api/index.js";
3
+ export declare const PRODUCT_CONTENT_MANUAL = "Manual";
4
+ export declare const PRODUCT_CONTENT_CATEGORY = "Category";
5
+ export type ProductContentOption = {
6
+ label: string;
7
+ value: string;
8
+ group?: string;
9
+ };
10
+ export declare function productContentOptions(categories: readonly AdminStorefrontCategory[], value: CategorySourceValue | null | undefined): {
11
+ options: ProductContentOption[];
12
+ selected: string;
13
+ };
2
14
  interface Props {
3
15
  value?: CategorySourceValue | null;
4
16
  onChange: (value: CategorySourceValue | null) => void;
@@ -1 +1 @@
1
- "use client";import{jsx as c,jsxs as j}from"react/jsx-runtime";import{slugify as L}from"efficient-shell/format";import{SettingsField as I}from"efficient-easel/panel";import{FieldSelect as U}from"efficient-easel/fields";import{CategoryIcon as D}from"efficient-easel/icons";import{say as o,sayCount as G}from"efficient-web-builder/format/lib/editor-words";import{useEffect as b,useRef as W,useState as a}from"react";import{loadProductCatalog as w}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as x}from"./useStorefrontCategories.js";import{COLLECTIONS as P}from"../../render/lib/wheels/collections.js";import{ALL_PRODUCTS_NAME as K,ALL_PRODUCTS_SLUG as u,rowsForGridSource as M}from"../../render/lib/wheels/grid-source.js";import X from"efficient-web-builder/editor/components/SourceStatus";const d="collection:";function $(e){return d+L(e)}function g(e){if(!e||!e.startsWith(d))return;const n=e.slice(d.length);return P.find(r=>L(r.key)===n)?.key}function f(e){return e.slug&&e.slug.trim()?e.slug:`cat-${e.id}`}function q(e,n){const r=g(e);if(r)return{slug:e,name:r,process:r};if(e===u)return{slug:e,name:K};const s=n.find(l=>f(l)===e);return s?{slug:e,name:s.name}:null}function T(e,n){if(g(e.slug)||e.slug===u)return e;const r=n.find(s=>f(s)===e.slug);return r&&r.name!==e.name?{...e,name:r.name}:e}function z({value:e,onChange:n}){const[r,s]=a(null),[l,h]=a(null),[m,y]=a(!1),[S,C]=a(!1),i=W(!0);b(()=>(i.current=!0,w().then(t=>{i.current&&h(t)}),x().then(t=>{i.current&&s(t)}),()=>{i.current=!1}),[]),b(()=>{if(!e?.slug||r===null)return;const t=T(e,r);t!==e&&n(t)},[r]);const N=t=>{n(t?q(t,r??[]):null)},R=()=>{e?.slug&&(y(!0),C(!1),Promise.all([x(!0),w(!0)]).then(([t,A])=>{if(!i.current)return;s(t),h(A);const k=T(e,t);k!==e&&n(k)}).catch(()=>{i.current&&C(!0)}).finally(()=>{i.current&&y(!1)}))},_=e?.slug&&l?M(e,l).length:0,E=e?.slug&&e.slug!==u&&!g(e.slug)&&!(r??[]).some(t=>f(t)===e.slug),F=S?"error":m?"loading":"idle",p=o("Storefront → Categories"),O=S?o("Couldn’t reach {place}.",{place:p}):m?o("Syncing from {place}…",{place:p}):G("Linked to “{name}” · {n} product","Linked to “{name}” · {n} products",_,{name:e?.name??""});return j("div",{children:[c(I,{label:o("Products source"),icon:c(D,{}),children:c(U,{value:e?.slug??"",ariaLabel:o("Products source"),onChange:N,options:[{label:o("None"),value:""},{label:o("All products"),value:u},...P.map(t=>({label:t.key,value:$(t.key),group:o("Collections")})),...E?[{label:o("{name} (unavailable)",{name:e.name}),value:e.slug}]:[],...(r??[]).map(t=>({label:t.name,value:f(t),group:o("Categories")}))]})}),e?.slug?c(X,{status:F,statusText:O,onRefresh:R,busy:m,hint:o("Shows this source’s products as they are now, here and on the live page. Set how many appear with “Wheels to display”. The wheels you pick below are ignored while a source is linked.")}):c("p",{className:"es-field-hint sf-hint-keep",style:{marginTop:7},children:o("Pick “All products” or a category from {place} to auto-fill this grid, or keep “None” to choose wheels yourself below.",{place:p})})]})}export{z as default};
1
+ "use client";import{jsx as a,jsxs as I}from"react/jsx-runtime";import{SettingsField as j}from"efficient-easel/panel";import{FieldSelect as D}from"efficient-easel/fields";import{CategoryIcon as F}from"efficient-easel/icons";import{say as o,sayCount as K}from"efficient-web-builder/format/lib/editor-words";import{useEffect as T,useRef as M,useState as f}from"react";import{loadProductCatalog as R}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as _}from"./useStorefrontCategories.js";import{ALL_PRODUCTS_NAME as w,ALL_PRODUCTS_SLUG as m,gridKindsOf as G,gridRowsOf as Y,productContentOf as g}from"../../render/lib/wheels/grid-source.js";import{plpKindNoun as $}from"../../render/lib/catalog/plp-item.js";import{Tooltip as q}from"efficient-shell/ui";import{useEasel as z}from"efficient-easel/easel";import B from"efficient-web-builder/editor/components/SourceStatus";const H="Manual",J="Category";function i(t){return t.slug&&t.slug.trim()?t.slug:`cat-${t.id}`}function Q(t,r){if(g(t)==="category")return r.find(n=>i(n)===t.slug)??r.find(n=>n.name===t.name)}function V(t,r){if(t===m)return{slug:t,name:w};const n=r.find(s=>i(s)===t);return n?{slug:t,name:n.name}:null}function N(t,r){if(g(t)!=="category")return t;const n=r.find(s=>i(s)===t.slug);return n&&n.name!==t.name?{...t,name:n.name}:t}function W(t,r){const n=g(r),s=Q(r,t),u=n==="category"&&!s;return{selected:n==="manual"?"":n==="all"?m:s?i(s):r.slug,options:[{label:H,value:""},{label:w,value:m},...u?[{label:o("{name} (unavailable)",{name:r.name}),value:r.slug}]:[],...t.map(l=>({label:l.name,value:i(l),group:J}))]}}function X({value:t,onChange:r}){const[n,s]=f(null),[u,p]=f(null),[l,h]=f(!1),[y,C]=f(!1),c=M(!0);T(()=>(c.current=!0,R().then(e=>{c.current&&p(e)}),_().then(e=>{c.current&&s(e)}),()=>{c.current=!1}),[]),T(()=>{if(!t?.slug||n===null)return;const e=N(t,n);e!==t&&r(e)},[n]);const P=e=>{r(e?V(e,n??[]):null)},A=()=>{t?.slug&&(h(!0),C(!1),Promise.all([_(!0),R(!0)]).then(([e,U])=>{if(!c.current)return;s(e),p(U);const O=N(t,e);O!==t&&r(O)}).catch(()=>{c.current&&C(!0)}).finally(()=>{c.current&&h(!1)}))},S=z(e=>e.selectedItem)?.props?.kinds,E=t?.slug&&u?Y(t,S,u).length:0,b=$(G(t,S)),x=W(n??[],t),d=o("Storefront → Categories"),L=y?"error":l?"loading":"idle",k=y?o("Couldn’t reach {place}.",{place:d}):l?o("Syncing from {place}…",{place:d}):K("{n} {one}","{n} {many}",E,{one:o(b.one),many:o(b.many)});return I("div",{children:[a(j,{label:o("Product content"),icon:a(F,{}),children:a(q,{className:"relative block w-full",content:t?.slug?null:o("Pick the products yourself below, or choose “All products” or a category from {place}.",{place:d}),children:a(D,{value:x.selected,ariaLabel:o("Product content"),onChange:P,options:x.options.map(e=>({...e,label:e.value===""||e.value===m?o(e.label):e.label,...e.group?{group:o(e.group)}:{}}))})})}),t?.slug?a(B,{status:L,statusText:k,onRefresh:A,busy:l,hint:o("Shows this source’s products as they are now, here and on the live page. Set how many appear with “Items to display”.")}):null]})}export{J as PRODUCT_CONTENT_CATEGORY,H as PRODUCT_CONTENT_MANUAL,X as default,W as productContentOptions};
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{Button as j}from"efficient-shell/ui";import{SettingsField as z}from"efficient-easel/panel";import{FieldSelect as E}from"efficient-easel/fields";import{CategoryIcon as I}from"efficient-easel/icons";import{useEffect as b,useRef as d,useState as T}from"react";import{loadStorefrontCategories as F}from"./useStorefrontCategories.js";import{snapshotChanged as W}from"efficient-web-builder/editor/components/useSnapshotSource";import{onCollectionCategoriesChanged as D}from"efficient-web-builder/format/lib/editor-events";import{useEaselHost as H}from"efficient-easel/screen/lib/host";import{say as t}from"efficient-web-builder/format/lib/editor-words";import{sizedImage as L}from"efficient-web-builder/format/lib/sized-image";import{resolveCategoryImage as P}from"../../render/components/CollectionCard.js";function C(e){return{id:e.id,name:e.name,slug:e.slug,description:e.description??"",image:e.image??""}}function _({value:e,onChange:s}){const N=H(),[a,x]=T(null),l=d(!0),m=d(e);m.current=e;const f=d(s);f.current=s;const p=(o=!1)=>F(o).then(r=>(l.current&&x(r),r)),h=o=>{const r=m.current;if(!r?.id)return;const c=o.find(R=>R.id===r.id);if(!c)return;const y=C(c);W(y,r)&&f.current(y)};b(()=>(l.current=!0,p().then(h),()=>{l.current=!1}),[]),b(()=>D(()=>{p(!0).then(h)}),[]);const v=o=>{if(!o){s(null);return}const r=(a??[]).find(c=>c.id===o);r&&s(C(r))},S=()=>{e?.id&&N.send("storefront-editor:open-category",{categoryId:e.id,name:e.name})},g=a===null,k=!!e?.id&&!(a??[]).some(o=>o.id===e.id),u=P(e?.image);return n("div",{children:[i(z,{label:t("Collection"),icon:i(I,{}),children:i(E,{value:e?.id??"",ariaLabel:t("Collection"),onChange:v,readOnly:g,options:[{label:g?t("Loading…"):t("None"),value:""},...k?[{label:t("{name} (unavailable)",{name:e.name}),value:e.id}]:[],...(a??[]).map(o=>({label:o.name,value:o.id}))]})}),e?.id?n("div",{className:"sf-blogsource",style:{marginTop:9},children:[n("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[n("div",{children:[i("div",{className:"sf-field-label",style:{opacity:.6},children:t("Name")}),i("div",{style:{fontWeight:600},children:e.name})]}),n("div",{children:[i("div",{className:"sf-field-label",style:{opacity:.6},children:t("Description")}),i("div",{style:{fontSize:13,opacity:e.description?.85:.5},children:e.description||t("No description yet")})]}),n("div",{children:[i("div",{className:"sf-field-label",style:{opacity:.6},children:t("Image")}),u?i("img",{...L(u,{fallbackWidth:640,maxWidth:960}),sizes:"320px",alt:"",style:{width:"100%",height:96,objectFit:"cover",borderRadius:8}}):i("div",{style:{fontSize:13,opacity:.5},children:t("No image yet")})]})]}),i(j,{variant:"secondary",size:"md",className:"sf-blogsource-action",style:{marginTop:10},onClick:S,children:t("Edit category ✎")}),i("p",{className:"es-field-hint sf-hint-keep",children:t("Name, description and image come from {place}. Edit them there — this card updates to match.",{place:t("Storefront → Categories")})})]}):i("p",{className:"es-field-hint sf-hint-keep",style:{marginTop:7},children:t("Pick a category from {place} to fill this card’s name, description and image. That content is edited in the category.",{place:t("Storefront → Categories")})})]})}export{_ as default};
1
+ "use client";import{jsx as i,jsxs as n}from"react/jsx-runtime";import{Button as j}from"efficient-shell/ui";import{SettingsField as z}from"efficient-easel/panel";import{FieldSelect as E}from"efficient-easel/fields";import{CategoryIcon as I}from"efficient-easel/icons";import{useEffect as b,useRef as d,useState as T}from"react";import{loadStorefrontCategories as F}from"./useStorefrontCategories.js";import{snapshotChanged as W}from"efficient-web-builder/editor/components/useSnapshotSource";import{onCollectionCategoriesChanged as D}from"efficient-web-builder/format/lib/editor-events";import{useEaselHost as H}from"efficient-easel/screen/lib/host";import{say as t}from"efficient-web-builder/format/lib/editor-words";import{sizedImage as L}from"efficient-web-builder/format/lib/sized-image";import{resolveCategoryImage as P}from"../../render/components/CollectionCard.js";function C(e){return{id:e.id,name:e.name,slug:e.slug,description:e.description??"",image:e.image??""}}function _({value:e,onChange:s}){const N=H(),[a,v]=T(null),l=d(!0),m=d(e);m.current=e;const f=d(s);f.current=s;const p=(o=!1)=>F(o).then(r=>(l.current&&v(r),r)),h=o=>{const r=m.current;if(!r?.id)return;const c=o.find(R=>R.id===r.id);if(!c)return;const y=C(c);W(y,r)&&f.current(y)};b(()=>(l.current=!0,p().then(h),()=>{l.current=!1}),[]),b(()=>D(()=>{p(!0).then(h)}),[]);const x=o=>{if(!o){s(null);return}const r=(a??[]).find(c=>c.id===o);r&&s(C(r))},S=()=>{e?.id&&N.send("storefront-editor:open-category",{categoryId:e.id,name:e.name})},g=a===null,k=!!e?.id&&!(a??[]).some(o=>o.id===e.id),u=P(e?.image);return n("div",{children:[i(z,{label:t("Collection"),icon:i(I,{}),children:i(E,{value:e?.id??"",ariaLabel:t("Collection"),onChange:x,readOnly:g,options:[{label:g?t("Loading…"):t("None"),value:""},...k?[{label:t("{name} (unavailable)",{name:e.name}),value:e.id}]:[],...(a??[]).map(o=>({label:o.name,value:o.id}))]})}),e?.id?n("div",{className:"sf-blogsource",style:{marginTop:9},children:[n("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[n("div",{children:[i("div",{className:"sf-field-label",style:{opacity:.6},children:t("Name")}),i("div",{style:{fontWeight:600},children:e.name})]}),n("div",{children:[i("div",{className:"sf-field-label",style:{opacity:.6},children:t("Description")}),i("div",{style:{fontSize:13,opacity:e.description?.85:.5},children:e.description||t("No description yet")})]}),n("div",{children:[i("div",{className:"sf-field-label",style:{opacity:.6},children:t("Image")}),u?i("img",{...L(u,{fallbackWidth:640,maxWidth:960}),sizes:"320px",alt:"",style:{width:"100%",height:96,objectFit:"cover",borderRadius:"var(--radius-card)"}}):i("div",{style:{fontSize:13,opacity:.5},children:t("No image yet")})]})]}),i(j,{variant:"secondary",size:"md",className:"sf-blogsource-action",style:{marginTop:10},onClick:S,children:t("Edit category ✎")}),i("p",{className:"es-field-hint sf-hint-keep",children:t("Name, description and image come from {place}. Edit them there — this card updates to match.",{place:t("Storefront → Categories")})})]}):i("p",{className:"es-field-hint sf-hint-keep",style:{marginTop:7},children:t("Pick a category from {place} to fill this card’s name, description and image. That content is edited in the category.",{place:t("Storefront → Categories")})})]})}export{_ as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as s,jsxs as r}from"react/jsx-runtime";import{PictureTiles as l}from"efficient-shell/ui";import{FlagUsIcon as c,GlobeIcon as u}from"efficient-shell/icons/efficient";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{COUNTRY_SHOW_AS as m,COUNTRY_SHOW_AS_LABEL as d,resolveCountryShowAs as p}from"../../render/lib/content/country-show-as.js";const t=e("span",{className:"inline-flex shrink-0 border border-current/20",children:e(c,{size:15})}),h={name:"UNITED STATES",code_currency:r(s,{children:["US",e("span",{className:"opacity-50",children:"·"}),"USD"]}),globe_code:r(s,{children:[e(u,{size:12,className:"shrink-0"}),"US"]}),currency:"USD",flag_code:r(s,{children:[t,"US"]}),flag:t};function f({kind:n}){return r("span",{"aria-hidden":!0,className:"inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-xs border border-current px-2 font-mono text-(length:--text-3xs) font-medium tracking-wider",children:[h[n],e("span",{className:"opacity-70",children:"▾"})]})}function b({value:n,onChange:i}){return e(l,{label:a(d),columns:2,captions:!0,value:p(n),onChange:i,options:m.map(o=>({value:o.value,label:a(o.label),picture:e(f,{kind:o.value})}))})}export{b as CountryShowAsTiles};
1
+ "use client";import{jsx as e,Fragment as o,jsxs as r}from"react/jsx-runtime";import{PictureTiles as l}from"efficient-shell/ui";import{FlagUsIcon as c,GlobeIcon as u}from"efficient-shell/icons/efficient";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{COUNTRY_SHOW_AS as m,COUNTRY_SHOW_AS_LABEL as d,resolveCountryShowAs as p}from"../../render/lib/content/country-show-as.js";const t=e("span",{className:"inline-flex shrink-0 border border-current/20",children:e(c,{size:15})}),h={name:"UNITED STATES",code_currency:r(o,{children:["US",e("span",{className:"opacity-50",children:"·"}),"USD"]}),globe_code:r(o,{children:[e(u,{size:12,className:"shrink-0"}),"US"]}),currency:"USD",flag_code:r(o,{children:[t,"US"]}),flag:t};function f({kind:n}){return r("span",{"aria-hidden":!0,className:"inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-xs border border-current px-2 font-mono text-(length:--text-3xs) font-medium tracking-wider",children:[h[n],e("span",{className:"opacity-70",children:"▾"})]})}function U({value:n,onChange:i}){return e(l,{label:a(d),columns:2,className:"w-full",captions:!0,value:p(n),onChange:i,options:m.map(s=>({value:s.value,label:a(s.label),picture:e(f,{kind:s.value})}))})}export{U as CountryShowAsTiles};
@@ -1,11 +1 @@
1
- "use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{ChatProvider as c}from"../../render/components/ChatContext.js";import p from"../../render/components/ChatWidget.js";import{usePreviewHeader as d}from"efficient-web-builder/render/components/PreviewHeaderContext";import{usePreviewChat as u}from"efficient-web-builder/editor/components/PreviewChatContext";import{CANVAS_ACCENT as r}from"efficient-web-builder/format/lib/canvas-accent";const f=`
2
- .sf-preview-chat-pick [aria-label] { cursor: pointer; }
3
- .sf-preview-chat-pick:hover [aria-label] {
4
- outline: 2px solid color-mix(in srgb, ${r} 45%, transparent);
5
- outline-offset: 3px;
6
- }
7
- .sf-preview-chat-pick[data-selected] [aria-label] {
8
- outline: 2px solid ${r};
9
- outline-offset: 3px;
10
- }
11
- `;function m(){const{chromePlaceholder:i,themeFromDocument:o}=d(),{chat:e,selected:l,select:s}=u();return i||o||!e.enabled?null:n("div",{className:"sf-preview-chat-pick","data-selected":l||void 0,onClick:a=>{a.stopPropagation(),s()},children:[t("style",{children:f}),t(c,{preview:!0,children:t(p,{title:e.title,subtitle:e.subtitle,greeting:e.greeting,look:e})})]})}export{m as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{ChatProvider as o}from"../../render/components/ChatContext.js";import l from"../../render/components/ChatWidget.js";import{usePreviewHeader as m}from"efficient-web-builder/render/components/PreviewHeaderContext";import{CHROME_ATTR as n}from"efficient-easel/easel";import{CHAT_CHROME_ID as u,usePreviewChat as a}from"efficient-web-builder/editor/components/PreviewChatContext";function c(){const{chromePlaceholder:t,themeFromDocument:i}=m(),{chat:e}=a();return t||i||!e.enabled?null:r("div",{[n]:u,children:r(o,{preview:!0,children:r(l,{title:e.title,subtitle:e.subtitle,greeting:e.greeting,look:e})})})}export{c as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as s,jsxs as o}from"react/jsx-runtime";import l from"next/dynamic";import{CartProvider as c}from"../../render/components/CartContext.js";import f from"../../render/components/CartDrawer.js";import{CurrencyProvider as p}from"../../render/components/CurrencyContext.js";import{usePreviewHeader as m}from"efficient-web-builder/render/components/PreviewHeaderContext";import{usePreviewSurface as u}from"efficient-web-builder/editor/components/PreviewSurfaceContext";import d from"efficient-easel/screen/components/UiIcon";import{shopSurface as x}from"../lib/storefront-shop-surfaces.js";import{say as i}from"efficient-web-builder/format/lib/editor-words";const h=l(()=>import("./EditorPreviewCheckout.js"),{ssr:!1});function b(){const{chromePlaceholder:n,themeFromDocument:t}=m(),{surface:e}=u();return n||t||!e||e!=="cart"&&e!=="checkout"?null:e==="checkout"?o(s,{children:[r(h,{}),r(a,{surface:e})]}):r(p,{children:o(c,{preview:!0,children:[r(f,{}),r(a,{surface:e})]})})}function a({surface:n}){const{label:t,href:e}=x(n);return o("div",{style:{position:"fixed",bottom:14,left:"50%",transform:"translateX(-50%)",zIndex:2147483e3,display:"flex",alignItems:"center",gap:8,maxWidth:"calc(100% - 24px)",padding:"5px 6px 5px 13px",borderRadius:999,fontSize:12,fontWeight:600,fontFamily:"system-ui, sans-serif",color:"#334155",background:"rgba(255,255,255,0.94)",border:"1px solid rgba(15,23,42,0.12)",boxShadow:"0 6px 24px rgba(15,23,42,0.18)",pointerEvents:"none"},children:[r("span",{style:{whiteSpace:"nowrap"},children:i("{name} · preview only",{name:i(t)})}),o("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{pointerEvents:"auto",flex:"none",display:"inline-flex",alignItems:"center",gap:5,padding:"4px 11px",borderRadius:999,color:"#fff",background:"#2563eb",textDecoration:"none"},children:[i("Open live"),r(d,{name:"external-link",size:13,rounded:!0})]})]})}export{a as SurfaceRibbon,b as default};
1
+ "use client";import{jsx as r,Fragment as l,jsxs as o}from"react/jsx-runtime";import s from"next/dynamic";import{CartProvider as c}from"../../render/components/CartContext.js";import f from"../../render/components/CartDrawer.js";import{CurrencyProvider as m}from"../../render/components/CurrencyContext.js";import{usePreviewHeader as u}from"efficient-web-builder/render/components/PreviewHeaderContext";import{usePreviewSurface as p}from"efficient-web-builder/editor/components/PreviewSurfaceContext";import d from"efficient-easel/screen/components/UiIcon";import{shopSurface as x}from"../lib/storefront-shop-surfaces.js";import{say as i}from"efficient-web-builder/format/lib/editor-words";const h=s(()=>import("./EditorPreviewCheckout.js"),{ssr:!1});function b(){const{chromePlaceholder:n,themeFromDocument:t}=u(),{surface:e}=p();return n||t||!e||e!=="cart"&&e!=="checkout"?null:e==="checkout"?o(l,{children:[r(h,{}),r(a,{surface:e})]}):r(m,{children:o(c,{preview:!0,children:[r(f,{}),r(a,{surface:e})]})})}function a({surface:n}){const{label:t,href:e}=x(n);return o("div",{className:"rounded-full py-1 pr-2 pl-3",style:{position:"fixed",bottom:14,left:"50%",transform:"translateX(-50%)",zIndex:2147483e3,display:"flex",alignItems:"center",gap:8,maxWidth:"calc(100% - 24px)",fontSize:12,fontWeight:600,fontFamily:"system-ui, sans-serif",color:"#334155",background:"rgba(255,255,255,0.94)",border:"1px solid rgba(15,23,42,0.12)",boxShadow:"0 6px 24px rgba(15,23,42,0.18)",pointerEvents:"none"},children:[r("span",{style:{whiteSpace:"nowrap"},children:i("{name} · preview only",{name:i(t)})}),o("a",{className:"rounded-(--radius-control) px-3 py-1",href:e,target:"_blank",rel:"noopener noreferrer",style:{pointerEvents:"auto",flex:"none",display:"inline-flex",alignItems:"center",gap:5,color:"#fff",background:"#2563eb",textDecoration:"none"},children:[i("Open live"),r(d,{name:"external-link",size:13,rounded:!0})]})]})}export{a as SurfaceRibbon,b as default};
@@ -1 +1 @@
1
- "use client";import{jsx as l,jsxs as h,Fragment as F}from"react/jsx-runtime";import{mediaGroupVehicle as O}from"../../render/lib/content/source-values.js";import{useEffect as P,useMemo as N,useState as S}from"react";import{IconButton as E,Tooltip as H}from"efficient-shell/ui";import{SettingsField as C}from"efficient-easel/panel";import{FieldSelect as v}from"efficient-easel/fields";import{BlockProductIcon as W,MediaIcon as G}from"efficient-easel/icons";import{loadProductCatalog as M}from"../../render/components/useProductCatalog.js";import{loadWheelMediaGroups as T}from"./useWheelMediaGroups.js";import $ from"efficient-easel/screen/components/UiIcon";import{say as n}from"efficient-web-builder/format/lib/editor-words";function y({label:o,hidden:a,onToggle:i}){return h("div",{className:"sf-field-head",children:[l("span",{className:"sf-field-label sf-field-label--inline",children:o}),i&&l(H,{content:a?n("Show on the card"):n("Hide on the card"),children:l(E,{size:"md","aria-pressed":!!a,"aria-label":a?n("Show on the card"):n("Hide on the card"),onClick:i,children:a?l($,{name:"eye-off",size:14}):l($,{name:"eye",size:14})})})]})}const V=[["photos","Photos"],["lifestyle","Lifestyle"],["accessories","Accessories"],["others","Others"],["videos","Videos"]];function w(o){switch(o){case"photos":return n("Photos");case"lifestyle":return n("Lifestyle");case"accessories":return n("Accessories");case"others":return n("Others");case"videos":return n("Videos");default:return String(o)}}function j(o){if(!o)return[];const a=[];for(const[i,r]of V)(o[i]??[]).forEach((s,u)=>{const d=(s.items??[]).filter(t=>t.kind==="image").map(t=>t.url);d.length!==0&&a.push({key:`${String(i)}:${u}`,label:s.name?`${w(i)} · ${s.name}`:w(i),name:s.name||r,vehicle:O(s),images:d})});return a}function I(o){return o?o.categories&&o.categories.length?o.categories:o.process?[o.process]:[]:[]}function k(o,a,i){const r=a?.find(c=>c.slug===o.code)??null;if(!r)return{name:void 0,href:void 0,cover:void 0,photos:[],vehicle:void 0,eyebrow:void 0};const s=o.group?i.find(c=>c.name===o.group):void 0,u=o.finish?r.finishes.find(c=>c.name===o.finish&&c.src):void 0;let d,t=[];return s&&s.images.length?(d=s.images[0],t=s.images.slice(1)):(d=u?.src||r.coverImage||void 0,t=[]),{name:r.name,href:`/wheels/${r.slug}`,cover:d,photos:t,vehicle:s?.vehicle||void 0,eyebrow:void 0}}function B({value:o,onChange:a}){const i=N(()=>o??{},[o]),[r,s]=S(null),[u,d]=S([]),[t,c]=S(!1);P(()=>{let e=!1;return M().then(f=>{e||s(f)}),()=>{e=!0}},[]),P(()=>{let e=!1;if(!i.code){d([]);return}return c(!0),T(i.code).then(f=>{e||(d(j(f)),c(!1))}),()=>{e=!0}},[i.code]);const m=N(()=>r?.find(e=>e.slug===i.code)??null,[r,i.code]),x=N(()=>I(m),[m]),L=r===null;function g(e,f=u){const b={...i,...e};a({...b,...k(b,r,f)})}function z(e){if(!e){a({});return}const f=r?.find(b=>b.slug===e)??null;g({code:e,category:I(f)[0]??"",finish:"",group:""},[])}function p(e){a({...i,[e]:!i[e]})}return h("div",{children:[l(C,{label:n("Product"),icon:l(W,{}),children:l(v,{value:i.code??"",ariaLabel:n("Product"),readOnly:L,onChange:z,options:[{label:L?n("Loading…"):n("Select a product…"),value:""},...(r??[]).map(e=>({label:e.name,value:e.slug}))]})}),i.code&&h(F,{children:[h("div",{className:`sf-field${i.hideName?" is-hidden":""}`,children:[l(y,{label:n("Title / product"),hidden:i.hideName,onToggle:()=>p("hideName")}),h("div",{style:{display:"flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:6,border:"1px solid var(--sf-field-border, rgba(128,128,128,0.3))",opacity:.75,fontSize:13},children:[m?.name??i.name??"—",l("span",{style:{opacity:.6},children:n("(auto)")})]})]}),h("div",{className:`sf-field${i.hideProcess?" is-hidden":""}`,children:[l(y,{label:n("Category"),hidden:i.hideProcess,onToggle:()=>p("hideProcess")}),l(v,{value:i.category??"",ariaLabel:n("Category"),readOnly:x.length===0,onChange:e=>g({category:e}),options:x.length===0?[{label:n("No categories on this product"),value:""}]:x.map(e=>({label:e,value:e}))})]}),l(C,{label:n("Media group"),icon:l(G,{}),hint:n("Its photos become the card cover and lightbox, and its car fills the Vehicle below. No group → the product’s cover image."),children:l(v,{value:i.group??"",ariaLabel:n("Media group"),readOnly:t,onChange:e=>g({group:e}),options:[{label:t?n("Loading…"):u.length===0?n("Cover image only (no media groups)"):n("Cover image only"),value:""},...u.map(e=>({label:e.label,value:e.name}))]})}),h("div",{className:`sf-field${i.hideEyebrow?" is-hidden":""}`,children:[l(y,{label:h(F,{children:[n("Vehicle")," ",l("span",{style:{fontWeight:400,opacity:.6},children:n("(from media group)")})]}),hidden:i.hideEyebrow,onToggle:()=>p("hideEyebrow")}),l("div",{style:{display:"flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:6,border:"1px solid var(--sf-field-border, rgba(128,128,128,0.3))",opacity:.75,fontSize:13},children:i.vehicle||"—"})]}),h("div",{className:`sf-field${i.hideFinish?" is-hidden":""}`,children:[l(y,{label:n("Finish"),hidden:i.hideFinish,onToggle:()=>p("hideFinish")}),l(v,{value:i.finish??"",ariaLabel:n("Finish"),onChange:e=>g({finish:e}),options:[{label:n("Default (the product’s default finish)"),value:""},...(m?.finishes??[]).map(e=>({label:e.src?e.name:n("{name} — no render",{name:e.name}),value:e.name,disabled:!e.src}))]})]})]})]})}export{B as default};
1
+ "use client";import{jsx as l,jsxs as u,Fragment as F}from"react/jsx-runtime";import{mediaGroupVehicle as O}from"../../render/lib/content/source-values.js";import{useEffect as P,useMemo as N,useState as S}from"react";import{IconButton as E,Tooltip as H}from"efficient-shell/ui";import{SettingsField as C}from"efficient-easel/panel";import{FieldSelect as v}from"efficient-easel/fields";import{BlockProductIcon as W,MediaIcon as G}from"efficient-easel/icons";import{loadProductCatalog as M}from"../../render/components/useProductCatalog.js";import{loadWheelMediaGroups as T}from"./useWheelMediaGroups.js";import $ from"efficient-easel/screen/components/UiIcon";import{say as n}from"efficient-web-builder/format/lib/editor-words";function y({label:o,hidden:a,onToggle:i}){return u("div",{className:"sf-field-head",children:[l("span",{className:"sf-field-label sf-field-label--inline",children:o}),i&&l(H,{content:a?n("Show on the card"):n("Hide on the card"),children:l(E,{size:"md","aria-pressed":!!a,"aria-label":a?n("Show on the card"):n("Hide on the card"),onClick:i,children:a?l($,{name:"eye-off",size:14}):l($,{name:"eye",size:14})})})]})}const V=[["photos","Photos"],["lifestyle","Lifestyle"],["accessories","Accessories"],["others","Others"],["videos","Videos"]];function w(o){switch(o){case"photos":return n("Photos");case"lifestyle":return n("Lifestyle");case"accessories":return n("Accessories");case"others":return n("Others");case"videos":return n("Videos");default:return String(o)}}function j(o){if(!o)return[];const a=[];for(const[i,r]of V)(o[i]??[]).forEach((s,h)=>{const d=(s.items??[]).filter(t=>t.kind==="image").map(t=>t.url);d.length!==0&&a.push({key:`${String(i)}:${h}`,label:s.name?`${w(i)} · ${s.name}`:w(i),name:s.name||r,vehicle:O(s),images:d})});return a}function I(o){return o?o.categories&&o.categories.length?o.categories:o.process?[o.process]:[]:[]}function k(o,a,i){const r=a?.find(c=>c.slug===o.code)??null;if(!r)return{name:void 0,href:void 0,cover:void 0,photos:[],vehicle:void 0,eyebrow:void 0};const s=o.group?i.find(c=>c.name===o.group):void 0,h=o.finish?r.finishes.find(c=>c.name===o.finish&&c.src):void 0;let d,t=[];return s&&s.images.length?(d=s.images[0],t=s.images.slice(1)):(d=h?.src||r.coverImage||void 0,t=[]),{name:r.name,href:`/wheels/${r.slug}`,cover:d,photos:t,vehicle:s?.vehicle||void 0,eyebrow:void 0}}function B({value:o,onChange:a}){const i=N(()=>o??{},[o]),[r,s]=S(null),[h,d]=S([]),[t,c]=S(!1);P(()=>{let e=!1;return M().then(f=>{e||s(f)}),()=>{e=!0}},[]),P(()=>{let e=!1;if(!i.code){d([]);return}return c(!0),T(i.code).then(f=>{e||(d(j(f)),c(!1))}),()=>{e=!0}},[i.code]);const m=N(()=>r?.find(e=>e.slug===i.code)??null,[r,i.code]),x=N(()=>I(m),[m]),L=r===null;function g(e,f=h){const b={...i,...e};a({...b,...k(b,r,f)})}function z(e){if(!e){a({});return}const f=r?.find(b=>b.slug===e)??null;g({code:e,category:I(f)[0]??"",finish:"",group:""},[])}function p(e){a({...i,[e]:!i[e]})}return u("div",{children:[l(C,{label:n("Product"),icon:l(W,{}),children:l(v,{value:i.code??"",ariaLabel:n("Product"),readOnly:L,onChange:z,options:[{label:L?n("Loading…"):n("Select a product…"),value:""},...(r??[]).map(e=>({label:e.name,value:e.slug}))]})}),i.code&&u(F,{children:[u("div",{className:`sf-field${i.hideName?" is-hidden":""}`,children:[l(y,{label:n("Title / product"),hidden:i.hideName,onToggle:()=>p("hideName")}),u("div",{style:{display:"flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:"var(--radius-control)",border:"1px solid var(--line)",opacity:.75,fontSize:13},children:[m?.name??i.name??"—",l("span",{style:{opacity:.6},children:n("(auto)")})]})]}),u("div",{className:`sf-field${i.hideProcess?" is-hidden":""}`,children:[l(y,{label:n("Category"),hidden:i.hideProcess,onToggle:()=>p("hideProcess")}),l(v,{value:i.category??"",ariaLabel:n("Category"),readOnly:x.length===0,onChange:e=>g({category:e}),options:x.length===0?[{label:n("No categories on this product"),value:""}]:x.map(e=>({label:e,value:e}))})]}),l(C,{label:n("Media group"),icon:l(G,{}),hint:n("Its photos become the card cover and lightbox, and its car fills the Vehicle below. No group → the product’s cover image."),children:l(v,{value:i.group??"",ariaLabel:n("Media group"),readOnly:t,onChange:e=>g({group:e}),options:[{label:t?n("Loading…"):h.length===0?n("Cover image only (no media groups)"):n("Cover image only"),value:""},...h.map(e=>({label:e.label,value:e.name}))]})}),u("div",{className:`sf-field${i.hideEyebrow?" is-hidden":""}`,children:[l(y,{label:u(F,{children:[n("Vehicle")," ",l("span",{style:{fontWeight:400,opacity:.6},children:n("(from media group)")})]}),hidden:i.hideEyebrow,onToggle:()=>p("hideEyebrow")}),l("div",{style:{display:"flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:"var(--radius-control)",border:"1px solid var(--line)",opacity:.75,fontSize:13},children:i.vehicle||"—"})]}),u("div",{className:`sf-field${i.hideFinish?" is-hidden":""}`,children:[l(y,{label:n("Finish"),hidden:i.hideFinish,onToggle:()=>p("hideFinish")}),l(v,{value:i.finish??"",ariaLabel:n("Finish"),onChange:e=>g({finish:e}),options:[{label:n("Default (the product’s default finish)"),value:""},...(m?.finishes??[]).map(e=>({label:e.src?e.name:n("{name} — no render",{name:e.name}),value:e.name,disabled:!e.src}))]})]})]})]})}export{B as default};
@@ -1 +1 @@
1
- "use client";import{jsx as d,jsxs as Q}from"react/jsx-runtime";import{mediaGroupVehicle as U}from"../../render/lib/content/source-values.js";import{SettingsField as N}from"efficient-easel/panel";import{FieldSelect as H}from"efficient-easel/fields";import{BlockProductIcon as X,CategoryIcon as Y}from"efficient-easel/icons";import{useEffect as L,useMemo as Z,useRef as w,useState as P}from"react";import{storefrontAdmin as v}from"../../render/lib/api/index.js";import{useEaselHost as ee}from"efficient-easel/screen/lib/host";import{getEditorToken as te}from"efficient-web-builder/render/lib/editor-auth";import{getEditorSiteId as re}from"efficient-web-builder/render/lib/editor-site";import{loadProductCatalog as I}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as oe}from"./useStorefrontCategories.js";import{useCategoryFilter as se}from"./useCategoryFilter.js";import{snapshotChanged as ne}from"efficient-web-builder/editor/components/useSnapshotSource";import ae from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as T}from"efficient-web-builder/format/lib/editor-words";const a="__all__";function ie(e,r){return r===a?e:e.filter(s=>s.process===r)}function p(e,r){return e.map(s=>({image:s.items[0]?.url,photos:s.items.map(o=>({src:o.url})),href:`/wheels/${r.slug}`,process:r.process,eyebrow:U(s),name:r.name,meta:s.finish})).filter(s=>!!s.image)}function W(e){const r=te();return r?v.getWheelDetail(r,e,{siteId:re()}):Promise.reject(new Error("editor not authenticated"))}async function le(e){const r=await W(e),s={slug:r.slug,name:r.name,process:r.process},o=r.mediaGroups??{photos:[],lifestyle:[],videos:[],accessories:[],others:[]};return{...s,vehicleCards:p(o.lifestyle??[],s),wheelCards:p(o.photos??[],s),othersCards:p(o.others??[],s)}}async function ce(e,r){const s=await Promise.all(e.map(i=>W(i.slug).catch(()=>null))),o=[],h=[],g=[];for(const i of s){if(!i)continue;const c={slug:i.slug,name:i.name,process:i.process},m=i.mediaGroups??{photos:[],lifestyle:[],videos:[],accessories:[],others:[]};o.push(...p(m.lifestyle??[],c)),h.push(...p(m.photos??[],c)),g.push(...p(m.others??[],c))}return{slug:a,name:r===a?"All products":r,process:"",vehicleCards:o,wheelCards:h,othersCards:g,category:r}}function ue({value:e,onChange:r}){const s=ee(),[o,h]=P(null),[g,i]=P(null),[c,m]=P(!1),[R,A]=P(!1),u=w(!0),y=w(e);y.current=e;const B=w(r);B.current=r;const F=(t,f=!1)=>{m(!0),f||A(!1),t().then(x=>{u.current&&(ne(x,y.current)&&B.current(x),A(!1))}).catch(()=>{u.current&&!f&&A(!0)}).finally(()=>{u.current&&m(!1)})},S=(t,f=!1)=>F(()=>le(t),f),C=(t,f=!1)=>F(()=>ce(ie(o??[],t),t),f);L(()=>(u.current=!0,I().then(t=>{u.current&&h(t)}),oe().then(t=>{u.current&&i(t)}),()=>{u.current=!1}),[]);const b=w(!1);L(()=>{if(b.current)return;const t=y.current;if(!t?.slug){b.current=!0;return}if(t.slug===a){if(o===null)return;b.current=!0,C(t.category??a,!0)}else b.current=!0,S(t.slug,!0)},[o]);const l=e?.slug===a,k=Z(()=>o&&e?.slug&&!l?o.find(t=>t.slug===e.slug)??null:null,[o,e?.slug,l]),{category:O,setCategory:E,categoryNames:D,filtered:M}=se(o,g);L(()=>{l?e?.category&&E(e.category):k?.process&&E(k.process)},[k,l,e?.category]);const G=o===null,_=!!e?.slug&&!l&&o!==null&&!k,V=t=>{if(!t){r(null);return}if(t===a){C(O);return}S(t)},$=t=>{E(t),y.current?.slug===a&&C(t)},q=()=>{e?.slug&&(I(!0).then(t=>{u.current&&h(t)}),l?C(e.category??a):S(e.slug))},z=()=>{e?.slug&&s.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},j=(e?.vehicleCards.length??0)+(e?.wheelCards.length??0)+(e?.othersCards?.length??0),J=R?"error":c?"loading":"idle",K=R?n("Couldn’t reach the product catalog."):c?n("Syncing media from the catalog…"):_?n("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):l?T("Linked to “{name}” · {n} card from all products’ media groups.","Linked to “{name}” · {n} cards from all products’ media groups.",j,{name:e?.name??""}):T("Linked to “{name}” · {n} card from its media groups.","Linked to “{name}” · {n} cards from its media groups.",j,{name:e?.name??""});return Q("div",{children:[d(N,{label:n("Category"),icon:d(Y,{}),children:d(H,{value:O,ariaLabel:n("Category"),onChange:$,readOnly:G,options:[{label:n("All products"),value:a},...D.map(t=>({label:t,value:t}))]})}),d(N,{label:n("Product"),icon:d(X,{}),children:d(H,{value:e?.slug??"",ariaLabel:n("Product"),onChange:V,readOnly:G||c,options:[{label:G?n("Loading…"):n("None (write the cards yourself)"),value:""},{label:n("All products"),value:a},..._?[{label:n("{name} (unavailable)",{name:e.name}),value:e.slug}]:[],...M.map(t=>({label:t.name,value:t.slug}))]})}),e?.slug?d(ae,{status:J,statusText:K,onRefresh:q,busy:c,edit:l?void 0:{label:n("Edit product ✎"),onClick:z},hint:l?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.")}):d("p",{className:"es-field-hint sf-hint-keep",style:{marginTop:7},children:n("Pick a product — or All products — to build the galleries from media groups, or keep “None” to author the cards yourself.")})]})}export{ue as default};
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 k,useState as b}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 T(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 T(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=>T(i.slug).catch(()=>null))),s=[],p=[],h=[];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)),p.push(...m(d.photos??[],l)),h.push(...m(d.others??[],l))}return{slug:a,name:r===a?"All products":r,process:"",vehicleCards:s,wheelCards:p,othersCards:h,category:r}}function ie({value:e,onChange:r}){const o=X(),[s,p]=b(null),[h,i]=b(null),[l,d]=b(!1),[L,P]=b(!1),u=k(!0),g=k(e);g.current=e;const O=k(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&&p(t)}),v().then(t=>{u.current&&i(t)}),()=>{u.current=!1}),[]);const C=k(!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:W,filtered:D}=ee(s,h);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&&p(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:W,readOnly:S,products:D,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 sf-hint-keep",style:{marginTop:7},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};
@@ -19,10 +19,14 @@ interface Props {
19
19
  onOpenWebsiteSettings?: () => void;
20
20
  }
21
21
  export default function HeaderSettingsPanel({ tokenRef, siteId, onClose, onAuthExpired, inline, placeholderMode, websiteName, onOpenWebsiteSettings, }: Props): import("react").JSX.Element;
22
- export declare function Field({ label, children, stacked, }: {
23
- label: string;
24
- children: React.ReactNode;
25
- stacked?: boolean;
22
+ export declare function PxSlider({ labelledBy, value, min, max, step, onPreview, onCommit, }: {
23
+ labelledBy: string;
24
+ value: number;
25
+ min: number;
26
+ max: number;
27
+ step: number;
28
+ onPreview: (px: number) => void;
29
+ onCommit?: (px: number) => void;
26
30
  }): import("react").JSX.Element;
27
31
  export declare const HEADER_SEGMENTED: {
28
32
  readonly logoPosition: {
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r,Fragment as B}from"react/jsx-runtime";import{useCallback as k,useEffect as V,useRef as le,useState as E}from"react";import{ApiError as He,storefrontAdmin as A}from"../../render/lib/api/index.js";import{requestMediaPick as Te}from"efficient-easel/screen/lib/media-picker";import{refreshSiteLiveState as Ee}from"efficient-web-builder/editor/lib/site-live-state";import{useEaselHost as fe}from"efficient-easel/screen/lib/host";import{onHeaderMenusChanged as Ae}from"efficient-web-builder/format/lib/editor-events";import{loadAllSitesMenus as Pe,refreshAllSitesMenus as Oe}from"../../render/lib/menu-source.js";import{headerMenuMissingWarning as Me}from"../../render/lib/content/menu-placeholder.js";import{say as l,sayCount as Re}from"efficient-web-builder/format/lib/editor-words";import{sayWith as ne}from"../lib/say-with.js";import{NEUTRAL_SITE_NAME as De}from"../../render/lib/content/site.js";import{SECTION_WIDTH_CHOICES as Ie,WIDTH_CHOICE_LABEL as ze}from"efficient-web-builder/format/lib/content/section-width";import{usePreviewHeader as Be}from"efficient-web-builder/render/components/PreviewHeaderContext";import{HEADER_LOGO_PX as ge,HEADER_LOGO_PX_MIN as Ge,HEADER_LOGO_PX_MAX as We}from"efficient-web-builder/render/components/Logo";import{HEADER_HEIGHT_PX as $,HEADER_MENU_GAP_PX as K}from"efficient-web-builder/render/lib/document/header-clearance";import Fe from"efficient-web-builder/editor/components/SectionThemePicker";import{HEADER_THEME_FOLLOW as be}from"../../render/lib/content/header-theme.js";import{resolveHeaderInkMode as Ue}from"efficient-web-builder/render/lib/document/header-ink";import{absolutizeApiUrl as je}from"efficient-web-builder/render/lib/media";import{loadHeaderSettings as Xe,primeHeaderSettings as Ve,clearHeaderSettingsCache as Ke,toPreviewHeaderSettings as qe}from"../lib/header-settings-source.js";import{Banner as Ye,Button as oe,Drawer as $e,InputNumber as Ze,LoadingSpinner as Je,MediaUploadField as Qe,ShowWhen as q,Slider as et,Tabs as tt,tabButtonId as lt,tabPanelId as nt}from"efficient-shell/ui";import{CountryShowAsTiles as ot}from"./CountryShowAsTiles.js";import{truthy as at,visibleFields as it}from"efficient-web-builder/render/lib/document/show-when";const st={field:"country_selector_enabled",is:!0},ae={not:{context:"placeholderMode",is:!0}},rt={field:"menu_position",is:"beside"},ct={all:[{field:"logo_position",is:"center"},{not:{field:"menu_position",is:"center"}}]},dt={all:[ae,at("country_selector_enabled")]};import{SettingsDefaultReset as ie,SettingsSwitch as W}from"efficient-easel/panel";import{FieldSelect as se}from"efficient-easel/fields";import{useEaselStrings as ut}from"efficient-easel/strings";import{ListIcon as ht,LogoIcon as mt,SettingsIcon as pt,StylesIcon as ft}from"efficient-easel/icons";import{GroupLabel as gt,Segmented as P}from"efficient-web-builder/editor/lib/document/controls";import{HintsToggle as re,SHOW_HINTS_DEFAULT as bt}from"efficient-web-builder/editor/components/WebsiteSettingsPanel";const ce="sf-header",_e="sf-header-size-label",xe="sf-header-gap-label",ve="sf-header-height-label",we=[{id:"logo",label:"Logo",icon:e(mt,{})},{id:"menu",label:"Menu",icon:e(ht,{}),showWhen:ae},{id:"tools",label:"Tools",icon:e(pt,{})},{id:"look",label:"Look",icon:e(ft,{})}];function _t({tokenRef:o,siteId:a,onClose:b,onAuthExpired:x,inline:O,placeholderMode:C,websiteName:v,onOpenWebsiteSettings:L}){const m=fe(),M=ut(),[n,_]=E(null),[R,S]=E(null),[D,Y]=E(!1),[u,N]=E(we[0].id),[c,T]=E(bt),F=n,Z={placeholderMode:C},J=Object.values(it(Object.fromEntries(we.map(t=>[t.id,t])),F,Z)),I=J.find(t=>t.id===u)??J[0],[Se,ye]=E(0),{setSettings:ue}=Be(),U=le(null),j=le(null),X=le(null);V(()=>{let t=!1,s=null,h=null;const d=3,H=(G,z=0)=>{t||S(null),Xe(G,a,z>0).then(Ne=>!t&&_(Ne)).catch(()=>{t||(z+1<d?h=setTimeout(()=>H(G,z+1),600*(z+1)):S(l("Could not load header settings.")))})},pe=o.current;if(pe)H(pe);else{let G=0;s=setInterval(()=>{const z=o.current;if(z){s&&clearInterval(s),s=null,t||S(null),H(z);return}G+=250,G===5e3&&!t&&S(l("Waiting for editor authorization…")),G>=3e4&&(s&&clearInterval(s),s=null,t||S(l("Not authorized yet — reopen once the editor has loaded.")))},250)}return()=>{t=!0,s&&clearInterval(s),h&&clearTimeout(h)}},[o,Se,a]),V(()=>{n&&ue(qe(n))},[n,ue]),V(()=>()=>{U.current&&clearTimeout(U.current),j.current&&clearTimeout(j.current),X.current&&clearTimeout(X.current)},[]);const g=k(async(t,s)=>{const h=o.current;if(!h||!n)return;const d=n;s&&_({...n,...s}),Y(!0),S(null);try{const H=await t(h);_(H),Ve(H,a),Ee()}catch(H){_(d),H instanceof He&&H.status===401?(Ke(a),x?.(),S(l("Authorization expired — try again in a moment."))):S(l("Could not save. Please retry."))}finally{Y(!1)}},[n,o,x,a]),p=k(t=>g(s=>A.updateHeaderSettings(t,s,a??void 0),t),[g,a]),he=k(t=>{g(s=>A.setHeaderLogoFromAsset(t,s,a??void 0))},[g,a]),Ce=k(()=>{Te(m,{accept:"image/svg+xml",title:l("Logo (SVG)")}).then(t=>{t&&he(t.id)})},[he]),Q=k((t,s=!0)=>{_(d=>d&&{...d,logo_size_px:t}),U.current&&clearTimeout(U.current);const h=()=>{g(d=>A.updateHeaderSettings({logo_size_px:t},d,a??void 0))};s?h():U.current=setTimeout(h,400)},[g,a]),ee=k((t,s=!0)=>{_(d=>d&&{...d,height_px:t}),j.current&&clearTimeout(j.current);const h=()=>{g(d=>A.updateHeaderSettings({height_px:t},d,a??void 0))};s?h():j.current=setTimeout(h,400)},[g,a]),te=k((t,s=!0)=>{_(d=>d&&{...d,menu_gap_px:t}),X.current&&clearTimeout(X.current);const h=()=>{g(d=>A.updateHeaderSettings({menu_gap_px:t},d,a??void 0))};s?h():X.current=setTimeout(h,400)},[g,a]),Le=k(()=>{g(async t=>{const s=await A.clearHeaderLogo(t,a??void 0);return s.reverse_logo?A.updateHeaderSettings({reverse_logo:!1},t,a??void 0):s})},[g,a]),ke=k(t=>{_(s=>s&&{...s,menu:t?.id??null,menu_handle:t?.handle??null,menu_name:t?.name??null,menu_items:t?t.items.map(h=>({label:h.label,url:h.url,dropdown_menu:h.dropdown_menu??null,dropdown_items:h.dropdown_items??[]})):[]}),g(s=>A.updateHeaderSettings({menu:t?.id??null},s,a??void 0))},[g,a]),me=r(B,{children:[R&&e(Ye,{tone:"danger",className:"mx-4 mt-3",action:n?void 0:e(oe,{variant:"secondary",size:"md",onClick:()=>ye(t=>t+1),children:l("Retry")}),children:R}),n?r(B,{children:[e(Et,{tabs:J,activeId:I.id,onSelect:N}),r("div",{id:nt(ce,I.id),role:"tabpanel","aria-labelledby":lt(ce,I.id),className:"flex flex-col p-4 [&>*+*]:mt-3",children:[I.id==="logo"&&r(B,{children:[e(w,{label:"Image"}),e(q,{rule:ae,values:F,context:Z,children:e(xt,{settings:n,websiteName:v,onPick:Ce,onClear:Le,showHint:c})}),e(f,{label:"Reverse the Logo",children:e(W,{checked:n.reverse_logo,onChange:t=>p({reverse_logo:t}),ariaLabel:l("Reverse the Logo")})}),e(y,{shown:c,children:l("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.")}),e(w,{label:"Placement"}),e(wt,{label:i.logoPosition.label,value:i.logoPosition.options.find(t=>t.value===i.logoPosition.choose(n.logo_position))?.label,children:e(P,{value:i.logoPosition.choose(n.logo_position),options:i.logoPosition.options,onChange:t=>p({logo_position:t}),ariaLabel:i.logoPosition.label})}),r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-center justify-between",children:[e("span",{id:_e,className:"text-xs text-[var(--ink-muted)]",children:l("Size")}),r("span",{className:"flex items-center gap-1",children:[r("span",{className:"sf-header-value text-[12px] tabular-nums text-[var(--ink-faint)]","data-changed":n.logo_size_px!=null||void 0,children:[n.logo_size_px??ge[n.logo_size],"px"]}),e(ie,{label:l("Size"),words:M.panel,changed:n.logo_size_px!=null,onReset:()=>Q(null)})]})]}),e(de,{labelledBy:_e,min:Ge,max:We,step:2,value:n.logo_size_px??ge[n.logo_size],onPreview:t=>Q(t,!1),onCommit:t=>Q(t,!0)}),e(y,{shown:c,children:l("Sets the logo’s height; the width follows the logo’s own proportions.")})]}),e(re,{shown:c,onChange:T})]}),I.id==="menu"&&r(B,{children:[e(w,{label:"Links"}),e(vt,{token:o.current,menuId:n.menu,menuName:n.menu_name,itemCount:n.menu_items?.length??0,onPick:ke}),e(f,{label:i.menuAlign.label,children:e(P,{value:i.menuAlign.choose(n.menu_position),options:i.menuAlign.options.filter(t=>t.value!=="beside"||n.logo_position!=="center"),onChange:t=>p({menu_position:t}),ariaLabel:i.menuAlign.label})}),e(q,{rule:rt,values:F,children:r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-center justify-between",children:[e("span",{id:xe,className:"text-xs text-[var(--ink-muted)]",children:l("Space from the logo")}),r("span",{className:"flex items-center gap-1",children:[r("span",{className:"sf-header-value text-[12px] tabular-nums text-[var(--ink-faint)]","data-changed":n.menu_gap_px!=null||void 0,children:[n.menu_gap_px??K.default,"px"]}),e(ie,{label:l("Space from the logo"),words:M.panel,changed:n.menu_gap_px!=null,onReset:()=>te(null)})]})]}),e(de,{labelledBy:xe,min:K.min,max:K.max,step:K.step,value:n.menu_gap_px??K.default,onPreview:t=>te(t,!1),onCommit:t=>te(t,!0)}),e(y,{shown:c,children:l("How much room the menu leaves the logo. Only the logo moves away; the space between the menu words stays as it is.")})]})}),e(f,{label:i.menuRow.label,children:e(P,{value:i.menuRow.choose(n.menu_row),options:i.menuRow.options,onChange:t=>p({menu_row:t}),ariaLabel:i.menuRow.label})}),e(q,{rule:ct,values:F,children:e(f,{label:"Left items",children:e("div",{className:"w-16",children:e(se,{value:n.menu_split??3,ariaLabel:l("Left items"),onChange:t=>p({menu_split:t}),options:[1,2,3,4].map(t=>({label:String(t),value:t}))})})})}),e(f,{label:i.navTextCase.label,children:e(P,{value:i.navTextCase.choose(n.nav_text_case),options:i.navTextCase.options,onChange:t=>p({nav_text_case:t}),ariaLabel:i.navTextCase.label})}),e(y,{shown:c,children:ne(l("{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:l("Uppercase")}),capitalised:e("strong",{children:l("Capitalised")})})})]}),I.id==="tools"&&r(B,{children:[e(w,{label:"Style"}),e(f,{label:i.utilStyle.label,children:e(P,{value:i.utilStyle.choose(n.util_style),options:i.utilStyle.options,onChange:t=>p({util_style:t}),ariaLabel:i.utilStyle.label})}),e(y,{shown:c,children:ne(l("{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:l("Text")})})}),e(w,{label:"Search"}),e(f,{label:"Search",children:e(W,{checked:n.search_enabled,onChange:t=>p({search_enabled:t}),ariaLabel:l("Search")})}),e(f,{label:i.searchPosition.label,children:e(P,{value:i.searchPosition.choose(n.search_position),options:i.searchPosition.options,onChange:t=>p({search_position:t}),ariaLabel:i.searchPosition.label})}),e(w,{label:"Country selector"}),e(f,{label:"Show selector",children:e(W,{checked:n.country_selector_enabled,onChange:t=>p({country_selector_enabled:t}),ariaLabel:l("Show selector")})}),e(q,{rule:st,values:{country_selector_enabled:n.country_selector_enabled},children:e(f,{label:"Show as",stacked:!0,children:e(ot,{value:n.country_selector_show_as,onChange:t=>p({country_selector_show_as:t})})})}),e(q,{rule:dt,values:F,context:Z,children:e(y,{shown:c,children:ne(l("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:l("Storefront › Settings › Regions & currencies")})})})}),e(w,{label:"Account and cart"}),e(f,{label:"Account",children:e(W,{checked:n.account_enabled??!0,onChange:t=>p({account_enabled:t}),ariaLabel:l("Account")})}),e(f,{label:"Cart",children:e(W,{checked:n.cart_enabled??!0,onChange:t=>p({cart_enabled:t}),ariaLabel:l("Cart")})}),e(w,{label:"Call"}),e(f,{label:"Call button",children:e(W,{checked:n.call_button??!1,onChange:t=>p({call_button:t}),ariaLabel:l("Call button")})}),e(y,{shown:c,children:l("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(re,{shown:c,onChange:T})]}),I.id==="look"&&r(B,{children:[e(w,{label:"Dimensions"}),e(f,{label:i.width.label,children:e(P,{value:i.width.choose(n.width),options:i.width.options,onChange:t=>p({width:t}),ariaLabel:i.width.label})}),r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-center justify-between",children:[e("span",{id:ve,className:"text-xs text-[var(--ink-muted)]",children:l("Height")}),r("span",{className:"flex items-center gap-1",children:[r("span",{className:"sf-header-value text-[12px] tabular-nums text-[var(--ink-faint)]","data-changed":n.height_px!=null||void 0,children:[n.height_px??$.default,"px"]}),e(ie,{label:l("Height"),words:M.panel,changed:n.height_px!=null,onReset:()=>ee(null)})]})]}),e(de,{labelledBy:ve,min:$.min,max:$.max,step:2,value:n.height_px??$.default,onPreview:t=>ee(t,!1),onCommit:t=>ee(t,!0)}),e(y,{shown:c,children:l("Sets how tall the header bar is; the content below it shifts down to match.")})]}),e(f,{label:"Border thickness",children:e("div",{className:"w-24",children:e(Ze,{value:n.border_thickness,min:0,max:20,precision:0,size:"md",suffix:"px","aria-label":l("Border thickness"),onChange:t=>p({border_thickness:Math.max(0,t??0)})})})}),e(w,{label:"Color"}),e(f,{label:"Theme",children:e(Fe,{value:n.theme??be,onChange:t=>p({theme:t===be?null:t}),followLabel:l("Follow the site theme")})}),e(y,{shown:c,children:l("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(f,{label:i.topTextColor.label,children:e(P,{value:i.topTextColor.choose(n.top_text_color),options:i.topTextColor.options,onChange:t=>p({top_text_color:t}),ariaLabel:i.topTextColor.label})}),e(y,{shown:c,children:l("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"}),e(f,{label:"Sticky header",children:e("div",{className:"w-32",children:e(se,{value:n.sticky,ariaLabel:l("Sticky header"),onChange:t=>p({sticky:t}),options:[{label:l("None"),value:"none"},{label:l("Always"),value:"always"},{label:l("On scroll up"),value:"on_scroll_up"}]})})}),L&&r(B,{children:[e(w,{label:"Display mode"}),e("p",{className:"text-[12px] text-[var(--ink-faint)]",children:l("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:L,children:l("Set up display mode →")})]}),e(re,{shown:c,onChange:T})]})]})]}):R?null:e(Je,{size:"sm",padding:"p-4",label:l("Loading…")})]});return O?r("div",{className:"flex flex-col",children:[D&&e("div",{className:"px-4 pt-2 text-[11px] text-[var(--ink-faintest)]",children:l("Saving…")}),me]}):r($e,{open:!0,onClose:b??(()=>{}),side:"right",size:"sm",title:l("Header"),children:[D&&e("div",{className:"pb-2 text-[11px] text-[var(--ink-faintest)]",children:l("Saving…")}),me]})}function xt({settings:o,websiteName:a,onPick:b,onClear:x,showHint:O}){const C=!!o.logo_url,v=!C&&!!o.default_logo_url,L=je(o.effective_logo_url),m=a&&a.trim()?a.trim():De;return r("div",{className:"flex flex-col gap-2",children:[e(Qe,{value:L||"",onChange:M=>{M||x()},onPick:b,accept:"image/svg+xml,.svg",acceptHint:"SVG",fit:"contain",height:80,placeholder:l("No logo — “{name}” wordmark shown",{name:m}),replaceLabel:C?l("Replace SVG logo"):l("Upload SVG logo"),allowRemove:C,removeLabel:l("Use company default")}),e(y,{shown:O,children:C?l("Custom SVG logo uploaded for this store."):v?l("Using your company logo from the database."):l("No company logo on file — upload an SVG or the wordmark is used.")})]})}function vt({token:o,menuId:a,menuName:b,itemCount:x,onPick:O}){const C=fe(),[v,L]=E(null),[m,M]=E(!1),n=k(u=>{L(u),M(!0)},[]);V(()=>{let u=!1;return Pe(o).then(N=>!u&&n(N)).catch(()=>!u&&L([])),()=>{u=!0}},[o,n]),V(()=>{let u=!1;const N=Ae(()=>{Oe(o).then(c=>!u&&n(c)).catch(()=>{})});return()=>{u=!0,N()}},[o,n]);const _=v===null,R=!_&&(v?.length??0)===0,S=!_&&(v??[]).some(u=>u.id===a),D=S?a:"",Y=m&&!!a&&!S;return r("div",{className:"flex flex-col gap-2",children:[e(f,{label:"Menu",children:e("div",{className:"w-[170px] max-w-full",children:e(se,{value:D,ariaLabel:l("Menu"),readOnly:_||R,onChange:u=>{const N=u?(v??[]).find(c=>c.id===u):null;O(N?{...N,items:N.items.map(c=>({...c,dropdown_items:(v??[]).find(T=>T.id===c.dropdown_menu)?.items.map(T=>({label:T.label,url:T.url}))??[]}))}:null)},options:[{label:_?l("Loading…"):R?l("No menus"):l("Default links"),value:""},...(v??[]).map(u=>({label:`${u.name} (${u.item_count??u.items.length})`,value:u.id}))]})})}),Y?e("p",{className:"text-[12px] text-[var(--sf-warning,#b45309)]",children:Me()}):e("p",{className:"text-[12px] text-[var(--ink-faint)]",children:D?Re("Header shows “{name}” — {n} link.","Header shows “{name}” — {n} links.",x,{name:b??l("the linked menu")}):R?l("No menus yet. Create one in {place}, then pick it here.",{place:l("Storefront → Menus")}):l("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:()=>C.send("storefront-editor:open-menus",{menuId:D||null}),children:D?l("Edit menu →"):l("Manage menus →")})]})}function y({shown:o,children:a}){return o?e("p",{className:"text-[11px] text-[var(--sf-muted)]",children:a}):null}function de({labelledBy:o,value:a,min:b,max:x,step:O,onPreview:C,onCommit:v}){const L=m=>{m instanceof HTMLInputElement&&m.type==="range"&&v(Number(m.value))};return e("div",{onPointerUp:m=>L(m.target),onKeyUp:m=>{/^(Arrow|Home|End|Page)/.test(m.key)&&L(m.target)},children:e(et,{value:a,min:b,max:x,step:O,showInput:!1,size:"sm","aria-labelledby":o,valueText:m=>l("{n} pixels",{n:m}),onChange:m=>{m!=null&&C(m)}})})}function wt({label:o,value:a,children:b}){return r("div",{className:"flex flex-col gap-2",children:[r("div",{className:"flex items-center justify-between",children:[e("span",{className:"text-xs text-[var(--ink-muted)]",children:l(o)}),a&&e("span",{className:"text-[12px] text-[var(--ink-faint)]",children:l(a)})]}),b]})}function w({label:o}){return e(gt,{label:o})}function f({label:o,children:a,stacked:b=!1}){return b?r("div",{className:"flex flex-col gap-y-2",children:[e("span",{className:"text-xs text-[var(--sf-text-secondary)]",children:l(o)}),a]}):r("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-2",children:[e("span",{className:"text-xs text-[var(--sf-text-secondary)]",children:l(o)}),e("div",{className:"flex flex-shrink-0 grow justify-end",children:a})]})}const St=[{label:"Left",value:"left"},{label:"Center",value:"center"}],yt=[{label:"Left",value:"left"},{label:"Right",value:"right"}],Ct=[{label:"Right",value:"left"},{label:"Centered",value:"center"},{label:"Beside logo",value:"beside"}],Lt=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],kt=Ie.map(o=>({label:ze[o],value:o})),Nt=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],Ht=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],Tt=[{label:"Auto",value:"auto"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}],i={logoPosition:{label:"Position",options:St,choose:o=>o==="right"?"center":o},menuAlign:{label:"Alignment",options:Ct,choose:o=>o==="center"?"center":o==="beside"?"beside":"left"},menuRow:{label:"Row",options:Lt,choose:o=>o==="inline"?"inline":"top"},searchPosition:{label:"Position",options:yt,choose:o=>o},width:{label:"Width",options:kt,choose:o=>o},navTextCase:{label:"Letters",options:Ht,choose:o=>o==="capitalised"?"capitalised":"uppercase"},utilStyle:{label:"Show as",options:Nt,choose:o=>o==="text"?"text":"icon"},topTextColor:{label:"Text color at the top",options:Tt,choose:o=>Ue(o)}};function Et({tabs:o,activeId:a,onSelect:b}){return e("div",{className:"es-insp-tabs",children:e(tt,{variant:"underline",block:!0,labelsFit:!0,"aria-label":l("Header settings"),idPrefix:ce,value:a,onChange:b,items:o.map(x=>({id:x.id,icon:x.icon,label:l(x.label)}))})})}export{f as Field,i as HEADER_SEGMENTED,we as HEADER_TABS,ce as HEADER_TABS_ID_PREFIX,Et as HeaderTabStrip,ae as OFF_PLACEHOLDER,_t as default};
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 +1 @@
1
- "use client";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{Button as C}from"efficient-shell/ui";import{SettingsField as P}from"efficient-easel/panel";import{FieldSelect as R}from"efficient-easel/fields";import{MenuIcon as U}from"efficient-easel/icons";import{useCallback as B,useEffect as M,useState as c}from"react";import{say as i,sayCount as E}from"efficient-web-builder/format/lib/editor-words";import{getEditorToken as u}from"efficient-web-builder/render/lib/editor-auth";import{onHeaderMenusChanged as F}from"efficient-web-builder/format/lib/editor-events";import{findLinkedMenu as f,loadMenus as L,refreshMenus as I}from"../../render/lib/menu-source.js";import{menuPickerMissingWarning as T,menuPickerUnlinkedWarning as W}from"../../render/lib/content/menu-placeholder.js";function $({value:l,onChange:p}){const[t,h]=c(null),[w,y]=c(!1),a=B(e=>{h(e),y(!0)},[]);M(()=>{let e=!1;return L(u()).then(n=>{e||a(n)}).catch(()=>{e||h([])}),()=>{e=!0}},[a]),M(()=>{let e=!1;const n=F(()=>{I(u()).then(r=>{e||a(r)}).catch(()=>{})});return()=>{e=!0,n()}},[a]);const d=t===null,o=!!(l?.id||l?.handle),m=w&&o&&!f(t??[],l),N=!o&&(l?.items?.length??0)>0,S=m?"":f(t??[],l)?.id??"",g=e=>p({id:e.id,handle:e.handle,name:e.name,items:e.items.map(n=>({label:n.label,url:n.url,...n.dropdown_items?.length?{dropdown_items:n.dropdown_items.map(r=>({label:r.label,url:r.url}))}:{}}))}),_=e=>{if(!e){p(null);return}const n=(t??[]).find(r=>r.id===e);n&&g(n)},[k,b]=c(!1),j=()=>{o&&(b(!0),L(u(),!0).then(e=>{a(e);const n=f(e,l);n&&g(n)}).catch(()=>{}).finally(()=>b(!1)))};return x("div",{children:[s(P,{label:i("Menu"),icon:s(U,{}),hint:!d&&t&&t.length===0?i("Create menus in {place}, then pick one here.",{place:i("Storefront → Menus")}):void 0,children:s(R,{value:S,ariaLabel:i("Menu"),onChange:_,readOnly:d||(t?.length??0)===0,options:[{label:d?i("Loading menus…"):t&&t.length===0?i("No menus found"):i("Select a menu…"),value:""},...(t??[]).map(e=>({label:`${e.name} (${e.item_count??e.items.length})`,value:e.id}))]})}),N?s("p",{className:"mt-2 text-[12px] text-[var(--sf-warning,#b45309)]",children:W()}):null,m?s("p",{className:"mt-2 text-[12px] text-[var(--sf-warning,#b45309)]",children:T(l?.name??i("The linked menu"))}):null,o&&!m?x("div",{className:"mt-2 flex items-center justify-between gap-2",children:[s("p",{className:"text-[12px] text-fg-dim",children:E("Linked to “{name}” — {n} link. Re-pull after editing the menu:","Linked to “{name}” — {n} links. Re-pull after editing the menu:",l?.items?.length??0,{name:l?.name??""})}),s(C,{variant:"link",size:"sm",className:"shrink-0",onClick:j,disabled:k,children:k?i("Updating…"):i("Update links")})]}):null]})}export{$ as default};
1
+ "use client";import{jsx as s,jsxs as b}from"react/jsx-runtime";import{Button as C}from"efficient-shell/ui";import{SettingsField as P}from"efficient-easel/panel";import{FieldSelect as R}from"efficient-easel/fields";import{MenuIcon as U}from"efficient-easel/icons";import{useCallback as B,useEffect as M,useState as c}from"react";import{say as i,sayCount as E}from"efficient-web-builder/format/lib/editor-words";import{getEditorToken as u}from"efficient-web-builder/render/lib/editor-auth";import{onHeaderMenusChanged as F}from"efficient-web-builder/format/lib/editor-events";import{findLinkedMenu as f,loadMenus as L,refreshMenus as I}from"../../render/lib/menu-source.js";import{menuPickerMissingWarning as T,menuPickerUnlinkedWarning as W}from"../../render/lib/content/menu-placeholder.js";function $({value:l,onChange:p}){const[t,h]=c(null),[w,y]=c(!1),a=B(e=>{h(e),y(!0)},[]);M(()=>{let e=!1;return L(u()).then(n=>{e||a(n)}).catch(()=>{e||h([])}),()=>{e=!0}},[a]),M(()=>{let e=!1;const n=F(()=>{I(u()).then(r=>{e||a(r)}).catch(()=>{})});return()=>{e=!0,n()}},[a]);const d=t===null,o=!!(l?.id||l?.handle),m=w&&o&&!f(t??[],l),N=!o&&(l?.items?.length??0)>0,S=m?"":f(t??[],l)?.id??"",g=e=>p({id:e.id,handle:e.handle,name:e.name,items:e.items.map(n=>({label:n.label,url:n.url,...n.dropdown_items?.length?{dropdown_items:n.dropdown_items.map(r=>({label:r.label,url:r.url}))}:{}}))}),_=e=>{if(!e){p(null);return}const n=(t??[]).find(r=>r.id===e);n&&g(n)},[k,x]=c(!1),j=()=>{o&&(x(!0),L(u(),!0).then(e=>{a(e);const n=f(e,l);n&&g(n)}).catch(()=>{}).finally(()=>x(!1)))};return b("div",{children:[s(P,{label:i("Menu"),icon:s(U,{}),hint:!d&&t&&t.length===0?i("Create menus in {place}, then pick one here.",{place:i("Storefront → Menus")}):void 0,children:s(R,{value:S,ariaLabel:i("Menu"),onChange:_,readOnly:d||(t?.length??0)===0,options:[{label:d?i("Loading menus…"):t&&t.length===0?i("No menus found"):i("Select a menu…"),value:""},...(t??[]).map(e=>({label:`${e.name} (${e.item_count??e.items.length})`,value:e.id}))]})}),N?s("p",{className:"mt-2 text-[12px] text-[var(--warning-text)]",children:W()}):null,m?s("p",{className:"mt-2 text-[12px] text-[var(--warning-text)]",children:T(l?.name??i("The linked menu"))}):null,o&&!m?b("div",{className:"mt-2 flex items-center justify-between gap-2",children:[s("p",{className:"text-[12px] text-fg-dim",children:E("Linked to “{name}” — {n} link. Re-pull after editing the menu:","Linked to “{name}” — {n} links. Re-pull after editing the menu:",l?.items?.length??0,{name:l?.name??""})}),s(C,{variant:"link",size:"sm",className:"shrink-0",onClick:j,disabled:k,children:k?i("Updating…"):i("Update links")})]}):null]})}export{$ as default};
@@ -1 +1 @@
1
- "use client";import{jsx as k,Fragment as x}from"react/jsx-runtime";import{useEffect as v,useMemo as w,useState as _}from"react";import{SettingsField as A}from"efficient-easel/panel";import{FieldSelect as B}from"efficient-easel/fields";import{iconOf as C,noGlyph as I}from"efficient-web-builder/editor/lib/document/controls";import{formatPrice as K}from"../../render/lib/commerce.js";import{resolveWheelPrice as N}from"../../render/lib/wheels/price-display.js";import{loadUnifiedProductCatalog as O}from"../../render/components/useProductCatalog.js";import{useCurrency as R}from"../../render/components/CurrencyContext.js";import F from"efficient-web-builder/editor/components/SearchSelectField";import{PREVIEWABLE_KINDS as G}from"../../render/components/pdp-dynamic/useSampleProduct.js";import{PLP_ALL_TYPES_LABEL as D,PLP_KINDS as V,PLP_KIND_LABELS as S}from"../../render/lib/catalog/plp-item.js";import{currentPreviewPickKey as W,useCurrentPreviewPick as T,writePreviewPick as U}from"../../render/lib/document/preview-pick.js";import{say as r}from"efficient-web-builder/format/lib/editor-words";const p="__all__",L="";function Y(o){return(o??[]).filter(n=>G.includes(n.kind))}const j=I("one row per level from one list — the gutter would repeat one mark down the column and say nothing; the group heading carries it once GG, 2026-09-23"),g=o=>typeof o.brand=="string"?o.brand.trim():"";function E(o,n){if(o.kind!=="alloy-wheel"||!n)return;const l=o,i=N(l.prices?.[n],l.msrpPrices?.[n]);return i.priced?K(i.unit,n):void 0}function H({rows:o,brand:n,kind:l,slug:i,loading:d=!1,currency:m=""}){const f=o??[],s=[...new Set(f.map(g).filter(Boolean))].sort((t,y)=>t.localeCompare(y)),u=n===p?f:f.filter(t=>g(t)===n),c=V.filter(t=>u.some(y=>y.kind===t)),b=l===p?u:u.filter(t=>t.kind===l),h=new Set(b.map(t=>t.kind)).size>1,e=b.map(t=>({value:t.slug,label:t.name,...h?{group:r(S[t.kind])}:{},thumb:t.coverImage??null,...E(t,m)?{meta:E(t,m)}:{}})),a=i&&!b.some(t=>t.slug===i)?[{value:i,label:d?i:r("{slug} (not in this list)",{slug:i})}]:[],P=[];return s.length>1&&P.push({key:"brand",label:r("Brand"),options:[{value:p,label:r("All brands")},...s.map(t=>({value:t,label:t}))]}),c.length>1&&P.push({key:"kind",label:r("Product type"),options:[{value:p,label:r(D)},...c.map(t=>({value:t,label:r(S[t])}))]}),P.push({key:"product",label:r("Product"),options:[{value:L,label:d?r("Loading…"):r("Generic placeholder")},...a,...e]}),P}function M(){const[o,n]=_(null),[l,i]=_(p),[d,m]=_(p),f=W(),s=T()??L;v(()=>{let e=!1;return O().then(a=>{e||n(a)}).catch(()=>{e||n([])}),()=>{e=!0}},[]);const{currency:u}=R(),c=w(()=>Y(o),[o]);v(()=>{const e=c.find(a=>a.slug===s);e&&g(e)&&i(g(e))},[s,c]);const b=w(()=>H({rows:c,brand:l,kind:d,slug:s,loading:o===null,currency:u}),[c,l,d,s,o,u]),h={brand:e=>{i(e),m(p)},kind:m,product:e=>U(f,e)};return k(x,{children:b.map(e=>k(A,{label:e.label,icon:C(j),hint:e.key==="product"?r(z):void 0,children:e.key==="product"?k(F,{bare:!0,label:e.label,options:e.options,fallback:L,value:s,onChange:h.product,placeholder:r("Search your catalog…")}):k(B,{value:e.key==="brand"?l:d,ariaLabel:e.label,onChange:a=>h[e.key](a),options:e.options.map(a=>({label:a.label,value:a.value}))})},e.key))})}const z="Only for looking at while you design. Shoppers always see the product they opened.";export{p as ANY_VALUE,L as NO_PRODUCT,M as default,H as previewPickerLevels,Y as previewableRows};
1
+ "use client";import{jsx as k,Fragment as x}from"react/jsx-runtime";import{useEffect as v,useMemo as w,useState as _}from"react";import{SettingsField as A}from"efficient-easel/panel";import{FieldSelect as B}from"efficient-easel/fields";import{iconOf as C,noGlyph as I}from"efficient-easel/screen/lib/document/box-fields";import{formatPrice as K}from"../../render/lib/commerce.js";import{resolveWheelPrice as N}from"../../render/lib/wheels/price-display.js";import{loadUnifiedProductCatalog as O}from"../../render/components/useProductCatalog.js";import{useCurrency as R}from"../../render/components/CurrencyContext.js";import F from"efficient-web-builder/editor/components/SearchSelectField";import{PREVIEWABLE_KINDS as G}from"../../render/components/pdp-dynamic/useSampleProduct.js";import{PLP_ALL_TYPES_LABEL as D,PLP_KINDS as V,PLP_KIND_LABELS as S}from"../../render/lib/catalog/plp-item.js";import{currentPreviewPickKey as W,useCurrentPreviewPick as T,writePreviewPick as U}from"../../render/lib/document/preview-pick.js";import{say as r}from"efficient-web-builder/format/lib/editor-words";const p="__all__",L="";function Y(o){return(o??[]).filter(n=>G.includes(n.kind))}const j=I("one row per level from one list — the gutter would repeat one mark down the column and say nothing; the group heading carries it once GG, 2026-09-23"),g=o=>typeof o.brand=="string"?o.brand.trim():"";function E(o,n){if(o.kind!=="alloy-wheel"||!n)return;const l=o,i=N(l.prices?.[n],l.msrpPrices?.[n]);return i.priced?K(i.unit,n):void 0}function H({rows:o,brand:n,kind:l,slug:i,loading:d=!1,currency:m=""}){const f=o??[],s=[...new Set(f.map(g).filter(Boolean))].sort((t,y)=>t.localeCompare(y)),u=n===p?f:f.filter(t=>g(t)===n),c=V.filter(t=>u.some(y=>y.kind===t)),b=l===p?u:u.filter(t=>t.kind===l),h=new Set(b.map(t=>t.kind)).size>1,e=b.map(t=>({value:t.slug,label:t.name,...h?{group:r(S[t.kind])}:{},thumb:t.coverImage??null,...E(t,m)?{meta:E(t,m)}:{}})),a=i&&!b.some(t=>t.slug===i)?[{value:i,label:d?i:r("{slug} (not in this list)",{slug:i})}]:[],P=[];return s.length>1&&P.push({key:"brand",label:r("Brand"),options:[{value:p,label:r("All brands")},...s.map(t=>({value:t,label:t}))]}),c.length>1&&P.push({key:"kind",label:r("Product type"),options:[{value:p,label:r(D)},...c.map(t=>({value:t,label:r(S[t])}))]}),P.push({key:"product",label:r("Product"),options:[{value:L,label:d?r("Loading…"):r("Generic placeholder")},...a,...e]}),P}function M(){const[o,n]=_(null),[l,i]=_(p),[d,m]=_(p),f=W(),s=T()??L;v(()=>{let e=!1;return O().then(a=>{e||n(a)}).catch(()=>{e||n([])}),()=>{e=!0}},[]);const{currency:u}=R(),c=w(()=>Y(o),[o]);v(()=>{const e=c.find(a=>a.slug===s);e&&g(e)&&i(g(e))},[s,c]);const b=w(()=>H({rows:c,brand:l,kind:d,slug:s,loading:o===null,currency:u}),[c,l,d,s,o,u]),h={brand:e=>{i(e),m(p)},kind:m,product:e=>U(f,e)};return k(x,{children:b.map(e=>k(A,{label:e.label,icon:C(j),hint:e.key==="product"?r(z):void 0,children:e.key==="product"?k(F,{bare:!0,label:e.label,options:e.options,fallback:L,value:s,onChange:h.product,placeholder:r("Search your catalog…")}):k(B,{value:e.key==="brand"?l:d,ariaLabel:e.label,onChange:a=>h[e.key](a),options:e.options.map(a=>({label:a.label,value:a.value}))})},e.key))})}const z="Only for looking at while you design. Shoppers always see the product they opened.";export{p as ANY_VALUE,L as NO_PRODUCT,M as default,H as previewPickerLevels,Y as previewableRows};
@@ -1 +1 @@
1
- "use client";import{jsx as c,jsxs as $}from"react/jsx-runtime";import{SettingsField as z}from"efficient-easel/panel";import{FieldSelect as O}from"efficient-easel/fields";import{CategoryIcon as _}from"efficient-easel/icons";import{useEffect as w,useMemo as C,useState as K}from"react";import{useEaselHost as N}from"efficient-easel/screen/lib/host";import{formatPrice as W}from"../../render/lib/commerce.js";import{resolveWheelPrice as G}from"../../render/lib/wheels/price-display.js";import{isRenderableFinish as M}from"../../render/lib/wheels/renderable-finishes.js";import{loadUnifiedProductCatalog as U}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as V}from"./useStorefrontCategories.js";import{ALL_CATEGORY as Y,filterByCategory as q,useCategoryFilter as D}from"./useCategoryFilter.js";import{useSnapshotSource as J}from"efficient-web-builder/editor/components/useSnapshotSource";import{useCurrency as Q}from"../../render/components/CurrencyContext.js";import X from"efficient-web-builder/editor/components/SearchSelectField";import Z from"efficient-web-builder/editor/components/SourceStatus";import{say as n,sayCount as v}from"efficient-web-builder/format/lib/editor-words";const S=e=>e.kind==="tyre"?"tyre":"alloy-wheel",m=e=>`${e.kind}:${e.slug}`;function P(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(M).map(r=>({name:r.name,color:r.color,src:r.src})),prices:e.prices,href:`/wheels/${e.slug}`}}function x(e,r){const s=S(r);return e.find(t=>t.kind===s&&t.slug===r.slug)}function L(e){return R(e)?n("Category — wheels only"):n("Category")}const R=e=>!!(e?.some(r=>r.kind==="tyre")&&e.some(r=>r.kind==="alloy-wheel")),ee=e=>v("{n} size","{n} sizes",e);function te({rows:e,category:r,value:s,loading:t,currency:l}){const a=e??[],d=a.filter(o=>o.kind==="alloy-wheel"),p=a.filter(o=>o.kind==="tyre"),h=d.length>0&&p.length>0,k={value:"",label:t?n("Loading…"):n("Pick a product…")},g=s&&!(e!==null&&x(e,s))?[{value:m({kind:S(s),slug:s.slug}),label:t?s.name:n("{name} (unavailable)",{name:s.name})}]:[],u=q(d,r).map(o=>{const f=G(o.prices[l],o.msrpPrices?.[l]);return{value:m({kind:"alloy-wheel",slug:o.slug}),label:o.name,...h?{group:n("Wheels")}:{},thumb:o.coverImage??null,...f.priced?{meta:W(f.unit,l)}:{}}}),b=p.map(o=>({value:m(o),label:o.name,...h?{group:n("Tyres")}:{},thumb:o.coverImage??null,meta:ee(o.variantCount)}));return[k,...g,...u,...b]}function oe({value:e,onChange:r}){const s=N(),{rows:t,loading:l,refreshing:a,errored:d,refresh:p}=J({load:U,resolve:x,snapshot:P,value:e,onChange:r}),[h,k]=K(null);w(()=>{let i=!1;return V().then(y=>{i||k(y)}),()=>{i=!0}},[]);const{currency:g}=Q(),u=C(()=>t&&e?x(t,e)??null:null,[t,e]),b=C(()=>(t??[]).filter(i=>i.kind==="alloy-wheel"),[t]),{category:o,setCategory:f,categoryNames:T}=D(b,h,u?.kind==="alloy-wheel"?u:null),A=!!e?.slug&&t!==null&&!u,E=C(()=>te({rows:t,category:o,value:e,loading:l,currency:g}),[t,o,e,l,g]),F=i=>{if(!i){r(null);return}const y=(t??[]).find(H=>m(H)===i);y&&r(P(y))},I=()=>{e?.slug&&s.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},j=d?"error":a?"loading":"idle",B=d?n("Couldn’t reach the product catalog."):a?n("Syncing from the catalog…"):A?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 $("div",{children:[c(X,{label:"Product",options:E,fallback:"",value:e?m({kind:S(e),slug:e.slug}):"",onChange:F,placeholder:"Search products…"}),c(z,{label:L(t),icon:c(_,{}),children:c(O,{value:o,ariaLabel:L(t),onChange:f,readOnly:l,options:[{label:R(t)?n("All wheel categories"):n("All products"),value:Y},...T.map(i=>({label:i,value:i}))]})}),e?.slug?c(Z,{status:j,statusText:B,onRefresh:p,busy:a,edit:{label:n("Edit product ✎"),onClick:I},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.")}):c("p",{className:"es-field-hint sf-hint-keep",style:{marginTop:7},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{oe as default,L as heroCategoryLabel,te as heroPickerOptions,x as heroResolve,P as heroSnapshot};
1
+ "use client";import{jsx as y,jsxs as I}from"react/jsx-runtime";import{useEffect as $,useMemo as C,useState as z}from"react";import{useEaselHost as N}from"efficient-easel/screen/lib/host";import{formatPrice as w}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 W}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as _}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 s,sayCount as Q}from"efficient-web-builder/format/lib/editor-words";const S=e=>e.kind==="tyre"?"tyre":"alloy-wheel",u=e=>`${e.kind}:${e.slug}`;function P(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(r=>({name:r.name,color:r.color,src:r.src})),prices:e.prices,href:`/wheels/${e.slug}`}}function x(e,r){const n=S(r);return e.find(o=>o.kind===n&&o.slug===r.slug)}function X(e){return L(e)?s("Category — wheels only"):s("Category")}const L=e=>!!(e?.some(r=>r.kind==="tyre")&&e.some(r=>r.kind==="alloy-wheel")),Y=e=>Q("{n} size","{n} sizes",e);function Z({rows:e,category:r,value:n,loading:o,currency:i}){const a=e??[],c=a.filter(t=>t.kind==="alloy-wheel"),m=a.filter(t=>t.kind==="tyre"),p=c.length>0&&m.length>0,k={value:"",label:o?s("Loading…"):s("Pick a product…")},h=n&&!(e!==null&&x(e,n))?[{value:u({kind:S(n),slug:n.slug}),label:o?n.name:s("{name} (unavailable)",{name:n.name})}]:[],d=M(c,r).map(t=>{const g=K(t.prices[i],t.msrpPrices?.[i]);return{value:u({kind:"alloy-wheel",slug:t.slug}),label:t.name,...p?{group:s("Wheels")}:{},thumb:t.coverImage??null,...g.priced?{meta:w(g.unit,i)}:{}}}),b=m.map(t=>({value:u(t),label:t.name,...p?{group:s("Tyres")}:{},thumb:t.coverImage??null,meta:Y(t.variantCount)}));return[k,...h,...d,...b]}function v({value:e,onChange:r}){const n=N(),{rows:o,loading:i,refreshing:a,errored:c,refresh:m}=q({load:W,resolve:x,snapshot:P,value:e,onChange:r}),[p,k]=z(null);$(()=>{let l=!1;return _().then(f=>{l||k(f)}),()=>{l=!0}},[]);const{currency:h}=D(),d=C(()=>o&&e?x(o,e)??null:null,[o,e]),b=C(()=>(o??[]).filter(l=>l.kind==="alloy-wheel"),[o]),{category:t,setCategory:g,categoryNames:R}=U(b,p,d?.kind==="alloy-wheel"?d:null),T=!!e?.slug&&o!==null&&!d,E=C(()=>Z({rows:o,category:t,value:e,loading:i,currency:h}),[o,t,e,i,h]),j=l=>{if(!l){r(null);return}const f=(o??[]).find(H=>u(H)===l);f&&r(P(f))},A=()=>{e?.slug&&n.send("storefront-editor:open-product",{slug:e.slug,name:e.name})},B=c?"error":a?"loading":"idle",F=c?s("Couldn’t reach the product catalog."):a?s("Syncing from the catalog…"):T?s("Linked to “{name}” — no longer in the catalog.",{name:e?.name??""}):s("Linked to “{name}” · title, description, category, price & image follow the product.",{name:e?.name??""});return I("div",{children:[y(G,{label:"Product",options:E,fallback:"",value:e?u({kind:S(e),slug:e.slug}):"",onChange:j,placeholder:"Search products…"}),y(V,{label:X(o),allLabel:L(o)?s("All wheel categories"):s("All products"),category:t,onChange:g,categoryNames:R,readOnly:i}),e?.slug?y(J,{status:B,statusText:F,onRefresh:m,busy:a,edit:{label:s("Edit product ✎"),onClick:A},hint:s("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.")}):y("p",{className:"es-field-hint sf-hint-keep",style:{marginTop:7},children:s("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,x as heroResolve,P as heroSnapshot};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as d}from"react/jsx-runtime";import{SettingsField as u}from"efficient-easel/panel";import{FieldSelect as m}from"efficient-easel/fields";import{BlockProductIcon as L,CategoryIcon as N}from"efficient-easel/icons";import{useEffect as S,useMemo as v,useState as f}from"react";import{loadProductCatalog as x}from"../../render/components/useProductCatalog.js";import{loadStorefrontCategories as j}from"./useStorefrontCategories.js";import{ALL_CATEGORY as T,useCategoryFilter as A}from"./useCategoryFilter.js";import{useGridSourceLock as F}from"./useGridSourceLock.js";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{sayWith as O}from"../lib/say-with.js";function W({value:r,onChange:g}){const[l,h]=f(null),[p,y]=f(null);S(()=>{let e=!1;return x().then(i=>{e||h(i)}),j().then(i=>{e||y(i)}),()=>{e=!0}},[]);const b=v(()=>l&&r?l.find(e=>e.slug===r)??null:null,[l,r]),{category:C,setCategory:k,categoryNames:P,filtered:n}=A(l,p,b),a=l===null,c=F(),s=c!==null;return d("div",{children:[s&&t("p",{className:"es-field-hint sf-hint-keep",style:{marginBottom:8},children:O(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 “None”.",{name:c??""}),{source:t("strong",{children:o("Products source")})})}),d("div",{className:s?"sf-locked":void 0,children:[t(u,{label:o("Category"),icon:t(N,{}),children:t(m,{value:C,ariaLabel:o("Category"),onChange:k,readOnly:a||s,options:[{label:o("All products"),value:T},...P.map(e=>({label:e,value:e}))]})}),t(u,{label:o("Product"),icon:t(L,{}),children:t(m,{value:r??"",ariaLabel:o("Product"),onChange:g,readOnly:a||s,options:[{label:a?o("Loading…"):n.length===0?o("No products in this category"):o("Select a product…"),value:""},...n.map(e=>({label:e.name,value:e.slug}))]})})]})]})}export{W as default};
1
+ "use client";import{jsx as c,jsxs as C}from"react/jsx-runtime";import{useEffect as N,useMemo as P,useState as d}from"react";import{loadProductCatalog as x}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";function W({value:r,onChange:u}){const[e,m]=d(null),[f,g]=d(null);N(()=>{let t=!1;return x().then(n=>{t||m(n)}),b().then(n=>{t||g(n)}),()=>{t=!0}},[]);const h=P(()=>e&&r?e.find(t=>t.slug===r)??null:null,[e,r]),{category:p,setCategory:y,categoryNames:k,filtered:a}=j(e,f,h),l=e===null,i=L(),s=i!==null;return C("div",{children:[s&&c("p",{className:"es-field-hint sf-hint-keep",style:{marginBottom:8},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:k,readOnly:l||s,products:a,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 e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{Button as t}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{GroupLabel as l}from"efficient-web-builder/editor/lib/document/controls";function a(){const{openPanel:s}=r();return n(o,{children:[e(l,{label:"Social links"}),e("p",{className:"es-field-hint sf-hint-keep",children:i("The links are typed once for the whole website, in Site settings.")}),e(t,{variant:"link",size:"sm",onClick:s,children:i("Edit social links →")})]})}export{a as default};
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 sf-hint-keep",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};