@mohasinac/appkit 3.0.3 → 3.0.6
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/_internal/client/features/filters/filter-load-options.js +11 -1
- package/dist/_internal/client/features/layout/filterNavItems.js +0 -1
- package/dist/_internal/client/features/layout/index.js +0 -1
- package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +0 -1
- package/dist/_internal/client/features/maintenance/views/ServerErrorDetailView.js +0 -1
- package/dist/_internal/server/features/auctions/data.d.ts +2 -4
- package/dist/_internal/server/features/auctions/data.js +3 -9
- package/dist/_internal/server/features/checkout/actions.js +9 -9
- package/dist/_internal/server/features/classified/adapters.d.ts +2 -15
- package/dist/_internal/server/features/classified/adapters.js +2 -17
- package/dist/_internal/server/features/classified/data.d.ts +1 -6
- package/dist/_internal/server/features/classified/data.js +2 -10
- package/dist/_internal/server/features/digital-code/adapters.d.ts +2 -15
- package/dist/_internal/server/features/digital-code/adapters.js +2 -17
- package/dist/_internal/server/features/digital-code/data.d.ts +1 -6
- package/dist/_internal/server/features/digital-code/data.js +2 -10
- package/dist/_internal/server/features/live/adapters.d.ts +2 -15
- package/dist/_internal/server/features/live/adapters.js +2 -17
- package/dist/_internal/server/features/live/data.d.ts +1 -6
- package/dist/_internal/server/features/live/data.js +2 -10
- package/dist/_internal/server/features/pre-orders/data.d.ts +2 -4
- package/dist/_internal/server/features/pre-orders/data.js +3 -9
- package/dist/_internal/server/features/prize-draws/actions.d.ts +2 -0
- package/dist/_internal/server/features/prize-draws/actions.js +22 -0
- package/dist/_internal/server/features/prize-draws/data.d.ts +1 -17
- package/dist/_internal/server/features/prize-draws/data.js +2 -20
- package/dist/_internal/server/features/prize-draws/index.d.ts +3 -1
- package/dist/_internal/server/features/prize-draws/index.js +2 -0
- package/dist/_internal/server/features/prize-draws/service.d.ts +3 -0
- package/dist/_internal/server/features/prize-draws/service.js +19 -0
- package/dist/_internal/server/features/shared/listing-adapters.d.ts +19 -0
- package/dist/_internal/server/features/shared/listing-adapters.js +20 -0
- package/dist/_internal/server/features/shared/listing-data-factory.d.ts +9 -0
- package/dist/_internal/server/features/shared/listing-data-factory.js +33 -0
- package/dist/_internal/server/features/stores/data.d.ts +3 -14
- package/dist/_internal/server/features/stores/data.js +6 -44
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
- package/dist/_internal/shared/features/cart/schema.d.ts +8 -8
- package/dist/_internal/shared/features/cart/schema.js +3 -0
- package/dist/_internal/shared/listing-types/_registry.js +2 -0
- package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
- package/dist/_internal/shared/listing-types/auction/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/auction/schema.js +7 -1
- package/dist/_internal/shared/listing-types/classified/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/classified/schema.js +3 -1
- package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/digital-code/schema.js +7 -1
- package/dist/_internal/shared/listing-types/live/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/live/schema.js +3 -1
- package/dist/_internal/shared/listing-types/pre-order/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/pre-order/schema.js +7 -1
- package/dist/_internal/shared/listing-types/prize-draw/schema.d.ts +3 -1
- package/dist/_internal/shared/listing-types/prize-draw/schema.js +13 -1
- package/dist/_internal/shared/listing-types/standard/schema.d.ts +2 -1
- package/dist/_internal/shared/listing-types/standard/schema.js +4 -1
- package/dist/_internal/shared/types/base-document.d.ts +15 -0
- package/dist/_internal/shared/types/base-document.js +1 -0
- package/dist/_internal/shared/types/index.d.ts +2 -0
- package/dist/_internal/shared/types/index.js +1 -0
- package/dist/client/api/ApiError.d.ts +10 -4
- package/dist/client/api/surface-error.js +0 -1
- package/dist/client.d.ts +8 -4
- package/dist/client.js +4 -2
- package/dist/constants/api-endpoints.d.ts +12 -0
- package/dist/constants/api-endpoints.js +4 -0
- package/dist/core/hooks/useSyncManager.js +4 -4
- package/dist/features/_guide-cls.d.ts +1 -1
- package/dist/features/_guide-cls.js +1 -1
- package/dist/features/about/components/AboutView.js +1 -4
- package/dist/features/about/components/FAQPageView.js +1 -1
- package/dist/features/about/components/FeesView.js +1 -1
- package/dist/features/about/components/HelpPageView.js +1 -1
- package/dist/features/about/components/HowOrdersWorkView.js +1 -1
- package/dist/features/about/components/PublicProfileView.js +6 -6
- package/dist/features/about/components/TrackOrderView.js +1 -1
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressForm.js +10 -2
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/account/components/BuyerAccountGuideView.js +1 -1
- package/dist/features/account/components/BuyerAuctionsGuideView.js +1 -1
- package/dist/features/account/components/BuyerOrdersGuideView.js +1 -1
- package/dist/features/account/components/BuyerShoppingGuideView.js +1 -1
- package/dist/features/account/components/ChatWindow.js +1 -1
- package/dist/features/account/components/MessagesView.js +1 -1
- package/dist/features/account/components/NotificationBell.js +25 -10
- package/dist/features/account/components/NotificationPreferencesPanel.js +2 -2
- package/dist/features/account/components/UserOffersPanel.js +1 -0
- package/dist/features/account/components/UserSidebar.js +1 -6
- package/dist/features/account/components/UserSupportView.js +1 -1
- package/dist/features/addresses/schemas/firestore.d.ts +2 -4
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +2 -2
- package/dist/features/admin/components/AdminBlogEditorView.js +1 -1
- package/dist/features/admin/components/AdminBundlesView.js +1 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
- package/dist/features/admin/components/AdminCatalogGuideView.js +2 -2
- package/dist/features/admin/components/AdminContentGuideView.js +2 -2
- package/dist/features/admin/components/AdminEmployeeEditorView.js +2 -2
- package/dist/features/admin/components/AdminFulfillmentView.d.ts +6 -0
- package/dist/features/admin/components/AdminFulfillmentView.js +107 -0
- package/dist/features/admin/components/AdminGuideHubView.js +1 -5
- package/dist/features/admin/components/AdminMediaView.js +1 -1
- package/dist/features/admin/components/AdminNavigationView.js +1 -1
- package/dist/features/admin/components/AdminOrdersGuideView.js +3 -3
- package/dist/features/admin/components/AdminPayoutsView.js +1 -4
- package/dist/features/admin/components/AdminProductEditorView.js +21 -9
- package/dist/features/admin/components/AdminProductsView.js +3 -0
- package/dist/features/admin/components/AdminSidebar.js +1 -6
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +9 -1
- package/dist/features/admin/components/AdminStoreEditorView.js +1 -1
- package/dist/features/admin/components/AdminStoresGuideView.js +2 -2
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -7
- package/dist/features/admin/components/AdminTeamGuideView.js +2 -2
- package/dist/features/admin/components/AdminTrustGuideView.js +3 -3
- package/dist/features/admin/components/AdminUsersGuideView.js +3 -3
- package/dist/features/admin/components/DashboardStats.js +6 -5
- package/dist/features/admin/components/DataListingView.d.ts +1 -0
- package/dist/features/admin/components/DataTable.js +2 -2
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +4 -6
- package/dist/features/admin/components/analytics/AdminStatCard.js +4 -3
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -1
- package/dist/features/admin/components/index.d.ts +2 -0
- package/dist/features/admin/components/index.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +3 -8
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -3
- package/dist/features/auctions/schemas/firestore.d.ts +2 -4
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/components/ForgotPasswordView.js +19 -8
- package/dist/features/auth/components/LoginForm.js +10 -2
- package/dist/features/auth/components/RegisterForm.js +10 -2
- package/dist/features/auth/components/ResetPasswordView.js +19 -8
- package/dist/features/auth/components/SocialAuthButtons.js +1 -1
- package/dist/features/before-after/components/BeforeAfterSlider.js +1 -1
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/api/[slug]/route.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
- package/dist/features/blog/components/BlogListView.js +1 -1
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/blog/schemas/firestore.d.ts +2 -4
- package/dist/features/blog/schemas/index.d.ts +6 -6
- package/dist/features/cart/components/CartDrawer.js +2 -2
- package/dist/features/cart/components/CartView.js +1 -1
- package/dist/features/cart/components/CheckoutView.js +1 -1
- package/dist/features/cart/schemas/firestore.d.ts +2 -4
- package/dist/features/categories/components/BrandDetailPageView.js +2 -1
- package/dist/features/categories/components/BundleDetailView.js +1 -1
- package/dist/features/categories/components/BundleItemsPicker.js +1 -1
- package/dist/features/categories/components/CategoryBundlesListing.js +3 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -1
- package/dist/features/categories/components/CategoryGrid.js +2 -1
- package/dist/features/categories/components/CategoryTableColumns.js +5 -2
- package/dist/features/categories/components/CategoryTree.js +3 -2
- package/dist/features/categories/components/ConcernCard.js +1 -1
- package/dist/features/categories/schemas/firestore.d.ts +2 -4
- package/dist/features/categories/schemas/index.d.ts +6 -6
- package/dist/features/checkout/components/CheckoutStepper.js +1 -1
- package/dist/features/collections/components/CollectionCard.js +1 -1
- package/dist/features/contact/components/ContactPageView.js +27 -27
- package/dist/features/contact/email.js +4 -4
- package/dist/features/copilot/components/AdminCopilotView.js +3 -3
- package/dist/features/email/primitives.d.ts +4 -0
- package/dist/features/email/primitives.js +4 -0
- package/dist/features/events/components/EventCard.js +2 -2
- package/dist/features/events/components/EventOfferCard.js +1 -1
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
- package/dist/features/events/components/EventRaffleWinnerView.js +2 -2
- package/dist/features/events/components/EventSaleBanner.js +0 -1
- package/dist/features/events/schemas/firestore.d.ts +2 -4
- package/dist/features/events/schemas/index.d.ts +4 -4
- package/dist/features/faq/components/ContactCTA.js +1 -1
- package/dist/features/faq/components/FAQAccordion.js +2 -2
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +2 -2
- package/dist/features/faq/components/RelatedFAQs.js +1 -1
- package/dist/features/faq/schemas/firestore.d.ts +2 -4
- package/dist/features/faq/schemas/index.d.ts +4 -4
- package/dist/features/filters/AsyncFacetSection.js +3 -3
- package/dist/features/filters/FilterFacetSection.js +6 -6
- package/dist/features/filters/RangeFilter.js +2 -2
- package/dist/features/filters/SwitchFilter.js +1 -1
- package/dist/features/forms/Checkbox.js +1 -1
- package/dist/features/forms/Slider.js +7 -2
- package/dist/features/forms/utils.d.ts +2 -2
- package/dist/features/forms/utils.js +2 -2
- package/dist/features/grouped/schemas/index.d.ts +2 -2
- package/dist/features/history/hooks/useHistory.js +1 -1
- package/dist/features/homepage/components/AdSlot.js +3 -3
- package/dist/features/homepage/components/AdvertisementBanner.js +5 -4
- package/dist/features/homepage/components/BeforeAfterCard.js +9 -1
- package/dist/features/homepage/components/CharacterHotspot.js +42 -49
- package/dist/features/homepage/components/CharacterHotspotForm.js +18 -20
- package/dist/features/homepage/components/CollectionCardsSection.js +2 -2
- package/dist/features/homepage/components/CustomCardsSection.js +3 -6
- package/dist/features/homepage/components/CustomerReviewsSection.js +1 -1
- package/dist/features/homepage/components/FAQSection.js +2 -2
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
- package/dist/features/homepage/components/GoogleReviewsSection.js +4 -4
- package/dist/features/homepage/components/HeroBanner.js +12 -63
- package/dist/features/homepage/components/HeroCarousel.js +6 -6
- package/dist/features/homepage/components/HeroSection.js +1 -1
- package/dist/features/homepage/components/HowItWorksInfoView.js +1 -1
- package/dist/features/homepage/components/HowItWorksSection.js +5 -3
- package/dist/features/homepage/components/NewsletterBanner.js +3 -7
- package/dist/features/homepage/components/PromoGrid.js +2 -26
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/homepage/components/SecurityHighlightsSection.js +6 -3
- package/dist/features/homepage/components/ShopByCategorySection.js +3 -3
- package/dist/features/homepage/components/SiteFeaturesSection.js +1 -1
- package/dist/features/homepage/components/SocialPostCard.js +2 -3
- package/dist/features/homepage/components/StatsCounterSection.js +6 -3
- package/dist/features/homepage/components/TestimonialsCarousel.js +2 -25
- package/dist/features/homepage/components/TrustBadges.js +1 -9
- package/dist/features/homepage/components/TrustFeaturesSection.js +6 -3
- package/dist/features/homepage/components/TrustIndicatorsSection.js +1 -1
- package/dist/features/homepage/components/WelcomeSection.js +2 -2
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -1
- package/dist/features/homepage/lib/franchise-colors.d.ts +7 -0
- package/dist/features/homepage/lib/franchise-colors.js +7 -0
- package/dist/features/homepage/lib/live-stats.js +5 -5
- package/dist/features/homepage/schemas/firestore.d.ts +4 -12
- package/dist/features/homepage/schemas/index.d.ts +2 -2
- package/dist/features/layout/AppLayoutShell.js +7 -9
- package/dist/features/layout/BottomNavbar.js +1 -2
- package/dist/features/messages/hooks/useConversation.js +2 -1
- package/dist/features/messages/hooks/useConversations.js +1 -0
- package/dist/features/messages/schemas/firestore.d.ts +2 -4
- package/dist/features/messages/schemas/index.d.ts +2 -2
- package/dist/features/orders/components/OrdersList.js +1 -1
- package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
- package/dist/features/orders/components/RefundHistoryTable.js +3 -2
- package/dist/features/orders/repository/orders.repository.d.ts +5 -0
- package/dist/features/orders/repository/orders.repository.js +26 -0
- package/dist/features/orders/schemas/firestore.d.ts +9 -5
- package/dist/features/orders/schemas/firestore.js +3 -0
- package/dist/features/payments/schemas/firestore.d.ts +2 -4
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -2
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +2 -1
- package/dist/features/pre-orders/schemas/index.d.ts +2 -2
- package/dist/features/products/components/CompareOverlay.js +11 -8
- package/dist/features/products/components/CustomSectionTabContent.js +1 -1
- package/dist/features/products/components/FeatureBadge.js +11 -1
- package/dist/features/products/components/GroupSettingsPanel.js +2 -2
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -1
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +2 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
- package/dist/features/products/components/PrizeDrawsIndexListing.js +1 -1
- package/dist/features/products/components/ProductCardMetadataSection.js +0 -1
- package/dist/features/products/components/ProductDetailPageView.js +1 -1
- package/dist/features/products/components/ProductFeatureBadges.js +1 -1
- package/dist/features/products/components/ProductGalleryClient.js +1 -1
- package/dist/features/products/components/ProductGrid.js +7 -7
- package/dist/features/products/components/ShareButton.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +7 -5
- package/dist/features/products/components/SublistingCarouselSection.js +2 -2
- package/dist/features/products/constants/action-defs.d.ts +16 -0
- package/dist/features/products/constants/action-defs.js +16 -0
- package/dist/features/products/constants/listing-tabs.d.ts +48 -0
- package/dist/features/products/constants/listing-tabs.js +12 -0
- package/dist/features/products/repository/products.repository.d.ts +37 -0
- package/dist/features/products/repository/products.repository.js +28 -1
- package/dist/features/products/schemas/firestore.d.ts +8 -6
- package/dist/features/products/schemas/firestore.js +2 -0
- package/dist/features/products/schemas/index.d.ts +8 -8
- package/dist/features/products/types/index.d.ts +2 -0
- package/dist/features/promotions/components/CouponCard.js +2 -2
- package/dist/features/promotions/schemas/firestore.d.ts +2 -4
- package/dist/features/promotions/schemas/index.d.ts +6 -6
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -3
- package/dist/features/reviews/components/ReviewModal.js +2 -4
- package/dist/features/reviews/components/ReviewSummary.js +3 -2
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/reviews/schemas/firestore.d.ts +2 -4
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/scams/actions/scam-actions.js +1 -1
- package/dist/features/scams/components/ScamProfileView.js +1 -1
- package/dist/features/scams/schemas/firestore.d.ts +2 -4
- package/dist/features/scams/schemas/index.d.ts +4 -4
- package/dist/features/search/components/Search.js +2 -2
- package/dist/features/search/components/SearchFiltersRow.js +1 -1
- package/dist/features/search/schemas/index.d.ts +3 -3
- package/dist/features/seller/components/BarcodeField.d.ts +17 -0
- package/dist/features/seller/components/BarcodeField.js +30 -0
- package/dist/features/seller/components/FulfillmentView.d.ts +5 -0
- package/dist/features/seller/components/FulfillmentView.js +120 -0
- package/dist/features/seller/components/PhysicalLocationModal.js +2 -3
- package/dist/features/seller/components/PrintCenterView.d.ts +3 -1
- package/dist/features/seller/components/PrintCenterView.js +52 -4
- package/dist/features/seller/components/SellerAddressesView.js +2 -1
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -1
- package/dist/features/seller/components/SellerBidsView.js +1 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerLiveView.js +1 -1
- package/dist/features/seller/components/SellerOffersPanel.js +1 -0
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutMethodsView.js +8 -2
- package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.d.ts +2 -0
- package/dist/features/seller/components/SellerProductShell.js +4 -3
- package/dist/features/seller/components/SellerProductsCards.js +1 -1
- package/dist/features/seller/components/SellerProductsView.js +1 -1
- package/dist/features/seller/components/SellerReviewsView.js +2 -1
- package/dist/features/seller/components/SellerShippingConfigsView.js +9 -3
- package/dist/features/seller/components/SellerShippingView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +3 -8
- package/dist/features/seller/components/SellerStoreCategoriesView.js +11 -3
- package/dist/features/seller/components/SellerTemplatesView.js +8 -2
- package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -1
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/schemas/index.d.ts +4 -4
- package/dist/features/shell/FormShell.js +2 -2
- package/dist/features/shell/QuickFormDrawer.js +1 -1
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -1
- package/dist/features/store-extensions/schemas/firestore.d.ts +12 -44
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +1 -1
- package/dist/features/stores/components/StoreClassifiedsListing.d.ts +5 -0
- package/dist/features/stores/components/StoreClassifiedsListing.js +48 -0
- package/dist/features/stores/components/StoreClassifiedsPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreClassifiedsPageView.js +20 -0
- package/dist/features/stores/components/StoreDetailLayoutView.js +23 -2
- package/dist/features/stores/components/StoreDigitalCodesListing.d.ts +5 -0
- package/dist/features/stores/components/StoreDigitalCodesListing.js +48 -0
- package/dist/features/stores/components/StoreDigitalCodesPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreDigitalCodesPageView.js +20 -0
- package/dist/features/stores/components/StoreGuideHubView.js +2 -9
- package/dist/features/stores/components/StoreHeader.js +1 -1
- package/dist/features/stores/components/StoreListingsGuideView.js +4 -4
- package/dist/features/stores/components/StoreLiveItemsListing.d.ts +5 -0
- package/dist/features/stores/components/StoreLiveItemsListing.js +48 -0
- package/dist/features/stores/components/StoreLiveItemsPageView.d.ts +4 -0
- package/dist/features/stores/components/StoreLiveItemsPageView.js +20 -0
- package/dist/features/stores/components/StoreOrdersGuideView.js +2 -2
- package/dist/features/stores/components/StoresIndexListing.js +1 -1
- package/dist/features/stores/components/index.d.ts +9 -0
- package/dist/features/stores/components/index.js +3 -0
- package/dist/features/stores/schemas/firestore.d.ts +2 -4
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/features/support/schemas/firestore.d.ts +2 -4
- package/dist/features/support/schemas/index.d.ts +2 -2
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +2 -2
- package/dist/features/wishlist/components/WishlistPage.js +1 -1
- package/dist/features/wishlist/components/WishlistToggleButton.js +3 -3
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
- package/dist/http/ApiClient.d.ts +1 -0
- package/dist/http/ApiClient.js +20 -0
- package/dist/monitoring/error-tracking.d.ts +0 -3
- package/dist/monitoring/error-tracking.js +1 -1
- package/dist/monitoring/server-logger.js +3 -3
- package/dist/next/components/GlobalError.js +1 -1
- package/dist/next/routing/route-map.d.ts +11 -0
- package/dist/next/routing/route-map.js +5 -0
- package/dist/react/ErrorBoundary.js +1 -1
- package/dist/schemas/registry.d.ts +24 -24
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -1
- package/dist/seed/products-preorders-seed-data.d.ts +2 -1
- package/dist/seed/products-standard-seed-data.js +8 -0
- package/dist/server-entry.d.ts +3 -0
- package/dist/server-entry.js +3 -0
- package/dist/server.d.ts +4 -4
- package/dist/styles.css +45 -7
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/default-light.js +3 -0
- package/dist/tokens/tokens.css +43 -6
- package/dist/ui/components/Anchor.d.ts +8 -1
- package/dist/ui/components/Anchor.js +16 -2
- package/dist/ui/components/Button.d.ts +5 -2
- package/dist/ui/components/Button.js +5 -2
- package/dist/ui/components/Details.d.ts +33 -2
- package/dist/ui/components/Details.js +73 -4
- package/dist/ui/components/Div.d.ts +3 -0
- package/dist/ui/components/Div.js +12 -1
- package/dist/ui/components/DynamicBgDiv.d.ts +13 -0
- package/dist/ui/components/DynamicBgDiv.js +18 -0
- package/dist/ui/components/Form.d.ts +3 -19
- package/dist/ui/components/Form.js +8 -1
- package/dist/ui/components/Layout.d.ts +12 -1
- package/dist/ui/components/Layout.js +9 -1
- package/dist/ui/components/Progress.d.ts +1 -1
- package/dist/ui/components/Progress.js +1 -0
- package/dist/ui/components/Progress.style.css +1 -0
- package/dist/ui/components/ProgressBarFill.d.ts +6 -0
- package/dist/ui/components/ProgressBarFill.js +11 -0
- package/dist/ui/components/Semantic.d.ts +26 -7
- package/dist/ui/components/Semantic.js +33 -8
- package/dist/ui/components/TextLink.d.ts +36 -1
- package/dist/ui/components/TextLink.js +30 -2
- package/dist/ui/components/Typography.d.ts +26 -6
- package/dist/ui/components/Typography.js +37 -13
- package/dist/ui/components/VacationBanner.js +0 -1
- package/dist/ui/components/surface-tokens.d.ts +12 -2
- package/dist/ui/components/surface-tokens.js +19 -1
- package/dist/ui/rich-text/RichText.js +1 -1
- package/dist/utils/id-generators.d.ts +8 -0
- package/dist/utils/id-generators.js +14 -0
- package/dist/validation/schemas.d.ts +1 -1
- package/package.json +2 -1
|
@@ -137,18 +137,34 @@ export const DETAIL_ACTIONS = {
|
|
|
137
137
|
auction: [ACTION_ID.PLACE_BID, ACTION_ID.BUY_NOW_AUCTION, ACTION_ID.WATCH_AUCTION, ACTION_ID.SHARE],
|
|
138
138
|
/** Pre-order: reserve, wishlist, share */
|
|
139
139
|
preorder: [ACTION_ID.RESERVE_NOW, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.SHARE],
|
|
140
|
+
/** Prize draw: enter, wishlist, share */
|
|
141
|
+
"prize-draw": [ACTION_ID.ENTER_PRIZE_DRAW, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.SHARE],
|
|
142
|
+
/** Classified: offer, share */
|
|
143
|
+
classified: [ACTION_ID.MAKE_OFFER, ACTION_ID.SHARE],
|
|
144
|
+
/** Digital code: buy now, share */
|
|
145
|
+
"digital-code": [ACTION_ID.BUY_NOW, ACTION_ID.SHARE],
|
|
146
|
+
/** Live item: buy now, wishlist, share */
|
|
147
|
+
live: [ACTION_ID.BUY_NOW, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.SHARE],
|
|
140
148
|
};
|
|
141
149
|
// Mobile bottom bar — 1–2 primary CTAs only (limited horizontal space)
|
|
142
150
|
export const MOBILE_PRIMARY_ACTIONS = {
|
|
143
151
|
product: [ACTION_ID.BUY_NOW, ACTION_ID.ADD_TO_CART],
|
|
144
152
|
auction: [ACTION_ID.PLACE_BID, ACTION_ID.BUY_NOW_AUCTION],
|
|
145
153
|
preorder: [ACTION_ID.RESERVE_NOW],
|
|
154
|
+
"prize-draw": [ACTION_ID.ENTER_PRIZE_DRAW],
|
|
155
|
+
classified: [ACTION_ID.MAKE_OFFER],
|
|
156
|
+
"digital-code": [ACTION_ID.BUY_NOW],
|
|
157
|
+
live: [ACTION_ID.BUY_NOW],
|
|
146
158
|
};
|
|
147
159
|
// Listing page bulk actions — shown in the bottom action bar when items are selected
|
|
148
160
|
export const LISTING_BULK_ACTIONS = {
|
|
149
161
|
products: [ACTION_ID.ADD_TO_CART, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
150
162
|
auctions: [ACTION_ID.WATCH_AUCTION, ACTION_ID.UNWATCH_AUCTION, ACTION_ID.COMPARE],
|
|
151
163
|
preorders: [ACTION_ID.ADD_TO_CART, ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
164
|
+
prizeDraws: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
165
|
+
classifieds: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
166
|
+
digitalCodes: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
167
|
+
live: [ACTION_ID.ADD_TO_WISHLIST, ACTION_ID.COMPARE],
|
|
152
168
|
stores: [ACTION_ID.COMPARE],
|
|
153
169
|
};
|
|
154
170
|
/** Maximum number of items the Compare overlay (BK3) supports at once. */
|
|
@@ -40,6 +40,18 @@ export declare const CATEGORY_PAGE_TABS: readonly [{
|
|
|
40
40
|
readonly id: "bundles";
|
|
41
41
|
readonly label: "Bundles";
|
|
42
42
|
readonly collection: "bundles";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "classifieds";
|
|
45
|
+
readonly label: "Classifieds";
|
|
46
|
+
readonly listingType: "classified";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "digital-codes";
|
|
49
|
+
readonly label: "Digital Codes";
|
|
50
|
+
readonly listingType: "digital-code";
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "live";
|
|
53
|
+
readonly label: "Live Items";
|
|
54
|
+
readonly listingType: "live";
|
|
43
55
|
}, {
|
|
44
56
|
readonly id: "stores";
|
|
45
57
|
readonly label: "Stores";
|
|
@@ -67,6 +79,18 @@ export declare const STORE_PAGE_TABS: readonly [{
|
|
|
67
79
|
readonly id: "bundles";
|
|
68
80
|
readonly label: "Bundles";
|
|
69
81
|
readonly collection: "bundles";
|
|
82
|
+
}, {
|
|
83
|
+
readonly id: "classifieds";
|
|
84
|
+
readonly label: "Classifieds";
|
|
85
|
+
readonly listingType: "classified";
|
|
86
|
+
}, {
|
|
87
|
+
readonly id: "digital-codes";
|
|
88
|
+
readonly label: "Digital Codes";
|
|
89
|
+
readonly listingType: "digital-code";
|
|
90
|
+
}, {
|
|
91
|
+
readonly id: "live";
|
|
92
|
+
readonly label: "Live Items";
|
|
93
|
+
readonly listingType: "live";
|
|
70
94
|
}];
|
|
71
95
|
export type StoreTabId = (typeof STORE_PAGE_TABS)[number]["id"];
|
|
72
96
|
/** Tabs shown on the seller-dashboard listings view + admin products list. */
|
|
@@ -89,6 +113,18 @@ export declare const SELLER_LISTING_TABS: readonly [{
|
|
|
89
113
|
readonly id: "prize-draws";
|
|
90
114
|
readonly label: "Prize Draws";
|
|
91
115
|
readonly listingType: "prize-draw";
|
|
116
|
+
}, {
|
|
117
|
+
readonly id: "classifieds";
|
|
118
|
+
readonly label: "Classifieds";
|
|
119
|
+
readonly listingType: "classified";
|
|
120
|
+
}, {
|
|
121
|
+
readonly id: "digital-codes";
|
|
122
|
+
readonly label: "Digital Codes";
|
|
123
|
+
readonly listingType: "digital-code";
|
|
124
|
+
}, {
|
|
125
|
+
readonly id: "live";
|
|
126
|
+
readonly label: "Live Items";
|
|
127
|
+
readonly listingType: "live";
|
|
92
128
|
}];
|
|
93
129
|
export type SellerListingTabId = (typeof SELLER_LISTING_TABS)[number]["id"];
|
|
94
130
|
/** Tabs shown on `/search` results. */
|
|
@@ -115,5 +151,17 @@ export declare const SEARCH_RESULT_TABS: readonly [{
|
|
|
115
151
|
readonly id: "bundles";
|
|
116
152
|
readonly label: "Bundles";
|
|
117
153
|
readonly collection: "bundles";
|
|
154
|
+
}, {
|
|
155
|
+
readonly id: "classifieds";
|
|
156
|
+
readonly label: "Classifieds";
|
|
157
|
+
readonly listingType: "classified";
|
|
158
|
+
}, {
|
|
159
|
+
readonly id: "digital-codes";
|
|
160
|
+
readonly label: "Digital Codes";
|
|
161
|
+
readonly listingType: "digital-code";
|
|
162
|
+
}, {
|
|
163
|
+
readonly id: "live";
|
|
164
|
+
readonly label: "Live Items";
|
|
165
|
+
readonly listingType: "live";
|
|
118
166
|
}];
|
|
119
167
|
export type SearchTabId = (typeof SEARCH_RESULT_TABS)[number]["id"];
|
|
@@ -15,6 +15,9 @@ export const CATEGORY_PAGE_TABS = [
|
|
|
15
15
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
16
16
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
17
17
|
{ id: "bundles", label: "Bundles", collection: "bundles" },
|
|
18
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
19
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
20
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
18
21
|
{ id: "stores", label: "Stores", entity: "stores" },
|
|
19
22
|
];
|
|
20
23
|
/** Tabs shown on the public `/stores/[slug]` nav bar. */
|
|
@@ -24,6 +27,9 @@ export const STORE_PAGE_TABS = [
|
|
|
24
27
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
25
28
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
26
29
|
{ id: "bundles", label: "Bundles", collection: "bundles" },
|
|
30
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
31
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
32
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
27
33
|
];
|
|
28
34
|
/** Tabs shown on the seller-dashboard listings view + admin products list. */
|
|
29
35
|
export const SELLER_LISTING_TABS = [
|
|
@@ -32,6 +38,9 @@ export const SELLER_LISTING_TABS = [
|
|
|
32
38
|
{ id: "auctions", label: "Auctions", listingType: "auction" },
|
|
33
39
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
34
40
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
41
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
42
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
43
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
35
44
|
];
|
|
36
45
|
/** Tabs shown on `/search` results. */
|
|
37
46
|
export const SEARCH_RESULT_TABS = [
|
|
@@ -41,4 +50,7 @@ export const SEARCH_RESULT_TABS = [
|
|
|
41
50
|
{ id: "pre-orders", label: "Pre-Orders", listingType: "pre-order" },
|
|
42
51
|
{ id: "prize-draws", label: "Prize Draws", listingType: "prize-draw" },
|
|
43
52
|
{ id: "bundles", label: "Bundles", collection: "bundles" },
|
|
53
|
+
{ id: "classifieds", label: "Classifieds", listingType: "classified" },
|
|
54
|
+
{ id: "digital-codes", label: "Digital Codes", listingType: "digital-code" },
|
|
55
|
+
{ id: "live", label: "Live Items", listingType: "live" },
|
|
44
56
|
];
|
|
@@ -18,6 +18,7 @@ export declare class ProductRepository extends BaseRepository<ProductDocument> {
|
|
|
18
18
|
findByStatus(status: ProductStatus): Promise<ProductDocument[]>;
|
|
19
19
|
findFeatured(): Promise<ProductDocument[]>;
|
|
20
20
|
findByCategory(category: string): Promise<ProductDocument[]>;
|
|
21
|
+
findByBarcodeId(barcodeId: string): Promise<ProductDocument | null>;
|
|
21
22
|
findBySlug(slug: string): Promise<ProductDocument | undefined>;
|
|
22
23
|
findByIdOrSlug(idOrSlug: string): Promise<ProductDocument | undefined>;
|
|
23
24
|
/**
|
|
@@ -206,6 +207,42 @@ export declare class ProductRepository extends BaseRepository<ProductDocument> {
|
|
|
206
207
|
canFilter: boolean;
|
|
207
208
|
canSort: boolean;
|
|
208
209
|
};
|
|
210
|
+
"classified.meetupArea": {
|
|
211
|
+
canFilter: boolean;
|
|
212
|
+
canSort: boolean;
|
|
213
|
+
};
|
|
214
|
+
"classified.acceptsShipping": {
|
|
215
|
+
canFilter: boolean;
|
|
216
|
+
canSort: boolean;
|
|
217
|
+
};
|
|
218
|
+
"classified.negotiable": {
|
|
219
|
+
canFilter: boolean;
|
|
220
|
+
canSort: boolean;
|
|
221
|
+
};
|
|
222
|
+
"digitalCode.codeDeliveryMethod": {
|
|
223
|
+
canFilter: boolean;
|
|
224
|
+
canSort: boolean;
|
|
225
|
+
};
|
|
226
|
+
"digitalCode.codesAvailable": {
|
|
227
|
+
canFilter: boolean;
|
|
228
|
+
canSort: boolean;
|
|
229
|
+
};
|
|
230
|
+
"liveItem.species": {
|
|
231
|
+
canFilter: boolean;
|
|
232
|
+
canSort: boolean;
|
|
233
|
+
};
|
|
234
|
+
"liveItem.sex": {
|
|
235
|
+
canFilter: boolean;
|
|
236
|
+
canSort: boolean;
|
|
237
|
+
};
|
|
238
|
+
"liveItem.jurisdictionAllowed": {
|
|
239
|
+
canFilter: boolean;
|
|
240
|
+
canSort: boolean;
|
|
241
|
+
};
|
|
242
|
+
"liveItem.cites": {
|
|
243
|
+
canFilter: boolean;
|
|
244
|
+
canSort: boolean;
|
|
245
|
+
};
|
|
209
246
|
};
|
|
210
247
|
/**
|
|
211
248
|
* Virtual filter aliases — callers can pass `f=listingType==auction` for
|
|
@@ -3,7 +3,7 @@ import { increment, serverTimestamp } from "../../../contracts/field-ops";
|
|
|
3
3
|
import { DatabaseError } from "../../../errors";
|
|
4
4
|
import { BaseRepository, prepareForFirestore, } from "../../../providers/db-firebase";
|
|
5
5
|
import { cacheManager } from "../../../core";
|
|
6
|
-
import { generateUniqueId, slugify, buildSearchTokens, tokenizeQuery } from "../../../utils";
|
|
6
|
+
import { generateUniqueId, slugify, buildSearchTokens, tokenizeQuery, generateBarcodeId } from "../../../utils";
|
|
7
7
|
import { PRODUCT_COLLECTION, ProductStatusValues, } from "../schemas";
|
|
8
8
|
import { PRODUCT_FIELDS } from "../../../constants/field-names";
|
|
9
9
|
/**
|
|
@@ -20,11 +20,17 @@ const SIEVE_CLAUSE_LT_AUCTION = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_
|
|
|
20
20
|
const SIEVE_CLAUSE_LT_PREORDER = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRE_ORDER}`;
|
|
21
21
|
const SIEVE_CLAUSE_LT_STANDARD = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.STANDARD}`;
|
|
22
22
|
const SIEVE_CLAUSE_LT_PRIZE_DRAW = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.PRIZE_DRAW}`;
|
|
23
|
+
const SIEVE_CLAUSE_LT_CLASSIFIED = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.CLASSIFIED}`;
|
|
24
|
+
const SIEVE_CLAUSE_LT_DIGITAL_CODE = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.DIGITAL_CODE}`;
|
|
25
|
+
const SIEVE_CLAUSE_LT_LIVE = `${PRODUCT_FIELDS.LISTING_TYPE}==${LISTING_TYPE_VALUES.LIVE}`;
|
|
23
26
|
const LISTING_KIND_ALIAS_MAP = {
|
|
24
27
|
standard: LISTING_TYPE_VALUES.STANDARD,
|
|
25
28
|
auction: LISTING_TYPE_VALUES.AUCTION,
|
|
26
29
|
"pre-order": LISTING_TYPE_VALUES.PRE_ORDER,
|
|
27
30
|
"prize-draw": LISTING_TYPE_VALUES.PRIZE_DRAW,
|
|
31
|
+
classified: LISTING_TYPE_VALUES.CLASSIFIED,
|
|
32
|
+
"digital-code": LISTING_TYPE_VALUES.DIGITAL_CODE,
|
|
33
|
+
live: LISTING_TYPE_VALUES.LIVE,
|
|
28
34
|
// Legacy → canonical.
|
|
29
35
|
product: LISTING_TYPE_VALUES.STANDARD,
|
|
30
36
|
preorder: LISTING_TYPE_VALUES.PRE_ORDER,
|
|
@@ -105,8 +111,10 @@ export class ProductRepository extends BaseRepository {
|
|
|
105
111
|
return false;
|
|
106
112
|
}
|
|
107
113
|
});
|
|
114
|
+
const barcodeId = input.barcodeId ?? await generateBarcodeId(id);
|
|
108
115
|
const productData = {
|
|
109
116
|
...input,
|
|
117
|
+
barcodeId,
|
|
110
118
|
slug: id,
|
|
111
119
|
availableQuantity: input.stockQuantity,
|
|
112
120
|
searchTokens: buildProductSearchTokens(input),
|
|
@@ -136,6 +144,10 @@ export class ProductRepository extends BaseRepository {
|
|
|
136
144
|
.get();
|
|
137
145
|
return snap.docs.map((d) => this.mapDoc(d));
|
|
138
146
|
}
|
|
147
|
+
async findByBarcodeId(barcodeId) {
|
|
148
|
+
const docs = await this.findBy("barcodeId", barcodeId);
|
|
149
|
+
return docs[0] ?? null;
|
|
150
|
+
}
|
|
139
151
|
async findBySlug(slug) {
|
|
140
152
|
const key = this.cacheKeyBySlug(slug);
|
|
141
153
|
const cached = cacheManager.get(key);
|
|
@@ -486,6 +498,15 @@ ProductRepository.SIEVE_FIELDS = {
|
|
|
486
498
|
currency: { canFilter: true, canSort: false },
|
|
487
499
|
freeShipping: { canFilter: true, canSort: false },
|
|
488
500
|
searchTokens: { canFilter: true, canSort: false },
|
|
501
|
+
"classified.meetupArea": { canFilter: true, canSort: false },
|
|
502
|
+
"classified.acceptsShipping": { canFilter: true, canSort: false },
|
|
503
|
+
"classified.negotiable": { canFilter: true, canSort: false },
|
|
504
|
+
"digitalCode.codeDeliveryMethod": { canFilter: true, canSort: false },
|
|
505
|
+
"digitalCode.codesAvailable": { canFilter: true, canSort: true },
|
|
506
|
+
"liveItem.species": { canFilter: true, canSort: false },
|
|
507
|
+
"liveItem.sex": { canFilter: true, canSort: false },
|
|
508
|
+
"liveItem.jurisdictionAllowed": { canFilter: true, canSort: false },
|
|
509
|
+
"liveItem.cites": { canFilter: true, canSort: false },
|
|
489
510
|
};
|
|
490
511
|
/**
|
|
491
512
|
* Virtual filter aliases — callers can pass `f=listingType==auction` for
|
|
@@ -540,6 +561,12 @@ ProductRepository.FILTER_ALIASES = {
|
|
|
540
561
|
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_PREORDER].join(",");
|
|
541
562
|
case "publicPrizeDraws":
|
|
542
563
|
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_PRIZE_DRAW].join(",");
|
|
564
|
+
case "publicClassifieds":
|
|
565
|
+
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_CLASSIFIED].join(",");
|
|
566
|
+
case "publicDigitalCodes":
|
|
567
|
+
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_DIGITAL_CODE].join(",");
|
|
568
|
+
case "publicLive":
|
|
569
|
+
return [SIEVE_CLAUSE_PUBLISHED, SIEVE_CLAUSE_LT_LIVE].join(",");
|
|
543
570
|
case "published":
|
|
544
571
|
return SIEVE_CLAUSE_PUBLISHED;
|
|
545
572
|
default:
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type GenerateProductIdInput, type GenerateAuctionIdInput, type GeneratePreOrderIdInput } from "../../../utils/id-generators";
|
|
5
5
|
import type { ProductStatus, ListingType } from "../types";
|
|
6
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
6
7
|
export interface ProductVideoField {
|
|
7
8
|
url: string;
|
|
8
9
|
thumbnailUrl: string;
|
|
@@ -103,8 +104,7 @@ export interface ProductLiveItemMeta {
|
|
|
103
104
|
/** CITES permit number (Appendix I/II species). */
|
|
104
105
|
cites?: string;
|
|
105
106
|
}
|
|
106
|
-
export interface ProductDocument {
|
|
107
|
-
id: string;
|
|
107
|
+
export interface ProductDocument extends BaseDocument {
|
|
108
108
|
title: string;
|
|
109
109
|
description: string;
|
|
110
110
|
slug?: string;
|
|
@@ -264,9 +264,11 @@ export interface ProductDocument {
|
|
|
264
264
|
shelf: string;
|
|
265
265
|
bin: string;
|
|
266
266
|
};
|
|
267
|
+
/** Scannable barcode identifier linking this listing to a physical stickered item.
|
|
268
|
+
* Auto-generated as `LIR-{8-char-hex}` on product creation when not supplied.
|
|
269
|
+
* Override by scanning a pre-printed sticker during the create/edit flow. */
|
|
270
|
+
barcodeId?: string;
|
|
267
271
|
searchTokens?: string[];
|
|
268
|
-
createdAt: Date;
|
|
269
|
-
updatedAt: Date;
|
|
270
272
|
}
|
|
271
273
|
/**
|
|
272
274
|
* Single prize within a prize-draw listing. A draw can have between 3 and 16
|
|
@@ -294,10 +296,10 @@ export declare const ProductStatusValues: {
|
|
|
294
296
|
readonly ARCHIVED: "archived";
|
|
295
297
|
};
|
|
296
298
|
export declare const PRODUCT_COLLECTION: "products";
|
|
297
|
-
export declare const PRODUCT_INDEXED_FIELDS: readonly ["storeId", "status", "category", "featured", "listingType", "isPromoted", "isOnSale", "isSold", "searchTokens", "createdAt"];
|
|
299
|
+
export declare const PRODUCT_INDEXED_FIELDS: readonly ["storeId", "status", "category", "featured", "listingType", "isPromoted", "isOnSale", "isSold", "searchTokens", "createdAt", "barcodeId"];
|
|
298
300
|
export declare const DEFAULT_PRODUCT_DATA: Partial<ProductDocument>;
|
|
299
301
|
export declare const PRODUCT_PUBLIC_FIELDS: readonly ["id", "title", "description", "category", "subcategory", "brand", "price", "currency", "stockQuantity", "availableQuantity", "images", "status", "storeName", "featured", "tags", "specifications", "features", "shippingInfo", "returnPolicy", "listingType", "auctionEndDate", "startingBid", "currentBid", "bidCount", "reservePrice", "buyNowPrice", "minBidIncrement", "autoExtendable", "auctionExtensionMinutes", "auctionShippingPaidBy", "buyItNowPriceInPaise", "bidsHaveStarted", "grading", "card", "classified", "digitalCode", "liveItem", "catalogProductId", "preOrderDeliveryDate", "preOrderDepositPercent", "preOrderDepositAmount", "preOrderMaxQuantity", "preOrderCurrentCount", "preOrderProductionStatus", "preOrderCancellable", "condition", "insurance", "insuranceCost", "shippingPaidBy", "isPromoted", "isOnSale", "isSold", "slug", "seoTitle", "seoDescription", "seoKeywords", "viewCount", "customFields", "customSections", "sublistingCategoryId", "groupId", "isGroupParent", "groupParentSlug", "groupChildSlugs", "groupTitle", "createdAt"];
|
|
300
|
-
export declare const PRODUCT_UPDATABLE_FIELDS: readonly ["title", "description", "category", "subcategory", "brand", "price", "stockQuantity", "images", "status", "tags", "specifications", "features", "shippingInfo", "returnPolicy", "pickupAddressId", "condition", "insurance", "shippingPaidBy", "autoExtendable", "auctionExtensionMinutes", "auctionShippingPaidBy", "reservePrice", "buyNowPrice", "minBidIncrement", "buyItNowPriceInPaise", "bidsHaveStarted", "grading", "card", "classified", "digitalCode", "liveItem", "catalogProductId", "listingType", "preOrderDeliveryDate", "preOrderDepositPercent", "preOrderDepositAmount", "preOrderMaxQuantity", "preOrderProductionStatus", "preOrderCancellable", "isOnSale", "isSold", "seoTitle", "seoDescription", "seoKeywords", "customFields", "customSections", "sublistingCategoryId", "groupId", "isGroupParent", "groupParentSlug", "groupChildSlugs", "groupTitle"];
|
|
302
|
+
export declare const PRODUCT_UPDATABLE_FIELDS: readonly ["title", "description", "category", "subcategory", "brand", "price", "stockQuantity", "images", "status", "tags", "specifications", "features", "shippingInfo", "returnPolicy", "pickupAddressId", "condition", "insurance", "shippingPaidBy", "autoExtendable", "auctionExtensionMinutes", "auctionShippingPaidBy", "reservePrice", "buyNowPrice", "minBidIncrement", "buyItNowPriceInPaise", "bidsHaveStarted", "grading", "card", "classified", "digitalCode", "liveItem", "catalogProductId", "listingType", "preOrderDeliveryDate", "preOrderDepositPercent", "preOrderDepositAmount", "preOrderMaxQuantity", "preOrderProductionStatus", "preOrderCancellable", "isOnSale", "isSold", "seoTitle", "seoDescription", "seoKeywords", "customFields", "customSections", "sublistingCategoryId", "groupId", "isGroupParent", "groupParentSlug", "groupChildSlugs", "groupTitle", "barcodeId"];
|
|
301
303
|
export type ProductCreateInput = Omit<ProductDocument, "id" | "createdAt" | "updatedAt" | "availableQuantity" | "bidCount" | "currentBid" | "auctionOriginalEndDate">;
|
|
302
304
|
export type ProductUpdateInput = Partial<Pick<ProductDocument, (typeof PRODUCT_UPDATABLE_FIELDS)[number]>>;
|
|
303
305
|
export type ProductAdminUpdateInput = Partial<Omit<ProductDocument, "id" | "createdAt">>;
|
|
@@ -23,6 +23,7 @@ export const PRODUCT_INDEXED_FIELDS = [
|
|
|
23
23
|
"isSold",
|
|
24
24
|
"searchTokens",
|
|
25
25
|
"createdAt",
|
|
26
|
+
"barcodeId",
|
|
26
27
|
];
|
|
27
28
|
export const DEFAULT_PRODUCT_DATA = {
|
|
28
29
|
status: "draft",
|
|
@@ -173,6 +174,7 @@ export const PRODUCT_UPDATABLE_FIELDS = [
|
|
|
173
174
|
"groupParentSlug",
|
|
174
175
|
"groupChildSlugs",
|
|
175
176
|
"groupTitle",
|
|
177
|
+
"barcodeId",
|
|
176
178
|
];
|
|
177
179
|
// ── SB-UNI-N 2026-05-15 — Digital-code pool subcollection ───────────────────
|
|
178
180
|
// Codes live at `products/{productId}/codes/{codeId}` — seller-only write,
|
|
@@ -263,8 +263,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
263
263
|
unit?: string | undefined;
|
|
264
264
|
}>, "many">>;
|
|
265
265
|
}, "strip", z.ZodTypeAny, {
|
|
266
|
-
id: string;
|
|
267
266
|
title: string;
|
|
267
|
+
id: string;
|
|
268
268
|
text?: string | undefined;
|
|
269
269
|
fields?: {
|
|
270
270
|
value: string;
|
|
@@ -273,8 +273,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
273
273
|
unit?: string | undefined;
|
|
274
274
|
}[] | undefined;
|
|
275
275
|
}, {
|
|
276
|
-
id: string;
|
|
277
276
|
title: string;
|
|
277
|
+
id: string;
|
|
278
278
|
text?: string | undefined;
|
|
279
279
|
fields?: {
|
|
280
280
|
value: string;
|
|
@@ -285,9 +285,9 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
285
285
|
}>, "many">>;
|
|
286
286
|
}, "strip", z.ZodTypeAny, {
|
|
287
287
|
status: "draft" | "published" | "archived" | "in_review";
|
|
288
|
-
id: string;
|
|
289
288
|
title: string;
|
|
290
289
|
price: number;
|
|
290
|
+
id: string;
|
|
291
291
|
currency?: string | undefined;
|
|
292
292
|
video?: {
|
|
293
293
|
url: string;
|
|
@@ -356,8 +356,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
356
356
|
unit?: string | undefined;
|
|
357
357
|
}[] | undefined;
|
|
358
358
|
customSections?: {
|
|
359
|
-
id: string;
|
|
360
359
|
title: string;
|
|
360
|
+
id: string;
|
|
361
361
|
text?: string | undefined;
|
|
362
362
|
fields?: {
|
|
363
363
|
value: string;
|
|
@@ -414,9 +414,9 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
414
414
|
publishedAt?: string | undefined;
|
|
415
415
|
}, {
|
|
416
416
|
status: "draft" | "published" | "archived" | "in_review";
|
|
417
|
-
id: string;
|
|
418
417
|
title: string;
|
|
419
418
|
price: number;
|
|
419
|
+
id: string;
|
|
420
420
|
currency?: string | undefined;
|
|
421
421
|
video?: {
|
|
422
422
|
url: string;
|
|
@@ -485,8 +485,8 @@ export declare const productItemSchema: z.ZodObject<{
|
|
|
485
485
|
unit?: string | undefined;
|
|
486
486
|
}[] | undefined;
|
|
487
487
|
customSections?: {
|
|
488
|
-
id: string;
|
|
489
488
|
title: string;
|
|
489
|
+
id: string;
|
|
490
490
|
text?: string | undefined;
|
|
491
491
|
fields?: {
|
|
492
492
|
value: string;
|
|
@@ -565,8 +565,8 @@ export declare const productListParamsSchema: z.ZodObject<{
|
|
|
565
565
|
featured?: boolean | undefined;
|
|
566
566
|
listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle" | undefined;
|
|
567
567
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
568
|
-
q?: string | undefined;
|
|
569
568
|
page?: number | undefined;
|
|
569
|
+
q?: string | undefined;
|
|
570
570
|
perPage?: number | undefined;
|
|
571
571
|
minPrice?: number | undefined;
|
|
572
572
|
maxPrice?: number | undefined;
|
|
@@ -579,8 +579,8 @@ export declare const productListParamsSchema: z.ZodObject<{
|
|
|
579
579
|
featured?: boolean | undefined;
|
|
580
580
|
listingType?: "standard" | "auction" | "pre-order" | "prize-draw" | "bundle" | undefined;
|
|
581
581
|
condition?: "new" | "used" | "refurbished" | "broken" | "like_new" | "good" | "fair" | "poor" | undefined;
|
|
582
|
-
q?: string | undefined;
|
|
583
582
|
page?: number | undefined;
|
|
583
|
+
q?: string | undefined;
|
|
584
584
|
perPage?: number | undefined;
|
|
585
585
|
minPrice?: number | undefined;
|
|
586
586
|
maxPrice?: number | undefined;
|
|
@@ -149,6 +149,8 @@ export interface ProductItem {
|
|
|
149
149
|
shelf: string;
|
|
150
150
|
bin: string;
|
|
151
151
|
};
|
|
152
|
+
/** Scannable barcode ID linking this listing to a physical stickered item. */
|
|
153
|
+
barcodeId?: string;
|
|
152
154
|
}
|
|
153
155
|
export interface ProductListResponse {
|
|
154
156
|
items: ProductItem[];
|
|
@@ -104,7 +104,7 @@ export function CouponCard({ coupon, labels: labelsProp, onCopy, className = "",
|
|
|
104
104
|
const handleCopy = () => {
|
|
105
105
|
if (!n.code)
|
|
106
106
|
return;
|
|
107
|
-
navigator.clipboard.writeText(n.code).catch(
|
|
107
|
+
navigator.clipboard.writeText(n.code).catch(console.error);
|
|
108
108
|
setCopied(true);
|
|
109
109
|
onCopy?.(n.code);
|
|
110
110
|
setTimeout(() => setCopied(false), 2000);
|
|
@@ -159,7 +159,7 @@ export function CouponCard({ coupon, labels: labelsProp, onCopy, className = "",
|
|
|
159
159
|
setBusy(null);
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
return (_jsxs(Stack, { className: `group relative h-full border-2 ${colors.card} ${isSelected ? "ring-2 ring-primary" : ""} ${!n.isActive ? "opacity-70" : ""} ${className}`, rounded: "xl", padding: "md", onMouseDown: onSelect && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: onSelect && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: onSelect && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: onSelect && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: onSelect && !isSelected ? longPress.onTouchEnd : undefined, children: [onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onSelect(n.id, !isSelected); }, label: isSelected ? "Deselect coupon" : "Select coupon", position: "top-2 right-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), (hasAdminActions || n.scope) && (_jsxs(Row, { gap: "xs", wrap: true, className: "mb-2", children: [_jsx(Badge, { variant: n.isActive ? "active" : "inactive", size: "xs", className: "text-[10px] uppercase tracking-wide", children: n.isActive ? labels.active : labels.inactive }), n.scope && (_jsx(Span, { layout: "inline-flex", weight: "semibold", className: "bg-
|
|
162
|
+
return (_jsxs(Stack, { className: `group relative h-full border-2 ${colors.card} ${isSelected ? "ring-2 ring-primary" : ""} ${!n.isActive ? "opacity-70" : ""} ${className}`, rounded: "xl", padding: "md", onMouseDown: onSelect && !isSelected ? longPress.onMouseDown : undefined, onMouseUp: onSelect && !isSelected ? longPress.onMouseUp : undefined, onMouseLeave: onSelect && !isSelected ? longPress.onMouseLeave : undefined, onTouchStart: onSelect && !isSelected ? longPress.onTouchStart : undefined, onTouchEnd: onSelect && !isSelected ? longPress.onTouchEnd : undefined, children: [onSelect && (_jsx(BaseListingCard.Checkbox, { selected: isSelected, onSelect: (e) => { e.preventDefault(); onSelect(n.id, !isSelected); }, label: isSelected ? "Deselect coupon" : "Select coupon", position: "top-2 right-2", className: selectable || isSelected ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity" })), (hasAdminActions || n.scope) && (_jsxs(Row, { gap: "xs", wrap: true, className: "mb-2", children: [_jsx(Badge, { variant: n.isActive ? "active" : "inactive", size: "xs", className: "text-[10px] uppercase tracking-wide", children: n.isActive ? labels.active : labels.inactive }), n.scope && (_jsx(Span, { layout: "inline-flex", weight: "semibold", className: "bg-neutral-200/70 text-[10px] tracking-wide dark:bg-neutral-700/60", rounded: "full", padding: "pill-xs", color: "primary", transform: "uppercase", children: n.scope }))] })), _jsxs(Div, { className: "mb-3", children: [_jsx(Text, { className: "font-extrabold tracking-tight leading-none", size: "2xl", children: discountLabel }), n.name && (_jsx(Text, { className: "mt-0.5 opacity-80", size: "sm", weight: "medium", children: n.name }))] }), n.description && (_jsx(Text, { className: "opacity-60 mb-3", size: "xs", children: n.description })), _jsxs(Row, { className: `border border-dashed ${colors.code}`, align: "center", gap: "sm", rounded: "lg", padding: "inlineSm", children: [_jsx(Span, { size: "sm", weight: "bold", className: "flex-1 font-mono tracking-widest select-all", transform: "uppercase", children: n.code || "—" }), n.code && (_jsx("button", { type: "button", onClick: handleCopy, className: "shrink-0 rounded-md px-2.5 py-1 text-xs font-semibold transition-all hover:opacity-80 active:scale-95 bg-white/60 dark:bg-black/20 border border-current/20", "aria-label": "Copy coupon code", children: copied ? labels.copied : labels.copy }))] }), showClaim && n.code && n.isActive && (_jsx(Div, { className: "mt-2", children: _jsx("button", { type: "button", onClick: handleClaim, disabled: claiming, className: "w-full rounded-md px-3 py-1.5 text-xs font-semibold transition-all active:scale-95 bg-[var(--appkit-color-primary-700)] text-[var(--appkit-color-text-on-primary)] hover:bg-[var(--appkit-color-primary-800)] disabled:opacity-50", "aria-label": `Claim coupon ${n.code} and apply at checkout`, children: claiming ? labels.claiming : labels.claim }) })), _jsxs(Row, { textSize: "xs", wrap: true, gap: "sm", className: "opacity-60 mt-2", children: [n.minOrderAmount ? (_jsxs(Span, { children: [labels.minOrder, ": \u20B9", (n.minOrderAmount / 100).toFixed(0)] })) : null, expiry && (_jsxs(Span, { children: [labels.expires, ": ", expiry] })), n.usageLimit ? (_jsxs(Span, { children: [n.usageCount, "/", n.usageLimit, " ", labels.used] })) : n.usageCount > 0 ? (_jsxs(Span, { children: [n.usageCount, " ", labels.used] })) : null] }), hasAdminActions && (_jsxs(Row, { gap: "xs", justify: "end", className: "mt-auto", padding: "t-sm", children: [onEdit && (_jsx("button", { type: "button", onClick: () => onEdit(n.id), title: labels.edit, "aria-label": labels.edit, className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-white/60 dark:hover:bg-black/30 hover:text-zinc-800 dark:hover:text-zinc-200 transition-colors", children: _jsx(Pencil, { className: "h-4 w-4" }) })), onToggleActive && (_jsx("button", { type: "button", onClick: handleToggle, disabled: busy === "toggle", title: n.isActive ? labels.deactivate : labels.activate, "aria-label": n.isActive ? labels.deactivate : labels.activate, className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-white/60 dark:hover:bg-black/30 transition-colors disabled:opacity-50", children: n.isActive
|
|
163
163
|
? _jsx(ToggleRight, { className: CLS_TOGGLE_ON })
|
|
164
164
|
: _jsx(ToggleLeft, { className: "h-4 w-4" }) })), onDelete && (_jsx("button", { type: "button", onClick: () => setDeleteConfirmOpen(true), disabled: busy === "delete", title: labels.delete, "aria-label": labels.delete, className: CLS_DELETE_BTN, children: _jsx(Trash2, { className: "h-4 w-4" }) }))] })), deleteConfirmOpen && (_jsx(ConfirmDeleteModal, { isOpen: true, title: "Delete Coupon", message: labels.deleteConfirm, onConfirm: handleDeleteConfirmed, onClose: () => setDeleteConfirmOpen(false), isDeleting: busy === "delete" }))] }));
|
|
165
165
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Coupons/Promotions Firestore Document Types & Constants
|
|
3
3
|
*/
|
|
4
4
|
import type { CouponType } from "../types";
|
|
5
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
5
6
|
export interface DiscountConfig {
|
|
6
7
|
value: number;
|
|
7
8
|
maxDiscount?: number;
|
|
@@ -41,8 +42,7 @@ export interface CouponStats {
|
|
|
41
42
|
totalRevenue: number;
|
|
42
43
|
totalDiscount: number;
|
|
43
44
|
}
|
|
44
|
-
export interface CouponDocument {
|
|
45
|
-
id: string;
|
|
45
|
+
export interface CouponDocument extends BaseDocument {
|
|
46
46
|
code: string;
|
|
47
47
|
name: string;
|
|
48
48
|
description: string;
|
|
@@ -58,8 +58,6 @@ export interface CouponDocument {
|
|
|
58
58
|
validity: ValidityConfig;
|
|
59
59
|
restrictions: RestrictionsConfig;
|
|
60
60
|
createdBy: string;
|
|
61
|
-
createdAt: Date;
|
|
62
|
-
updatedAt: Date;
|
|
63
61
|
stats: CouponStats;
|
|
64
62
|
}
|
|
65
63
|
export interface CouponUsageDocument {
|
|
@@ -277,8 +277,8 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
277
277
|
createdAt: string | Date | z.objectOutputType<{
|
|
278
278
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
279
279
|
}, z.ZodTypeAny, "passthrough">;
|
|
280
|
-
id: string;
|
|
281
280
|
description: string;
|
|
281
|
+
id: string;
|
|
282
282
|
updatedAt: string | Date | z.objectOutputType<{
|
|
283
283
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
284
284
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -336,8 +336,8 @@ export declare const couponFirestoreSchema: z.ZodObject<{
|
|
|
336
336
|
createdAt: string | Date | z.objectInputType<{
|
|
337
337
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
338
338
|
}, z.ZodTypeAny, "passthrough">;
|
|
339
|
-
id: string;
|
|
340
339
|
description: string;
|
|
340
|
+
id: string;
|
|
341
341
|
updatedAt: string | Date | z.objectInputType<{
|
|
342
342
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
343
343
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -758,8 +758,8 @@ export declare const couponItemSchema: z.ZodObject<{
|
|
|
758
758
|
code: string;
|
|
759
759
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
760
760
|
createdAt: string;
|
|
761
|
-
id: string;
|
|
762
761
|
description: string;
|
|
762
|
+
id: string;
|
|
763
763
|
updatedAt: string;
|
|
764
764
|
name: string;
|
|
765
765
|
scope: "seller" | "admin";
|
|
@@ -782,8 +782,8 @@ export declare const couponItemSchema: z.ZodObject<{
|
|
|
782
782
|
code: string;
|
|
783
783
|
type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
|
|
784
784
|
createdAt: string;
|
|
785
|
-
id: string;
|
|
786
785
|
description: string;
|
|
786
|
+
id: string;
|
|
787
787
|
updatedAt: string;
|
|
788
788
|
name: string;
|
|
789
789
|
scope: "seller" | "admin";
|
|
@@ -814,16 +814,16 @@ export declare const promotionsListParamsSchema: z.ZodObject<{
|
|
|
814
814
|
}, "strip", z.ZodTypeAny, {
|
|
815
815
|
sort?: string | undefined;
|
|
816
816
|
storeId?: string | undefined;
|
|
817
|
-
scope?: "seller" | "admin" | undefined;
|
|
818
817
|
page?: number | undefined;
|
|
818
|
+
scope?: "seller" | "admin" | undefined;
|
|
819
819
|
pageSize?: number | undefined;
|
|
820
820
|
isActive?: boolean | undefined;
|
|
821
821
|
filters?: string | undefined;
|
|
822
822
|
}, {
|
|
823
823
|
sort?: string | undefined;
|
|
824
824
|
storeId?: string | undefined;
|
|
825
|
-
scope?: "seller" | "admin" | undefined;
|
|
826
825
|
page?: number | undefined;
|
|
826
|
+
scope?: "seller" | "admin" | undefined;
|
|
827
827
|
pageSize?: number | undefined;
|
|
828
828
|
isActive?: boolean | undefined;
|
|
829
829
|
filters?: string | undefined;
|
|
@@ -89,9 +89,9 @@ export function ReviewDetailShell({ review, storeHref }) {
|
|
|
89
89
|
? String(ROUTES.PUBLIC.PROFILE(reviewerProfileId))
|
|
90
90
|
: null;
|
|
91
91
|
const currentImage = lightboxIdx !== null ? images[lightboxIdx] : null;
|
|
92
|
-
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "default", className: "border-b border-neutral-200 pt-
|
|
92
|
+
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "default", className: "border-b border-neutral-200 pt-[2.5rem]", padding: "b-xl", children: _jsxs(Div, { className: "mx-auto max-w-3xl", padding: "x-md", children: [_jsxs(Row, { gap: "sm", className: "mb-4", children: [_jsx(StarRating, { value: review.rating, size: "lg", readOnly: true }), _jsxs(Span, { color: "inverse", weight: "bold", className: "text-neutral-900 dark:text-neutral-100 dark:", size: "2xl", children: [review.rating, ".0"] }), review.verified && (_jsx(Span, { layout: "inline-flex", gap: "xs", color: "success", surface: "success-surface", size: "xs", weight: "semibold", rounded: "full", padding: "pill-md", children: "\u2713 Verified Purchase" })), review.featured && (_jsx(Span, { size: "xs", weight: "semibold", className: CLS_RATING_PILL, children: "\u2605 Featured" }))] }), review.title && (_jsx(Heading, { color: "inverse", level: 1, className: "text-neutral-900 dark:text-neutral-100 dark: mb-4 leading-snug", size: "2xl", weight: "bold", children: review.title })), _jsxs(Row, { gap: "sm", children: [review.userAvatar ? (_jsx("img", { src: review.userAvatar, alt: displayName, className: "h-11 w-11 flex-shrink-0 object-cover rounded-full ring-2 ring-white dark:ring-zinc-800" })) : (_jsx(Row, { textWeight: "bold", textSize: "base", centered: true, className: "h-11 w-11 flex-shrink-0 bg-primary/10 text-primary ring-2 ring-white dark:ring-zinc-800", rounded: "full", children: initials })), _jsxs(Div, { className: "min-w-0", children: [reviewerHref ? (_jsx(Link, { href: reviewerHref, className: "text-sm font-semibold text-neutral-900 dark:text-neutral-100 dark:text-white hover:text-primary transition-colors", children: displayName })) : (_jsx(Span, { color: "inverse", size: "sm", weight: "semibold", className: "text-neutral-900 dark:text-neutral-100 dark:", children: review.isAnonymous ? "Anonymous" : displayName })), date && (_jsx(Text, { size: "xs", color: "muted", className: "mt-0.5", children: date }))] })] })] }) }), _jsxs(Stack, { gap: "xl", className: "mx-auto max-w-3xl", paddingY: "y-xl", paddingX: "x-md", children: [review.comment && (_jsx(Section, { children: _jsx(RichText, { html: normalizeRichTextHtml(review.comment), proseClass: "prose prose-neutral dark:prose-invert max-w-none prose-p:leading-relaxed prose-headings:font-semibold prose-img:rounded-lg prose-a:text-primary", className: "text-neutral-700 dark:text-zinc-300" }) })), images.length > 0 && (_jsxs(Section, { children: [_jsxs(Heading, { level: 2, className: "tracking-wide mb-3", color: "faint", size: "sm", weight: "semibold", transform: "uppercase", children: ["Photos (", images.length, ")"] }), _jsx(Grid, { gap: "xs", className: "grid-cols-3 sm:grid-cols-4", children: images.map((img, i) => (_jsxs("button", { type: "button", onClick: () => setLightboxIdx(i), "aria-label": `View photo ${i + 1}`, className: "group relative aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-zinc-700 bg-neutral-100 dark:bg-zinc-800 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary", children: [_jsx("img", { src: img.thumbnailUrl ?? img.url, alt: `Review image ${i + 1}`, className: "h-full w-full object-cover transition-transform duration-300 group-hover:scale-105" }), _jsx(Row, { centered: true, className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity bg-[rgba(0,0,0,0.3)]", children: _jsx(Span, { color: "inverse", size: "xl", children: "\uD83D\uDD0D" }) })] }, i))) })] })), review.video && (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "tracking-wide mb-3", color: "faint", size: "sm", weight: "semibold", transform: "uppercase", children: "Video" }), _jsx(Div, { className: `${__O.hidden} border border-neutral-200 dark:border-neutral-700 bg-[rgb(0,0,0)] aspect-video`, rounded: "xl", children: _jsx("video", { src: review.video.url, poster: review.video.thumbnailUrl, controls: true, className: "h-full w-full", preload: "metadata" }) })] })), _jsxs(Section, { className: "flex items-[center] gap-[1rem] border-t border-neutral-100", padding: "y-md", children: [_jsx(Div, { textSize: "sm", className: "text-neutral-500 dark:text-neutral-400", children: helpfulCount > 0 && (_jsxs(Span, { children: [_jsx(Span, { color: "inverse", weight: "bold", className: "text-neutral-900 dark:text-neutral-100 dark:", children: helpfulCount }), " ", helpfulCount === 1 ? "person" : "people", " found this helpful"] })) }), _jsxs("button", { type: "button", onClick: handleVote, disabled: voted || voting, className: `ml-auto flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors ${voted
|
|
93
93
|
? CLS_HELPFUL_ACTIVE
|
|
94
|
-
: "border-neutral-300 dark:border-zinc-600 text-neutral-700 dark:text-zinc-200 hover:border-primary hover:text-primary dark:hover:border-primary dark:hover:text-primary disabled:opacity-50"}`, children: [_jsx(Span, { "aria-hidden": "true", children: voted ? "✓" : "👍" }), voted ? "Marked helpful" : voting ? "Saving…" : "Helpful?"] })] }), _jsxs(Section, { className: "grid gap-
|
|
94
|
+
: "border-neutral-300 dark:border-zinc-600 text-neutral-700 dark:text-zinc-200 hover:border-primary hover:text-primary dark:hover:border-primary dark:hover:text-primary disabled:opacity-50"}`, children: [_jsx(Span, { "aria-hidden": "true", children: voted ? "✓" : "👍" }), voted ? "Marked helpful" : voting ? "Saving…" : "Helpful?"] })] }), _jsxs(Section, { className: "grid gap-[0.75rem] sm:grid-cols-3", children: [productHref && (_jsxs(Link, { href: productHref, className: CLS_RELATED_LINK, children: [_jsx(Span, { className: CLS_ICON_ORANGE, children: "\uD83D\uDCE6" }), _jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: CLS_RELATED_LABEL, children: "Product" }), _jsx(Text, { className: CLS_RELATED_TITLE, children: review.productTitle ?? "View Product" })] })] })), sellerHref && (_jsxs(Link, { href: sellerHref, className: CLS_RELATED_LINK, children: [_jsx(Span, { className: CLS_ICON_BLUE, children: "\uD83C\uDFEA" }), _jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: CLS_RELATED_LABEL, children: "Seller" }), _jsx(Text, { className: CLS_RELATED_TITLE, children: "View Seller" })] })] })), reviewerHref ? (_jsxs(Link, { href: reviewerHref, className: CLS_RELATED_LINK, children: [_jsx(Span, { className: CLS_ICON_PURPLE, children: "\uD83D\uDC64" }), _jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: CLS_RELATED_LABEL, children: "Reviewer" }), _jsx(Text, { className: CLS_RELATED_TITLE, children: displayName })] })] })) : (_jsxs(Row, { surface: "default", gap: "sm", className: `border border-neutral-200 dark:border-[var(--appkit-color-border)] ${__P.p4}`, rounded: "xl", children: [_jsx(Span, { size: "xl", className: CLS_ICON_PURPLE_BARE, children: "\uD83D\uDC64" }), _jsxs(Div, { className: "min-w-0", children: [_jsx(Span, { size: "xs", className: "block mb-0.5", color: "faint", children: "Reviewer" }), _jsx(Span, { color: "inverse", size: "sm", weight: "medium", className: "block text-neutral-900 dark:text-neutral-100 dark: truncate", children: "Anonymous" })] })] }))] })] }), lightboxIdx !== null && currentImage && (_jsxs(Row, { centered: true, className: "fixed inset-0 z-50 bg-[rgba(0,0,0,0.95)]", onClick: closeLightbox, role: "dialog", "aria-modal": "true", "aria-label": "Image lightbox", children: [_jsx("button", { type: "button", onClick: closeLightbox, "aria-label": "Close lightbox", className: "absolute top-4 right-4 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors text-xl", children: "\u00D7" }), _jsxs(Div, { textSize: "sm", className: "absolute top-4 left-1/2 -translate-x-1/2 text-white/70", children: [lightboxIdx + 1, " / ", images.length] }), images.length > 1 && (_jsx("button", { type: "button", onClick: (e) => { e.stopPropagation(); prevImage(); }, "aria-label": "Previous image", className: "absolute left-4 top-1/2 -translate-y-1/2 z-10 flex h-12 w-12 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/25 transition-colors text-2xl", children: "\u2039" })), _jsx(Row, { centered: true, className: "max-h-[85vh] max-w-[85vw]", onClick: (e) => e.stopPropagation(), children: _jsx("img", { src: currentImage.url, alt: `Review photo ${lightboxIdx + 1}`, className: "max-h-[85vh] max-w-[85vw] rounded-lg object-contain shadow-2xl" }) }), images.length > 1 && (_jsx("button", { type: "button", onClick: (e) => { e.stopPropagation(); nextImage(); }, "aria-label": "Next image", className: "absolute right-4 top-1/2 -translate-y-1/2 z-10 flex h-12 w-12 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/25 transition-colors text-2xl", children: "\u203A" })), images.length > 1 && (_jsx(Row, { justify: "center", gap: "xs", className: "absolute bottom-4 left-0 right-0", padding: "x-md", children: images.map((img, i) => (_jsx("button", { type: "button", onClick: (e) => { e.stopPropagation(); setLightboxIdx(i); }, "aria-label": `Go to image ${i + 1}`, className: `h-12 w-12 flex-shrink-0 rounded-md overflow-hidden border-2 transition-all ${i === lightboxIdx
|
|
95
95
|
? "border-white scale-110"
|
|
96
|
-
: "border-transparent opacity-60 hover:opacity-100"}`,
|
|
96
|
+
: "border-transparent opacity-60 hover:opacity-100"}`, children: _jsx("img", { src: img.thumbnailUrl ?? img.url, alt: `Thumbnail ${i + 1}`, className: "w-full h-full object-cover" }) }, i))) }))] }))] }));
|
|
97
97
|
}
|