create-abcart-theme 0.10.1 → 1.0.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 (251) hide show
  1. package/CHANGELOG.md +133 -127
  2. package/LICENSE +202 -202
  3. package/NOTICE +2 -2
  4. package/README.md +65 -65
  5. package/bin/create-abcart-theme.mjs +4 -4
  6. package/package.json +49 -49
  7. package/src/args.mjs +113 -113
  8. package/src/banner.mjs +21 -21
  9. package/src/cli.mjs +119 -119
  10. package/src/create.mjs +85 -82
  11. package/src/package-manager.mjs +32 -32
  12. package/src/style.mjs +17 -17
  13. package/templates/default/.agents/skills/{wocart-docs → abcart-docs}/SKILL.md +146 -146
  14. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/SKILL.md +58 -58
  15. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/inputs-and-rights.md +47 -47
  16. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/layout-rtl-and-phone.md +36 -36
  17. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/measure-the-design.md +60 -60
  18. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/tokens-sections-content.md +103 -103
  19. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/verify-and-report.md +102 -102
  20. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/scripts/compare-design.cjs +230 -230
  21. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/scripts/qa-pages.cjs +219 -219
  22. package/templates/default/.agents/skills/shopify-theme-asset-collector/SKILL.md +125 -125
  23. package/templates/default/.agents/skills/shopify-theme-asset-collector/scripts/collect_public_assets.py +370 -370
  24. package/templates/default/.dev.vars.example +12 -12
  25. package/templates/default/AGENTS.md +240 -240
  26. package/templates/default/README.md +184 -184
  27. package/templates/default/_gitignore +11 -11
  28. package/templates/default/astro.config.mjs +85 -85
  29. package/templates/default/package.json +36 -36
  30. package/templates/default/public/fonts/OFL.txt +96 -96
  31. package/templates/default/src/actions/index.ts +22 -22
  32. package/templates/default/src/components/cart/AddToCartButton.astro +45 -45
  33. package/templates/default/src/components/cart/CartDrawer.astro +47 -47
  34. package/templates/default/src/components/cart/CartSummary.astro +11 -11
  35. package/templates/default/src/components/cart/FreeShipping.astro +7 -7
  36. package/templates/default/src/components/checkout/CheckoutMain.astro +29 -29
  37. package/templates/default/src/components/checkout/OrderForm.astro +280 -280
  38. package/templates/default/src/components/checkout/ThankYouMain.astro +68 -68
  39. package/templates/default/src/components/landing/LandingImages.astro +51 -51
  40. package/templates/default/src/components/landing/LandingOrder.astro +46 -46
  41. package/templates/default/src/components/landing/LandingProduct.astro +41 -41
  42. package/templates/default/src/components/listing/ListingMain.astro +93 -93
  43. package/templates/default/src/components/listing/PageMain.astro +52 -52
  44. package/templates/default/src/components/listing/Pagination.astro +31 -31
  45. package/templates/default/src/components/listing/SortControl.astro +35 -35
  46. package/templates/default/src/components/product/BuyBox.astro +96 -96
  47. package/templates/default/src/components/product/Description.astro +24 -24
  48. package/templates/default/src/components/product/Gallery.astro +66 -66
  49. package/templates/default/src/components/product/MobileBuyBar.astro +29 -29
  50. package/templates/default/src/components/product/OfferChoice.astro +66 -66
  51. package/templates/default/src/components/product/ProductMain.astro +40 -40
  52. package/templates/default/src/components/product/ProductReviews.astro +72 -72
  53. package/templates/default/src/components/product/RelatedProducts.astro +30 -30
  54. package/templates/default/src/components/product/blocks/BenefitsBlock.astro +13 -13
  55. package/templates/default/src/components/product/blocks/CollapsibleBlock.astro +20 -20
  56. package/templates/default/src/components/product/blocks/DescriptionBlock.astro +19 -19
  57. package/templates/default/src/components/product/blocks/DetailsBlock.astro +33 -33
  58. package/templates/default/src/components/product/blocks/GalleryBlock.astro +12 -12
  59. package/templates/default/src/components/product/blocks/OrderBlock.astro +30 -30
  60. package/templates/default/src/components/product/blocks/PriceBlock.astro +23 -23
  61. package/templates/default/src/components/product/blocks/RatingBlock.astro +16 -16
  62. package/templates/default/src/components/product/blocks/StockBlock.astro +22 -22
  63. package/templates/default/src/components/product/blocks/TextBlock.astro +11 -11
  64. package/templates/default/src/components/product/blocks/TitleBlock.astro +20 -20
  65. package/templates/default/src/components/reviews/ReviewCard.astro +46 -46
  66. package/templates/default/src/components/reviews/ReviewForm.astro +113 -113
  67. package/templates/default/src/components/reviews/VoiceNote.astro +60 -60
  68. package/templates/default/src/components/sections/CollectionCards.astro +65 -65
  69. package/templates/default/src/components/sections/Countdown.astro +57 -57
  70. package/templates/default/src/components/sections/Faq.astro +44 -44
  71. package/templates/default/src/components/sections/FeaturedProduct.astro +71 -71
  72. package/templates/default/src/components/sections/Hero.astro +99 -99
  73. package/templates/default/src/components/sections/ImageBanner.astro +46 -46
  74. package/templates/default/src/components/sections/ProductGrid.astro +47 -47
  75. package/templates/default/src/components/sections/RichText.astro +35 -35
  76. package/templates/default/src/components/sections/Steps.astro +46 -46
  77. package/templates/default/src/components/sections/Testimonials.astro +57 -57
  78. package/templates/default/src/components/shell/Footer.astro +80 -80
  79. package/templates/default/src/components/shell/Header.astro +89 -89
  80. package/templates/default/src/components/shell/LanguageMenu.astro +33 -33
  81. package/templates/default/src/components/shell/MobileMenu.astro +65 -65
  82. package/templates/default/src/components/shell/SearchDialog.astro +19 -19
  83. package/templates/default/src/components/shell/TopBar.astro +54 -54
  84. package/templates/default/src/components/shell/WhatsAppWidget.astro +111 -111
  85. package/templates/default/src/components/store/ContactMain.astro +79 -79
  86. package/templates/default/src/components/store/SearchMain.astro +56 -56
  87. package/templates/default/src/components/store/TrackOrderMain.astro +161 -161
  88. package/templates/default/src/components/surface/Area.astro +20 -20
  89. package/templates/default/src/components/surface/PreviewBridge.astro +24 -24
  90. package/templates/default/src/components/surface/Sections.astro +35 -35
  91. package/templates/default/src/components/ui/Breadcrumbs.astro +36 -36
  92. package/templates/default/src/components/ui/Button.astro +45 -45
  93. package/templates/default/src/components/ui/EditorPlaceholder.astro +24 -24
  94. package/templates/default/src/components/ui/Icon.astro +93 -93
  95. package/templates/default/src/components/ui/Logo.astro +36 -36
  96. package/templates/default/src/components/ui/Photo.astro +46 -46
  97. package/templates/default/src/components/ui/Price.astro +24 -24
  98. package/templates/default/src/components/ui/ProductCard.astro +41 -41
  99. package/templates/default/src/components/ui/Rating.astro +22 -22
  100. package/templates/default/src/components/ui/Section.astro +34 -34
  101. package/templates/default/src/components/ui/SectionHeading.astro +19 -19
  102. package/templates/default/src/env.d.ts +23 -23
  103. package/templates/default/src/layouts/StoreLayout.astro +145 -145
  104. package/templates/default/src/lib/browser-copy.ts +37 -37
  105. package/templates/default/src/lib/context.ts +89 -89
  106. package/templates/default/src/lib/coupon-notice.ts +47 -47
  107. package/templates/default/src/lib/i18n.ts +32 -32
  108. package/templates/default/src/lib/images.ts +38 -38
  109. package/templates/default/src/lib/listing-query.ts +41 -41
  110. package/templates/default/src/lib/money.ts +16 -16
  111. package/templates/default/src/lib/motion.ts +16 -16
  112. package/templates/default/src/lib/nav.ts +26 -26
  113. package/templates/default/src/lib/offer-tiles.ts +105 -105
  114. package/templates/default/src/lib/order-outcome.ts +66 -66
  115. package/templates/default/src/lib/otp-message.ts +21 -21
  116. package/templates/default/src/lib/products.ts +38 -38
  117. package/templates/default/src/lib/review-refusals.ts +31 -31
  118. package/templates/default/src/lib/store.ts +31 -31
  119. package/templates/default/src/lib/whatsapp.ts +29 -29
  120. package/templates/default/src/middleware.ts +23 -23
  121. package/templates/default/src/pages/404.astro +22 -22
  122. package/templates/default/src/pages/{wocart-preview.astro → abcart-preview.astro} +43 -43
  123. package/templates/default/src/pages/{wocart-revalidate.ts → abcart-revalidate.ts} +10 -10
  124. package/templates/default/src/pages/{wocart-styles.css.ts → abcart-styles.css.ts} +5 -5
  125. package/templates/default/src/pages/{wocart-theme.json.ts → abcart-theme.json.ts} +5 -5
  126. package/templates/default/src/pages/api/abandoned/convert.ts +4 -4
  127. package/templates/default/src/pages/api/abandoned/upsert.ts +4 -4
  128. package/templates/default/src/pages/api/cart/validate.ts +4 -4
  129. package/templates/default/src/pages/api/communes/[wilayaId].ts +4 -4
  130. package/templates/default/src/pages/api/otp/send.ts +4 -4
  131. package/templates/default/src/pages/api/otp/verify.ts +4 -4
  132. package/templates/default/src/pages/api/reviews/[productId].ts +3 -3
  133. package/templates/default/src/pages/api/reviews/eligibility.ts +3 -3
  134. package/templates/default/src/pages/api/reviews/submit.ts +3 -3
  135. package/templates/default/src/pages/api/reviews/upload.ts +3 -3
  136. package/templates/default/src/pages/category/[slug].astro +20 -20
  137. package/templates/default/src/pages/checkout.astro +25 -25
  138. package/templates/default/src/pages/collections/[handle].astro +20 -20
  139. package/templates/default/src/pages/contact.astro +17 -17
  140. package/templates/default/src/pages/index.astro +9 -9
  141. package/templates/default/src/pages/lp/[slug].astro +47 -47
  142. package/templates/default/src/pages/pages/[slug].astro +16 -16
  143. package/templates/default/src/pages/products/[handle].astro +37 -37
  144. package/templates/default/src/pages/products/index.astro +15 -15
  145. package/templates/default/src/pages/robots.txt.ts +9 -9
  146. package/templates/default/src/pages/search.astro +19 -19
  147. package/templates/default/src/pages/sitemap.xml.ts +12 -12
  148. package/templates/default/src/pages/thank-you.astro +33 -33
  149. package/templates/default/src/pages/track-order.astro +17 -17
  150. package/templates/default/src/scripts/cart.ts +371 -371
  151. package/templates/default/src/scripts/checkout/coupon.ts +96 -96
  152. package/templates/default/src/scripts/checkout/delivery.ts +86 -86
  153. package/templates/default/src/scripts/checkout/form.ts +54 -54
  154. package/templates/default/src/scripts/checkout/otp.ts +106 -106
  155. package/templates/default/src/scripts/checkout/picker.ts +169 -169
  156. package/templates/default/src/scripts/checkout/quote.ts +169 -169
  157. package/templates/default/src/scripts/checkout/submit.ts +113 -113
  158. package/templates/default/src/scripts/checkout/tracking.ts +74 -74
  159. package/templates/default/src/scripts/countdown.ts +29 -29
  160. package/templates/default/src/scripts/events.ts +4 -4
  161. package/templates/default/src/scripts/hero.ts +49 -49
  162. package/templates/default/src/scripts/listing.ts +13 -13
  163. package/templates/default/src/scripts/order-form.ts +100 -100
  164. package/templates/default/src/scripts/product.ts +306 -306
  165. package/templates/default/src/scripts/public-config.ts +79 -79
  166. package/templates/default/src/scripts/reviews.ts +358 -358
  167. package/templates/default/src/scripts/site.ts +131 -131
  168. package/templates/default/src/scripts/thank-you.ts +11 -11
  169. package/templates/default/src/scripts/voice-note.ts +94 -94
  170. package/templates/default/src/styles/base.css +1030 -1030
  171. package/templates/default/src/styles/checkout.css +1111 -1111
  172. package/templates/default/src/styles/global.css +12 -12
  173. package/templates/default/src/styles/product.css +871 -871
  174. package/templates/default/src/styles/reviews.css +533 -533
  175. package/templates/default/src/styles/sections.css +931 -931
  176. package/templates/default/src/styles/shell.css +970 -970
  177. package/templates/default/src/styles/tokens.css +583 -583
  178. package/templates/default/src/theme/api-routes.ts +10 -10
  179. package/templates/default/src/theme/content/catalog.ts +117 -117
  180. package/templates/default/src/theme/content/checkout.ts +168 -168
  181. package/templates/default/src/theme/content/editor.ts +21 -21
  182. package/templates/default/src/theme/content/index.ts +45 -45
  183. package/templates/default/src/theme/content/reviews.ts +76 -76
  184. package/templates/default/src/theme/content/shell.ts +59 -59
  185. package/templates/default/src/theme/content/types.ts +12 -12
  186. package/templates/default/src/theme/documents/catalog.json +11 -11
  187. package/templates/default/src/theme/documents/category.json +11 -11
  188. package/templates/default/src/theme/documents/checkout.json +11 -11
  189. package/templates/default/src/theme/documents/collection.json +11 -11
  190. package/templates/default/src/theme/documents/contact.json +11 -11
  191. package/templates/default/src/theme/documents/footer.area.json +11 -11
  192. package/templates/default/src/theme/documents/header.area.json +16 -16
  193. package/templates/default/src/theme/documents/home.json +313 -313
  194. package/templates/default/src/theme/documents/landing.json +8 -8
  195. package/templates/default/src/theme/documents/page.json +11 -11
  196. package/templates/default/src/theme/documents/product.json +125 -125
  197. package/templates/default/src/theme/documents/search.json +11 -11
  198. package/templates/default/src/theme/documents/thank-you.json +11 -11
  199. package/templates/default/src/theme/documents/track-order.json +11 -11
  200. package/templates/default/src/theme/fields.ts +61 -61
  201. package/templates/default/src/theme/key.ts +11 -11
  202. package/templates/default/src/theme/labels.ts +231 -231
  203. package/templates/default/src/theme/locales.ts +11 -11
  204. package/templates/default/src/theme/palette.ts +14 -14
  205. package/templates/default/src/theme/sections/collection-cards.ts +65 -65
  206. package/templates/default/src/theme/sections/faq.ts +74 -74
  207. package/templates/default/src/theme/sections/featured-product.ts +42 -42
  208. package/templates/default/src/theme/sections/hero.ts +47 -47
  209. package/templates/default/src/theme/sections/image-banner.ts +25 -25
  210. package/templates/default/src/theme/sections/index.ts +40 -40
  211. package/templates/default/src/theme/sections/landing.ts +150 -150
  212. package/templates/default/src/theme/sections/listing.ts +84 -84
  213. package/templates/default/src/theme/sections/product-grid.ts +42 -42
  214. package/templates/default/src/theme/sections/product.ts +297 -297
  215. package/templates/default/src/theme/sections/rich-text.ts +39 -39
  216. package/templates/default/src/theme/sections/shared.ts +54 -54
  217. package/templates/default/src/theme/sections/shell.ts +85 -85
  218. package/templates/default/src/theme/sections/store-pages.ts +101 -101
  219. package/templates/default/src/theme/sections/testimonials.ts +61 -61
  220. package/templates/default/src/theme/sections/thank-you.ts +35 -35
  221. package/templates/default/src/theme/settings.ts +124 -124
  222. package/templates/default/src/theme/theme.ts +65 -65
  223. package/templates/default/tests/fixtures/canvas-tote.json +62 -62
  224. package/templates/default/tests/fixtures/linen-shirt.json +128 -128
  225. package/templates/default/tests/unit/checkout.test.ts +241 -241
  226. package/templates/default/tests/unit/contract.test.ts +170 -169
  227. package/templates/default/tests/unit/contrast.test.ts +68 -68
  228. package/templates/default/tests/unit/copy.test.ts +101 -101
  229. package/templates/default/tests/unit/design-values.test.ts +95 -95
  230. package/templates/default/tests/unit/editability.test.ts +180 -180
  231. package/templates/default/tests/unit/fixtures.ts +91 -91
  232. package/templates/default/tests/unit/footer.test.ts +54 -54
  233. package/templates/default/tests/unit/guards.test.ts +340 -340
  234. package/templates/default/tests/unit/images.test.ts +26 -26
  235. package/templates/default/tests/unit/landing.test.ts +151 -151
  236. package/templates/default/tests/unit/languages.test.ts +42 -42
  237. package/templates/default/tests/unit/middleware.test.ts +53 -53
  238. package/templates/default/tests/unit/offer-tiles.test.ts +75 -75
  239. package/templates/default/tests/unit/render.ts +38 -38
  240. package/templates/default/tests/unit/reviews.test.ts +25 -25
  241. package/templates/default/tests/unit/rules.test.ts +59 -59
  242. package/templates/default/tests/unit/source.ts +75 -75
  243. package/templates/default/tests/unit/store-pages.test.ts +147 -147
  244. package/templates/default/tests/unit/studio.test.ts +202 -202
  245. package/templates/default/tests/unit/testimonials.test.ts +52 -52
  246. package/templates/default/tests/unit/thank-you.test.ts +52 -52
  247. package/templates/default/tests/unit/tracking.test.ts +29 -29
  248. package/templates/default/tests/unit/voice-note.test.ts +42 -42
  249. package/templates/default/tsconfig.json +13 -13
  250. package/templates/default/vitest.config.ts +15 -15
  251. package/templates/default/wrangler.jsonc +16 -16
