@mohasinac/appkit 4.53.0 → 4.53.1
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/dist/.build-stamp.json +3 -3
- package/dist/_internal/client/scaffolds/AppShell.js +1 -1
- package/dist/_internal/server/features/auctions/og.d.ts +3 -1
- package/dist/_internal/server/features/auctions/og.js +3 -1
- package/dist/_internal/server/features/bundles/actions.js +1 -1
- package/dist/_internal/server/features/business-documents/download.d.ts +41 -0
- package/dist/_internal/server/features/business-documents/download.js +91 -0
- package/dist/_internal/server/features/categories/adapters.d.ts +1 -1
- package/dist/_internal/server/features/categories/adapters.js +10 -0
- package/dist/_internal/server/features/checkout/actions.d.ts +14 -0
- package/dist/_internal/server/features/checkout/actions.js +106 -12
- package/dist/_internal/server/features/checkout/bundle-expansion.js +17 -0
- package/dist/_internal/server/features/checkout/data.d.ts +22 -0
- package/dist/_internal/server/features/checkout/group-rule-revalidation.d.ts +34 -0
- package/dist/_internal/server/features/checkout/group-rule-revalidation.js +124 -0
- package/dist/_internal/server/features/checkout/supplier-identity.d.ts +55 -0
- package/dist/_internal/server/features/checkout/supplier-identity.js +81 -0
- package/dist/_internal/server/features/classified/metadata.js +1 -1
- package/dist/_internal/server/features/classified/og.d.ts +3 -1
- package/dist/_internal/server/features/classified/og.js +3 -1
- package/dist/_internal/server/features/digital-code/metadata.js +1 -1
- package/dist/_internal/server/features/digital-code/og.d.ts +3 -1
- package/dist/_internal/server/features/digital-code/og.js +3 -1
- package/dist/_internal/server/features/digital-code/pool.d.ts +19 -4
- package/dist/_internal/server/features/digital-code/pool.js +19 -4
- package/dist/_internal/server/features/live/metadata.js +1 -1
- package/dist/_internal/server/features/live/og.d.ts +3 -1
- package/dist/_internal/server/features/live/og.js +3 -1
- package/dist/_internal/server/features/messages/actions.js +1 -1
- package/dist/_internal/server/features/parts/og.js +1 -1
- package/dist/_internal/server/features/pre-orders/og.d.ts +3 -1
- package/dist/_internal/server/features/pre-orders/og.js +3 -1
- package/dist/_internal/server/features/price-index/search.d.ts +18 -0
- package/dist/_internal/server/features/price-index/search.js +47 -7
- package/dist/_internal/server/features/prize-draws/og.d.ts +3 -1
- package/dist/_internal/server/features/prize-draws/og.js +3 -1
- package/dist/_internal/server/features/products/group-members.d.ts +26 -0
- package/dist/_internal/server/features/products/group-members.js +7 -1
- package/dist/_internal/server/features/products/og.d.ts +3 -1
- package/dist/_internal/server/features/products/og.js +3 -1
- package/dist/_internal/server/features/search/scoped-sources.d.ts +26 -0
- package/dist/_internal/server/features/search/scoped-sources.js +252 -0
- package/dist/_internal/server/features/search/search-everything.d.ts +57 -0
- package/dist/_internal/server/features/search/search-everything.js +70 -20
- package/dist/_internal/server/features/seo/sitemap.js +6 -0
- package/dist/_internal/server/features/shared/listing-adapters.js +4 -2
- package/dist/_internal/server/features/sticker-trace/adapters.d.ts +11 -0
- package/dist/_internal/server/features/sticker-trace/adapters.js +1 -0
- package/dist/_internal/server/features/sticker-trace/promote-to-listings.d.ts +26 -0
- package/dist/_internal/server/features/sticker-trace/promote-to-listings.js +264 -0
- package/dist/_internal/server/features/sticker-trace/sheet-actions.d.ts +3 -1
- package/dist/_internal/server/features/sticker-trace/sheet-actions.js +32 -0
- package/dist/_internal/server/features/sticker-trace/storage.d.ts +20 -1
- package/dist/_internal/server/features/sticker-trace/storage.js +20 -1
- package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
- package/dist/_internal/server/features/stores/adapters.js +16 -0
- package/dist/_internal/server/features/stores/index.d.ts +1 -0
- package/dist/_internal/server/features/stores/index.js +1 -0
- package/dist/_internal/server/features/stores/tabs.d.ts +25 -0
- package/dist/_internal/server/features/stores/tabs.js +122 -0
- package/dist/_internal/shared/checkout/rules/_defaults.js +0 -2
- package/dist/_internal/shared/checkout/rules/_limits.d.ts +14 -1
- package/dist/_internal/shared/checkout/rules/_limits.js +14 -1
- package/dist/_internal/shared/checkout/rules/_registry.js +2 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.js +9 -1
- package/dist/_internal/shared/checkout/rules/bundle.rule.js +13 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/index.js +9 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.js +0 -1
- package/dist/_internal/shared/checkout/rules/payment-gate.d.ts +26 -0
- package/dist/_internal/shared/checkout/rules/payment-gate.js +133 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +29 -8
- package/dist/_internal/shared/checkout/rules/spares.rule.d.ts +16 -0
- package/dist/_internal/shared/checkout/rules/spares.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +26 -2
- package/dist/_internal/shared/config/schema.d.ts +122 -0
- package/dist/_internal/shared/features/cart/schema.js +3 -2
- package/dist/_internal/shared/features/products/group-rules.d.ts +75 -0
- package/dist/_internal/shared/features/products/group-rules.js +142 -0
- package/dist/_internal/shared/listing-types/_registry.d.ts +24 -0
- package/dist/_internal/shared/listing-types/_registry.js +39 -1
- package/dist/_internal/shared/listing-types/art/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/config.js +2 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/auction/config.js +2 -0
- package/dist/_internal/shared/listing-types/availability.js +48 -0
- package/dist/_internal/shared/listing-types/capabilities.js +19 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/config.js +2 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +2 -0
- package/dist/_internal/shared/listing-types/feature-flags.js +1 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/config.js +2 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +2 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +2 -0
- package/dist/_internal/shared/listing-types/spares/config.d.ts +74 -0
- package/dist/_internal/shared/listing-types/spares/config.js +60 -0
- package/dist/_internal/shared/listing-types/spares/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/spares/ctas.js +4 -0
- package/dist/_internal/shared/listing-types/spares/og.js +1 -0
- package/dist/_internal/shared/listing-types/spares/schema.d.ts +2 -0
- package/dist/_internal/shared/listing-types/spares/schema.js +3 -0
- package/dist/_internal/shared/listing-types/spares/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/spares/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/standard/config.js +2 -0
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/config.js +2 -0
- package/dist/_internal/shared/search/match.d.ts +11 -0
- package/dist/_internal/shared/search/match.js +2 -1
- package/dist/_internal/shared/search/to-groups.d.ts +52 -0
- package/dist/_internal/shared/search/to-groups.js +141 -0
- package/dist/client.d.ts +8 -2
- package/dist/client.js +4 -1
- package/dist/constants/api-endpoints.d.ts +39 -15
- package/dist/constants/api-endpoints.js +28 -5
- package/dist/constants/cache-invalidation.js +3 -1
- package/dist/constants/field-names.d.ts +6 -0
- package/dist/constants/field-names.js +6 -0
- package/dist/features/about/components/PolicyPageView.d.ts +22 -2
- package/dist/features/about/components/PolicyPageView.js +14 -2
- package/dist/features/about/components/PublicProfileView.js +2 -1
- package/dist/features/about/components/ShippingPolicyView.js +42 -2
- package/dist/features/account/components/NotificationBell.js +1 -1
- package/dist/features/account/hooks/useProfileStats.js +5 -1
- package/dist/features/addresses/repository/addresses.repository.d.ts +16 -0
- package/dist/features/addresses/repository/addresses.repository.js +21 -0
- package/dist/features/admin/actions/admin-actions.js +16 -1
- package/dist/features/admin/components/AdminCategoryEditorView.js +19 -2
- package/dist/features/admin/components/AdminNavigationView.js +1 -1
- package/dist/features/admin/components/AdminPageHeader.js +1 -1
- package/dist/features/admin/components/AdminProductEditorView.js +17 -2
- package/dist/features/admin/components/AdminSidebar.js +1 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +39 -8
- package/dist/features/admin/components/AdminSparesView.d.ts +12 -0
- package/dist/features/admin/components/AdminSparesView.js +30 -0
- package/dist/features/admin/components/AdminUsersView.js +9 -7
- package/dist/features/admin/components/index.d.ts +2 -0
- package/dist/features/admin/components/index.js +1 -0
- package/dist/features/admin/components/sections/adminSectionsTypes.js +7 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +3 -0
- package/dist/features/admin/constants/filter-tabs.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +26 -2
- package/dist/features/auctions/components/AuctionDetailPageView.js +4 -11
- package/dist/features/auth/repository/user.repository.d.ts +13 -0
- package/dist/features/auth/repository/user.repository.js +28 -0
- package/dist/features/auth/schemas/firestore.d.ts +2 -0
- package/dist/features/auth/schemas/firestore.js +2 -0
- package/dist/features/business-documents/repository/business-documents.repository.d.ts +58 -0
- package/dist/features/business-documents/repository/business-documents.repository.js +54 -0
- package/dist/features/business-documents/schemas/firestore.d.ts +105 -0
- package/dist/features/business-documents/schemas/firestore.js +75 -0
- package/dist/features/cart/actions/cart-actions.js +83 -6
- package/dist/features/cart/repository/cart.repository.js +32 -4
- package/dist/features/cart/schemas/firestore.d.ts +20 -0
- package/dist/features/cart/schemas/index.d.ts +2 -2
- package/dist/features/catalogue/components/PublicCatalogueItemDetailView.js +1 -1
- package/dist/features/categories/api/[id]/price-guidance/route.d.ts +42 -0
- package/dist/features/categories/api/[id]/price-guidance/route.js +113 -0
- package/dist/features/categories/components/BrandDetailPageView.js +19 -3
- package/dist/features/categories/components/BrandDetailTabs.js +10 -0
- package/dist/features/categories/components/CategoriesIndexListing.js +23 -8
- package/dist/features/categories/components/CategoryDetailPageView.js +141 -14
- package/dist/features/categories/components/CategoryDetailTabs.js +12 -0
- package/dist/features/categories/components/CategoryGrid.js +10 -1
- package/dist/features/categories/components/PriceGuidanceHint.d.ts +29 -0
- package/dist/features/categories/components/PriceGuidanceHint.js +61 -0
- package/dist/features/categories/components/SubcategoryCardRow.d.ts +27 -0
- package/dist/features/categories/components/SubcategoryCardRow.js +98 -0
- package/dist/features/categories/constants/category-tabs.d.ts +20 -25
- package/dist/features/categories/constants/category-tabs.js +22 -39
- package/dist/features/categories/repository/categories.repository.d.ts +12 -0
- package/dist/features/categories/repository/categories.repository.js +20 -0
- package/dist/features/categories/schemas/firestore.d.ts +22 -1
- package/dist/features/categories/schemas/firestore.js +10 -0
- package/dist/features/categories/schemas/index.d.ts +6 -0
- package/dist/features/categories/schemas/index.js +2 -0
- package/dist/features/categories/types/index.d.ts +8 -0
- package/dist/features/categories/utils/taxonomy-visual.d.ts +16 -3
- package/dist/features/categories/utils/taxonomy-visual.js +26 -10
- package/dist/features/classified/components/ClassifiedDetailPageView.js +4 -9
- package/dist/features/contact/components/ContactPageView.d.ts +33 -1
- package/dist/features/contact/components/ContactPageView.js +58 -28
- package/dist/features/digital-codes/components/DigitalCodeDetailPageView.js +4 -9
- package/dist/features/grouped/components/GroupedListingDetailView.js +9 -1
- package/dist/features/grouped/schemas/firestore.d.ts +5 -0
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +3 -3
- package/dist/features/homepage/components/CollectionCardsSection.d.ts +28 -6
- package/dist/features/homepage/components/CollectionCardsSection.js +43 -8
- package/dist/features/homepage/components/HowItWorksSection.d.ts +23 -6
- package/dist/features/homepage/components/HowItWorksSection.js +4 -4
- package/dist/features/homepage/components/PromoGrid.d.ts +31 -2
- package/dist/features/homepage/components/PromoGrid.js +12 -3
- package/dist/features/homepage/components/TestimonialsCarousel.d.ts +34 -2
- package/dist/features/homepage/components/TestimonialsCarousel.js +1 -1
- package/dist/features/homepage/components/index.d.ts +0 -20
- package/dist/features/homepage/components/index.js +0 -11
- package/dist/features/homepage/index.d.ts +0 -2
- package/dist/features/homepage/index.js +0 -2
- package/dist/features/homepage/lib/section-renderer.d.ts +9 -0
- package/dist/features/homepage/lib/section-renderer.js +202 -58
- package/dist/features/homepage/repository/homepage-sections.repository.d.ts +35 -3
- package/dist/features/homepage/repository/homepage-sections.repository.js +58 -8
- package/dist/features/homepage/schemas/firestore.d.ts +106 -3
- package/dist/features/homepage/schemas/firestore.js +32 -2
- package/dist/features/homepage/schemas/index.d.ts +36 -7
- package/dist/features/homepage/schemas/index.js +39 -27
- package/dist/features/homepage/server.d.ts +0 -3
- package/dist/features/homepage/server.js +0 -3
- package/dist/features/homepage/types/index.d.ts +0 -47
- package/dist/features/homepage/types/index.js +49 -0
- package/dist/features/layout/AppLayoutShell.js +1 -1
- package/dist/features/layout/BottomNavItem.js +1 -1
- package/dist/features/layout/BottomSheet.js +1 -1
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/live/components/LiveItemDetailPageView.js +4 -9
- package/dist/features/media/hooks/useMedia.js +17 -0
- package/dist/features/media/repository/media-assets.repository.d.ts +46 -0
- package/dist/features/media/repository/media-assets.repository.js +31 -0
- package/dist/features/media/trust-signals.d.ts +85 -0
- package/dist/features/media/trust-signals.js +126 -0
- package/dist/features/parts/components/PartDetailPageView.d.ts +14 -1
- package/dist/features/parts/components/PartDetailPageView.js +2 -2
- package/dist/features/parts/components/PartsIndexPageView.d.ts +11 -2
- package/dist/features/parts/components/PartsIndexPageView.js +2 -2
- package/dist/features/parts/components/PartsSearchBox.d.ts +9 -0
- package/dist/features/parts/components/PartsSearchBox.js +57 -0
- package/dist/features/parts/schemas/firestore.d.ts +149 -3
- package/dist/features/parts/schemas/firestore.js +184 -0
- package/dist/features/payments/repository/payout.repository.d.ts +15 -0
- package/dist/features/payments/repository/payout.repository.js +21 -0
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +4 -11
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +1 -1
- package/dist/features/price-index/components/PriceIndexToolView.d.ts +3 -1
- package/dist/features/price-index/components/PriceIndexToolView.js +92 -13
- package/dist/features/products/components/CompareOverlay.d.ts +18 -1
- package/dist/features/products/components/CompareOverlay.js +21 -2
- package/dist/features/products/components/CustomSectionTabContent.d.ts +31 -0
- package/dist/features/products/components/CustomSectionTabContent.js +29 -3
- package/dist/features/products/components/GroupMemberPicker.d.ts +19 -1
- package/dist/features/products/components/GroupMemberPicker.js +46 -8
- package/dist/features/products/components/GroupSettingsPanel.d.ts +11 -1
- package/dist/features/products/components/GroupSettingsPanel.js +91 -3
- package/dist/features/products/components/PrizeDrawDetailPageView.js +1 -1
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +15 -1
- package/dist/features/products/components/PrizeDrawEntryActions.js +70 -8
- package/dist/features/products/components/ProductDetailPageView.js +74 -15
- package/dist/features/products/components/ProductForm.d.ts +13 -1
- package/dist/features/products/components/ProductForm.js +16 -2
- package/dist/features/products/components/ProductsIndexListing.d.ts +16 -1
- package/dist/features/products/components/ProductsIndexListing.js +3 -3
- package/dist/features/products/components/ShowGroupSection.js +15 -2
- package/dist/features/products/components/SparesListView.d.ts +7 -0
- package/dist/features/products/components/SparesListView.js +39 -0
- package/dist/features/products/constants/action-defs.d.ts +1 -0
- package/dist/features/products/constants/action-defs.js +1 -0
- package/dist/features/products/repository/products.repository.d.ts +98 -0
- package/dist/features/products/repository/products.repository.js +235 -17
- package/dist/features/products/schemas/firestore.d.ts +97 -4
- package/dist/features/products/schemas/firestore.js +104 -0
- package/dist/features/products/schemas/index.d.ts +10 -19
- package/dist/features/products/schemas/index.js +23 -6
- package/dist/features/products/types/index.d.ts +45 -1
- package/dist/features/products/utils/group-member-image.d.ts +39 -0
- package/dist/features/products/utils/group-member-image.js +3 -0
- package/dist/features/products/utils/listing-badge-variant.js +4 -0
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/scams/components/ScamProfileView.js +1 -1
- package/dist/features/search/components/EntityTypeahead.d.ts +44 -0
- package/dist/features/search/components/EntityTypeahead.js +92 -0
- package/dist/features/search/components/Search.d.ts +12 -1
- package/dist/features/search/components/Search.js +47 -3
- package/dist/features/search/components/SearchFacetRail.d.ts +11 -0
- package/dist/features/search/components/SearchFacetRail.js +92 -0
- package/dist/features/search/components/SearchResultsClient.d.ts +33 -0
- package/dist/features/search/components/SearchResultsClient.js +103 -0
- package/dist/features/search/components/SearchResultsPageView.d.ts +15 -1
- package/dist/features/search/components/SearchResultsPageView.js +2 -2
- package/dist/features/search/components/index.d.ts +0 -6
- package/dist/features/search/components/index.js +0 -3
- package/dist/features/search/hooks/useNavSuggestions.d.ts +13 -0
- package/dist/features/search/hooks/useScopedSearch.d.ts +34 -0
- package/dist/features/search/hooks/useScopedSearch.js +114 -0
- package/dist/features/search/hooks/useSiteSearch.d.ts +26 -0
- package/dist/features/search/hooks/useSiteSearch.js +149 -0
- package/dist/features/search/index.d.ts +0 -4
- package/dist/features/search/index.js +0 -4
- package/dist/features/search/manifest.d.ts +12 -0
- package/dist/features/search/manifest.js +17 -2
- package/dist/features/search/server.d.ts +0 -3
- package/dist/features/search/server.js +0 -3
- package/dist/features/seller/components/SellerListingTypeView.d.ts +1 -1
- package/dist/features/seller/components/SellerListingTypeView.js +20 -0
- package/dist/features/seller/components/SellerPayoutSettingsView.js +35 -14
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductShell.js +2 -1
- package/dist/features/seller/components/SellerSidebar.js +1 -1
- package/dist/features/seller/components/SellerSparesView.d.ts +17 -0
- package/dist/features/seller/components/SellerSparesView.js +6 -0
- package/dist/features/seller/components/index.d.ts +2 -0
- package/dist/features/seller/components/index.js +1 -0
- package/dist/features/shell/CommandPalette.js +1 -1
- package/dist/features/sticker-trace/schemas/firestore.d.ts +19 -0
- package/dist/features/stores/components/StoreDetailLayoutView.d.ts +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +7 -82
- package/dist/features/stores/components/StoreHeader.js +1 -2
- package/dist/features/stores/components/StoreSparesPageView.d.ts +27 -0
- package/dist/features/stores/components/StoreSparesPageView.js +48 -0
- package/dist/features/stores/schemas/firestore.d.ts +19 -0
- package/dist/features/tester/seed-data/authored/buying__spares-and-groups.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/buying__spares-and-groups.js +96 -0
- package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__authenticity-checker.js +280 -45
- package/dist/features/tester/seed-data/authored/content-discovery__category-tabs-franchise-bundles.js +54 -32
- package/dist/features/tester/seed-data/authored/content-discovery__parts-database.js +3 -2
- package/dist/features/tester/seed-data/authored/content-discovery__price-index-and-compare.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__price-index-and-compare.js +73 -0
- package/dist/features/tester/seed-data/authored/content-discovery__site-wide-index.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/content-discovery__site-wide-index.js +340 -0
- package/dist/features/tester/seed-data/authored/index.js +16 -0
- package/dist/features/tester/seed-data/authored/search-and-nav__header-search.d.ts +1 -0
- package/dist/features/tester/seed-data/authored/search-and-nav__header-search.js +57 -0
- package/dist/features/tester/seed-data/authored/selling__spares-and-group-editing.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/selling__spares-and-group-editing.js +77 -0
- package/dist/features/tester/seed-data/authored/tools__sticker-promote-to-listings.d.ts +2 -0
- package/dist/features/tester/seed-data/authored/tools__sticker-promote-to-listings.js +58 -0
- package/dist/features/tester/seed-data/authored/tools__sticker-tracer.js +5 -4
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +372 -18
- package/dist/index.d.ts +17 -57
- package/dist/index.js +35 -96
- package/dist/next/routing/route-map.d.ts +42 -1
- package/dist/next/routing/route-map.js +45 -0
- package/dist/providers/db-firebase/base.repository.d.ts +22 -0
- package/dist/providers/db-firebase/base.repository.js +36 -0
- package/dist/schemas/registry.d.ts +15 -6
- package/dist/security/blind-index-tokens.d.ts +54 -0
- package/dist/security/blind-index-tokens.js +152 -0
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/settings-encryption.d.ts +35 -0
- package/dist/security/settings-encryption.js +91 -0
- package/dist/seed/_helpers/brand-rows.js +38 -14
- package/dist/seed/_helpers/category-forest.js +73 -7
- package/dist/seed/_helpers/category-images-generated.d.ts +25 -6
- package/dist/seed/_helpers/category-images-generated.js +81 -6
- package/dist/seed/_helpers/category-models.d.ts +1 -1
- package/dist/seed/_helpers/category-models.js +7 -1
- package/dist/seed/_helpers/category-parts-glossary-map.js +8 -0
- package/dist/seed/_helpers/category-parts.d.ts +1 -1
- package/dist/seed/_helpers/category-parts.js +50 -2
- package/dist/seed/_helpers/character-features.d.ts +1 -1
- package/dist/seed/_helpers/character-features.js +2 -1
- package/dist/seed/_helpers/franchise-rows.js +10 -2
- package/dist/seed/_helpers/media.d.ts +47 -0
- package/dist/seed/_helpers/media.js +34 -0
- package/dist/seed/authenticity-knowledge-seed-data.d.ts +49 -5
- package/dist/seed/authenticity-knowledge-seed-data.js +10001 -549
- package/dist/seed/categories-seed-data.js +124 -20
- package/dist/seed/grouped-listings-seed-data.js +16 -0
- package/dist/seed/homepage-sections-seed-data.js +94 -5
- package/dist/seed/index.d.ts +2 -3
- package/dist/seed/index.js +2 -2
- package/dist/seed/manifest.js +3 -0
- package/dist/seed/media-assets-seed-data.d.ts +1 -1
- package/dist/seed/media-assets-seed-data.js +746 -196
- package/dist/seed/model-composition-seed-data.js +122 -6
- package/dist/seed/part-glossary-seed-data.d.ts +1 -1
- package/dist/seed/part-glossary-seed-data.js +37219 -463
- package/dist/seed/products-art-seed-data.js +7 -18
- package/dist/seed/products-auctions-seed-data.js +56 -47
- package/dist/seed/products-beyblade-x-seed-data.d.ts +2 -0
- package/dist/seed/products-beyblade-x-seed-data.js +441 -0
- package/dist/seed/products-catalogue-seed-data.d.ts +5 -5
- package/dist/seed/products-catalogue-seed-data.js +1500 -1240
- package/dist/seed/products-classifieds-seed-data.js +9 -27
- package/dist/seed/products-digital-codes-seed-data.js +9 -18
- package/dist/seed/products-live-items-seed-data.js +5 -13
- package/dist/seed/products-preorders-seed-data.js +67 -33
- package/dist/seed/products-prize-draws-seed-data.js +8 -17
- package/dist/seed/products-spares-seed-data.d.ts +2 -0
- package/dist/seed/products-spares-seed-data.js +368 -0
- package/dist/seed/products-standard-seed-data.js +39 -126
- package/dist/seed/products-stickers-seed-data.js +59 -15
- package/dist/seed/site-settings-seed-data.js +8 -0
- package/dist/seo/json-ld.d.ts +25 -0
- package/dist/seo/json-ld.js +28 -0
- package/dist/server-entry.d.ts +3 -1
- package/dist/server-entry.js +2 -2
- package/dist/server.d.ts +9 -9
- package/dist/server.js +27 -25
- package/dist/styles.css +202 -1
- package/dist/tailwind-input.css +31 -17
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Accordion.js +1 -1
- package/dist/ui/components/Breadcrumb.js +1 -1
- package/dist/ui/components/DetailPageGallery.js +0 -2
- package/dist/ui/components/DetailPageHero.js +0 -1
- package/dist/ui/components/DetailPageTabs.js +1 -1
- package/dist/ui/components/Divider.js +3 -3
- package/dist/ui/components/GatedPrice.js +5 -1
- package/dist/ui/components/HorizontalScroller.js +1 -1
- package/dist/ui/components/ListingLayout.js +3 -3
- package/dist/ui/components/MediaTabs.style.css +81 -0
- package/dist/ui/components/Pagination.js +1 -1
- package/dist/ui/components/PendingValue.d.ts +45 -0
- package/dist/ui/components/PendingValue.js +7 -0
- package/dist/ui/components/Radio.style.css +119 -0
- package/dist/ui/components/RatingDisplay.js +2 -2
- package/dist/ui/components/SettingsSection.js +0 -2
- package/dist/ui/components/SiteLogo.js +3 -0
- package/dist/ui/components/SiteMark.js +3 -0
- package/dist/ui/components/SortDropdown.js +1 -1
- package/dist/ui/components/SpecTable.d.ts +58 -0
- package/dist/ui/components/SpecTable.js +8 -0
- package/dist/ui/components/StarRating.js +1 -3
- package/dist/ui/components/SummaryCard.js +1 -1
- package/dist/ui/components/index.style.css +1 -0
- package/dist/ui/icons/icon-registry.d.ts +1 -0
- package/dist/ui/icons/icon-registry.js +9 -1
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.js +2 -0
- package/dist/utils/search-txt-query.d.ts +12 -0
- package/dist/utils/search-txt-query.js +12 -0
- package/package.json +1 -1
- package/scripts/dedupe-peer-deps.mjs +18 -0
- package/scripts/seed-cli.mjs +135 -26
- package/scripts/verify-css-build.mjs +118 -37
- package/dist/_internal/server/features/search/actions.d.ts +0 -7
- package/dist/_internal/server/features/search/actions.js +0 -21
- package/dist/_internal/server/features/search/data.d.ts +0 -15
- package/dist/_internal/server/features/search/data.js +0 -18
- package/dist/_internal/server/features/search/index.d.ts +0 -3
- package/dist/_internal/server/features/search/index.js +0 -2
- package/dist/features/homepage/api/[id]/route.d.ts +0 -23
- package/dist/features/homepage/api/[id]/route.js +0 -103
- package/dist/features/homepage/api/route.d.ts +0 -14
- package/dist/features/homepage/api/route.js +0 -140
- package/dist/features/homepage/api/sections/[id]/route.d.ts +0 -26
- package/dist/features/homepage/api/sections/[id]/route.js +0 -95
- package/dist/features/homepage/api/sections/route.d.ts +0 -13
- package/dist/features/homepage/api/sections/route.js +0 -82
- package/dist/features/homepage/components/AdvertisementBanner.d.ts +0 -14
- package/dist/features/homepage/components/AdvertisementBanner.js +0 -35
- package/dist/features/homepage/components/BeforeAfterCard.d.ts +0 -9
- package/dist/features/homepage/components/BeforeAfterCard.js +0 -73
- package/dist/features/homepage/components/FeaturedResultsSection.d.ts +0 -17
- package/dist/features/homepage/components/FeaturedResultsSection.js +0 -17
- package/dist/features/homepage/components/HeroBanner.d.ts +0 -7
- package/dist/features/homepage/components/HeroBanner.js +0 -43
- package/dist/features/homepage/components/HeroSection.d.ts +0 -7
- package/dist/features/homepage/components/HeroSection.js +0 -6
- package/dist/features/homepage/components/HomepageSkeleton.d.ts +0 -2
- package/dist/features/homepage/components/HomepageSkeleton.js +0 -21
- package/dist/features/homepage/components/HomepageView.d.ts +0 -25
- package/dist/features/homepage/components/HomepageView.js +0 -5
- package/dist/features/homepage/components/NewsletterBanner.d.ts +0 -23
- package/dist/features/homepage/components/NewsletterBanner.js +0 -37
- package/dist/features/homepage/components/SiteFeaturesSection.d.ts +0 -14
- package/dist/features/homepage/components/SiteFeaturesSection.js +0 -11
- package/dist/features/homepage/components/TrustBadges.d.ts +0 -6
- package/dist/features/homepage/components/TrustBadges.js +0 -46
- package/dist/features/homepage/components/TrustIndicatorsSection.d.ts +0 -12
- package/dist/features/homepage/components/TrustIndicatorsSection.js +0 -11
- package/dist/features/homepage/hooks/useHomepage.d.ts +0 -11
- package/dist/features/homepage/hooks/useHomepage.js +0 -17
- package/dist/features/homepage/hooks/useHomepageSections.d.ts +0 -2
- package/dist/features/homepage/hooks/useHomepageSections.js +0 -10
- package/dist/features/homepage/repository/homepage.repository.d.ts +0 -11
- package/dist/features/homepage/repository/homepage.repository.js +0 -25
- package/dist/features/search/actions/index.d.ts +0 -1
- package/dist/features/search/actions/index.js +0 -1
- package/dist/features/search/actions/search-actions.d.ts +0 -18
- package/dist/features/search/actions/search-actions.js +0 -43
- package/dist/features/search/api/route.d.ts +0 -22
- package/dist/features/search/api/route.js +0 -128
- package/dist/features/search/columns/index.d.ts +0 -17
- package/dist/features/search/columns/index.js +0 -49
- package/dist/features/search/components/SearchFiltersRow.d.ts +0 -22
- package/dist/features/search/components/SearchFiltersRow.js +0 -21
- package/dist/features/search/components/SearchResultsSection.d.ts +0 -53
- package/dist/features/search/components/SearchResultsSection.js +0 -35
- package/dist/features/search/components/SearchView.d.ts +0 -27
- package/dist/features/search/components/SearchView.js +0 -8
- package/dist/features/search/hooks/useSearch.d.ts +0 -21
- package/dist/features/search/hooks/useSearch.js +0 -33
- package/dist/features/search/repository/search.repository.d.ts +0 -14
- package/dist/features/search/repository/search.repository.js +0 -59
- package/dist/features/search/schemas/index.d.ts +0 -70
- package/dist/features/search/schemas/index.js +0 -36
- package/dist/features/search/types/index.d.ts +0 -48
- package/dist/features/stores/components/StoreScopedSearch.d.ts +0 -17
- package/dist/features/stores/components/StoreScopedSearch.js +0 -27
- package/dist/seed/defaults/homepage-sections.d.ts +0 -2
- package/dist/seed/defaults/homepage-sections.js +0 -60
- package/dist/seed/factories/homepage-section.factory.d.ts +0 -10
- package/dist/seed/factories/homepage-section.factory.js +0 -13
- /package/dist/{features/search/types/index.js → _internal/shared/listing-types/spares/og.d.ts} +0 -0
|
@@ -1,41 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
|
|
3
2
|
import { cache } from "react";
|
|
4
|
-
import { storeRepository, siteSettingsRepository
|
|
3
|
+
import { storeRepository, siteSettingsRepository } from "../../../repositories/index.js";
|
|
5
4
|
import { safeRead } from "../../../errors/safe-read.js";
|
|
6
|
-
import { ROUTES } from "../../../next/routing/route-map.js";
|
|
7
5
|
import { Container, Main, Section, Text } from "../../../ui/index.js";
|
|
8
|
-
import { STORE_PAGE_TABS } from "../../products/constants/listing-tabs.js";
|
|
9
|
-
import { isListingTypeEnabled, isCategoryTypeEnabled } from "../../../_internal/shared/listing-types/feature-flags.js";
|
|
10
|
-
import { pluginFor } from "../../../_internal/shared/listing-types/_registry.js";
|
|
11
|
-
import { listingTabCounts, } from "../../../_internal/server/features/products/listing-tab-counts.js";
|
|
12
6
|
import { getSellerTrustStatus } from "../../scams/actions/scam-actions.js";
|
|
13
7
|
import { StoreHeader } from "./StoreHeader.js";
|
|
14
8
|
import { StoreNavTabs } from "./StoreNavTabs.js";
|
|
15
9
|
import { toStoreDetail } from "../../../_internal/server/features/stores/adapters.js";
|
|
16
|
-
|
|
17
|
-
products: (slug) => String(ROUTES.PUBLIC.STORE_PRODUCTS(slug)),
|
|
18
|
-
auctions: (slug) => String(ROUTES.PUBLIC.STORE_AUCTIONS(slug)),
|
|
19
|
-
"pre-orders": (slug) => String(ROUTES.PUBLIC.STORE_PRE_ORDERS(slug)),
|
|
20
|
-
"prize-draws": (slug) => String(ROUTES.PUBLIC.STORE_PRIZE_DRAWS(slug)),
|
|
21
|
-
bundles: (slug) => String(ROUTES.PUBLIC.STORE_BUNDLES(slug)),
|
|
22
|
-
classifieds: (slug) => String(ROUTES.PUBLIC.STORE_CLASSIFIEDS(slug)),
|
|
23
|
-
"digital-codes": (slug) => String(ROUTES.PUBLIC.STORE_DIGITAL_CODES(slug)),
|
|
24
|
-
live: (slug) => String(ROUTES.PUBLIC.STORE_LIVE(slug)),
|
|
25
|
-
// Combined art + stickers, mirroring the public /art page. This used to
|
|
26
|
-
// point at STORE_PRODUCTS, which filters to `standard` — so the tab showed
|
|
27
|
-
// a real non-zero count and landed on a page with none of those items.
|
|
28
|
-
art: (slug) => String(ROUTES.PUBLIC.STORE_ART(slug)),
|
|
29
|
-
};
|
|
10
|
+
import { resolveStoreTabs } from "../../../_internal/server/features/stores/tabs.js";
|
|
30
11
|
// The store IS this layout's subject, and `findBySlug` already returns null for
|
|
31
12
|
// "no such slug" — swallowing a read failure into the same value would render
|
|
32
13
|
// the "Store not found." branch below for a live store during an outage.
|
|
33
14
|
export const getStoreBySlug = cache((slug) => storeRepository.findBySlug(slug));
|
|
34
|
-
function tabLabel(base, count) {
|
|
35
|
-
if (!count)
|
|
36
|
-
return base;
|
|
37
|
-
return `${base} (${count.toLocaleString()})`;
|
|
38
|
-
}
|
|
39
15
|
export async function StoreDetailLayoutView({ storeSlug, activeTab, children, scamRegistryEnabled = false, }) {
|
|
40
16
|
const store = await getStoreBySlug(storeSlug);
|
|
41
17
|
if (!store) {
|
|
@@ -53,61 +29,10 @@ export async function StoreDetailLayoutView({ storeSlug, activeTab, children, sc
|
|
|
53
29
|
? safeRead(() => getSellerTrustStatus(storeId), { route: "/stores/[slug]", key: "store.sellerTrust", fallback: undefined })
|
|
54
30
|
: Promise.resolve(undefined),
|
|
55
31
|
]);
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
const [listingCounts, couponsCount, reviewsCount] = storeId
|
|
62
|
-
? await Promise.all([
|
|
63
|
-
listingTabCounts(STORE_PAGE_TABS, { storeId }),
|
|
64
|
-
// audit-public-test-data-ok: a COUNT of the store's own coupons, and
|
|
65
|
-
// `CouponDocument` carries no isTestData field — there is nothing to strip.
|
|
66
|
-
couponsRepository
|
|
67
|
-
.list({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("validity.isActive", SIEVE_OP.EQ, "true")), page: 1, pageSize: 1 })
|
|
68
|
-
.then((r) => r.total)
|
|
69
|
-
.catch(() => 0),
|
|
70
|
-
reviewRepository
|
|
71
|
-
.listAll({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "approved")), page: 1, pageSize: 1 })
|
|
72
|
-
.then((r) => r.total)
|
|
73
|
-
.catch(() => 0),
|
|
74
|
-
])
|
|
75
|
-
: [{}, 0, 0];
|
|
76
|
-
const visibleStoreTabs = STORE_PAGE_TABS.filter((tab) => {
|
|
77
|
-
if (tab.id === "bundles") {
|
|
78
|
-
if (!isCategoryTypeEnabled("bundle", settings))
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
else if (tab.id === pluginFor("art").tabSlug) {
|
|
82
|
-
// Combined tab — visible if either underlying listing type is enabled.
|
|
83
|
-
if (!(isListingTypeEnabled("art", settings) || isListingTypeEnabled("stickers", settings)))
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
else if (tab.listingType) {
|
|
87
|
-
if (!isListingTypeEnabled(tab.listingType, settings))
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
// A store with zero items of a given listing type shouldn't offer a tab
|
|
91
|
-
// that leads to an empty page — matches the "hide empty tab" rule below
|
|
92
|
-
// for coupons/reviews. `undefined` means the count query FAILED, not zero,
|
|
93
|
-
// so the tab stays visible rather than hiding real stock behind a
|
|
94
|
-
// swallowed error (Root Cause #59) — this used to be `.catch(() => 0)`.
|
|
95
|
-
const count = listingCounts[tab.id];
|
|
96
|
-
return count === undefined || count > 0;
|
|
97
|
-
});
|
|
98
|
-
const dropdownTabs = visibleStoreTabs.map((tab) => ({
|
|
99
|
-
value: tab.id,
|
|
100
|
-
label: tabLabel(tab.label, listingCounts[tab.id]),
|
|
101
|
-
href: STORE_LISTING_HREF[tab.id](storeSlug),
|
|
102
|
-
}));
|
|
103
|
-
const tabs = [
|
|
104
|
-
...(couponsCount > 0
|
|
105
|
-
? [{ value: "coupons", label: tabLabel("Coupons", couponsCount), href: String(ROUTES.PUBLIC.STORE_COUPONS(storeSlug)) }]
|
|
106
|
-
: []),
|
|
107
|
-
...(reviewsCount > 0
|
|
108
|
-
? [{ value: "reviews", label: tabLabel("Reviews", reviewsCount), href: String(ROUTES.PUBLIC.STORE_REVIEWS(storeSlug)) }]
|
|
109
|
-
: []),
|
|
110
|
-
{ value: "about", label: "About", href: String(ROUTES.PUBLIC.STORE_ABOUT(storeSlug)) },
|
|
111
|
-
];
|
|
32
|
+
// Single source of truth shared with the bare `/stores/[slug]` redirect
|
|
33
|
+
// (`getDefaultStoreTabPath`) — both need "which tabs actually have
|
|
34
|
+
// something in them, in what order", and computing that twice is the
|
|
35
|
+
// duplicated-predicate shape Root Cause #73 warns about.
|
|
36
|
+
const { dropdownTabs, tabs } = await resolveStoreTabs(storeSlug, storeId, settings);
|
|
112
37
|
return (_jsxs(Main, { children: [_jsx(StoreHeader, { store: toStoreDetail(store), trust: trust }), _jsxs(Container, { size: "xl", className: "mt-6", children: [_jsx(StoreNavTabs, { dropdownTabs: dropdownTabs, dropdownPlaceholder: "Browse listings", tabs: tabs, activeValue: activeTab }), _jsx(Section, { padding: "t-lg", children: children })] })] }));
|
|
113
38
|
}
|
|
@@ -3,7 +3,6 @@ import { Button, Div, Heading, RichText, Row, Section, Span, Text, } from "../..
|
|
|
3
3
|
import { MediaImage } from "../../media/MediaImage.js";
|
|
4
4
|
import { normalizeRichTextHtml } from "../../../utils/string.formatter.js";
|
|
5
5
|
import { ShareButton } from "../../products/components/ShareButton.js";
|
|
6
|
-
import { StoreScopedSearch } from "./StoreScopedSearch.js";
|
|
7
6
|
import { SellerTrustBadge } from "../../scams/components/SellerTrustBadge.js";
|
|
8
7
|
const __O = {
|
|
9
8
|
hidden: "overflow-hidden",
|
|
@@ -15,5 +14,5 @@ const CLS_WARN_BANNER = "mt-3 rounded-lg bg-warning-surface dark:bg-warning-surf
|
|
|
15
14
|
export function StoreHeader({ store, labels = {}, onFollow, className = "", trust, }) {
|
|
16
15
|
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (_jsx(Div, { className: `relative h-40 md:h-56 ${__O.hidden} bg-[var(--appkit-color-surface)] bg-[var(--appkit-color-surface-elevated)]`, children: _jsx(MediaImage, { src: store.storeBannerURL, alt: `${store.storeName} banner`, size: "banner" }) })), _jsxs(Div, { paddingX: "x-page", className: "max-w-7xl mx-auto", padding: "y-md", children: [_jsxs(Row, { align: "end", gap: "md", children: [store.storeLogoURL ? (_jsx(Div, { className: "relative -mt-8 h-16 w-16 border-2 border-white", rounded: "xl", shadow: "sm", overflow: "hidden", children: _jsx(MediaImage, { src: store.storeLogoURL, alt: store.storeName, size: "avatar" }) })) : (_jsx(Div, { className: CLS_AVATAR, children: store.storeName[0]?.toUpperCase() })), _jsxs(Div, { className: "flex-1 min-w-0", children: [_jsxs(Row, { className: "mb-0.5", align: "center", gap: "sm", wrap: true, children: [_jsx(Heading, { level: 1, className: "text-[var(--appkit-color-text)]", size: "xl", weight: "bold", children: store.storeName }), store.averageRating != null && store.averageRating > 0 && (_jsxs(Span, { size: "sm", weight: "medium", className: CLS_STARS, children: ["\u2605 ", store.averageRating.toFixed(1)] })), trust && _jsx(SellerTrustBadge, { trust: trust })] }), _jsxs(Row, { textSize: "xs", className: "text-[var(--appkit-color-text-muted)] mb-0.5", gap: "3", children: [store.category && _jsx(Span, { transform: "capitalize", children: store.category }), store.totalProducts != null && store.totalProducts > 0 && (_jsxs(Span, { children: [store.totalProducts, " ", labels.products ?? "products"] })), store.totalReviews != null && store.totalReviews > 0 && (_jsxs(Span, { children: [store.totalReviews, " ", labels.reviews ?? "reviews"] })), store.itemsSold != null && store.itemsSold > 0 && (_jsxs(Span, { children: [store.itemsSold, " ", labels.sold ?? "sold"] }))] }), store.storeDescription && (_jsx(RichText, { html: normalizeRichTextHtml(store.storeDescription), copyableCode: true, className: "mt-0.5" }))] }), _jsxs(Row, { gap: "sm", align: "center", className: "shrink-0", children: [_jsx(ShareButton, { title: store.storeName }), onFollow && (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => onFollow(store.storeSlug), className: CLS_FOLLOW_BTN, children: labels.follow ?? "Follow" }))] })] }), store.isVacationMode && (_jsx(Text, { className: CLS_WARN_BANNER, children: store.vacationMessage ??
|
|
17
16
|
labels.vacationMode ??
|
|
18
|
-
"Store is on vacation mode" }))
|
|
17
|
+
"Store is on vacation mode" }))] })] }));
|
|
19
18
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type SearchParams = Record<string, string | string[]>;
|
|
3
|
+
export interface StoreSparesPageViewProps {
|
|
4
|
+
storeSlug: string;
|
|
5
|
+
searchParams?: SearchParams;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One store's spares tab.
|
|
9
|
+
*
|
|
10
|
+
* 🛑 This page EXISTS because `STORE_PAGE_TABS` is derived from the plugin
|
|
11
|
+
* registry: the Spares tab appeared on every store page the moment the plugin
|
|
12
|
+
* landed, and a missing folder here is a clickable 404 that no audit covers.
|
|
13
|
+
* It is the named risk in the Part Two plan and the reason this ships in the
|
|
14
|
+
* same change as the route key.
|
|
15
|
+
*
|
|
16
|
+
* 🛑 It reuses `ProductsIndexListing` with a `storeId` rather than adding a
|
|
17
|
+
* seventh hand-written `Store<Type>Listing`. Six of those exist, ~140 lines
|
|
18
|
+
* each of identical toolbar/availability/pagination/grid scaffolding — already
|
|
19
|
+
* past the Duplication Framework's Rule of Three. Consolidating them is its own
|
|
20
|
+
* session; declining to make it worse cost one prop.
|
|
21
|
+
*
|
|
22
|
+
* `typeTabs={[]}` suppresses the listing-type facet: this page spans exactly
|
|
23
|
+
* one type, so the facet would render a single checkbox that changes nothing.
|
|
24
|
+
* `ProductFilters` already guards on an empty option list.
|
|
25
|
+
*/
|
|
26
|
+
export declare function StoreSparesPageView({ storeSlug, searchParams }: StoreSparesPageViewProps): Promise<React.JSX.Element | null>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PRODUCT_FIELDS } from "../../../constants/field-names.js";
|
|
3
|
+
import { sortBy } from "../../../constants/sort.js";
|
|
4
|
+
import { listStoreProducts } from "../../../_internal/server/features/products/list-public.js";
|
|
5
|
+
import { getStoreBySlug } from "./StoreDetailLayoutView.js";
|
|
6
|
+
import { ProductsIndexListing } from "../../products/components/ProductsIndexListing.js";
|
|
7
|
+
const LISTING_TYPES = ["spares"];
|
|
8
|
+
const DEFAULT_PAGE_SIZE = 24;
|
|
9
|
+
const DEFAULT_SORT = sortBy(PRODUCT_FIELDS.CREATED_AT);
|
|
10
|
+
/**
|
|
11
|
+
* One store's spares tab.
|
|
12
|
+
*
|
|
13
|
+
* 🛑 This page EXISTS because `STORE_PAGE_TABS` is derived from the plugin
|
|
14
|
+
* registry: the Spares tab appeared on every store page the moment the plugin
|
|
15
|
+
* landed, and a missing folder here is a clickable 404 that no audit covers.
|
|
16
|
+
* It is the named risk in the Part Two plan and the reason this ships in the
|
|
17
|
+
* same change as the route key.
|
|
18
|
+
*
|
|
19
|
+
* 🛑 It reuses `ProductsIndexListing` with a `storeId` rather than adding a
|
|
20
|
+
* seventh hand-written `Store<Type>Listing`. Six of those exist, ~140 lines
|
|
21
|
+
* each of identical toolbar/availability/pagination/grid scaffolding — already
|
|
22
|
+
* past the Duplication Framework's Rule of Three. Consolidating them is its own
|
|
23
|
+
* session; declining to make it worse cost one prop.
|
|
24
|
+
*
|
|
25
|
+
* `typeTabs={[]}` suppresses the listing-type facet: this page spans exactly
|
|
26
|
+
* one type, so the facet would render a single checkbox that changes nothing.
|
|
27
|
+
* `ProductFilters` already guards on an empty option list.
|
|
28
|
+
*/
|
|
29
|
+
export async function StoreSparesPageView({ storeSlug, searchParams }) {
|
|
30
|
+
const store = await getStoreBySlug(storeSlug);
|
|
31
|
+
const storeId = store?.id;
|
|
32
|
+
if (typeof storeId !== "string" || !storeId)
|
|
33
|
+
return null;
|
|
34
|
+
// The shared query — never `productRepository.list()` with an inline filter
|
|
35
|
+
// string swallowed by `.catch(() => null)`, which is how the six older store
|
|
36
|
+
// tabs rendered empty with nothing logged when an index was missing.
|
|
37
|
+
const result = await listStoreProducts(storeId, LISTING_TYPES, searchParams ?? {}, {
|
|
38
|
+
pageSize: DEFAULT_PAGE_SIZE,
|
|
39
|
+
sorts: DEFAULT_SORT,
|
|
40
|
+
});
|
|
41
|
+
return (_jsx(ProductsIndexListing
|
|
42
|
+
// `undefined`, not `null` — React Query treats `null` as defined data, so
|
|
43
|
+
// a failed query would freeze an empty grid under `staleTime: Infinity`.
|
|
44
|
+
, {
|
|
45
|
+
// `undefined`, not `null` — React Query treats `null` as defined data, so
|
|
46
|
+
// a failed query would freeze an empty grid under `staleTime: Infinity`.
|
|
47
|
+
initialData: result ?? undefined, listingTypes: LISTING_TYPES, typeTabs: [], storeId: storeId, searchPlaceholder: "Search this store's spares..." }));
|
|
48
|
+
}
|
|
@@ -174,6 +174,25 @@ export interface StoreDocument extends BaseDocument {
|
|
|
174
174
|
* products they want converted — see `ProductRepository`.
|
|
175
175
|
*/
|
|
176
176
|
pricesIncludeGst?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* The seller's own 15-character GSTIN, when they have one.
|
|
179
|
+
*
|
|
180
|
+
* Absent/empty means unregistered, and the order then carries the
|
|
181
|
+
* platform's GSTIN. Validate with the existing `isValidGstin` (shape AND
|
|
182
|
+
* base-36 checksum) — never a second regex.
|
|
183
|
+
*/
|
|
184
|
+
gstin?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Registered legal name, when it differs from `storeName`.
|
|
187
|
+
*
|
|
188
|
+
* "Beyblade Arena" is a storefront; "Arena Collectibles Pvt Ltd" is who
|
|
189
|
+
* issues the invoice. Absent means the platform's legal name is used
|
|
190
|
+
* alongside the platform GSTIN — the two always travel together, because a
|
|
191
|
+
* GSTIN under the wrong legal name is a worse invoice than neither.
|
|
192
|
+
*/
|
|
193
|
+
legalName?: string;
|
|
194
|
+
/** Registered address as it should appear on the invoice. */
|
|
195
|
+
registeredAddress?: string;
|
|
177
196
|
/**
|
|
178
197
|
* How this store PRICES shipping — C5b. Absent means `free`.
|
|
179
198
|
*
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: Authored six-part procedures for Part Two's buyer-facing surfaces —
|
|
3
|
+
* spares, made-to-order, and self-assembled group selections with rules
|
|
4
|
+
* and a discount.
|
|
5
|
+
* WHAT: 6 case(s), keyed by full checklist id.
|
|
6
|
+
*
|
|
7
|
+
* 🛑 EVERY CASE IS AN EXPLICIT BEFORE -> AFTER. A spares page or a group picker
|
|
8
|
+
* returning 200 with plausible cards is not evidence any of this works — the
|
|
9
|
+
* exclusion from the general catalogue, the stock bypass, and the discount
|
|
10
|
+
* arithmetic are all silent-failure-shaped.
|
|
11
|
+
*
|
|
12
|
+
* @tag domain:tester
|
|
13
|
+
* @tag layer:seed
|
|
14
|
+
* @tag pattern:none
|
|
15
|
+
* @tag access:server-only
|
|
16
|
+
* @tag consumers:seed-data/authored/index.ts
|
|
17
|
+
* @tag sideEffects:none
|
|
18
|
+
*/
|
|
19
|
+
export const authored = {
|
|
20
|
+
"checklist-buying-spares-and-groups-spares-not-in-general-catalogue": {
|
|
21
|
+
roles: ["buyer"],
|
|
22
|
+
startPage: "/products",
|
|
23
|
+
steps: [
|
|
24
|
+
"Search /products for a known spare's title (e.g. \"Cross Dranzer\" or \"Galeon Bit Chip\").",
|
|
25
|
+
"Note whether it appears in the results.",
|
|
26
|
+
"Navigate to /spares and search for the same title.",
|
|
27
|
+
],
|
|
28
|
+
expectedBehaviour: "`spares` sets `inGeneralCatalogue: false`, so `listPublicProducts` on /products never includes it. The same row is reachable only through /spares, which spans exactly that one listing type.",
|
|
29
|
+
expectedUiState: "The spare's title is ABSENT from the /products search results. The same title IS present in the /spares search results, with its own card and price.",
|
|
30
|
+
endResult: "BEFORE spares existed, there was no tenth listing type at all. AFTER: a spare is reachable from exactly one place, never two. If it appears on both pages, the catalogue-exclusion flag broke. If it appears on neither, the /spares page or its nav wiring broke.",
|
|
31
|
+
},
|
|
32
|
+
"checklist-buying-spares-and-groups-spares-nav-entry-present": {
|
|
33
|
+
roles: ["buyer"],
|
|
34
|
+
startPage: "/",
|
|
35
|
+
steps: [
|
|
36
|
+
"Open the main nav's \"Products\" dropdown (hover on desktop, tap the caret on mobile).",
|
|
37
|
+
"Look for a \"Spares\" entry in the list of children.",
|
|
38
|
+
"Click it.",
|
|
39
|
+
],
|
|
40
|
+
expectedBehaviour: "Every listing type excluded from the general catalogue must be linked from MAIN_NAV_ITEMS or it is reachable from nowhere. Spares is one of those types, so its nav child is not decoration — it is the only discovery path.",
|
|
41
|
+
expectedUiState: "The dropdown shows a \"Spares\" row with a puzzle-piece icon and a one-line description. Clicking it navigates to /spares and the page renders a product grid.",
|
|
42
|
+
endResult: "BEFORE: no entry existed because the type did not exist. AFTER: the entry is present, and clicking it lands on a real page, not a 404 or a redirect back to /products.",
|
|
43
|
+
},
|
|
44
|
+
"checklist-buying-spares-and-groups-made-to-order-buyable-at-zero-stock": {
|
|
45
|
+
roles: ["buyer"],
|
|
46
|
+
startPage: "/products/sticker-beyblade-custom-print-on-demand",
|
|
47
|
+
steps: [
|
|
48
|
+
"Open the seeded \"Custom Beyblade Sticker Sheet — Print on Demand\" listing.",
|
|
49
|
+
"Read the stock/availability line near the price.",
|
|
50
|
+
"Click Add to Cart, then proceed through checkout with a test payment method.",
|
|
51
|
+
],
|
|
52
|
+
expectedBehaviour: "This listing has `madeToOrder: true` and `availableQuantity: 0`. `baseAvailable()` returns true unconditionally for a made-to-order row before either quantity check runs, so stock must gate nothing on it — not the PDP badge, not Add to Cart, not checkout.",
|
|
53
|
+
expectedUiState: "The page shows \"Made to order — printed when you order, so it never runs out.\" It must NOT show \"Out of Stock\" or any stock count. Add to Cart is enabled and checkout completes normally.",
|
|
54
|
+
endResult: "BEFORE the `madeToOrder` flag existed, a listing at zero stock was always sold out — there was no way to sell a print-on-demand item without lying about a fake stock number. AFTER: zero stock and buyable coexist correctly for this one flag.",
|
|
55
|
+
},
|
|
56
|
+
"checklist-buying-spares-and-groups-group-picker-shows-rules-before-choosing": {
|
|
57
|
+
roles: ["buyer"],
|
|
58
|
+
startPage: "/products/product-beyblade-burst-valkyrie",
|
|
59
|
+
steps: [
|
|
60
|
+
"Open any member of the seeded \"Burst & X Attackers You Might Like\" group (e.g. the Valkyrie listing).",
|
|
61
|
+
"Scroll to the group/\"Pick what you want\" section and open the full picker (it may be behind a \"Show all\" link once 5+ members exist).",
|
|
62
|
+
"Read the picker before selecting anything.",
|
|
63
|
+
],
|
|
64
|
+
expectedBehaviour: "The group carries `groupMinMembers: 2`, `groupMaxMembers: 3`, `groupMaxUnitsPerMember: 2`, `groupDiscountPercent: 10`. `describeGroupRules()` must render these as plain text near the top of the picker — stated BEFORE the buyer commits to a selection, not only surfaced as a refusal after submitting.",
|
|
65
|
+
expectedUiState: "Text reading something like \"Pick at least 2 · Pick at most 3 · Max 2 of each · 10% off the selection\" is visible above the member rows, before any quantity has been changed from zero.",
|
|
66
|
+
endResult: "BEFORE: a group had no rules at all, so there was nothing to state. AFTER: the rules are visible up front. If the picker shows nothing until a violation occurs, the rule-statement UI is missing even though enforcement might still work — that is a real but easy-to-miss partial failure.",
|
|
67
|
+
},
|
|
68
|
+
"checklist-buying-spares-and-groups-group-picker-blocks-and-explains-invalid-selection": {
|
|
69
|
+
roles: ["buyer"],
|
|
70
|
+
startPage: "/products/product-beyblade-burst-valkyrie",
|
|
71
|
+
steps: [
|
|
72
|
+
"On the same group picker, set exactly ONE member's quantity to 1 and leave the rest at 0.",
|
|
73
|
+
"Observe the Add button and any message shown.",
|
|
74
|
+
"Change the selection to 3 units of a single member instead (0 of the others).",
|
|
75
|
+
"Observe the Add button and message again.",
|
|
76
|
+
"Correct the selection to 2 different members at 1 unit each.",
|
|
77
|
+
],
|
|
78
|
+
expectedBehaviour: "`checkGroupRules()` runs client-side on every change. One item selected violates `groupMinMembers: 2` (\"Pick at least 2 different items\"). Three units of one item violates `groupMaxUnitsPerMember: 2` (\"At most 2 of … per order\"). Both must disable Add; neither should require a page reload to re-enable it once fixed.",
|
|
79
|
+
expectedUiState: "Step 1: Add is disabled, a warning box names the minimum-items rule. Step 2 (after changing selection): Add is still disabled, a DIFFERENT warning naming the per-item cap appears — not the same message as step 1. Step 3: both warnings disappear and Add becomes enabled, with no reload.",
|
|
80
|
+
endResult: "BEFORE: a group selection had no rules to violate. AFTER: an invalid selection is caught before the buyer wastes a click on a server round-trip, and the message names the SPECIFIC rule broken rather than a generic \"invalid selection\".",
|
|
81
|
+
},
|
|
82
|
+
"checklist-buying-spares-and-groups-group-discount-applied-and-shown": {
|
|
83
|
+
roles: ["buyer"],
|
|
84
|
+
startPage: "/products/product-beyblade-burst-valkyrie",
|
|
85
|
+
steps: [
|
|
86
|
+
"On the group picker, note the individual prices of two different members.",
|
|
87
|
+
"Select 1 of each of those two members.",
|
|
88
|
+
"Read the total shown in the picker.",
|
|
89
|
+
"Add to cart and open the cart page; read the line total there.",
|
|
90
|
+
"Proceed to checkout and read the order review total for that line.",
|
|
91
|
+
],
|
|
92
|
+
expectedBehaviour: "`groupDiscountPercent: 10` is applied inside `deriveLinePrice` — the single writer of a multi-member line's price — so the discount must be visible and IDENTICAL in all three places: the picker's live total, the cart line, and the checkout review. 10% below the sum of the two members' individual prices, rounded to the paisa.",
|
|
93
|
+
expectedUiState: "All three totals show the same discounted figure (sum of the two prices × 0.9, rounded to 2 decimals). The picker additionally shows the pre-discount sum struck through or labelled, so the discount is legible rather than just a smaller number.",
|
|
94
|
+
endResult: "BEFORE: a self-assembled group had no price relationship to its members beyond a plain sum. AFTER: the discount is one number, computed once, read identically everywhere — if any of the three disagrees with the other two, the cart total and the invoice have diverged, which is the exact failure Root Cause #75 describes.",
|
|
95
|
+
},
|
|
96
|
+
};
|