@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Package, ShoppingBag, Wallet, Settings, Shield, Headphones, CheckCircle2, Circle, BookOpen, } from "lucide-react";
|
|
3
|
-
import { Div, Heading, Row, Section, Stack, Text } from "../../../ui";
|
|
3
|
+
import { Div, Heading, Progress, Row, Section, Stack, Text } from "../../../ui";
|
|
4
4
|
import { ROUTES } from "../../../next/routing/route-map";
|
|
5
5
|
const CLS_CHECK_ICON = "w-5 h-5 flex-shrink-0 text-emerald-500";
|
|
6
6
|
const CLS_SUCCESS_BOX = "rounded-xl border border-emerald-200 bg-emerald-50 dark:bg-emerald-950/30 dark:border-emerald-800 px-5 py-4";
|
|
@@ -77,14 +77,7 @@ export function StoreGuideHubView({ store }) {
|
|
|
77
77
|
const storeName = store?.storeName ?? "Your Store";
|
|
78
78
|
const steps = buildChecklist(store);
|
|
79
79
|
const completedCount = steps.filter((s) => s.done).length;
|
|
80
|
-
return (_jsxs(Stack, { gap: "xl", padding: "b-2xl", children: [_jsx(Section, {
|
|
81
|
-
background: "linear-gradient(135deg,var(--appkit-color-primary-700) 0%,var(--appkit-color-cobalt) 60%,var(--appkit-color-secondary-400) 100%)",
|
|
82
|
-
}, children: [_jsxs(Row, { className: "mb-3", align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-10 h-10", surface: "default", align: "center", justify: "center", rounded: "xl", children: _jsx(BookOpen, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { color: "inverse", className: "/80 tracking-widest", size: "sm", weight: "semibold", transform: "uppercase", children: "Seller Guide" })] }), _jsx(Heading, { color: "inverse", level: 1, className: "mb-2", mdSize: "3xl", size: "2xl", weight: "bold", children: storeName }), _jsx(Text, { color: "inverse", className: "/80", size: "base", children: "Everything you need to know about selling on LetItRip." })] }) }), _jsxs(Div, { layout: "grid", gap: "8", className: "grid-cols-1 lg:grid-cols-3", children: [_jsxs(Stack, { className: "lg:col-span-2", gap: "md", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text)]", size: "lg", weight: "semibold", children: "Guides" }), _jsx(Div, { layout: "grid", gap: "4", className: "grid-cols-1 sm:grid-cols-2", children: GUIDE_CARDS.map(({ Icon, title, description, href }) => (_jsxs("a", { href: href, className: "group flex flex-col gap-3 rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] p-5 hover:border-[var(--appkit-color-primary)] hover:shadow-md transition-all", children: [_jsxs(Row, { align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-9 h-9", align: "center", justify: "center", rounded: "lg", style: {
|
|
83
|
-
background: "linear-gradient(135deg,var(--appkit-color-primary-700) 0%,var(--appkit-color-cobalt) 100%)",
|
|
84
|
-
}, children: _jsx(Icon, { className: "w-4 h-4 text-white" }) }), _jsx(Text, { className: "text-[var(--appkit-color-text)] group-hover:text-[var(--appkit-color-primary)] transition-colors", weight: "semibold", children: title })] }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)] leading-relaxed", size: "sm", children: description }), _jsx(Text, { className: "text-[var(--appkit-color-primary)] mt-auto", size: "xs", weight: "medium", children: "Read guide \u2192" })] }, title))) })] }), _jsxs(Stack, { gap: "md", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text)]", size: "lg", weight: "semibold", children: "Getting started" }), _jsxs(Div, { className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] overflow-hidden", rounded: "xl", children: [_jsxs(Div, { className: "px-5 pt-5 border-b border-[var(--appkit-color-border)]", padding: "b-md", children: [_jsxs(Row, { className: "mb-2", align: "center", justify: "between", children: [_jsxs(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: [completedCount, " of ", steps.length, " complete"] }), _jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: [Math.round((completedCount / steps.length) * 100), "%"] })] }), _jsx(Div, { className: "h-1.5 bg-[var(--appkit-color-border)]", rounded: "full", children: _jsx(Div, { className: "h-full transition-all", rounded: "full", style: {
|
|
85
|
-
width: `${Math.round((completedCount / steps.length) * 100)}%`,
|
|
86
|
-
background: "linear-gradient(90deg,var(--appkit-color-primary-700),var(--appkit-color-cobalt))",
|
|
87
|
-
} }) })] }), _jsx(Div, { className: "divide-y divide-[var(--appkit-color-border)]", children: steps.map(({ label, done, href }) => (_jsxs("a", { href: done ? "#" : href, "aria-disabled": done, className: `flex items-center gap-3 px-5 py-3.5 text-sm transition-colors ${done
|
|
80
|
+
return (_jsxs(Stack, { gap: "xl", padding: "b-2xl", children: [_jsx(Section, { overflow: "hidden", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", rounded: "2xl", shadow: "sm", children: _jsxs(Div, { paddingX: "x-md-xl", paddingY: "y-xl", className: "[background:linear-gradient(135deg,var(--appkit-color-primary-700)_0%,var(--appkit-color-cobalt)_60%,var(--appkit-color-secondary-400)_100%)]", children: [_jsxs(Row, { className: "mb-3", align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-10 h-10", surface: "default", align: "center", justify: "center", rounded: "xl", children: _jsx(BookOpen, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { color: "inverse", className: "/80 tracking-widest", size: "sm", weight: "semibold", transform: "uppercase", children: "Seller Guide" })] }), _jsx(Heading, { color: "inverse", level: 1, className: "mb-2", mdSize: "3xl", size: "2xl", weight: "bold", children: storeName }), _jsx(Text, { color: "inverse", className: "/80", size: "base", children: "Everything you need to know about selling on LetItRip." })] }) }), _jsxs(Div, { layout: "grid", gap: "8", className: "grid-cols-1 lg:grid-cols-3", children: [_jsxs(Stack, { className: "lg:col-span-2", gap: "md", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text)]", size: "lg", weight: "semibold", children: "Guides" }), _jsx(Div, { layout: "grid", gap: "4", className: "grid-cols-1 sm:grid-cols-2", children: GUIDE_CARDS.map(({ Icon, title, description, href }) => (_jsxs("a", { href: href, className: "group flex flex-col gap-3 rounded-xl border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] p-5 hover:border-[var(--appkit-color-primary)] hover:shadow-md transition-all", children: [_jsxs(Row, { align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-9 h-9 [background:linear-gradient(135deg,var(--appkit-color-primary-700)_0%,var(--appkit-color-cobalt)_100%)]", align: "center", justify: "center", rounded: "lg", children: _jsx(Icon, { className: "w-4 h-4 text-white" }) }), _jsx(Text, { className: "text-[var(--appkit-color-text)] group-hover:text-[var(--appkit-color-primary)] transition-colors", weight: "semibold", children: title })] }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)] leading-relaxed", size: "sm", children: description }), _jsx(Text, { className: "text-[var(--appkit-color-primary)] mt-auto", size: "xs", weight: "medium", children: "Read guide \u2192" })] }, title))) })] }), _jsxs(Stack, { gap: "md", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text)]", size: "lg", weight: "semibold", children: "Getting started" }), _jsxs(Div, { overflow: "hidden", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", rounded: "xl", children: [_jsxs(Div, { className: "px-[1.25rem] pt-[1.25rem] border-b border-[var(--appkit-color-border)]", padding: "b-md", children: [_jsxs(Row, { className: "mb-2", align: "center", justify: "between", children: [_jsxs(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: [completedCount, " of ", steps.length, " complete"] }), _jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: [Math.round((completedCount / steps.length) * 100), "%"] })] }), _jsx(Progress, { value: completedCount, max: steps.length, size: "sm", variant: "gradient" })] }), _jsx(Div, { className: "divide-y divide-[var(--appkit-color-border)]", children: steps.map(({ label, done, href }) => (_jsxs("a", { href: done ? "#" : href, "aria-disabled": done, className: `flex items-center gap-3 px-5 py-3.5 text-sm transition-colors ${done
|
|
88
81
|
? "cursor-default"
|
|
89
82
|
: "hover:bg-[var(--appkit-color-border)]/30"}`, children: [done ? (_jsx(CheckCircle2, { className: CLS_CHECK_ICON })) : (_jsx(Circle, { className: "w-5 h-5 flex-shrink-0 text-[var(--appkit-color-text-muted)]" })), _jsx(Text, { className: `leading-snug ${done
|
|
90
83
|
? "line-through text-[var(--appkit-color-text-muted)]"
|
|
@@ -11,7 +11,7 @@ const CLS_STARS = "inline-flex items-center gap-1 text-warning";
|
|
|
11
11
|
const CLS_FOLLOW_BTN = "rounded-lg border border-warning px-4 py-2 text-sm font-medium text-warning hover:bg-warning-surface transition-colors";
|
|
12
12
|
const CLS_WARN_BANNER = "mt-3 rounded-lg bg-warning-surface dark:bg-warning-surface border border-warning dark:border-warning px-3 py-2 text-sm text-warning dark:text-warning";
|
|
13
13
|
export function StoreHeader({ store, labels = {}, onFollow, className = "", }) {
|
|
14
|
-
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (_jsx(Div, { className: `h-40 md:h-56 ${__O.hidden} bg-gray-100 dark:bg-
|
|
14
|
+
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (_jsx(Div, { className: `h-40 md:h-56 ${__O.hidden} bg-gray-100 dark:bg-neutral-800`, children: _jsx("img", { src: store.storeBannerURL, alt: `${store.storeName} banner`, className: "h-full w-full object-cover" }) })), _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: "-mt-8 h-16 w-16 border-2 border-white", rounded: "xl", shadow: "sm", overflow: "hidden", children: _jsx("img", { src: store.storeLogoURL, alt: store.storeName, className: "w-full h-full object-cover" }) })) : (_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-gray-900", 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)] }))] }), _jsxs(Row, { textSize: "xs", className: "text-gray-500 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 ??
|
|
15
15
|
labels.vacationMode ??
|
|
16
16
|
"Store is on vacation mode" })), _jsx(Div, { className: "mt-3", children: _jsx(StoreScopedSearch, { storeId: store.storeSlug, storeName: store.storeName }) })] })] }));
|
|
17
17
|
}
|
|
@@ -41,7 +41,7 @@ function ListingTypesTable() {
|
|
|
41
41
|
{ label: "Required fields", keys: ["requiredFields"] },
|
|
42
42
|
{ label: "Ideal use case", keys: ["idealUseCase"] },
|
|
43
43
|
];
|
|
44
|
-
return (_jsx(Div, {
|
|
44
|
+
return (_jsx(Div, { overflow: "x-auto", className: "-mx-6", children: _jsxs(Table, { className: "min-w-full", size: "sm", children: [_jsx(Thead, { children: _jsx(Tr, { className: "border-b border-[var(--appkit-color-border)]", children: HEADERS.map((h) => (_jsx(Th, { weight: "semibold", padding: "lg-3", className: "text-left text-[var(--appkit-color-text)]", children: h }, h))) }) }), _jsx(Tbody, { className: "divide-y divide-[var(--appkit-color-border)]", children: ROWS.map(({ label, keys }) => (_jsxs(Tr, { children: [_jsx(Td, { weight: "medium", padding: "lg-3", className: "text-[var(--appkit-color-text-muted)] whitespace-nowrap", children: label }), LISTING_TYPES.map((t) => (_jsx(Td, { padding: "lg-3", className: "text-[var(--appkit-color-text)] align-top", children: t[keys[0]] }, t.type)))] }, label))) })] }) }));
|
|
45
45
|
}
|
|
46
46
|
// -- Section 2: Standard product walkthrough -----------------------------------
|
|
47
47
|
const STANDARD_STEPS = [
|
|
@@ -88,11 +88,11 @@ const STANDARD_STEPS = [
|
|
|
88
88
|
},
|
|
89
89
|
];
|
|
90
90
|
function StandardWalkthrough() {
|
|
91
|
-
return (_jsx(Stack, { gap: "5", children: STANDARD_STEPS.map(({ step, items }) => (_jsxs(Div, { children: [_jsx(Text, { className: "mb-2 text-[var(--appkit-color-text)]", weight: "semibold", children: step }), _jsx(Ul, { className: "space-y-
|
|
91
|
+
return (_jsx(Stack, { gap: "5", children: STANDARD_STEPS.map(({ step, items }) => (_jsxs(Div, { children: [_jsx(Text, { className: "mb-2 text-[var(--appkit-color-text)]", weight: "semibold", children: step }), _jsx(Ul, { className: "space-y-[0.375rem]", indent: "lg", children: items.map((item) => (_jsx(Li, { textSize: "sm", color: "muted", className: LIST_DISC, children: item }, item))) })] }, step))) }));
|
|
92
92
|
}
|
|
93
93
|
// -- Section 3: Auction walkthrough --------------------------------------------
|
|
94
94
|
function AuctionWalkthrough() {
|
|
95
|
-
return (_jsxs(Stack, { textSize: "sm", className: "text-[var(--appkit-color-text-muted)]", gap: "md", children: [_jsxs(Div, { children: [_jsx(Text, { className: SUBHEADING, children: "Reserve price vs starting bid" }), _jsxs(Text, { className: "leading-relaxed", children: ["The ", _jsx(Span, { weight: "bold", children: "starting bid" }), " is the minimum first bid a buyer can place. The ", _jsx(Span, { weight: "bold", children: "reserve price" }), " is the minimum price you are willing to accept \u2014 if bidding does not reach the reserve, you are not obligated to sell. The reserve is hidden from buyers."] })] }), _jsxs(Div, { children: [_jsx(Text, { className: SUBHEADING, children: "Bid increment" }), _jsx(Div, {
|
|
95
|
+
return (_jsxs(Stack, { textSize: "sm", className: "text-[var(--appkit-color-text-muted)]", gap: "md", children: [_jsxs(Div, { children: [_jsx(Text, { className: SUBHEADING, children: "Reserve price vs starting bid" }), _jsxs(Text, { className: "leading-relaxed", children: ["The ", _jsx(Span, { weight: "bold", children: "starting bid" }), " is the minimum first bid a buyer can place. The ", _jsx(Span, { weight: "bold", children: "reserve price" }), " is the minimum price you are willing to accept \u2014 if bidding does not reach the reserve, you are not obligated to sell. The reserve is hidden from buyers."] })] }), _jsxs(Div, { children: [_jsx(Text, { className: SUBHEADING, children: "Bid increment" }), _jsx(Div, { overflow: "x-auto", children: _jsxs(Table, { className: "min-w-[320px]", size: "sm", children: [_jsx(Thead, { children: _jsxs(Tr, { className: "border-b border-[var(--appkit-color-border)]", children: [_jsx(Th, { weight: "semibold", align: "left", paddingSide: "pr-md", className: "text-[var(--appkit-color-text)]", padding: "xs-tall", children: "Current high bid" }), _jsx(Th, { weight: "semibold", align: "left", className: "text-[var(--appkit-color-text)]", padding: "xs-tall", children: "Minimum increment" })] }) }), _jsx(Tbody, { className: "divide-y divide-[var(--appkit-color-border)]", children: [
|
|
96
96
|
["₹0 – ₹499", "₹10"],
|
|
97
97
|
["₹500 – ₹1,999", "₹25"],
|
|
98
98
|
["₹2,000 – ₹9,999", "₹100"],
|
|
@@ -121,7 +121,7 @@ const STATUS_NOTES = [
|
|
|
121
121
|
{ status: "SOLD", note: "Auction only — marked when the winning bid is confirmed paid." },
|
|
122
122
|
];
|
|
123
123
|
function StatusLifecycle() {
|
|
124
|
-
return (_jsxs(Stack, { gap: "md", children: [_jsx(Div, { textSize: "xs", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-subtle,var(--appkit-color-border))/20] font-mono text-[var(--appkit-color-text-muted)]
|
|
124
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsx(Div, { textSize: "xs", overflow: "x-auto", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-subtle,var(--appkit-color-border))/20] font-mono text-[var(--appkit-color-text-muted)] whitespace-pre", rounded: "lg", padding: "md", children: STATUS_LIFECYCLE }), _jsx(Stack, { gap: "sm", children: STATUS_NOTES.map(({ status, note }) => (_jsxs(Row, { textSize: "sm", gap: "3", children: [_jsx(Text, { className: "shrink-0 font-mono text-[var(--appkit-color-text)] w-24", weight: "semibold", children: status }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: note })] }, status))) }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "Live auctions with at least one bid cannot be taken to ARCHIVED until the auction ends." })] }));
|
|
125
125
|
}
|
|
126
126
|
// -- Section 6: Media guide ----------------------------------------------------
|
|
127
127
|
const MEDIA_TIPS = [
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useCallback } from "react";
|
|
4
|
+
import { useUrlTable } from "../../../react/hooks/useUrlTable";
|
|
5
|
+
import { usePendingTable } from "../../../react/hooks/usePendingTable";
|
|
6
|
+
import { useProducts } from "../../products/hooks/useProducts";
|
|
7
|
+
import { Div, FilterDrawer, ListingToolbar, Pagination, Row, Text } from "../../../ui";
|
|
8
|
+
import { LiveItemFilters } from "../../live/components/LiveItemFilters";
|
|
9
|
+
import { InteractiveProductCard } from "../../products/components/InteractiveProductCard";
|
|
10
|
+
import { PRODUCT_FIELDS } from "../../../constants/field-names";
|
|
11
|
+
import { TABLE_KEYS } from "../../../constants/table-keys";
|
|
12
|
+
import { sortBy } from "../../../constants/sort";
|
|
13
|
+
import { ROUTES } from "../../../next";
|
|
14
|
+
const DEFAULT_SORT = sortBy(PRODUCT_FIELDS.CREATED_AT);
|
|
15
|
+
const SORT_OPTIONS = [
|
|
16
|
+
{ value: sortBy(PRODUCT_FIELDS.CREATED_AT), label: "Newest First" },
|
|
17
|
+
{ value: sortBy(PRODUCT_FIELDS.CREATED_AT, "ASC"), label: "Oldest First" },
|
|
18
|
+
{ value: sortBy(PRODUCT_FIELDS.PRICE, "ASC"), label: "Price: Low to High" },
|
|
19
|
+
{ value: sortBy(PRODUCT_FIELDS.PRICE), label: "Price: High to Low" },
|
|
20
|
+
];
|
|
21
|
+
const FILTER_KEYS = [TABLE_KEYS.MIN_PRICE, TABLE_KEYS.MAX_PRICE, TABLE_KEYS.SPECIES, "liveSex", "liveTransportMethod", "jurisdiction"];
|
|
22
|
+
export function StoreLiveItemsListing({ storeId, initialData }) {
|
|
23
|
+
const table = useUrlTable({ defaults: { pageSize: "24", sort: DEFAULT_SORT } });
|
|
24
|
+
const [searchInput, setSearchInput] = useState(table.get("q") || "");
|
|
25
|
+
const [filterOpen, setFilterOpen] = useState(false);
|
|
26
|
+
const { pendingTable, filterActiveCount, onFilterApply, onFilterClear, onResetAll, onFilterReset } = usePendingTable(table, FILTER_KEYS);
|
|
27
|
+
const openFilters = useCallback(() => { onFilterReset(); setFilterOpen(true); }, [onFilterReset]);
|
|
28
|
+
const applyFilters = useCallback(() => { onFilterApply(); setFilterOpen(false); }, [onFilterApply]);
|
|
29
|
+
const resetAll = useCallback(() => { onResetAll({ q: "", sort: "" }); setSearchInput(""); }, [onResetAll]);
|
|
30
|
+
const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || filterActiveCount > 0;
|
|
31
|
+
const params = {
|
|
32
|
+
q: table.get("q") || undefined,
|
|
33
|
+
minPrice: table.get(TABLE_KEYS.MIN_PRICE) ? Number(table.get(TABLE_KEYS.MIN_PRICE)) : undefined,
|
|
34
|
+
maxPrice: table.get(TABLE_KEYS.MAX_PRICE) ? Number(table.get(TABLE_KEYS.MAX_PRICE)) : undefined,
|
|
35
|
+
sort: table.get("sort") || DEFAULT_SORT,
|
|
36
|
+
page: table.getNumber("page", 1),
|
|
37
|
+
perPage: table.getNumber("pageSize", 24),
|
|
38
|
+
storeId: storeId || undefined,
|
|
39
|
+
listingType: "live",
|
|
40
|
+
};
|
|
41
|
+
const { products, totalPages, page, isLoading } = useProducts(params, { initialData });
|
|
42
|
+
const gridClass = "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4";
|
|
43
|
+
return (_jsxs(Div, { className: "min-h-[200px]", children: [_jsx(ListingToolbar, { filterCount: filterActiveCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search live animals & plants\u2026", onSearchChange: setSearchInput, onSearchCommit: () => table.set("q", searchInput.trim()), sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => table.set("sort", v), onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx(Row, { border: "bottom", className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 backdrop-blur-sm", surface: "default", padding: "toolbar", justify: "center", children: _jsx(Pagination, { currentPage: page, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx(Div, { padding: "y-lg", children: _jsx(Div, { className: gridClass, children: isLoading
|
|
44
|
+
? Array.from({ length: 8 }).map((_, i) => _jsx(Div, { surface: "muted", rounded: "xl", className: "aspect-square animate-pulse" }, i))
|
|
45
|
+
: products.length === 0
|
|
46
|
+
? _jsx(Div, { paddingY: "y-4xl", className: "col-span-full text-center", children: _jsx(Text, { color: "muted", children: "No live items in this store yet." }) })
|
|
47
|
+
: products.map((p) => (_jsx(InteractiveProductCard, { product: p, href: String(ROUTES.PUBLIC.LIVE_DETAIL(p.slug ?? p.id)) }, p.id))) }) }), _jsx(FilterDrawer, { open: filterOpen, onOpen: openFilters, onClose: () => setFilterOpen(false), onApply: applyFilters, onReset: onFilterClear, activeCount: filterActiveCount, hideTrigger: true, children: _jsx(LiveItemFilters, { table: pendingTable, currencyPrefix: "\u20B9" }) })] }));
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { sieveFilter, sieveAnd, SIEVE_OP, sortBy, PRODUCT_FIELDS } from "@mohasinac/appkit";
|
|
3
|
+
import { productRepository } from "../../../repositories";
|
|
4
|
+
import { getStoreBySlug } from "./StoreDetailLayoutView";
|
|
5
|
+
import { StoreLiveItemsListing } from "./StoreLiveItemsListing";
|
|
6
|
+
export async function StoreLiveItemsPageView({ storeSlug }) {
|
|
7
|
+
const store = await getStoreBySlug(storeSlug);
|
|
8
|
+
const storeId = store?.id;
|
|
9
|
+
if (!storeId)
|
|
10
|
+
return null;
|
|
11
|
+
const result = await productRepository
|
|
12
|
+
.list({
|
|
13
|
+
filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "live")),
|
|
14
|
+
sorts: sortBy(PRODUCT_FIELDS.CREATED_AT),
|
|
15
|
+
page: 1,
|
|
16
|
+
pageSize: 24,
|
|
17
|
+
})
|
|
18
|
+
.catch(() => null);
|
|
19
|
+
return _jsx(StoreLiveItemsListing, { storeId: storeId, initialData: result ?? undefined });
|
|
20
|
+
}
|
|
@@ -55,7 +55,7 @@ const STATUS_ROWS = [
|
|
|
55
55
|
},
|
|
56
56
|
];
|
|
57
57
|
function OrderLifecycle() {
|
|
58
|
-
return (_jsxs(Stack, { gap: "md", children: [_jsx(Div, { textSize: "xs", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-subtle,var(--appkit-color-border))/20] font-mono text-[var(--appkit-color-text-muted)]
|
|
58
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsx(Div, { textSize: "xs", overflow: "x-auto", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-subtle,var(--appkit-color-border))/20] font-mono text-[var(--appkit-color-text-muted)] whitespace-pre", rounded: "lg", padding: "md", children: STATUS_LIFECYCLE }), _jsx(Stack, { gap: "sm", children: STATUS_ROWS.map(({ status, meaning, action }) => (_jsxs(Div, { textSize: "sm", className: "border border-[var(--appkit-color-border)]", rounded: "lg", padding: "sm", children: [_jsxs(Row, { className: "mb-1", align: "center", gap: "sm", children: [_jsx(Text, { className: "font-mono text-[var(--appkit-color-text)] w-28 shrink-0", weight: "semibold", children: status }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", children: meaning })] }), _jsxs(Text, { className: "pl-[7.5rem] text-[var(--appkit-color-text-muted)] italic", size: "xs", children: ["\u2192 ", action] })] }, status))) })] }));
|
|
59
59
|
}
|
|
60
60
|
// -- Section 2: Processing an order -------------------------------------------
|
|
61
61
|
const PROCESSING_STEPS = [
|
|
@@ -81,7 +81,7 @@ const CARRIERS = [
|
|
|
81
81
|
{ name: "Shadowfax", sla: "1–3 business days — good for urban same-day" },
|
|
82
82
|
];
|
|
83
83
|
function CarriersSection() {
|
|
84
|
-
return (_jsxs(Stack, { gap: "3", children: [_jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "Any carrier is accepted \u2014 enter the tracking number manually in the order detail. Buyers receive the tracking number as entered; they look it up on the carrier's website." }), _jsx(Div, {
|
|
84
|
+
return (_jsxs(Stack, { gap: "3", children: [_jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "Any carrier is accepted \u2014 enter the tracking number manually in the order detail. Buyers receive the tracking number as entered; they look it up on the carrier's website." }), _jsx(Div, { overflow: "x-auto", className: "-mx-6", children: _jsxs(Table, { className: "min-w-full", size: "sm", children: [_jsx(Thead, { children: _jsxs(Tr, { className: "border-b border-[var(--appkit-color-border)]", children: [_jsx(Th, { weight: "semibold", padding: "lg-3", className: "text-left text-[var(--appkit-color-text)]", children: "Carrier" }), _jsx(Th, { weight: "semibold", padding: "lg-3", className: "text-left text-[var(--appkit-color-text)]", children: "Typical SLA" })] }) }), _jsx(Tbody, { className: "divide-y divide-[var(--appkit-color-border)]", children: CARRIERS.map(({ name, sla }) => (_jsxs(Tr, { children: [_jsx(Td, { weight: "medium", padding: "lg-3", className: "text-[var(--appkit-color-text)]", children: name }), _jsx(Td, { padding: "lg-3", className: "text-[var(--appkit-color-text-muted)]", children: sla })] }, name))) })] }) }), _jsx(Alert, { variant: "info", title: "Tip: insurance for high-value shipments", children: "For items above \u20B95,000, consider using a carrier that offers shipment insurance (Blue Dart, Delhivery Premium). Document the item with photos before sealing the package \u2014 this is your evidence if a damage claim arises." })] }));
|
|
85
85
|
}
|
|
86
86
|
// -- Section 4: Cancellations -------------------------------------------------
|
|
87
87
|
function CancellationsSection() {
|
|
@@ -135,7 +135,7 @@ export function StoresIndexListing({ initialData }) {
|
|
|
135
135
|
disabled: selection.selectedCount !== 1,
|
|
136
136
|
onClick: () => { selection.clearSelection(); },
|
|
137
137
|
},
|
|
138
|
-
] }), totalPages > 1 && (_jsx(Row, { border: "bottom", className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 backdrop-blur-sm", surface: "default", padding: "toolbar", justify: "center", children: _jsx(Pagination, { currentPage: table.getNumber("page", 1), totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx(Div, { padding: "y-lg", children: isLoading ? (_jsx(Div, { layout: "grid", gap: "6", className: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: Array.from({ length: 6 }).map((_, i) => (_jsxs(Div, { className: `${__O.hidden} animate-pulse`, border: "subtle", rounded: "xl", children: [_jsx(Div, { className: "aspect-video", surface: "subtle" }), _jsxs(Div, { className: `${__P.p4} space-y-
|
|
138
|
+
] }), totalPages > 1 && (_jsx(Row, { border: "bottom", className: "sticky top-[calc(var(--header-height,0px)+44px)] z-10 backdrop-blur-sm", surface: "default", padding: "toolbar", justify: "center", children: _jsx(Pagination, { currentPage: table.getNumber("page", 1), totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsx(Div, { padding: "y-lg", children: isLoading ? (_jsx(Div, { layout: "grid", gap: "6", className: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: Array.from({ length: 6 }).map((_, i) => (_jsxs(Div, { className: `${__O.hidden} animate-pulse`, border: "subtle", rounded: "xl", children: [_jsx(Div, { className: "aspect-video", surface: "subtle" }), _jsxs(Div, { className: `${__P.p4} space-y-[0.625rem]`, children: [_jsx(Row, { align: "center", gap: "sm", children: _jsx(Div, { className: "h-10 w-10", surface: "subtle", rounded: "lg" }) }), _jsx(Div, { className: "h-4 w-2/3", surface: "subtle", rounded: "default" }), _jsx(Div, { className: "h-3 w-full", surface: "subtle", rounded: "default" }), _jsx(Div, { className: "h-3 w-1/2", surface: "subtle", rounded: "default" })] })] }, i))) })) : stores.length === 0 ? (_jsx(Text, { paddingY: "4xl", color: "muted", size: "sm", align: "center", children: "No stores found." })) : view === "list" ? (_jsx(Stack, { className: "divide-y divide-zinc-100 dark:divide-zinc-800", border: "subtle", rounded: "xl", children: stores.map((store) => {
|
|
139
139
|
const storeKey = store.storeSlug ?? store.id;
|
|
140
140
|
return (_jsx(InteractiveStoreCard, { store: store, href: String(ROUTES.PUBLIC.STORE_DETAIL(storeKey)), selectable: selection.isSelecting, isSelected: selection.isSelected(store.id ?? store.storeSlug), onSelect: (id, sel) => { void sel; selection.toggle(id); } }, storeKey));
|
|
141
141
|
}) })) : (_jsx(Div, { layout: "grid", gap: "6", className: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", children: stores.map((store) => {
|
|
@@ -26,6 +26,15 @@ export type { StorePreOrdersListingProps } from "./StorePreOrdersListing";
|
|
|
26
26
|
export type { StorePreOrdersPageViewProps } from "./StorePreOrdersPageView";
|
|
27
27
|
export type { StorePrizeDrawsPageViewProps } from "./StorePrizeDrawsPageView";
|
|
28
28
|
export type { StoreBundlesPageViewProps } from "./StoreBundlesPageView";
|
|
29
|
+
export { StoreClassifiedsListing } from "./StoreClassifiedsListing";
|
|
30
|
+
export type { StoreClassifiedsListingProps } from "./StoreClassifiedsListing";
|
|
31
|
+
export type { StoreClassifiedsPageViewProps } from "./StoreClassifiedsPageView";
|
|
32
|
+
export { StoreDigitalCodesListing } from "./StoreDigitalCodesListing";
|
|
33
|
+
export type { StoreDigitalCodesListingProps } from "./StoreDigitalCodesListing";
|
|
34
|
+
export type { StoreDigitalCodesPageViewProps } from "./StoreDigitalCodesPageView";
|
|
35
|
+
export { StoreLiveItemsListing } from "./StoreLiveItemsListing";
|
|
36
|
+
export type { StoreLiveItemsListingProps } from "./StoreLiveItemsListing";
|
|
37
|
+
export type { StoreLiveItemsPageViewProps } from "./StoreLiveItemsPageView";
|
|
29
38
|
export { StoreGuideHubView } from "./StoreGuideHubView";
|
|
30
39
|
export type { StoreGuideHubViewProps } from "./StoreGuideHubView";
|
|
31
40
|
export { StoreListingsGuideView } from "./StoreListingsGuideView";
|
|
@@ -11,6 +11,9 @@ export { StoreProductsListing } from "./StoreProductsListing";
|
|
|
11
11
|
export { StoreAuctionsListing } from "./StoreAuctionsListing";
|
|
12
12
|
export { StoreReviewsListing } from "./StoreReviewsListing";
|
|
13
13
|
export { StorePreOrdersListing } from "./StorePreOrdersListing";
|
|
14
|
+
export { StoreClassifiedsListing } from "./StoreClassifiedsListing";
|
|
15
|
+
export { StoreDigitalCodesListing } from "./StoreDigitalCodesListing";
|
|
16
|
+
export { StoreLiveItemsListing } from "./StoreLiveItemsListing";
|
|
14
17
|
export { StoreGuideHubView } from "./StoreGuideHubView";
|
|
15
18
|
export { StoreListingsGuideView } from "./StoreListingsGuideView";
|
|
16
19
|
export { StoreOrdersGuideView } from "./StoreOrdersGuideView";
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* and helpers for the stores feature.
|
|
6
6
|
*/
|
|
7
7
|
import type { StoreCapability } from "../../auth/permissions/constants";
|
|
8
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
8
9
|
export type ShippingProviderType = "shiprocket" | "self-courier" | "store-pickup" | "custom";
|
|
9
10
|
export interface ShippingProviderConfig {
|
|
10
11
|
/** Stable slug — never changes after creation. */
|
|
@@ -46,8 +47,7 @@ export declare const StoreStatusValues: {
|
|
|
46
47
|
readonly REJECTED: "rejected";
|
|
47
48
|
};
|
|
48
49
|
export type StoreStatus = (typeof StoreStatusValues)[keyof typeof StoreStatusValues];
|
|
49
|
-
export interface StoreDocument {
|
|
50
|
-
id: string;
|
|
50
|
+
export interface StoreDocument extends BaseDocument {
|
|
51
51
|
storeSlug: string;
|
|
52
52
|
ownerId: string;
|
|
53
53
|
storeName: string;
|
|
@@ -123,8 +123,6 @@ export interface StoreDocument {
|
|
|
123
123
|
/** When the seller first connected their account */
|
|
124
124
|
connectedAt?: Date;
|
|
125
125
|
};
|
|
126
|
-
createdAt: Date;
|
|
127
|
-
updatedAt: Date;
|
|
128
126
|
}
|
|
129
127
|
export type { StoreCapability } from "../../auth/permissions/constants";
|
|
130
128
|
export declare const STORE_COLLECTION: "stores";
|
|
@@ -405,8 +405,8 @@ export declare const storeFirestoreSchema: z.ZodObject<{
|
|
|
405
405
|
createdAt: string | Date | z.objectOutputType<{
|
|
406
406
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
407
407
|
}, z.ZodTypeAny, "passthrough">;
|
|
408
|
-
id: string;
|
|
409
408
|
storeName: string;
|
|
409
|
+
id: string;
|
|
410
410
|
updatedAt: string | Date | z.objectOutputType<{
|
|
411
411
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
412
412
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -489,8 +489,8 @@ export declare const storeFirestoreSchema: z.ZodObject<{
|
|
|
489
489
|
createdAt: string | Date | z.objectInputType<{
|
|
490
490
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
491
491
|
}, z.ZodTypeAny, "passthrough">;
|
|
492
|
-
id: string;
|
|
493
492
|
storeName: string;
|
|
493
|
+
id: string;
|
|
494
494
|
updatedAt: string | Date | z.objectInputType<{
|
|
495
495
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
496
496
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -603,8 +603,8 @@ export declare const storeListItemSchema: z.ZodObject<{
|
|
|
603
603
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
604
604
|
}, "strip", z.ZodTypeAny, {
|
|
605
605
|
status: string;
|
|
606
|
-
id: string;
|
|
607
606
|
storeName: string;
|
|
607
|
+
id: string;
|
|
608
608
|
isPublic: boolean;
|
|
609
609
|
storeSlug: string;
|
|
610
610
|
ownerId: string;
|
|
@@ -619,8 +619,8 @@ export declare const storeListItemSchema: z.ZodObject<{
|
|
|
619
619
|
averageRating?: number | undefined;
|
|
620
620
|
}, {
|
|
621
621
|
status: string;
|
|
622
|
-
id: string;
|
|
623
622
|
storeName: string;
|
|
623
|
+
id: string;
|
|
624
624
|
isPublic: boolean;
|
|
625
625
|
storeSlug: string;
|
|
626
626
|
ownerId: string;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* - No creation if user has create_support_tickets soft ban
|
|
15
15
|
* - No new ticket in the same category while existing one is waiting_on_user
|
|
16
16
|
*/
|
|
17
|
+
import type { BaseDocument } from "../../../_internal/shared/types/base-document";
|
|
17
18
|
export declare const TicketCategoryValues: {
|
|
18
19
|
readonly ORDER_ISSUE: "order_issue";
|
|
19
20
|
readonly BILLING_PAYMENT: "billing_payment";
|
|
@@ -70,8 +71,7 @@ export interface TicketRelatedParties {
|
|
|
70
71
|
productId?: string;
|
|
71
72
|
bidId?: string;
|
|
72
73
|
}
|
|
73
|
-
export interface SupportTicketDocument {
|
|
74
|
-
id: string;
|
|
74
|
+
export interface SupportTicketDocument extends BaseDocument {
|
|
75
75
|
userId: string;
|
|
76
76
|
/** Denormalized — for admin table display. */
|
|
77
77
|
userEmail: string;
|
|
@@ -103,8 +103,6 @@ export interface SupportTicketDocument {
|
|
|
103
103
|
messages: TicketMessage[];
|
|
104
104
|
resolvedAt?: Date;
|
|
105
105
|
closedAt?: Date;
|
|
106
|
-
createdAt: Date;
|
|
107
|
-
updatedAt: Date;
|
|
108
106
|
}
|
|
109
107
|
export type SupportTicketCreateInput = Pick<SupportTicketDocument, "userId" | "userEmail" | "userDisplayName" | "category" | "subject" | "description" | "orderId">;
|
|
110
108
|
export type SupportTicketUpdateInput = Partial<Pick<SupportTicketDocument, "status" | "priority" | "assignedTo" | "assignedToName" | "internalNotes" | "resolvedAt" | "closedAt" | "relatedParties">>;
|
|
@@ -154,8 +154,8 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
|
|
|
154
154
|
createdAt: string | Date | z.objectOutputType<{
|
|
155
155
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
156
156
|
}, z.ZodTypeAny, "passthrough">;
|
|
157
|
-
id: string;
|
|
158
157
|
description: string;
|
|
158
|
+
id: string;
|
|
159
159
|
updatedAt: string | Date | z.objectOutputType<{
|
|
160
160
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
161
161
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -197,8 +197,8 @@ export declare const supportTicketFirestoreSchema: z.ZodObject<{
|
|
|
197
197
|
createdAt: string | Date | z.objectInputType<{
|
|
198
198
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
199
199
|
}, z.ZodTypeAny, "passthrough">;
|
|
200
|
-
id: string;
|
|
201
200
|
description: string;
|
|
201
|
+
id: string;
|
|
202
202
|
updatedAt: string | Date | z.objectInputType<{
|
|
203
203
|
toDate: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodDate>;
|
|
204
204
|
}, z.ZodTypeAny, "passthrough">;
|
|
@@ -158,7 +158,7 @@ export function SellerWhatsAppSettingsView({ hasCapability }) {
|
|
|
158
158
|
: step.checkKey === "connected"
|
|
159
159
|
? cfg?.connected === true
|
|
160
160
|
: Boolean(cfg?.[step.checkKey]);
|
|
161
|
-
return (_jsxs(Row, { gap: "sm", align: "start", children: [_jsx(Row, { textWeight: "bold", textSize: "xs", className: `flex-shrink-0 w-6 h-6 mt-0.5 ${done ? "bg-[var(--appkit-color-success)] text-white" : "bg-
|
|
161
|
+
return (_jsxs(Row, { gap: "sm", align: "start", children: [_jsx(Row, { textWeight: "bold", textSize: "xs", className: `flex-shrink-0 w-6 h-6 mt-0.5 ${done ? "bg-[var(--appkit-color-success)] text-white" : "bg-[var(--appkit-color-surface-elevated)] text-[var(--appkit-color-text-muted)] dark:text-[var(--appkit-color-text-faint)]"}`, align: "center", justify: "center", rounded: "full", children: done ? "✓" : step.n }), _jsxs(Div, { children: [_jsx(Text, { size: "sm", weight: "medium", color: "primary", children: step.title }), _jsx(Text, { className: "mt-0.5", color: "muted", size: "xs", children: step.body })] })] }, step.n));
|
|
162
162
|
}) })] }), _jsxs(Section, { className: CLS_SECTION_CARD, children: [_jsxs(Row, { justify: "between", align: "center", className: "mb-4", children: [_jsx(Heading, { level: 2, size: "sm", weight: "semibold", color: "primary", children: "Connection" }), isLoading ? null : cfg?.connected ? (_jsx(Badge, { variant: "success", children: "Connected" })) : (_jsx(Badge, { variant: "default", children: "Not configured" }))] }), _jsxs(Form, { onSubmit: (e) => {
|
|
163
163
|
e.preventDefault();
|
|
164
164
|
saveMutation.mutate();
|
|
@@ -168,7 +168,7 @@ export function SellerWhatsAppSettingsView({ hasCapability }) {
|
|
|
168
168
|
additionalItemCount: 2,
|
|
169
169
|
totalAmount: 450000,
|
|
170
170
|
orderId: "order-3-20260510-a1b2c3",
|
|
171
|
-
}) })] }), _jsxs(Section, { className: CLS_SECTION_CARD, children: [_jsx(Heading, { level: 2, className: "mb-2", color: "primary", size: "sm", weight: "semibold", children: "Catalog Preview" }), _jsx(Text, { className: "mb-4", color: "muted", size: "xs", children: "This is how your products appear in the WhatsApp Catalog when a buyer taps \"View Catalog\" in the chat. Only published standard products are included." }), _jsxs(Div, { className: `${__O.hidden} bg-[
|
|
171
|
+
}) })] }), _jsxs(Section, { className: CLS_SECTION_CARD, children: [_jsx(Heading, { level: 2, className: "mb-2", color: "primary", size: "sm", weight: "semibold", children: "Catalog Preview" }), _jsx(Text, { className: "mb-4", color: "muted", size: "xs", children: "This is how your products appear in the WhatsApp Catalog when a buyer taps \"View Catalog\" in the chat. Only published standard products are included." }), _jsxs(Div, { className: `${__O.hidden} bg-[var(--appkit-color-whatsapp-bg)] dark:bg-neutral-800 ${__P.p3}`, rounded: "xl", border: "default", children: [_jsxs(Row, { gap: "sm", align: "center", className: "mb-3", children: [_jsx(Row, { className: "w-8 h-8 bg-[var(--appkit-color-whatsapp)]", align: "center", justify: "center", rounded: "full", children: _jsx(Text, { color: "inverse", size: "xs", weight: "bold", children: "W" }) }), _jsxs(Div, { children: [_jsx(Text, { size: "xs", weight: "semibold", color: "primary", children: cfg?.connected ? "Your Store" : "Store Name" }), _jsx(Text, { className: "text-[10px]", color: "muted", children: "WhatsApp Business" })] })] }), _jsx(Div, { layout: "grid", gap: "2", className: "grid-cols-2", children: SAMPLE_CATALOG_ITEMS.map((item) => (_jsxs(Div, { surface: "card", className: `${__O.hidden}`, children: [_jsx(Row, { className: "aspect-square", surface: "subtle", align: "center", justify: "center", children: _jsx(Text, { size: "2xl", children: item.emoji }) }), _jsxs(Div, { padding: "xs", children: [_jsx(Text, { className: "line-clamp-2 leading-tight", color: "primary", size: "xs", weight: "medium", children: item.name }), _jsx(Text, { className: "text-[var(--appkit-color-whatsapp)] mt-0.5", size: "xs", weight: "semibold", children: item.price })] })] }, item.id))) }), _jsx(Div, { className: "mt-3 text-center", children: _jsx(Text, { className: "text-[10px]", color: "muted", children: cfg?.lastSyncCount
|
|
172
172
|
? `${cfg.lastSyncCount} products synced to catalog`
|
|
173
173
|
: "Sync your products to populate the catalog" }) })] }), !cfg?.connected && (_jsx(Text, { className: "text-warning mt-2", size: "xs", children: "Connect your WhatsApp Business account above to enable the catalog." }))] })] }));
|
|
174
174
|
}
|
|
@@ -5,7 +5,7 @@ const CLS_REMOVE_BTN = "self-start text-zinc-400 dark:text-zinc-400 transition h
|
|
|
5
5
|
export function WishlistCard({ item, onRemove, onProductClick, }) {
|
|
6
6
|
return (_jsxs(Div, { layout: "flex", gap: "4", surface: "card", padding: "sm", children: [_jsx(Div, { role: onProductClick ? "button" : undefined, tabIndex: onProductClick ? 0 : undefined, onClick: onProductClick ? () => onProductClick(item) : undefined, onKeyDown: onProductClick
|
|
7
7
|
? (e) => e.key === "Enter" && onProductClick(item)
|
|
8
|
-
: undefined, className: `h-20 w-20 flex-shrink-0 overflow-hidden bg-neutral-100 dark:bg-slate-800 ${onProductClick ? "cursor-pointer" : ""}`, rounded: "lg", children: item.productImage && (_jsx(
|
|
8
|
+
: undefined, className: `h-20 w-20 flex-shrink-0 overflow-hidden bg-neutral-100 dark:bg-slate-800 ${onProductClick ? "cursor-pointer" : ""}`, rounded: "lg", children: item.productImage && (_jsx("img", { src: item.productImage, alt: item.productTitle ?? "", className: "h-full w-full object-cover" })) }), _jsxs(Stack, { justify: "between", className: "flex-1", children: [_jsx(Text, { truncate: 2, weight: "medium", color: "primary", children: item.productTitle }), item.productPrice !== undefined && (_jsx(Text, { className: "text-neutral-900 dark:text-neutral-100", size: "sm", weight: "semibold", children: formatCurrency(item.productPrice, item.productCurrency) }))] }), onRemove && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onRemove(item.id), "aria-label": "Remove from wishlist", className: CLS_REMOVE_BTN, children: "\u2715" }))] }));
|
|
9
9
|
}
|
|
10
10
|
export function WishlistPage({ items, isLoading, onRemove, onProductClick, emptyLabel = "Your wishlist is empty", }) {
|
|
11
11
|
if (isLoading) {
|
|
@@ -23,12 +23,12 @@ export function WishlistToggleButton({ inWishlist, isLoading = false, onToggle,
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsx(LoginRequiredModal, { isOpen: showLoginModal, onClose: () => setShowLoginModal(false), message: "You need to be signed in to save items to your wishlist. Please log in or create an account." }), _jsx(Button, { type: "button", onClick: handleClick, disabled: isLoading, "aria-label": label, title: label, className: `
|
|
27
|
-
flex items-center justify-center
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(LoginRequiredModal, { isOpen: showLoginModal, onClose: () => setShowLoginModal(false), message: "You need to be signed in to save items to your wishlist. Please log in or create an account." }), _jsx(Button, { type: "button", onClick: handleClick, disabled: isLoading, "aria-label": label, title: label, rounded: "full", className: `
|
|
27
|
+
flex items-[center] justify-[center]
|
|
28
28
|
transition-all duration-150
|
|
29
29
|
${inWishlist
|
|
30
30
|
? "bg-error-surface text-error hover:bg-error-surface"
|
|
31
|
-
: "bg-
|
|
31
|
+
: "bg-[rgba(255,255,255,0.8)] text-[var(--appkit-color-text-faint)] hover:text-error"}
|
|
32
32
|
${sizeClasses[size]}
|
|
33
33
|
${isLoading ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
34
34
|
${className}
|
package/dist/http/ApiClient.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare class ApiClient {
|
|
|
54
54
|
put<T = JsonValue>(endpoint: string, data?: unknown, config?: RequestConfig): Promise<T>;
|
|
55
55
|
patch<T = JsonValue>(endpoint: string, data?: unknown, config?: RequestConfig): Promise<T>;
|
|
56
56
|
delete<T = JsonValue>(endpoint: string, config?: RequestConfig): Promise<T>;
|
|
57
|
+
blob(endpoint: string, config?: RequestConfig): Promise<Blob>;
|
|
57
58
|
upload<T = JsonValue>(endpoint: string, formData: FormData, config?: RequestConfig): Promise<T>;
|
|
58
59
|
}
|
|
59
60
|
/** Default singleton instance — reads NEXT_PUBLIC_APP_URL from env */
|
package/dist/http/ApiClient.js
CHANGED
|
@@ -132,6 +132,26 @@ export class ApiClient {
|
|
|
132
132
|
async delete(endpoint, config) {
|
|
133
133
|
return this.request(endpoint, { ...config, method: "DELETE" });
|
|
134
134
|
}
|
|
135
|
+
async blob(endpoint, config) {
|
|
136
|
+
const { params, timeout = this.defaultTimeout, headers: customHeaders, ...fetchConfig } = config ?? {};
|
|
137
|
+
const url = this.buildURL(endpoint, params);
|
|
138
|
+
const headers = await this.getHeaders("GET", customHeaders);
|
|
139
|
+
const controller = new AbortController();
|
|
140
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
141
|
+
try {
|
|
142
|
+
const response = await fetch(url, { ...fetchConfig, headers, signal: controller.signal, credentials: "include" });
|
|
143
|
+
clearTimeout(timeoutId);
|
|
144
|
+
if (!response.ok)
|
|
145
|
+
throw new ApiClientError(`Download failed with status ${response.status}`, response.status);
|
|
146
|
+
return response.blob();
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
clearTimeout(timeoutId);
|
|
150
|
+
if (error instanceof ApiClientError)
|
|
151
|
+
throw error;
|
|
152
|
+
throw new ApiClientError(error instanceof Error ? error.message : "Download failed", 0);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
135
155
|
async upload(endpoint, formData, config) {
|
|
136
156
|
const { headers, ...restConfig } = config ?? {};
|
|
137
157
|
const uploadHeaders = await this.getHeaders("POST", headers);
|
|
@@ -38,9 +38,6 @@ export interface TrackedError {
|
|
|
38
38
|
timestamp: string;
|
|
39
39
|
}
|
|
40
40
|
export type ErrorTrackerFn = (error: Error | string, category: ErrorCategory, severity: ErrorSeverity, context?: ErrorContext) => void;
|
|
41
|
-
declare global {
|
|
42
|
-
var __mohasinac_error_tracker__: ErrorTrackerFn | undefined;
|
|
43
|
-
}
|
|
44
41
|
/** Override the default console-based tracker with a custom implementation. */
|
|
45
42
|
export declare function setErrorTracker(fn: ErrorTrackerFn): void;
|
|
46
43
|
export declare function trackError(error: Error | string, category?: ErrorCategory, severity?: ErrorSeverity, context?: ErrorContext): void;
|
|
@@ -24,7 +24,7 @@ export var ErrorCategory;
|
|
|
24
24
|
})(ErrorCategory || (ErrorCategory = {}));
|
|
25
25
|
const TRACKER_KEY = "__mohasinac_error_tracker__";
|
|
26
26
|
function getTracker() {
|
|
27
|
-
return (globalThis
|
|
27
|
+
return (globalThis[TRACKER_KEY] ??
|
|
28
28
|
((error, category, severity, context) => {
|
|
29
29
|
const msg = error instanceof Error ? error.message : error;
|
|
30
30
|
console.error(`[${severity.toUpperCase()}][${category}] ${msg}`, context);
|
|
@@ -150,7 +150,7 @@ export const serverLogger = {
|
|
|
150
150
|
};
|
|
151
151
|
console.info(`[INFO] ${message}`, sanitized);
|
|
152
152
|
if (isFileLoggingEnabled)
|
|
153
|
-
writeLog(entry).catch(() => { });
|
|
153
|
+
writeLog(entry).catch((err) => { process.stderr.write(String(err) + "\n"); });
|
|
154
154
|
},
|
|
155
155
|
warn(message, data) {
|
|
156
156
|
const sanitized = data ? redactPii(normalizeLogData(data)) : undefined;
|
|
@@ -162,7 +162,7 @@ export const serverLogger = {
|
|
|
162
162
|
};
|
|
163
163
|
console.warn(`[WARN] ${message}`, sanitized);
|
|
164
164
|
if (isFileLoggingEnabled)
|
|
165
|
-
writeLog(entry).catch(() => { });
|
|
165
|
+
writeLog(entry).catch((err) => { process.stderr.write(String(err) + "\n"); });
|
|
166
166
|
},
|
|
167
167
|
error(message, data) {
|
|
168
168
|
const sanitized = data ? redactPii(normalizeLogData(data)) : undefined;
|
|
@@ -174,7 +174,7 @@ export const serverLogger = {
|
|
|
174
174
|
};
|
|
175
175
|
console.error(`[ERROR] ${message}`, sanitized);
|
|
176
176
|
if (isFileLoggingEnabled)
|
|
177
|
-
writeLog(entry).catch(() => { });
|
|
177
|
+
writeLog(entry).catch((err) => { process.stderr.write(String(err) + "\n"); });
|
|
178
178
|
},
|
|
179
179
|
};
|
|
180
180
|
/** Pull the commonly needed headers from a NextRequest in one call. */
|
|
@@ -34,7 +34,7 @@ export function GlobalError({ error, reset }) {
|
|
|
34
34
|
}, children: [_jsx(Heading, { level: 1, style: { fontSize: "2rem", marginBottom: "0.5rem" }, children: "Something went wrong" }), _jsx(Text, { style: { opacity: 0.7, marginBottom: "1.5rem" }, children: "A critical error occurred. We're working on it." }), process.env.NODE_ENV === "development" && (_jsxs(Pre, { style: {
|
|
35
35
|
fontSize: "0.75rem",
|
|
36
36
|
padding: "1rem",
|
|
37
|
-
background: "
|
|
37
|
+
background: "var(--appkit-color-zinc-100)",
|
|
38
38
|
borderRadius: "0.5rem",
|
|
39
39
|
textAlign: "left",
|
|
40
40
|
maxWidth: "40rem",
|