@mohasinac/appkit 2.7.27 → 2.7.31
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.d.ts +29 -0
- package/dist/_internal/client/features/filters/filter-load-options.js +98 -0
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +1 -1
- package/dist/_internal/server/features/checkout/actions.js +42 -35
- package/dist/_internal/server/features/classified/adapters.d.ts +21 -0
- package/dist/_internal/server/features/classified/adapters.js +24 -0
- package/dist/_internal/server/features/classified/index.d.ts +3 -0
- package/dist/_internal/server/features/classified/index.js +3 -0
- package/dist/_internal/server/features/classified/metadata.d.ts +8 -0
- package/dist/_internal/server/features/classified/metadata.js +43 -0
- package/dist/_internal/server/features/classified/og.d.ts +30 -0
- package/dist/_internal/server/features/classified/og.js +76 -0
- package/dist/_internal/server/features/digital-code/adapters.d.ts +21 -0
- package/dist/_internal/server/features/digital-code/adapters.js +29 -0
- package/dist/_internal/server/features/digital-code/index.d.ts +3 -0
- package/dist/_internal/server/features/digital-code/index.js +3 -0
- package/dist/_internal/server/features/digital-code/metadata.d.ts +8 -0
- package/dist/_internal/server/features/digital-code/metadata.js +36 -0
- package/dist/_internal/server/features/digital-code/og.d.ts +27 -0
- package/dist/_internal/server/features/digital-code/og.js +77 -0
- package/dist/_internal/server/features/live/adapters.d.ts +21 -0
- package/dist/_internal/server/features/live/adapters.js +34 -0
- package/dist/_internal/server/features/live/index.d.ts +3 -0
- package/dist/_internal/server/features/live/index.js +3 -0
- package/dist/_internal/server/features/live/metadata.d.ts +8 -0
- package/dist/_internal/server/features/live/metadata.js +39 -0
- package/dist/_internal/server/features/live/og.d.ts +27 -0
- package/dist/_internal/server/features/live/og.js +72 -0
- package/dist/_internal/server/features/promotions/actions.js +4 -3
- package/dist/_internal/server/jobs/core/onOrderCreate.js +19 -16
- package/dist/_internal/server/jobs/core/onOrderStatusChange.js +25 -22
- package/dist/_internal/server/jobs/core/onProductWrite.js +48 -58
- package/dist/_internal/shared/actions/action-registry.js +504 -9
- package/dist/_internal/shared/features/blog/schema.d.ts +4 -4
- package/dist/_internal/shared/features/brands/schema.d.ts +5 -5
- package/dist/_internal/shared/features/cart/schema.d.ts +18 -18
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +1 -1
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +38 -38
- package/dist/_internal/shared/features/events/schema.d.ts +8 -8
- package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
- package/dist/_internal/shared/features/products/schema.d.ts +42 -42
- package/dist/_internal/shared/features/promotions/schema.d.ts +4 -4
- package/dist/_internal/shared/features/reviews/schema.d.ts +1 -1
- package/dist/_internal/shared/media/limits.js +4 -3
- package/dist/client.d.ts +4 -0
- package/dist/client.js +2 -0
- package/dist/configs/next.js +4 -0
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +2 -0
- package/dist/constants/field-names.d.ts +1 -0
- package/dist/constants/field-names.js +1 -0
- package/dist/constants/table-keys.d.ts +6 -0
- package/dist/constants/table-keys.js +9 -0
- package/dist/core/hooks/useSyncManager.js +9 -8
- package/dist/features/about/components/FeesView.js +10 -7
- package/dist/features/about/components/HelpPageView.js +10 -1
- package/dist/features/about/components/HowAuctionsWorkView.js +10 -1
- package/dist/features/about/components/HowCheckoutWorksView.js +10 -1
- package/dist/features/about/components/HowOffersWorkView.js +10 -1
- package/dist/features/about/components/HowOrdersWorkView.js +10 -1
- package/dist/features/about/components/HowPayoutsWorkView.js +10 -1
- package/dist/features/about/components/HowPreOrdersWorkView.js +10 -1
- package/dist/features/about/components/HowReviewsWorkView.js +10 -1
- package/dist/features/about/components/PublicProfileView.js +46 -16
- package/dist/features/about/components/SecurityPrivacyView.js +7 -1
- package/dist/features/account/components/AddressesIndexListing.js +2 -2
- package/dist/features/account/components/NotificationBell.js +27 -16
- package/dist/features/account/components/NotificationPreferencesPanel.d.ts +9 -0
- package/dist/features/account/components/NotificationPreferencesPanel.js +91 -0
- package/dist/features/account/components/UserSidebar.js +4 -4
- package/dist/features/account/components/UserSupportView.js +16 -6
- package/dist/features/account/components/index.d.ts +2 -0
- package/dist/features/account/components/index.js +1 -0
- package/dist/features/account/schemas/index.d.ts +4 -4
- package/dist/features/account/types/index.d.ts +34 -0
- package/dist/features/admin/actions/admin-actions.js +4 -3
- package/dist/features/admin/actions/notification-actions.d.ts +24 -22
- package/dist/features/admin/actions/notification-actions.js +122 -22
- package/dist/features/admin/components/AdminAdEditorView.js +29 -15
- package/dist/features/admin/components/AdminAddressEditorView.d.ts +7 -0
- package/dist/features/admin/components/AdminAddressEditorView.js +117 -0
- package/dist/features/admin/components/AdminAdsView.js +22 -28
- package/dist/features/admin/components/AdminAllEventEntriesView.js +6 -1
- package/dist/features/admin/components/AdminBidsView.js +10 -3
- package/dist/features/admin/components/AdminBlogEditorView.js +2 -2
- package/dist/features/admin/components/AdminBlogView.js +8 -3
- package/dist/features/admin/components/AdminBrandsView.js +7 -2
- package/dist/features/admin/components/AdminBundleEditorView.js +5 -2
- package/dist/features/admin/components/AdminCarouselEditorView.js +6 -3
- package/dist/features/admin/components/AdminCarouselView.js +13 -7
- package/dist/features/admin/components/AdminCategoriesView.js +8 -3
- package/dist/features/admin/components/AdminCategoryEditorView.js +12 -9
- package/dist/features/admin/components/AdminContactView.js +6 -1
- package/dist/features/admin/components/AdminCouponEditorView.js +8 -2
- package/dist/features/admin/components/AdminCouponsView.js +6 -1
- package/dist/features/admin/components/AdminEmployeeEditorView.js +12 -9
- package/dist/features/admin/components/AdminFaqEditorView.js +2 -2
- package/dist/features/admin/components/AdminFaqsView.js +7 -2
- package/dist/features/admin/components/AdminFeatureFlagsView.js +58 -13
- package/dist/features/admin/components/AdminFeaturesView.js +4 -3
- package/dist/features/admin/components/AdminMediaView.js +9 -8
- package/dist/features/admin/components/AdminNavigationView.js +10 -17
- package/dist/features/admin/components/AdminNewsletterView.js +6 -1
- package/dist/features/admin/components/AdminNotificationsView.js +11 -3
- package/dist/features/admin/components/AdminOrdersView.js +6 -1
- package/dist/features/admin/components/AdminPayoutsView.js +10 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.js +10 -3
- package/dist/features/admin/components/AdminProductEditorView.d.ts +3 -1
- package/dist/features/admin/components/AdminProductEditorView.js +12 -9
- package/dist/features/admin/components/AdminProductsView.js +18 -12
- package/dist/features/admin/components/AdminReturnRequestsView.js +5 -4
- package/dist/features/admin/components/AdminReviewsView.js +36 -26
- package/dist/features/admin/components/AdminScammerEditorView.js +3 -2
- package/dist/features/admin/components/AdminScammersView.js +28 -26
- package/dist/features/admin/components/AdminSectionsView.js +112 -99
- package/dist/features/admin/components/AdminSessionsView.js +10 -3
- package/dist/features/admin/components/AdminSidebar.js +4 -4
- package/dist/features/admin/components/AdminSiteSettingsView.js +45 -4
- package/dist/features/admin/components/AdminStoresView.js +6 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +0 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
- package/dist/features/admin/components/AdminSupportTicketsView.js +32 -34
- package/dist/features/admin/components/AdminTeamView.js +6 -1
- package/dist/features/admin/components/AdminUserEditorView.js +8 -15
- package/dist/features/admin/components/AdminUsersView.js +6 -1
- package/dist/features/admin/components/AdminViewCards.js +4 -3
- package/dist/features/admin/components/DashboardStats.js +2 -2
- package/dist/features/admin/components/DataTable.js +2 -2
- package/dist/features/admin/components/index.d.ts +2 -0
- package/dist/features/admin/components/index.js +1 -0
- package/dist/features/admin/components/sections/adminSectionsTypes.js +4 -3
- package/dist/features/admin/repository/chat.repository.js +8 -8
- package/dist/features/admin/repository/site-settings.repository.d.ts +1 -0
- package/dist/features/admin/repository/site-settings.repository.js +11 -9
- package/dist/features/admin/schemas/firestore.d.ts +38 -0
- package/dist/features/admin/schemas/firestore.js +15 -0
- package/dist/features/auctions/components/AuctionBidsTable.d.ts +13 -0
- package/dist/features/auctions/components/AuctionBidsTable.js +62 -0
- package/dist/features/auctions/components/AuctionDetailPageView.js +15 -21
- package/dist/features/auctions/components/AuctionFilters.d.ts +7 -1
- package/dist/features/auctions/components/AuctionFilters.js +3 -2
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +18 -9
- package/dist/features/auctions/components/MarketplaceAuctionGrid.js +3 -2
- package/dist/features/auctions/components/index.d.ts +2 -1
- package/dist/features/auctions/components/index.js +1 -1
- package/dist/features/auctions/schemas/index.d.ts +14 -14
- package/dist/features/auth/actions/realtime-token-actions.js +19 -4
- package/dist/features/auth/components/RegisterForm.js +8 -4
- package/dist/features/auth/consent-otp.d.ts +2 -0
- package/dist/features/auth/consent-otp.js +8 -0
- package/dist/features/auth/schemas/firestore.d.ts +2 -0
- package/dist/features/auth/schemas/firestore.js +18 -25
- package/dist/features/auth/schemas/index.d.ts +2 -2
- package/dist/features/before-after/api/[id]/route.js +8 -6
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.d.ts +3 -3
- package/dist/features/blog/components/BlogIndexListing.js +21 -2
- package/dist/features/blog/components/BlogPostForm.js +11 -5
- package/dist/features/blog/components/BlogPostView.js +10 -2
- package/dist/features/blog/schemas/index.d.ts +18 -18
- package/dist/features/cart/components/CartDrawer.js +3 -2
- package/dist/features/cart/components/CartView.js +2 -1
- package/dist/features/cart/components/CheckoutView.js +2 -1
- package/dist/features/cart/repository/cart.repository.js +4 -3
- package/dist/features/cart/utils/pending-ops.d.ts +1 -1
- package/dist/features/categories/api/[id]/route.js +4 -3
- package/dist/features/categories/api/route.js +4 -3
- package/dist/features/categories/components/BrandDetailPageView.js +2 -2
- package/dist/features/categories/components/BrandDetailTabs.d.ts +5 -1
- package/dist/features/categories/components/BrandDetailTabs.js +30 -16
- package/dist/features/categories/components/BundleCollage.d.ts +8 -0
- package/dist/features/categories/components/BundleCollage.js +50 -0
- package/dist/features/categories/components/BundleDetailView.js +2 -10
- package/dist/features/categories/components/BundleItemsPicker.js +20 -13
- package/dist/features/categories/components/CategoriesIndexListing.js +28 -9
- package/dist/features/categories/components/CategoryDetailPageView.js +2 -2
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +5 -1
- package/dist/features/categories/components/CategoryDetailTabs.js +31 -16
- package/dist/features/categories/components/CategoryProductsListing.js +52 -13
- package/dist/features/categories/components/index.d.ts +2 -0
- package/dist/features/categories/components/index.js +1 -0
- package/dist/features/categories/schemas/index.d.ts +6 -6
- package/dist/features/checkout/actions/checkout-actions.js +4 -3
- package/dist/features/checkout/hooks/usePaymentCheckout.js +31 -22
- package/dist/features/classified/components/ClassifiedFilters.d.ts +12 -0
- package/dist/features/classified/components/ClassifiedFilters.js +20 -0
- package/dist/features/classified/components/ClassifiedIndexListing.d.ts +4 -0
- package/dist/features/classified/components/ClassifiedIndexListing.js +110 -0
- package/dist/features/classified/components/ClassifiedListView.d.ts +6 -0
- package/dist/features/classified/components/ClassifiedListView.js +43 -0
- package/dist/features/classified/components/index.d.ts +6 -0
- package/dist/features/classified/components/index.js +3 -0
- package/dist/features/collections/api/[slug]/route.js +16 -12
- package/dist/features/collections/schemas/index.d.ts +5 -5
- package/dist/features/consultation/api/[id]/route.js +12 -9
- package/dist/features/consultation/components/ConsultationForm.js +3 -2
- package/dist/features/consultation/schemas/index.d.ts +6 -6
- package/dist/features/contact/email.js +77 -116
- package/dist/features/copilot/components/AdminCopilotView.js +12 -2
- package/dist/features/corporate/api/[id]/route.js +12 -9
- package/dist/features/corporate/components/CorporateInquiryForm.js +2 -1
- package/dist/features/digital-codes/components/DigitalCodeFilters.d.ts +12 -0
- package/dist/features/digital-codes/components/DigitalCodeFilters.js +17 -0
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.d.ts +4 -0
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +107 -0
- package/dist/features/digital-codes/components/DigitalCodesListView.d.ts +6 -0
- package/dist/features/digital-codes/components/DigitalCodesListView.js +37 -0
- package/dist/features/digital-codes/components/index.d.ts +6 -0
- package/dist/features/digital-codes/components/index.js +3 -0
- package/dist/features/events/actions/event-actions.js +4 -3
- package/dist/features/events/components/AdminEventEditorView.js +3 -2
- package/dist/features/events/components/AdminEventsView.js +4 -2
- package/dist/features/events/components/EventPollWidget.js +5 -5
- package/dist/features/events/components/EventsIndexListing.js +2 -2
- package/dist/features/events/repository/event-entry.repository.d.ts +1 -0
- package/dist/features/events/repository/event-entry.repository.js +5 -0
- package/dist/features/events/schemas/index.d.ts +20 -20
- package/dist/features/faq/actions/faq-actions.d.ts +8 -8
- package/dist/features/faq/components/ContactCTA.js +3 -1
- package/dist/features/faq/components/FAQAccordion.js +1 -1
- package/dist/features/faq/schemas/index.d.ts +4 -4
- package/dist/features/filters/AsyncFacetSection.d.ts +18 -0
- package/dist/features/filters/AsyncFacetSection.js +65 -0
- package/dist/features/filters/index.d.ts +2 -0
- package/dist/features/filters/index.js +1 -0
- package/dist/features/forms/Checkbox.js +2 -2
- package/dist/features/forms/Input.js +2 -2
- package/dist/features/forms/Radio.js +5 -5
- package/dist/features/forms/Select.js +2 -2
- package/dist/features/forms/Slider.js +2 -2
- package/dist/features/forms/Textarea.js +2 -2
- package/dist/features/homepage/api/[id]/route.js +4 -3
- package/dist/features/homepage/api/sections/[id]/route.js +12 -9
- package/dist/features/homepage/components/AdSlot.js +2 -1
- package/dist/features/homepage/components/AdvertisementBanner.js +5 -3
- package/dist/features/homepage/components/BrandsSection.js +2 -2
- package/dist/features/homepage/components/CTABannerSection.js +2 -2
- package/dist/features/homepage/components/CharacterHotspot.d.ts +2 -2
- package/dist/features/homepage/components/CharacterHotspot.js +119 -157
- package/dist/features/homepage/components/CharacterHotspotForm.js +25 -20
- package/dist/features/homepage/components/CustomCardsSection.js +8 -6
- package/dist/features/homepage/components/FeaturedProductsSection.js +2 -2
- package/dist/features/homepage/components/GoogleReviewsSection.js +3 -3
- package/dist/features/homepage/components/HeroBanner.js +5 -4
- package/dist/features/homepage/components/HeroCarousel.js +13 -26
- package/dist/features/homepage/components/HowItWorksSection.js +4 -2
- package/dist/features/homepage/components/SocialFeedSection.js +2 -2
- package/dist/features/homepage/components/SocialPostCard.js +3 -2
- package/dist/features/homepage/lib/social-feed-fetcher.js +6 -3
- package/dist/features/layout/AppLayoutShell.d.ts +8 -2
- package/dist/features/layout/AppLayoutShell.js +54 -78
- package/dist/features/layout/BottomActions.js +43 -48
- package/dist/features/live/components/LiveItemFilters.d.ts +12 -0
- package/dist/features/live/components/LiveItemFilters.js +24 -0
- package/dist/features/live/components/LiveItemsIndexListing.d.ts +4 -0
- package/dist/features/live/components/LiveItemsIndexListing.js +108 -0
- package/dist/features/live/components/LiveItemsListView.d.ts +6 -0
- package/dist/features/live/components/LiveItemsListView.js +43 -0
- package/dist/features/live/components/index.d.ts +6 -0
- package/dist/features/live/components/index.js +3 -0
- package/dist/features/media/MediaLightbox.js +8 -14
- package/dist/features/media/types/index.d.ts +2 -2
- package/dist/features/media/upload/CameraCapture.js +2 -2
- package/dist/features/media/upload/ImageUpload.js +4 -2
- package/dist/features/media/upload/MediaUploadField.js +24 -8
- package/dist/features/media/upload/MediaUploadList.js +1 -1
- package/dist/features/orders/actions/order-actions.js +4 -3
- package/dist/features/orders/components/MarketplaceOrderCard.js +2 -1
- package/dist/features/orders/components/OrderFilters.js +12 -9
- package/dist/features/orders/schemas/index.d.ts +6 -6
- package/dist/features/pre-orders/api/[id]/route.js +12 -9
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +5 -4
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +29 -22
- package/dist/features/pre-orders/components/PreOrderFilters.d.ts +7 -1
- package/dist/features/pre-orders/components/PreOrderFilters.js +3 -2
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +17 -52
- package/dist/features/pre-orders/components/PreorderCard.d.ts +0 -9
- package/dist/features/pre-orders/components/PreorderCard.js +2 -13
- package/dist/features/pre-orders/components/index.d.ts +1 -1
- package/dist/features/pre-orders/components/index.js +1 -1
- package/dist/features/pre-orders/schemas/index.d.ts +10 -10
- package/dist/features/products/api/[id]/route.js +9 -7
- package/dist/features/products/api/route.js +1 -1
- package/dist/features/products/columns/productTableColumns.js +3 -3
- package/dist/features/products/components/AuctionsIndexListing.js +15 -51
- package/dist/features/products/components/BidHistory.js +2 -2
- package/dist/features/products/components/CompareOverlay.d.ts +2 -0
- package/dist/features/products/components/CompareOverlay.js +3 -2
- package/dist/features/products/components/MakeOfferButton.js +20 -14
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +2 -1
- package/dist/features/products/components/PrizeDrawCollage.d.ts +1 -15
- package/dist/features/products/components/PrizeDrawCollage.js +54 -14
- package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -1
- package/dist/features/products/components/PrizeDrawEntryActions.js +2 -1
- package/dist/features/products/components/PrizeDrawItemsEditor.js +9 -7
- package/dist/features/products/components/PrizeDrawsIndexListing.js +18 -51
- package/dist/features/products/components/PrizeRevealModal.js +24 -14
- package/dist/features/products/components/ProductDetailPageView.js +2 -1
- package/dist/features/products/components/ProductFilters.d.ts +7 -1
- package/dist/features/products/components/ProductFilters.js +11 -8
- package/dist/features/products/components/ProductForm.js +18 -16
- package/dist/features/products/components/ProductGalleryClient.js +2 -1
- package/dist/features/products/components/ProductGrid.js +12 -15
- package/dist/features/products/components/ProductsIndexListing.js +16 -52
- package/dist/features/products/components/ProductsIndexPageView.js +2 -2
- package/dist/features/products/repository/products.repository.d.ts +4 -0
- package/dist/features/products/repository/products.repository.js +22 -3
- package/dist/features/products/schemas/firestore.d.ts +7 -1
- package/dist/features/products/schemas/index.d.ts +56 -56
- package/dist/features/products/schemas/product-features.validators.d.ts +14 -14
- package/dist/features/products/types/index.d.ts +4 -0
- package/dist/features/promotions/components/CouponsIndexListing.js +1 -1
- package/dist/features/promotions/schemas/index.d.ts +6 -6
- package/dist/features/reviews/actions/review-actions.js +6 -5
- package/dist/features/reviews/api/[id]/route.js +4 -3
- package/dist/features/reviews/components/ReviewDetailPageView.js +2 -2
- package/dist/features/reviews/components/ReviewDetailShell.js +6 -3
- package/dist/features/reviews/components/ReviewsIndexListing.js +2 -2
- package/dist/features/reviews/schemas/index.d.ts +6 -6
- package/dist/features/scams/components/ScamProfileView.js +19 -10
- package/dist/features/scams/components/ScamRegistryView.js +2 -1
- package/dist/features/search/components/Search.d.ts +1 -1
- package/dist/features/search/components/Search.js +56 -49
- package/dist/features/search/schemas/index.d.ts +5 -5
- package/dist/features/seller/actions/offer-actions.js +11 -9
- package/dist/features/seller/components/SellerAddressesView.js +6 -4
- package/dist/features/seller/components/SellerBidsView.js +2 -2
- package/dist/features/seller/components/SellerCouponsView.js +1 -1
- package/dist/features/seller/components/SellerOffersPanel.js +6 -1
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +3 -3
- package/dist/features/seller/components/SellerPreOrdersView.js +5 -4
- package/dist/features/seller/components/SellerPrizeDrawsView.js +5 -4
- package/dist/features/seller/components/SellerProductShell.d.ts +19 -1
- package/dist/features/seller/components/SellerProductShell.js +75 -9
- package/dist/features/seller/components/SellerProductsView.js +10 -11
- package/dist/features/seller/components/SellerShippingView.js +3 -3
- package/dist/features/seller/components/SellerSidebar.js +10 -7
- package/dist/features/seller/components/SellerStorefrontView.js +3 -3
- package/dist/features/seller/schemas/index.d.ts +4 -4
- package/dist/features/shell/FormShell.js +2 -1
- package/dist/features/shell/QuickFormDrawer.js +4 -3
- package/dist/features/shell/StepForm.js +4 -3
- package/dist/features/stores/actions/store-query-actions.js +4 -3
- package/dist/features/stores/components/StoreAboutView.js +2 -1
- package/dist/features/stores/components/StoreAuctionsListing.js +43 -64
- package/dist/features/stores/components/StoreDetailLayoutView.js +18 -4
- package/dist/features/stores/components/StorePreOrdersListing.js +33 -57
- package/dist/features/stores/components/StoreProductsListing.js +16 -49
- package/dist/features/stores/components/StoresIndexListing.js +2 -2
- package/dist/features/stores/schemas/index.d.ts +2 -2
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +8 -7
- package/dist/features/wishlist/hooks/useGuestWishlist.d.ts +5 -5
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +6 -6
- package/dist/features/wishlist/utils/guest-wishlist.d.ts +5 -5
- package/dist/index.d.ts +27 -3
- package/dist/index.js +1743 -1725
- package/dist/monitoring/server-logger.js +5 -9
- package/dist/next/api/apiHandler.js +56 -37
- package/dist/next/components/GlobalError.js +2 -1
- package/dist/next/routing/route-map.d.ts +41 -0
- package/dist/next/routing/route-map.js +17 -0
- package/dist/react/ErrorBoundary.js +2 -1
- package/dist/react/contexts/SessionContext.js +38 -28
- package/dist/react/hooks/useCamera.d.ts +1 -1
- package/dist/react/hooks/useCamera.js +8 -7
- package/dist/seed/products-auctions-seed-data.js +40 -40
- package/dist/seed/products-preorders-seed-data.js +16 -16
- package/dist/seed/products-prize-draws-seed-data.js +4 -4
- package/dist/seed/products-standard-seed-data.js +202 -202
- package/dist/seed/site-settings-seed-data.js +6 -0
- package/dist/server-entry.d.ts +3 -0
- package/dist/server-entry.js +3 -0
- package/dist/server.d.ts +12 -0
- package/dist/server.js +15 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/DataTable.js +28 -7
- package/dist/ui/components/Button.d.ts +8 -1
- package/dist/ui/components/Button.js +47 -8
- package/dist/ui/components/CollageLightbox.d.ts +18 -0
- package/dist/ui/components/CollageLightbox.js +41 -0
- package/dist/ui/components/Dropdown.js +7 -6
- package/dist/ui/components/ImageLightbox.d.ts +7 -1
- package/dist/ui/components/ImageLightbox.js +15 -5
- package/dist/ui/components/PageLoader.js +4 -3
- package/dist/ui/components/PaginatedMultiSelect.d.ts +28 -0
- package/dist/ui/components/PaginatedMultiSelect.js +141 -0
- package/dist/ui/components/PaginatedMultiSelect.style.css +272 -0
- package/dist/ui/components/Semantic.js +1 -1
- package/dist/ui/components/SideDrawer.js +17 -15
- package/dist/ui/components/index.style.css +1 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/number.formatter.js +5 -13
- package/dist/utils/string.formatter.js +21 -18
- package/dist/validation/schemas.d.ts +2 -2
- package/package.json +1 -1
|
@@ -4,10 +4,11 @@ import React, { useState, useCallback } from "react";
|
|
|
4
4
|
import { Pencil, X } from "lucide-react";
|
|
5
5
|
import { useUrlTable } from "../../../react/hooks/useUrlTable";
|
|
6
6
|
import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
|
|
7
|
-
import { Alert, Badge, Button, FilterChipGroup, ListingToolbar, Pagination,
|
|
7
|
+
import { Alert, Badge, Button, Div, FilterChipGroup, ListingToolbar, ListingViewShell, Pagination, Row, Text } from "../../../ui";
|
|
8
8
|
import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
9
9
|
import { SELLER_PRIZE_DRAW_STATUS_TABS } from "../../admin/constants/filter-tabs";
|
|
10
10
|
import { ROUTES } from "../../../constants";
|
|
11
|
+
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
11
12
|
import { toRecordArray, toRelativeDate, toRupees, toStringValue, useSellerListingData, } from "../hooks/useSellerListingData";
|
|
12
13
|
import { DataTable } from "../../admin/components/DataTable";
|
|
13
14
|
import { useActionDispatch } from "../../../react/hooks/use-action-dispatch";
|
|
@@ -39,7 +40,7 @@ const PRIZE_DRAW_COLUMNS = [
|
|
|
39
40
|
{
|
|
40
41
|
key: "primary",
|
|
41
42
|
header: "Prize Draw",
|
|
42
|
-
render: (row) => (_jsxs("div", { className: "space-y-1", children: [_jsx(
|
|
43
|
+
render: (row) => (_jsxs("div", { className: "space-y-1", children: [_jsx(Text, { className: "font-medium text-[var(--appkit-color-text)] line-clamp-1", children: row.primary }), _jsx("span", { className: "text-xs text-[var(--appkit-color-text-muted)]", children: row.secondary })] })),
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
key: "entryFee",
|
|
@@ -134,8 +135,8 @@ export function SellerPrizeDrawsView({ children, ...props }) {
|
|
|
134
135
|
if (hasChildren) {
|
|
135
136
|
return (_jsx(ListingViewShell, { portal: "seller", ...props, children: children }));
|
|
136
137
|
}
|
|
137
|
-
return (_jsxs(
|
|
138
|
+
return (_jsxs(Div, { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search prize draws by name\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), totalPages > 1 && (_jsx("div", { className: "sticky z-10 flex justify-center bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm border-b border-[var(--appkit-color-border)] px-3 py-1.5", style: { top: "calc(var(--header-height, 0px) + 44px)" }, children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs("div", { className: "py-4 px-3 sm:px-4", children: [errorMessage && (_jsx(Alert, { variant: "error", className: "mb-4", children: errorMessage })), _jsx(DataTable, { columns: PRIZE_DRAW_COLUMNS, rows: rows, isLoading: isLoading, emptyLabel: "No prize draws listed yet", getRowHref: (row) => String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)), renderRowActions: (row) => (_jsx(Button, { variant: "ghost", size: "sm", onClick: (e) => {
|
|
138
139
|
e.stopPropagation();
|
|
139
140
|
void dispatch({ type: "NAVIGATE", href: String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id)) });
|
|
140
|
-
}, "aria-label": "
|
|
141
|
+
}, "aria-label": ACTIONS.STORE["edit-listing"].ariaLabel, children: _jsx(Pencil, { className: "w-4 h-4" }) })) })] }), filterOpen && (_jsxs(_Fragment, { children: [_jsx(Div, { role: "presentation", className: "fixed inset-0 z-40 bg-black/40", onClick: () => setFilterOpen(false) }), _jsxs(Div, { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-[var(--appkit-color-surface)] shadow-2xl", children: [_jsxs(Row, { justify: "between", className: "border-b border-[var(--appkit-color-border)] px-4 py-3.5", children: [_jsx(Text, { className: "text-base font-semibold text-[var(--appkit-color-text)]", children: "Filters" }), _jsxs(Row, { className: "gap-2", children: [activeFilterCount > 0 && (_jsx(Button, { variant: "ghost", size: "sm", onClick: clearFilters, className: "text-xs text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-error)]", children: "Clear all" })), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setFilterOpen(false), "aria-label": "Close filters", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx(Div, { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx(Div, { className: "border-t border-[var(--appkit-color-border)] px-4 py-3.5", children: _jsxs(Button, { variant: "primary", onClick: applyFilters, className: "w-full rounded-lg py-2.5 active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }));
|
|
141
142
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type ProductListingMode = "standard" | "auction" | "pre-order" | "prize-draw";
|
|
2
|
+
export type ProductListingMode = "standard" | "auction" | "pre-order" | "prize-draw" | "classified" | "digital-code" | "live";
|
|
3
3
|
export interface SellerProductDraft {
|
|
4
4
|
title?: string;
|
|
5
5
|
slug?: string;
|
|
@@ -38,6 +38,24 @@ export interface SellerProductDraft {
|
|
|
38
38
|
preOrderMaxQuantity?: number;
|
|
39
39
|
preOrderProductionStatus?: "upcoming" | "in_production" | "ready_to_ship";
|
|
40
40
|
preOrderCancellable?: boolean;
|
|
41
|
+
classifiedCity?: string;
|
|
42
|
+
classifiedLocality?: string;
|
|
43
|
+
classifiedPincode?: string;
|
|
44
|
+
classifiedContactMethod?: "chat" | "phone" | "both";
|
|
45
|
+
classifiedAcceptsShipping?: boolean;
|
|
46
|
+
classifiedNegotiable?: boolean;
|
|
47
|
+
digitalCodeDelivery?: "auto-claim" | "manual-email";
|
|
48
|
+
digitalCodePoolSize?: number;
|
|
49
|
+
digitalCodeRedemptionInstructions?: string;
|
|
50
|
+
digitalCodeExpiresAt?: string;
|
|
51
|
+
liveSpecies?: string;
|
|
52
|
+
liveAgeMonths?: number;
|
|
53
|
+
liveSex?: "male" | "female" | "unknown" | "n/a";
|
|
54
|
+
liveCareInfo?: string;
|
|
55
|
+
liveTransportMethod?: "courier" | "in-person" | "specialist";
|
|
56
|
+
liveHandlingFee?: number;
|
|
57
|
+
liveJurisdictions?: string[];
|
|
58
|
+
liveCites?: boolean;
|
|
41
59
|
}
|
|
42
60
|
export interface SellerProductShellProps {
|
|
43
61
|
mode: "create" | "edit";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useRef, useState } from "react";
|
|
4
4
|
import { useRouter } from "next/navigation";
|
|
5
5
|
import { FormShell, StepForm, useFormShell } from "../../shell";
|
|
6
|
-
import { Alert, Button, Div, FormField, FormGroup, Heading, Stack, Text, Toggle
|
|
6
|
+
import { Alert, Button, Div, FormField, FormGroup, Heading, Section, Stack, Text, Toggle } from "../../../ui";
|
|
7
7
|
import { ImageUpload, MediaUploadList, useMediaUpload } from "../../media";
|
|
8
8
|
import { StoreAddressSelectorCreate } from "../../stores/components/StoreAddressSelectorCreate";
|
|
9
9
|
const CONDITION_OPTIONS = [
|
|
@@ -27,7 +27,7 @@ function toPaise(rupeeStr) {
|
|
|
27
27
|
}
|
|
28
28
|
// ── Step 1: Basic ─────────────────────────────────────────────────────────────
|
|
29
29
|
function StepBasic({ values, onChange, renderCategorySelector, renderBrandSelector, renderTemplateSelector, }) {
|
|
30
|
-
return (_jsxs(Stack, { gap: "md", children: [renderTemplateSelector?.({ onApply: onChange }), _jsx(FormField, { name: "title", label: "Title", type: "text", value: values.title ?? "", onChange: (v) => onChange({ title: v }), placeholder: "e.g. Charizard Base Set PSA 9" }), _jsx(FormField, { name: "description", label: "Description", type: "textarea", value: values.description ?? "", onChange: (v) => onChange({ description: v }), placeholder: "Describe your listing in detail\u2026" }), _jsxs(FormGroup, { columns: 2, children: [renderCategorySelector ? (_jsxs(
|
|
30
|
+
return (_jsxs(Stack, { gap: "md", children: [renderTemplateSelector?.({ onApply: onChange }), _jsx(FormField, { name: "title", label: "Title", type: "text", value: values.title ?? "", onChange: (v) => onChange({ title: v }), placeholder: "e.g. Charizard Base Set PSA 9" }), _jsx(FormField, { name: "description", label: "Description", type: "textarea", value: values.description ?? "", onChange: (v) => onChange({ description: v }), placeholder: "Describe your listing in detail\u2026" }), _jsxs(FormGroup, { columns: 2, children: [renderCategorySelector ? (_jsxs(_Fragment, { children: [_jsx(Text, { className: "text-sm font-medium text-[var(--appkit-color-text)] mb-1", children: "Category" }), renderCategorySelector({ value: values.category ?? "", onChange: (v) => onChange({ category: v }) })] })) : (_jsx(FormField, { name: "category", label: "Category", type: "text", value: values.category ?? "", onChange: (v) => onChange({ category: v }), placeholder: "e.g. Trading Cards" })), _jsx(FormField, { name: "condition", label: "Condition", type: "select", value: values.condition ?? "new", onChange: (v) => onChange({ condition: v }), options: CONDITION_OPTIONS })] }), renderBrandSelector ? (_jsxs(_Fragment, { children: [_jsx(Text, { className: "text-sm font-medium text-[var(--appkit-color-text)] mb-1", children: "Brand" }), renderBrandSelector({ value: values.brand ?? "", onChange: (v) => onChange({ brand: v }) })] })) : (_jsx(FormField, { name: "brand", label: "Brand", type: "text", value: values.brand ?? "", onChange: (v) => onChange({ brand: v }), placeholder: "e.g. Pok\u00E9mon Company" })), _jsx(FormField, { name: "tags", label: "Tags (comma-separated)", type: "text", value: (values.tags ?? []).join(", "), onChange: (v) => onChange({ tags: v.split(",").map((t) => t.trim()).filter(Boolean) }), placeholder: "pokemon, psa9, charizard, holo" })] }));
|
|
31
31
|
}
|
|
32
32
|
// ── Step 2: Media ─────────────────────────────────────────────────────────────
|
|
33
33
|
function StepMedia({ values, onChange, storeSlug = "store", }) {
|
|
@@ -65,21 +65,57 @@ function StepAuctionSettings({ values, onChange, }) {
|
|
|
65
65
|
function StepPreOrderSettings({ values, onChange, }) {
|
|
66
66
|
return (_jsxs(Stack, { gap: "md", children: [_jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "preOrderDeliveryDate", label: "Estimated Delivery Date (YYYY-MM-DD)", type: "text", value: values.preOrderDeliveryDate ?? "", onChange: (v) => onChange({ preOrderDeliveryDate: v }), placeholder: "e.g. 2026-12-15", helpText: "When you expect to ship to buyers" }), _jsx(FormField, { name: "preOrderMaxQuantity", label: "Maximum Pre-Order Quantity (optional)", type: "number", value: String(values.preOrderMaxQuantity ?? ""), onChange: (v) => onChange({ preOrderMaxQuantity: v ? Number(v) : undefined }), placeholder: "Unlimited" })] }), _jsx(FormField, { name: "preOrderDepositPercent", label: "Deposit % (0 = full payment now)", type: "number", value: String(values.preOrderDepositPercent ?? 0), onChange: (v) => onChange({ preOrderDepositPercent: Math.min(100, Math.max(0, Number(v))) }), placeholder: "0", helpText: "Buyers pay this percentage upfront; remainder due on shipping" }), _jsx(FormField, { name: "preOrderProductionStatus", label: "Production Status", type: "select", value: values.preOrderProductionStatus ?? "upcoming", onChange: (v) => onChange({ preOrderProductionStatus: v }), options: PRODUCTION_STATUS_OPTIONS }), _jsx(Toggle, { checked: values.preOrderCancellable !== false, onChange: (checked) => onChange({ preOrderCancellable: checked }), label: "Allow buyers to cancel before shipping" })] }));
|
|
67
67
|
}
|
|
68
|
+
// ── Step 3: Classified Settings ───────────────────────────────────────────
|
|
69
|
+
const CLASSIFIED_CONTACT_OPTIONS = [
|
|
70
|
+
{ value: "chat", label: "In-app Chat only" },
|
|
71
|
+
{ value: "phone", label: "Phone / WhatsApp only" },
|
|
72
|
+
{ value: "both", label: "Chat or Phone" },
|
|
73
|
+
];
|
|
74
|
+
function StepClassifiedSettings({ values, onChange, }) {
|
|
75
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsx(Alert, { variant: "info", children: "Classified listings are local meetup / C2C sales. Add your meetup area so buyers know where you are." }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "classifiedCity", label: "City", type: "text", value: values.classifiedCity ?? "", onChange: (v) => onChange({ classifiedCity: v }), placeholder: "e.g. Mumbai" }), _jsx(FormField, { name: "classifiedLocality", label: "Locality / Area (optional)", type: "text", value: values.classifiedLocality ?? "", onChange: (v) => onChange({ classifiedLocality: v }), placeholder: "e.g. Andheri West" })] }), _jsx(FormField, { name: "classifiedPincode", label: "PIN Code (optional)", type: "text", value: values.classifiedPincode ?? "", onChange: (v) => onChange({ classifiedPincode: v }), placeholder: "400053" }), _jsx(FormField, { name: "classifiedContactMethod", label: "Preferred Contact Method", type: "select", value: values.classifiedContactMethod ?? "chat", onChange: (v) => onChange({ classifiedContactMethod: v }), options: CLASSIFIED_CONTACT_OPTIONS }), _jsx(Toggle, { checked: !!values.classifiedAcceptsShipping, onChange: (checked) => onChange({ classifiedAcceptsShipping: checked }), label: "Also open to shipping (in addition to meetup)" }), _jsx(Toggle, { checked: !!values.classifiedNegotiable, onChange: (checked) => onChange({ classifiedNegotiable: checked }), label: "Price is negotiable" })] }));
|
|
76
|
+
}
|
|
77
|
+
// ── Step 3: Digital Code Settings ─────────────────────────────────────────
|
|
78
|
+
const DIGITAL_DELIVERY_OPTIONS = [
|
|
79
|
+
{ value: "auto-claim", label: "Auto-Claim — code revealed instantly after payment" },
|
|
80
|
+
{ value: "manual-email", label: "Manual Email — you send the code within 24 h" },
|
|
81
|
+
];
|
|
82
|
+
function StepDigitalCodeSettings({ values, onChange, }) {
|
|
83
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsx(Alert, { variant: "info", children: "Digital code listings sell game keys, gift cards, or activation codes. Codes are never shown publicly." }), _jsx(FormField, { name: "digitalCodeDelivery", label: "Delivery Method", type: "select", value: values.digitalCodeDelivery ?? "auto-claim", onChange: (v) => onChange({ digitalCodeDelivery: v }), options: DIGITAL_DELIVERY_OPTIONS }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "digitalCodePoolSize", label: "Code Pool Size (optional)", type: "number", value: String(values.digitalCodePoolSize ?? ""), onChange: (v) => onChange({ digitalCodePoolSize: v ? Number(v) : undefined }), placeholder: "e.g. 50", helpText: "Total number of codes you have available" }), _jsx(FormField, { name: "digitalCodeExpiresAt", label: "Code Expiry Date (optional)", type: "text", value: values.digitalCodeExpiresAt ?? "", onChange: (v) => onChange({ digitalCodeExpiresAt: v }), placeholder: "YYYY-MM-DD", helpText: "When the codes expire (if applicable)" })] }), _jsx(FormField, { name: "digitalCodeRedemptionInstructions", label: "Redemption Instructions (optional)", type: "textarea", value: values.digitalCodeRedemptionInstructions ?? "", onChange: (v) => onChange({ digitalCodeRedemptionInstructions: v }), placeholder: "Step-by-step instructions for redeeming the code\u2026", helpText: "Shown to the buyer after purchase" })] }));
|
|
84
|
+
}
|
|
85
|
+
// ── Step 3: Live Item Settings ─────────────────────────────────────────────
|
|
86
|
+
const LIVE_SEX_OPTIONS = [
|
|
87
|
+
{ value: "male", label: "Male" },
|
|
88
|
+
{ value: "female", label: "Female" },
|
|
89
|
+
{ value: "unknown", label: "Unknown" },
|
|
90
|
+
{ value: "n/a", label: "N/A" },
|
|
91
|
+
];
|
|
92
|
+
const LIVE_TRANSPORT_OPTIONS = [
|
|
93
|
+
{ value: "in-person", label: "In-Person handover only" },
|
|
94
|
+
{ value: "courier", label: "Specialist live-animal courier" },
|
|
95
|
+
{ value: "specialist", label: "Third-party specialist transport" },
|
|
96
|
+
];
|
|
97
|
+
function StepLiveItemSettings({ values, onChange, }) {
|
|
98
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsx(Alert, { variant: "warning", children: "Live animal / plant listings must comply with all applicable laws, CITES regulations, and local jurisdiction rules. LetItRip is not responsible for legal compliance \u2014 this is solely the seller's responsibility." }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "liveSpecies", label: "Species / Common Name", type: "text", value: values.liveSpecies ?? "", onChange: (v) => onChange({ liveSpecies: v }), placeholder: "e.g. Axolotl (Ambystoma mexicanum)" }), _jsx(FormField, { name: "liveAgeMonths", label: "Age (months, optional)", type: "number", value: String(values.liveAgeMonths ?? ""), onChange: (v) => onChange({ liveAgeMonths: v ? Number(v) : undefined }), placeholder: "e.g. 6" })] }), _jsx(FormField, { name: "liveSex", label: "Sex", type: "select", value: values.liveSex ?? "unknown", onChange: (v) => onChange({ liveSex: v }), options: LIVE_SEX_OPTIONS }), _jsx(FormField, { name: "liveCareInfo", label: "Care Instructions (optional)", type: "textarea", value: values.liveCareInfo ?? "", onChange: (v) => onChange({ liveCareInfo: v }), placeholder: "Diet, temperature, habitat requirements\u2026" }), _jsx(FormField, { name: "liveTransportMethod", label: "Transport Method", type: "select", value: values.liveTransportMethod ?? "in-person", onChange: (v) => onChange({ liveTransportMethod: v }), options: LIVE_TRANSPORT_OPTIONS }), values.liveTransportMethod !== "in-person" && (_jsx(FormField, { name: "liveHandlingFee", label: "Handling / Transport Fee (\u20B9, optional)", type: "number", value: toRupees(values.liveHandlingFee), onChange: (v) => onChange({ liveHandlingFee: v ? toPaise(v) : undefined }), placeholder: "0" })), _jsx(FormField, { name: "liveJurisdictions", label: "Jurisdictions where sale is permitted (comma-separated)", type: "text", value: (values.liveJurisdictions ?? []).join(", "), onChange: (v) => onChange({ liveJurisdictions: v.split(",").map((s) => s.trim()).filter(Boolean) }), placeholder: "e.g. Maharashtra, Karnataka", helpText: "List all Indian states / UTs where you can legally sell" }), _jsx(Toggle, { checked: !!values.liveCites, onChange: (checked) => onChange({ liveCites: checked }), label: "This species requires CITES documentation" })] }));
|
|
99
|
+
}
|
|
68
100
|
// ── Step: Pricing ─────────────────────────────────────────────────────────
|
|
69
101
|
function StepPricing({ values, onChange, listingType, }) {
|
|
70
102
|
const priceLabel = listingType === "auction"
|
|
71
103
|
? "Suggested Retail Price (₹)"
|
|
72
104
|
: listingType === "pre-order"
|
|
73
105
|
? "Pre-Order Price (₹)"
|
|
74
|
-
:
|
|
75
|
-
|
|
106
|
+
: listingType === "classified"
|
|
107
|
+
? "Asking Price (₹)"
|
|
108
|
+
: listingType === "digital-code"
|
|
109
|
+
? "Price per Code (₹)"
|
|
110
|
+
: "Price (₹)";
|
|
111
|
+
return (_jsxs(Stack, { gap: "md", children: [_jsx(Alert, { variant: "info", children: "All prices in Indian Rupees (\u20B9)." }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "price", label: priceLabel, type: "number", value: toRupees(values.price), onChange: (v) => onChange({ price: toPaise(v) }), placeholder: "999" }), _jsx(FormField, { name: "compareAtPrice", label: "Compare-at Price (\u20B9, optional)", type: "number", value: toRupees(values.compareAtPrice), onChange: (v) => onChange({ compareAtPrice: v ? toPaise(v) : undefined }), placeholder: "1299", helpText: "Original price shown as strikethrough" })] }), (listingType === "standard" || listingType === "classified" || listingType === "live") && (_jsx(FormField, { name: "stockQuantity", label: "Stock Quantity", type: "number", value: String(values.stockQuantity ?? ""), onChange: (v) => onChange({ stockQuantity: Number(v) }), placeholder: "1" })), _jsxs(FormGroup, { columns: 2, children: [_jsx(Toggle, { checked: !!values.featured, onChange: (checked) => onChange({ featured: checked }), label: "Mark as Featured" }), _jsx(Toggle, { checked: !!values.isNew, onChange: (checked) => onChange({ isNew: checked }), label: "Mark as New Arrival" })] })] }));
|
|
76
112
|
}
|
|
77
113
|
// ── Step: Shipping ────────────────────────────────────────────────────────
|
|
78
114
|
function StepShipping({ values, onChange, renderAddressSelector, }) {
|
|
79
115
|
return (_jsxs(Stack, { gap: "md", children: [_jsx(FormField, { name: "shippingPaidBy", label: "Shipping Paid By", type: "select", value: values.shippingPaidBy ?? "buyer", onChange: (v) => onChange({ shippingPaidBy: v }), options: [
|
|
80
116
|
{ value: "buyer", label: "Buyer pays shipping" },
|
|
81
117
|
{ value: "seller", label: "Seller includes free shipping" },
|
|
82
|
-
] }), renderAddressSelector ? (_jsxs(
|
|
118
|
+
] }), renderAddressSelector ? (_jsxs(_Fragment, { children: [_jsx(Text, { className: "text-sm font-medium text-[var(--appkit-color-text)] mb-1", children: "Pickup Address (optional)" }), renderAddressSelector({
|
|
83
119
|
value: values.pickupAddressId ?? "",
|
|
84
120
|
onChange: (v) => onChange({ pickupAddressId: v }),
|
|
85
121
|
})] })) : (_jsx(StoreAddressSelectorCreate, { label: "Pickup Address (optional)", value: values.pickupAddressId ?? "", onChange: (id) => onChange({ pickupAddressId: id }) })), _jsx(Toggle, { checked: !!values.insurance, onChange: (checked) => onChange({ insurance: checked, insuranceCost: checked ? values.insuranceCost ?? 0 : undefined }), label: "Offer shipping insurance" }), values.insurance && (_jsx(FormField, { name: "insuranceCost", label: "Insurance Cost (\u20B9)", type: "number", value: toRupees(values.insuranceCost), onChange: (v) => onChange({ insuranceCost: toPaise(v) }), placeholder: "0" }))] }));
|
|
@@ -123,7 +159,17 @@ export function SellerProductShell({ mode, listingType = "standard", initialValu
|
|
|
123
159
|
await onPublish({ ...draft, status: "published" });
|
|
124
160
|
markClean();
|
|
125
161
|
}, [draft, onPublish, markClean]);
|
|
126
|
-
const listingTypeLabel = listingType === "auction"
|
|
162
|
+
const listingTypeLabel = listingType === "auction"
|
|
163
|
+
? "Auction"
|
|
164
|
+
: listingType === "pre-order"
|
|
165
|
+
? "Pre-Order"
|
|
166
|
+
: listingType === "classified"
|
|
167
|
+
? "Classified"
|
|
168
|
+
: listingType === "digital-code"
|
|
169
|
+
? "Digital Code"
|
|
170
|
+
: listingType === "live"
|
|
171
|
+
? "Live Item"
|
|
172
|
+
: "Product";
|
|
127
173
|
const typeSpecificStep = listingType === "auction"
|
|
128
174
|
? {
|
|
129
175
|
label: "Auction Settings",
|
|
@@ -136,7 +182,24 @@ export function SellerProductShell({ mode, listingType = "standard", initialValu
|
|
|
136
182
|
render: ({ values, onChange }) => (_jsx(StepPreOrderSettings, { values: values, onChange: onChange })),
|
|
137
183
|
validate: (v) => (!v.preOrderDeliveryDate ? "Estimated delivery date is required" : null),
|
|
138
184
|
}
|
|
139
|
-
:
|
|
185
|
+
: listingType === "classified"
|
|
186
|
+
? {
|
|
187
|
+
label: "Meetup Details",
|
|
188
|
+
render: ({ values, onChange }) => (_jsx(StepClassifiedSettings, { values: values, onChange: onChange })),
|
|
189
|
+
validate: (v) => (!v.classifiedCity?.trim() ? "City is required for classified listings" : null),
|
|
190
|
+
}
|
|
191
|
+
: listingType === "digital-code"
|
|
192
|
+
? {
|
|
193
|
+
label: "Code Details",
|
|
194
|
+
render: ({ values, onChange }) => (_jsx(StepDigitalCodeSettings, { values: values, onChange: onChange })),
|
|
195
|
+
}
|
|
196
|
+
: listingType === "live"
|
|
197
|
+
? {
|
|
198
|
+
label: "Live Item Details",
|
|
199
|
+
render: ({ values, onChange }) => (_jsx(StepLiveItemSettings, { values: values, onChange: onChange })),
|
|
200
|
+
validate: (v) => (!v.liveSpecies?.trim() ? "Species name is required" : null),
|
|
201
|
+
}
|
|
202
|
+
: null;
|
|
140
203
|
const steps = [
|
|
141
204
|
{
|
|
142
205
|
label: "Basic",
|
|
@@ -174,6 +237,9 @@ export function SellerProductShell({ mode, listingType = "standard", initialValu
|
|
|
174
237
|
...EDIT_SECTIONS,
|
|
175
238
|
...(listingType === "auction" ? [{ id: "auction", label: "Auction" }] : []),
|
|
176
239
|
...(listingType === "pre-order" ? [{ id: "preorder", label: "Pre-Order" }] : []),
|
|
240
|
+
...(listingType === "classified" ? [{ id: "classified", label: "Meetup Details" }] : []),
|
|
241
|
+
...(listingType === "digital-code" ? [{ id: "digitalcode", label: "Code Details" }] : []),
|
|
242
|
+
...(listingType === "live" ? [{ id: "live", label: "Live Item" }] : []),
|
|
177
243
|
];
|
|
178
|
-
return (_jsx(FormShell, { isOpen: true, onClose: handleDiscard, title: title, breadcrumb: breadcrumb, isDirty: isDirty, isLoading: isLoading, sections: editSections, onSaveDraft: handleSave, onPublish: handlePublish, saveLabel: "Save Changes", publishLabel: "Update", previewSlot: previewSlot, children: _jsxs(Stack, { gap: "lg", children: [_jsxs(
|
|
244
|
+
return (_jsx(FormShell, { isOpen: true, onClose: handleDiscard, title: title, breadcrumb: breadcrumb, isDirty: isDirty, isLoading: isLoading, sections: editSections, onSaveDraft: handleSave, onPublish: handlePublish, saveLabel: "Save Changes", publishLabel: "Update", previewSlot: previewSlot, children: _jsxs(Stack, { gap: "lg", children: [_jsxs(Section, { id: "basic", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Basic Info" }), _jsx(StepBasic, { values: draft, onChange: update, renderCategorySelector: renderCategorySelector, renderBrandSelector: renderBrandSelector, renderTemplateSelector: renderTemplateSelector })] }), _jsxs(Section, { id: "media", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Media" }), _jsx(StepMedia, { values: draft, onChange: update, storeSlug: storeSlug })] }), listingType === "auction" && (_jsxs(Section, { id: "auction", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Auction Settings" }), _jsx(StepAuctionSettings, { values: draft, onChange: update })] })), listingType === "pre-order" && (_jsxs(Section, { id: "preorder", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Pre-Order Settings" }), _jsx(StepPreOrderSettings, { values: draft, onChange: update })] })), listingType === "classified" && (_jsxs(Section, { id: "classified", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Meetup Details" }), _jsx(StepClassifiedSettings, { values: draft, onChange: update })] })), listingType === "digital-code" && (_jsxs(Section, { id: "digitalcode", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Code Details" }), _jsx(StepDigitalCodeSettings, { values: draft, onChange: update })] })), listingType === "live" && (_jsxs(Section, { id: "live", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Live Item Details" }), _jsx(StepLiveItemSettings, { values: draft, onChange: update })] })), _jsxs(Section, { id: "pricing", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Pricing" }), _jsx(StepPricing, { values: draft, onChange: update, listingType: listingType })] }), _jsxs(Section, { id: "shipping", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Shipping" }), _jsx(StepShipping, { values: draft, onChange: update, renderAddressSelector: renderAddressSelector })] }), _jsxs(Section, { id: "publish", children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Publish" }), _jsx(StepPublish, { values: draft, onChange: update }), onSaveAsTemplate && (_jsxs(Div, { className: "mt-4 border-t border-[var(--appkit-color-border)] pt-4", children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => onSaveAsTemplate(draft), children: "Save as Template" }), _jsx(Text, { className: "mt-1 text-xs text-[var(--appkit-color-secondary-text)]", children: "Save these settings as a reusable template for future listings." })] }))] })] }) }));
|
|
179
245
|
}
|
|
@@ -5,13 +5,14 @@ import { useActionDispatch } from "../../../react/hooks/use-action-dispatch";
|
|
|
5
5
|
import { X, Pencil, Trash2 } from "lucide-react";
|
|
6
6
|
import { useUrlTable } from "../../../react/hooks/useUrlTable";
|
|
7
7
|
import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
|
|
8
|
-
import { Alert, FilterChipGroup, ListingToolbar, Pagination,
|
|
8
|
+
import { Alert, Badge, Button, Div, FilterChipGroup, ListingToolbar, ListingViewShell, Pagination, Row, Span, Text } from "../../../ui";
|
|
9
9
|
import { SELLER_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
10
10
|
import { SELLER_PRODUCT_STATUS_TABS } from "../../admin/constants/filter-tabs";
|
|
11
11
|
import { ROUTES } from "../../../constants";
|
|
12
12
|
import { normalizeListingType } from "../../products/utils/listing-type";
|
|
13
13
|
import { toRecordArray, toRelativeDate, toStringValue, useSellerListingData, } from "../hooks/useSellerListingData";
|
|
14
14
|
import { DataTable } from "../../admin/components/DataTable";
|
|
15
|
+
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
15
16
|
const PAGE_SIZE = 25;
|
|
16
17
|
const FILTER_KEYS = ["status"];
|
|
17
18
|
const DEFAULT_SORT = "-createdAt";
|
|
@@ -32,7 +33,7 @@ function TypeChips({ active, onChange, }) {
|
|
|
32
33
|
{ kind: "pre-order", label: "Pre-order" },
|
|
33
34
|
{ kind: "prize-draw", label: "Prize Draw" },
|
|
34
35
|
];
|
|
35
|
-
return (_jsx(
|
|
36
|
+
return (_jsx(Row, { className: "gap-2 px-3 lg:px-4 py-2 overflow-x-auto border-b border-[var(--appkit-color-border)]", children: chips.map(({ kind, label }) => (_jsx("button", { type: "button", onClick: () => onChange(kind), className: [
|
|
36
37
|
"flex-shrink-0 rounded-full px-3 py-1 text-xs font-medium border transition-colors",
|
|
37
38
|
active === kind
|
|
38
39
|
? "bg-[var(--appkit-color-primary)] text-white border-[var(--appkit-color-primary)]"
|
|
@@ -50,18 +51,18 @@ const PRODUCT_COLUMNS = [
|
|
|
50
51
|
key: "thumbnail",
|
|
51
52
|
header: "",
|
|
52
53
|
className: "w-12",
|
|
53
|
-
render: (row) => row.imageUrl ? (_jsx("img", { src: row.imageUrl, alt: "", className: "w-10 h-10 rounded-lg object-cover border border-[var(--appkit-color-border)]" })) : (_jsx(
|
|
54
|
+
render: (row) => row.imageUrl ? (_jsx("img", { src: row.imageUrl, alt: "", className: "w-10 h-10 rounded-lg object-cover border border-[var(--appkit-color-border)]" })) : (_jsx(Div, { className: "w-10 h-10 rounded-lg bg-[var(--appkit-color-surface-raised)] border border-[var(--appkit-color-border)] flex items-center justify-center", children: _jsx(Span, { className: "text-xs text-[var(--appkit-color-text-faint)]", children: "\u2013" }) })),
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
57
|
key: "primary",
|
|
57
58
|
header: "Product",
|
|
58
|
-
render: (row) => (_jsxs(
|
|
59
|
+
render: (row) => (_jsxs(Div, { className: "space-y-1", children: [_jsx(Text, { className: "font-medium text-[var(--appkit-color-text)] line-clamp-1", children: row.primary }), _jsxs(Row, { className: "gap-2", children: [_jsx(Badge, { variant: KIND_BADGE_VARIANT[row.listingKind] ?? "default", children: row.listingKind }), _jsx(Span, { className: "text-xs text-[var(--appkit-color-text-muted)]", children: row.secondary })] })] })),
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
62
|
key: "price",
|
|
62
63
|
header: "Price",
|
|
63
64
|
className: "w-28 text-right",
|
|
64
|
-
render: (row) => (_jsx(
|
|
65
|
+
render: (row) => (_jsx(Span, { className: "text-sm font-medium text-[var(--appkit-color-text)]", children: row.price })),
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
68
|
key: "status",
|
|
@@ -82,7 +83,7 @@ const PRODUCT_COLUMNS = [
|
|
|
82
83
|
key: "updatedAt",
|
|
83
84
|
header: "Updated",
|
|
84
85
|
className: "w-28",
|
|
85
|
-
render: (row) => (_jsx(
|
|
86
|
+
render: (row) => (_jsx(Span, { className: "text-xs text-[var(--appkit-color-text-muted)]", children: row.updatedAt })),
|
|
86
87
|
},
|
|
87
88
|
];
|
|
88
89
|
export function SellerProductsView({ onDeleteProduct, children, ...props }) {
|
|
@@ -194,8 +195,6 @@ export function SellerProductsView({ onDeleteProduct, children, ...props }) {
|
|
|
194
195
|
const handleDelete = async (row) => {
|
|
195
196
|
if (!onDeleteProduct)
|
|
196
197
|
return;
|
|
197
|
-
if (!confirm(`Delete "${row.primary}"? This cannot be undone.`))
|
|
198
|
-
return;
|
|
199
198
|
setDeletingId(row.id);
|
|
200
199
|
try {
|
|
201
200
|
await onDeleteProduct(row.id);
|
|
@@ -204,7 +203,7 @@ export function SellerProductsView({ onDeleteProduct, children, ...props }) {
|
|
|
204
203
|
setDeletingId(null);
|
|
205
204
|
}
|
|
206
205
|
};
|
|
207
|
-
return (_jsx(_Fragment, { children: _jsxs(
|
|
206
|
+
return (_jsx(_Fragment, { children: _jsxs(Div, { className: "min-h-screen", children: [_jsx(ListingToolbar, { filterCount: activeFilterCount, onFiltersClick: openFilters, searchValue: searchInput, searchPlaceholder: "Search products by name\u2026", onSearchChange: setSearchInput, onSearchCommit: commitSearch, sortValue: table.get("sort") || DEFAULT_SORT, sortOptions: SORT_OPTIONS, onSortChange: (v) => { table.set("sort", v); }, showTableView: true, view: view, onViewChange: (v) => setView(v), onResetAll: resetAll, hasActiveState: hasActiveState }), _jsx(TypeChips, { active: listingKind, onChange: handleKindChange }), totalPages > 1 && (_jsx(Div, { className: "sticky z-10 flex justify-center bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm border-b border-[var(--appkit-color-border)] px-3 py-1.5", style: { top: "calc(var(--header-height, 0px) + 44px)" }, children: _jsx(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: (p) => table.setPage(p) }) })), _jsxs(Div, { className: "py-4 px-3 lg:px-4", children: [errorMessage && (_jsx(Alert, { variant: "error", className: "mb-4", children: errorMessage })), _jsx(DataTable, { columns: PRODUCT_COLUMNS, rows: rows, isLoading: isLoading, emptyLabel: listingKind !== "all"
|
|
208
207
|
? `No ${listingKind} listings found`
|
|
209
208
|
: "No products listed yet", getRowHref: (row) => row.listingKind === "auction"
|
|
210
209
|
? String(ROUTES.STORE.AUCTIONS_EDIT(row.id))
|
|
@@ -213,6 +212,6 @@ export function SellerProductsView({ onDeleteProduct, children, ...props }) {
|
|
|
213
212
|
: row.listingKind === "prize-draw"
|
|
214
213
|
? String(ROUTES.STORE.PRIZE_DRAWS_EDIT(row.id))
|
|
215
214
|
: String(ROUTES.STORE.PRODUCTS_EDIT(row.id)), renderRowActions: onDeleteProduct
|
|
216
|
-
? (row) => (_jsxs(
|
|
217
|
-
: undefined })] }), filterOpen && (_jsxs(_Fragment, { children: [_jsx("
|
|
215
|
+
? (row) => (_jsxs(Row, { className: "gap-1", children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: (e) => { e.stopPropagation(); handleEdit(row); }, "aria-label": ACTIONS.STORE["edit-listing"].ariaLabel, children: _jsx(Pencil, { className: "w-4 h-4" }) }), _jsx(Button, { variant: "ghost", size: "sm", action: ACTIONS.STORE["delete-listing"], onClick: (e) => { e.stopPropagation(); void handleDelete(row); }, disabled: deletingId === row.id, className: "text-[var(--appkit-color-error)] hover:bg-[var(--appkit-color-border-subtle)]", children: _jsx(Trash2, { className: "w-4 h-4" }) })] }))
|
|
216
|
+
: undefined })] }), filterOpen && (_jsxs(_Fragment, { children: [_jsx(Div, { role: "presentation", className: "fixed inset-0 z-40 bg-black/40", onClick: () => setFilterOpen(false) }), _jsxs(Div, { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-[var(--appkit-color-surface)] shadow-2xl", children: [_jsxs(Row, { justify: "between", className: "border-b border-[var(--appkit-color-border)] px-4 py-3.5", children: [_jsx(Text, { className: "text-base font-semibold text-[var(--appkit-color-text)]", children: "Filters" }), _jsxs(Row, { className: "gap-2", children: [activeFilterCount > 0 && (_jsx(Button, { variant: "ghost", size: "sm", onClick: clearFilters, className: "text-xs text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-error)]", children: "Clear all" })), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setFilterOpen(false), "aria-label": "Close filters", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), _jsx(Div, { className: "flex-1 overflow-y-auto px-4 py-4 space-y-5", children: _jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) }) }), _jsx(Div, { className: "border-t border-[var(--appkit-color-border)] px-4 py-3.5", children: _jsxs(Button, { variant: "primary", onClick: applyFilters, className: "w-full rounded-lg py-2.5 active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }))] }) }));
|
|
218
217
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
|
-
import { Alert, Badge, Button, Div, FormField, Heading, Stack, Text
|
|
4
|
+
import { Alert, Badge, Button, Div, FormField, Heading, Section, Stack, Text } from "../../../ui";
|
|
5
5
|
import { StackedViewShell } from "../../../ui";
|
|
6
6
|
import { StoreAddressSelectorCreate } from "../../stores/components/StoreAddressSelectorCreate";
|
|
7
7
|
const DEFAULT_DRAFT = {
|
|
@@ -80,9 +80,9 @@ export function SellerShippingView({ apiBase = "/api/store/shipping" }) {
|
|
|
80
80
|
const isCustom = draft.method === "custom";
|
|
81
81
|
const busy = loading || saving;
|
|
82
82
|
return (_jsx(StackedViewShell, { portal: "seller", title: "Shipping Configuration", sections: [
|
|
83
|
-
_jsxs(Stack, { gap: "lg", children: [current && (_jsxs(Div, { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: current.isConfigured ? "success" : "warning", children: current.isConfigured ? "Configured" : "Not configured" }), current.method === "shiprocket" && (_jsx(Badge, { variant: current.isTokenValid ? "success" : "danger", children: current.isTokenValid ? "Shiprocket connected" : "Shiprocket token expired" }))] })), error && _jsx(Alert, { variant: "error", children: error }), success && _jsx(Alert, { variant: "success", children: "Shipping configuration saved." }), _jsxs(
|
|
83
|
+
_jsxs(Stack, { gap: "lg", children: [current && (_jsxs(Div, { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: current.isConfigured ? "success" : "warning", children: current.isConfigured ? "Configured" : "Not configured" }), current.method === "shiprocket" && (_jsx(Badge, { variant: current.isTokenValid ? "success" : "danger", children: current.isTokenValid ? "Shiprocket connected" : "Shiprocket token expired" }))] })), error && _jsx(Alert, { variant: "error", children: error }), success && _jsx(Alert, { variant: "success", children: "Shipping configuration saved." }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-3", children: "Shipping Method" }), _jsx(Stack, { gap: "sm", children: ["custom", "shiprocket"].map((m) => (_jsxs("label", { className: "flex items-center gap-3 p-3 rounded-lg border border-[var(--appkit-color-border)] cursor-pointer has-[:checked]:border-[var(--appkit-color-primary)] has-[:checked]:bg-[var(--appkit-color-primary)]/5", children: [_jsx("input", { type: "radio", name: "method", value: m, checked: draft.method === m, onChange: () => update("method", m), className: "accent-[var(--appkit-color-primary)]", disabled: busy }), _jsxs(Div, { children: [_jsx(Text, { className: "font-medium capitalize", children: m === "custom" ? "Custom / Manual" : "Shiprocket" }), _jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)]", children: m === "custom"
|
|
84
84
|
? "Set a fixed shipping fee and carrier name for all orders."
|
|
85
|
-
: "Automated shipping via Shiprocket — connect your account for label generation and tracking." })] })] }, m))) })] }), isCustom && (_jsxs(
|
|
85
|
+
: "Automated shipping via Shiprocket — connect your account for label generation and tracking." })] })] }, m))) })] }), isCustom && (_jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-3", children: "Custom Shipping Details" }), _jsxs(Stack, { gap: "md", children: [_jsx(FormField, { name: "customCarrierName", label: "Carrier Name", type: "text", value: draft.customCarrierName, onChange: (v) => update("customCarrierName", v), placeholder: "e.g. India Post, DTDC, Delhivery", disabled: busy }), _jsx(FormField, { name: "customShippingPrice", label: "Shipping Price (\u20B9)", type: "number", value: draft.customShippingPrice, onChange: (v) => update("customShippingPrice", v), placeholder: "0 for free shipping", helpText: "Charged to buyer at checkout. Enter 0 for free shipping.", disabled: busy })] })] })), !isCustom && (_jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-3", children: "Shiprocket Account" }), _jsxs(Stack, { gap: "md", children: [_jsx(FormField, { name: "shiprocketEmail", label: "Shiprocket Email", type: "email", value: draft.shiprocketEmail, onChange: (v) => update("shiprocketEmail", v), placeholder: "your@email.com", disabled: busy }), _jsx(FormField, { name: "shiprocketPassword", label: current?.isTokenValid ? "Password (leave blank to keep existing token)" : "Password", type: "password", value: draft.shiprocketPassword, onChange: (v) => update("shiprocketPassword", v), placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", helpText: current?.isTokenValid ? "Only fill this to re-authenticate." : "Required to connect your Shiprocket account.", disabled: busy }), _jsxs(Div, { children: [_jsx(StoreAddressSelectorCreate, { value: draft.pickupAddressId, onChange: (id) => update("pickupAddressId", id), label: "Pickup Address (optional)", disabled: busy }), _jsx(Text, { className: "mt-1 text-xs text-[var(--appkit-color-text-muted)]", children: "Registering a pickup address sends an OTP to your phone for verification." })] }), current?.pickupAddress && (_jsxs(Alert, { variant: "info", children: ["Current pickup: ", current.pickupAddress.locationName ?? "", current.pickupAddress.city ? `, ${current.pickupAddress.city}` : "", current.pickupAddress.isVerified
|
|
86
86
|
? " — ✓ Verified"
|
|
87
87
|
: " — Pending OTP verification"] }))] })] })), _jsx(Div, { className: "flex justify-end pt-2 border-t border-[var(--appkit-color-border)]", children: _jsx(Button, { variant: "primary", onClick: handleSave, disabled: busy, isLoading: saving, children: "Save Configuration" }) })] }, "shipping"),
|
|
88
88
|
] }));
|
|
@@ -5,13 +5,19 @@ import { createPortal } from "react-dom";
|
|
|
5
5
|
import Link from "next/link";
|
|
6
6
|
import { Div, Li, Nav, Row, Span, Text, Ul } from "../../../ui";
|
|
7
7
|
import { BottomSheet } from "../../layout/BottomSheet";
|
|
8
|
+
const CLS_STORE_AVATAR = "h-8 w-8 rounded-md bg-cover bg-center flex-shrink-0";
|
|
9
|
+
const CLS_STORE_FALLBACK = "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md bg-primary/10 text-sm font-bold text-primary";
|
|
10
|
+
const CLS_STORE_NAME = "text-sm font-semibold text-zinc-900 dark:text-zinc-100 truncate";
|
|
11
|
+
function isNavItemActive(item, activeHref) {
|
|
12
|
+
return activeHref === item.href;
|
|
13
|
+
}
|
|
8
14
|
function NavLink({ item, isActive, onClick }) {
|
|
9
15
|
return (_jsxs(Link, { href: item.href, onClick: onClick, className: `flex items-center gap-2.5 rounded-lg px-3 py-2 text-[0.8125rem] font-medium leading-tight transition-colors ${isActive
|
|
10
16
|
? "bg-orange-50 dark:bg-orange-900/20 text-orange-700 dark:text-orange-300"
|
|
11
17
|
: "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-slate-800/60 hover:text-zinc-800 dark:hover:text-zinc-200"}`, children: [item.icon && _jsx(Span, { className: "shrink-0 text-base opacity-60", children: item.icon }), _jsx(Span, { className: "flex-1 truncate", children: item.label }), item.badge != null && item.badge > 0 && (_jsx(Span, { className: "shrink-0 rounded-full bg-orange-500 px-1.5 py-0.5 text-[10px] font-bold text-white leading-none", children: item.badge }))] }));
|
|
12
18
|
}
|
|
13
19
|
function FlatContent({ items, activeHref, storeName, storeLogoURL, onItemClick, }) {
|
|
14
|
-
return (_jsxs(_Fragment, { children: [storeName && (_jsxs(Row, { gap: "3", className: "px-4 py-3 border-b border-zinc-100 dark:border-slate-700", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className:
|
|
20
|
+
return (_jsxs(_Fragment, { children: [storeName && (_jsxs(Row, { gap: "3", className: "px-4 py-3 border-b border-zinc-100 dark:border-slate-700", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className: CLS_STORE_AVATAR, style: { backgroundImage: `url(${storeLogoURL})` } })) : (_jsx(Div, { className: CLS_STORE_FALLBACK, children: storeName[0]?.toUpperCase() })), _jsx(Text, { className: CLS_STORE_NAME, children: storeName })] })), _jsx(Nav, { "aria-label": "Store navigation", className: "py-3", children: _jsx(Ul, { className: "space-y-0.5 px-3", children: items.map((item) => {
|
|
15
21
|
const isActive = activeHref === item.href;
|
|
16
22
|
return (_jsx(Li, { children: _jsx(NavLink, { item: item, isActive: isActive, onClick: onItemClick }) }, item.href));
|
|
17
23
|
}) }) })] }));
|
|
@@ -22,15 +28,12 @@ function GroupsContent({ groups, activeHref, storeName, storeLogoURL, onItemClic
|
|
|
22
28
|
g.defaultOpen ?? g.items.some((i) => activeHref === i.href),
|
|
23
29
|
])));
|
|
24
30
|
const toggle = useCallback((title) => setOpenGroups((p) => ({ ...p, [title]: !p[title] })), []);
|
|
25
|
-
return (_jsxs(_Fragment, { children: [storeName && (_jsxs(Row, { gap: "3", className: "px-4 py-3 border-b border-zinc-100 dark:border-slate-700", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className:
|
|
31
|
+
return (_jsxs(_Fragment, { children: [storeName && (_jsxs(Row, { gap: "3", className: "px-4 py-3 border-b border-zinc-100 dark:border-slate-700", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className: CLS_STORE_AVATAR, style: { backgroundImage: `url(${storeLogoURL})` } })) : (_jsx(Div, { className: CLS_STORE_FALLBACK, children: storeName[0]?.toUpperCase() })), _jsx(Text, { className: CLS_STORE_NAME, children: storeName })] })), _jsx(Nav, { "aria-label": "Store navigation", className: "py-2", children: groups.map((group) => {
|
|
26
32
|
const isOpen = openGroups[group.title] ?? false;
|
|
27
33
|
const hasActive = group.items.some((i) => activeHref === i.href);
|
|
28
34
|
return (_jsxs("div", { className: "mb-0.5", children: [_jsxs("button", { type: "button", onClick: () => toggle(group.title), className: `flex w-full items-center justify-between px-4 py-2 text-[0.6875rem] font-semibold uppercase tracking-widest transition-colors ${hasActive && !isOpen
|
|
29
35
|
? "text-orange-600 dark:text-orange-400"
|
|
30
|
-
: "text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300"}`, children: [_jsx("span", { children: group.title }), _jsx("svg", { className: `w-3 h-3 transition-transform duration-150 ${isOpen ? "rotate-180" : ""}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M19 9l-7 7-7-7" }) })] }), isOpen && (_jsx(Ul, { className: "space-y-0.5 px-3 pb-1", children: group.items.map((item) => {
|
|
31
|
-
const isActive = activeHref === item.href;
|
|
32
|
-
return (_jsx(Li, { children: _jsx(NavLink, { item: item, isActive: isActive, onClick: onItemClick }) }, item.href));
|
|
33
|
-
}) }))] }, group.title));
|
|
36
|
+
: "text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300"}`, children: [_jsx("span", { children: group.title }), _jsx("svg", { className: `w-3 h-3 transition-transform duration-150 ${isOpen ? "rotate-180" : ""}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M19 9l-7 7-7-7" }) })] }), isOpen && (_jsx(Ul, { className: "space-y-0.5 px-3 pb-1", children: group.items.map((item) => (_jsx(Li, { children: _jsx(NavLink, { item: item, isActive: isNavItemActive(item, activeHref), onClick: onItemClick }) }, item.href))) }))] }, group.title));
|
|
34
37
|
}) })] }));
|
|
35
38
|
}
|
|
36
39
|
function DrawerPanel({ title, onClose, children }) {
|
|
@@ -53,7 +56,7 @@ export function StoreSidebar({ items, groups, activeHref, storeName, storeLogoUR
|
|
|
53
56
|
height: "calc(100vh - var(--header-height, 3.5rem))",
|
|
54
57
|
width: "18rem",
|
|
55
58
|
transform: desktopOpen ? "translateX(0)" : "translateX(calc(-100% + 1.25rem))",
|
|
56
|
-
}, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-950 border-r border-zinc-200 dark:border-slate-700 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className:
|
|
59
|
+
}, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-950 border-r border-zinc-200 dark:border-slate-700 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className: CLS_STORE_AVATAR, style: { backgroundImage: `url(${storeLogoURL})` } })) : (_jsx(Div, { className: CLS_STORE_FALLBACK, children: storeName?.[0]?.toUpperCase() })), _jsx(Text, { className: CLS_STORE_NAME, children: storeName || panelTitle })] }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: navContent })] }), _jsx("button", { type: "button", onClick: handleToggle, "aria-label": desktopOpen ? "Collapse sidebar" : "Expand sidebar", className: "w-5 shrink-0 bg-primary dark:bg-secondary hover:bg-primary-600 dark:hover:bg-secondary-600 flex items-center justify-center transition-colors rounded-r-md shadow-md", children: _jsx("svg", { className: "w-3 h-3 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: desktopOpen ? (_jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M11 19l-7-7 7-7m8 14l-7-7 7-7" })) : (_jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M13 5l7 7-7 7M5 5l7 7-7 7" })) }) })] }), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: panelTitle, children: groups ? (_jsx(GroupsContent, { groups: groups, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) : (_jsx(FlatContent, { items: items, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) }) })] }));
|
|
57
60
|
}
|
|
58
61
|
return (_jsxs(_Fragment, { children: [mounted && mobileOpen &&
|
|
59
62
|
createPortal(_jsx(DrawerPanel, { title: panelTitle, onClose: close, children: navContent }), document.body), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: panelTitle, children: groups ? (_jsx(GroupsContent, { groups: groups, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) : (_jsx(FlatContent, { items: items, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) }) })] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { StackedViewShell } from "../../../ui";
|
|
4
|
+
import { Section, StackedViewShell } from "../../../ui";
|
|
5
5
|
import { Alert, Button, FormField, FormGroup, Heading, Stack, Text, Toggle, } from "../../../ui";
|
|
6
6
|
import { ImageUpload, useMediaUpload } from "../../media";
|
|
7
7
|
import { useFormShell } from "../../shell";
|
|
@@ -43,7 +43,7 @@ export function SellerStorefrontView({ initialValues, onSave, isLoading = false,
|
|
|
43
43
|
};
|
|
44
44
|
const busy = saving || isLoading;
|
|
45
45
|
return (_jsx(StackedViewShell, { portal: "seller", title: "Storefront Settings", sections: [
|
|
46
|
-
_jsxs(Stack, { gap: "lg", children: [saved && (_jsx(Alert, { variant: "success", children: "Changes saved successfully." })), _jsxs(
|
|
46
|
+
_jsxs(Stack, { gap: "lg", children: [saved && (_jsx(Alert, { variant: "success", children: "Changes saved successfully." })), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Store Profile" }), _jsxs(Stack, { gap: "md", children: [_jsx(FormField, { name: "storeName", label: "Store Name", type: "text", value: draft.storeName ?? "", onChange: (v) => update({ storeName: v }), placeholder: "e.g. Pok\u00E9mon Palace", disabled: busy }), _jsx(FormField, { name: "bio", label: "Short Bio (shown in search results)", type: "textarea", value: draft.bio ?? "", onChange: (v) => update({ bio: v }), placeholder: "One-liner about your store (max 300 chars)", disabled: busy }), _jsxs(FormGroup, { columns: 2, children: [_jsx(ImageUpload, { label: "Store Logo", currentImage: draft.storeLogoURL, onUpload: (file) => {
|
|
47
47
|
return upload(file, "stores", true, {
|
|
48
48
|
type: "store-logo",
|
|
49
49
|
store: storeSlug,
|
|
@@ -53,6 +53,6 @@ export function SellerStorefrontView({ initialValues, onSave, isLoading = false,
|
|
|
53
53
|
type: "store-banner",
|
|
54
54
|
store: storeSlug,
|
|
55
55
|
});
|
|
56
|
-
}, onChange: (url) => update({ storeBannerURL: url }), helperText: "Recommended: 1200\u00D7300px" })] })] })] }), _jsxs(
|
|
56
|
+
}, onChange: (url) => update({ storeBannerURL: url }), helperText: "Recommended: 1200\u00D7300px" })] })] })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Store Details" }), _jsxs(Stack, { gap: "md", children: [_jsx(FormField, { name: "storeCategory", label: "Store Category", type: "text", value: draft.storeCategory ?? "", onChange: (v) => update({ storeCategory: v }), placeholder: "e.g. Trading Cards, Action Figures", disabled: busy }), _jsx(FormField, { name: "storeDescription", label: "Full Description", type: "textarea", value: draft.storeDescription ?? "", onChange: (v) => update({ storeDescription: v }), placeholder: "Detailed store description shown on your public store page\u2026", disabled: busy })] })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Policies" }), _jsxs(Stack, { gap: "md", children: [_jsx(FormField, { name: "returnPolicy", label: "Return Policy", type: "textarea", value: draft.returnPolicy ?? "", onChange: (v) => update({ returnPolicy: v }), placeholder: "Describe your return policy\u2026", disabled: busy }), _jsx(FormField, { name: "shippingPolicy", label: "Shipping Policy", type: "textarea", value: draft.shippingPolicy ?? "", onChange: (v) => update({ shippingPolicy: v }), placeholder: "How and when you ship orders\u2026", disabled: busy })] })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Contact & Social" }), _jsxs(Stack, { gap: "md", children: [_jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "website", label: "Website", type: "text", value: draft.website ?? "", onChange: (v) => update({ website: v }), placeholder: "https://example.com", disabled: busy }), _jsx(FormField, { name: "location", label: "Location", type: "text", value: draft.location ?? "", onChange: (v) => update({ location: v }), placeholder: "e.g. Mumbai, India", disabled: busy })] }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "twitter", label: "Twitter / X URL", type: "text", value: draft.socialLinks?.twitter ?? "", onChange: (v) => updateSocial("twitter", v), placeholder: "https://twitter.com/...", disabled: busy }), _jsx(FormField, { name: "instagram", label: "Instagram URL", type: "text", value: draft.socialLinks?.instagram ?? "", onChange: (v) => updateSocial("instagram", v), placeholder: "https://instagram.com/...", disabled: busy })] }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "facebook", label: "Facebook URL", type: "text", value: draft.socialLinks?.facebook ?? "", onChange: (v) => updateSocial("facebook", v), placeholder: "https://facebook.com/...", disabled: busy }), _jsx(FormField, { name: "linkedin", label: "LinkedIn URL", type: "text", value: draft.socialLinks?.linkedin ?? "", onChange: (v) => updateSocial("linkedin", v), placeholder: "https://linkedin.com/...", disabled: busy })] })] })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Vacation Mode" }), _jsxs(Stack, { gap: "md", children: [_jsx(Toggle, { checked: !!draft.isVacationMode, onChange: (checked) => update({ isVacationMode: checked }), label: "Enable vacation mode \u2014 your store will show a notice to buyers", disabled: busy }), draft.isVacationMode && (_jsx(FormField, { name: "vacationMessage", label: "Vacation Message", type: "textarea", value: draft.vacationMessage ?? "", onChange: (v) => update({ vacationMessage: v }), placeholder: "I'm away until\u2026 Orders placed now will ship when I return.", disabled: busy }))] })] }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-4", children: "Visibility" }), _jsx(Toggle, { checked: draft.isPublic !== false, onChange: (checked) => update({ isPublic: checked }), label: "Make store public \u2014 visible to all buyers", disabled: busy }), draft.isPublic === false && (_jsx(Text, { className: "mt-2 text-sm text-[var(--appkit-color-text-muted)]", children: "Your store is hidden. Existing orders are unaffected." }))] }), _jsxs(Section, { children: [_jsx(Heading, { level: 3, className: "mb-1", children: "Google Business Reviews" }), _jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)] mb-4", children: "Display real Google reviews on your store About page. Requires a Google Place ID." }), _jsxs(Stack, { gap: "md", children: [_jsx(Toggle, { checked: !!draft.googleReviews?.enabled, onChange: (checked) => updateGoogleReviews({ enabled: checked }), label: "Show Google reviews on my store About page", disabled: busy }), draft.googleReviews?.enabled && (_jsxs(_Fragment, { children: [_jsx(FormField, { name: "googlePlaceId", label: "Google Place ID", type: "text", value: draft.googleReviews.placeId ?? "", onChange: (v) => updateGoogleReviews({ placeId: v }), placeholder: "ChIJ...", helpText: "Find your Place ID at developers.google.com/maps/documentation/places/web-service/place-id", disabled: busy }), _jsxs(FormGroup, { columns: 2, children: [_jsx(FormField, { name: "googleMaxReviews", label: "Max reviews to show", type: "number", value: String(draft.googleReviews.maxReviews ?? 6), onChange: (v) => updateGoogleReviews({ maxReviews: Number(v) }), disabled: busy }), _jsx(FormField, { name: "googleMinRating", label: "Minimum star rating (1\u20135)", type: "number", value: String(draft.googleReviews.minRating ?? 0), onChange: (v) => updateGoogleReviews({ minRating: Number(v) }), disabled: busy })] })] }))] })] }), _jsxs("div", { className: "flex items-center justify-end gap-3 pt-2 border-t border-[var(--appkit-color-border)]", children: [isDirty && !saving && (_jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)]", children: "You have unsaved changes." })), _jsx(Button, { variant: "primary", onClick: handleSave, disabled: busy || !isDirty, isLoading: saving, children: "Save Changes" })] })] }, "profile"),
|
|
57
57
|
] }));
|
|
58
58
|
}
|
|
@@ -93,6 +93,7 @@ export declare const sellerStoreSchema: z.ZodObject<{
|
|
|
93
93
|
isPublic: boolean;
|
|
94
94
|
storeSlug: string;
|
|
95
95
|
ownerId: string;
|
|
96
|
+
returnPolicy?: string | undefined;
|
|
96
97
|
location?: string | undefined;
|
|
97
98
|
stats?: {
|
|
98
99
|
itemsSold: number;
|
|
@@ -100,7 +101,6 @@ export declare const sellerStoreSchema: z.ZodObject<{
|
|
|
100
101
|
totalReviews: number;
|
|
101
102
|
averageRating?: number | undefined;
|
|
102
103
|
} | undefined;
|
|
103
|
-
returnPolicy?: string | undefined;
|
|
104
104
|
website?: string | undefined;
|
|
105
105
|
storeCategory?: string | undefined;
|
|
106
106
|
storeDescription?: string | undefined;
|
|
@@ -125,6 +125,7 @@ export declare const sellerStoreSchema: z.ZodObject<{
|
|
|
125
125
|
isPublic: boolean;
|
|
126
126
|
storeSlug: string;
|
|
127
127
|
ownerId: string;
|
|
128
|
+
returnPolicy?: string | undefined;
|
|
128
129
|
location?: string | undefined;
|
|
129
130
|
stats?: {
|
|
130
131
|
itemsSold: number;
|
|
@@ -132,7 +133,6 @@ export declare const sellerStoreSchema: z.ZodObject<{
|
|
|
132
133
|
totalReviews: number;
|
|
133
134
|
averageRating?: number | undefined;
|
|
134
135
|
} | undefined;
|
|
135
|
-
returnPolicy?: string | undefined;
|
|
136
136
|
website?: string | undefined;
|
|
137
137
|
storeCategory?: string | undefined;
|
|
138
138
|
storeDescription?: string | undefined;
|
|
@@ -213,15 +213,15 @@ export declare const sellerListParamsSchema: z.ZodObject<{
|
|
|
213
213
|
perPage?: number | undefined;
|
|
214
214
|
status?: "pending" | "active" | "rejected" | "suspended" | undefined;
|
|
215
215
|
q?: string | undefined;
|
|
216
|
-
page?: number | undefined;
|
|
217
216
|
category?: string | undefined;
|
|
217
|
+
page?: number | undefined;
|
|
218
218
|
}, {
|
|
219
219
|
sort?: string | undefined;
|
|
220
220
|
perPage?: number | undefined;
|
|
221
221
|
status?: "pending" | "active" | "rejected" | "suspended" | undefined;
|
|
222
222
|
q?: string | undefined;
|
|
223
|
-
page?: number | undefined;
|
|
224
223
|
category?: string | undefined;
|
|
224
|
+
page?: number | undefined;
|
|
225
225
|
}>;
|
|
226
226
|
export declare const payoutListParamsSchema: z.ZodObject<{
|
|
227
227
|
sellerId: z.ZodOptional<z.ZodString>;
|