create-tanqory-theme 0.0.0-stage → 0.2.3
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/LICENSE +21 -0
- package/README.md +55 -2
- package/bin/create-tanqory-theme.mjs +13 -0
- package/lib/agents.mjs +118 -0
- package/lib/create.mjs +245 -0
- package/package.json +39 -4
- package/templates/blank/README.md +13 -0
- package/templates/blank/config/settings.json +3 -0
- package/templates/blank/locales/en.json +22 -0
- package/templates/blank/locales/th.json +22 -0
- package/templates/blank/package.json +34 -0
- package/templates/blank/regions/footer.json +35 -0
- package/templates/blank/regions/header.json +13 -0
- package/templates/blank/scripts/build.mjs +193 -0
- package/templates/blank/scripts/probe.ts +4 -0
- package/templates/blank/src/bundle.ts +15 -0
- package/templates/blank/src/components/parts.tsx +32 -0
- package/templates/blank/src/entry.client.tsx +6 -0
- package/templates/blank/src/entry.server.tsx +13 -0
- package/templates/blank/src/sections/chrome.tsx +132 -0
- package/templates/blank/src/sections/commerce.tsx +242 -0
- package/templates/blank/src/sections/content.tsx +111 -0
- package/templates/blank/src/sections/editorial.tsx +107 -0
- package/templates/blank/src/settings.ts +15 -0
- package/templates/blank/src/styles/theme.css +195 -0
- package/templates/blank/src/templates.ts +14 -0
- package/templates/blank/src/theme.tsx +76 -0
- package/templates/blank/template.json +24 -0
- package/templates/blank/templates/404.json +14 -0
- package/templates/blank/templates/account.json +14 -0
- package/templates/blank/templates/article.json +14 -0
- package/templates/blank/templates/blog.json +14 -0
- package/templates/blank/templates/cart.json +14 -0
- package/templates/blank/templates/collection.json +14 -0
- package/templates/blank/templates/index.json +36 -0
- package/templates/blank/templates/page.contact.json +18 -0
- package/templates/blank/templates/page.json +14 -0
- package/templates/blank/templates/product.json +18 -0
- package/templates/blank/templates/search.json +14 -0
- package/templates/blank/tests/theme.test.ts +49 -0
- package/templates/blank/tsconfig.json +17 -0
- package/templates/blank/vite.client.config.ts +17 -0
- package/templates/blank/vite.probe.config.ts +16 -0
- package/templates/blank/vite.server.config.ts +32 -0
- package/templates/blank/vitest.config.ts +9 -0
- package/templates/common/.claude/settings.json +8 -0
- package/templates/common/.codex/config.toml +4 -0
- package/templates/common/.gemini/settings.json +12 -0
- package/templates/common/.github/workflows/theme-check.yml +44 -0
- package/templates/common/.mcp.json +12 -0
- package/templates/common/.vscode/mcp.json +9 -0
- package/templates/common/_gitignore +9 -0
- package/templates/common/scripts/check.mjs +44 -0
- package/templates/common/scripts/dev.mjs +30 -0
- package/templates/common/tanqory.config.json +6 -0
- package/templates/nova/.gitattributes +3 -0
- package/templates/nova/.tanqory/contracts/LOCK.json +66 -0
- package/templates/nova/.tanqory/contracts/nova-01.json +1092 -0
- package/templates/nova/.tanqory/contracts/nova-12A.json +2674 -0
- package/templates/nova/.tanqory/contracts/nova-12B.json +2285 -0
- package/templates/nova/.tanqory/contracts/nova-12C.json +2848 -0
- package/templates/nova/.tanqory/contracts/nova-12D.json +3039 -0
- package/templates/nova/.tanqory/contracts/nova-12E.json +1473 -0
- package/templates/nova/.tanqory/contracts/nova-12F.json +1670 -0
- package/templates/nova/.tanqory/contracts/nova-12G.json +1661 -0
- package/templates/nova/.tanqory/contracts/nova-13.json +301 -0
- package/templates/nova/.tanqory/contracts/nova-14.json +172 -0
- package/templates/nova/.tanqory/legacy-settings.json +1121 -0
- package/templates/nova/README.md +150 -0
- package/templates/nova/_gitignore +28 -0
- package/templates/nova/assets/ai-tokens.css +6 -0
- package/templates/nova/assets/starter/starter-art-1200x800-0b773ac4.svg +1 -0
- package/templates/nova/assets/starter/starter-art-1200x900-59600290.svg +1 -0
- package/templates/nova/assets/starter/starter-art-1200x900-c549d496.svg +1 -0
- package/templates/nova/assets/starter/starter-art-1600x900-8f979fcb.svg +1 -0
- package/templates/nova/assets/starter/starter-art-2100x900-cbb71bfd.svg +1 -0
- package/templates/nova/config/legacy-settings.json +438 -0
- package/templates/nova/config/promotion-popup.schema.ts +29 -0
- package/templates/nova/config/settings.json +23 -0
- package/templates/nova/config/settings.schema.ts +231 -0
- package/templates/nova/entry.abi.tsx +27 -0
- package/templates/nova/groups/footer.json +39 -0
- package/templates/nova/groups/header.json +11 -0
- package/templates/nova/lib/abi/abi.css +41 -0
- package/templates/nova/lib/bundle-core.ts +35 -0
- package/templates/nova/lib/bundle.client.ts +15 -0
- package/templates/nova/lib/bundle.ts +15 -0
- package/templates/nova/lib/legacy-settings.ts +104 -0
- package/templates/nova/locales/ar.json +590 -0
- package/templates/nova/locales/en.json +590 -0
- package/templates/nova/locales/th.json +590 -0
- package/templates/nova/main.abi.tsx +12 -0
- package/templates/nova/package.json +44 -0
- package/templates/nova/scripts/abi/build.mjs +145 -0
- package/templates/nova/scripts/abi/check-content.mjs +99 -0
- package/templates/nova/scripts/abi/jcs.mjs +27 -0
- package/templates/nova/scripts/abi/local-host.mjs +294 -0
- package/templates/nova/scripts/abi/manifest.mjs +392 -0
- package/templates/nova/scripts/abi/starter-assets.mjs +32 -0
- package/templates/nova/scripts/compiler/checks/check-a11y.mjs +88 -0
- package/templates/nova/scripts/compiler/checks/check-layout-sanity.mjs +169 -0
- package/templates/nova/scripts/compiler/checks/check-page-headings.mjs +67 -0
- package/templates/nova/scripts/compiler/checks/check-product-jsonld.mjs +80 -0
- package/templates/nova/scripts/compiler/checks/theme-spec/check.mjs +88 -0
- package/templates/nova/scripts/compiler/contracts/extract.mjs +188 -0
- package/templates/nova/scripts/compiler/contracts/index.ts +125 -0
- package/templates/nova/scripts/compiler/contracts/validate.ts +347 -0
- package/templates/nova/scripts/compiler/manifest/gen-manifest.mjs +156 -0
- package/templates/nova/scripts/compiler/manifest/manifest-entry.ts +386 -0
- package/templates/nova/scripts/compiler/manifest/manifest-sections.ts +247 -0
- package/templates/nova/scripts/compiler/migrate/migrate-content.mjs +171 -0
- package/templates/nova/scripts/compiler/migrate/migrate-groups.mjs +159 -0
- package/templates/nova/scripts/parity/case-shim.ts +14 -0
- package/templates/nova/scripts/parity/emit.ts +206 -0
- package/templates/nova/scripts/parity/index.html +12 -0
- package/templates/nova/scripts/parity/main.tsx +23 -0
- package/templates/nova/scripts/parity/pages.tsx +123 -0
- package/templates/nova/scripts/parity/vite.config.ts +29 -0
- package/templates/nova/src/components/base/Accordion.css +20 -0
- package/templates/nova/src/components/base/Accordion.tsx +50 -0
- package/templates/nova/src/components/base/Badge.css +17 -0
- package/templates/nova/src/components/base/Badge.tsx +26 -0
- package/templates/nova/src/components/base/Button.css +73 -0
- package/templates/nova/src/components/base/Button.tsx +64 -0
- package/templates/nova/src/components/base/Checkbox.tsx +18 -0
- package/templates/nova/src/components/base/Chip.css +20 -0
- package/templates/nova/src/components/base/Chip.tsx +33 -0
- package/templates/nova/src/components/base/Divider.css +6 -0
- package/templates/nova/src/components/base/Divider.tsx +28 -0
- package/templates/nova/src/components/base/IconButton.css +34 -0
- package/templates/nova/src/components/base/IconButton.tsx +41 -0
- package/templates/nova/src/components/base/Input.css +21 -0
- package/templates/nova/src/components/base/Input.tsx +24 -0
- package/templates/nova/src/components/base/Link.css +15 -0
- package/templates/nova/src/components/base/Link.tsx +23 -0
- package/templates/nova/src/components/base/Radio.tsx +13 -0
- package/templates/nova/src/components/base/Select.css +18 -0
- package/templates/nova/src/components/base/Select.tsx +34 -0
- package/templates/nova/src/components/base/Skeleton.css +17 -0
- package/templates/nova/src/components/base/Skeleton.tsx +23 -0
- package/templates/nova/src/components/base/Spinner.css +13 -0
- package/templates/nova/src/components/base/Spinner.tsx +8 -0
- package/templates/nova/src/components/base/Switch.tsx +16 -0
- package/templates/nova/src/components/base/Tabs.css +24 -0
- package/templates/nova/src/components/base/Tabs.tsx +61 -0
- package/templates/nova/src/components/base/Textarea.css +1 -0
- package/templates/nova/src/components/base/Textarea.tsx +8 -0
- package/templates/nova/src/components/base/choice-props.ts +9 -0
- package/templates/nova/src/components/base/choice.css +69 -0
- package/templates/nova/src/components/commerce/AddToCart.css +4 -0
- package/templates/nova/src/components/commerce/AddToCart.tsx +77 -0
- package/templates/nova/src/components/commerce/CartLine.css +26 -0
- package/templates/nova/src/components/commerce/CartLine.tsx +82 -0
- package/templates/nova/src/components/commerce/CartSummary.css +23 -0
- package/templates/nova/src/components/commerce/CartSummary.tsx +120 -0
- package/templates/nova/src/components/commerce/CollectionCard.css +66 -0
- package/templates/nova/src/components/commerce/CollectionCard.tsx +57 -0
- package/templates/nova/src/components/commerce/ComparisonTable.css +33 -0
- package/templates/nova/src/components/commerce/ComparisonTable.tsx +113 -0
- package/templates/nova/src/components/commerce/EarnHint.css +3 -0
- package/templates/nova/src/components/commerce/EarnHint.tsx +31 -0
- package/templates/nova/src/components/commerce/Hotspot.css +16 -0
- package/templates/nova/src/components/commerce/Hotspot.tsx +64 -0
- package/templates/nova/src/components/commerce/ListingParts.css +79 -0
- package/templates/nova/src/components/commerce/ListingParts.tsx +211 -0
- package/templates/nova/src/components/commerce/LookItem.css +19 -0
- package/templates/nova/src/components/commerce/LookItem.tsx +41 -0
- package/templates/nova/src/components/commerce/MiniCartLine.css +20 -0
- package/templates/nova/src/components/commerce/MiniCartLine.tsx +93 -0
- package/templates/nova/src/components/commerce/PaymentMark.css +2 -0
- package/templates/nova/src/components/commerce/PaymentMark.tsx +55 -0
- package/templates/nova/src/components/commerce/Price.css +27 -0
- package/templates/nova/src/components/commerce/Price.tsx +55 -0
- package/templates/nova/src/components/commerce/ProductCard.css +66 -0
- package/templates/nova/src/components/commerce/ProductCard.tsx +117 -0
- package/templates/nova/src/components/commerce/ProductGallery.css +72 -0
- package/templates/nova/src/components/commerce/ProductGallery.tsx +98 -0
- package/templates/nova/src/components/commerce/QuantitySelector.css +23 -0
- package/templates/nova/src/components/commerce/QuantitySelector.tsx +45 -0
- package/templates/nova/src/components/commerce/Reviews.css +34 -0
- package/templates/nova/src/components/commerce/Reviews.tsx +112 -0
- package/templates/nova/src/components/commerce/Stars.css +7 -0
- package/templates/nova/src/components/commerce/Stars.tsx +38 -0
- package/templates/nova/src/components/commerce/VariantPicker.css +31 -0
- package/templates/nova/src/components/commerce/VariantPicker.tsx +122 -0
- package/templates/nova/src/components/commerce/blocks/Badge.css +6 -0
- package/templates/nova/src/components/commerce/blocks/Badge.tsx +33 -0
- package/templates/nova/src/components/commerce/blocks/PaymentIcons.tsx +43 -0
- package/templates/nova/src/components/commerce/blocks/Swatches.tsx +17 -0
- package/templates/nova/src/components/commerce/blocks/payment.css +2 -0
- package/templates/nova/src/components/commerce/cart-limit.ts +11 -0
- package/templates/nova/src/components/commerce/money.ts +34 -0
- package/templates/nova/src/components/commerce/swatch.ts +54 -0
- package/templates/nova/src/components/content/ArticleCard.css +22 -0
- package/templates/nova/src/components/content/ArticleCard.tsx +53 -0
- package/templates/nova/src/components/content/BeforeAfterSlider.css +38 -0
- package/templates/nova/src/components/content/BeforeAfterSlider.tsx +87 -0
- package/templates/nova/src/components/content/CardRow.css +80 -0
- package/templates/nova/src/components/content/CardRow.tsx +140 -0
- package/templates/nova/src/components/content/CarouselControls.css +61 -0
- package/templates/nova/src/components/content/CarouselControls.tsx +90 -0
- package/templates/nova/src/components/content/ContentsNav.css +16 -0
- package/templates/nova/src/components/content/ContentsNav.tsx +55 -0
- package/templates/nova/src/components/content/Countdown.css +24 -0
- package/templates/nova/src/components/content/Countdown.tsx +115 -0
- package/templates/nova/src/components/content/HeroCopy.css +92 -0
- package/templates/nova/src/components/content/HeroCopy.tsx +148 -0
- package/templates/nova/src/components/content/HeroFrame.css +75 -0
- package/templates/nova/src/components/content/HeroFrame.tsx +49 -0
- package/templates/nova/src/components/content/HeroMedia.css +40 -0
- package/templates/nova/src/components/content/HeroMedia.tsx +170 -0
- package/templates/nova/src/components/content/LongForm.css +40 -0
- package/templates/nova/src/components/content/LongForm.tsx +56 -0
- package/templates/nova/src/components/content/MediaFrame.css +5 -0
- package/templates/nova/src/components/content/MediaFrame.tsx +52 -0
- package/templates/nova/src/components/content/RichText.tsx +30 -0
- package/templates/nova/src/components/content/SectionHead.css +8 -0
- package/templates/nova/src/components/content/SectionHead.tsx +34 -0
- package/templates/nova/src/components/content/ShareButtons.css +2 -0
- package/templates/nova/src/components/content/ShareButtons.tsx +40 -0
- package/templates/nova/src/components/content/StoreCard.css +14 -0
- package/templates/nova/src/components/content/StoreCard.tsx +60 -0
- package/templates/nova/src/components/content/TestimonialCard.css +36 -0
- package/templates/nova/src/components/content/TestimonialCard.tsx +102 -0
- package/templates/nova/src/components/content/UgcTile.css +8 -0
- package/templates/nova/src/components/content/UgcTile.tsx +33 -0
- package/templates/nova/src/components/content/blocks/Button.tsx +36 -0
- package/templates/nova/src/components/content/blocks/Column.tsx +30 -0
- package/templates/nova/src/components/content/blocks/Heading.tsx +31 -0
- package/templates/nova/src/components/content/blocks/Icon.tsx +25 -0
- package/templates/nova/src/components/content/blocks/Image.tsx +42 -0
- package/templates/nova/src/components/content/blocks/Text.tsx +26 -0
- package/templates/nova/src/components/content/blocks/Video.tsx +44 -0
- package/templates/nova/src/components/content/blocks/content.css +25 -0
- package/templates/nova/src/components/content/blocks/shared.ts +5 -0
- package/templates/nova/src/components/forms/ContactForm.css +19 -0
- package/templates/nova/src/components/forms/ContactForm.tsx +139 -0
- package/templates/nova/src/components/forms/FormField.css +15 -0
- package/templates/nova/src/components/forms/FormField.tsx +77 -0
- package/templates/nova/src/components/forms/GatewayFields.tsx +79 -0
- package/templates/nova/src/components/forms/NewsletterForm.css +9 -0
- package/templates/nova/src/components/forms/NewsletterForm.tsx +141 -0
- package/templates/nova/src/components/forms/SearchField.css +7 -0
- package/templates/nova/src/components/forms/SearchField.tsx +68 -0
- package/templates/nova/src/components/forms/blocks/Newsletter.css +5 -0
- package/templates/nova/src/components/forms/blocks/Newsletter.tsx +71 -0
- package/templates/nova/src/components/forms/validate.ts +4 -0
- package/templates/nova/src/components/listing/ProductListing.tsx +200 -0
- package/templates/nova/src/components/navigation/BrandLogo.tsx +35 -0
- package/templates/nova/src/components/navigation/Breadcrumb.css +16 -0
- package/templates/nova/src/components/navigation/Breadcrumb.tsx +59 -0
- package/templates/nova/src/components/navigation/LineAddFriend.css +5 -0
- package/templates/nova/src/components/navigation/LineAddFriend.tsx +42 -0
- package/templates/nova/src/components/navigation/LocaleSelector.css +33 -0
- package/templates/nova/src/components/navigation/LocaleSelector.tsx +64 -0
- package/templates/nova/src/components/navigation/Menu.tsx +26 -0
- package/templates/nova/src/components/navigation/Pagination.css +24 -0
- package/templates/nova/src/components/navigation/Pagination.tsx +74 -0
- package/templates/nova/src/components/navigation/RecoveryLinks.css +8 -0
- package/templates/nova/src/components/navigation/RecoveryLinks.tsx +23 -0
- package/templates/nova/src/components/navigation/SocialLinks.css +5 -0
- package/templates/nova/src/components/navigation/SocialLinks.tsx +51 -0
- package/templates/nova/src/components/navigation/blocks/SocialLinks.tsx +23 -0
- package/templates/nova/src/components/overlays/AccountMenu.css +11 -0
- package/templates/nova/src/components/overlays/AccountMenu.tsx +91 -0
- package/templates/nova/src/components/overlays/CartDrawer.css +17 -0
- package/templates/nova/src/components/overlays/CartDrawer.tsx +118 -0
- package/templates/nova/src/components/overlays/ConfirmationDialog.tsx +49 -0
- package/templates/nova/src/components/overlays/CookieConsent.css +56 -0
- package/templates/nova/src/components/overlays/CookieConsent.tsx +170 -0
- package/templates/nova/src/components/overlays/Drawer.css +38 -0
- package/templates/nova/src/components/overlays/Drawer.tsx +66 -0
- package/templates/nova/src/components/overlays/FriendOfferPanel.tsx +79 -0
- package/templates/nova/src/components/overlays/MarketSelector.css +111 -0
- package/templates/nova/src/components/overlays/MarketSelector.tsx +450 -0
- package/templates/nova/src/components/overlays/Menu.css +9 -0
- package/templates/nova/src/components/overlays/Menu.tsx +124 -0
- package/templates/nova/src/components/overlays/MobileNavDrawer.css +28 -0
- package/templates/nova/src/components/overlays/MobileNavDrawer.tsx +166 -0
- package/templates/nova/src/components/overlays/Modal.css +52 -0
- package/templates/nova/src/components/overlays/Modal.tsx +88 -0
- package/templates/nova/src/components/overlays/Popover.css +4 -0
- package/templates/nova/src/components/overlays/Popover.tsx +115 -0
- package/templates/nova/src/components/overlays/ProductLightbox.css +20 -0
- package/templates/nova/src/components/overlays/ProductLightbox.tsx +70 -0
- package/templates/nova/src/components/overlays/PromoPopup.css +32 -0
- package/templates/nova/src/components/overlays/PromoPopup.tsx +198 -0
- package/templates/nova/src/components/overlays/QuickView.css +31 -0
- package/templates/nova/src/components/overlays/QuickView.tsx +127 -0
- package/templates/nova/src/components/overlays/ReferralPanel.css +16 -0
- package/templates/nova/src/components/overlays/ReferralPanel.tsx +138 -0
- package/templates/nova/src/components/overlays/RewardsLauncher.css +22 -0
- package/templates/nova/src/components/overlays/RewardsLauncher.tsx +270 -0
- package/templates/nova/src/components/overlays/SearchModal.css +48 -0
- package/templates/nova/src/components/overlays/SearchModal.tsx +302 -0
- package/templates/nova/src/components/overlays/Sheet.css +16 -0
- package/templates/nova/src/components/overlays/Sheet.tsx +48 -0
- package/templates/nova/src/components/overlays/SizeGuide.css +8 -0
- package/templates/nova/src/components/overlays/SizeGuide.tsx +74 -0
- package/templates/nova/src/components/overlays/Toast.css +20 -0
- package/templates/nova/src/components/overlays/Toast.tsx +164 -0
- package/templates/nova/src/components/overlays/Tooltip.css +6 -0
- package/templates/nova/src/components/overlays/Tooltip.tsx +59 -0
- package/templates/nova/src/components/overlays/use-dialog.ts +74 -0
- package/templates/nova/src/components/section/shared.css +42 -0
- package/templates/nova/src/components/section/shared.ts +120 -0
- package/templates/nova/src/components/section/shell.tsx +29 -0
- package/templates/nova/src/components/states/Alert.css +10 -0
- package/templates/nova/src/components/states/Alert.tsx +50 -0
- package/templates/nova/src/components/states/EditorFrame.css +31 -0
- package/templates/nova/src/components/states/EditorFrame.tsx +43 -0
- package/templates/nova/src/components/states/MediaState.css +1 -0
- package/templates/nova/src/components/states/MediaState.tsx +49 -0
- package/templates/nova/src/components/states/OfflineNotice.css +4 -0
- package/templates/nova/src/components/states/OfflineNotice.tsx +24 -0
- package/templates/nova/src/components/states/SkeletonLayout.css +22 -0
- package/templates/nova/src/components/states/SkeletonLayout.tsx +104 -0
- package/templates/nova/src/components/states/StateBlock.css +22 -0
- package/templates/nova/src/components/states/StateBlock.tsx +39 -0
- package/templates/nova/src/components/states/media/MediaError.css +6 -0
- package/templates/nova/src/components/states/media/MediaError.tsx +49 -0
- package/templates/nova/src/components/states/media/MediaPlaceholder.css +24 -0
- package/templates/nova/src/components/states/media/MediaPlaceholder.tsx +101 -0
- package/templates/nova/src/components/states/media/placeholder-art.ts +142 -0
- package/templates/nova/src/layouts/Main.tsx +80 -0
- package/templates/nova/src/sections/Account/Account.tsx +109 -0
- package/templates/nova/src/sections/Account/index.ts +22 -0
- package/templates/nova/src/sections/Account/presets.ts +6 -0
- package/templates/nova/src/sections/Account/schema.ts +29 -0
- package/templates/nova/src/sections/AnnouncementBar/AnnouncementBar.css +37 -0
- package/templates/nova/src/sections/AnnouncementBar/AnnouncementBar.tsx +151 -0
- package/templates/nova/src/sections/AnnouncementBar/index.ts +20 -0
- package/templates/nova/src/sections/AnnouncementBar/presets.ts +10 -0
- package/templates/nova/src/sections/AnnouncementBar/schema.ts +26 -0
- package/templates/nova/src/sections/ArticleBody/ArticleBody.tsx +129 -0
- package/templates/nova/src/sections/ArticleBody/index.ts +21 -0
- package/templates/nova/src/sections/ArticleBody/presets.ts +10 -0
- package/templates/nova/src/sections/ArticleBody/schema.ts +40 -0
- package/templates/nova/src/sections/BeforeAfter/BeforeAfter.tsx +47 -0
- package/templates/nova/src/sections/BeforeAfter/blocks/Comparison.tsx +20 -0
- package/templates/nova/src/sections/BeforeAfter/index.ts +28 -0
- package/templates/nova/src/sections/BeforeAfter/presets.ts +10 -0
- package/templates/nova/src/sections/BeforeAfter/schema.ts +34 -0
- package/templates/nova/src/sections/BlogPosts/BlogPosts.tsx +106 -0
- package/templates/nova/src/sections/BlogPosts/index.ts +30 -0
- package/templates/nova/src/sections/BlogPosts/presets.ts +10 -0
- package/templates/nova/src/sections/BlogPosts/schema.ts +42 -0
- package/templates/nova/src/sections/Breadcrumbs/Breadcrumbs.css +10 -0
- package/templates/nova/src/sections/Breadcrumbs/Breadcrumbs.tsx +41 -0
- package/templates/nova/src/sections/Breadcrumbs/index.ts +20 -0
- package/templates/nova/src/sections/Breadcrumbs/presets.ts +6 -0
- package/templates/nova/src/sections/Breadcrumbs/schema.ts +24 -0
- package/templates/nova/src/sections/CartItems/CartItems.tsx +170 -0
- package/templates/nova/src/sections/CartItems/blocks/CartBadge.tsx +14 -0
- package/templates/nova/src/sections/CartItems/index.ts +37 -0
- package/templates/nova/src/sections/CartItems/presets.ts +8 -0
- package/templates/nova/src/sections/CartItems/schema.ts +34 -0
- package/templates/nova/src/sections/CollectionBanner/CollectionBanner.tsx +120 -0
- package/templates/nova/src/sections/CollectionBanner/index.ts +25 -0
- package/templates/nova/src/sections/CollectionBanner/presets.ts +10 -0
- package/templates/nova/src/sections/CollectionBanner/schema.ts +37 -0
- package/templates/nova/src/sections/CollectionLinks/CollectionLinks.tsx +47 -0
- package/templates/nova/src/sections/CollectionLinks/index.ts +20 -0
- package/templates/nova/src/sections/CollectionLinks/presets.ts +8 -0
- package/templates/nova/src/sections/CollectionLinks/schema.ts +33 -0
- package/templates/nova/src/sections/CollectionList/CollectionList.tsx +89 -0
- package/templates/nova/src/sections/CollectionList/blocks/CollectionItem.tsx +25 -0
- package/templates/nova/src/sections/CollectionList/index.ts +33 -0
- package/templates/nova/src/sections/CollectionList/presets.ts +10 -0
- package/templates/nova/src/sections/CollectionList/schema.ts +41 -0
- package/templates/nova/src/sections/ComparisonTable/ComparisonTable.tsx +52 -0
- package/templates/nova/src/sections/ComparisonTable/blocks/CompareItem.tsx +26 -0
- package/templates/nova/src/sections/ComparisonTable/index.ts +31 -0
- package/templates/nova/src/sections/ComparisonTable/presets.ts +8 -0
- package/templates/nova/src/sections/ComparisonTable/schema.ts +31 -0
- package/templates/nova/src/sections/ContactForm/ContactForm.tsx +83 -0
- package/templates/nova/src/sections/ContactForm/blocks/ContactDetail.tsx +13 -0
- package/templates/nova/src/sections/ContactForm/index.ts +29 -0
- package/templates/nova/src/sections/ContactForm/presets.ts +8 -0
- package/templates/nova/src/sections/ContactForm/schema.ts +34 -0
- package/templates/nova/src/sections/Divider/Divider.css +17 -0
- package/templates/nova/src/sections/Divider/Divider.tsx +21 -0
- package/templates/nova/src/sections/Divider/index.ts +20 -0
- package/templates/nova/src/sections/Divider/presets.ts +10 -0
- package/templates/nova/src/sections/Divider/schema.ts +24 -0
- package/templates/nova/src/sections/Faq/Faq.tsx +51 -0
- package/templates/nova/src/sections/Faq/blocks/FaqItem.tsx +13 -0
- package/templates/nova/src/sections/Faq/index.ts +28 -0
- package/templates/nova/src/sections/Faq/presets.ts +8 -0
- package/templates/nova/src/sections/Faq/schema.ts +32 -0
- package/templates/nova/src/sections/FeatureGridBlocks/FeatureGridBlocks.tsx +90 -0
- package/templates/nova/src/sections/FeatureGridBlocks/index.ts +35 -0
- package/templates/nova/src/sections/FeatureGridBlocks/presets.ts +8 -0
- package/templates/nova/src/sections/FeatureGridBlocks/schema.ts +35 -0
- package/templates/nova/src/sections/FeatureHighlights/FeatureHighlights.tsx +56 -0
- package/templates/nova/src/sections/FeatureHighlights/index.ts +20 -0
- package/templates/nova/src/sections/FeatureHighlights/presets.ts +6 -0
- package/templates/nova/src/sections/FeatureHighlights/schema.ts +27 -0
- package/templates/nova/src/sections/FeaturedCollection/FeaturedCollection.tsx +67 -0
- package/templates/nova/src/sections/FeaturedCollection/index.ts +21 -0
- package/templates/nova/src/sections/FeaturedCollection/presets.ts +10 -0
- package/templates/nova/src/sections/FeaturedCollection/schema.ts +39 -0
- package/templates/nova/src/sections/FeaturedProduct/FeaturedProduct.tsx +107 -0
- package/templates/nova/src/sections/FeaturedProduct/index.ts +23 -0
- package/templates/nova/src/sections/FeaturedProduct/presets.ts +8 -0
- package/templates/nova/src/sections/FeaturedProduct/schema.ts +35 -0
- package/templates/nova/src/sections/Footer/Footer.css +81 -0
- package/templates/nova/src/sections/Footer/Footer.tsx +256 -0
- package/templates/nova/src/sections/Footer/blocks/FooterBrand.tsx +40 -0
- package/templates/nova/src/sections/Footer/blocks/FooterLine.tsx +11 -0
- package/templates/nova/src/sections/Footer/blocks/FooterMenu.tsx +14 -0
- package/templates/nova/src/sections/Footer/blocks/FooterText.tsx +8 -0
- package/templates/nova/src/sections/Footer/blocks/footer.css +7 -0
- package/templates/nova/src/sections/Footer/index.ts +38 -0
- package/templates/nova/src/sections/Footer/presets.ts +10 -0
- package/templates/nova/src/sections/Footer/schema.ts +27 -0
- package/templates/nova/src/sections/Group/Group.css +59 -0
- package/templates/nova/src/sections/Group/Group.tsx +167 -0
- package/templates/nova/src/sections/Group/blocks/Accordion.tsx +26 -0
- package/templates/nova/src/sections/Group/blocks/JumboText.tsx +20 -0
- package/templates/nova/src/sections/Group/blocks/Spacer.tsx +16 -0
- package/templates/nova/src/sections/Group/index.ts +36 -0
- package/templates/nova/src/sections/Group/presets.ts +12 -0
- package/templates/nova/src/sections/Group/schema.ts +35 -0
- package/templates/nova/src/sections/Header/Header.css +185 -0
- package/templates/nova/src/sections/Header/Header.tsx +478 -0
- package/templates/nova/src/sections/Header/index.ts +32 -0
- package/templates/nova/src/sections/Header/presets.ts +10 -0
- package/templates/nova/src/sections/Header/schema.ts +32 -0
- package/templates/nova/src/sections/Hero/Hero.tsx +128 -0
- package/templates/nova/src/sections/Hero/index.ts +24 -0
- package/templates/nova/src/sections/Hero/presets.ts +16 -0
- package/templates/nova/src/sections/Hero/schema.ts +56 -0
- package/templates/nova/src/sections/ImageGallery/ImageGallery.tsx +86 -0
- package/templates/nova/src/sections/ImageGallery/index.ts +28 -0
- package/templates/nova/src/sections/ImageGallery/presets.ts +10 -0
- package/templates/nova/src/sections/ImageGallery/schema.ts +34 -0
- package/templates/nova/src/sections/ImageWithText/ImageWithText.tsx +62 -0
- package/templates/nova/src/sections/ImageWithText/index.ts +23 -0
- package/templates/nova/src/sections/ImageWithText/presets.ts +12 -0
- package/templates/nova/src/sections/ImageWithText/schema.ts +45 -0
- package/templates/nova/src/sections/LineAddFriend/LineAddFriend.tsx +25 -0
- package/templates/nova/src/sections/LineAddFriend/index.ts +20 -0
- package/templates/nova/src/sections/LineAddFriend/presets.ts +3 -0
- package/templates/nova/src/sections/LineAddFriend/schema.ts +25 -0
- package/templates/nova/src/sections/LogoList/LogoList.tsx +40 -0
- package/templates/nova/src/sections/LogoList/blocks/Logo.tsx +18 -0
- package/templates/nova/src/sections/LogoList/index.ts +29 -0
- package/templates/nova/src/sections/LogoList/presets.ts +8 -0
- package/templates/nova/src/sections/LogoList/schema.ts +29 -0
- package/templates/nova/src/sections/MainCollection/MainCollection.tsx +51 -0
- package/templates/nova/src/sections/MainCollection/index.ts +26 -0
- package/templates/nova/src/sections/MainCollection/presets.ts +10 -0
- package/templates/nova/src/sections/MainCollection/schema.ts +29 -0
- package/templates/nova/src/sections/Marquee/Marquee.tsx +114 -0
- package/templates/nova/src/sections/Marquee/index.ts +20 -0
- package/templates/nova/src/sections/Marquee/presets.ts +10 -0
- package/templates/nova/src/sections/Marquee/schema.ts +23 -0
- package/templates/nova/src/sections/Multicolumn/Multicolumn.tsx +56 -0
- package/templates/nova/src/sections/Multicolumn/index.ts +25 -0
- package/templates/nova/src/sections/Multicolumn/presets.ts +8 -0
- package/templates/nova/src/sections/Multicolumn/schema.ts +34 -0
- package/templates/nova/src/sections/Newsletter/Newsletter.tsx +64 -0
- package/templates/nova/src/sections/Newsletter/index.ts +20 -0
- package/templates/nova/src/sections/Newsletter/presets.ts +10 -0
- package/templates/nova/src/sections/Newsletter/schema.ts +36 -0
- package/templates/nova/src/sections/NotFound/NotFound.tsx +41 -0
- package/templates/nova/src/sections/NotFound/index.ts +20 -0
- package/templates/nova/src/sections/NotFound/presets.ts +6 -0
- package/templates/nova/src/sections/NotFound/schema.ts +30 -0
- package/templates/nova/src/sections/PageBody/PageBody.tsx +35 -0
- package/templates/nova/src/sections/PageBody/index.ts +21 -0
- package/templates/nova/src/sections/PageBody/presets.ts +6 -0
- package/templates/nova/src/sections/PageBody/schema.ts +29 -0
- package/templates/nova/src/sections/PolicyPage/PolicyPage.tsx +62 -0
- package/templates/nova/src/sections/PolicyPage/index.ts +23 -0
- package/templates/nova/src/sections/PolicyPage/presets.ts +6 -0
- package/templates/nova/src/sections/PolicyPage/schema.ts +27 -0
- package/templates/nova/src/sections/ProductDetails/ProductDetails.tsx +269 -0
- package/templates/nova/src/sections/ProductDetails/blocks/AddToCartBlock.tsx +15 -0
- package/templates/nova/src/sections/ProductDetails/blocks/ProductDescription.tsx +15 -0
- package/templates/nova/src/sections/ProductDetails/blocks/ProductInventory.tsx +38 -0
- package/templates/nova/src/sections/ProductDetails/blocks/ProductPrice.tsx +19 -0
- package/templates/nova/src/sections/ProductDetails/blocks/ProductSku.tsx +15 -0
- package/templates/nova/src/sections/ProductDetails/blocks/ProductTitle.tsx +17 -0
- package/templates/nova/src/sections/ProductDetails/blocks/Quantity.tsx +14 -0
- package/templates/nova/src/sections/ProductDetails/blocks/Tab.tsx +23 -0
- package/templates/nova/src/sections/ProductDetails/blocks/VariantPickerBlock.tsx +44 -0
- package/templates/nova/src/sections/ProductDetails/blocks/commerce-blocks.css +13 -0
- package/templates/nova/src/sections/ProductDetails/index.ts +44 -0
- package/templates/nova/src/sections/ProductDetails/presets.ts +10 -0
- package/templates/nova/src/sections/ProductDetails/schema.ts +44 -0
- package/templates/nova/src/sections/ProductGrid/ProductGrid.tsx +38 -0
- package/templates/nova/src/sections/ProductGrid/index.ts +25 -0
- package/templates/nova/src/sections/ProductGrid/presets.ts +6 -0
- package/templates/nova/src/sections/ProductGrid/schema.ts +37 -0
- package/templates/nova/src/sections/ProductRecommendations/ProductRecommendations.tsx +45 -0
- package/templates/nova/src/sections/ProductRecommendations/index.ts +20 -0
- package/templates/nova/src/sections/ProductRecommendations/presets.ts +8 -0
- package/templates/nova/src/sections/ProductRecommendations/schema.ts +28 -0
- package/templates/nova/src/sections/ProductReviews/ProductReviews.tsx +136 -0
- package/templates/nova/src/sections/ProductReviews/index.ts +22 -0
- package/templates/nova/src/sections/ProductReviews/presets.ts +6 -0
- package/templates/nova/src/sections/ProductReviews/schema.ts +31 -0
- package/templates/nova/src/sections/PromoBanner/PromoBanner.tsx +78 -0
- package/templates/nova/src/sections/PromoBanner/index.ts +20 -0
- package/templates/nova/src/sections/PromoBanner/presets.ts +10 -0
- package/templates/nova/src/sections/PromoBanner/schema.ts +38 -0
- package/templates/nova/src/sections/RecentlyViewed/RecentlyViewed.tsx +53 -0
- package/templates/nova/src/sections/RecentlyViewed/index.ts +20 -0
- package/templates/nova/src/sections/RecentlyViewed/presets.ts +6 -0
- package/templates/nova/src/sections/RecentlyViewed/schema.ts +26 -0
- package/templates/nova/src/sections/RichText/RichText.tsx +38 -0
- package/templates/nova/src/sections/RichText/index.ts +20 -0
- package/templates/nova/src/sections/RichText/presets.ts +10 -0
- package/templates/nova/src/sections/RichText/schema.ts +37 -0
- package/templates/nova/src/sections/SearchResults/SearchResults.tsx +112 -0
- package/templates/nova/src/sections/SearchResults/index.ts +26 -0
- package/templates/nova/src/sections/SearchResults/presets.ts +8 -0
- package/templates/nova/src/sections/SearchResults/schema.ts +30 -0
- package/templates/nova/src/sections/ShopTheLook/ShopTheLook.tsx +112 -0
- package/templates/nova/src/sections/ShopTheLook/blocks/Hotspot.tsx +22 -0
- package/templates/nova/src/sections/ShopTheLook/index.ts +33 -0
- package/templates/nova/src/sections/ShopTheLook/presets.ts +8 -0
- package/templates/nova/src/sections/ShopTheLook/schema.ts +31 -0
- package/templates/nova/src/sections/Slideshow/Slideshow.tsx +199 -0
- package/templates/nova/src/sections/Slideshow/blocks/Slide.tsx +93 -0
- package/templates/nova/src/sections/Slideshow/index.ts +30 -0
- package/templates/nova/src/sections/Slideshow/presets.ts +10 -0
- package/templates/nova/src/sections/Slideshow/schema.ts +36 -0
- package/templates/nova/src/sections/StoreLocator/StoreLocator.tsx +66 -0
- package/templates/nova/src/sections/StoreLocator/index.ts +20 -0
- package/templates/nova/src/sections/StoreLocator/presets.ts +6 -0
- package/templates/nova/src/sections/StoreLocator/schema.ts +34 -0
- package/templates/nova/src/sections/TeamFounders/TeamFounders.tsx +74 -0
- package/templates/nova/src/sections/TeamFounders/blocks/Person.tsx +28 -0
- package/templates/nova/src/sections/TeamFounders/index.ts +28 -0
- package/templates/nova/src/sections/TeamFounders/presets.ts +10 -0
- package/templates/nova/src/sections/TeamFounders/schema.ts +36 -0
- package/templates/nova/src/sections/Testimonials/Testimonials.tsx +83 -0
- package/templates/nova/src/sections/Testimonials/blocks/Testimonial.tsx +30 -0
- package/templates/nova/src/sections/Testimonials/index.ts +29 -0
- package/templates/nova/src/sections/Testimonials/presets.ts +10 -0
- package/templates/nova/src/sections/Testimonials/schema.ts +35 -0
- package/templates/nova/src/sections/Timeline/Timeline.tsx +43 -0
- package/templates/nova/src/sections/Timeline/blocks/Step.tsx +19 -0
- package/templates/nova/src/sections/Timeline/index.ts +28 -0
- package/templates/nova/src/sections/Timeline/presets.ts +8 -0
- package/templates/nova/src/sections/Timeline/schema.ts +31 -0
- package/templates/nova/src/sections/TrustBadges/TrustBadges.tsx +42 -0
- package/templates/nova/src/sections/TrustBadges/index.ts +29 -0
- package/templates/nova/src/sections/TrustBadges/presets.ts +8 -0
- package/templates/nova/src/sections/TrustBadges/schema.ts +29 -0
- package/templates/nova/src/sections/UgcGallery/UgcGallery.tsx +58 -0
- package/templates/nova/src/sections/UgcGallery/blocks/UgcImage.tsx +27 -0
- package/templates/nova/src/sections/UgcGallery/index.ts +31 -0
- package/templates/nova/src/sections/UgcGallery/presets.ts +8 -0
- package/templates/nova/src/sections/UgcGallery/schema.ts +35 -0
- package/templates/nova/src/sections/VideoHero/VideoHero.tsx +75 -0
- package/templates/nova/src/sections/VideoHero/index.ts +22 -0
- package/templates/nova/src/sections/VideoHero/presets.ts +8 -0
- package/templates/nova/src/sections/VideoHero/schema.ts +43 -0
- package/templates/nova/src/sections/data.ts +115 -0
- package/templates/nova/src/sections/shipped-copy.ts +25 -0
- package/templates/nova/src/sections/starter.ts +49 -0
- package/templates/nova/src/styles/Container.css +6 -0
- package/templates/nova/src/styles/Container.tsx +13 -0
- package/templates/nova/src/styles/Icon.css +2 -0
- package/templates/nova/src/styles/Icon.tsx +101 -0
- package/templates/nova/src/styles/NovaProvider.tsx +91 -0
- package/templates/nova/src/styles/base.css +142 -0
- package/templates/nova/src/styles/blocks.css +6 -0
- package/templates/nova/src/styles/fonts/OFL.txt +93 -0
- package/templates/nova/src/styles/fonts/geist-cyrillic-ext.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-cyrillic.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-latin-ext.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-latin.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-mono-cyrillic-ext.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-mono-cyrillic.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-mono-latin-ext.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-mono-latin.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-mono-vietnamese.woff2 +0 -0
- package/templates/nova/src/styles/fonts/geist-vietnamese.woff2 +0 -0
- package/templates/nova/src/styles/fonts.css +95 -0
- package/templates/nova/src/styles/global-settings.css +88 -0
- package/templates/nova/src/styles/index.css +6 -0
- package/templates/nova/src/styles/motion.ts +53 -0
- package/templates/nova/src/styles/scroll.ts +24 -0
- package/templates/nova/src/styles/sections/commerce.css +147 -0
- package/templates/nova/src/styles/sections/content.css +304 -0
- package/templates/nova/src/styles/sections/editorial.css +131 -0
- package/templates/nova/src/styles/sections/promotion.css +336 -0
- package/templates/nova/src/styles/sections/trust.css +117 -0
- package/templates/nova/src/styles/sections/utility.css +190 -0
- package/templates/nova/src/styles/strings.ts +492 -0
- package/templates/nova/src/styles/text.ts +4 -0
- package/templates/nova/src/styles/theme.ts +171 -0
- package/templates/nova/src/styles/tokens.css +600 -0
- package/templates/nova/src/styles/viewport.ts +23 -0
- package/templates/nova/template.json +94 -0
- package/templates/nova/templates/404.json +30 -0
- package/templates/nova/templates/account.json +15 -0
- package/templates/nova/templates/article.json +41 -0
- package/templates/nova/templates/article.longform.json +17 -0
- package/templates/nova/templates/blog.featured.json +22 -0
- package/templates/nova/templates/blog.json +29 -0
- package/templates/nova/templates/cart.json +67 -0
- package/templates/nova/templates/collection.featured.json +43 -0
- package/templates/nova/templates/collection.json +30 -0
- package/templates/nova/templates/contact.json +65 -0
- package/templates/nova/templates/index.json +167 -0
- package/templates/nova/templates/list-collections.json +19 -0
- package/templates/nova/templates/page.about.json +134 -0
- package/templates/nova/templates/page.contact.json +27 -0
- package/templates/nova/templates/page.json +27 -0
- package/templates/nova/templates/policy.json +23 -0
- package/templates/nova/templates/product.bundle.json +145 -0
- package/templates/nova/templates/product.json +119 -0
- package/templates/nova/templates/search.json +17 -0
- package/templates/nova/tests/abi-ai-contract.test.ts +99 -0
- package/templates/nova/tests/abi-forms.test.tsx +269 -0
- package/templates/nova/tests/abi-inventory.test.tsx +197 -0
- package/templates/nova/tests/abi-legacy-settings.test.tsx +105 -0
- package/templates/nova/tests/abi-opt-in.test.tsx +100 -0
- package/templates/nova/tests/abi-parity.test.tsx +95 -0
- package/templates/nova/tests/abi-r5-store-settings.test.tsx +337 -0
- package/templates/nova/tests/abi-render.test.tsx +178 -0
- package/templates/nova/tests/abi-shop-links.test.tsx +141 -0
- package/templates/nova/tests/abi-storefront-basics.test.tsx +233 -0
- package/templates/nova/tests/abi-variant-url.test.tsx +73 -0
- package/templates/nova/tests/add-refused-no-success.test.tsx +193 -0
- package/templates/nova/tests/architecture.test.ts +63 -0
- package/templates/nova/tests/architecture.ts +160 -0
- package/templates/nova/tests/audit-guards.test.ts +31 -0
- package/templates/nova/tests/bundle-split.test.ts +29 -0
- package/templates/nova/tests/cart-limit-message.test.tsx +212 -0
- package/templates/nova/tests/cart-link-message.test.tsx +98 -0
- package/templates/nova/tests/cases/components/Overview.cases.tsx +8 -0
- package/templates/nova/tests/cases/components/base/Accordion.cases.tsx +40 -0
- package/templates/nova/tests/cases/components/base/Badge.cases.tsx +30 -0
- package/templates/nova/tests/cases/components/base/Button.cases.tsx +73 -0
- package/templates/nova/tests/cases/components/base/Checkbox.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/base/Chip.cases.tsx +37 -0
- package/templates/nova/tests/cases/components/base/Divider.cases.tsx +26 -0
- package/templates/nova/tests/cases/components/base/IconButton.cases.tsx +28 -0
- package/templates/nova/tests/cases/components/base/Input.cases.tsx +28 -0
- package/templates/nova/tests/cases/components/base/Link.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/base/Radio.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/base/Select.cases.tsx +26 -0
- package/templates/nova/tests/cases/components/base/Skeleton.cases.tsx +29 -0
- package/templates/nova/tests/cases/components/base/Spinner.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/base/Switch.cases.tsx +26 -0
- package/templates/nova/tests/cases/components/base/Tabs.cases.tsx +39 -0
- package/templates/nova/tests/cases/components/base/Textarea.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/commerce/AddToCart.cases.tsx +36 -0
- package/templates/nova/tests/cases/components/commerce/CartLine.cases.tsx +20 -0
- package/templates/nova/tests/cases/components/commerce/CartSummary.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/commerce/CollectionCard.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/commerce/ComparisonTable.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/commerce/Hotspot.cases.tsx +25 -0
- package/templates/nova/tests/cases/components/commerce/LookItem.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/commerce/PaymentMark.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/commerce/Price.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/commerce/ProductCard.cases.tsx +67 -0
- package/templates/nova/tests/cases/components/commerce/ProductGallery.cases.tsx +39 -0
- package/templates/nova/tests/cases/components/commerce/QuantitySelector.cases.tsx +31 -0
- package/templates/nova/tests/cases/components/commerce/Reviews.cases.tsx +35 -0
- package/templates/nova/tests/cases/components/commerce/Stars.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/commerce/VariantPicker.cases.tsx +38 -0
- package/templates/nova/tests/cases/components/commerce/blocks/Badge.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/commerce/blocks/PaymentIcons.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/commerce/blocks/Swatches.cases.tsx +22 -0
- package/templates/nova/tests/cases/components/content/ArticleCard.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/content/BeforeAfterSlider.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/content/CardRow.cases.tsx +23 -0
- package/templates/nova/tests/cases/components/content/CarouselControls.cases.tsx +48 -0
- package/templates/nova/tests/cases/components/content/ContentsNav.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/content/Countdown.cases.tsx +28 -0
- package/templates/nova/tests/cases/components/content/HeroCopy.cases.tsx +42 -0
- package/templates/nova/tests/cases/components/content/HeroFrame.cases.tsx +22 -0
- package/templates/nova/tests/cases/components/content/HeroMedia.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/content/LongForm.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/content/MediaFrame.cases.tsx +32 -0
- package/templates/nova/tests/cases/components/content/RichText.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/content/SectionHead.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/content/ShareButtons.cases.tsx +24 -0
- package/templates/nova/tests/cases/components/content/StoreCard.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/content/TestimonialCard.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/content/UgcTile.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/content/blocks/Button.cases.tsx +20 -0
- package/templates/nova/tests/cases/components/content/blocks/Column.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/content/blocks/Heading.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/content/blocks/Icon.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/content/blocks/Image.cases.tsx +22 -0
- package/templates/nova/tests/cases/components/content/blocks/Text.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/content/blocks/Video.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/forms/ContactForm.cases.tsx +29 -0
- package/templates/nova/tests/cases/components/forms/FormField.cases.tsx +61 -0
- package/templates/nova/tests/cases/components/forms/NewsletterForm.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/forms/SearchField.cases.tsx +25 -0
- package/templates/nova/tests/cases/components/forms/blocks/Newsletter.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/navigation/BrandLogo.cases.tsx +29 -0
- package/templates/nova/tests/cases/components/navigation/Breadcrumb.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/navigation/LocaleSelector.cases.tsx +32 -0
- package/templates/nova/tests/cases/components/navigation/Menu.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/navigation/Pagination.cases.tsx +25 -0
- package/templates/nova/tests/cases/components/navigation/RecoveryLinks.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/navigation/SocialLinks.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/navigation/blocks/SocialLinks.cases.tsx +17 -0
- package/templates/nova/tests/cases/components/overlays/AccountMenu.cases.tsx +28 -0
- package/templates/nova/tests/cases/components/overlays/CartDrawer.cases.tsx +30 -0
- package/templates/nova/tests/cases/components/overlays/ConfirmationDialog.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/overlays/CookieConsent.cases.tsx +23 -0
- package/templates/nova/tests/cases/components/overlays/CookiePreferences.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/overlays/Drawer.cases.tsx +52 -0
- package/templates/nova/tests/cases/components/overlays/MarketSelector.cases.tsx +82 -0
- package/templates/nova/tests/cases/components/overlays/Menu.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/overlays/MobileNavDrawer.cases.tsx +32 -0
- package/templates/nova/tests/cases/components/overlays/Modal.cases.tsx +71 -0
- package/templates/nova/tests/cases/components/overlays/Popover.cases.tsx +50 -0
- package/templates/nova/tests/cases/components/overlays/PromoPopup.cases.tsx +19 -0
- package/templates/nova/tests/cases/components/overlays/QuickView.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/overlays/SearchModal.cases.tsx +60 -0
- package/templates/nova/tests/cases/components/overlays/Sheet.cases.tsx +32 -0
- package/templates/nova/tests/cases/components/overlays/SizeGuide.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/overlays/Toast.cases.tsx +48 -0
- package/templates/nova/tests/cases/components/overlays/Tooltip.cases.tsx +33 -0
- package/templates/nova/tests/cases/components/states/Alert.cases.tsx +27 -0
- package/templates/nova/tests/cases/components/states/EditorFrame.cases.tsx +36 -0
- package/templates/nova/tests/cases/components/states/Empty.cases.tsx +30 -0
- package/templates/nova/tests/cases/components/states/Error.cases.tsx +38 -0
- package/templates/nova/tests/cases/components/states/Loading.cases.tsx +15 -0
- package/templates/nova/tests/cases/components/states/MediaState.cases.tsx +29 -0
- package/templates/nova/tests/cases/components/states/SkeletonLayout.cases.tsx +20 -0
- package/templates/nova/tests/cases/components/states/Unavailable.cases.tsx +16 -0
- package/templates/nova/tests/cases/components/states/media/MediaError.cases.tsx +18 -0
- package/templates/nova/tests/cases/components/states/media/MediaPlaceholder.cases.tsx +87 -0
- package/templates/nova/tests/cases/sections/Overview.cases.tsx +8 -0
- package/templates/nova/tests/cases/sections/commerce/collection-list/CollectionList.cases.tsx +46 -0
- package/templates/nova/tests/cases/sections/commerce/collection-list/blocks/CollectionItem.cases.tsx +18 -0
- package/templates/nova/tests/cases/sections/commerce/featured-collection/FeaturedCollection.cases.tsx +46 -0
- package/templates/nova/tests/cases/sections/commerce/featured-product/FeaturedProduct.cases.tsx +40 -0
- package/templates/nova/tests/cases/sections/commerce/main-collection/MainCollection.cases.tsx +81 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/ProductDetails.cases.tsx +110 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/AddToCartBlock.cases.tsx +21 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/ProductDescription.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/ProductInventory.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/ProductPrice.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/ProductSku.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/ProductTitle.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/Quantity.cases.tsx +20 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/Tab.cases.tsx +29 -0
- package/templates/nova/tests/cases/sections/commerce/product-details/blocks/VariantPickerBlock.cases.tsx +32 -0
- package/templates/nova/tests/cases/sections/commerce/product-grid/ProductGrid.cases.tsx +48 -0
- package/templates/nova/tests/cases/sections/commerce/product-recommendations/ProductRecommendations.cases.tsx +27 -0
- package/templates/nova/tests/cases/sections/commerce/recently-viewed/RecentlyViewed.cases.tsx +36 -0
- package/templates/nova/tests/cases/sections/content/article-body/ArticleBody.cases.tsx +32 -0
- package/templates/nova/tests/cases/sections/content/before-after/BeforeAfter.cases.tsx +40 -0
- package/templates/nova/tests/cases/sections/content/before-after/blocks/Comparison.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/content/blog-posts/BlogPosts.cases.tsx +47 -0
- package/templates/nova/tests/cases/sections/content/collection-links/CollectionLinks.cases.tsx +36 -0
- package/templates/nova/tests/cases/sections/content/faq/Faq.cases.tsx +38 -0
- package/templates/nova/tests/cases/sections/content/faq/blocks/FaqItem.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/content/feature-grid-blocks/FeatureGridBlocks.cases.tsx +31 -0
- package/templates/nova/tests/cases/sections/content/feature-highlights/FeatureHighlights.cases.tsx +26 -0
- package/templates/nova/tests/cases/sections/content/image-gallery/ImageGallery.cases.tsx +31 -0
- package/templates/nova/tests/cases/sections/content/image-with-text/ImageWithText.cases.tsx +35 -0
- package/templates/nova/tests/cases/sections/content/multicolumn/Multicolumn.cases.tsx +32 -0
- package/templates/nova/tests/cases/sections/content/page-body/PageBody.cases.tsx +31 -0
- package/templates/nova/tests/cases/sections/content/rich-text/RichTextSection.cases.tsx +33 -0
- package/templates/nova/tests/cases/sections/content/team-founders/TeamFounders.cases.tsx +31 -0
- package/templates/nova/tests/cases/sections/content/team-founders/blocks/Person.cases.tsx +18 -0
- package/templates/nova/tests/cases/sections/content/timeline/Timeline.cases.tsx +27 -0
- package/templates/nova/tests/cases/sections/content/timeline/blocks/Step.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/layout/announcement-bar/AnnouncementBar.cases.tsx +119 -0
- package/templates/nova/tests/cases/sections/layout/breadcrumbs/Breadcrumbs.cases.tsx +73 -0
- package/templates/nova/tests/cases/sections/layout/divider/Divider.cases.tsx +81 -0
- package/templates/nova/tests/cases/sections/layout/footer/Footer.cases.tsx +116 -0
- package/templates/nova/tests/cases/sections/layout/footer/blocks/FooterBrand.cases.tsx +27 -0
- package/templates/nova/tests/cases/sections/layout/footer/blocks/FooterMenu.cases.tsx +22 -0
- package/templates/nova/tests/cases/sections/layout/footer/blocks/FooterText.cases.tsx +20 -0
- package/templates/nova/tests/cases/sections/layout/group/Group.cases.tsx +185 -0
- package/templates/nova/tests/cases/sections/layout/group/blocks/Accordion.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/layout/group/blocks/JumboText.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/layout/group/blocks/Spacer.cases.tsx +33 -0
- package/templates/nova/tests/cases/sections/layout/header/Header.cases.tsx +277 -0
- package/templates/nova/tests/cases/sections/marketing/collection-banner/CollectionBanner.cases.tsx +62 -0
- package/templates/nova/tests/cases/sections/marketing/hero/Hero.cases.tsx +138 -0
- package/templates/nova/tests/cases/sections/marketing/marquee/Marquee.cases.tsx +63 -0
- package/templates/nova/tests/cases/sections/marketing/promo-banner/PromoBanner.cases.tsx +87 -0
- package/templates/nova/tests/cases/sections/marketing/slideshow/Slideshow.cases.tsx +113 -0
- package/templates/nova/tests/cases/sections/marketing/slideshow/blocks/Slide.cases.tsx +26 -0
- package/templates/nova/tests/cases/sections/marketing/video-hero/VideoHero.cases.tsx +72 -0
- package/templates/nova/tests/cases/sections/trust/comparison-table/ComparisonTableSection.cases.tsx +42 -0
- package/templates/nova/tests/cases/sections/trust/comparison-table/blocks/CompareItem.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/trust/logo-list/LogoList.cases.tsx +29 -0
- package/templates/nova/tests/cases/sections/trust/logo-list/blocks/Logo.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/trust/product-reviews/ProductReviews.cases.tsx +51 -0
- package/templates/nova/tests/cases/sections/trust/shop-the-look/ShopTheLook.cases.tsx +51 -0
- package/templates/nova/tests/cases/sections/trust/shop-the-look/blocks/Hotspot.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/trust/testimonials/Testimonials.cases.tsx +61 -0
- package/templates/nova/tests/cases/sections/trust/testimonials/blocks/Testimonial.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/trust/trust-badges/TrustBadges.cases.tsx +30 -0
- package/templates/nova/tests/cases/sections/trust/ugc-gallery/UgcGallery.cases.tsx +32 -0
- package/templates/nova/tests/cases/sections/trust/ugc-gallery/blocks/UgcImage.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/utility/account/Account.cases.tsx +44 -0
- package/templates/nova/tests/cases/sections/utility/cart-items/CartItems.cases.tsx +43 -0
- package/templates/nova/tests/cases/sections/utility/cart-items/blocks/CartBadge.cases.tsx +16 -0
- package/templates/nova/tests/cases/sections/utility/contact-form/ContactFormSection.cases.tsx +52 -0
- package/templates/nova/tests/cases/sections/utility/contact-form/blocks/ContactDetail.cases.tsx +17 -0
- package/templates/nova/tests/cases/sections/utility/newsletter/NewsletterSection.cases.tsx +109 -0
- package/templates/nova/tests/cases/sections/utility/not-found/NotFound.cases.tsx +28 -0
- package/templates/nova/tests/cases/sections/utility/policy-page/PolicyPage.cases.tsx +29 -0
- package/templates/nova/tests/cases/sections/utility/search-results/SearchResultsSection.cases.tsx +39 -0
- package/templates/nova/tests/cases/sections/utility/store-locator/StoreLocator.cases.tsx +40 -0
- package/templates/nova/tests/cases/styles/Borders.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/Breakpoints.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/Colors.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/Elevation.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/Icon.cases.tsx +23 -0
- package/templates/nova/tests/cases/styles/Layout.cases.tsx +8 -0
- package/templates/nova/tests/cases/styles/Motion.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/Overview.cases.tsx +8 -0
- package/templates/nova/tests/cases/styles/Radius.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/SharedThemeSettings.cases.tsx +19 -0
- package/templates/nova/tests/cases/styles/Spacing.cases.tsx +10 -0
- package/templates/nova/tests/cases/styles/Typography.cases.tsx +10 -0
- package/templates/nova/tests/cases.test.tsx +38 -0
- package/templates/nova/tests/components/PromoPopup.test.ts +21 -0
- package/templates/nova/tests/components/RichText.test.tsx +65 -0
- package/templates/nova/tests/components/formatDate.test.ts +10 -0
- package/templates/nova/tests/contract-locks.test.ts +23 -0
- package/templates/nova/tests/contracts.test.ts +153 -0
- package/templates/nova/tests/cookie-consent-privacy.test.tsx +128 -0
- package/templates/nova/tests/empty-store.test.tsx +81 -0
- package/templates/nova/tests/fixtures/commerce.ts +128 -0
- package/templates/nova/tests/fixtures/content.ts +58 -0
- package/templates/nova/tests/fixtures/index.ts +8 -0
- package/templates/nova/tests/fixtures/merch.ts +161 -0
- package/templates/nova/tests/fixtures/navigation.ts +125 -0
- package/templates/nova/tests/fixtures/promotion.ts +43 -0
- package/templates/nova/tests/fixtures/sample-store.json +1674 -0
- package/templates/nova/tests/fixtures/shop.ts +88 -0
- package/templates/nova/tests/fixtures/stress.ts +21 -0
- package/templates/nova/tests/inert.test.tsx +285 -0
- package/templates/nova/tests/line-add-friend.test.tsx +108 -0
- package/templates/nova/tests/localized-copy.test.ts +330 -0
- package/templates/nova/tests/product-template-blocks.test.ts +28 -0
- package/templates/nova/tests/rewards-launcher.test.tsx +401 -0
- package/templates/nova/tests/schema.test.ts +65 -0
- package/templates/nova/tests/schema.typetest.ts +7 -0
- package/templates/nova/tests/section-groups.test.ts +189 -0
- package/templates/nova/tests/sections/Group.test.tsx +37 -0
- package/templates/nova/tests/setup.ts +30 -0
- package/templates/nova/tests/starter.test.ts +56 -0
- package/templates/nova/tests/storefront-click-path.test.tsx +157 -0
- package/templates/nova/tests/styles/button-brand.test.ts +24 -0
- package/templates/nova/tests/styles/theme.test.ts +43 -0
- package/templates/nova/tests/styles/tokens.test.ts +35 -0
- package/templates/nova/tests/support/abi-ctx.ts +136 -0
- package/templates/nova/tests/support/block-stories.tsx +13 -0
- package/templates/nova/tests/support/case.tsx +102 -0
- package/templates/nova/tests/support/contracts.ts +30 -0
- package/templates/nova/tests/support/foundation-pages.tsx +260 -0
- package/templates/nova/tests/support/ia-pages.tsx +154 -0
- package/templates/nova/tests/support/listing-demo.tsx +29 -0
- package/templates/nova/tests/support/presets.ts +14 -0
- package/templates/nova/tests/support/sections.ts +36 -0
- package/templates/nova/tests/support/story-content.ts +321 -0
- package/templates/nova/tests/support/story-helpers.tsx +37 -0
- package/templates/nova/tests/support/with-nova.tsx +26 -0
- package/templates/nova/tests/theme-config.test.ts +82 -0
- package/templates/nova/tests/theme-integrity.test.ts +315 -0
- package/templates/nova/theme.config.ts +134 -0
- package/templates/nova/theme.manifest.json +17495 -0
- package/templates/nova/tsconfig.json +19 -0
- package/templates/nova/vite.abi-ssr.config.ts +37 -0
- package/templates/nova/vite.abi.config.ts +26 -0
- package/templates/nova/vitest.config.ts +20 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Content migration for renamed section settings.
|
|
4
|
+
*
|
|
5
|
+
* Renaming an attribute orphans every saved value under the old key — the
|
|
6
|
+
* theme's own templates AND every merchant's customised copy. `k8s.mjs` merges
|
|
7
|
+
* theme updates by path prefix with no content version, so nothing else will
|
|
8
|
+
* carry those values across.
|
|
9
|
+
*
|
|
10
|
+
* This script migrates the theme's shipped templates. Merchant content needs
|
|
11
|
+
* the same map applied at publish time; the RENAMES table below is the record
|
|
12
|
+
* of what changed, and is intentionally append-only.
|
|
13
|
+
*
|
|
14
|
+
* node scripts/migrate-content.mjs [--dry]
|
|
15
|
+
*/
|
|
16
|
+
import { readdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
17
|
+
import { join, dirname } from 'node:path'
|
|
18
|
+
import { fileURLToPath } from 'node:url'
|
|
19
|
+
|
|
20
|
+
// The theme: the directory the command runs in.
|
|
21
|
+
const ROOT = process.cwd()
|
|
22
|
+
const DRY = process.argv.includes('--dry')
|
|
23
|
+
|
|
24
|
+
/** section/block type → { oldKey: newKey | [newKey, transform] } */
|
|
25
|
+
const RENAMES = {
|
|
26
|
+
// 2026-09-18 — design conversion: semantic presets replace raw values.
|
|
27
|
+
slideshow: {
|
|
28
|
+
size: 'slideHeight',
|
|
29
|
+
intervalMs: ['interval', (ms) => (ms <= 4000 ? '4s' : ms >= 8000 ? '8s' : '6s')],
|
|
30
|
+
showDots: ['controls', (on) => (on ? 'arrows+counter' : 'none')],
|
|
31
|
+
},
|
|
32
|
+
divider: {
|
|
33
|
+
height: ['spacing', (px) => (px <= 16 ? 'sm' : px <= 48 ? 'md' : px <= 96 ? 'lg' : 'xl')],
|
|
34
|
+
showLine: ['style', (on) => (on ? 'line-subtle' : 'space')],
|
|
35
|
+
color: null, // dropped: raw colour is not a design control
|
|
36
|
+
},
|
|
37
|
+
group: {
|
|
38
|
+
gap: ['innerGap', (px) => (px <= 12 ? 'small' : px <= 24 ? 'medium' : 'large')],
|
|
39
|
+
},
|
|
40
|
+
'featured-collection': {
|
|
41
|
+
limit: ['productsToShow', (n) => Math.max(2, Math.min(12, Number(n) || 4))],
|
|
42
|
+
},
|
|
43
|
+
'main-collection': {
|
|
44
|
+
limit: ['productsPerPage', (n) => String([12, 24, 48].includes(Number(n)) ? n : 24)],
|
|
45
|
+
},
|
|
46
|
+
'rich-text': {
|
|
47
|
+
align: 'contentAlignment',
|
|
48
|
+
},
|
|
49
|
+
'image-with-text': {
|
|
50
|
+
imageRight: ['mediaPosition', (on) => (on ? 'right' : 'left')],
|
|
51
|
+
},
|
|
52
|
+
'contact-form': {
|
|
53
|
+
showPhone: ['fields', (on) => (on ? 'name,email,phone,message' : 'name,email,message')],
|
|
54
|
+
},
|
|
55
|
+
marquee: {
|
|
56
|
+
speed: ['speed', (v) => (typeof v === 'number' ? (v >= 34 ? 'slow' : v <= 16 ? 'fast' : 'standard') : v)],
|
|
57
|
+
bg: ['background', (hex) => (String(hex).toLowerCase() === '#ffffff' ? 'surface' : 'primary')],
|
|
58
|
+
fg: null,
|
|
59
|
+
},
|
|
60
|
+
newsletter: {
|
|
61
|
+
inverse: ['background', (on) => (on ? 'primary' : 'surface-secondary')],
|
|
62
|
+
},
|
|
63
|
+
'feature-highlights': {
|
|
64
|
+
textAlign: 'textAlignment',
|
|
65
|
+
background: ['background', (v) => (typeof v === 'string' && v.startsWith('#') ? 'surface' : v || 'surface')],
|
|
66
|
+
},
|
|
67
|
+
'announcement-bar': {
|
|
68
|
+
bg: ['background', (hex) => (String(hex).toLowerCase() === '#ffffff' ? 'surface-secondary' : 'primary')],
|
|
69
|
+
fg: null,
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Global theme settings whose VALUE vocabulary changed, not their key.
|
|
75
|
+
* `config/settings.json` and every merchant's copy hold the old word, and a
|
|
76
|
+
* value that is no longer in the select silently falls back to the default —
|
|
77
|
+
* so a merchant who chose "Bold" icons would land on the theme default with no
|
|
78
|
+
* warning. Append-only, same as RENAMES.
|
|
79
|
+
*/
|
|
80
|
+
const VALUE_RENAMES = {
|
|
81
|
+
// 2026-09-20 — realigned onto the approved design package (06 Configuration
|
|
82
|
+
// System), which the theme had drifted from on both axis and vocabulary.
|
|
83
|
+
typeScale: { standard: 'default', spacious: 'large' },
|
|
84
|
+
buttonTextStyle: { sentence: 'default' },
|
|
85
|
+
// badgeStyle was a SHAPE (square|pill); the design's axis is fill.
|
|
86
|
+
badgeStyle: { square: 'filled', pill: 'filled' },
|
|
87
|
+
// iconStyle was a WEIGHT (light|regular|bold); the design's axis is family.
|
|
88
|
+
iconStyle: { light: 'outline', regular: 'outline', bold: 'filled' },
|
|
89
|
+
cardHoverEffect: { zoom: 'image-swap', border: 'image-swap' },
|
|
90
|
+
motion: { none: 'reduced', subtle: 'standard' },
|
|
91
|
+
productImageRatio: { tall: 'landscape' },
|
|
92
|
+
// buttonBorder became a role rather than an on/off.
|
|
93
|
+
buttonBorder: { true: 'default', false: 'default' },
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let changed = 0
|
|
97
|
+
const log = []
|
|
98
|
+
|
|
99
|
+
function migrateNode(node) {
|
|
100
|
+
const map = RENAMES[node.type]
|
|
101
|
+
if (map && node.settings) {
|
|
102
|
+
for (const [oldKey, target] of Object.entries(map)) {
|
|
103
|
+
if (!(oldKey in node.settings)) continue
|
|
104
|
+
const value = node.settings[oldKey]
|
|
105
|
+
// A same-key entry is a VALUE rename. Once the value is already the new
|
|
106
|
+
// one there is nothing to do — counting it made every run report work.
|
|
107
|
+
if (Array.isArray(target) && target[0] === oldKey && JSON.stringify(target[1](value)) === JSON.stringify(value)) continue
|
|
108
|
+
delete node.settings[oldKey]
|
|
109
|
+
changed += 1
|
|
110
|
+
if (target === null) {
|
|
111
|
+
log.push(` ${node.type}.${oldKey} dropped (was ${JSON.stringify(value)})`)
|
|
112
|
+
continue
|
|
113
|
+
}
|
|
114
|
+
const [newKey, transform] = Array.isArray(target) ? target : [target, (v) => v]
|
|
115
|
+
// Never clobber a value the merchant already set under the new name.
|
|
116
|
+
if (node.settings[newKey] === undefined) node.settings[newKey] = transform(value)
|
|
117
|
+
log.push(` ${node.type}.${oldKey} → ${newKey} = ${JSON.stringify(node.settings[newKey])}`)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (const child of node.blocks ?? []) migrateNode(child)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const dir = join(ROOT, 'templates')
|
|
124
|
+
for (const file of readdirSync(dir).filter((f) => f.endsWith('.json'))) {
|
|
125
|
+
const path = join(dir, file)
|
|
126
|
+
const before = readFileSync(path, 'utf8')
|
|
127
|
+
const doc = JSON.parse(before)
|
|
128
|
+
const start = changed
|
|
129
|
+
for (const s of doc.sections ?? []) migrateNode(s)
|
|
130
|
+
if (changed > start && !DRY) writeFileSync(path, `${JSON.stringify(doc, null, 2)}\n`)
|
|
131
|
+
if (changed > start) console.log(`${file}:`)
|
|
132
|
+
}
|
|
133
|
+
// ── Global theme settings ───────────────────────────────────────────────────
|
|
134
|
+
/**
|
|
135
|
+
* Global settings whose KEY changed. The schema follows the approved design
|
|
136
|
+
* package's names; these are the names an earlier build saved under.
|
|
137
|
+
* app/platform/safe-values.ts still reads the old key as a fallback, so a store that
|
|
138
|
+
* has not been migrated keeps its colours and fonts. Append-only.
|
|
139
|
+
*/
|
|
140
|
+
const SETTING_KEY_RENAMES = {
|
|
141
|
+
colorBrand: 'colorPrimary',
|
|
142
|
+
fontHeading: 'headingFont',
|
|
143
|
+
fontBody: 'bodyFont',
|
|
144
|
+
}
|
|
145
|
+
const settingsPath = join(ROOT, 'config', 'settings.json')
|
|
146
|
+
const settings = JSON.parse(readFileSync(settingsPath, 'utf8'))
|
|
147
|
+
const settingsStart = changed
|
|
148
|
+
for (const [oldKey, newKey] of Object.entries(SETTING_KEY_RENAMES)) {
|
|
149
|
+
if (!(oldKey in settings)) continue
|
|
150
|
+
const value = settings[oldKey]
|
|
151
|
+
delete settings[oldKey]
|
|
152
|
+
// A value already saved under the new name wins; an empty one does not.
|
|
153
|
+
if (settings[newKey] === undefined || settings[newKey] === '') settings[newKey] = value
|
|
154
|
+
log.push(` settings.${oldKey} → ${newKey} = ${JSON.stringify(settings[newKey])}`)
|
|
155
|
+
changed += 1
|
|
156
|
+
}
|
|
157
|
+
for (const [key, map] of Object.entries(VALUE_RENAMES)) {
|
|
158
|
+
if (!(key in settings)) continue
|
|
159
|
+
const next = map[String(settings[key])]
|
|
160
|
+
if (next === undefined) continue
|
|
161
|
+
log.push(` settings.${key}: ${JSON.stringify(settings[key])} → ${JSON.stringify(next)}`)
|
|
162
|
+
settings[key] = next
|
|
163
|
+
changed += 1
|
|
164
|
+
}
|
|
165
|
+
if (changed > settingsStart) {
|
|
166
|
+
console.log('config/settings.json:')
|
|
167
|
+
if (!DRY) writeFileSync(settingsPath, `${JSON.stringify(settings, null, 2)}\n`)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
console.log(log.join('\n'))
|
|
171
|
+
console.log(changed === 0 ? '✓ no orphaned settings' : `${DRY ? 'would migrate' : '✓ migrated'} ${changed} setting(s)`)
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Move the per-template header/footer copies into shared groups.
|
|
4
|
+
*
|
|
5
|
+
* node scripts/migrate-groups.mjs # migrate, print the report
|
|
6
|
+
* node scripts/migrate-groups.mjs --check # exit 1 if a run would change anything
|
|
7
|
+
* node scripts/migrate-groups.mjs --dry # report only, write nothing
|
|
8
|
+
* node scripts/migrate-groups.mjs --inline # ROLLBACK: fold the groups back into every template
|
|
9
|
+
*
|
|
10
|
+
* Before: 17 of 18 templates carried their own copy of the header and footer,
|
|
11
|
+
* so "edit the header" meant editing one page. After: `groups/header.json` and
|
|
12
|
+
* `groups/footer.json` are the single source of truth, templates reference
|
|
13
|
+
* them, and a page that is deliberately different keeps its own copy as an
|
|
14
|
+
* explicit `override` — printed here, never merged away.
|
|
15
|
+
*
|
|
16
|
+
* The logic is the kit contract's `extractGroups`, which the studio-api
|
|
17
|
+
* migration path calls too. This file only reads the theme, feeds the section
|
|
18
|
+
* defaults (so `{}` and `{ sticky: 'always' }` compare equal), writes what
|
|
19
|
+
* comes back, and prints the report. Idempotent: `--check` on a migrated theme
|
|
20
|
+
* passes, which is what CI runs.
|
|
21
|
+
*/
|
|
22
|
+
import { readFileSync, writeFileSync, readdirSync, mkdirSync, existsSync } from 'node:fs'
|
|
23
|
+
import { join, dirname } from 'node:path'
|
|
24
|
+
import { fileURLToPath } from 'node:url'
|
|
25
|
+
import { spawnSync } from 'node:child_process'
|
|
26
|
+
|
|
27
|
+
// The contract is the theme's own TypeScript (app/platform/tanqory/contract). A plain
|
|
28
|
+
// `node scripts/migrate-groups.mjs` re-executes itself with type stripping on
|
|
29
|
+
// so callers (tests, CI, a developer) need no flag.
|
|
30
|
+
if (!process.execArgv.some((a) => a.includes('strip-types')) && !process.features?.typescript) {
|
|
31
|
+
const r = spawnSync(process.execPath, ['--experimental-strip-types', '--no-warnings', ...process.argv.slice(1)], { stdio: 'inherit' })
|
|
32
|
+
process.exit(r.status ?? 1)
|
|
33
|
+
}
|
|
34
|
+
const { extractGroups, resolvePage } = await import('@tanqory/theme-kit/contract')
|
|
35
|
+
|
|
36
|
+
// The theme: the directory the command runs in.
|
|
37
|
+
const ROOT = process.cwd()
|
|
38
|
+
const TEMPLATES = join(ROOT, 'templates')
|
|
39
|
+
const GROUPS = join(ROOT, 'groups')
|
|
40
|
+
const CHECK = process.argv.includes('--check')
|
|
41
|
+
const DRY = process.argv.includes('--dry')
|
|
42
|
+
const INLINE = process.argv.includes('--inline')
|
|
43
|
+
|
|
44
|
+
const read = (p) => JSON.parse(readFileSync(p, 'utf8'))
|
|
45
|
+
const stringify = (o) => JSON.stringify(o, null, 2) + '\n'
|
|
46
|
+
|
|
47
|
+
// Attribute defaults per section type, from the generated manifest — the same
|
|
48
|
+
// source the runtime applies at render, so the comparison is what a shopper sees.
|
|
49
|
+
const manifest = read(join(ROOT, 'theme.manifest.json'))
|
|
50
|
+
const defaults = {}
|
|
51
|
+
for (const s of manifest.sections) {
|
|
52
|
+
defaults[s.name] = {}
|
|
53
|
+
for (const [k, spec] of Object.entries(s.attributes ?? {})) {
|
|
54
|
+
if (spec?.default !== undefined) defaults[s.name][k] = spec.default
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const templates = {}
|
|
59
|
+
for (const f of readdirSync(TEMPLATES).filter((x) => x.endsWith('.json')).sort()) {
|
|
60
|
+
templates[f.replace(/\.json$/, '')] = read(join(TEMPLATES, f))
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ── rollback: groups → inline copies (content version 1) ──────────────────
|
|
64
|
+
// The exact inverse of the migration, through the same resolver the runtime
|
|
65
|
+
// uses: every template gets the header/footer it currently RENDERS written
|
|
66
|
+
// back as inline `area` nodes, the `groups` binding and `contentVersion` are
|
|
67
|
+
// dropped, and groups/ is left in place (harmless to a v1 reader; delete it
|
|
68
|
+
// by hand once nothing references it). Running the migration again afterwards
|
|
69
|
+
// reproduces the bindings, so this is a round trip, not a one-way door.
|
|
70
|
+
if (INLINE) {
|
|
71
|
+
const groupDocs = {}
|
|
72
|
+
if (existsSync(GROUPS)) {
|
|
73
|
+
for (const f of readdirSync(GROUPS).filter((x) => x.endsWith('.json'))) groupDocs[f.replace(/\.json$/, '')] = read(join(GROUPS, f))
|
|
74
|
+
}
|
|
75
|
+
let n = 0
|
|
76
|
+
for (const [slug, doc] of Object.entries(templates)) {
|
|
77
|
+
if (!doc.groups && doc.contentVersion === undefined) continue
|
|
78
|
+
const r = resolvePage(doc, groupDocs)
|
|
79
|
+
if (r.missingGroups.length) { console.error(`✗ ${slug}: binds missing group(s) ${r.missingGroups.join(', ')} — nothing written`); process.exit(1) }
|
|
80
|
+
const { groups: _g, contentVersion: _v, ...rest } = doc
|
|
81
|
+
const inlined = { ...rest, sections: r.sections.map(({ area, ...node }) => (area && area !== 'template' ? { ...node, area } : node)) }
|
|
82
|
+
if (DRY) { console.log(`would inline ${slug} (${r.sections.length} sections)`); continue }
|
|
83
|
+
writeFileSync(join(TEMPLATES, `${slug}.json`), stringify(inlined))
|
|
84
|
+
n++
|
|
85
|
+
}
|
|
86
|
+
console.log(DRY ? '(dry run — nothing written)' : `✓ folded the shared groups back into ${n} template(s); groups/ left in place`)
|
|
87
|
+
process.exit(0)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const { groups, templates: next, report, noop } = extractGroups(templates, { defaults })
|
|
91
|
+
|
|
92
|
+
// ── report ────────────────────────────────────────────────────────────────
|
|
93
|
+
for (const r of report) {
|
|
94
|
+
console.log(`\n${r.slot.toUpperCase()} → groups/${r.group}.json`)
|
|
95
|
+
if (r.alreadyBound.length) console.log(` already bound (${r.alreadyBound.length}): ${r.alreadyBound.join(', ')}`)
|
|
96
|
+
if (r.canonical.templates.length) console.log(` shared by (${r.canonical.templates.length}): ${r.canonical.templates.join(', ')}`)
|
|
97
|
+
for (const o of r.overrides) {
|
|
98
|
+
console.log(` ⚠ ${o.template} DIFFERS — kept as an explicit override:`)
|
|
99
|
+
for (const d of o.differences) console.log(` ${d}`)
|
|
100
|
+
}
|
|
101
|
+
for (const m of r.idRemaps) console.log(` ↻ ${m.template}: id ${m.from} → ${m.to} (same content, takes the group's id)`)
|
|
102
|
+
if (r.empty.length) console.log(` ∅ no ${r.slot} at all: ${r.empty.join(', ')}`)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (CHECK) {
|
|
106
|
+
// A bound template whose group file is missing renders without its chrome.
|
|
107
|
+
// `extractGroups` has nothing to migrate in that state, so check it here.
|
|
108
|
+
const dangling = []
|
|
109
|
+
for (const [slug, doc] of Object.entries(templates)) {
|
|
110
|
+
for (const [slot, v] of Object.entries(doc.groups ?? {})) {
|
|
111
|
+
const name = typeof v === 'string' ? v : v && typeof v === 'object' && 'ref' in v ? v.ref : null
|
|
112
|
+
if (name && !existsSync(join(GROUPS, `${name}.json`))) dangling.push(`${slug}.${slot} → groups/${name}.json`)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (dangling.length) {
|
|
116
|
+
console.error(`\n✗ template(s) bind a group that does not exist:\n ${dangling.join('\n ')}`)
|
|
117
|
+
process.exit(1)
|
|
118
|
+
}
|
|
119
|
+
if (noop) {
|
|
120
|
+
console.log('\n✓ groups are up to date — a migration run would change nothing')
|
|
121
|
+
process.exit(0)
|
|
122
|
+
}
|
|
123
|
+
console.error('\n✗ templates still carry inline header/footer copies. Run `node scripts/migrate-groups.mjs`.')
|
|
124
|
+
process.exit(1)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (noop) {
|
|
128
|
+
console.log('\n✓ nothing to migrate')
|
|
129
|
+
process.exit(0)
|
|
130
|
+
}
|
|
131
|
+
if (DRY) {
|
|
132
|
+
console.log('\n(dry run — nothing written)')
|
|
133
|
+
process.exit(0)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// ── write ─────────────────────────────────────────────────────────────────
|
|
137
|
+
mkdirSync(GROUPS, { recursive: true })
|
|
138
|
+
for (const g of Object.values(groups)) {
|
|
139
|
+
const file = join(GROUPS, `${g.name}.json`)
|
|
140
|
+
if (existsSync(file)) {
|
|
141
|
+
// A re-run with a new canonical would overwrite a group somebody edited.
|
|
142
|
+
// extractGroups only produces a group when inline copies still exist, so
|
|
143
|
+
// reaching here means a template was un-migrated by hand; refuse rather
|
|
144
|
+
// than clobber.
|
|
145
|
+
console.error(`✗ ${file} already exists — will not overwrite a shared group. Bind the template by hand.`)
|
|
146
|
+
process.exit(1)
|
|
147
|
+
}
|
|
148
|
+
writeFileSync(file, stringify({ type: g.doc.type, name: g.name[0].toUpperCase() + g.name.slice(1), sections: g.doc.sections }))
|
|
149
|
+
console.log(`\n✓ wrote groups/${g.name}.json`)
|
|
150
|
+
}
|
|
151
|
+
let rewritten = 0
|
|
152
|
+
for (const [slug, doc] of Object.entries(next)) {
|
|
153
|
+
const before = stringify(templates[slug])
|
|
154
|
+
const after = stringify({ contentVersion: 2, ...doc })
|
|
155
|
+
if (before === after) continue
|
|
156
|
+
writeFileSync(join(TEMPLATES, `${slug}.json`), after)
|
|
157
|
+
rewritten++
|
|
158
|
+
}
|
|
159
|
+
console.log(`✓ rewrote ${rewritten} template(s)`)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tests/support/case for the parity page: the same types and helpers, without vitest or the
|
|
3
|
+
* testing library (the parity page never runs a `play`).
|
|
4
|
+
*/
|
|
5
|
+
export type { Meta, StoryObj, CaseModule, CaseContext, Decorator, NovaParams } from '../../tests/support/case'
|
|
6
|
+
|
|
7
|
+
const noop = (..._a: unknown[]) => undefined
|
|
8
|
+
export const fn = <T extends (...a: never[]) => unknown>(impl?: T) => (impl ?? noop) as T
|
|
9
|
+
export const expect = noop
|
|
10
|
+
export const within = noop
|
|
11
|
+
export const waitFor = noop
|
|
12
|
+
export const screen = {}
|
|
13
|
+
export const fireEvent = {}
|
|
14
|
+
export const userEvent = {}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parity pages' content and data for the ABI host, derived from the same stories:
|
|
3
|
+
*
|
|
4
|
+
* npx vite-node --config scripts/parity/vite.config.ts scripts/parity/emit.ts -- <outDir>
|
|
5
|
+
*
|
|
6
|
+
* writes <outDir>/wire/*.json recorded wire answers (the local host's `--data`), the story fixtures
|
|
7
|
+
* converted to Theme ABI records (the inverse of @tanqory/theme-kit abi/convert.ts +
|
|
8
|
+
* runtime/data/to-ui.ts)
|
|
9
|
+
* <outDir>/content.json a ContentRevision whose section settings are the stories' args
|
|
10
|
+
* <outDir>/cart.json the cart story's lines as ABI cart lines (the local host's `--cart`)
|
|
11
|
+
*/
|
|
12
|
+
import { mkdirSync, writeFileSync } from 'node:fs'
|
|
13
|
+
import { join } from 'node:path'
|
|
14
|
+
import type { Collection, NovaImage, NovaMenu, NovaMenuItem, Product, Article } from '@tanqory/theme-kit'
|
|
15
|
+
import { sectionRegistry } from '../../tests/support/sections'
|
|
16
|
+
import * as fx from '../../tests/fixtures/index'
|
|
17
|
+
import * as sc from '../../tests/support/story-content'
|
|
18
|
+
import { FOOTER, HEADER, PAGES, argsOf, type Entry } from './pages'
|
|
19
|
+
|
|
20
|
+
const out = process.argv.slice(2).filter((a) => a !== '--')[0]
|
|
21
|
+
if (!out) throw new Error('usage: emit.ts <outDir>')
|
|
22
|
+
const wireDir = join(out, 'wire')
|
|
23
|
+
mkdirSync(wireDir, { recursive: true })
|
|
24
|
+
|
|
25
|
+
// ── the local host's file naming (scripts/abi/local-host.mjs fileOf) ───────────────────────────
|
|
26
|
+
const canon = (v: unknown): string =>
|
|
27
|
+
v === null || typeof v !== 'object' ? JSON.stringify(v) : Array.isArray(v) ? `[${v.map(canon).join(',')}]` : `{${Object.keys(v as object).sort().map((k) => `${JSON.stringify(k)}:${canon((v as Record<string, unknown>)[k])}`).join(',')}}`
|
|
28
|
+
const b64 = (s: string) => Buffer.from(s).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
|
|
29
|
+
const put = (op: string, args: unknown[], data: unknown) =>
|
|
30
|
+
writeFileSync(join(wireDir, `${op}${args.length ? '-' + b64(canon(args)) : ''}.json`.replace(/[^A-Za-z0-9._-]/g, '_')), JSON.stringify({ ok: true, data, dataVersion: 'parity' }))
|
|
31
|
+
|
|
32
|
+
// ── UI fixtures → ABI records ──────────────────────────────────────────────────────────────────
|
|
33
|
+
const money = (m: { amount: number; currencyCode: string }) => ({ amount: m.amount.toFixed(m.currencyCode === 'JPY' ? 0 : 2), currencyCode: m.currencyCode })
|
|
34
|
+
const img = (i: NovaImage | null | undefined) => (i ? { url: i.src, ...(i.alt ? { altText: i.alt } : {}), ...(i.width ? { width: i.width } : {}), ...(i.height ? { height: i.height } : {}) } : null)
|
|
35
|
+
const conn = <T>(nodes: T[], totalCount = nodes.length) => ({ nodes, pageInfo: { hasNextPage: false, endCursor: null }, totalCount })
|
|
36
|
+
const seo = { title: null, description: null }
|
|
37
|
+
|
|
38
|
+
function product(p: Product) {
|
|
39
|
+
// A card fixture may state a price range its variants do not carry (the board is "From $74",
|
|
40
|
+
// every variant $74): the platform derives the range from the variants, so give the top one the max.
|
|
41
|
+
const variants = p.variants.map((v) => ({ ...v }))
|
|
42
|
+
const top = Math.max(...variants.map((v) => v.price.amount))
|
|
43
|
+
if (variants.length > 1 && p.priceRange.max.amount > top) variants[variants.length - 1].price = { ...p.priceRange.max }
|
|
44
|
+
return {
|
|
45
|
+
id: p.id, handle: p.handle, title: p.title,
|
|
46
|
+
descriptionHtml: p.descriptionHtml ?? (p.description ? `<p>${p.description}</p>` : ''),
|
|
47
|
+
vendor: p.vendor ?? '', productType: p.productType ?? '', tags: [...(p.tags ?? [])],
|
|
48
|
+
availableForSale: p.available,
|
|
49
|
+
featuredImage: img(p.featuredImage), images: p.images.map(img).filter(Boolean),
|
|
50
|
+
options: p.options.map((o) => ({ name: o.name, values: [...o.values] })),
|
|
51
|
+
variants: conn(variants.map((v) => ({
|
|
52
|
+
id: v.id, title: v.title, sku: v.sku ?? null, availableForSale: v.available,
|
|
53
|
+
price: money(v.price), compareAtPrice: v.compareAtPrice ? money(v.compareAtPrice) : null,
|
|
54
|
+
selectedOptions: v.selectedOptions.map((o) => ({ name: o.name, value: o.value })), image: null,
|
|
55
|
+
// As the platform sends it with data:inventory and stock levels shown (0–999, 999 = "999 or more").
|
|
56
|
+
...(typeof v.quantityAvailable === 'number' ? { quantityAvailable: Math.min(999, Math.max(0, Math.floor(v.quantityAvailable))) } : {}),
|
|
57
|
+
}))),
|
|
58
|
+
priceRange: { minVariantPrice: money(p.priceRange.min), maxVariantPrice: money(p.priceRange.max) },
|
|
59
|
+
...(p.compareAtPriceRange ? { compareAtPriceRange: { minVariantPrice: money(p.compareAtPriceRange.min), maxVariantPrice: money(p.compareAtPriceRange.max) } } : {}),
|
|
60
|
+
seo, templateSuffix: null,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function collection(c: Collection, products = c.products ?? []) {
|
|
64
|
+
return {
|
|
65
|
+
id: c.id, handle: c.handle, title: c.title, descriptionHtml: c.description ? `<p>${c.description}</p>` : '',
|
|
66
|
+
image: img(c.image), products: conn(products.map(product), c.productsCount), seo, templateSuffix: null,
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
let itemSeq = 0
|
|
70
|
+
const menuItem = (i: NovaMenuItem): unknown => ({ id: `mi-${++itemSeq}`, title: i.title, url: i.url ?? '/', type: 'HTTP', items: (i.items ?? []).map(menuItem) })
|
|
71
|
+
const menu = (m: NovaMenu) => ({ handle: m.handle, title: m.title, items: m.items.map(menuItem) })
|
|
72
|
+
const article = (a: Article) => ({
|
|
73
|
+
id: a.id, handle: a.handle, title: a.title, excerpt: a.excerpt ?? null, contentHtml: (a as { contentHtml?: string }).contentHtml ?? '',
|
|
74
|
+
image: img(a.image), author: a.author ? { name: a.author } : null, publishedAt: a.publishedAt, tags: [...(a.tags ?? [])],
|
|
75
|
+
blog: { handle: a.blogHandle ?? 'journal' }, seo,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// ── shop + menus ───────────────────────────────────────────────────────────────────────────────
|
|
79
|
+
// The platform only serves https/http image URLs for the brand logo (safe-values normalizeImageUrl
|
|
80
|
+
// drops a data: URL), so the logo is written out and served by `MEDIA` (a static server on the host).
|
|
81
|
+
const MEDIA = process.env.PARITY_MEDIA ?? 'http://localhost:4411'
|
|
82
|
+
mkdirSync(join(out, 'media'), { recursive: true })
|
|
83
|
+
const shop = fx.shopWithLogo
|
|
84
|
+
writeFileSync(join(out, 'media', 'logo.svg'), decodeURIComponent(shop.logo!.src.replace(/^data:image\/svg\+xml;charset=utf-8,/, '')))
|
|
85
|
+
put('shop.get', [], {
|
|
86
|
+
name: shop.name, description: null, primaryDomain: { url: '' },
|
|
87
|
+
paymentSettings: { currencyCode: 'USD', enabledPresentmentCurrencies: ['USD'] },
|
|
88
|
+
shipsToCountries: ['TH', 'JP', 'SG', 'GB', 'US'],
|
|
89
|
+
brand: { logo: { ...img(shop.logo), url: `${MEDIA}/logo.svg` } },
|
|
90
|
+
})
|
|
91
|
+
const menus = [fx.mainMenu, fx.footerShop, fx.footerHelp, fx.footerCompany, fx.legalMenu]
|
|
92
|
+
put('shop.menus', [], menus.map(menu))
|
|
93
|
+
|
|
94
|
+
// ── catalog ────────────────────────────────────────────────────────────────────────────────────
|
|
95
|
+
// The collection page lists the listing story's 21 products; its first four are the featured row's.
|
|
96
|
+
const kitchen = { ...fx.merchRooms[0], products: fx.merchListing }
|
|
97
|
+
const collections = [kitchen, ...fx.merchRooms.slice(1), sc.storeNewSeason]
|
|
98
|
+
for (const c of collections) put('catalog.collection', [c.handle, { productsFirst: 24 }], collection(c))
|
|
99
|
+
put('catalog.collections', [{ first: 50 }], conn(collections.map((c) => collection(c, []))))
|
|
100
|
+
const allProducts = new Map<string, Product>()
|
|
101
|
+
for (const p of [...fx.merchProducts, ...fx.merchListing, fx.merchThrow, fx.merchDuvetBlend, fx.merchDuvetPercale, fx.merchSimple, ...sc.storeSearch.products]) allProducts.set(p.handle, p)
|
|
102
|
+
for (const p of allProducts.values()) put('catalog.product', [p.handle], product(p))
|
|
103
|
+
const recs = (argsOf(PAGES.find((p) => p.name === 'product')!.sections.find((s) => s.type === 'product-recommendations')!).products as Product[]).map(product)
|
|
104
|
+
for (const n of [4, 8]) put('catalog.recommendations', [fx.merchDuvet.handle, 'related', n], recs)
|
|
105
|
+
|
|
106
|
+
// ── search (the server's first page and the browser's) ─────────────────────────────────────────
|
|
107
|
+
const s = sc.storeSearch
|
|
108
|
+
const searchResult = {
|
|
109
|
+
query: s.query,
|
|
110
|
+
products: conn(s.products.map(product)),
|
|
111
|
+
pages: conn(s.pages.map((p, i) => ({ id: `page-${i}`, handle: p.url.split('/').pop(), title: p.title, body: `<p>${p.excerpt ?? ''}</p>`, seo }))),
|
|
112
|
+
articles: conn(s.articles.map(article)),
|
|
113
|
+
collections: conn([]),
|
|
114
|
+
}
|
|
115
|
+
for (const first of [24, 48]) put('catalog.search', [{ query: 'linen', first, types: ['product', 'page', 'article'] }], searchResult)
|
|
116
|
+
|
|
117
|
+
// ── the size guide page (product-details sizeGuidePage) ────────────────────────────────────────
|
|
118
|
+
const pd = argsOf(PAGES.find((p) => p.name === 'product')!.sections.find((x) => x.type === 'product-details')!)
|
|
119
|
+
const guide = pd.sizeGuide as { title: string; html: string }
|
|
120
|
+
put('content.page', ['size-guide'], { id: 'page-size-guide', handle: 'size-guide', title: guide.title, body: guide.html, seo })
|
|
121
|
+
|
|
122
|
+
// ── the cart story's lines ─────────────────────────────────────────────────────────────────────
|
|
123
|
+
const cartArgs = argsOf(PAGES.find((p) => p.name === 'cart')!.sections[0])
|
|
124
|
+
const cartLines = (cartArgs.cart as typeof sc.storeCart).lines.map((l, i) => {
|
|
125
|
+
const full = allProducts.get(l.product.handle) ?? fx.merchCandle
|
|
126
|
+
return {
|
|
127
|
+
id: `line-${i + 1}`, quantity: l.quantity, attributes: {},
|
|
128
|
+
merchandise: {
|
|
129
|
+
id: l.variant.id, title: l.variant.title, sku: l.variant.sku ?? null, availableForSale: l.variant.available,
|
|
130
|
+
price: money(l.variant.price), compareAtPrice: l.variant.compareAtPrice ? money(l.variant.compareAtPrice) : null, image: img(l.variant.image ?? full.featuredImage),
|
|
131
|
+
product: { id: full.id, handle: l.product.handle, title: l.product.title, featuredImage: img(full.featuredImage) },
|
|
132
|
+
selectedOptions: l.variant.selectedOptions,
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
writeFileSync(join(out, 'cart.json'), JSON.stringify(cartLines, null, 1))
|
|
137
|
+
|
|
138
|
+
// ── content: each story's args → a node ────────────────────────────────────────────────────────
|
|
139
|
+
type Node = { type: string; id: string; settings: Record<string, unknown>; blocks?: Node[] }
|
|
140
|
+
const handleOf = (v: unknown): string | undefined => {
|
|
141
|
+
if (typeof v === 'string') return v
|
|
142
|
+
if (v && typeof v === 'object') {
|
|
143
|
+
const o = v as { handle?: string; src?: string }
|
|
144
|
+
return o.handle ?? o.src
|
|
145
|
+
}
|
|
146
|
+
return undefined
|
|
147
|
+
}
|
|
148
|
+
/** Settings the schema declares: prop fields as given, adapter fields (resources) as their handle / URL. */
|
|
149
|
+
function settingsOf(type: string, args: Record<string, unknown>, fieldsOf = sectionRegistry[type]?.schema.fields): Record<string, unknown> {
|
|
150
|
+
const outS: Record<string, unknown> = {}
|
|
151
|
+
for (const [k, f] of Object.entries(fieldsOf ?? {})) {
|
|
152
|
+
// "not set" is an absent key (Theme ABI v2)
|
|
153
|
+
if (!(k in args) || args[k] === undefined || args[k] === null || args[k] === '') continue
|
|
154
|
+
if ((f as { binding: string }).binding === 'adapter') {
|
|
155
|
+
const h = handleOf(args[k])
|
|
156
|
+
if (h) outS[k] = h
|
|
157
|
+
} else outS[k] = args[k]
|
|
158
|
+
}
|
|
159
|
+
return outS
|
|
160
|
+
}
|
|
161
|
+
const blockFields = (section: string, block: string) => sectionRegistry[section].blockSchemas.find((b) => b.name === block)?.fields
|
|
162
|
+
let blockSeq = 0
|
|
163
|
+
const block = (type: string, settings: Record<string, unknown>): Node => ({ type, id: `b${++blockSeq}`, settings })
|
|
164
|
+
function blocksOf(e: Entry, args: Record<string, unknown>): Node[] | undefined {
|
|
165
|
+
switch (e.type) {
|
|
166
|
+
case 'footer':
|
|
167
|
+
return (args.blocks as { type: string; settings?: Record<string, unknown>; menu?: NovaMenu }[]).map((b) =>
|
|
168
|
+
block(b.type, { ...(b.settings ?? {}), ...(b.menu ? { menu: b.menu.handle } : {}) }))
|
|
169
|
+
case 'collection-list':
|
|
170
|
+
return (args.items as { settings: Record<string, unknown>; collection: Collection }[]).map((i) =>
|
|
171
|
+
block('collection-item', { ...settingsOf('', i.settings, blockFields('collection-list', 'collection-item')), collection: i.collection.handle }))
|
|
172
|
+
case 'testimonials':
|
|
173
|
+
return (args.testimonials as { settings: Record<string, unknown>; avatar?: NovaImage | null }[]).map((t) =>
|
|
174
|
+
block('testimonial', { ...settingsOf('', t.settings, blockFields('testimonials', 'testimonial')), ...(t.avatar ? { avatar: t.avatar.src } : {}) }))
|
|
175
|
+
case 'product-details':
|
|
176
|
+
return (args.blocks as { type: string; settings?: Record<string, unknown> }[]).map((b) => block(b.type, { ...(b.settings ?? {}) }))
|
|
177
|
+
case 'trust-badges':
|
|
178
|
+
return (args.badges as Record<string, unknown>[]).map((b) => block('badge', settingsOf('', b, blockFields('trust-badges', 'badge'))))
|
|
179
|
+
case 'cart-items':
|
|
180
|
+
return (args.badges as Record<string, unknown>[]).map((b) => block('badge', settingsOf('', b, blockFields('cart-items', 'badge'))))
|
|
181
|
+
default:
|
|
182
|
+
return undefined
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** Resources the story passes as data objects but the route (not a setting) supplies under the ABI. */
|
|
186
|
+
const ROUTE_SUPPLIED: Record<string, string[]> = { 'main-collection': ['collection'], 'product-details': ['product'] }
|
|
187
|
+
let secSeq = 0
|
|
188
|
+
function nodeOf(e: Entry): Node {
|
|
189
|
+
const args = argsOf(e)
|
|
190
|
+
const settings = settingsOf(e.type, args)
|
|
191
|
+
for (const k of ROUTE_SUPPLIED[e.type] ?? []) delete settings[k]
|
|
192
|
+
if (e.type === 'header') settings.menu = (args.menu as NovaMenu).handle
|
|
193
|
+
if (e.type === 'footer') settings.legalMenu = (args.legalMenu as NovaMenu).handle
|
|
194
|
+
if (e.type === 'product-details') settings.sizeGuidePage = 'size-guide'
|
|
195
|
+
if (e.type === 'cart-items' && args.emptyCollection) settings.emptyStateCollection = (args.emptyCollection as Collection).handle
|
|
196
|
+
const blocks = blocksOf(e, args)
|
|
197
|
+
return { type: e.type, id: `${e.type}-${++secSeq}`, settings, ...(blocks ? { blocks } : {}) }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const content = {
|
|
201
|
+
settings: { values: {} },
|
|
202
|
+
regions: { header: { sections: [nodeOf(HEADER)] }, footer: { sections: [nodeOf(FOOTER)] } },
|
|
203
|
+
templates: Object.fromEntries(PAGES.map((p) => [p.template, { regions: { announcement: { sections: [] }, main: { sections: p.sections.map(nodeOf) } } }])),
|
|
204
|
+
}
|
|
205
|
+
writeFileSync(join(out, 'content.json'), JSON.stringify(content, null, 1))
|
|
206
|
+
console.log(`wrote ${out}/wire, content.json, cart.json`)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Nova parity — storybook render</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/scripts/parity/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The "storybook render" of a parity page: ?page=<name>. Dev-only (vite --config scripts/parity/vite.config.ts). */
|
|
2
|
+
import { createRoot } from 'react-dom/client'
|
|
3
|
+
import { withNova } from '../../tests/support/with-nova'
|
|
4
|
+
import { FOOTER, HEADER, PAGES, drawStory } from './pages'
|
|
5
|
+
|
|
6
|
+
const name = new URLSearchParams(location.search).get('page') ?? 'home'
|
|
7
|
+
const page = PAGES.find((p) => p.name === name)
|
|
8
|
+
const root = document.getElementById('root')!
|
|
9
|
+
if (!page) root.textContent = `no parity page "${name}" — one of ${PAGES.map((p) => p.name).join(', ')}`
|
|
10
|
+
else {
|
|
11
|
+
const Page = () => (
|
|
12
|
+
<>
|
|
13
|
+
{drawStory(HEADER)}
|
|
14
|
+
<main id="main">
|
|
15
|
+
{page.sections.map((e, i) => (
|
|
16
|
+
<div key={i} data-parity-section={e.type}>{drawStory(e)}</div>
|
|
17
|
+
))}
|
|
18
|
+
</main>
|
|
19
|
+
{drawStory(FOOTER)}
|
|
20
|
+
</>
|
|
21
|
+
)
|
|
22
|
+
createRoot(root).render(withNova(Page, { args: {}, globals: {}, parameters: {}, canvasElement: root }) as JSX.Element)
|
|
23
|
+
}
|