@eldrajs/theme-cli 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/LICENSE +21 -0
- package/README.md +26 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +203 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +3 -0
- package/dist/validate-C6jB8_Oc.js +510 -0
- package/package.json +50 -2
- package/template/.eldra/block-types.d.ts +429 -0
- package/template/.eldra/manifest.json +9377 -0
- package/template/.eldra/previews.json +36 -0
- package/template/.github/workflows/eldra-deploy.yml +24 -0
- package/template/.gitlab-ci.yml +16 -0
- package/template/.storybook/eldra.ts +123 -0
- package/template/.storybook/i18n.ts +23 -0
- package/template/.storybook/main.ts +59 -0
- package/template/.storybook/nuxt-link-stub.ts +23 -0
- package/template/.storybook/preview.ts +52 -0
- package/template/.storybook/shims-vue.d.ts +10 -0
- package/template/.storybook/virtual-eldra.d.ts +27 -0
- package/template/README.md +288 -0
- package/template/app/app.vue +126 -0
- package/template/app/assets/main.css +404 -0
- package/template/app/components/EldraIcon.vue +66 -0
- package/template/app/components/EldraRouterLink.vue +62 -0
- package/template/app/components/ui/UiImage.stories.ts +30 -0
- package/template/app/components/ui/UiImage.vue +224 -0
- package/template/app/components/ui/__tests__/UiImage.spec.ts +292 -0
- package/template/app/composables/iconComponent.ts +84 -0
- package/template/app/composables/iconFetcher.ts +14 -0
- package/template/app/composables/useBlockData.ts +30 -0
- package/template/app/composables/useEditing.ts +31 -0
- package/template/app/composables/useEldraIcon.ts +46 -0
- package/template/app/composables/useRevalidating.ts +69 -0
- package/template/app/composables/useRichTextScrollRegions.ts +80 -0
- package/template/app/composables/useStorefront.ts +18 -0
- package/template/app/composables/useStorefrontFeedback.ts +49 -0
- package/template/app/composables/useUiId.ts +18 -0
- package/template/app/composables/useWishlist.ts +42 -0
- package/template/app/i18n.d.ts +28 -0
- package/template/app/icons.ts +185 -0
- package/template/app/pages/[...slug].vue +134 -0
- package/template/app/plugins/eldra-i18n.ts +98 -0
- package/template/app/plugins/eldra-storefront.ts +288 -0
- package/template/app/plugins/eldra-ui-messages.ts +112 -0
- package/template/app/storefront/cart.ts +245 -0
- package/template/app/storefront/categories.ts +283 -0
- package/template/app/storefront/collectionSelector.ts +60 -0
- package/template/app/storefront/commerce.ts +58 -0
- package/template/app/storefront/demo.ts +1313 -0
- package/template/app/storefront/facets.ts +476 -0
- package/template/app/storefront/feedback.ts +122 -0
- package/template/app/storefront/gateway.ts +2256 -0
- package/template/app/storefront/history.ts +233 -0
- package/template/app/storefront/money.ts +247 -0
- package/template/app/storefront/options.ts +71 -0
- package/template/app/storefront/prerender.ts +77 -0
- package/template/app/storefront/refresh.ts +222 -0
- package/template/app/storefront/toProductCard.ts +154 -0
- package/template/app/storefront/types.ts +815 -0
- package/template/app/storefront/volatile.ts +211 -0
- package/template/app/templates.ts +544 -0
- package/template/app/utils/classes.ts +40 -0
- package/template/app/utils/links.ts +70 -0
- package/template/app/utils/pageStructure.ts +77 -0
- package/template/app/utils/pageTitle.ts +37 -0
- package/template/app/virtual-eldra.d.ts +12 -0
- package/template/bitbucket-pipelines.yml +19 -0
- package/template/blocks/announcement-bar/Block.vue +203 -0
- package/template/blocks/announcement-bar/__tests__/Block.spec.ts +227 -0
- package/template/blocks/announcement-bar/block.json +45 -0
- package/template/blocks/announcement-bar/mock.json +7 -0
- package/template/blocks/announcement-bar/preview.png +0 -0
- package/template/blocks/article/Block.vue +317 -0
- package/template/blocks/article/__tests__/Block.spec.ts +229 -0
- package/template/blocks/article/block.json +148 -0
- package/template/blocks/article/mock.json +512 -0
- package/template/blocks/article/preview.json +16 -0
- package/template/blocks/article/preview.png +0 -0
- package/template/blocks/article-list/Block.vue +343 -0
- package/template/blocks/article-list/__tests__/Block.spec.ts +279 -0
- package/template/blocks/article-list/block.json +181 -0
- package/template/blocks/article-list/mock.json +68 -0
- package/template/blocks/article-list/preview.json +84 -0
- package/template/blocks/article-list/preview.png +0 -0
- package/template/blocks/breadcrumbs/Block.vue +278 -0
- package/template/blocks/breadcrumbs/__tests__/Block.spec.ts +461 -0
- package/template/blocks/breadcrumbs/block.json +89 -0
- package/template/blocks/breadcrumbs/mock.json +11 -0
- package/template/blocks/breadcrumbs/preview.json +3 -0
- package/template/blocks/breadcrumbs/preview.png +0 -0
- package/template/blocks/cart/Block.vue +372 -0
- package/template/blocks/cart/__tests__/Block.spec.ts +561 -0
- package/template/blocks/cart/__tests__/ShippingBar.spec.ts +78 -0
- package/template/blocks/cart/__tests__/Summary.spec.ts +245 -0
- package/template/blocks/cart/block.json +74 -0
- package/template/blocks/cart/mock.json +11 -0
- package/template/blocks/cart/parts/CartLines.vue +257 -0
- package/template/blocks/cart/parts/ShippingBar.vue +105 -0
- package/template/blocks/cart/parts/Summary.vue +291 -0
- package/template/blocks/cart/preview.png +0 -0
- package/template/blocks/collection-grid/Block.vue +1832 -0
- package/template/blocks/collection-grid/__tests__/Block.spec.ts +3037 -0
- package/template/blocks/collection-grid/__tests__/groups.spec.ts +731 -0
- package/template/blocks/collection-grid/block.json +187 -0
- package/template/blocks/collection-grid/mock.json +23 -0
- package/template/blocks/collection-grid/parts/groups.ts +861 -0
- package/template/blocks/collection-grid/preview.json +7 -0
- package/template/blocks/collection-grid/preview.png +0 -0
- package/template/blocks/collection-header/Block.vue +533 -0
- package/template/blocks/collection-header/__tests__/Block.spec.ts +381 -0
- package/template/blocks/collection-header/block.json +140 -0
- package/template/blocks/collection-header/mock.json +28 -0
- package/template/blocks/collection-header/preview.json +14 -0
- package/template/blocks/collection-header/preview.png +0 -0
- package/template/blocks/contact/Block.vue +621 -0
- package/template/blocks/contact/__tests__/Block.spec.ts +347 -0
- package/template/blocks/contact/block.json +174 -0
- package/template/blocks/contact/mock.json +28 -0
- package/template/blocks/contact/preview.json +9 -0
- package/template/blocks/contact/preview.png +0 -0
- package/template/blocks/cta/Block.vue +383 -0
- package/template/blocks/cta/__tests__/Block.spec.ts +309 -0
- package/template/blocks/cta/block.json +86 -0
- package/template/blocks/cta/mock.json +10 -0
- package/template/blocks/cta/preview.json +9 -0
- package/template/blocks/cta/preview.png +0 -0
- package/template/blocks/faq/Block.vue +254 -0
- package/template/blocks/faq/__tests__/Block.spec.ts +312 -0
- package/template/blocks/faq/block.json +113 -0
- package/template/blocks/faq/mock.json +115 -0
- package/template/blocks/faq/preview.png +0 -0
- package/template/blocks/feature-grid/Block.vue +241 -0
- package/template/blocks/feature-grid/__tests__/Block.spec.ts +311 -0
- package/template/blocks/feature-grid/block.json +106 -0
- package/template/blocks/feature-grid/mock.json +29 -0
- package/template/blocks/feature-grid/preview.json +45 -0
- package/template/blocks/feature-grid/preview.png +0 -0
- package/template/blocks/footer/Block.vue +652 -0
- package/template/blocks/footer/__tests__/Block.spec.ts +700 -0
- package/template/blocks/footer/block.json +240 -0
- package/template/blocks/footer/mock.json +161 -0
- package/template/blocks/footer/preview.png +0 -0
- package/template/blocks/gallery/Block.vue +416 -0
- package/template/blocks/gallery/__tests__/Block.spec.ts +289 -0
- package/template/blocks/gallery/block.json +87 -0
- package/template/blocks/gallery/mock.json +16 -0
- package/template/blocks/gallery/preview.json +64 -0
- package/template/blocks/gallery/preview.png +0 -0
- package/template/blocks/hero/Block.vue +378 -0
- package/template/blocks/hero/__tests__/Block.spec.ts +324 -0
- package/template/blocks/hero/block.json +146 -0
- package/template/blocks/hero/mock.json +11 -0
- package/template/blocks/hero/preview.json +55 -0
- package/template/blocks/hero/preview.png +0 -0
- package/template/blocks/image/Block.vue +232 -0
- package/template/blocks/image/__tests__/Block.spec.ts +224 -0
- package/template/blocks/image/block.json +67 -0
- package/template/blocks/image/mock.json +7 -0
- package/template/blocks/image/preview.json +9 -0
- package/template/blocks/image/preview.png +0 -0
- package/template/blocks/logo-cloud/Block.vue +206 -0
- package/template/blocks/logo-cloud/__tests__/Block.spec.ts +210 -0
- package/template/blocks/logo-cloud/block.json +79 -0
- package/template/blocks/logo-cloud/mock.json +15 -0
- package/template/blocks/logo-cloud/preview.json +92 -0
- package/template/blocks/logo-cloud/preview.png +0 -0
- package/template/blocks/navigation/Block.vue +1348 -0
- package/template/blocks/navigation/__tests__/Block.spec.ts +2030 -0
- package/template/blocks/navigation/block.json +167 -0
- package/template/blocks/navigation/mock.json +191 -0
- package/template/blocks/navigation/preview.png +0 -0
- package/template/blocks/navigation/useMegaMenuKeys.ts +276 -0
- package/template/blocks/newsletter/Block.vue +399 -0
- package/template/blocks/newsletter/__tests__/Block.spec.ts +365 -0
- package/template/blocks/newsletter/block.json +105 -0
- package/template/blocks/newsletter/mock.json +31 -0
- package/template/blocks/newsletter/preview.png +0 -0
- package/template/blocks/order-status/Block.vue +754 -0
- package/template/blocks/order-status/__tests__/Block.spec.ts +515 -0
- package/template/blocks/order-status/block.json +138 -0
- package/template/blocks/order-status/mock.json +19 -0
- package/template/blocks/order-status/preview.png +0 -0
- package/template/blocks/pricing-table/Block.vue +297 -0
- package/template/blocks/pricing-table/__tests__/Block.spec.ts +357 -0
- package/template/blocks/pricing-table/block.json +155 -0
- package/template/blocks/pricing-table/mock.json +47 -0
- package/template/blocks/pricing-table/preview.png +0 -0
- package/template/blocks/product-carousel/Block.vue +459 -0
- package/template/blocks/product-carousel/__tests__/Block.spec.ts +957 -0
- package/template/blocks/product-carousel/block.json +71 -0
- package/template/blocks/product-carousel/mock.json +9 -0
- package/template/blocks/product-carousel/preview.json +7 -0
- package/template/blocks/product-carousel/preview.png +0 -0
- package/template/blocks/product-detail/Block.vue +886 -0
- package/template/blocks/product-detail/__tests__/Block.spec.ts +1495 -0
- package/template/blocks/product-detail/__tests__/stock.spec.ts +119 -0
- package/template/blocks/product-detail/block.json +155 -0
- package/template/blocks/product-detail/mock.json +113 -0
- package/template/blocks/product-detail/parts/Gallery.vue +181 -0
- package/template/blocks/product-detail/parts/StickyBuyBar.vue +99 -0
- package/template/blocks/product-detail/preview.png +0 -0
- package/template/blocks/product-detail/stock.ts +150 -0
- package/template/blocks/quote/Block.vue +206 -0
- package/template/blocks/quote/__tests__/Block.spec.ts +265 -0
- package/template/blocks/quote/block.json +76 -0
- package/template/blocks/quote/mock.json +9 -0
- package/template/blocks/quote/preview.json +16 -0
- package/template/blocks/quote/preview.png +0 -0
- package/template/blocks/rich-text/Block.vue +143 -0
- package/template/blocks/rich-text/__tests__/Block.spec.ts +191 -0
- package/template/blocks/rich-text/block.json +57 -0
- package/template/blocks/rich-text/mock.json +87 -0
- package/template/blocks/rich-text/preview.png +0 -0
- package/template/blocks/search/Block.vue +589 -0
- package/template/blocks/search/PopularChips.vue +40 -0
- package/template/blocks/search/TypeSection.vue +148 -0
- package/template/blocks/search/__tests__/Block.spec.ts +718 -0
- package/template/blocks/search/__tests__/results.spec.ts +166 -0
- package/template/blocks/search/block.json +102 -0
- package/template/blocks/search/mock.json +18 -0
- package/template/blocks/search/preview.png +0 -0
- package/template/blocks/search/results.ts +85 -0
- package/template/blocks/split-content/Block.vue +195 -0
- package/template/blocks/split-content/__tests__/Block.spec.ts +225 -0
- package/template/blocks/split-content/block.json +70 -0
- package/template/blocks/split-content/mock.json +45 -0
- package/template/blocks/split-content/preview.json +58 -0
- package/template/blocks/split-content/preview.png +0 -0
- package/template/blocks/stats/Block.vue +159 -0
- package/template/blocks/stats/__tests__/Block.spec.ts +194 -0
- package/template/blocks/stats/block.json +73 -0
- package/template/blocks/stats/mock.json +12 -0
- package/template/blocks/stats/preview.png +0 -0
- package/template/blocks/tabs/Block.vue +278 -0
- package/template/blocks/tabs/__tests__/Block.spec.ts +303 -0
- package/template/blocks/tabs/block.json +97 -0
- package/template/blocks/tabs/mock.json +129 -0
- package/template/blocks/tabs/preview.json +153 -0
- package/template/blocks/tabs/preview.png +0 -0
- package/template/blocks/team/Block.vue +288 -0
- package/template/blocks/team/__tests__/Block.spec.ts +221 -0
- package/template/blocks/team/block.json +125 -0
- package/template/blocks/team/mock.json +39 -0
- package/template/blocks/team/preview.json +62 -0
- package/template/blocks/team/preview.png +0 -0
- package/template/blocks/testimonials/Block.vue +408 -0
- package/template/blocks/testimonials/__tests__/Block.spec.ts +319 -0
- package/template/blocks/testimonials/block.json +121 -0
- package/template/blocks/testimonials/mock.json +46 -0
- package/template/blocks/testimonials/preview.json +68 -0
- package/template/blocks/testimonials/preview.png +0 -0
- package/template/blocks/timeline/Block.vue +274 -0
- package/template/blocks/timeline/__tests__/Block.spec.ts +310 -0
- package/template/blocks/timeline/block.json +98 -0
- package/template/blocks/timeline/mock.json +27 -0
- package/template/blocks/timeline/preview.png +0 -0
- package/template/blocks/trust-strip/Block.vue +330 -0
- package/template/blocks/trust-strip/__tests__/Block.spec.ts +290 -0
- package/template/blocks/trust-strip/block.json +117 -0
- package/template/blocks/trust-strip/mock.json +37 -0
- package/template/blocks/trust-strip/preview.png +0 -0
- package/template/blocks/video-embed/Block.vue +354 -0
- package/template/blocks/video-embed/__tests__/Block.spec.ts +219 -0
- package/template/blocks/video-embed/__tests__/embed.spec.ts +76 -0
- package/template/blocks/video-embed/block.json +94 -0
- package/template/blocks/video-embed/embed.ts +84 -0
- package/template/blocks/video-embed/mock.json +13 -0
- package/template/blocks/video-embed/preview.json +9 -0
- package/template/blocks/video-embed/preview.png +0 -0
- package/template/blocks/wishlist/Block.vue +367 -0
- package/template/blocks/wishlist/__tests__/Block.spec.ts +508 -0
- package/template/blocks/wishlist/block.json +42 -0
- package/template/blocks/wishlist/mock.json +9 -0
- package/template/blocks/wishlist/preview.png +0 -0
- package/template/i18n/en-US.json +602 -0
- package/template/i18n/is-IS.json +602 -0
- package/template/nuxt.config.ts +148 -0
- package/template/package.json +55 -0
- package/template/pages/article.page.json +731 -0
- package/template/pages/cart.page.json +85 -0
- package/template/pages/category.page.json +133 -0
- package/template/pages/collection.page.json +194 -0
- package/template/pages/home.page.json +353 -0
- package/template/pages/product.page.json +323 -0
- package/template/pages/products.page.json +144 -0
- package/template/pages/search.page.json +83 -0
- package/template/pages/wishlist.page.json +88 -0
- package/template/public/demo/article-cover.svg +1 -0
- package/template/public/demo/article-figure.svg +1 -0
- package/template/public/demo/avatar-1.svg +3 -0
- package/template/public/demo/avatar-2.svg +3 -0
- package/template/public/demo/avatar-3.svg +3 -0
- package/template/public/demo/avatar-4.svg +3 -0
- package/template/public/demo/avatar-5.svg +3 -0
- package/template/public/demo/avatar-6.svg +3 -0
- package/template/public/demo/avatar-7.svg +3 -0
- package/template/public/demo/avatar-8.svg +3 -0
- package/template/public/demo/collection-1.svg +1 -0
- package/template/public/demo/collection-2.svg +1 -0
- package/template/public/demo/cta-split.svg +1 -0
- package/template/public/demo/feature-1.svg +1 -0
- package/template/public/demo/feature-2.svg +1 -0
- package/template/public/demo/feature-3.svg +1 -0
- package/template/public/demo/feature-4.svg +1 -0
- package/template/public/demo/gallery-1.svg +1 -0
- package/template/public/demo/gallery-2.svg +1 -0
- package/template/public/demo/gallery-3.svg +1 -0
- package/template/public/demo/gallery-4.svg +1 -0
- package/template/public/demo/gallery-5.svg +1 -0
- package/template/public/demo/gallery-6.svg +1 -0
- package/template/public/demo/gallery-7.svg +1 -0
- package/template/public/demo/gallery-8.svg +1 -0
- package/template/public/demo/hero-slide-1.svg +1 -0
- package/template/public/demo/hero-slide-2.svg +1 -0
- package/template/public/demo/hero-slide-3.svg +1 -0
- package/template/public/demo/hero-slide-4.svg +1 -0
- package/template/public/demo/hero-wide.svg +1 -0
- package/template/public/demo/hero.svg +1 -0
- package/template/public/demo/logo-1.svg +4 -0
- package/template/public/demo/logo-2.svg +4 -0
- package/template/public/demo/logo-3.svg +4 -0
- package/template/public/demo/logo-4.svg +4 -0
- package/template/public/demo/logo-5.svg +4 -0
- package/template/public/demo/logo-6.svg +4 -0
- package/template/public/demo/logo-7.svg +4 -0
- package/template/public/demo/logo-8.svg +4 -0
- package/template/public/demo/logo.svg +3 -0
- package/template/public/demo/map.svg +1 -0
- package/template/public/demo/poster.svg +1 -0
- package/template/public/demo/product-1.svg +4 -0
- package/template/public/demo/product-10.svg +4 -0
- package/template/public/demo/product-11.svg +4 -0
- package/template/public/demo/product-12.svg +4 -0
- package/template/public/demo/product-2.svg +4 -0
- package/template/public/demo/product-3.svg +4 -0
- package/template/public/demo/product-4.svg +4 -0
- package/template/public/demo/product-5.svg +4 -0
- package/template/public/demo/product-6.svg +4 -0
- package/template/public/demo/product-7.svg +4 -0
- package/template/public/demo/product-8.svg +4 -0
- package/template/public/demo/product-9.svg +4 -0
- package/template/public/demo/product-square-1.svg +4 -0
- package/template/public/demo/product-square-2.svg +4 -0
- package/template/public/demo/product-square-3.svg +4 -0
- package/template/public/demo/product-square-4.svg +4 -0
- package/template/public/demo/product-square-5.svg +4 -0
- package/template/public/demo/product-square-6.svg +4 -0
- package/template/public/demo/quote-portrait.svg +4 -0
- package/template/public/demo/split-1.svg +1 -0
- package/template/public/demo/split-2.svg +1 -0
- package/template/public/demo/split-3.svg +1 -0
- package/template/public/demo/split-4.svg +1 -0
- package/template/public/demo/team-1.svg +4 -0
- package/template/public/demo/team-2.svg +4 -0
- package/template/public/demo/team-3.svg +4 -0
- package/template/public/demo/team-4.svg +4 -0
- package/template/scripts/demo-images.mjs +393 -0
- package/template/scripts/generate-stories.mjs +156 -0
- package/template/scripts/previewHash.mjs +125 -0
- package/template/scripts/previews.mjs +149 -0
- package/template/stories/generated/announcement-bar.stories.ts +44 -0
- package/template/stories/generated/article-list.stories.ts +87 -0
- package/template/stories/generated/article.stories.ts +27 -0
- package/template/stories/generated/breadcrumbs.stories.ts +39 -0
- package/template/stories/generated/cart.stories.ts +38 -0
- package/template/stories/generated/collection-grid.stories.ts +117 -0
- package/template/stories/generated/collection-header.stories.ts +51 -0
- package/template/stories/generated/contact.stories.ts +45 -0
- package/template/stories/generated/cta.stories.ts +51 -0
- package/template/stories/generated/faq.stories.ts +56 -0
- package/template/stories/generated/feature-grid.stories.ts +69 -0
- package/template/stories/generated/footer.stories.ts +50 -0
- package/template/stories/generated/gallery.stories.ts +81 -0
- package/template/stories/generated/hero.stories.ts +75 -0
- package/template/stories/generated/image.stories.ts +99 -0
- package/template/stories/generated/logo-cloud.stories.ts +57 -0
- package/template/stories/generated/navigation.stories.ts +62 -0
- package/template/stories/generated/newsletter.stories.ts +68 -0
- package/template/stories/generated/order-status.stories.ts +32 -0
- package/template/stories/generated/pricing-table.stories.ts +44 -0
- package/template/stories/generated/product-carousel.stories.ts +75 -0
- package/template/stories/generated/product-detail.stories.ts +62 -0
- package/template/stories/generated/quote.stories.ts +69 -0
- package/template/stories/generated/rich-text.stories.ts +50 -0
- package/template/stories/generated/search.stories.ts +56 -0
- package/template/stories/generated/split-content.stories.ts +39 -0
- package/template/stories/generated/stats.stories.ts +68 -0
- package/template/stories/generated/tabs.stories.ts +45 -0
- package/template/stories/generated/team.stories.ts +45 -0
- package/template/stories/generated/testimonials.stories.ts +69 -0
- package/template/stories/generated/timeline.stories.ts +80 -0
- package/template/stories/generated/trust-strip.stories.ts +62 -0
- package/template/stories/generated/video-embed.stories.ts +63 -0
- package/template/stories/generated/wishlist.stories.ts +26 -0
- package/template/stories/pages/article.stories.ts +51 -0
- package/template/stories/pages/cart.stories.ts +56 -0
- package/template/stories/pages/category.stories.ts +56 -0
- package/template/stories/pages/collection.stories.ts +51 -0
- package/template/stories/pages/home.stories.ts +51 -0
- package/template/stories/pages/product.stories.ts +47 -0
- package/template/stories/pages/products.stories.ts +58 -0
- package/template/stories/pages/search.stories.ts +54 -0
- package/template/stories/pages/wishlist.stories.ts +53 -0
- package/template/stories/support/pageBlocks.ts +115 -0
- package/template/test/blocksEmptyData.spec.ts +52 -0
- package/template/test/carouselKeyboard.spec.ts +272 -0
- package/template/test/carouselRing.browser.spec.ts +193 -0
- package/template/test/carouselSlideWidth.browser.spec.ts +102 -0
- package/template/test/cartDrawer.spec.ts +295 -0
- package/template/test/cartToast.spec.ts +86 -0
- package/template/test/countPill.browser.spec.ts +196 -0
- package/template/test/demoImages.spec.ts +140 -0
- package/template/test/deps.spec.ts +102 -0
- package/template/test/eldraIcon.spec.ts +58 -0
- package/template/test/framing.spec.ts +76 -0
- package/template/test/i18n.spec.ts +200 -0
- package/template/test/iconComponent.spec.ts +91 -0
- package/template/test/inlineEditable.spec.ts +334 -0
- package/template/test/localePrefix.spec.ts +342 -0
- package/template/test/mainCss.spec.ts +107 -0
- package/template/test/mockGatewayContract.spec.ts +122 -0
- package/template/test/mocks/blocks.ts +20 -0
- package/template/test/mocks/breakpoints.ts +7 -0
- package/template/test/mocks/manifest.ts +11 -0
- package/template/test/moneyFormatting.spec.ts +89 -0
- package/template/test/pageTitle.spec.ts +49 -0
- package/template/test/pages/article.spec.ts +231 -0
- package/template/test/pages/category.spec.ts +185 -0
- package/template/test/pages/collection.spec.ts +396 -0
- package/template/test/pages/home.spec.ts +295 -0
- package/template/test/pages/hydration.spec.ts +557 -0
- package/template/test/pages/product.spec.ts +396 -0
- package/template/test/pages/seededPages.spec.ts +190 -0
- package/template/test/pages/ssr.spec.ts +393 -0
- package/template/test/prerenderCommerce.spec.ts +134 -0
- package/template/test/prerenderFailure.spec.ts +130 -0
- package/template/test/prerenderRefresh.browser.spec.ts +1431 -0
- package/template/test/previewsFresh.spec.ts +56 -0
- package/template/test/richText.spec.ts +161 -0
- package/template/test/richTextTypography.spec.ts +182 -0
- package/template/test/setup.ts +21 -0
- package/template/test/slugPage.spec.ts +244 -0
- package/template/test/slugPageTemplate.spec.ts +194 -0
- package/template/test/starter.spec.ts +1416 -0
- package/template/test/storefront/cart.spec.ts +404 -0
- package/template/test/storefront/categories.spec.ts +235 -0
- package/template/test/storefront/collectionSelector.spec.ts +74 -0
- package/template/test/storefront/demo.spec.ts +555 -0
- package/template/test/storefront/facets.spec.ts +425 -0
- package/template/test/storefront/feedback.spec.ts +97 -0
- package/template/test/storefront/gateway.spec.ts +2673 -0
- package/template/test/storefront/gatewayCart.spec.ts +289 -0
- package/template/test/storefront/gatewayPrerender.spec.ts +1037 -0
- package/template/test/storefront/history.spec.ts +341 -0
- package/template/test/storefront/money.spec.ts +171 -0
- package/template/test/storefront/toProductCard.spec.ts +138 -0
- package/template/test/storefront/volatile.spec.ts +284 -0
- package/template/test/support/axe.ts +14 -0
- package/template/test/support/dialog.ts +51 -0
- package/template/test/support/hydrate.ts +118 -0
- package/template/test/support/i18nText.ts +11 -0
- package/template/test/support/mockGateway.ts +1017 -0
- package/template/test/support/mountBlock.ts +194 -0
- package/template/test/support/mountPage.spec.ts +72 -0
- package/template/test/support/mountPage.ts +254 -0
- package/template/test/support/mountProbe.client.ts +69 -0
- package/template/test/support/renderSsr.ts +97 -0
- package/template/test/support/staticServer.ts +96 -0
- package/template/test/themeIcons.spec.ts +140 -0
- package/template/test/toastAnnouncement.spec.ts +133 -0
- package/template/test/tokens.spec.ts +102 -0
- package/template/test/uiMessagesPlugin.spec.ts +104 -0
- package/template/test/useBlockData.spec.ts +46 -0
- package/template/test/useEditing.spec.ts +54 -0
- package/template/test/useEldraIcon.spec.ts +126 -0
- package/template/test/useUiId.spec.ts +40 -0
- package/template/tokens.json +149 -0
- package/template/tsconfig.json +3 -0
- package/template/tsconfig.storybook.json +17 -0
- package/template/vitest-axe.d.ts +13 -0
- package/template/vitest.config.ts +44 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-11"><defs><linearGradient id="product11-grad" x1="1.9%" y1="36.36%" x2="98.1%" y2="63.64%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product11-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product11-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product11-grad)"/><circle cx="474.62" cy="851.98" r="382.64" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product11-blur-a)"/><circle cx="524.37" cy="1260.54" r="193.01" fill="#0f766e" fill-opacity="0.24" filter="url(#product11-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-12"><defs><linearGradient id="product12-grad" x1="94.14%" y1="26.51%" x2="5.86%" y2="73.49%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product12-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product12-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product12-grad)"/><circle cx="906.28" cy="1162.67" r="286.91" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product12-blur-a)"/><circle cx="410.5" cy="541.71" r="285.63" fill="#0f766e" fill-opacity="0.24" filter="url(#product12-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-2"><defs><linearGradient id="product2-grad" x1="14.32%" y1="14.97%" x2="85.68%" y2="85.03%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product2-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product2-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product2-grad)"/><circle cx="972.49" cy="332" r="150.44" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product2-blur-a)"/><circle cx="818.44" cy="303.8" r="255.2" fill="#0f766e" fill-opacity="0.24" filter="url(#product2-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-3"><defs><linearGradient id="product3-grad" x1="9.45%" y1="20.75%" x2="90.55%" y2="79.25%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product3-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product3-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product3-grad)"/><circle cx="825.86" cy="1194.73" r="307.86" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product3-blur-a)"/><circle cx="899.93" cy="957.05" r="213.27" fill="#0f766e" fill-opacity="0.24" filter="url(#product3-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-4"><defs><linearGradient id="product4-grad" x1="85.08%" y1="85.63%" x2="14.92%" y2="14.37%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product4-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product4-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product4-grad)"/><circle cx="435.31" cy="432.97" r="203.27" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product4-blur-a)"/><circle cx="545.28" cy="1153.79" r="179.85" fill="#0f766e" fill-opacity="0.24" filter="url(#product4-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-5"><defs><linearGradient id="product5-grad" x1="95.55%" y1="29.38%" x2="4.45%" y2="70.62%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product5-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product5-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product5-grad)"/><circle cx="304.33" cy="699.95" r="304.59" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product5-blur-a)"/><circle cx="485.23" cy="885.11" r="191.54" fill="#0f766e" fill-opacity="0.24" filter="url(#product5-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-6"><defs><linearGradient id="product6-grad" x1="91.39%" y1="78.05%" x2="8.61%" y2="21.95%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product6-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product6-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product6-grad)"/><circle cx="862.35" cy="572.3" r="221.01" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product6-blur-a)"/><circle cx="262.03" cy="732.73" r="177.03" fill="#0f766e" fill-opacity="0.24" filter="url(#product6-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-7"><defs><linearGradient id="product7-grad" x1="99.03%" y1="40.2%" x2="0.97%" y2="59.8%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product7-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product7-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product7-grad)"/><circle cx="462.96" cy="537.09" r="296.25" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product7-blur-a)"/><circle cx="372.66" cy="946.12" r="236.18" fill="#0f766e" fill-opacity="0.24" filter="url(#product7-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-8"><defs><linearGradient id="product8-grad" x1="78.42%" y1="91.14%" x2="21.58%" y2="8.86%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product8-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product8-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product8-grad)"/><circle cx="514.9" cy="507.47" r="210.47" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product8-blur-a)"/><circle cx="425.35" cy="1269.84" r="172.21" fill="#0f766e" fill-opacity="0.24" filter="url(#product8-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1500" viewBox="0 0 1200 1500" role="img" aria-label="product-9"><defs><linearGradient id="product9-grad" x1="99.73%" y1="55.15%" x2="0.27%" y2="44.85%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="product9-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="product9-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1500" fill="url(#product9-grad)"/><circle cx="303.35" cy="691.68" r="332.73" fill="#1d4ed8" fill-opacity="0.28" filter="url(#product9-blur-a)"/><circle cx="483" cy="509.33" r="236.93" fill="#0f766e" fill-opacity="0.24" filter="url(#product9-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="630" width="552" height="600" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="630" rx="309.12" ry="84"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" viewBox="0 0 1200 1200" role="img" aria-label="product-square-1"><defs><linearGradient id="productsquare1-grad" x1="96.49%" y1="31.59%" x2="3.51%" y2="68.41%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="productsquare1-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="productsquare1-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1200" fill="url(#productsquare1-grad)"/><circle cx="360.38" cy="389.75" r="230.01" fill="#1d4ed8" fill-opacity="0.28" filter="url(#productsquare1-blur-a)"/><circle cx="736.19" cy="571.71" r="292.44" fill="#0f766e" fill-opacity="0.24" filter="url(#productsquare1-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="504" width="552" height="480" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="504" rx="309.12" ry="67.2"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" viewBox="0 0 1200 1200" role="img" aria-label="product-square-2"><defs><linearGradient id="productsquare2-grad" x1="52.58%" y1="99.93%" x2="47.42%" y2="0.07%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="productsquare2-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="productsquare2-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1200" fill="url(#productsquare2-grad)"/><circle cx="309.16" cy="718.97" r="201.27" fill="#1d4ed8" fill-opacity="0.28" filter="url(#productsquare2-blur-a)"/><circle cx="997.2" cy="760.92" r="207.98" fill="#0f766e" fill-opacity="0.24" filter="url(#productsquare2-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="504" width="552" height="480" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="504" rx="309.12" ry="67.2"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" viewBox="0 0 1200 1200" role="img" aria-label="product-square-3"><defs><linearGradient id="productsquare3-grad" x1="2.94%" y1="66.88%" x2="97.06%" y2="33.12%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="productsquare3-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="productsquare3-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1200" fill="url(#productsquare3-grad)"/><circle cx="731.54" cy="828.66" r="382.02" fill="#1d4ed8" fill-opacity="0.28" filter="url(#productsquare3-blur-a)"/><circle cx="321.54" cy="673" r="336.8" fill="#0f766e" fill-opacity="0.24" filter="url(#productsquare3-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="504" width="552" height="480" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="504" rx="309.12" ry="67.2"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" viewBox="0 0 1200 1200" role="img" aria-label="product-square-4"><defs><linearGradient id="productsquare4-grad" x1="83.87%" y1="86.78%" x2="16.13%" y2="13.22%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="productsquare4-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="productsquare4-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1200" fill="url(#productsquare4-grad)"/><circle cx="602.8" cy="861.17" r="148.73" fill="#1d4ed8" fill-opacity="0.28" filter="url(#productsquare4-blur-a)"/><circle cx="771.12" cy="967.18" r="379.81" fill="#0f766e" fill-opacity="0.24" filter="url(#productsquare4-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="504" width="552" height="480" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="504" rx="309.12" ry="67.2"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" viewBox="0 0 1200 1200" role="img" aria-label="product-square-5"><defs><linearGradient id="productsquare5-grad" x1="94.38%" y1="26.97%" x2="5.62%" y2="73.03%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="productsquare5-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="productsquare5-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1200" fill="url(#productsquare5-grad)"/><circle cx="241.97" cy="361.28" r="163.36" fill="#1d4ed8" fill-opacity="0.28" filter="url(#productsquare5-blur-a)"/><circle cx="857.21" cy="552.69" r="343.35" fill="#0f766e" fill-opacity="0.24" filter="url(#productsquare5-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="504" width="552" height="480" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="504" rx="309.12" ry="67.2"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" viewBox="0 0 1200 1200" role="img" aria-label="product-square-6"><defs><linearGradient id="productsquare6-grad" x1="92.17%" y1="23.14%" x2="7.83%" y2="76.86%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="productsquare6-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="productsquare6-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1200" height="1200" fill="url(#productsquare6-grad)"/><circle cx="358.37" cy="346.51" r="265.29" fill="#1d4ed8" fill-opacity="0.28" filter="url(#productsquare6-blur-a)"/><circle cx="787.84" cy="408.85" r="290.32" fill="#0f766e" fill-opacity="0.24" filter="url(#productsquare6-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<rect x="324" y="504" width="552" height="480" rx="66.24"/>
|
|
3
|
+
<ellipse cx="600" cy="504" rx="309.12" ry="67.2"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1250" viewBox="0 0 1000 1250" role="img" aria-label="quote-portrait"><defs><linearGradient id="quoteportrait-grad" x1="5.18%" y1="27.85%" x2="94.82%" y2="72.15%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="quoteportrait-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="80"/></filter><filter id="quoteportrait-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="100"/></filter></defs><rect width="1000" height="1250" fill="url(#quoteportrait-grad)"/><circle cx="226.27" cy="1000.85" r="311.92" fill="#1d4ed8" fill-opacity="0.28" filter="url(#quoteportrait-blur-a)"/><circle cx="166.37" cy="390.5" r="201.21" fill="#0f766e" fill-opacity="0.24" filter="url(#quoteportrait-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<circle cx="500" cy="418.48" r="160"/>
|
|
3
|
+
<rect x="140" y="750" width="720" height="575" rx="230.4"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1200" viewBox="0 0 1600 1200" role="img" aria-label="split-1"><defs><linearGradient id="split1-grad" x1="23.57%" y1="92.44%" x2="76.43%" y2="7.56%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="split1-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="split1-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1600" height="1200" fill="url(#split1-grad)"/><circle cx="1181.23" cy="444.96" r="277.19" fill="#1d4ed8" fill-opacity="0.28" filter="url(#split1-blur-a)"/><circle cx="1116.45" cy="215.25" r="331.17" fill="#0f766e" fill-opacity="0.24" filter="url(#split1-blur-b)"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1200" viewBox="0 0 1600 1200" role="img" aria-label="split-2"><defs><linearGradient id="split2-grad" x1="88.86%" y1="81.47%" x2="11.14%" y2="18.53%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="split2-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="split2-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1600" height="1200" fill="url(#split2-grad)"/><circle cx="727.49" cy="346.95" r="217.25" fill="#1d4ed8" fill-opacity="0.28" filter="url(#split2-blur-a)"/><circle cx="967.38" cy="833.52" r="150.63" fill="#0f766e" fill-opacity="0.24" filter="url(#split2-blur-b)"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1200" viewBox="0 0 1600 1200" role="img" aria-label="split-3"><defs><linearGradient id="split3-grad" x1="0.44%" y1="56.6%" x2="99.56%" y2="43.4%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="split3-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="split3-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1600" height="1200" fill="url(#split3-grad)"/><circle cx="500.43" cy="649.52" r="351.85" fill="#1d4ed8" fill-opacity="0.28" filter="url(#split3-blur-a)"/><circle cx="932.68" cy="741.22" r="366.45" fill="#0f766e" fill-opacity="0.24" filter="url(#split3-blur-b)"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1200" viewBox="0 0 1600 1200" role="img" aria-label="split-4"><defs><linearGradient id="split4-grad" x1="87.32%" y1="16.73%" x2="12.68%" y2="83.27%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="split4-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="96"/></filter><filter id="split4-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="120"/></filter></defs><rect width="1600" height="1200" fill="url(#split4-grad)"/><circle cx="688.14" cy="287.49" r="364.5" fill="#1d4ed8" fill-opacity="0.28" filter="url(#split4-blur-a)"/><circle cx="1013" cy="512.77" r="314.47" fill="#0f766e" fill-opacity="0.24" filter="url(#split4-blur-b)"/></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1250" viewBox="0 0 1000 1250" role="img" aria-label="team-1"><defs><linearGradient id="team1-grad" x1="54.62%" y1="0.21%" x2="45.38%" y2="99.79%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="team1-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="80"/></filter><filter id="team1-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="100"/></filter></defs><rect width="1000" height="1250" fill="url(#team1-grad)"/><circle cx="421.97" cy="380.99" r="179.02" fill="#1d4ed8" fill-opacity="0.28" filter="url(#team1-blur-a)"/><circle cx="726.51" cy="404.16" r="214.6" fill="#0f766e" fill-opacity="0.24" filter="url(#team1-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<circle cx="500" cy="419.86" r="160"/>
|
|
3
|
+
<rect x="140" y="750" width="720" height="575" rx="230.4"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1250" viewBox="0 0 1000 1250" role="img" aria-label="team-2"><defs><linearGradient id="team2-grad" x1="16.94%" y1="87.51%" x2="83.06%" y2="12.49%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="team2-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="80"/></filter><filter id="team2-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="100"/></filter></defs><rect width="1000" height="1250" fill="url(#team2-grad)"/><circle cx="216.81" cy="541.37" r="151.88" fill="#1d4ed8" fill-opacity="0.28" filter="url(#team2-blur-a)"/><circle cx="395.05" cy="256.13" r="180.76" fill="#0f766e" fill-opacity="0.24" filter="url(#team2-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<circle cx="500" cy="394.32" r="160"/>
|
|
3
|
+
<rect x="140" y="750" width="720" height="575" rx="230.4"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1250" viewBox="0 0 1000 1250" role="img" aria-label="team-3"><defs><linearGradient id="team3-grad" x1="69.55%" y1="96.02%" x2="30.45%" y2="3.98%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="team3-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="80"/></filter><filter id="team3-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="100"/></filter></defs><rect width="1000" height="1250" fill="url(#team3-grad)"/><circle cx="347.33" cy="228.89" r="167.43" fill="#1d4ed8" fill-opacity="0.28" filter="url(#team3-blur-a)"/><circle cx="333.05" cy="800.39" r="233.71" fill="#0f766e" fill-opacity="0.24" filter="url(#team3-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<circle cx="500" cy="424.28" r="160"/>
|
|
3
|
+
<rect x="140" y="750" width="720" height="575" rx="230.4"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1250" viewBox="0 0 1000 1250" role="img" aria-label="team-4"><defs><linearGradient id="team4-grad" x1="60.71%" y1="1.16%" x2="39.29%" y2="98.84%"><stop offset="0%" stop-color="#f6f7f9"/><stop offset="55%" stop-color="#e9ecf1"/><stop offset="100%" stop-color="#dfe4ea"/></linearGradient><filter id="team4-blur-a" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="80"/></filter><filter id="team4-blur-b" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="100"/></filter></defs><rect width="1000" height="1250" fill="url(#team4-grad)"/><circle cx="525.68" cy="650.91" r="268.28" fill="#1d4ed8" fill-opacity="0.28" filter="url(#team4-blur-a)"/><circle cx="590.17" cy="546.13" r="242.54" fill="#0f766e" fill-opacity="0.24" filter="url(#team4-blur-b)"/><g fill="#14181f" fill-opacity="0.82">
|
|
2
|
+
<circle cx="500" cy="422.67" r="160"/>
|
|
3
|
+
<rect x="140" y="750" width="720" height="575" rx="230.4"/>
|
|
4
|
+
</g></svg>
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Generates deterministic placeholder SVGs for the starter's mock content
|
|
3
|
+
// into public/demo/. No third-party media assets and no randomness: every
|
|
4
|
+
// image is seeded by its own file name, so re-running this script produces
|
|
5
|
+
// byte-identical output. Palette is the starter's own design tokens
|
|
6
|
+
// (primary #1d4ed8, accent #0f766e, surface #f6f7f9, surface-strong
|
|
7
|
+
// #e9ecf1) so the placeholders already look at home next to the real
|
|
8
|
+
// theme colors.
|
|
9
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
|
|
13
|
+
const outDir = fileURLToPath(new URL('../public/demo', import.meta.url));
|
|
14
|
+
mkdirSync(outDir, { recursive: true });
|
|
15
|
+
|
|
16
|
+
const PRIMARY = '#1d4ed8';
|
|
17
|
+
const ACCENT = '#0f766e';
|
|
18
|
+
const SURFACE = '#f6f7f9';
|
|
19
|
+
const SURFACE_STRONG = '#e9ecf1';
|
|
20
|
+
const INK = '#14181f';
|
|
21
|
+
|
|
22
|
+
// --- deterministic PRNG, seeded from the image's own name -----------------
|
|
23
|
+
|
|
24
|
+
function seedFromName(name) {
|
|
25
|
+
let hash = 2166136261;
|
|
26
|
+
for (let i = 0; i < name.length; i++) {
|
|
27
|
+
hash ^= name.charCodeAt(i);
|
|
28
|
+
hash = Math.imul(hash, 16777619);
|
|
29
|
+
}
|
|
30
|
+
return hash >>> 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// mulberry32
|
|
34
|
+
function makeRng(seed) {
|
|
35
|
+
let state = seed;
|
|
36
|
+
return () => {
|
|
37
|
+
state |= 0;
|
|
38
|
+
state = (state + 0x6d2b79f5) | 0;
|
|
39
|
+
let t = Math.imul(state ^ (state >>> 15), 1 | state);
|
|
40
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
41
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function round(n) {
|
|
46
|
+
return Math.round(n * 100) / 100;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --- shared building blocks -------------------------------------------------
|
|
50
|
+
|
|
51
|
+
function gradientDef(id, angleDeg, stops) {
|
|
52
|
+
const rad = (angleDeg * Math.PI) / 180;
|
|
53
|
+
const x1 = round(50 - Math.cos(rad) * 50);
|
|
54
|
+
const y1 = round(50 - Math.sin(rad) * 50);
|
|
55
|
+
const x2 = round(50 + Math.cos(rad) * 50);
|
|
56
|
+
const y2 = round(50 + Math.sin(rad) * 50);
|
|
57
|
+
const stopEls = stops
|
|
58
|
+
.map(
|
|
59
|
+
([offset, color, opacity]) =>
|
|
60
|
+
`<stop offset="${offset}%" stop-color="${color}"${
|
|
61
|
+
opacity === undefined ? '' : ` stop-opacity="${opacity}"`
|
|
62
|
+
}/>`
|
|
63
|
+
)
|
|
64
|
+
.join('');
|
|
65
|
+
return `<linearGradient id="${id}" x1="${x1}%" y1="${y1}%" x2="${x2}%" y2="${y2}%">${stopEls}</linearGradient>`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function blurredCircle(rng, w, h, opts = {}) {
|
|
69
|
+
const {
|
|
70
|
+
color = PRIMARY,
|
|
71
|
+
opacity = 0.35,
|
|
72
|
+
minR = Math.min(w, h) * 0.12,
|
|
73
|
+
maxR = Math.min(w, h) * 0.32,
|
|
74
|
+
blur = Math.min(w, h) * 0.06,
|
|
75
|
+
} = opts;
|
|
76
|
+
const cx = round(w * (0.15 + rng() * 0.7));
|
|
77
|
+
const cy = round(h * (0.15 + rng() * 0.7));
|
|
78
|
+
const r = round(minR + rng() * (maxR - minR));
|
|
79
|
+
return { cx, cy, r, color, opacity, blur };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function circleEl(c, filterId) {
|
|
83
|
+
return `<circle cx="${c.cx}" cy="${c.cy}" r="${c.r}" fill="${c.color}" fill-opacity="${c.opacity}" filter="url(#${filterId})"/>`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function blurFilter(id, stdDeviation) {
|
|
87
|
+
return `<filter id="${id}" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${stdDeviation}"/></filter>`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function svgWrap(name, width, height, body) {
|
|
91
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" role="img" aria-label="${escapeXml(
|
|
92
|
+
name
|
|
93
|
+
)}">${body}</svg>\n`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function escapeXml(value) {
|
|
97
|
+
return value
|
|
98
|
+
.replace(/&/g, '&')
|
|
99
|
+
.replace(/</g, '<')
|
|
100
|
+
.replace(/>/g, '>')
|
|
101
|
+
.replace(/"/g, '"');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// A layered gradient backdrop with two soft blurred circles, used by hero,
|
|
105
|
+
// gallery and feature images.
|
|
106
|
+
function backdrop(rng, w, h, label) {
|
|
107
|
+
const gradId = `${label}-grad`;
|
|
108
|
+
const blurA = `${label}-blur-a`;
|
|
109
|
+
const blurB = `${label}-blur-b`;
|
|
110
|
+
const angle = round(rng() * 360);
|
|
111
|
+
const gradient = gradientDef(gradId, angle, [
|
|
112
|
+
[0, SURFACE],
|
|
113
|
+
[55, SURFACE_STRONG],
|
|
114
|
+
[100, '#dfe4ea'],
|
|
115
|
+
]);
|
|
116
|
+
const circleA = blurredCircle(rng, w, h, { color: PRIMARY, opacity: 0.28 });
|
|
117
|
+
const circleB = blurredCircle(rng, w, h, { color: ACCENT, opacity: 0.24 });
|
|
118
|
+
const defs = `<defs>${gradient}${blurFilter(blurA, Math.min(w, h) * 0.08)}${blurFilter(
|
|
119
|
+
blurB,
|
|
120
|
+
Math.min(w, h) * 0.1
|
|
121
|
+
)}</defs>`;
|
|
122
|
+
const rect = `<rect width="${w}" height="${h}" fill="url(#${gradId})"/>`;
|
|
123
|
+
return `${defs}${rect}${circleEl(circleA, blurA)}${circleEl(circleB, blurB)}`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// --- generators --------------------------------------------------------------
|
|
127
|
+
|
|
128
|
+
function heroOrGallerySvg(name, width, height) {
|
|
129
|
+
const rng = makeRng(seedFromName(name));
|
|
130
|
+
const body = backdrop(rng, width, height, name.replace(/[^a-z0-9]/gi, ''));
|
|
131
|
+
return svgWrap(name, width, height, body);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function productSvg(name, width, height) {
|
|
135
|
+
const rng = makeRng(seedFromName(name));
|
|
136
|
+
const label = name.replace(/[^a-z0-9]/gi, '');
|
|
137
|
+
const body = backdrop(rng, width, height, label);
|
|
138
|
+
const bodyW = round(width * 0.46);
|
|
139
|
+
const bodyH = round(height * 0.4);
|
|
140
|
+
const bodyX = round((width - bodyW) / 2);
|
|
141
|
+
const bodyY = round(height * 0.42);
|
|
142
|
+
const radius = round(bodyW * 0.12);
|
|
143
|
+
const lidRx = round(bodyW * 0.56);
|
|
144
|
+
const lidRy = round(bodyH * 0.14);
|
|
145
|
+
const lidCx = round(width / 2);
|
|
146
|
+
const lidCy = bodyY;
|
|
147
|
+
const silhouette = `<g fill="${INK}" fill-opacity="0.82">
|
|
148
|
+
<rect x="${bodyX}" y="${bodyY}" width="${bodyW}" height="${bodyH}" rx="${radius}"/>
|
|
149
|
+
<ellipse cx="${lidCx}" cy="${lidCy}" rx="${lidRx}" ry="${lidRy}"/>
|
|
150
|
+
</g>`;
|
|
151
|
+
return svgWrap(name, width, height, `${body}${silhouette}`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function initialsFor(name) {
|
|
155
|
+
return name
|
|
156
|
+
.split(/\s+/)
|
|
157
|
+
.filter(Boolean)
|
|
158
|
+
.slice(0, 2)
|
|
159
|
+
.map((part) => part[0]?.toUpperCase() ?? '')
|
|
160
|
+
.join('');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function avatarSvg(name, width, height, displayName) {
|
|
164
|
+
const rng = makeRng(seedFromName(name));
|
|
165
|
+
const label = name.replace(/[^a-z0-9]/gi, '');
|
|
166
|
+
const gradId = `${label}-grad`;
|
|
167
|
+
const angle = round(rng() * 360);
|
|
168
|
+
const gradient = gradientDef(gradId, angle, [
|
|
169
|
+
[0, PRIMARY],
|
|
170
|
+
[100, ACCENT],
|
|
171
|
+
]);
|
|
172
|
+
const initials = initialsFor(displayName);
|
|
173
|
+
const fontSize = round(width * 0.34);
|
|
174
|
+
const body = `<defs>${gradient}</defs>
|
|
175
|
+
<circle cx="${width / 2}" cy="${height / 2}" r="${width / 2}" fill="url(#${gradId})"/>
|
|
176
|
+
<text x="50%" y="50%" text-anchor="middle" dominant-baseline="central" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${fontSize}" font-weight="600" fill="#ffffff">${escapeXml(
|
|
177
|
+
initials
|
|
178
|
+
)}</text>`;
|
|
179
|
+
return svgWrap(name, width, height, body);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function logoSvg(name, width, height) {
|
|
183
|
+
const rng = makeRng(seedFromName(name));
|
|
184
|
+
const markR = round(height * 0.28);
|
|
185
|
+
const markCx = round(height * 0.5);
|
|
186
|
+
const markCy = round(height * 0.5);
|
|
187
|
+
const angle = round(rng() * 360);
|
|
188
|
+
const gradId = 'logo-grad';
|
|
189
|
+
const gradient = gradientDef(gradId, angle, [
|
|
190
|
+
[0, PRIMARY],
|
|
191
|
+
[100, ACCENT],
|
|
192
|
+
]);
|
|
193
|
+
const textX = round(markCx + markR + height * 0.28);
|
|
194
|
+
const fontSize = round(height * 0.34);
|
|
195
|
+
const body = `<defs>${gradient}</defs>
|
|
196
|
+
<circle cx="${markCx}" cy="${markCy}" r="${markR}" fill="url(#${gradId})"/>
|
|
197
|
+
<text x="${textX}" y="50%" dominant-baseline="central" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${fontSize}" font-weight="700" fill="${INK}">Northwind</text>`;
|
|
198
|
+
return svgWrap(name, width, height, body);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function featureSvg(name, width, height) {
|
|
202
|
+
const rng = makeRng(seedFromName(name));
|
|
203
|
+
const label = name.replace(/[^a-z0-9]/gi, '');
|
|
204
|
+
const body = backdrop(rng, width, height, label);
|
|
205
|
+
const r = round(Math.min(width, height) * 0.16);
|
|
206
|
+
const cx = round(width / 2);
|
|
207
|
+
const cy = round(height * 0.44);
|
|
208
|
+
const mark = `<circle cx="${cx}" cy="${cy}" r="${r}" fill="${PRIMARY}" fill-opacity="0.85"/>`;
|
|
209
|
+
return svgWrap(name, width, height, `${body}${mark}`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// A backdrop with a simple person silhouette (head + shoulders), used by the
|
|
213
|
+
// `team` block's member photos and `quote`'s portrait variant — both want a
|
|
214
|
+
// "photo of a person" placeholder, distinct from the small circular
|
|
215
|
+
// initials `avatarSvg` draws for byline/reviewer avatars.
|
|
216
|
+
function personSvg(name, width, height) {
|
|
217
|
+
const rng = makeRng(seedFromName(name));
|
|
218
|
+
const label = name.replace(/[^a-z0-9]/gi, '');
|
|
219
|
+
const body = backdrop(rng, width, height, label);
|
|
220
|
+
const headR = round(width * 0.16);
|
|
221
|
+
const headCx = round(width / 2);
|
|
222
|
+
const headCy = round(height * (0.3 + rng() * 0.06));
|
|
223
|
+
const shoulderW = round(width * 0.72);
|
|
224
|
+
const shoulderH = round(height * 0.46);
|
|
225
|
+
const shoulderX = round((width - shoulderW) / 2);
|
|
226
|
+
const shoulderY = round(height * 0.6);
|
|
227
|
+
const shoulderRx = round(shoulderW * 0.32);
|
|
228
|
+
const silhouette = `<g fill="${INK}" fill-opacity="0.82">
|
|
229
|
+
<circle cx="${headCx}" cy="${headCy}" r="${headR}"/>
|
|
230
|
+
<rect x="${shoulderX}" y="${shoulderY}" width="${shoulderW}" height="${shoulderH}" rx="${shoulderRx}"/>
|
|
231
|
+
</g>`;
|
|
232
|
+
return svgWrap(name, width, height, `${body}${silhouette}`);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// An abstract mark-plus-wordmark shape (a gradient mark beside two tapered
|
|
236
|
+
// bars standing in for a company name and tagline) — deliberately not a
|
|
237
|
+
// real or invented brand name, just a coloured shape in the spirit of this
|
|
238
|
+
// script's placeholders, for the `logo-cloud` block's partner-logo strip.
|
|
239
|
+
function wordmarkSvg(name, width, height) {
|
|
240
|
+
const rng = makeRng(seedFromName(name));
|
|
241
|
+
const label = name.replace(/[^a-z0-9]/gi, '');
|
|
242
|
+
const gradId = `${label}-grad`;
|
|
243
|
+
const markR = round(height * 0.28);
|
|
244
|
+
const markCx = round(height * 0.5);
|
|
245
|
+
const markCy = round(height * 0.5);
|
|
246
|
+
const angle = round(rng() * 360);
|
|
247
|
+
const gradient = gradientDef(gradId, angle, [
|
|
248
|
+
[0, PRIMARY],
|
|
249
|
+
[100, ACCENT],
|
|
250
|
+
]);
|
|
251
|
+
const textX = round(markCx + markR + height * 0.3);
|
|
252
|
+
const barH = round(height * 0.16);
|
|
253
|
+
const gap = round(height * 0.12);
|
|
254
|
+
const bar1Y = round(height * 0.34);
|
|
255
|
+
const bar2Y = round(bar1Y + barH + gap);
|
|
256
|
+
const bar1W = round(width * (0.32 + rng() * 0.14));
|
|
257
|
+
const bar2W = round(bar1W * (0.5 + rng() * 0.3));
|
|
258
|
+
const body = `<defs>${gradient}</defs>
|
|
259
|
+
<circle cx="${markCx}" cy="${markCy}" r="${markR}" fill="url(#${gradId})"/>
|
|
260
|
+
<rect x="${textX}" y="${bar1Y}" width="${bar1W}" height="${barH}" rx="${round(barH / 2)}" fill="${INK}" fill-opacity="0.82"/>
|
|
261
|
+
<rect x="${textX}" y="${bar2Y}" width="${bar2W}" height="${barH}" rx="${round(barH / 2)}" fill="${INK}" fill-opacity="0.5"/>`;
|
|
262
|
+
return svgWrap(name, width, height, body);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// A stylised map placeholder (a light grid of "roads" plus one pin) for the
|
|
266
|
+
// `contact` block's map slot — a flat shape standing in for an embedded
|
|
267
|
+
// map, the same way every other generator stands in for a photo.
|
|
268
|
+
function mapSvg(name, width, height) {
|
|
269
|
+
const rng = makeRng(seedFromName(name));
|
|
270
|
+
const parts = [`<rect width="${width}" height="${height}" fill="${SURFACE}"/>`];
|
|
271
|
+
const vLines = 6;
|
|
272
|
+
const hLines = 3;
|
|
273
|
+
for (let i = 1; i < vLines; i++) {
|
|
274
|
+
const x = round((width / vLines) * i + (rng() - 0.5) * 20);
|
|
275
|
+
parts.push(
|
|
276
|
+
`<line x1="${x}" y1="0" x2="${x}" y2="${height}" stroke="${SURFACE_STRONG}" stroke-width="3"/>`
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
for (let i = 1; i < hLines; i++) {
|
|
280
|
+
const y = round((height / hLines) * i + (rng() - 0.5) * 10);
|
|
281
|
+
parts.push(
|
|
282
|
+
`<line x1="0" y1="${y}" x2="${width}" y2="${y}" stroke="${SURFACE_STRONG}" stroke-width="3"/>`
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
const pinX = round(width * (0.4 + rng() * 0.2));
|
|
286
|
+
const pinY = round(height * (0.35 + rng() * 0.25));
|
|
287
|
+
const pinR = round(Math.min(width, height) * 0.06);
|
|
288
|
+
parts.push(`<circle cx="${pinX}" cy="${pinY}" r="${pinR}" fill="${ACCENT}"/>`);
|
|
289
|
+
parts.push(`<circle cx="${pinX}" cy="${pinY}" r="${round(pinR * 0.4)}" fill="${SURFACE}"/>`);
|
|
290
|
+
return svgWrap(name, width, height, parts.join(''));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// --- image manifest -----------------------------------------------------------
|
|
294
|
+
//
|
|
295
|
+
// Every name here is a `mock.json`/`preview.json` media source across the 33
|
|
296
|
+
// blocks: generic photographic backdrops
|
|
297
|
+
// (`heroOrGallerySvg`) for hero/gallery/collection/split/article/poster/cta
|
|
298
|
+
// imagery, product silhouettes (`productSvg`) at both the portrait and
|
|
299
|
+
// square crops product cards use, person placeholders (`personSvg`) for
|
|
300
|
+
// team photos and the quote block's portrait variant, initials avatars
|
|
301
|
+
// (`avatarSvg`) for bylines and reviews, abstract wordmarks (`wordmarkSvg`)
|
|
302
|
+
// for the logo cloud, and one map (`mapSvg`) for the contact block.
|
|
303
|
+
|
|
304
|
+
// One name per `avatar-N.svg`, in order, and each one is the name the mock that *uses* that avatar
|
|
305
|
+
// prints beside it — `avatarSvg` draws the initials from this list, so a mismatch renders
|
|
306
|
+
// "Hannah Reeve — AK" on the home and article sample pages, in Storybook and in the shipped
|
|
307
|
+
// `preview.png`. Keep this list and the mocks in step: change a reviewer's name in
|
|
308
|
+
// `blocks/testimonials/{mock,preview}.json` and change it here in the same edit, then rerun
|
|
309
|
+
// `pnpm --filter starter-nuxt demo-images` and `previews`.
|
|
310
|
+
const avatarNames = [
|
|
311
|
+
'Hannah Reeve', // avatar-1 — blocks/testimonials items[0]
|
|
312
|
+
'Marcus Bell', // avatar-2 — blocks/testimonials items[1]
|
|
313
|
+
'Priya Nair', // avatar-3 — blocks/testimonials items[2]
|
|
314
|
+
'Sofia Lind', // avatar-4 — blocks/testimonials items[3]
|
|
315
|
+
'The Larder Journal', // avatar-5 — blocks/quote's attribution
|
|
316
|
+
'Ingrid Moe', // avatar-6 — blocks/article's byline
|
|
317
|
+
'Joel Mercer', // avatar-7 — blocks/testimonials items[4], which carries no avatar today
|
|
318
|
+
'Casey Novak', // avatar-8 — spare, used by no mock yet
|
|
319
|
+
];
|
|
320
|
+
|
|
321
|
+
function seriesOf(prefix, count, width, height, render) {
|
|
322
|
+
return Array.from({ length: count }, (_, i) => {
|
|
323
|
+
const name = `${prefix}-${i + 1}`;
|
|
324
|
+
return { name, width, height, render: () => render(name, width, height) };
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const images = [
|
|
329
|
+
{ name: 'hero', width: 1600, height: 1000, render: () => heroOrGallerySvg('hero', 1600, 1000) },
|
|
330
|
+
{
|
|
331
|
+
name: 'hero-wide',
|
|
332
|
+
width: 2400,
|
|
333
|
+
height: 800,
|
|
334
|
+
render: () => heroOrGallerySvg('hero-wide', 2400, 800),
|
|
335
|
+
},
|
|
336
|
+
...seriesOf('hero-slide', 4, 1200, 1500, heroOrGallerySvg),
|
|
337
|
+
...seriesOf('product', 12, 1200, 1500, productSvg),
|
|
338
|
+
...seriesOf('product-square', 6, 1200, 1200, productSvg),
|
|
339
|
+
...seriesOf('collection', 2, 1600, 1067, heroOrGallerySvg),
|
|
340
|
+
...seriesOf('split', 4, 1600, 1200, heroOrGallerySvg),
|
|
341
|
+
...seriesOf('feature', 4, 800, 600, featureSvg),
|
|
342
|
+
...seriesOf('gallery', 8, 1600, 1000, heroOrGallerySvg),
|
|
343
|
+
...seriesOf('team', 4, 1000, 1250, personSvg),
|
|
344
|
+
{ name: 'logo', width: 480, height: 160, render: () => logoSvg('logo', 480, 160) },
|
|
345
|
+
...seriesOf('logo', 8, 480, 160, wordmarkSvg),
|
|
346
|
+
...Array.from({ length: 8 }, (_, i) => {
|
|
347
|
+
const name = `avatar-${i + 1}`;
|
|
348
|
+
return {
|
|
349
|
+
name,
|
|
350
|
+
width: 256,
|
|
351
|
+
height: 256,
|
|
352
|
+
render: () => avatarSvg(name, 256, 256, avatarNames[i]),
|
|
353
|
+
};
|
|
354
|
+
}),
|
|
355
|
+
{
|
|
356
|
+
name: 'article-cover',
|
|
357
|
+
width: 1920,
|
|
358
|
+
height: 1080,
|
|
359
|
+
render: () => heroOrGallerySvg('article-cover', 1920, 1080),
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: 'article-figure',
|
|
363
|
+
width: 1600,
|
|
364
|
+
height: 1000,
|
|
365
|
+
render: () => heroOrGallerySvg('article-figure', 1600, 1000),
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: 'quote-portrait',
|
|
369
|
+
width: 1000,
|
|
370
|
+
height: 1250,
|
|
371
|
+
render: () => personSvg('quote-portrait', 1000, 1250),
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: 'poster',
|
|
375
|
+
width: 1920,
|
|
376
|
+
height: 1080,
|
|
377
|
+
render: () => heroOrGallerySvg('poster', 1920, 1080),
|
|
378
|
+
},
|
|
379
|
+
{ name: 'map', width: 1600, height: 500, render: () => mapSvg('map', 1600, 500) },
|
|
380
|
+
{
|
|
381
|
+
name: 'cta-split',
|
|
382
|
+
width: 1200,
|
|
383
|
+
height: 900,
|
|
384
|
+
render: () => heroOrGallerySvg('cta-split', 1200, 900),
|
|
385
|
+
},
|
|
386
|
+
];
|
|
387
|
+
|
|
388
|
+
for (const image of images) {
|
|
389
|
+
const svg = image.render();
|
|
390
|
+
writeFileSync(join(outDir, `${image.name}.svg`), svg);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
console.log(`Generated ${images.length} demo SVGs in ${outDir}`);
|