@mohasinac/appkit 2.7.58 → 2.8.0
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 +4 -5
- package/dist/_internal/server/features/auctions/og.js +8 -32
- package/dist/_internal/server/features/blog/og.js +10 -49
- package/dist/_internal/server/features/checkout/actions.js +6 -0
- package/dist/_internal/server/features/classified/og.js +9 -51
- package/dist/_internal/server/features/digital-code/actions.d.ts +11 -0
- package/dist/_internal/server/features/digital-code/actions.js +30 -0
- package/dist/_internal/server/features/digital-code/index.d.ts +1 -0
- package/dist/_internal/server/features/digital-code/index.js +1 -0
- package/dist/_internal/server/features/digital-code/og.js +9 -51
- package/dist/_internal/server/features/events/og.js +10 -49
- package/dist/_internal/server/features/item-requests/data.d.ts +17 -0
- package/dist/_internal/server/features/item-requests/data.js +20 -0
- package/dist/_internal/server/features/item-requests/index.d.ts +2 -0
- package/dist/_internal/server/features/item-requests/index.js +2 -0
- package/dist/_internal/server/features/item-requests/og.d.ts +40 -0
- package/dist/_internal/server/features/item-requests/og.js +136 -0
- package/dist/_internal/server/features/live/actions.d.ts +5 -0
- package/dist/_internal/server/features/live/actions.js +24 -0
- package/dist/_internal/server/features/live/index.d.ts +1 -0
- package/dist/_internal/server/features/live/index.js +1 -0
- package/dist/_internal/server/features/live/og.js +9 -51
- package/dist/_internal/server/features/media/contextGuards.js +19 -8
- package/dist/_internal/server/features/pre-orders/og.js +8 -32
- package/dist/_internal/server/features/prize-draws/data.d.ts +17 -0
- package/dist/_internal/server/features/prize-draws/data.js +20 -0
- package/dist/_internal/server/features/prize-draws/index.d.ts +2 -0
- package/dist/_internal/server/features/prize-draws/index.js +2 -0
- package/dist/_internal/server/features/prize-draws/og.d.ts +30 -0
- package/dist/_internal/server/features/prize-draws/og.js +50 -0
- package/dist/_internal/server/features/products/og.js +8 -33
- package/dist/_internal/server/features/scams/og.js +1 -1
- package/dist/_internal/server/features/seo/og-layout.d.ts +42 -0
- package/dist/_internal/server/features/seo/og-layout.js +69 -0
- package/dist/_internal/server/features/stores/og.js +8 -41
- package/dist/_internal/server/features/sublisting-categories/og.js +11 -42
- package/dist/_internal/shared/actions/bulk-helpers.d.ts +3 -0
- package/dist/_internal/shared/actions/bulk-helpers.js +19 -0
- package/dist/_internal/shared/config/schema.d.ts +4 -4
- package/dist/client.d.ts +13 -6
- package/dist/client.js +9 -3
- package/dist/configs/next.js +11 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/notification-types.d.ts +20 -0
- package/dist/constants/notification-types.js +37 -0
- package/dist/constants/pagination-presets.d.ts +39 -0
- package/dist/constants/pagination-presets.js +38 -0
- package/dist/errors/messages.d.ts +0 -4
- package/dist/errors/messages.js +0 -4
- package/dist/features/account/components/AddressesIndexListing.js +3 -4
- package/dist/features/account/components/UserOffersPanel.js +1 -1
- package/dist/features/account/components/UserSidebar.js +14 -10
- package/dist/features/account/components/UserSupportView.d.ts +1 -2
- package/dist/features/account/components/UserSupportView.js +9 -1
- package/dist/features/admin/actions/admin-actions.js +16 -1
- package/dist/features/admin/components/AdminAllEventEntriesView.d.ts +2 -3
- package/dist/features/admin/components/AdminAllEventEntriesView.js +50 -89
- package/dist/features/admin/components/AdminBidsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBidsView.js +64 -104
- package/dist/features/admin/components/AdminBlogView.d.ts +3 -7
- package/dist/features/admin/components/AdminBlogView.js +53 -88
- package/dist/features/admin/components/AdminBrandEditorView.js +14 -17
- package/dist/features/admin/components/AdminBrandsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBrandsView.js +85 -89
- package/dist/features/admin/components/AdminBundlesView.js +68 -130
- package/dist/features/admin/components/AdminCarouselView.d.ts +2 -2
- package/dist/features/admin/components/AdminCarouselView.js +22 -70
- package/dist/features/admin/components/AdminCartsView.d.ts +2 -3
- package/dist/features/admin/components/AdminCartsView.js +39 -89
- package/dist/features/admin/components/AdminCategoriesView.d.ts +3 -3
- package/dist/features/admin/components/AdminCategoriesView.js +97 -96
- package/dist/features/admin/components/AdminCategoryEditorView.js +2 -6
- package/dist/features/admin/components/AdminClassifiedView.d.ts +3 -0
- package/dist/features/admin/components/AdminClassifiedView.js +44 -0
- package/dist/features/admin/components/AdminContactView.d.ts +2 -2
- package/dist/features/admin/components/AdminContactView.js +105 -130
- package/dist/features/admin/components/AdminCouponEditorView.js +14 -17
- package/dist/features/admin/components/AdminCouponsView.d.ts +3 -6
- package/dist/features/admin/components/AdminCouponsView.js +69 -97
- package/dist/features/admin/components/AdminDigitalCodesView.d.ts +3 -0
- package/dist/features/admin/components/AdminDigitalCodesView.js +51 -0
- package/dist/features/admin/components/AdminFaqEditorView.js +14 -17
- package/dist/features/admin/components/AdminFaqsView.d.ts +4 -4
- package/dist/features/admin/components/AdminFaqsView.js +79 -86
- package/dist/features/admin/components/AdminFeatureEditorView.js +7 -9
- package/dist/features/admin/components/AdminFeaturesView.d.ts +2 -3
- package/dist/features/admin/components/AdminFeaturesView.js +57 -70
- package/dist/features/admin/components/AdminGroupedListingsView.d.ts +3 -0
- package/dist/features/admin/components/AdminGroupedListingsView.js +43 -0
- package/dist/features/admin/components/AdminHistoryView.d.ts +2 -3
- package/dist/features/admin/components/AdminHistoryView.js +35 -52
- package/dist/features/admin/components/AdminListingScaffold.d.ts +2 -2
- package/dist/features/admin/components/AdminListingScaffold.js +3 -3
- package/dist/features/admin/components/AdminLiveView.d.ts +3 -0
- package/dist/features/admin/components/AdminLiveView.js +50 -0
- package/dist/features/admin/components/AdminNewsletterView.d.ts +2 -2
- package/dist/features/admin/components/AdminNewsletterView.js +68 -108
- package/dist/features/admin/components/AdminNotificationsView.d.ts +2 -3
- package/dist/features/admin/components/AdminNotificationsView.js +67 -99
- package/dist/features/admin/components/AdminOrderEditorView.js +10 -10
- package/dist/features/admin/components/AdminOrdersView.d.ts +2 -3
- package/dist/features/admin/components/AdminOrdersView.js +93 -113
- package/dist/features/admin/components/AdminPayoutsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPayoutsView.js +51 -97
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.js +41 -83
- package/dist/features/admin/components/AdminProductEditorView.js +3 -7
- package/dist/features/admin/components/AdminProductsView.d.ts +4 -4
- package/dist/features/admin/components/AdminProductsView.js +166 -167
- package/dist/features/admin/components/AdminReturnRequestsView.d.ts +1 -1
- package/dist/features/admin/components/AdminReturnRequestsView.js +64 -66
- package/dist/features/admin/components/AdminReviewsView.d.ts +3 -7
- package/dist/features/admin/components/AdminReviewsView.js +94 -116
- package/dist/features/admin/components/AdminScammersView.d.ts +2 -3
- package/dist/features/admin/components/AdminScammersView.js +53 -103
- package/dist/features/admin/components/AdminSectionsView.js +1 -1
- package/dist/features/admin/components/AdminSessionsView.d.ts +2 -3
- package/dist/features/admin/components/AdminSessionsView.js +62 -95
- package/dist/features/admin/components/AdminStoreAddressesView.d.ts +1 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +39 -53
- package/dist/features/admin/components/AdminStoreEditorView.js +21 -8
- package/dist/features/admin/components/AdminStoresView.d.ts +2 -3
- package/dist/features/admin/components/AdminStoresView.js +67 -105
- package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +1 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +29 -49
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +17 -20
- package/dist/features/admin/components/AdminSupportTicketDetailView.d.ts +10 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +191 -5
- package/dist/features/admin/components/AdminSupportTicketsView.d.ts +2 -3
- package/dist/features/admin/components/AdminSupportTicketsView.js +65 -102
- package/dist/features/admin/components/AdminTeamView.d.ts +2 -2
- package/dist/features/admin/components/AdminTeamView.js +42 -85
- package/dist/features/admin/components/AdminUserEditorView.d.ts +11 -1
- package/dist/features/admin/components/AdminUserEditorView.js +80 -6
- package/dist/features/admin/components/AdminUsersView.d.ts +2 -3
- package/dist/features/admin/components/AdminUsersView.js +108 -106
- package/dist/features/admin/components/AdminViewCards.d.ts +1 -1
- package/dist/features/admin/components/AdminWishlistsView.d.ts +2 -3
- package/dist/features/admin/components/AdminWishlistsView.js +36 -62
- package/dist/features/admin/components/DataListingView.d.ts +122 -0
- package/dist/features/admin/components/DataListingView.js +66 -0
- package/dist/features/admin/components/index.d.ts +10 -4
- package/dist/features/admin/components/index.js +6 -2
- package/dist/features/admin/constants/filter-tabs.d.ts +23 -17
- package/dist/features/admin/constants/filter-tabs.js +21 -17
- package/dist/features/admin/hooks/useAdminListing.d.ts +59 -0
- package/dist/features/admin/hooks/useAdminListing.js +71 -0
- package/dist/features/admin/schemas/firestore.js +6 -7
- package/dist/features/auctions/server.d.ts +0 -1
- package/dist/features/auctions/server.js +0 -1
- package/dist/features/auth/actions/realtime-token-actions.js +1 -1
- package/dist/features/auth/repository/user.repository.js +1 -1
- package/dist/features/auth/schemas/firestore.d.ts +1 -0
- package/dist/features/blog/components/BlogIndexListing.js +3 -6
- package/dist/features/cart/repository/cart.repository.d.ts +4 -1
- package/dist/features/cart/repository/cart.repository.js +12 -0
- package/dist/features/categories/components/CategoriesIndexListing.js +3 -6
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -2
- package/dist/features/checkout/index.d.ts +1 -1
- package/dist/features/events/components/AdminEventsView.d.ts +3 -3
- package/dist/features/events/components/AdminEventsView.js +50 -86
- package/dist/features/events/components/EventOfferCard.d.ts +19 -0
- package/dist/features/events/components/EventOfferCard.js +29 -0
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +25 -0
- package/dist/features/events/components/EventRaffleEntryForm.js +37 -0
- package/dist/features/events/components/EventRafflesSection.d.ts +1 -4
- package/dist/features/events/components/EventRafflesSection.js +17 -6
- package/dist/features/events/components/EventSaleBanner.d.ts +21 -0
- package/dist/features/events/components/EventSaleBanner.js +18 -0
- package/dist/features/events/components/EventsIndexListing.js +3 -4
- package/dist/features/events/components/index.d.ts +6 -0
- package/dist/features/events/components/index.js +4 -0
- package/dist/features/events/repository/event-entry.repository.d.ts +5 -0
- package/dist/features/events/repository/event-entry.repository.js +7 -0
- package/dist/features/filters/AsyncFacetSection.d.ts +1 -1
- package/dist/features/homepage/components/AnnouncementBar.d.ts +4 -1
- package/dist/features/homepage/components/AnnouncementBar.js +51 -4
- package/dist/features/homepage/components/FAQSection.d.ts +0 -5
- package/dist/features/homepage/components/MarketplaceHomepageView.d.ts +3 -1
- package/dist/features/homepage/components/MarketplaceHomepageView.js +2 -2
- package/dist/features/homepage/components/index.d.ts +1 -1
- package/dist/features/homepage/components/index.js +1 -1
- package/dist/features/homepage/lib/live-stats.js +1 -1
- package/dist/features/homepage/lib/section-renderer.d.ts +2 -2
- package/dist/features/homepage/lib/section-renderer.js +2 -2
- package/dist/features/homepage/schemas/firestore.d.ts +0 -2
- package/dist/features/layout/index.d.ts +0 -2
- package/dist/features/layout/index.js +0 -1
- package/dist/features/orders/repository/orders.repository.d.ts +0 -1
- package/dist/features/orders/repository/orders.repository.js +0 -1
- package/dist/features/orders/server.d.ts +1 -1
- package/dist/features/orders/server.js +1 -1
- package/dist/features/pre-orders/server.d.ts +0 -1
- package/dist/features/pre-orders/server.js +0 -1
- package/dist/features/products/components/GroupSettingsPanel.js +65 -49
- package/dist/features/products/components/PrizeDrawItemsEditor.js +2 -2
- package/dist/features/products/components/PrizeDrawsSection.d.ts +1 -4
- package/dist/features/products/components/PrizeDrawsSection.js +17 -6
- package/dist/features/products/components/PrizeRevealModal.js +1 -1
- package/dist/features/products/components/ProductCardMetadataSection.d.ts +11 -0
- package/dist/features/products/components/ProductCardMetadataSection.js +25 -0
- package/dist/features/products/components/ProductDetailPageView.js +3 -1
- package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
- package/dist/features/products/components/ProductGradingTab.d.ts +13 -0
- package/dist/features/products/components/ProductGradingTab.js +25 -0
- package/dist/features/products/components/ProductGrid.js +14 -2
- package/dist/features/products/components/ProductTabsShell.d.ts +5 -1
- package/dist/features/products/components/ProductTabsShell.js +6 -1
- package/dist/features/products/components/index.d.ts +4 -0
- package/dist/features/products/components/index.js +3 -0
- package/dist/features/products/constants/action-defs.d.ts +5 -0
- package/dist/features/products/constants/action-defs.js +52 -32
- package/dist/features/products/constants/sieve.d.ts +24 -4
- package/dist/features/products/constants/sieve.js +20 -11
- package/dist/features/products/repository/products.repository.d.ts +0 -2
- package/dist/features/products/repository/products.repository.js +0 -2
- package/dist/features/products/schemas/firestore.d.ts +17 -0
- package/dist/features/products/schemas/product-features.validators.d.ts +2 -2
- package/dist/features/products/schemas/product-templates.d.ts +2 -4
- package/dist/features/products/server.d.ts +1 -1
- package/dist/features/products/server.js +1 -1
- package/dist/features/products/types/index.d.ts +4 -0
- package/dist/features/promotions/components/CouponCard.js +5 -5
- package/dist/features/promotions/components/CouponsIndexListing.js +3 -2
- package/dist/features/promotions/server.d.ts +0 -1
- package/dist/features/promotions/server.js +0 -1
- package/dist/features/reviews/components/ReviewsIndexListing.js +3 -4
- package/dist/features/reviews/repository/reviews.repository.d.ts +0 -1
- package/dist/features/reviews/repository/reviews.repository.js +0 -1
- package/dist/features/reviews/server.d.ts +1 -1
- package/dist/features/reviews/server.js +1 -1
- package/dist/features/search/api/route.js +44 -1
- package/dist/features/search/components/Search.js +2 -0
- package/dist/features/search/hooks/useNavSuggestions.d.ts +5 -1
- package/dist/features/search/hooks/useNavSuggestions.js +31 -4
- package/dist/features/seller/components/BrandInlineSelect.js +2 -2
- package/dist/features/seller/components/CategoryInlineSelect.js +2 -2
- package/dist/features/seller/components/SellerAddressesView.js +10 -20
- package/dist/features/seller/components/SellerAuctionsView.d.ts +3 -3
- package/dist/features/seller/components/SellerAuctionsView.js +67 -106
- package/dist/features/seller/components/SellerBidsView.js +6 -6
- package/dist/features/seller/components/SellerBundlesView.js +72 -105
- package/dist/features/seller/components/SellerClassifiedView.js +74 -105
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -1
- package/dist/features/seller/components/SellerCouponsView.d.ts +2 -2
- package/dist/features/seller/components/SellerCouponsView.js +51 -96
- package/dist/features/seller/components/SellerDigitalCodesView.js +70 -103
- package/dist/features/seller/components/SellerGroupedListingsView.js +34 -54
- package/dist/features/seller/components/SellerLiveView.js +70 -99
- package/dist/features/seller/components/SellerOffersPanel.js +1 -1
- package/dist/features/seller/components/SellerOffersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOffersView.js +37 -70
- package/dist/features/seller/components/SellerOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +10 -24
- package/dist/features/seller/components/SellerPayoutMethodsView.js +12 -24
- package/dist/features/seller/components/SellerPayoutsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPayoutsView.js +34 -69
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerPreOrdersView.js +55 -97
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPrizeDrawsView.js +55 -97
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +3 -6
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -2
- package/dist/features/seller/components/SellerProductsView.js +24 -32
- package/dist/features/seller/components/SellerShippingConfigsView.js +12 -24
- package/dist/features/seller/components/SellerSidebar.d.ts +0 -4
- package/dist/features/seller/components/SellerSidebar.js +0 -2
- package/dist/features/seller/components/SellerStoreCategoriesView.js +15 -34
- package/dist/features/seller/components/SellerTemplatesView.js +27 -43
- package/dist/features/seller/components/SellersListView.d.ts +1 -2
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.d.ts +5 -0
- package/dist/features/seller/components/analytics/SellerAnalyticsStats.js +2 -8
- package/dist/features/seller/components/index.d.ts +0 -3
- package/dist/features/seller/components/index.js +0 -2
- package/dist/features/seller/server.d.ts +0 -1
- package/dist/features/seller/server.js +0 -1
- package/dist/features/shell/FormShell.d.ts +1 -1
- package/dist/features/shell/FormShell.js +4 -1
- package/dist/features/shell/field-groups/ImageFieldGroup.d.ts +18 -0
- package/dist/features/shell/field-groups/ImageFieldGroup.js +15 -0
- package/dist/features/shell/field-groups/SeoFieldGroup.d.ts +22 -0
- package/dist/features/shell/field-groups/SeoFieldGroup.js +16 -0
- package/dist/features/shell/field-groups/StatusFieldGroup.d.ts +35 -0
- package/dist/features/shell/field-groups/StatusFieldGroup.js +16 -0
- package/dist/features/shell/field-groups/TitleDescriptionGroup.d.ts +40 -0
- package/dist/features/shell/field-groups/TitleDescriptionGroup.js +16 -0
- package/dist/features/shell/field-groups/index.d.ts +13 -0
- package/dist/features/shell/field-groups/index.js +9 -0
- package/dist/features/shell/index.d.ts +2 -0
- package/dist/features/shell/index.js +1 -0
- package/dist/features/stores/components/StoreCapabilitiesGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreFinanceGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreHeader.js +2 -1
- package/dist/features/stores/components/StoreListingsGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreOrdersGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoreReviewsListing.js +3 -4
- package/dist/features/stores/components/StoreScopedSearch.d.ts +16 -0
- package/dist/features/stores/components/StoreScopedSearch.js +27 -0
- package/dist/features/stores/components/StoreSettingsGuideView.d.ts +1 -2
- package/dist/features/stores/components/StoresIndexListing.js +3 -4
- package/dist/features/stores/server.d.ts +0 -1
- package/dist/features/stores/server.js +0 -1
- package/dist/features/support/schemas/firestore.d.ts +22 -1
- package/dist/features/support/schemas/firestore.js +10 -0
- package/dist/features/wishlist/server.d.ts +0 -1
- package/dist/features/wishlist/server.js +0 -1
- package/dist/index.d.ts +11 -33
- package/dist/index.js +17 -62
- package/dist/next/routing/route-map.d.ts +8 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/react/contexts/SessionContext.d.ts +2 -0
- package/dist/react/contexts/SessionContext.js +2 -0
- package/dist/react/hooks/useEntityDelete.d.ts +15 -0
- package/dist/react/hooks/useEntityDelete.js +39 -0
- package/dist/react/hooks/useListingTypeFlags.d.ts +32 -0
- package/dist/react/hooks/useListingTypeFlags.js +19 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/repositories/index.d.ts +3 -3
- package/dist/repositories/index.js +3 -3
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/pii-redact.d.ts +8 -0
- package/dist/security/pii-redact.js +10 -1
- package/dist/seed/grouped-listings-seed-data.d.ts +4 -0
- package/dist/seed/products-preorders-seed-data.d.ts +4 -0
- package/dist/seed/products-prize-draws-seed-data.js +3 -0
- package/dist/seed/site-settings-seed-data.js +5 -5
- package/dist/seed/sub-listings-seed-data.d.ts +4 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +4 -0
- package/dist/styles.css +54 -395
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/BaseListingCard.d.ts +10 -0
- package/dist/ui/components/BaseListingCard.js +17 -1
- package/dist/ui/components/DetailPageGallery.d.ts +32 -0
- package/dist/ui/components/DetailPageGallery.js +47 -0
- package/dist/ui/components/DetailPageHero.d.ts +30 -0
- package/dist/ui/components/DetailPageHero.js +22 -0
- package/dist/ui/components/DetailPageTabs.d.ts +34 -0
- package/dist/ui/components/DetailPageTabs.js +38 -0
- package/dist/ui/components/HorizontalScroller.style.css +15 -2
- package/dist/ui/components/ListingFilterDrawer.d.ts +10 -0
- package/dist/ui/components/ListingFilterDrawer.js +8 -0
- package/dist/ui/components/ListingLayout.d.ts +11 -2
- package/dist/ui/components/ListingLayout.js +12 -6
- package/dist/ui/components/PaginatedSelect.d.ts +66 -0
- package/dist/ui/components/PaginatedSelect.js +201 -0
- package/dist/ui/components/PaginatedSelect.style.css +254 -0
- package/dist/ui/components/Semantic.d.ts +0 -4
- package/dist/ui/components/Semantic.js +0 -2
- package/dist/ui/components/SettingsSection.d.ts +47 -0
- package/dist/ui/components/SettingsSection.js +38 -0
- package/dist/ui/components/index.style.css +1 -4
- package/dist/ui/index.d.ts +14 -14
- package/dist/ui/index.js +7 -7
- package/dist/utils/id-generators.d.ts +1 -18
- package/dist/utils/id-generators.js +51 -18
- package/dist/validation/schemas.d.ts +25 -0
- package/dist/validation/schemas.js +28 -0
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ function BuyerOfferCard({ offer, onAcceptCounter, onWithdraw, onCheckout, onUpda
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
return (_jsxs(Div, { surface: "card", padding: "sm", className: "space-y-3", children: [_jsxs(Div, { className: "flex items-start justify-between gap-2 flex-wrap", children: [_jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: "font-semibold text-sm text-zinc-900 dark:text-zinc-100 truncate", children: offer.productTitle ?? "Unknown Product" }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: relativeTime(offer.createdAt) })] }), _jsx(Badge, { variant: statusVariant(offer.status), className: "shrink-0 capitalize text-xs", children: offer.status })] }), _jsxs(Div, { className: "flex gap-4 flex-wrap", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Listed" }), _jsx(Text, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: formatRupees(offer.listedPrice) })] }), _jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Your Offer" }), _jsx(Text, { className: "text-sm font-semibold text-zinc-900 dark:text-zinc-100", children: formatRupees(offer.offerAmount) })] }), offer.counterAmount != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Seller Counter" }), _jsx(Text, { className: "text-sm font-semibold text-blue-600 dark:text-blue-400", children: formatRupees(offer.counterAmount) })] })), offer.lockedPrice != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Agreed Price" }), _jsx(Text, { className: "text-sm font-semibold text-success", children: formatRupees(offer.lockedPrice) })] }))] }), offer.sellerNote && (_jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 italic", children: ["Seller note: \"", offer.sellerNote, "\""] })), offer.status === "countered" && (_jsxs(Div, { className: "space-y-2", children: [_jsxs(Text, { className: "text-xs text-info font-medium", children: ["Seller countered at ", formatRupees(offer.counterAmount), ". Accept or withdraw your offer."] }), _jsxs(Div, { className: "flex gap-2 flex-wrap", children: [_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onAcceptCounter(offer.id), { status: "accepted", lockedPrice: offer.counterAmount }), disabled: isPending, children: isPending ? "Accepting…" : `Accept ${formatRupees(offer.counterAmount)}` }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-error border border-
|
|
59
|
+
return (_jsxs(Div, { surface: "card", padding: "sm", className: "space-y-3", children: [_jsxs(Div, { className: "flex items-start justify-between gap-2 flex-wrap", children: [_jsxs(Div, { className: "min-w-0", children: [_jsx(Text, { className: "font-semibold text-sm text-zinc-900 dark:text-zinc-100 truncate", children: offer.productTitle ?? "Unknown Product" }), _jsx(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: relativeTime(offer.createdAt) })] }), _jsx(Badge, { variant: statusVariant(offer.status), className: "shrink-0 capitalize text-xs", children: offer.status })] }), _jsxs(Div, { className: "flex gap-4 flex-wrap", children: [_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Listed" }), _jsx(Text, { className: "text-sm font-medium text-zinc-700 dark:text-zinc-300", children: formatRupees(offer.listedPrice) })] }), _jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Your Offer" }), _jsx(Text, { className: "text-sm font-semibold text-zinc-900 dark:text-zinc-100", children: formatRupees(offer.offerAmount) })] }), offer.counterAmount != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Seller Counter" }), _jsx(Text, { className: "text-sm font-semibold text-blue-600 dark:text-blue-400", children: formatRupees(offer.counterAmount) })] })), offer.lockedPrice != null && (_jsxs(Div, { children: [_jsx(Text, { className: "text-xs text-zinc-400 dark:text-zinc-400 uppercase tracking-wide", children: "Agreed Price" }), _jsx(Text, { className: "text-sm font-semibold text-success", children: formatRupees(offer.lockedPrice) })] }))] }), offer.sellerNote && (_jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400 italic", children: ["Seller note: \"", offer.sellerNote, "\""] })), offer.status === "countered" && (_jsxs(Div, { className: "space-y-2", children: [_jsxs(Text, { className: "text-xs text-info font-medium", children: ["Seller countered at ", formatRupees(offer.counterAmount), ". Accept or withdraw your offer."] }), _jsxs(Div, { className: "flex gap-2 flex-wrap", children: [_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onAcceptCounter(offer.id), { status: "accepted", lockedPrice: offer.counterAmount }), disabled: isPending, children: isPending ? "Accepting…" : `Accept ${formatRupees(offer.counterAmount)}` }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-error border border-error/20", children: "Withdraw" })] })] })), offer.status === "accepted" && onCheckout && (_jsx(Button, { size: "sm", variant: "primary", onClick: () => act(() => onCheckout(offer.id), { status: "paid" }), disabled: isPending, children: isPending ? "Processing…" : "Checkout at Agreed Price" })), offer.status === "pending" && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming("withdraw"), disabled: isPending, className: "text-error border border-error/20 text-xs", children: "Withdraw Offer" })), confirming === "withdraw" && (_jsxs(Div, { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: () => act(() => onWithdraw(offer.id), { status: "withdrawn" }), disabled: isPending, className: "text-error border border-error/20", children: isPending ? "Withdrawing…" : "Confirm Withdraw" }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => setConfirming(null), disabled: isPending, children: "Cancel" })] })), error && _jsx(Alert, { variant: "error", children: _jsx(Text, { className: "text-xs", children: error }) })] }));
|
|
60
60
|
}
|
|
61
61
|
export function UserOffersPanel({ fetchEndpoint = "/api/user/offers", onAcceptCounter, onWithdraw, onCheckout, className = "", }) {
|
|
62
62
|
const [offers, setOffers] = useState([]);
|
|
@@ -4,26 +4,30 @@ import { useState, useCallback, useEffect } from "react";
|
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import Link from "next/link";
|
|
6
6
|
import { usePathname } from "next/navigation";
|
|
7
|
-
import { Li, Nav, Span, Ul } from "../../../ui";
|
|
7
|
+
import { ConfirmDeleteModal, Li, Nav, Span, Ul } from "../../../ui";
|
|
8
8
|
import { BottomSheet } from "../../layout/BottomSheet";
|
|
9
9
|
import { SidebarCollapseToggle } from "../../../_internal/client/features/layout/SidebarCollapseToggle";
|
|
10
10
|
function isNavItemActive(item, activeHref) {
|
|
11
11
|
return activeHref === item.href || activeHref.startsWith(item.href + "/");
|
|
12
12
|
}
|
|
13
13
|
function NavLink({ item, isActive, onClick }) {
|
|
14
|
+
const [showConfirm, setShowConfirm] = useState(false);
|
|
14
15
|
const handleClick = (e) => {
|
|
15
|
-
if (item.confirm
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
16
|
+
if (item.confirm) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
setShowConfirm(true);
|
|
19
|
+
return;
|
|
21
20
|
}
|
|
22
21
|
onClick?.();
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const linkClass = `flex items-center gap-2.5 rounded-lg px-3 py-2 text-[0.8125rem] font-medium leading-tight transition-colors ${isActive
|
|
24
|
+
? "bg-primary-50 dark:bg-primary-900/25 text-primary-700 dark:text-primary-300"
|
|
25
|
+
: "text-zinc-500 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-slate-800 hover:text-zinc-900 dark:hover:text-zinc-100"}`;
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Link, { href: item.href, onClick: handleClick, className: linkClass, children: [item.icon && _jsx(Span, { className: "shrink-0 text-base opacity-70", children: item.icon }), _jsx(Span, { className: "flex-1 truncate", children: item.label })] }), showConfirm && item.confirm && (_jsx(ConfirmDeleteModal, { isOpen: true, title: item.confirm.title ?? "Confirm", message: item.confirm.message, confirmText: "Continue", variant: "warning", onConfirm: () => {
|
|
27
|
+
setShowConfirm(false);
|
|
28
|
+
onClick?.();
|
|
29
|
+
window.location.href = item.href;
|
|
30
|
+
}, onClose: () => setShowConfirm(false) }))] }));
|
|
27
31
|
}
|
|
28
32
|
function DrawerContent({ groups, items, activeHref, onItemClick, }) {
|
|
29
33
|
const [openGroups, setOpenGroups] = useState(() => {
|
|
@@ -14,6 +14,14 @@ const CATEGORY_OPTIONS = [
|
|
|
14
14
|
{ label: "Listing Dispute", value: "listing_dispute" },
|
|
15
15
|
{ label: "Refund Request", value: "refund_request" },
|
|
16
16
|
{ label: "Auction Dispute", value: "auction_dispute" },
|
|
17
|
+
// ST-4 — sellers use this to request changes to admin-controlled
|
|
18
|
+
// store fields (status, capabilities, verification badge).
|
|
19
|
+
{ label: "Store Change Request (sellers)", value: "store_change_request" },
|
|
20
|
+
// ST-3 — buyers/sellers request mutation of order line items
|
|
21
|
+
{ label: "Order Modification Request", value: "order_modification_request" },
|
|
22
|
+
// ST-5 — appeal a soft or hard ban; bypasses the create_support_tickets
|
|
23
|
+
// soft-ban guard server-side.
|
|
24
|
+
{ label: "Appeal a ban (unban request)", value: "unban_request" },
|
|
17
25
|
{ label: "General", value: "general" },
|
|
18
26
|
];
|
|
19
27
|
const STATUS_BADGE = {
|
|
@@ -86,7 +94,7 @@ export function UserSupportView(_props) {
|
|
|
86
94
|
}
|
|
87
95
|
function renderTicketListArea(props) {
|
|
88
96
|
const { isLoading, error, tickets, setSelectedTicket, setDetailOpen } = props;
|
|
89
|
-
return (_jsxs(_Fragment, { children: [isLoading && (_jsx(Div, { className: "space-y-3", children: [1, 2, 3].map((i) => _jsx("div", { className: "h-16 animate-pulse rounded-lg bg-zinc-100 dark:bg-zinc-800" }, i)) })), error && (_jsx(Div, { className: "rounded-xl border border-
|
|
97
|
+
return (_jsxs(_Fragment, { children: [isLoading && (_jsx(Div, { className: "space-y-3", children: [1, 2, 3].map((i) => _jsx("div", { className: "h-16 animate-pulse rounded-lg bg-zinc-100 dark:bg-zinc-800" }, i)) })), error && (_jsx(Div, { className: "rounded-xl border border-error/20 bg-error-surface px-4 py-3 text-sm text-error", children: "Failed to load support tickets." })), !isLoading && tickets.length === 0 && (_jsx(Div, { className: "rounded-xl border border-zinc-200 bg-zinc-50 px-6 py-10 text-center dark:border-zinc-700 dark:bg-zinc-900/40", children: _jsx(Text, { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "You haven't opened any support tickets yet." }) })), _jsx("ul", { className: "space-y-3", children: tickets.map((ticket) => (_jsx("li", { children: _jsx("button", { type: "button", className: "w-full rounded-xl border border-zinc-200 bg-white p-4 text-left shadow-sm hover:border-primary-300 transition-colors dark:border-zinc-700 dark:bg-zinc-900", onClick: () => { setSelectedTicket(ticket); setDetailOpen(true); }, children: _jsxs("div", { className: "flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx(Text, { className: "font-medium text-zinc-900 dark:text-zinc-100 truncate", children: ticket.subject }), _jsxs(Text, { className: "text-xs text-zinc-500 dark:text-zinc-400", children: [ticket.category.replace(/_/g, " "), ticket.orderId ? ` · Order: ${ticket.orderId}` : ""] })] }), _jsx("span", { className: `shrink-0 inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium ${STATUS_BADGE[ticket.status] ?? STATUS_BADGE.open}`, children: ticket.status.replace(/_/g, " ") })] }) }) }, ticket.id))) })] }));
|
|
90
98
|
}
|
|
91
99
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
100
|
function renderNewTicketDrawer(props) {
|
|
@@ -11,6 +11,7 @@ import { payoutRepository } from "../../payments/repository/payout.repository";
|
|
|
11
11
|
import { userRepository } from "../../auth/repository/user.repository";
|
|
12
12
|
import { productRepository } from "../../products/repository/products.repository";
|
|
13
13
|
import { NotFoundError, ValidationError } from "../../../errors";
|
|
14
|
+
import { finalizeStagedMediaUrl, finalizeStagedMediaField, finalizeStagedMediaArray, } from "../../media/finalize";
|
|
14
15
|
import { getProviders } from "../../../contracts";
|
|
15
16
|
const ERR_UID_REQUIRED = "uid is required";
|
|
16
17
|
export async function revokeSession(adminId, sessionId) {
|
|
@@ -150,7 +151,21 @@ export async function adminUpdateProduct(adminId, id, input) {
|
|
|
150
151
|
if (!existing) {
|
|
151
152
|
throw new NotFoundError("Product not found");
|
|
152
153
|
}
|
|
153
|
-
const
|
|
154
|
+
const finalized = { ...input };
|
|
155
|
+
if (typeof finalized.mainImage === "string" && finalized.mainImage) {
|
|
156
|
+
finalized.mainImage = await finalizeStagedMediaUrl(finalized.mainImage);
|
|
157
|
+
}
|
|
158
|
+
if (Array.isArray(finalized.images) && finalized.images.length > 0) {
|
|
159
|
+
finalized.images = await finalizeStagedMediaArray(finalized.images);
|
|
160
|
+
}
|
|
161
|
+
if (finalized.video?.url) {
|
|
162
|
+
finalized.video = {
|
|
163
|
+
...finalized.video,
|
|
164
|
+
url: await finalizeStagedMediaUrl(finalized.video.url),
|
|
165
|
+
thumbnailUrl: (await finalizeStagedMediaField(finalized.video.thumbnailUrl)) ?? finalized.video.thumbnailUrl,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const updated = await productRepository.updateProduct(id, finalized);
|
|
154
169
|
serverLogger.info("adminUpdateProduct", {
|
|
155
170
|
adminId,
|
|
156
171
|
productId: id,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
3
|
-
}
|
|
1
|
+
import type { ListingLayoutProps } from "../../../ui";
|
|
2
|
+
export type AdminAllEventEntriesViewProps = ListingLayoutProps;
|
|
4
3
|
export declare function AdminAllEventEntriesView({ children, ...props }: AdminAllEventEntriesViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,88 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import React
|
|
4
|
-
import { X } from "lucide-react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
5
4
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import {
|
|
7
|
-
import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
|
|
8
|
-
import { FilterChipGroup, ListingToolbar, Pagination, ListingViewShell, RowActionMenu, useToast } from "../../../ui";
|
|
5
|
+
import { FilterChipGroup, ListingLayout, RowActionMenu, useToast } from "../../../ui";
|
|
9
6
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
10
7
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
11
8
|
import { ADMIN_EVENT_ENTRY_STATUS_TABS } from "../constants/filter-tabs";
|
|
12
|
-
import { toRecordArray, toRelativeDate, toStringValue,
|
|
13
|
-
import {
|
|
9
|
+
import { toRecordArray, toRelativeDate, toStringValue, } from "../hooks/useAdminListingData";
|
|
10
|
+
import { DataListingView } from "./DataListingView";
|
|
14
11
|
import { apiClient } from "../../../http";
|
|
15
|
-
const PAGE_SIZE = 25;
|
|
16
|
-
const FILTER_KEYS = ["status"];
|
|
17
|
-
const DEFAULT_SORT = "-submittedAt";
|
|
18
|
-
const SORT_OPTIONS = [
|
|
19
|
-
{ value: "-submittedAt", label: "Newest" },
|
|
20
|
-
{ value: "submittedAt", label: "Oldest" },
|
|
21
|
-
];
|
|
22
|
-
const STATUS_OPTIONS = ADMIN_EVENT_ENTRY_STATUS_TABS;
|
|
23
|
-
function EntriesFilterDrawer({ filterOpen, setFilterOpen, activeFilterCount, clearFilters, pendingFilters, setPendingFilters, applyFilters, }) {
|
|
24
|
-
if (!filterOpen)
|
|
25
|
-
return null;
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", 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-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
|
|
27
|
-
}
|
|
28
12
|
export function AdminAllEventEntriesView({ children, ...props }) {
|
|
29
|
-
const hasChildren = React.Children.count(children) > 0;
|
|
30
|
-
const [view, setView] = useState("table");
|
|
31
13
|
const queryClient = useQueryClient();
|
|
32
14
|
const { showToast } = useToast();
|
|
33
|
-
const table = useUrlTable({ defaults: { pageSize: String(PAGE_SIZE), sort: DEFAULT_SORT } });
|
|
34
|
-
const [searchInput, setSearchInput] = useState(table.get("q") || "");
|
|
35
|
-
const [filterOpen, setFilterOpen] = useState(false);
|
|
36
|
-
const [pendingFilters, setPendingFilters] = useState(() => Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
37
|
-
const openFilters = useCallback(() => {
|
|
38
|
-
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
39
|
-
setFilterOpen(true);
|
|
40
|
-
}, [table]);
|
|
41
|
-
const applyFilters = useCallback(() => {
|
|
42
|
-
const updates = { page: "1" };
|
|
43
|
-
for (const k of FILTER_KEYS)
|
|
44
|
-
updates[k] = pendingFilters[k] ?? "";
|
|
45
|
-
table.setMany(updates);
|
|
46
|
-
setFilterOpen(false);
|
|
47
|
-
}, [pendingFilters, table]);
|
|
48
|
-
const clearFilters = useCallback(() => {
|
|
49
|
-
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, ""])));
|
|
50
|
-
}, []);
|
|
51
|
-
const resetAll = useCallback(() => {
|
|
52
|
-
const updates = { q: "", sort: "" };
|
|
53
|
-
for (const k of FILTER_KEYS)
|
|
54
|
-
updates[k] = "";
|
|
55
|
-
table.setMany(updates);
|
|
56
|
-
setSearchInput("");
|
|
57
|
-
}, [table]);
|
|
58
|
-
const commitSearch = useCallback(() => {
|
|
59
|
-
table.set("q", searchInput.trim());
|
|
60
|
-
}, [searchInput, table]);
|
|
61
|
-
const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
|
|
62
|
-
const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
|
|
63
|
-
const statusRaw = table.get("status");
|
|
64
|
-
const filters = statusRaw && statusRaw !== "All" ? `status==${statusRaw}` : undefined;
|
|
65
|
-
const { rows, total, isLoading, errorMessage } = useAdminListingData({
|
|
66
|
-
queryKey: ["admin", "event-entries", "listing"],
|
|
67
|
-
endpoint: ADMIN_ENDPOINTS.ADMIN_EVENT_ENTRIES,
|
|
68
|
-
page: table.getNumber("page", 1),
|
|
69
|
-
pageSize: PAGE_SIZE,
|
|
70
|
-
sorts: table.get("sort") || DEFAULT_SORT,
|
|
71
|
-
filters,
|
|
72
|
-
q: table.get("q") || undefined,
|
|
73
|
-
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
74
|
-
id: toStringValue(item.id, `entry-${index}`),
|
|
75
|
-
primary: toStringValue(item.userDisplayName ?? item.userName, "Unknown user"),
|
|
76
|
-
secondary: [
|
|
77
|
-
toStringValue(item.eventId, ""),
|
|
78
|
-
toStringValue(item.userEmail, ""),
|
|
79
|
-
].filter(Boolean).join(" · "),
|
|
80
|
-
status: toStringValue(item.status ?? item.reviewStatus, "PENDING"),
|
|
81
|
-
updatedAt: toRelativeDate(item.submittedAt ?? item.createdAt),
|
|
82
|
-
eventId: toStringValue(item.eventId, ""),
|
|
83
|
-
})),
|
|
84
|
-
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
85
|
-
});
|
|
86
15
|
const updateMutation = useMutation({
|
|
87
16
|
mutationFn: async ({ id, status }) => {
|
|
88
17
|
await apiClient.patch(ADMIN_ENDPOINTS.ADMIN_EVENT_ENTRY_BY_ID(id), { status });
|
|
@@ -95,18 +24,50 @@ export function AdminAllEventEntriesView({ children, ...props }) {
|
|
|
95
24
|
showToast(err?.message ?? "Failed to update entry.", "error");
|
|
96
25
|
},
|
|
97
26
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const selection = useBulkSelection({ items: rows, keyExtractor: (r) => r.id });
|
|
101
|
-
if (hasChildren) {
|
|
102
|
-
return _jsx(ListingViewShell, { portal: "admin", ...props, children: children });
|
|
27
|
+
if (React.Children.count(children) > 0) {
|
|
28
|
+
return (_jsx(ListingLayout, { portal: "admin", ...props, children: children }));
|
|
103
29
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
30
|
+
const config = {
|
|
31
|
+
portal: "admin",
|
|
32
|
+
title: "Event Entries",
|
|
33
|
+
searchPlaceholder: "Search by user name or event ID",
|
|
34
|
+
emptyLabel: "No entries found",
|
|
35
|
+
filterKeys: ["status"],
|
|
36
|
+
defaultSort: "-submittedAt",
|
|
37
|
+
queryKey: ["admin", "event-entries", "listing"],
|
|
38
|
+
endpoint: ADMIN_ENDPOINTS.ADMIN_EVENT_ENTRIES,
|
|
39
|
+
sortOptions: [
|
|
40
|
+
{ value: "-submittedAt", label: "Newest" },
|
|
41
|
+
{ value: "submittedAt", label: "Oldest" },
|
|
42
|
+
],
|
|
43
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
44
|
+
id: toStringValue(item.id, `entry-${index}`),
|
|
45
|
+
primary: toStringValue(item.userDisplayName ?? item.userName, "Unknown user"),
|
|
46
|
+
secondary: [toStringValue(item.eventId, ""), toStringValue(item.userEmail, "")]
|
|
47
|
+
.filter(Boolean)
|
|
48
|
+
.join(" · "),
|
|
49
|
+
status: toStringValue(item.status ?? item.reviewStatus, "PENDING"),
|
|
50
|
+
updatedAt: toRelativeDate(item.submittedAt ?? item.createdAt),
|
|
51
|
+
eventId: toStringValue(item.eventId, ""),
|
|
52
|
+
})),
|
|
53
|
+
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
54
|
+
buildFilters: (state) => state.status && state.status !== "All" ? `status==${state.status}` : undefined,
|
|
55
|
+
renderRowActions: (row) => (_jsx(RowActionMenu, { actions: [
|
|
56
|
+
{
|
|
57
|
+
label: ACTIONS.ADMIN["confirm-entry"].label,
|
|
58
|
+
onClick: () => updateMutation.mutate({ id: row.id, status: "CONFIRMED" }),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: ACTIONS.ADMIN["waitlist-entry"].label,
|
|
62
|
+
onClick: () => updateMutation.mutate({ id: row.id, status: "WAITLISTED" }),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: ACTIONS.ADMIN["cancel-entry"].label,
|
|
66
|
+
destructive: true,
|
|
67
|
+
onClick: () => updateMutation.mutate({ id: row.id, status: "CANCELLED" }),
|
|
68
|
+
},
|
|
69
|
+
] })),
|
|
70
|
+
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Status", tabs: ADMIN_EVENT_ENTRY_STATUS_TABS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) })),
|
|
71
|
+
};
|
|
72
|
+
return _jsx(DataListingView, { config: config });
|
|
112
73
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
3
|
-
}
|
|
1
|
+
import type { ListingLayoutProps } from "../../../ui";
|
|
2
|
+
export type AdminBidsViewProps = ListingLayoutProps;
|
|
4
3
|
export declare function AdminBidsView({ children, ...props }: AdminBidsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,93 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
3
|
-
import React, { useState
|
|
4
|
-
import { X } from "lucide-react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState } from "react";
|
|
5
4
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import {
|
|
7
|
-
import { useBulkSelection } from "../../../react/hooks/useBulkSelection";
|
|
8
|
-
import { BulkActionBar, FilterChipGroup, ListingToolbar, Pagination, ListingViewShell, ConfirmDeleteModal, RowActionMenu, useToast } from "../../../ui";
|
|
5
|
+
import { ConfirmDeleteModal, FilterChipGroup, ListingLayout, RowActionMenu, useToast } from "../../../ui";
|
|
9
6
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
10
7
|
import { ADMIN_BID_STATUS_TABS } from "../constants/filter-tabs";
|
|
11
8
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
12
9
|
import { ROW_ACTION_META, ROW_ACTION_ID } from "../../products/constants/action-defs";
|
|
13
|
-
import { toRecordArray, toRelativeDate, toRupees, toStringValue,
|
|
14
|
-
import {
|
|
10
|
+
import { toRecordArray, toRelativeDate, toRupees, toStringValue, } from "../hooks/useAdminListingData";
|
|
11
|
+
import { DataListingView } from "./DataListingView";
|
|
15
12
|
import { apiClient } from "../../../http";
|
|
16
|
-
import { useBottomActions } from "../../layout";
|
|
17
|
-
const PAGE_SIZE = 25;
|
|
18
|
-
const FILTER_KEYS = ["status"];
|
|
19
|
-
const DEFAULT_SORT = "-bidTime";
|
|
20
|
-
const SORT_OPTIONS = [
|
|
21
|
-
{ value: "-bidTime", label: "Newest" },
|
|
22
|
-
{ value: "bidTime", label: "Oldest" },
|
|
23
|
-
{ value: "-amount", label: "Highest amount" },
|
|
24
|
-
];
|
|
25
|
-
const STATUS_OPTIONS = ADMIN_BID_STATUS_TABS;
|
|
26
|
-
function BidsFilterDrawer({ filterOpen, setFilterOpen, activeFilterCount, clearFilters, pendingFilters, setPendingFilters, applyFilters, }) {
|
|
27
|
-
if (!filterOpen)
|
|
28
|
-
return null;
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40 bg-black/40", "aria-hidden": "true", onClick: () => setFilterOpen(false) }), _jsxs("div", { className: "fixed inset-y-0 left-0 z-50 flex w-80 flex-col bg-white dark:bg-slate-900 shadow-2xl", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-zinc-200 dark:border-slate-700 px-4 py-3.5", children: [_jsx("span", { className: "text-base font-semibold text-zinc-900 dark:text-zinc-100", children: "Filters" }), _jsxs("div", { className: "flex items-center gap-2", children: [activeFilterCount > 0 && (_jsx("button", { type: "button", onClick: clearFilters, className: "text-xs text-zinc-500 hover:text-rose-500 dark:text-zinc-400 transition-colors", children: "Clear all" })), _jsx("button", { type: "button", onClick: () => setFilterOpen(false), "aria-label": "Close", className: "rounded-lg p-1.5 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors", 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-zinc-200 dark:border-slate-700 px-4 py-3.5", children: _jsxs("button", { type: "button", onClick: applyFilters, className: "w-full rounded-lg bg-primary py-2.5 text-sm font-semibold text-white hover:bg-primary-600 transition-colors active:scale-[0.98]", children: ["Apply Filters", activeFilterCount > 0 ? ` (${activeFilterCount})` : ""] }) })] })] }));
|
|
30
|
-
}
|
|
31
13
|
export function AdminBidsView({ children, ...props }) {
|
|
32
|
-
const hasChildren = React.Children.count(children) > 0;
|
|
33
|
-
const [view, setView] = useState("table");
|
|
34
14
|
const queryClient = useQueryClient();
|
|
35
15
|
const { showToast } = useToast();
|
|
36
16
|
const [cancelOpen, setCancelOpen] = useState(false);
|
|
37
17
|
const [selectedRow, setSelectedRow] = useState(null);
|
|
38
|
-
const table = useUrlTable({ defaults: { pageSize: String(PAGE_SIZE), sort: DEFAULT_SORT } });
|
|
39
|
-
const [searchInput, setSearchInput] = useState(table.get("q") || "");
|
|
40
|
-
const [filterOpen, setFilterOpen] = useState(false);
|
|
41
|
-
const [pendingFilters, setPendingFilters] = useState(() => Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
42
|
-
const openFilters = useCallback(() => {
|
|
43
|
-
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
44
|
-
setFilterOpen(true);
|
|
45
|
-
}, [table]);
|
|
46
|
-
const applyFilters = useCallback(() => {
|
|
47
|
-
const updates = { page: "1" };
|
|
48
|
-
for (const k of FILTER_KEYS)
|
|
49
|
-
updates[k] = pendingFilters[k] ?? "";
|
|
50
|
-
table.setMany(updates);
|
|
51
|
-
setFilterOpen(false);
|
|
52
|
-
}, [pendingFilters, table]);
|
|
53
|
-
const clearFilters = useCallback(() => {
|
|
54
|
-
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, ""])));
|
|
55
|
-
}, []);
|
|
56
|
-
const resetAll = useCallback(() => {
|
|
57
|
-
const updates = { q: "", sort: "" };
|
|
58
|
-
for (const k of FILTER_KEYS)
|
|
59
|
-
updates[k] = "";
|
|
60
|
-
table.setMany(updates);
|
|
61
|
-
setSearchInput("");
|
|
62
|
-
}, [table]);
|
|
63
|
-
const commitSearch = useCallback(() => {
|
|
64
|
-
table.set("q", searchInput.trim());
|
|
65
|
-
}, [searchInput, table]);
|
|
66
|
-
const activeFilterCount = FILTER_KEYS.filter((k) => !!table.get(k)).length;
|
|
67
|
-
const hasActiveState = !!table.get("q") || table.get("sort") !== DEFAULT_SORT || activeFilterCount > 0;
|
|
68
|
-
const statusRaw = table.get("status");
|
|
69
|
-
const filters = statusRaw && statusRaw !== "All" ? `status==${statusRaw}` : undefined;
|
|
70
|
-
const { rows, total, isLoading, errorMessage } = useAdminListingData({
|
|
71
|
-
queryKey: ["admin", "bids", "listing"],
|
|
72
|
-
endpoint: ADMIN_ENDPOINTS.BIDS,
|
|
73
|
-
page: table.getNumber("page", 1),
|
|
74
|
-
pageSize: PAGE_SIZE,
|
|
75
|
-
sorts: table.get("sort") || DEFAULT_SORT,
|
|
76
|
-
filters,
|
|
77
|
-
q: table.get("q") || undefined,
|
|
78
|
-
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
79
|
-
id: toStringValue(item.id, `bid-${index}`),
|
|
80
|
-
primary: [
|
|
81
|
-
toStringValue(item.productName ?? item.productTitle, "Unknown item"),
|
|
82
|
-
toRupees(item.amount),
|
|
83
|
-
].join(" · "),
|
|
84
|
-
secondary: toStringValue(item.bidderId ?? item.bidderName ?? item.userId, "Unknown bidder"),
|
|
85
|
-
status: toStringValue(item.status, "active"),
|
|
86
|
-
updatedAt: toRelativeDate(item.bidTime ?? item.bidDate ?? item.updatedAt ?? item.createdAt),
|
|
87
|
-
_raw: item,
|
|
88
|
-
})),
|
|
89
|
-
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
90
|
-
});
|
|
91
18
|
const cancelMutation = useMutation({
|
|
92
19
|
mutationFn: async (bidId) => {
|
|
93
20
|
await apiClient.patch(ADMIN_ENDPOINTS.BID_BY_ID(bidId), { status: "cancelled" });
|
|
@@ -102,31 +29,64 @@ export function AdminBidsView({ children, ...props }) {
|
|
|
102
29
|
showToast(err?.message ?? "Failed to cancel bid.", "error");
|
|
103
30
|
},
|
|
104
31
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const selection = useBulkSelection({ items: rows, keyExtractor: (r) => r.id });
|
|
108
|
-
if (hasChildren) {
|
|
109
|
-
return _jsx(ListingViewShell, { portal: "admin", ...props, children: children });
|
|
32
|
+
if (React.Children.count(children) > 0) {
|
|
33
|
+
return (_jsx(ListingLayout, { portal: "admin", ...props, children: children }));
|
|
110
34
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
35
|
+
const config = {
|
|
36
|
+
portal: "admin",
|
|
37
|
+
title: "Bids",
|
|
38
|
+
searchPlaceholder: "Search bids, products, or bidder IDs",
|
|
39
|
+
emptyLabel: "No bids found",
|
|
40
|
+
filterKeys: ["status"],
|
|
41
|
+
defaultSort: "-bidTime",
|
|
42
|
+
queryKey: ["admin", "bids", "listing"],
|
|
43
|
+
endpoint: ADMIN_ENDPOINTS.BIDS,
|
|
44
|
+
sortOptions: [
|
|
45
|
+
{ value: "-bidTime", label: "Newest" },
|
|
46
|
+
{ value: "bidTime", label: "Oldest" },
|
|
47
|
+
{ value: "-amount", label: "Highest amount" },
|
|
48
|
+
],
|
|
49
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
50
|
+
id: toStringValue(item.id, `bid-${index}`),
|
|
51
|
+
primary: [
|
|
52
|
+
toStringValue(item.productName ?? item.productTitle, "Unknown item"),
|
|
53
|
+
toRupees(item.amount),
|
|
54
|
+
].join(" · "),
|
|
55
|
+
secondary: toStringValue(item.bidderId ?? item.bidderName ?? item.userId, "Unknown bidder"),
|
|
56
|
+
status: toStringValue(item.status, "active"),
|
|
57
|
+
updatedAt: toRelativeDate(item.bidTime ?? item.bidDate ?? item.updatedAt ?? item.createdAt),
|
|
58
|
+
})),
|
|
59
|
+
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
60
|
+
buildFilters: (state) => state.status && state.status !== "All" ? `status==${state.status}` : undefined,
|
|
61
|
+
buildBulkActions: (selection) => [
|
|
62
|
+
{
|
|
63
|
+
id: ROW_ACTION_ID.CANCEL,
|
|
64
|
+
label: ACTIONS.ADMIN["cancel-bid"].label,
|
|
65
|
+
variant: "secondary",
|
|
66
|
+
onClick: () => selection.clearSelection(),
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
renderRowActions: (row) => {
|
|
70
|
+
const isCancelled = row.status === "cancelled" || row.status === "voided";
|
|
71
|
+
return (_jsx(RowActionMenu, { actions: [
|
|
72
|
+
{
|
|
73
|
+
label: ROW_ACTION_META[ROW_ACTION_ID.CANCEL].label,
|
|
74
|
+
destructive: ROW_ACTION_META[ROW_ACTION_ID.CANCEL].destructive,
|
|
75
|
+
disabled: isCancelled,
|
|
76
|
+
onClick: () => {
|
|
77
|
+
setSelectedRow(row);
|
|
78
|
+
setCancelOpen(true);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
] }));
|
|
82
|
+
},
|
|
83
|
+
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Status", tabs: ADMIN_BID_STATUS_TABS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) })),
|
|
84
|
+
};
|
|
85
|
+
return (_jsxs(_Fragment, { children: [_jsx(DataListingView, { config: config }), _jsx(ConfirmDeleteModal, { isOpen: cancelOpen, onClose: () => {
|
|
86
|
+
setCancelOpen(false);
|
|
87
|
+
setSelectedRow(null);
|
|
88
|
+
}, onConfirm: () => {
|
|
89
|
+
if (selectedRow)
|
|
90
|
+
cancelMutation.mutate(selectedRow.id);
|
|
91
|
+
}, isDeleting: cancelMutation.isPending, title: "Cancel this bid?", message: "This will mark the bid as cancelled and notify the bidder. The auction will continue with remaining active bids.", confirmText: "Cancel bid", variant: "warning" })] }));
|
|
132
92
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
actionHref?: string;
|
|
5
|
-
getRowHref?: (row: AdminListingScaffoldRow) => string;
|
|
6
|
-
}
|
|
7
|
-
export declare function AdminBlogView({ children, getRowHref, ...props }: AdminBlogViewProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { ListingLayoutProps } from "../../../ui";
|
|
2
|
+
export type AdminBlogViewProps = ListingLayoutProps;
|
|
3
|
+
export declare function AdminBlogView({ children, ...props }: AdminBlogViewProps): import("react/jsx-runtime").JSX.Element;
|