@@ -1,20 +1,20 @@
1
- ---
2
- /**
3
- * A part every page shares — the header, the footer — composed of sections like
4
- * a page: the store's saved document for it, or the theme's default. When an
5
- * editor is working on this area its draft renders, and only then are the
6
- * area's sections marked for selection.
7
- */
8
- import { areaSurface } from "@abcart/theme";
9
- import Sections from "./Sections.astro";
10
-
11
- interface Props {
12
- area: "header" | "footer";
13
- }
14
-
15
- const surface = areaSurface(Astro.props.area);
16
- const draft = Astro.locals.preview?.draft;
17
- const editing = draft?.surface === surface;
18
- const document = editing && draft?.document !== undefined ? draft.document : await Astro.locals.store.client.pageData.get(surface);
19
- ---
20
- <Sections surface={surface} document={document} preview={editing} />
1
+ ---
2
+ /**
3
+ * A part every page shares — the header, the footer — composed of sections like
4
+ * a page: the store's saved document for it, or the theme's default. When an
5
+ * editor is working on this area its draft renders, and only then are the
6
+ * area's sections marked for selection.
7
+ */
8
+ import { areaSurface } from "@abcart/theme";
9
+ import Sections from "./Sections.astro";
10
+
11
+ interface Props {
12
+ area: "header" | "footer";
13
+ }
14
+
15
+ const surface = areaSurface(Astro.props.area);
16
+ const draft = Astro.locals.preview?.draft;
17
+ const editing = draft?.surface === surface;
18
+ const document = editing && draft?.document !== undefined ? draft.document : await Astro.locals.store.client.pageData.get(surface);
19
+ ---
20
+ <Sections surface={surface} document={document} preview={editing} />
@@ -1,24 +1,24 @@
1
- ---
2
- /**
3
- * The preview page's link to the editor that frames it: it reports where each
4
- * marked section is, turns clicks into selections and re-renders the drafts
5
- * the editor sends. Rendered on `/wocart-preview` only, from a verified token.
6
- */
7
- interface Props {
8
- /** The verified token's editor origin: the only window it talks to. */
9
- editor: string;
10
- token: string;
11
- }
12
-
13
- const { editor, token } = Astro.props;
14
- ---
15
- <wocart-preview-bridge data-editor={editor} data-token={token} hidden></wocart-preview-bridge>
16
-
17
- <script>
18
- import { startPreviewBridge } from "@abcart/theme/preview";
19
-
20
- const host = document.querySelector<HTMLElement>("wocart-preview-bridge");
21
- if (host?.dataset.editor && host.dataset.token) {
22
- startPreviewBridge({ editorOrigin: host.dataset.editor, token: host.dataset.token });
23
- }
24
- </script>
1
+ ---
2
+ /**
3
+ * The preview page's link to the editor that frames it: it reports where each
4
+ * marked section is, turns clicks into selections and re-renders the drafts
5
+ * the editor sends. Rendered on `/abcart-preview` only, from a verified token.
6
+ */
7
+ interface Props {
8
+ /** The verified token's editor origin: the only window it talks to. */
9
+ editor: string;
10
+ token: string;
11
+ }
12
+
13
+ const { editor, token } = Astro.props;
14
+ ---
15
+ <abcart-preview-bridge data-editor={editor} data-token={token} hidden></abcart-preview-bridge>
16
+
17
+ <script>
18
+ import { startPreviewBridge } from "@abcart/theme/preview";
19
+
20
+ const host = document.querySelector<HTMLElement>("abcart-preview-bridge");
21
+ if (host?.dataset.editor && host.dataset.token) {
22
+ startPreviewBridge({ editorOrigin: host.dataset.editor, token: host.dataset.token });
23
+ }
24
+ </script>
@@ -1,35 +1,35 @@
1
- ---
2
- /**
3
- * A composed surface's sections: the document that wins — the store's saved one
4
- * or an editor's draft, else the theme's default — completed with every
5
- * required section and rendered through the SDK with one read cache per page.
6
- * In a preview each section is marked so the editor can select it; a shopper's
7
- * page carries no markers.
8
- */
9
- import InstanceView from "@abcart/theme/astro/InstanceView.astro";
10
- import { createReadCache, type RendererIssue } from "@abcart/theme/astro";
11
- import { resolveSurfaceDocument, type ReadCache } from "@abcart/theme";
12
- import { theme } from "@/theme/theme";
13
- import { THEME_KEY } from "@/theme/key";
14
- import { buildThemeRenderContext } from "@/lib/context";
15
-
16
- interface Props {
17
- surface: string;
18
- /** What the store saved for the surface (`null` when nothing), or an editor's draft. */
19
- document: unknown;
20
- preview?: boolean;
21
- params?: Record<string, string | undefined>;
22
- reads?: ReadCache;
23
- }
24
-
25
- const { surface, document, preview = false, params } = Astro.props;
26
- const store = Astro.locals.store;
27
- const context = buildThemeRenderContext(store, params);
28
- const resolved = resolveSurfaceDocument(theme, surface, document, { content: store.content, locales: [store.locale, ...(context.fallbackLocales ?? [])] });
29
- if (resolved.source === "default" && document) console.warn(`[${THEME_KEY}] ${surface}: saved document replaced by the default (${resolved.issues.length} issue(s))`);
30
- const reads = Astro.props.reads ?? createReadCache();
31
- const onIssue = (issue: RendererIssue) => console.warn(`[${THEME_KEY}] ${surface}: ${issue.code} ${issue.message}`);
32
- ---
33
- {resolved.page.sections.map((section) => (
34
- <InstanceView instance={section} theme={theme} context={context} storefront={store.client} reads={reads} onIssue={onIssue} preview={preview} />
35
- ))}
1
+ ---
2
+ /**
3
+ * A composed surface's sections: the document that wins — the store's saved one
4
+ * or an editor's draft, else the theme's default — completed with every
5
+ * required section and rendered through the SDK with one read cache per page.
6
+ * In a preview each section is marked so the editor can select it; a shopper's
7
+ * page carries no markers.
8
+ */
9
+ import InstanceView from "@abcart/theme/astro/InstanceView.astro";
10
+ import { createReadCache, type RendererIssue } from "@abcart/theme/astro";
11
+ import { resolveSurfaceDocument, type ReadCache } from "@abcart/theme";
12
+ import { theme } from "@/theme/theme";
13
+ import { THEME_KEY } from "@/theme/key";
14
+ import { buildThemeRenderContext } from "@/lib/context";
15
+
16
+ interface Props {
17
+ surface: string;
18
+ /** What the store saved for the surface (`null` when nothing), or an editor's draft. */
19
+ document: unknown;
20
+ preview?: boolean;
21
+ params?: Record<string, string | undefined>;
22
+ reads?: ReadCache;
23
+ }
24
+
25
+ const { surface, document, preview = false, params } = Astro.props;
26
+ const store = Astro.locals.store;
27
+ const context = buildThemeRenderContext(store, params);
28
+ const resolved = resolveSurfaceDocument(theme, surface, document, { content: store.content, locales: [store.locale, ...(context.fallbackLocales ?? [])] });
29
+ if (resolved.source === "default" && document) console.warn(`[${THEME_KEY}] ${surface}: saved document replaced by the default (${resolved.issues.length} issue(s))`);
30
+ const reads = Astro.props.reads ?? createReadCache();
31
+ const onIssue = (issue: RendererIssue) => console.warn(`[${THEME_KEY}] ${surface}: ${issue.code} ${issue.message}`);
32
+ ---
33
+ {resolved.page.sections.map((section) => (
34
+ <InstanceView instance={section} theme={theme} context={context} storefront={store.client} reads={reads} onIssue={onIssue} preview={preview} />
35
+ ))}
@@ -1,36 +1,36 @@
1
- ---
2
- import Icon from "./Icon.astro";
3
- import { createTranslator } from "@/lib/i18n";
4
-
5
- interface Crumb {
6
- label: string;
7
- href?: string;
8
- }
9
-
10
- interface Props {
11
- /** From home to the page itself; the last one is the page. */
12
- items: Crumb[];
13
- }
14
-
15
- const { items } = Astro.props;
16
- const t = createTranslator(Astro.locals.store.content, Astro.locals.store.locale);
17
- ---
18
- <nav class="breadcrumbs" aria-label={t("a11y.breadcrumb")}>
19
- <ol>
20
- {items.map((item, index) => {
21
- const last = index === items.length - 1;
22
- return (
23
- <li>
24
- {index > 0 && <Icon name="chevron-right" size={13} class="icon-directional" />}
25
- {last || !item.href ? (
26
- <span aria-current={last ? "page" : undefined}>{item.label}</span>
27
- ) : index === 0 ? (
28
- <a href={item.href}><Icon name="home" size={15} /><span class="sr-only">{item.label}</span></a>
29
- ) : (
30
- <a href={item.href}>{item.label}</a>
31
- )}
32
- </li>
33
- );
34
- })}
35
- </ol>
36
- </nav>
1
+ ---
2
+ import Icon from "./Icon.astro";
3
+ import { createTranslator } from "@/lib/i18n";
4
+
5
+ interface Crumb {
6
+ label: string;
7
+ href?: string;
8
+ }
9
+
10
+ interface Props {
11
+ /** From home to the page itself; the last one is the page. */
12
+ items: Crumb[];
13
+ }
14
+
15
+ const { items } = Astro.props;
16
+ const t = createTranslator(Astro.locals.store.content, Astro.locals.store.locale);
17
+ ---
18
+ <nav class="breadcrumbs" aria-label={t("a11y.breadcrumb")}>
19
+ <ol>
20
+ {items.map((item, index) => {
21
+ const last = index === items.length - 1;
22
+ return (
23
+ <li>
24
+ {index > 0 && <Icon name="chevron-right" size={13} class="icon-directional" />}
25
+ {last || !item.href ? (
26
+ <span aria-current={last ? "page" : undefined}>{item.label}</span>
27
+ ) : index === 0 ? (
28
+ <a href={item.href}><Icon name="home" size={15} /><span class="sr-only">{item.label}</span></a>
29
+ ) : (
30
+ <a href={item.href}>{item.label}</a>
31
+ )}
32
+ </li>
33
+ );
34
+ })}
35
+ </ol>
36
+ </nav>
@@ -1,45 +1,45 @@
1
- ---
2
- interface Props {
3
- href?: string;
4
- variant?: "primary" | "ghost" | "white" | "dark" | "link";
5
- size?: "sm" | "md" | "lg";
6
- block?: boolean;
7
- type?: "button" | "submit";
8
- class?: string;
9
- ariaLabel?: string;
10
- disabled?: boolean;
11
- attrs?: Record<string, string | number | boolean | undefined>;
12
- }
13
-
14
- const {
15
- href,
16
- variant = "primary",
17
- size = "md",
18
- block = false,
19
- type = "button",
20
- class: className = "",
21
- ariaLabel,
22
- disabled = false,
23
- attrs = {},
24
- } = Astro.props;
25
-
26
- const classes = [
27
- "btn",
28
- variant !== "primary" ? `btn--${variant}` : "",
29
- size !== "md" ? `btn--${size}` : "",
30
- block ? "btn--block" : "",
31
- className,
32
- ]
33
- .filter(Boolean)
34
- .join(" ");
35
-
36
- ---
37
- {href ? (
38
- <a href={href} class={classes} aria-label={ariaLabel} {...Object.fromEntries(Object.entries(attrs).filter(([, v]) => v !== undefined && v !== false))}>
39
- <slot />
40
- </a>
41
- ) : (
42
- <button type={type} class={classes} aria-label={ariaLabel} disabled={disabled} {...Object.fromEntries(Object.entries(attrs).filter(([, v]) => v !== undefined && v !== false))}>
43
- <slot />
44
- </button>
45
- )}
1
+ ---
2
+ interface Props {
3
+ href?: string;
4
+ variant?: "primary" | "ghost" | "white" | "dark" | "link";
5
+ size?: "sm" | "md" | "lg";
6
+ block?: boolean;
7
+ type?: "button" | "submit";
8
+ class?: string;
9
+ ariaLabel?: string;
10
+ disabled?: boolean;
11
+ attrs?: Record<string, string | number | boolean | undefined>;
12
+ }
13
+
14
+ const {
15
+ href,
16
+ variant = "primary",
17
+ size = "md",
18
+ block = false,
19
+ type = "button",
20
+ class: className = "",
21
+ ariaLabel,
22
+ disabled = false,
23
+ attrs = {},
24
+ } = Astro.props;
25
+
26
+ const classes = [
27
+ "btn",
28
+ variant !== "primary" ? `btn--${variant}` : "",
29
+ size !== "md" ? `btn--${size}` : "",
30
+ block ? "btn--block" : "",
31
+ className,
32
+ ]
33
+ .filter(Boolean)
34
+ .join(" ");
35
+
36
+ ---
37
+ {href ? (
38
+ <a href={href} class={classes} aria-label={ariaLabel} {...Object.fromEntries(Object.entries(attrs).filter(([, v]) => v !== undefined && v !== false))}>
39
+ <slot />
40
+ </a>
41
+ ) : (
42
+ <button type={type} class={classes} aria-label={ariaLabel} disabled={disabled} {...Object.fromEntries(Object.entries(attrs).filter(([, v]) => v !== undefined && v !== false))}>
43
+ <slot />
44
+ </button>
45
+ )}
@@ -1,24 +1,24 @@
1
- ---
2
- /**
3
- * What a section with nothing to show yet draws in the editor's preview — no
4
- * products picked, no photos, no text — so the merchant can see, select and
5
- * fill it. A shopper's page never renders it: a section with nothing to show
6
- * renders nothing there.
7
- */
8
- import Icon from "./Icon.astro";
9
- import { createTranslator } from "@/lib/i18n";
10
- import type { ContentKey } from "@/theme/content";
11
-
12
- interface Props {
13
- /** What the merchant should do to fill the section. */
14
- hint: ContentKey;
15
- icon?: string;
16
- }
17
-
18
- const { hint, icon = "sparkles" } = Astro.props;
19
- const t = createTranslator(Astro.locals.store.content, Astro.locals.store.locale);
20
- ---
21
- <div class="editor-placeholder">
22
- <Icon name={icon} size={26} />
23
- <p>{t(hint)}</p>
24
- </div>
1
+ ---
2
+ /**
3
+ * What a section with nothing to show yet draws in the editor's preview — no
4
+ * products picked, no photos, no text — so the merchant can see, select and
5
+ * fill it. A shopper's page never renders it: a section with nothing to show
6
+ * renders nothing there.
7
+ */
8
+ import Icon from "./Icon.astro";
9
+ import { createTranslator } from "@/lib/i18n";
10
+ import type { ContentKey } from "@/theme/content";
11
+
12
+ interface Props {
13
+ /** What the merchant should do to fill the section. */
14
+ hint: ContentKey;
15
+ icon?: string;
16
+ }
17
+
18
+ const { hint, icon = "sparkles" } = Astro.props;
19
+ const t = createTranslator(Astro.locals.store.content, Astro.locals.store.locale);
20
+ ---
21
+ <div class="editor-placeholder">
22
+ <Icon name={icon} size={26} />
23
+ <p>{t(hint)}</p>
24
+ </div>
@@ -1,93 +1,93 @@
1
- ---
2
- interface Props {
3
- name: string;
4
- size?: number;
5
- class?: string;
6
- strokeWidth?: number;
7
- filled?: boolean;
8
- label?: string;
9
- style?: string;
10
- }
11
-
12
- const { name, size = 24, class: className, strokeWidth = 1.8, filled = false, label, style } = Astro.props;
13
-
14
- const paths: Record<string, string> = {
15
- menu: "M4 7h16M4 12h16M4 17h16",
16
- close: "M6 6l12 12M18 6L6 18",
17
- search: "M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm10 2-4.35-4.35",
18
- bag: "M6 8h12l1 12H5L6 8Zm3 0V6a3 3 0 0 1 6 0v2",
19
- edit: "M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z",
20
- "chevron-down": "m6 9 6 6 6-6",
21
- "chevron-up": "m18 15-6-6-6 6",
22
- "chevron-left": "m15 18-6-6 6-6",
23
- "chevron-right": "m9 18 6-6-6-6",
24
- "arrow-right": "M4 12h16m-6-6 6 6-6 6",
25
- "arrow-left": "M20 12H4m6 6-6-6 6-6",
26
- "arrow-up": "M12 20V4m-6 6 6-6 6 6",
27
- check: "m20 6-11 11-5-5",
28
- "check-circle": "M22 11.1V12a10 10 0 1 1-5.9-9.1M22 4 12 14l-3-3",
29
- plus: "M12 5v14M5 12h14",
30
- minus: "M5 12h14",
31
- trash: "M3 6h18M8 6V4h8v2m-9 0 1 14h8l1-14M10 10v7M14 10v7",
32
- tag: "M20.6 13.4 12 22l-9-9V4h9l8.6 8.6a1.4 1.4 0 0 1 0 2ZM7.5 7.5h.01",
33
- mail: "M4 4h16v16H4zM4 6l8 6 8-6",
34
- phone: "M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2 4.2 2 2 0 0 1 4 2h3a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.4 2.1L8 9.6a16 16 0 0 0 6 6l1.2-1.2a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2Z",
35
- "map-pin": "M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z M12 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",
36
- truck: "M3 6h11v11H3zM14 9h4l3 3v5h-7zM7.5 20.5a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6ZM18 20.5a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6Z",
37
- cash: "M3 6h18v12H3zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 9h.01M18 15h.01",
38
- refresh: "M3 12a9 9 0 0 1 15.5-6.2L21 8M21 3v5h-5M21 12a9 9 0 0 1-15.5 6.2L3 16M3 21v-5h5",
39
- shield: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z",
40
- lock: "M5 11h14v10H5zM8 11V7a4 4 0 0 1 8 0v4",
41
- star: "m12 2.6 2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5L2.6 9.4l6.5-.9L12 2.6Z",
42
- heart: "M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1.1L12 21l7.8-7.5 1.1-1.1a5.5 5.5 0 0 0-.1-7.8Z",
43
- instagram:
44
- "M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5Zm5 5.4a4.6 4.6 0 1 0 0 9.2 4.6 4.6 0 0 0 0-9.2ZM17.5 6.5h.01",
45
- facebook: "M14 22v-9h3l.5-3.5H14V7.3c0-1 .3-1.8 1.8-1.8h1.9V2.4c-.3 0-1.5-.1-2.8-.1-2.8 0-4.7 1.7-4.7 4.8v2.4H7V13h3.2v9H14Z",
46
- tiktok:
47
- "M14 3v9.6a4.4 4.4 0 1 1-3.5-4.3V11a1.8 1.8 0 1 0 1.4 1.7V3h2.1a5 5 0 0 0 5 4.5V10A7 7 0 0 1 14 8.2",
48
- youtube: "M21.6 7.2a2.7 2.7 0 0 0-1.9-1.9C18 4.8 12 4.8 12 4.8s-6 0-7.7.5A2.7 2.7 0 0 0 2.4 7.2 28 28 0 0 0 2 12a28 28 0 0 0 .4 4.8 2.7 2.7 0 0 0 1.9 1.9c1.7.5 7.7.5 7.7.5s6 0 7.7-.5a2.7 2.7 0 0 0 1.9-1.9A28 28 0 0 0 22 12a28 28 0 0 0-.4-4.8ZM10 15.2V8.8l5.2 3.2-5.2 3.2Z",
49
- whatsapp:
50
- "M12 2a10 10 0 0 0-8.5 15.2L2 22l4.9-1.4A10 10 0 1 0 12 2Zm0 2a8 8 0 0 1 0 16 8 8 0 0 1-4.2-1.2l-.5-.3-2.6.7.7-2.5-.3-.5A8 8 0 0 1 12 4Zm-3.2 4.1c-.2 0-.5.1-.7.4-.2.3-.8.8-.8 2s.8 2.3.9 2.5c.1.2 1.6 2.6 4 3.6 2 .8 2.4.6 2.8.6.4 0 1.4-.6 1.6-1.1.2-.6.2-1 .1-1.1-.1-.1-.2-.2-.5-.4l-1.6-.8c-.2-.1-.4-.1-.6.1l-.7.9c-.1.2-.3.2-.5.1a6.6 6.6 0 0 1-3.2-2.8c-.1-.2 0-.4.1-.5l.5-.6c.1-.2.1-.3 0-.5l-.7-1.7c-.2-.5-.4-.4-.6-.4h-.1Z",
51
- sparkles: "m12 3 1.6 4.4L18 9l-4.4 1.6L12 15l-1.6-4.4L6 9l4.4-1.6L12 3ZM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14ZM5 14l.7 1.6L7.3 16l-1.6.7L5 18.3l-.7-1.6L2.7 16l1.6-.7L5 14Z",
52
- alert: "M12 9v4m0 4h.01M10.3 3.9 2.4 17.5A2 2 0 0 0 4.1 20.5h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z",
53
- info: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-14h.01M11 12h1v4h1",
54
- clock: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-16v6l4 2",
55
- package: "m12 2 9 5v10l-9 5-9-5V7l9-5Zm0 0v20M3 7l9 5 9-5",
56
- home: "m3 10 9-8 9 8v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1V10Z",
57
- filter: "M3 5h18l-7 8v6l-4 2v-8L3 5Z",
58
- grid: "M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z",
59
- globe:
60
- "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20ZM2 12h20M12 2a15 15 0 0 1 4 10 15 15 0 0 1-4 10 15 15 0 0 1-4-10 15 15 0 0 1 4-10Z",
61
- quote: "M3 21c3 0 7-1 7-8V5c0-1.2-1-2-2-2H4c-1 0-2 .8-2 2v6c0 1.2 1 2 2 2h3c0 3-1 4-4 5v3ZM14 21c3 0 7-1 7-8V5c0-1.2-1-2-2-2h-4c-1 0-2 .8-2 2v6c0 1.2 1 2 2 2h3c0 3-1 4-4 5v3Z",
62
- user: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",
63
- image: "M3 3h18v18H3zM8.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM21 15l-5-5L5 21",
64
- eye: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Zm10 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",
65
- gift: "M20 12v9H4v-9M2 7h20v5H2zM12 22V7m0 0H7.5a2.5 2.5 0 1 1 0-5C11 2 12 7 12 7Zm0 0h4.5a2.5 2.5 0 1 0 0-5C13 2 12 7 12 7Z",
66
- play: "M7 4.5v15a1 1 0 0 0 1.5.86l12.5-7.5a1 1 0 0 0 0-1.72L8.5 3.64A1 1 0 0 0 7 4.5Z",
67
- pause: "M7 4h3.5v16H7zM13.5 4H17v16h-3.5z",
68
- mic: "M12 15a3.5 3.5 0 0 0 3.5-3.5V5.5a3.5 3.5 0 1 0-7 0v6A3.5 3.5 0 0 0 12 15Zm-7-4a7 7 0 0 0 14 0M12 18v3",
69
- paperclip: "m21 11-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9",
70
- camera: "M4 7h3l2-3h6l2 3h3a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm8 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",
71
- percent: "M19 5 5 19M6.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM17.5 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",
72
- };
73
-
74
- const d = paths[name] ?? paths.info;
75
- ---
76
- <svg
77
- class={className}
78
- width={size}
79
- height={size}
80
- viewBox="0 0 24 24"
81
- fill={filled || name === "star" || name === "play" || name === "pause" ? "currentColor" : "none"}
82
- stroke={filled || name === "star" || name === "play" || name === "pause" ? "none" : "currentColor"}
83
- stroke-width={strokeWidth}
84
- stroke-linecap="round"
85
- stroke-linejoin="round"
86
- aria-hidden={label ? undefined : "true"}
87
- role={label ? "img" : undefined}
88
- aria-label={label}
89
- focusable="false"
90
- style={style}
91
- >
92
- <path d={d} />
93
- </svg>
1
+ ---
2
+ interface Props {
3
+ name: string;
4
+ size?: number;
5
+ class?: string;
6
+ strokeWidth?: number;
7
+ filled?: boolean;
8
+ label?: string;
9
+ style?: string;
10
+ }
11
+
12
+ const { name, size = 24, class: className, strokeWidth = 1.8, filled = false, label, style } = Astro.props;
13
+
14
+ const paths: Record<string, string> = {
15
+ menu: "M4 7h16M4 12h16M4 17h16",
16
+ close: "M6 6l12 12M18 6L6 18",
17
+ search: "M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm10 2-4.35-4.35",
18
+ bag: "M6 8h12l1 12H5L6 8Zm3 0V6a3 3 0 0 1 6 0v2",
19
+ edit: "M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z",
20
+ "chevron-down": "m6 9 6 6 6-6",
21
+ "chevron-up": "m18 15-6-6-6 6",
22
+ "chevron-left": "m15 18-6-6 6-6",
23
+ "chevron-right": "m9 18 6-6-6-6",
24
+ "arrow-right": "M4 12h16m-6-6 6 6-6 6",
25
+ "arrow-left": "M20 12H4m6 6-6-6 6-6",
26
+ "arrow-up": "M12 20V4m-6 6 6-6 6 6",
27
+ check: "m20 6-11 11-5-5",
28
+ "check-circle": "M22 11.1V12a10 10 0 1 1-5.9-9.1M22 4 12 14l-3-3",
29
+ plus: "M12 5v14M5 12h14",
30
+ minus: "M5 12h14",
31
+ trash: "M3 6h18M8 6V4h8v2m-9 0 1 14h8l1-14M10 10v7M14 10v7",
32
+ tag: "M20.6 13.4 12 22l-9-9V4h9l8.6 8.6a1.4 1.4 0 0 1 0 2ZM7.5 7.5h.01",
33
+ mail: "M4 4h16v16H4zM4 6l8 6 8-6",
34
+ phone: "M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2 4.2 2 2 0 0 1 4 2h3a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.4 2.1L8 9.6a16 16 0 0 0 6 6l1.2-1.2a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2Z",
35
+ "map-pin": "M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z M12 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",
36
+ truck: "M3 6h11v11H3zM14 9h4l3 3v5h-7zM7.5 20.5a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6ZM18 20.5a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6Z",
37
+ cash: "M3 6h18v12H3zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 9h.01M18 15h.01",
38
+ refresh: "M3 12a9 9 0 0 1 15.5-6.2L21 8M21 3v5h-5M21 12a9 9 0 0 1-15.5 6.2L3 16M3 21v-5h5",
39
+ shield: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z",
40
+ lock: "M5 11h14v10H5zM8 11V7a4 4 0 0 1 8 0v4",
41
+ star: "m12 2.6 2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5L2.6 9.4l6.5-.9L12 2.6Z",
42
+ heart: "M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1.1L12 21l7.8-7.5 1.1-1.1a5.5 5.5 0 0 0-.1-7.8Z",
43
+ instagram:
44
+ "M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5Zm5 5.4a4.6 4.6 0 1 0 0 9.2 4.6 4.6 0 0 0 0-9.2ZM17.5 6.5h.01",
45
+ facebook: "M14 22v-9h3l.5-3.5H14V7.3c0-1 .3-1.8 1.8-1.8h1.9V2.4c-.3 0-1.5-.1-2.8-.1-2.8 0-4.7 1.7-4.7 4.8v2.4H7V13h3.2v9H14Z",
46
+ tiktok:
47
+ "M14 3v9.6a4.4 4.4 0 1 1-3.5-4.3V11a1.8 1.8 0 1 0 1.4 1.7V3h2.1a5 5 0 0 0 5 4.5V10A7 7 0 0 1 14 8.2",
48
+ youtube: "M21.6 7.2a2.7 2.7 0 0 0-1.9-1.9C18 4.8 12 4.8 12 4.8s-6 0-7.7.5A2.7 2.7 0 0 0 2.4 7.2 28 28 0 0 0 2 12a28 28 0 0 0 .4 4.8 2.7 2.7 0 0 0 1.9 1.9c1.7.5 7.7.5 7.7.5s6 0 7.7-.5a2.7 2.7 0 0 0 1.9-1.9A28 28 0 0 0 22 12a28 28 0 0 0-.4-4.8ZM10 15.2V8.8l5.2 3.2-5.2 3.2Z",
49
+ whatsapp:
50
+ "M12 2a10 10 0 0 0-8.5 15.2L2 22l4.9-1.4A10 10 0 1 0 12 2Zm0 2a8 8 0 0 1 0 16 8 8 0 0 1-4.2-1.2l-.5-.3-2.6.7.7-2.5-.3-.5A8 8 0 0 1 12 4Zm-3.2 4.1c-.2 0-.5.1-.7.4-.2.3-.8.8-.8 2s.8 2.3.9 2.5c.1.2 1.6 2.6 4 3.6 2 .8 2.4.6 2.8.6.4 0 1.4-.6 1.6-1.1.2-.6.2-1 .1-1.1-.1-.1-.2-.2-.5-.4l-1.6-.8c-.2-.1-.4-.1-.6.1l-.7.9c-.1.2-.3.2-.5.1a6.6 6.6 0 0 1-3.2-2.8c-.1-.2 0-.4.1-.5l.5-.6c.1-.2.1-.3 0-.5l-.7-1.7c-.2-.5-.4-.4-.6-.4h-.1Z",
51
+ sparkles: "m12 3 1.6 4.4L18 9l-4.4 1.6L12 15l-1.6-4.4L6 9l4.4-1.6L12 3ZM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14ZM5 14l.7 1.6L7.3 16l-1.6.7L5 18.3l-.7-1.6L2.7 16l1.6-.7L5 14Z",
52
+ alert: "M12 9v4m0 4h.01M10.3 3.9 2.4 17.5A2 2 0 0 0 4.1 20.5h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z",
53
+ info: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-14h.01M11 12h1v4h1",
54
+ clock: "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-16v6l4 2",
55
+ package: "m12 2 9 5v10l-9 5-9-5V7l9-5Zm0 0v20M3 7l9 5 9-5",
56
+ home: "m3 10 9-8 9 8v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1V10Z",
57
+ filter: "M3 5h18l-7 8v6l-4 2v-8L3 5Z",
58
+ grid: "M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z",
59
+ globe:
60
+ "M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20ZM2 12h20M12 2a15 15 0 0 1 4 10 15 15 0 0 1-4 10 15 15 0 0 1-4-10 15 15 0 0 1 4-10Z",
61
+ quote: "M3 21c3 0 7-1 7-8V5c0-1.2-1-2-2-2H4c-1 0-2 .8-2 2v6c0 1.2 1 2 2 2h3c0 3-1 4-4 5v3ZM14 21c3 0 7-1 7-8V5c0-1.2-1-2-2-2h-4c-1 0-2 .8-2 2v6c0 1.2 1 2 2 2h3c0 3-1 4-4 5v3Z",
62
+ user: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",
63
+ image: "M3 3h18v18H3zM8.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM21 15l-5-5L5 21",
64
+ eye: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Zm10 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",
65
+ gift: "M20 12v9H4v-9M2 7h20v5H2zM12 22V7m0 0H7.5a2.5 2.5 0 1 1 0-5C11 2 12 7 12 7Zm0 0h4.5a2.5 2.5 0 1 0 0-5C13 2 12 7 12 7Z",
66
+ play: "M7 4.5v15a1 1 0 0 0 1.5.86l12.5-7.5a1 1 0 0 0 0-1.72L8.5 3.64A1 1 0 0 0 7 4.5Z",
67
+ pause: "M7 4h3.5v16H7zM13.5 4H17v16h-3.5z",
68
+ mic: "M12 15a3.5 3.5 0 0 0 3.5-3.5V5.5a3.5 3.5 0 1 0-7 0v6A3.5 3.5 0 0 0 12 15Zm-7-4a7 7 0 0 0 14 0M12 18v3",
69
+ paperclip: "m21 11-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9",
70
+ camera: "M4 7h3l2-3h6l2 3h3a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm8 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z",
71
+ percent: "M19 5 5 19M6.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM17.5 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",
72
+ };
73
+
74
+ const d = paths[name] ?? paths.info;
75
+ ---
76
+ <svg
77
+ class={className}
78
+ width={size}
79
+ height={size}
80
+ viewBox="0 0 24 24"
81
+ fill={filled || name === "star" || name === "play" || name === "pause" ? "currentColor" : "none"}
82
+ stroke={filled || name === "star" || name === "play" || name === "pause" ? "none" : "currentColor"}
83
+ stroke-width={strokeWidth}
84
+ stroke-linecap="round"
85
+ stroke-linejoin="round"
86
+ aria-hidden={label ? undefined : "true"}
87
+ role={label ? "img" : undefined}
88
+ aria-label={label}
89
+ focusable="false"
90
+ style={style}
91
+ >
92
+ <path d={d} />
93
+ </svg>
@@ -1,36 +1,36 @@
1
- ---
2
- /**
3
- * The store's logo, as uploaded in its settings, at the size the place it
4
- * sits in asks for and in its own proportions; the store's name in its place
5
- * when it has none.
6
- */
7
- import { imageUrl } from "@/lib/images";
8
-
9
- interface Props {
10
- /** The class the picture or the name wears. */
11
- imageClass: string;
12
- textClass: string;
13
- /** The height it is shown at, in CSS pixels; the file is fetched sharp for it. */
14
- height: number;
15
- loading?: "eager" | "lazy";
16
- }
17
-
18
- const { imageClass, textClass, height, loading = "eager" } = Astro.props;
19
- const { config } = Astro.locals.store;
20
- const logo = config.logo;
21
- const ratio = logo?.width && logo.height ? logo.width / logo.height : null;
22
- const width = ratio ? Math.round(height * ratio) : undefined;
23
- ---
24
- {logo ? (
25
- <img
26
- class={imageClass}
27
- src={imageUrl(logo.url, config.media, Math.min(width ?? height * 4, 640) * 2) ?? logo.url}
28
- alt={config.name}
29
- width={width}
30
- height={ratio ? height : undefined}
31
- loading={loading}
32
- decoding="async"
33
- />
34
- ) : (
35
- <span class={textClass}>{config.name}</span>
36
- )}
1
+ ---
2
+ /**
3
+ * The store's logo, as uploaded in its settings, at the size the place it
4
+ * sits in asks for and in its own proportions; the store's name in its place
5
+ * when it has none.
6
+ */
7
+ import { imageUrl } from "@/lib/images";
8
+
9
+ interface Props {
10
+ /** The class the picture or the name wears. */
11
+ imageClass: string;
12
+ textClass: string;
13
+ /** The height it is shown at, in CSS pixels; the file is fetched sharp for it. */
14
+ height: number;
15
+ loading?: "eager" | "lazy";
16
+ }
17
+
18
+ const { imageClass, textClass, height, loading = "eager" } = Astro.props;
19
+ const { config } = Astro.locals.store;
20
+ const logo = config.logo;
21
+ const ratio = logo?.width && logo.height ? logo.width / logo.height : null;
22
+ const width = ratio ? Math.round(height * ratio) : undefined;
23
+ ---
24
+ {logo ? (
25
+ <img
26
+ class={imageClass}
27
+ src={imageUrl(logo.url, config.media, Math.min(width ?? height * 4, 640) * 2) ?? logo.url}
28
+ alt={config.name}
29
+ width={width}
30
+ height={ratio ? height : undefined}
31
+ loading={loading}
32
+ decoding="async"
33
+ />
34
+ ) : (
35
+ <span class={textClass}>{config.name}</span>
36
+ )}