@mohasinac/appkit 2.7.59 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_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/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/client.d.ts +10 -6
- package/dist/client.js +7 -3
- 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/about/components/PublicProfileView.js +8 -8
- package/dist/features/account/components/UserOffersPanel.js +1 -1
- 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 -83
- package/dist/features/admin/components/AdminBidsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBidsView.js +64 -98
- package/dist/features/admin/components/AdminBlogView.d.ts +3 -7
- package/dist/features/admin/components/AdminBlogView.js +53 -83
- package/dist/features/admin/components/AdminBrandsView.d.ts +2 -3
- package/dist/features/admin/components/AdminBrandsView.js +84 -83
- package/dist/features/admin/components/AdminBundlesView.js +82 -125
- package/dist/features/admin/components/AdminCarouselView.d.ts +2 -2
- package/dist/features/admin/components/AdminCarouselView.js +17 -52
- package/dist/features/admin/components/AdminCartsView.d.ts +2 -3
- package/dist/features/admin/components/AdminCartsView.js +39 -88
- package/dist/features/admin/components/AdminCategoriesView.d.ts +3 -3
- package/dist/features/admin/components/AdminCategoriesView.js +98 -92
- package/dist/features/admin/components/AdminCategoryEditorView.js +2 -2
- 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 +104 -111
- package/dist/features/admin/components/AdminCouponsView.d.ts +3 -6
- package/dist/features/admin/components/AdminCouponsView.js +66 -86
- package/dist/features/admin/components/AdminDigitalCodesView.d.ts +3 -0
- package/dist/features/admin/components/AdminDigitalCodesView.js +51 -0
- package/dist/features/admin/components/AdminFaqsView.d.ts +4 -4
- package/dist/features/admin/components/AdminFaqsView.js +77 -33
- 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 +67 -97
- package/dist/features/admin/components/AdminNotificationsView.d.ts +2 -3
- package/dist/features/admin/components/AdminNotificationsView.js +67 -93
- 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 -107
- package/dist/features/admin/components/AdminPayoutsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPayoutsView.js +51 -91
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +2 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.js +39 -76
- package/dist/features/admin/components/AdminProductEditorView.js +3 -3
- package/dist/features/admin/components/AdminProductsView.d.ts +4 -4
- package/dist/features/admin/components/AdminProductsView.js +167 -163
- 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 -110
- package/dist/features/admin/components/AdminScammersView.d.ts +2 -3
- package/dist/features/admin/components/AdminScammersView.js +53 -97
- 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 -89
- package/dist/features/admin/components/AdminSiteSettingsView.js +4 -5
- 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 -99
- package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +1 -1
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +28 -44
- 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 -96
- package/dist/features/admin/components/AdminTeamView.d.ts +2 -2
- package/dist/features/admin/components/AdminTeamView.js +40 -74
- package/dist/features/admin/components/AdminUserEditorView.d.ts +11 -1
- package/dist/features/admin/components/AdminUserEditorView.js +77 -7
- package/dist/features/admin/components/AdminUsersView.d.ts +2 -3
- package/dist/features/admin/components/AdminUsersView.js +108 -100
- package/dist/features/admin/components/AdminViewCards.d.ts +1 -1
- package/dist/features/admin/components/AdminViewCards.js +15 -15
- 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 +1 -0
- package/dist/features/admin/hooks/useAdminListing.js +1 -1
- 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/blog/components/BlogFeaturedCard.js +1 -0
- package/dist/features/cart/repository/cart.repository.d.ts +4 -1
- package/dist/features/cart/repository/cart.repository.js +12 -0
- package/dist/features/checkout/hooks/useCheckoutApi.d.ts +0 -2
- package/dist/features/checkout/index.d.ts +1 -1
- package/dist/features/events/components/AdminEventEditorView.js +10 -13
- package/dist/features/events/components/AdminEventsView.d.ts +3 -3
- package/dist/features/events/components/AdminEventsView.js +50 -86
- package/dist/features/events/components/EventCard.js +1 -0
- 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/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/faq/components/FAQPageContent.js +1 -0
- package/dist/features/filters/AsyncFacetSection.d.ts +1 -1
- package/dist/features/homepage/components/AdvertisementBanner.js +6 -6
- package/dist/features/homepage/components/FAQSection.d.ts +0 -5
- package/dist/features/homepage/components/HomepageSkeleton.js +2 -2
- package/dist/features/homepage/components/WelcomeSection.js +3 -3
- package/dist/features/homepage/lib/live-stats.js +1 -1
- package/dist/features/homepage/schemas/firestore.d.ts +0 -2
- package/dist/features/layout/TitleBar.js +1 -0
- package/dist/features/layout/index.d.ts +0 -2
- package/dist/features/layout/index.js +0 -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 +2 -2
- 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 +15 -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/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/types/index.d.ts +4 -0
- package/dist/features/promotions/components/CouponsIndexListing.js +4 -4
- package/dist/features/promotions/server.d.ts +0 -1
- package/dist/features/promotions/server.js +0 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -3
- 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 +4 -5
- package/dist/features/seller/components/SellerAuctionsView.d.ts +3 -3
- package/dist/features/seller/components/SellerAuctionsView.js +60 -90
- package/dist/features/seller/components/SellerBidsView.js +1 -1
- package/dist/features/seller/components/SellerBundlesView.js +64 -89
- package/dist/features/seller/components/SellerClassifiedView.js +67 -90
- 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 +45 -84
- package/dist/features/seller/components/SellerDigitalCodesView.js +63 -88
- package/dist/features/seller/components/SellerGroupedListingsView.js +33 -49
- package/dist/features/seller/components/SellerLiveView.js +63 -84
- 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 -69
- package/dist/features/seller/components/SellerOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +4 -4
- package/dist/features/seller/components/SellerPayoutMethodsView.js +1 -1
- package/dist/features/seller/components/SellerPayoutsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPayoutsView.js +34 -68
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +2 -2
- package/dist/features/seller/components/SellerPreOrdersView.js +49 -82
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +2 -2
- package/dist/features/seller/components/SellerPrizeDrawsView.js +49 -82
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -1
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -2
- package/dist/features/seller/components/SellerProductsView.js +15 -10
- package/dist/features/seller/components/SellerShippingConfigsView.js +1 -1
- 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 +1 -1
- package/dist/features/seller/components/SellerTemplatesView.js +2 -2
- 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 +7 -4
- 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/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/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 +9 -27
- package/dist/index.js +14 -50
- package/dist/next/routing/route-map.d.ts +8 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/react/hooks/useListingTypeFlags.d.ts +32 -0
- package/dist/react/hooks/useListingTypeFlags.js +19 -0
- 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/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 +12 -14
- package/dist/ui/index.js +6 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
/** High-level OG renderer — accepts the raw store document from `getStoreForDetail`. */
|
|
4
4
|
export function renderStoreOg(doc, opts) {
|
|
@@ -10,44 +10,11 @@ export function renderStoreOg(doc, opts) {
|
|
|
10
10
|
}, opts.siteName);
|
|
11
11
|
}
|
|
12
12
|
export function renderStoreOgImage(data, siteName) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
fontFamily: "sans-serif",
|
|
21
|
-
position: "relative",
|
|
22
|
-
overflow: "hidden",
|
|
23
|
-
}, children: [bgImage && (_jsx("img", { src: bgImage, alt: "", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.12 } })), _jsx("div", { style: {
|
|
24
|
-
position: "absolute",
|
|
25
|
-
inset: 0,
|
|
26
|
-
background: "linear-gradient(135deg, rgba(15,23,42,0.97) 0%, rgba(15,23,42,0.85) 100%)",
|
|
27
|
-
} }), _jsxs("div", { style: {
|
|
28
|
-
position: "relative",
|
|
29
|
-
display: "flex",
|
|
30
|
-
width: "100%",
|
|
31
|
-
height: "100%",
|
|
32
|
-
padding: "60px",
|
|
33
|
-
gap: "48px",
|
|
34
|
-
alignItems: "center",
|
|
35
|
-
}, children: [logoUrl && (_jsx("img", { src: logoUrl, alt: name, style: { width: 200, height: 200, objectFit: "contain", borderRadius: 16, flexShrink: 0, background: "rgba(255,255,255,0.06)" } })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20, flex: 1 }, children: [_jsxs("div", { style: { fontSize: 18, color: "#38bdf8", fontWeight: 600, letterSpacing: 2, textTransform: "uppercase" }, children: [siteName, " \u00B7 Store"] }), _jsx("div", { style: {
|
|
36
|
-
fontSize: logoUrl ? 52 : 62,
|
|
37
|
-
fontWeight: 700,
|
|
38
|
-
color: "#f1f5f9",
|
|
39
|
-
lineHeight: 1.15,
|
|
40
|
-
display: "-webkit-box",
|
|
41
|
-
WebkitLineClamp: 2,
|
|
42
|
-
WebkitBoxOrient: "vertical",
|
|
43
|
-
overflow: "hidden",
|
|
44
|
-
}, children: name }), description && (_jsx("div", { style: {
|
|
45
|
-
fontSize: 26,
|
|
46
|
-
color: "#94a3b8",
|
|
47
|
-
lineHeight: 1.4,
|
|
48
|
-
display: "-webkit-box",
|
|
49
|
-
WebkitLineClamp: 2,
|
|
50
|
-
WebkitBoxOrient: "vertical",
|
|
51
|
-
overflow: "hidden",
|
|
52
|
-
}, children: description }))] })] })] }));
|
|
13
|
+
return renderOgLayout({
|
|
14
|
+
title: data.name,
|
|
15
|
+
subtitle: data.description ?? undefined,
|
|
16
|
+
imageUrl: data.logoUrl ?? data.bannerUrl,
|
|
17
|
+
siteName: `${siteName} · Store`,
|
|
18
|
+
theme: { accentColor: "#38bdf8" },
|
|
19
|
+
});
|
|
53
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderOgLayout } from "../seo/og-layout";
|
|
2
2
|
import { resolveOgImageUrl } from "../seo/og";
|
|
3
3
|
/** High-level OG renderer — accepts the raw sublisting-category doc from the repository. */
|
|
4
4
|
export function renderSublistingCategoryOg(doc, opts) {
|
|
@@ -12,46 +12,15 @@ export function renderSublistingCategoryOg(doc, opts) {
|
|
|
12
12
|
}, opts.siteName);
|
|
13
13
|
}
|
|
14
14
|
export function renderSublistingCategoryOgImage(data, siteName) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
? `${productCount} listing${productCount !== 1 ? "s" : ""} available`
|
|
15
|
+
const countLabel = data.productCount !== null && data.productCount !== undefined && data.productCount > 0
|
|
16
|
+
? `${data.productCount} listing${data.productCount !== 1 ? "s" : ""} available`
|
|
18
17
|
: null;
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, children: [coverImage && (_jsx("img", { src: coverImage, alt: "", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.12 } })), _jsx("div", { style: {
|
|
28
|
-
position: "absolute",
|
|
29
|
-
inset: 0,
|
|
30
|
-
background: "linear-gradient(135deg, rgba(15,23,42,0.97) 0%, rgba(15,23,42,0.82) 100%)",
|
|
31
|
-
} }), _jsxs("div", { style: {
|
|
32
|
-
position: "relative",
|
|
33
|
-
display: "flex",
|
|
34
|
-
width: "100%",
|
|
35
|
-
height: "100%",
|
|
36
|
-
padding: "60px",
|
|
37
|
-
gap: "48px",
|
|
38
|
-
alignItems: "center",
|
|
39
|
-
}, children: [coverImage && (_jsx("img", { src: coverImage, alt: name, style: { width: 300, height: 300, objectFit: "cover", borderRadius: 16, flexShrink: 0 } })), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 20, flex: 1 }, children: [_jsxs("div", { style: { fontSize: 16, color: "#f59e0b", fontWeight: 600, letterSpacing: 2, textTransform: "uppercase" }, children: [siteName, " \u00B7 Listings"] }), _jsx("div", { style: {
|
|
40
|
-
fontSize: coverImage ? 48 : 60,
|
|
41
|
-
fontWeight: 700,
|
|
42
|
-
color: "#f1f5f9",
|
|
43
|
-
lineHeight: 1.15,
|
|
44
|
-
display: "-webkit-box",
|
|
45
|
-
WebkitLineClamp: 2,
|
|
46
|
-
WebkitBoxOrient: "vertical",
|
|
47
|
-
overflow: "hidden",
|
|
48
|
-
}, children: name }), description && (_jsx("div", { style: {
|
|
49
|
-
fontSize: 24,
|
|
50
|
-
color: "#94a3b8",
|
|
51
|
-
lineHeight: 1.45,
|
|
52
|
-
display: "-webkit-box",
|
|
53
|
-
WebkitLineClamp: 2,
|
|
54
|
-
WebkitBoxOrient: "vertical",
|
|
55
|
-
overflow: "hidden",
|
|
56
|
-
}, children: description })), countLabel && (_jsx("div", { style: { fontSize: 20, fontWeight: 600, color: "#f59e0b" }, children: countLabel }))] })] })] }));
|
|
18
|
+
return renderOgLayout({
|
|
19
|
+
title: data.name,
|
|
20
|
+
subtitle: data.description ?? undefined,
|
|
21
|
+
imageUrl: data.coverImage,
|
|
22
|
+
siteName: `${siteName} · Listings`,
|
|
23
|
+
accentSlot: countLabel,
|
|
24
|
+
theme: { accentColor: "#f59e0b" },
|
|
25
|
+
});
|
|
57
26
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -91,8 +91,10 @@ export { TextLink } from "./ui/components/TextLink";
|
|
|
91
91
|
export type { TextLinkProps } from "./ui/components/TextLink";
|
|
92
92
|
export { Textarea } from "./ui/components/Textarea";
|
|
93
93
|
export { GlobalError } from "./next/components/GlobalError";
|
|
94
|
-
export { AppLayoutShell, LocaleSwitcher, useDashboardNav, BottomActionsProvider, useBottomActions, DashboardNavProvider, LayoutClient
|
|
95
|
-
export type { AppLayoutShellProps, AppLayoutShellSidebarLink, AppLayoutShellSidebarSection, DashboardNavState, MainNavbarItem, LayoutClientProps
|
|
94
|
+
export { AppLayoutShell, LocaleSwitcher, useDashboardNav, BottomActionsProvider, useBottomActions, DashboardNavProvider, LayoutClient } from "./features/layout/index";
|
|
95
|
+
export type { AppLayoutShellProps, AppLayoutShellSidebarLink, AppLayoutShellSidebarSection, DashboardNavState, MainNavbarItem, LayoutClientProps } from "./features/layout/index";
|
|
96
|
+
export { ListingLayout } from "./ui/components/ListingLayout";
|
|
97
|
+
export type { ListingLayoutProps, ListingLayoutLabels } from "./ui/components/ListingLayout";
|
|
96
98
|
export { Search } from "./features/search/components";
|
|
97
99
|
export type { SearchLabels, SearchProps, SearchQuickLink, SearchRouterAdapter, SearchResourceType, SearchResourceTypeOption } from "./features/search/components";
|
|
98
100
|
export { ToastProvider, SkipToMain, NavigationLoader } from "./ui/index";
|
|
@@ -101,8 +103,8 @@ export { ZodSetup } from "./validation/ZodSetup";
|
|
|
101
103
|
export type { ZodSetupProps } from "./validation/ZodSetup";
|
|
102
104
|
export { AdminSidebar } from "./features/admin/components/AdminSidebar";
|
|
103
105
|
export type { AdminSidebarProps, AdminNavItem, AdminNavGroup } from "./features/admin/components/AdminSidebar";
|
|
104
|
-
export { AdminDashboardView, AdminAnalyticsView,
|
|
105
|
-
export type { AdminDashboardViewProps, AdminAnalyticsViewProps, AdminAnalyticsViewLabels, AdminPrizeDrawsViewProps, AdminCarouselViewProps } from "./features/admin/index";
|
|
106
|
+
export { AdminDashboardView, AdminAnalyticsView, AdminPrizeDrawsView, AdminCarouselView, AdminSublistingCategoriesView, DataTable, DataListingView, useAdminListingData, toRecordArray, toStringValue, toRelativeDate, toRupees } from "./features/admin/index";
|
|
107
|
+
export type { AdminDashboardViewProps, AdminAnalyticsViewProps, AdminAnalyticsViewLabels, AdminPrizeDrawsViewProps, AdminCarouselViewProps, AdminListingScaffoldRow, ListingViewConfig } from "./features/admin/index";
|
|
106
108
|
export type { BulkActionItem } from "./ui/components/BulkActionBar";
|
|
107
109
|
export { ADMIN_ENDPOINTS } from "./constants/index";
|
|
108
110
|
export { apiClient, ApiClientError } from "./http/index";
|
|
@@ -129,8 +131,8 @@ export { useProfile, useUpdateProfile } from "./features/account/index";
|
|
|
129
131
|
export { CategoryProductsView } from "./features/categories/index";
|
|
130
132
|
export type { CategoryItem } from "./features/categories/index";
|
|
131
133
|
export { MediaImage } from "./features/media/index";
|
|
132
|
-
export { StoreSidebar
|
|
133
|
-
export type { StoreNavItem, StoreNavGroup
|
|
134
|
+
export { StoreSidebar } from "./features/seller/components/SellerSidebar";
|
|
135
|
+
export type { StoreNavItem, StoreNavGroup } from "./features/seller/components/SellerSidebar";
|
|
134
136
|
export { StoreProductsView, StoreAboutView } from "./features/stores/index";
|
|
135
137
|
export type { StoreProductItem, StoreAboutViewProps, StoreDetail } from "./features/stores/index";
|
|
136
138
|
export { SearchView } from "./features/search/index";
|
|
@@ -177,6 +179,8 @@ export { DASHBOARD_QUICK_ACTION_ID, DASHBOARD_QUICK_ACTION_META, DASHBOARD_QUICK
|
|
|
177
179
|
export type { DashboardQuickActionId, DashboardQuickActionMeta } from "./features/products/index";
|
|
178
180
|
export { useAuthGate } from "./react/hooks/useAuthGate";
|
|
179
181
|
export type { UseAuthGateReturn } from "./react/hooks/useAuthGate";
|
|
182
|
+
export { useListingTypeFlags } from "./react/hooks/useListingTypeFlags";
|
|
183
|
+
export type { ListingTypeFlags, ListingTypeFlagsShape, } from "./react/hooks/useListingTypeFlags";
|
|
180
184
|
export { useActionDispatch } from "./react/hooks/use-action-dispatch";
|
|
181
185
|
export type { DispatchAction, UseActionDispatchOptions } from "./react/hooks/use-action-dispatch";
|
|
182
186
|
export { usePanelStore } from "./stores/panel-store";
|
package/dist/client.js
CHANGED
|
@@ -145,12 +145,13 @@ export { Label, Text, Span, Caption } from "./ui/components/Typography";
|
|
|
145
145
|
export { TextLink } from "./ui/components/TextLink";
|
|
146
146
|
export { Textarea } from "./ui/components/Textarea";
|
|
147
147
|
export { GlobalError } from "./next/components/GlobalError";
|
|
148
|
-
export { AppLayoutShell, LocaleSwitcher, useDashboardNav, BottomActionsProvider, useBottomActions, DashboardNavProvider, LayoutClient
|
|
148
|
+
export { AppLayoutShell, LocaleSwitcher, useDashboardNav, BottomActionsProvider, useBottomActions, DashboardNavProvider, LayoutClient } from "./features/layout/index";
|
|
149
|
+
export { ListingLayout } from "./ui/components/ListingLayout";
|
|
149
150
|
export { Search } from "./features/search/components";
|
|
150
151
|
export { ToastProvider, SkipToMain, NavigationLoader } from "./ui/index";
|
|
151
152
|
export { ZodSetup } from "./validation/ZodSetup";
|
|
152
153
|
export { AdminSidebar } from "./features/admin/components/AdminSidebar";
|
|
153
|
-
export { AdminDashboardView, AdminAnalyticsView,
|
|
154
|
+
export { AdminDashboardView, AdminAnalyticsView, AdminPrizeDrawsView, AdminCarouselView, AdminSublistingCategoriesView, DataTable, DataListingView, useAdminListingData, toRecordArray, toStringValue, toRelativeDate, toRupees } from "./features/admin/index";
|
|
154
155
|
export { ADMIN_ENDPOINTS } from "./constants/index";
|
|
155
156
|
export { apiClient, ApiClientError } from "./http/index";
|
|
156
157
|
export { UserSidebar } from "./features/account/components/UserSidebar";
|
|
@@ -166,7 +167,7 @@ export { AddressBook, AddressCard, AddressForm } from "./features/account/index"
|
|
|
166
167
|
export { useProfile, useUpdateProfile } from "./features/account/index";
|
|
167
168
|
export { CategoryProductsView } from "./features/categories/index";
|
|
168
169
|
export { MediaImage } from "./features/media/index";
|
|
169
|
-
export { StoreSidebar
|
|
170
|
+
export { StoreSidebar } from "./features/seller/components/SellerSidebar";
|
|
170
171
|
export { StoreProductsView, StoreAboutView } from "./features/stores/index";
|
|
171
172
|
export { SearchView } from "./features/search/index";
|
|
172
173
|
export { UserSettingsView } from "./features/account/index";
|
|
@@ -199,6 +200,9 @@ export { FORM_ACTION_ID, FORM_ACTION_META, FORM_FOOTER_PRESET } from "./features
|
|
|
199
200
|
export { DASHBOARD_QUICK_ACTION_ID, DASHBOARD_QUICK_ACTION_META, DASHBOARD_QUICK_ACTIONS } from "./features/products/index";
|
|
200
201
|
// [CLIENT-ONLY] useAuthGate: pre-dispatch auth gate using ACTION_ID registry.
|
|
201
202
|
export { useAuthGate } from "./react/hooks/useAuthGate";
|
|
203
|
+
// [CLIENT-ONLY] W1-43 — useListingTypeFlags: read featureFlags.listingTypes
|
|
204
|
+
// from siteSettings; hide nav/search/picker entries for disabled types.
|
|
205
|
+
export { useListingTypeFlags } from "./react/hooks/useListingTypeFlags";
|
|
202
206
|
// Action dispatch hook + panel store
|
|
203
207
|
export { useActionDispatch } from "./react/hooks/use-action-dispatch";
|
|
204
208
|
export { usePanelStore } from "./stores/panel-store";
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { API_ENDPOINTS, API_ROUTES, LOGS_ENDPOINTS, AUTH_ENDPOINTS, ACCOUNT_ENDPOINTS, NOTIFICATIONS_ENDPOINTS, SITE_SETTINGS_ENDPOINTS, ADMIN_ENDPOINTS, CHAT_ENDPOINTS, AUCTION_ENDPOINTS, BID_ENDPOINTS, CART_ENDPOINTS, CATEGORY_ENDPOINTS, CHECKOUT_ENDPOINTS, PAYMENT_ENDPOINTS, COLLECTION_ENDPOINTS, CONSULTATION_ENDPOINTS, COPILOT_ENDPOINTS, CORPORATE_ENDPOINTS, EVENT_ENDPOINTS, FAQ_ENDPOINTS, HOMEPAGE_ENDPOINTS, LOYALTY_ENDPOINTS, MEDIA_ENDPOINTS, ORDER_ENDPOINTS, PREORDER_ENDPOINTS, PRODUCT_ENDPOINTS, PROMOTION_ENDPOINTS, REVIEW_ENDPOINTS, SEARCH_ENDPOINTS, SELLER_ENDPOINTS, BLOG_ENDPOINTS, STORE_ENDPOINTS, WISHLIST_ENDPOINTS, PROFILE_STATS_ENDPOINTS, DEMO_ENDPOINTS, } from "./api-endpoints";
|
|
13
13
|
export { COLLECTION_CACHE_PATHS } from "./cache-invalidation";
|
|
14
|
+
export { PAGE_SIZES, MAX_PAGE_SIZE, FEATURED_LIMITS, SITEMAP_LIMITS, } from "./pagination-presets";
|
|
15
|
+
export type { PageSizeKey } from "./pagination-presets";
|
|
16
|
+
export { NOTIFICATION_TYPES, NOTIFICATION_TYPE_TABS, } from "./notification-types";
|
|
17
|
+
export type { NotificationType } from "./notification-types";
|
|
14
18
|
export { resolveEndpoint, resolveEndpointFn } from "./api-endpoint-resolver";
|
|
15
19
|
export { ROUTES, PUBLIC_ROUTES, PROTECTED_ROUTES, AUTH_ROUTES } from "../next/routing/route-map";
|
|
16
20
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, WISHLIST_DOC_ID, HISTORY_DOC_ID, WISHLIST_COLLECTION, HISTORY_COLLECTION, } from "./limits";
|
package/dist/constants/index.js
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { API_ENDPOINTS, API_ROUTES, LOGS_ENDPOINTS, AUTH_ENDPOINTS, ACCOUNT_ENDPOINTS, NOTIFICATIONS_ENDPOINTS, SITE_SETTINGS_ENDPOINTS, ADMIN_ENDPOINTS, CHAT_ENDPOINTS, AUCTION_ENDPOINTS, BID_ENDPOINTS, CART_ENDPOINTS, CATEGORY_ENDPOINTS, CHECKOUT_ENDPOINTS, PAYMENT_ENDPOINTS, COLLECTION_ENDPOINTS, CONSULTATION_ENDPOINTS, COPILOT_ENDPOINTS, CORPORATE_ENDPOINTS, EVENT_ENDPOINTS, FAQ_ENDPOINTS, HOMEPAGE_ENDPOINTS, LOYALTY_ENDPOINTS, MEDIA_ENDPOINTS, ORDER_ENDPOINTS, PREORDER_ENDPOINTS, PRODUCT_ENDPOINTS, PROMOTION_ENDPOINTS, REVIEW_ENDPOINTS, SEARCH_ENDPOINTS, SELLER_ENDPOINTS, BLOG_ENDPOINTS, STORE_ENDPOINTS, WISHLIST_ENDPOINTS, PROFILE_STATS_ENDPOINTS, DEMO_ENDPOINTS, } from "./api-endpoints";
|
|
13
13
|
export { COLLECTION_CACHE_PATHS } from "./cache-invalidation";
|
|
14
|
+
export { PAGE_SIZES, MAX_PAGE_SIZE, FEATURED_LIMITS, SITEMAP_LIMITS, } from "./pagination-presets";
|
|
15
|
+
export { NOTIFICATION_TYPES, NOTIFICATION_TYPE_TABS, } from "./notification-types";
|
|
14
16
|
export { resolveEndpoint, resolveEndpointFn } from "./api-endpoint-resolver";
|
|
15
17
|
export { ROUTES, PUBLIC_ROUTES, PROTECTED_ROUTES, AUTH_ROUTES } from "../next/routing/route-map";
|
|
16
18
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, WISHLIST_DOC_ID, HISTORY_DOC_ID, WISHLIST_COLLECTION, HISTORY_COLLECTION, } from "./limits";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Type Registry — W1-33
|
|
3
|
+
*
|
|
4
|
+
* Canonical list of notification type IDs. Shared across:
|
|
5
|
+
* - AdminNotificationsView filter chips
|
|
6
|
+
* - NotificationPreferencesPanel (per-type toggles)
|
|
7
|
+
* - sendNotification() dispatch (type-based channel routing)
|
|
8
|
+
*
|
|
9
|
+
* Add new types here. Don't redefine the list inline in components.
|
|
10
|
+
*/
|
|
11
|
+
export declare const NOTIFICATION_TYPES: readonly ["order_placed", "order_shipped", "order_delivered", "order_cancelled", "bid_placed", "bid_outbid", "bid_won", "review_posted", "payout_processed"];
|
|
12
|
+
export type NotificationType = (typeof NOTIFICATION_TYPES)[number];
|
|
13
|
+
/**
|
|
14
|
+
* Shape used by filter-chip rows (id + display label).
|
|
15
|
+
* Prepended with an "All" option for the typical filter-chip pattern.
|
|
16
|
+
*/
|
|
17
|
+
export declare const NOTIFICATION_TYPE_TABS: ReadonlyArray<{
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Type Registry — W1-33
|
|
3
|
+
*
|
|
4
|
+
* Canonical list of notification type IDs. Shared across:
|
|
5
|
+
* - AdminNotificationsView filter chips
|
|
6
|
+
* - NotificationPreferencesPanel (per-type toggles)
|
|
7
|
+
* - sendNotification() dispatch (type-based channel routing)
|
|
8
|
+
*
|
|
9
|
+
* Add new types here. Don't redefine the list inline in components.
|
|
10
|
+
*/
|
|
11
|
+
export const NOTIFICATION_TYPES = [
|
|
12
|
+
"order_placed",
|
|
13
|
+
"order_shipped",
|
|
14
|
+
"order_delivered",
|
|
15
|
+
"order_cancelled",
|
|
16
|
+
"bid_placed",
|
|
17
|
+
"bid_outbid",
|
|
18
|
+
"bid_won",
|
|
19
|
+
"review_posted",
|
|
20
|
+
"payout_processed",
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Shape used by filter-chip rows (id + display label).
|
|
24
|
+
* Prepended with an "All" option for the typical filter-chip pattern.
|
|
25
|
+
*/
|
|
26
|
+
export const NOTIFICATION_TYPE_TABS = [
|
|
27
|
+
{ id: "All", label: "All" },
|
|
28
|
+
{ id: "order_placed", label: "Order placed" },
|
|
29
|
+
{ id: "order_shipped", label: "Order shipped" },
|
|
30
|
+
{ id: "order_delivered", label: "Order delivered" },
|
|
31
|
+
{ id: "order_cancelled", label: "Order cancelled" },
|
|
32
|
+
{ id: "bid_placed", label: "Bid placed" },
|
|
33
|
+
{ id: "bid_outbid", label: "Bid outbid" },
|
|
34
|
+
{ id: "bid_won", label: "Bid won" },
|
|
35
|
+
{ id: "review_posted", label: "Review posted" },
|
|
36
|
+
{ id: "payout_processed", label: "Payout processed" },
|
|
37
|
+
];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination presets — W2-5
|
|
3
|
+
*
|
|
4
|
+
* Canonical page-size and limit constants. Reference these instead of
|
|
5
|
+
* redefining `PAGE_SIZE` / `DEFAULT_PAGE_SIZE` / `FEATURED_LIMIT` per feature.
|
|
6
|
+
*
|
|
7
|
+
* Empirically derived from the existing distribution (2026-05-23):
|
|
8
|
+
* - public marketplace cards (24 per page) — GRID
|
|
9
|
+
* - admin tables (50 per page) — LARGE
|
|
10
|
+
* - admin tables (default 25) — DEFAULT
|
|
11
|
+
* - bundle/category page nav (12 per page) — SMALL
|
|
12
|
+
*/
|
|
13
|
+
export declare const PAGE_SIZES: {
|
|
14
|
+
readonly SMALL: 12;
|
|
15
|
+
readonly DEFAULT: 25;
|
|
16
|
+
readonly GRID: 24;
|
|
17
|
+
readonly LARGE: 50;
|
|
18
|
+
};
|
|
19
|
+
export type PageSizeKey = keyof typeof PAGE_SIZES;
|
|
20
|
+
/** Maximum permissible page-size for paginated API routes. Server-side guard. */
|
|
21
|
+
export declare const MAX_PAGE_SIZE = 100;
|
|
22
|
+
/** Per-resource featured-section limits (homepage hero strips). */
|
|
23
|
+
export declare const FEATURED_LIMITS: {
|
|
24
|
+
readonly products: 8;
|
|
25
|
+
readonly categories: 12;
|
|
26
|
+
readonly stores: 8;
|
|
27
|
+
readonly blog: 3;
|
|
28
|
+
readonly bundles: 12;
|
|
29
|
+
readonly events: 6;
|
|
30
|
+
readonly auctions: 8;
|
|
31
|
+
};
|
|
32
|
+
/** Per-resource sitemap node-count limits (URL caps). */
|
|
33
|
+
export declare const SITEMAP_LIMITS: {
|
|
34
|
+
readonly products: 5000;
|
|
35
|
+
readonly categories: 200;
|
|
36
|
+
readonly stores: 200;
|
|
37
|
+
readonly blog: 5000;
|
|
38
|
+
readonly auctions: 5000;
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination presets — W2-5
|
|
3
|
+
*
|
|
4
|
+
* Canonical page-size and limit constants. Reference these instead of
|
|
5
|
+
* redefining `PAGE_SIZE` / `DEFAULT_PAGE_SIZE` / `FEATURED_LIMIT` per feature.
|
|
6
|
+
*
|
|
7
|
+
* Empirically derived from the existing distribution (2026-05-23):
|
|
8
|
+
* - public marketplace cards (24 per page) — GRID
|
|
9
|
+
* - admin tables (50 per page) — LARGE
|
|
10
|
+
* - admin tables (default 25) — DEFAULT
|
|
11
|
+
* - bundle/category page nav (12 per page) — SMALL
|
|
12
|
+
*/
|
|
13
|
+
export const PAGE_SIZES = {
|
|
14
|
+
SMALL: 12,
|
|
15
|
+
DEFAULT: 25,
|
|
16
|
+
GRID: 24,
|
|
17
|
+
LARGE: 50,
|
|
18
|
+
};
|
|
19
|
+
/** Maximum permissible page-size for paginated API routes. Server-side guard. */
|
|
20
|
+
export const MAX_PAGE_SIZE = 100;
|
|
21
|
+
/** Per-resource featured-section limits (homepage hero strips). */
|
|
22
|
+
export const FEATURED_LIMITS = {
|
|
23
|
+
products: 8,
|
|
24
|
+
categories: 12,
|
|
25
|
+
stores: 8,
|
|
26
|
+
blog: 3,
|
|
27
|
+
bundles: 12,
|
|
28
|
+
events: 6,
|
|
29
|
+
auctions: 8,
|
|
30
|
+
};
|
|
31
|
+
/** Per-resource sitemap node-count limits (URL caps). */
|
|
32
|
+
export const SITEMAP_LIMITS = {
|
|
33
|
+
products: 5000,
|
|
34
|
+
categories: 200,
|
|
35
|
+
stores: 200,
|
|
36
|
+
blog: 5000,
|
|
37
|
+
auctions: 5000,
|
|
38
|
+
};
|
|
@@ -463,10 +463,6 @@ export declare const ERROR_MESSAGES: {
|
|
|
463
463
|
readonly ORDER_CREATE_FAILED: "Failed to create shipment with shipping provider";
|
|
464
464
|
readonly AWB_ASSIGN_FAILED: "Failed to assign courier AWB number";
|
|
465
465
|
readonly PICKUP_SCHEDULE_FAILED: "Failed to schedule pickup with shipping provider";
|
|
466
|
-
/** @deprecated Use PROVIDER_CREDS_REQUIRED */
|
|
467
|
-
readonly SHIPROCKET_CREDS_REQUIRED: "Shipping provider email and password are required";
|
|
468
|
-
/** @deprecated Use PROVIDER_AUTH_FAILED */
|
|
469
|
-
readonly SHIPROCKET_AUTH_FAILED: "Failed to authenticate with shipping provider — check your credentials";
|
|
470
466
|
readonly TRACKING_FAILED: "Failed to fetch tracking details";
|
|
471
467
|
readonly INVALID_TRACKING_URL: "Please provide a valid tracking URL";
|
|
472
468
|
readonly CARRIER_NAME_REQUIRED: "Carrier name is required when providing tracking details";
|
package/dist/errors/messages.js
CHANGED
|
@@ -496,10 +496,6 @@ export const ERROR_MESSAGES = {
|
|
|
496
496
|
ORDER_CREATE_FAILED: "Failed to create shipment with shipping provider",
|
|
497
497
|
AWB_ASSIGN_FAILED: "Failed to assign courier AWB number",
|
|
498
498
|
PICKUP_SCHEDULE_FAILED: "Failed to schedule pickup with shipping provider",
|
|
499
|
-
/** @deprecated Use PROVIDER_CREDS_REQUIRED */
|
|
500
|
-
SHIPROCKET_CREDS_REQUIRED: "Shipping provider email and password are required",
|
|
501
|
-
/** @deprecated Use PROVIDER_AUTH_FAILED */
|
|
502
|
-
SHIPROCKET_AUTH_FAILED: "Failed to authenticate with shipping provider — check your credentials",
|
|
503
499
|
TRACKING_FAILED: "Failed to fetch tracking details",
|
|
504
500
|
INVALID_TRACKING_URL: "Please provide a valid tracking URL",
|
|
505
501
|
CARRIER_NAME_REQUIRED: "Carrier name is required when providing tracking details",
|
|
@@ -4,7 +4,7 @@ import { getPublicUserProfile, getProfileStoreProducts, getSellerReviews } from
|
|
|
4
4
|
import { storeRepository } from "../../stores/repository/store.repository";
|
|
5
5
|
import { ROUTES } from "../../../constants";
|
|
6
6
|
import { THEME_CONSTANTS } from "../../../tokens";
|
|
7
|
-
import { Heading,
|
|
7
|
+
import { Div, Grid, Heading, Row, Section, Span, Stack, Text } from "../../../ui";
|
|
8
8
|
import { ProductCard } from "../../products/components/ProductGrid";
|
|
9
9
|
import { ReviewCard } from "../../reviews/components/ReviewsList";
|
|
10
10
|
import { isAuctionListing, isPreOrderListing } from "../../products/utils/listing-type";
|
|
@@ -80,7 +80,7 @@ export async function PublicProfileView({ userId, heroBannerClass = DEFAULT_HERO
|
|
|
80
80
|
const storeDescription = store?.storeDescription ?? pub?.storeDescription;
|
|
81
81
|
const profileHeroCtx = { displayName, photoURL, memberSince, isSeller, storeSlug, flex, page, heroBannerClass };
|
|
82
82
|
const statItems = buildProfileStatItems(t, { listingCount, reviewCount, itemsSold, auctionsWon, totalOrders, isSeller });
|
|
83
|
-
return (_jsxs(
|
|
83
|
+
return (_jsxs(Div, { className: "-mx-4 md:-mx-6 lg:-mx-8 -mt-6 sm:-mt-8 lg:-mt-10", children: [renderProfileHero(t, profileHeroCtx), _jsxs(Stack, { gap: "2xl", className: `${page.container.md} py-10 md:py-12`, children: [renderProfileStatsRow(themed, flex, statItems), renderProfileBioSection(themed, pub), renderStoreDescriptionSection(themed, isSeller, storeSlug ?? null, storeDescription ?? null, storeName, t), renderProfileListingsSection(t, themed, products, storeSlug ?? null), renderProfileReviewsSection(t, themed, reviews, storeSlug ?? null), _jsx(Row, { justify: "center", className: "pt-2", children: _jsxs(Link, { href: String(ROUTES.HOME), className: "text-sm text-zinc-400 dark:text-zinc-400 hover:text-neutral-600 dark:hover:text-zinc-300", children: ["\u2190 ", t("backHome")] }) })] })] }));
|
|
84
84
|
}
|
|
85
85
|
function buildProfileStatItems(t, ctx) {
|
|
86
86
|
const { listingCount, reviewCount, itemsSold, auctionsWon, totalOrders, isSeller } = ctx;
|
|
@@ -100,25 +100,25 @@ function buildProfileStatItems(t, ctx) {
|
|
|
100
100
|
}
|
|
101
101
|
function renderProfileHero(t, ctx) {
|
|
102
102
|
const { displayName, photoURL, memberSince, isSeller, storeSlug, flex, page, heroBannerClass } = ctx;
|
|
103
|
-
return (_jsx(Section, { className: `${heroBannerClass} text-white py-10 md:py-14`, children: _jsx(
|
|
103
|
+
return (_jsx(Section, { className: `${heroBannerClass} text-white py-10 md:py-14`, children: _jsx(Div, { className: `${page.container.md}`, children: _jsxs(Row, { gap: "md", align: "end", wrap: true, className: "flex-col sm:flex-row items-center sm:items-end", children: [_jsx(Div, { className: `w-20 h-20 rounded-full bg-white/20 ${flex.center} flex-shrink-0 overflow-hidden`, children: photoURL ? _jsx("img", { src: photoURL, alt: displayName, className: "w-full h-full object-cover" }) : _jsx(User, { className: "w-10 h-10 text-white/60" }) }), _jsxs(Stack, { gap: "xs", className: "text-center sm:text-left", children: [_jsxs(Row, { gap: "xs", wrap: true, className: "justify-center sm:justify-start", children: [_jsx(Heading, { level: 1, variant: "none", className: "text-white mb-0", children: displayName }), isSeller && _jsx(Span, { className: "rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold text-white/90", children: t("roleSeller") })] }), _jsx(Text, { variant: "none", className: "text-white/60 text-sm", children: memberSince })] }), isSeller && storeSlug && (_jsx(Div, { className: "sm:ml-auto", children: _jsxs(Link, { href: String(ROUTES.PUBLIC.STORE_DETAIL(storeSlug)), className: "inline-flex items-center gap-1.5 rounded-full border border-white/30 bg-white/10 hover:bg-white/20 px-4 py-2 text-sm font-medium text-white transition-colors", children: [_jsx(ExternalLink, { className: "w-3.5 h-3.5" }), t("visitStore")] }) }))] }) }) }));
|
|
104
104
|
}
|
|
105
105
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
106
106
|
function renderProfileStatsRow(themed, flex, statItems) {
|
|
107
|
-
return (_jsx("
|
|
107
|
+
return (_jsx(Grid, { gap: "md", className: "grid-cols-2 sm:grid-cols-4", children: statItems.map(({ icon: Icon, label, value }) => (_jsxs(Div, { rounded: "xl", className: `border ${themed.border} ${themed.bgPrimary} p-4 text-center`, children: [_jsx(Row, { centered: true, className: `${flex.center} mb-1`, children: _jsx(Icon, { className: "w-4 h-4 text-neutral-400" }) }), _jsx(Text, { className: "text-lg font-bold", children: value }), _jsx(Text, { variant: "secondary", className: "text-xs", children: label })] }, label))) }));
|
|
108
108
|
}
|
|
109
109
|
function renderProfileBioSection(themed, pub) {
|
|
110
110
|
if (!pub?.bio && !pub?.location && !pub?.website)
|
|
111
111
|
return null;
|
|
112
|
-
return (_jsx(Section, { children: _jsxs("
|
|
112
|
+
return (_jsx(Section, { children: _jsxs(Stack, { gap: "sm", className: `rounded-2xl border ${themed.border} ${themed.bgPrimary} p-6`, children: [pub.bio && _jsx(Text, { className: "text-sm leading-relaxed text-neutral-700 dark:text-zinc-300", children: pub.bio }), _jsxs(Row, { gap: "md", wrap: true, children: [pub.location && _jsxs(Span, { className: "flex items-center gap-1.5 text-sm text-neutral-500 dark:text-zinc-400", children: [_jsx(MapPin, { className: "w-4 h-4" }), pub.location] }), pub.website && _jsxs("a", { href: pub.website, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-1.5 text-sm text-primary hover:underline", children: [_jsx(Globe, { className: "w-4 h-4" }), pub.website.replace(/^https?:\/\//, "")] })] })] }) }));
|
|
113
113
|
}
|
|
114
114
|
function renderStoreDescriptionSection(themed, isSeller, storeSlug, storeDescription, storeName, t) {
|
|
115
115
|
if (!isSeller || !storeSlug || !storeDescription)
|
|
116
116
|
return null;
|
|
117
|
-
return (_jsx(Section, { children: _jsxs("
|
|
117
|
+
return (_jsx(Section, { children: _jsxs(Div, { rounded: "2xl", className: `border ${themed.border} ${themed.bgSecondary} p-6`, children: [_jsx(Heading, { level: 3, className: "mb-2", children: storeName }), _jsx(Text, { variant: "secondary", className: "text-sm leading-relaxed", children: storeDescription }), _jsxs(Link, { href: String(ROUTES.PUBLIC.STORE_DETAIL(storeSlug)), className: "mt-3 inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline", children: [t("visitStore"), " \u2192"] })] }) }));
|
|
118
118
|
}
|
|
119
119
|
function renderProfileListingsSection(t, themed, products, storeSlug) {
|
|
120
|
-
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-4", children: t("listingsTitle") }), products.length === 0 ? (_jsxs("
|
|
120
|
+
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-4", children: t("listingsTitle") }), products.length === 0 ? (_jsxs(Div, { rounded: "2xl", className: `border ${themed.border} ${themed.bgSecondary} p-12 text-center`, children: [_jsx(ShoppingBag, { className: "w-10 h-10 mx-auto mb-3 text-neutral-300 dark:text-neutral-600" }), _jsx(Text, { variant: "secondary", className: "text-sm", children: t("noListings") })] })) : (_jsx(Grid, { gap: "md", className: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-4", children: products.slice(0, 8).map((p) => _jsx(ProductCard, { product: toProductItem(p), href: getProductHref(p) }, p.id)) })), products.length > 8 && storeSlug && (_jsx(Div, { className: "mt-4 text-center", children: _jsx(Link, { href: String(ROUTES.PUBLIC.STORE_PRODUCTS(storeSlug)), className: "text-sm font-medium text-primary hover:underline", children: t("viewAllListings", { count: products.length }) }) }))] }));
|
|
121
121
|
}
|
|
122
122
|
function renderProfileReviewsSection(t, themed, reviews, storeSlug) {
|
|
123
|
-
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-4", children: t("reviewsTitle") }), reviews.length === 0 ? (_jsxs("
|
|
123
|
+
return (_jsxs(Section, { children: [_jsx(Heading, { level: 2, className: "mb-4", children: t("reviewsTitle") }), reviews.length === 0 ? (_jsxs(Div, { rounded: "2xl", className: `border ${themed.border} ${themed.bgSecondary} p-12 text-center`, children: [_jsx(Star, { className: "w-10 h-10 mx-auto mb-3 text-neutral-300 dark:text-neutral-600" }), _jsx(Text, { variant: "secondary", className: "text-sm", children: t("noReviews") })] })) : (_jsx(Grid, { gap: "md", className: "grid-cols-1 sm:grid-cols-2", children: reviews.slice(0, 6).map((review) => _jsx(ReviewCard, { review: review }, review.id)) })), reviews.length > 6 && storeSlug && (_jsx(Div, { className: "mt-4 text-center", children: _jsx(Link, { href: String(ROUTES.PUBLIC.STORE_REVIEWS(storeSlug)), className: "text-sm font-medium text-primary hover:underline", children: t("viewAllReviews", { count: reviews.length }) }) }))] }));
|
|
124
124
|
}
|
|
@@ -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([]);
|
|
@@ -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;
|