@mohasinac/appkit 4.10.0 → 4.11.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/layout/DashboardLayoutClient.d.ts +6 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +4 -1
- package/dist/_internal/client/features/lottery/LotteryPullForm.d.ts +1 -1
- package/dist/_internal/client/features/lottery/LotteryPullForm.js +2 -2
- package/dist/_internal/server/features/admin/daily-digest-actions.d.ts +18 -0
- package/dist/_internal/server/features/admin/daily-digest-actions.js +37 -0
- package/dist/_internal/server/features/audit-log/actions.d.ts +25 -0
- package/dist/_internal/server/features/audit-log/actions.js +38 -0
- package/dist/_internal/server/features/brands/actions.js +0 -2
- package/dist/_internal/server/features/brands/og.d.ts +4 -1
- package/dist/_internal/server/features/brands/og.js +1 -1
- package/dist/_internal/server/features/grouped/data.d.ts +4 -0
- package/dist/_internal/server/features/grouped/data.js +24 -0
- package/dist/_internal/server/features/grouped/index.d.ts +1 -1
- package/dist/_internal/server/features/grouped/index.js +1 -1
- package/dist/_internal/server/features/orders/actions.js +9 -0
- package/dist/_internal/server/features/orders/adapters.js +25 -0
- package/dist/_internal/server/features/products/data.d.ts +2 -2
- package/dist/_internal/server/features/products/data.js +5 -23
- package/dist/_internal/server/functions/scheduled.d.ts +3 -1
- package/dist/_internal/server/functions/scheduled.js +17 -1
- package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +40 -0
- package/dist/_internal/server/jobs/core/dailyStatusDigest.js +164 -0
- package/dist/_internal/server/jobs/core/hardBanCascade.js +11 -0
- package/dist/_internal/server/jobs/core/testerSandboxCleanup.d.ts +1 -0
- package/dist/_internal/server/jobs/core/testerSandboxCleanup.js +4 -1
- package/dist/_internal/server/jobs/core/testerSandboxRefresh.d.ts +12 -0
- package/dist/_internal/server/jobs/core/testerSandboxRefresh.js +85 -0
- package/dist/_internal/server/jobs/core/whatsappNotify.js +16 -0
- package/dist/_internal/server/jobs/handlers/dailyStatusDigest.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/dailyStatusDigest.js +4 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/index.js +3 -0
- package/dist/_internal/server/jobs/handlers/testerSandboxRefresh.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/testerSandboxRefresh.js +2 -0
- package/dist/_internal/server/notifications/channel-health.d.ts +27 -0
- package/dist/_internal/server/notifications/channel-health.js +101 -0
- package/dist/_internal/shared/features/brands/schema.d.ts +0 -6
- package/dist/_internal/shared/features/brands/schema.js +0 -1
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +7 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.js +3 -0
- package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
- package/dist/_internal/shared/features/products/to-product-item.d.ts +25 -0
- package/dist/_internal/shared/features/products/to-product-item.js +45 -0
- package/dist/client.d.ts +21 -6
- package/dist/client.js +13 -3
- package/dist/constants/api-endpoints.d.ts +6 -9
- package/dist/constants/api-endpoints.js +2 -3
- package/dist/contracts/client-auth.d.ts +3 -7
- package/dist/contracts/email.d.ts +1 -0
- package/dist/features/account/components/AddressForm.js +24 -2
- package/dist/features/account/components/BecomeSellerView.d.ts +1 -2
- package/dist/features/account/components/BecomeSellerView.js +1 -1
- package/dist/features/account/components/NotificationBell.js +1 -1
- package/dist/features/account/components/UserBidsView.d.ts +1 -0
- package/dist/features/account/components/UserBidsView.js +47 -0
- package/dist/features/account/components/UserOrdersView.d.ts +4 -11
- package/dist/features/account/components/UserOrdersView.js +54 -4
- package/dist/features/account/components/UserReturnsView.d.ts +4 -9
- package/dist/features/account/components/UserReturnsView.js +37 -3
- package/dist/features/account/components/index.d.ts +3 -2
- package/dist/features/account/components/index.js +1 -0
- package/dist/features/admin/actions/admin-actions.js +22 -0
- package/dist/features/admin/actions/admin-coupon-actions.js +10 -0
- package/dist/features/admin/actions/notification-actions.js +4 -3
- package/dist/features/admin/components/AdminAdsView.d.ts +2 -3
- package/dist/features/admin/components/AdminAdsView.js +86 -89
- package/dist/features/admin/components/AdminAllEventEntriesView.js +18 -3
- package/dist/features/admin/components/AdminAuditLogView.d.ts +11 -0
- package/dist/features/admin/components/AdminAuditLogView.js +95 -0
- package/dist/features/admin/components/AdminBlogEditorView.js +37 -3
- package/dist/features/admin/components/AdminBrandEditorView.js +10 -6
- package/dist/features/admin/components/AdminBundleEditorView.js +18 -2
- package/dist/features/admin/components/AdminCarouselEditorView.js +2 -2
- package/dist/features/admin/components/AdminCarouselGroupEditorView.js +2 -2
- package/dist/features/admin/components/AdminCartsView.js +34 -4
- package/dist/features/admin/components/AdminCategoryEditorView.js +5 -4
- package/dist/features/admin/components/AdminCouponEditorView.js +2 -2
- package/dist/features/admin/components/AdminFaqEditorView.js +2 -2
- package/dist/features/admin/components/AdminHistoryView.js +11 -1
- package/dist/features/admin/components/AdminNotificationsView.js +27 -1
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +10 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +4 -3
- package/dist/features/admin/components/AdminOrdersView.js +92 -24
- package/dist/features/admin/components/AdminPayoutMarkPaidModal.d.ts +7 -0
- package/dist/features/admin/components/AdminPayoutMarkPaidModal.js +47 -0
- package/dist/features/admin/components/AdminPayoutsView.js +15 -31
- package/dist/features/admin/components/AdminProductEditorView.js +26 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +20 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +22 -2
- package/dist/features/admin/components/AdminStoresView.js +7 -0
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +2 -2
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +2 -2
- package/dist/features/admin/components/AdminUserEditorView.d.ts +2 -2
- package/dist/features/admin/components/AdminUserEditorView.js +4 -2
- package/dist/features/admin/components/AdminUsersView.js +1 -1
- package/dist/features/admin/components/AdminWishlistsView.js +14 -1
- package/dist/features/admin/components/DataListingView.d.ts +2 -2
- package/dist/features/admin/components/ViewAuditLogEntryModal.d.ts +19 -0
- package/dist/features/admin/components/ViewAuditLogEntryModal.js +22 -0
- package/dist/features/admin/components/ViewNotificationModal.d.ts +21 -0
- package/dist/features/admin/components/ViewNotificationModal.js +15 -0
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.d.ts +4 -7
- package/dist/features/admin/components/analytics/AdminPageViewsReportView.js +56 -36
- package/dist/features/admin/components/index.d.ts +8 -1
- package/dist/features/admin/components/index.js +4 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +49 -0
- package/dist/features/admin/constants/filter-tabs.js +27 -0
- package/dist/features/admin/hooks/useAdminListing.d.ts +6 -0
- package/dist/features/admin/hooks/useAdminListing.js +3 -1
- package/dist/features/admin/hooks/useAdminListingData.d.ts +9 -1
- package/dist/features/admin/hooks/useAdminListingData.js +9 -2
- package/dist/features/admin/repository/site-settings.repository.d.ts +5 -0
- package/dist/features/admin/schemas/firestore.d.ts +12 -0
- package/dist/features/analytics/types.d.ts +1 -1
- package/dist/features/analytics/types.js +8 -0
- package/dist/features/auctions/schemas/index.d.ts +5 -0
- package/dist/features/audit-log/repository/audit-log.repository.d.ts +45 -0
- package/dist/features/audit-log/repository/audit-log.repository.js +30 -0
- package/dist/features/audit-log/schemas/firestore.d.ts +59 -0
- package/dist/features/audit-log/schemas/firestore.js +35 -0
- package/dist/features/auth/actions/index.d.ts +0 -1
- package/dist/features/auth/actions/index.js +0 -1
- package/dist/features/auth/hooks/useAuth.d.ts +8 -35
- package/dist/features/auth/hooks/useAuth.js +21 -37
- package/dist/features/auth/permissions/constants.d.ts +1 -1
- package/dist/features/auth/permissions/constants.js +2 -0
- package/dist/features/blog/schemas/index.d.ts +32 -0
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +31 -3
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +2 -1
- package/dist/features/categories/components/BrandDetailPageView.js +14 -12
- package/dist/features/categories/components/CategoryDetailPageView.js +7 -3
- package/dist/features/categories/components/CategoryHighlightsAndFaqSection.d.ts +14 -0
- package/dist/features/categories/components/CategoryHighlightsAndFaqSection.js +22 -0
- package/dist/features/categories/components/CategoryProductsView.d.ts +1 -5
- package/dist/features/categories/components/CategoryProductsView.js +1 -1
- package/dist/features/categories/components/CategorySelectorCreate.js +16 -2
- package/dist/features/categories/schemas/firestore.d.ts +19 -2
- package/dist/features/categories/schemas/index.d.ts +24 -3
- package/dist/features/categories/schemas/index.js +3 -1
- package/dist/features/categories/types/index.d.ts +7 -0
- package/dist/features/checkout/actions/checkout-value-otp-actions.d.ts +17 -3
- package/dist/features/checkout/actions/checkout-value-otp-actions.js +101 -22
- package/dist/features/contact/components/ContactForm.js +17 -4
- package/dist/features/contact/email.d.ts +1 -0
- package/dist/features/contact/email.js +3 -0
- package/dist/features/events/components/AdminEventEditorView.js +54 -2
- package/dist/features/events/components/AdminEventEntriesView.d.ts +2 -16
- package/dist/features/events/components/AdminEventEntriesView.js +56 -89
- package/dist/features/events/components/EventFormDrawer.js +5 -1
- package/dist/features/events/components/EventRaffleEntryForm.d.ts +1 -3
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -1
- package/dist/features/events/schemas/index.d.ts +22 -0
- package/dist/features/grouped/components/GroupedListingsCarousel.js +4 -1
- package/dist/features/grouped/repository/grouped-listings.repository.d.ts +4 -0
- package/dist/features/grouped/repository/grouped-listings.repository.js +18 -0
- package/dist/features/homepage/components/CharacterHotspotForm.js +202 -187
- package/dist/features/homepage/components/SectionCarousel.d.ts +1 -7
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/layout/TitleBarLayout.d.ts +1 -1
- package/dist/features/layout/TitleBarLayout.js +3 -3
- package/dist/features/media/MediaImage.js +39 -3
- package/dist/features/media/types/index.d.ts +10 -0
- package/dist/features/media/types/index.js +1 -0
- package/dist/features/media/upload/MediaUploadField.d.ts +7 -1
- package/dist/features/media/upload/MediaUploadField.js +11 -7
- package/dist/features/media/upload/video-poster.d.ts +2 -0
- package/dist/features/media/upload/video-poster.js +16 -1
- package/dist/features/media/upload/video-poster.test.js +1 -1
- package/dist/features/orders/components/OrderStatusTimeline.d.ts +12 -0
- package/dist/features/orders/components/OrderStatusTimeline.js +55 -0
- package/dist/features/orders/components/index.d.ts +2 -0
- package/dist/features/orders/components/index.js +1 -0
- package/dist/features/orders/constants/payment-window.d.ts +25 -0
- package/dist/features/orders/constants/payment-window.js +25 -0
- package/dist/features/orders/repository/orders.repository.d.ts +32 -0
- package/dist/features/orders/repository/orders.repository.js +56 -0
- package/dist/features/orders/schemas/index.d.ts +24 -24
- package/dist/features/orders/types/index.d.ts +33 -0
- package/dist/features/pre-orders/schemas/index.d.ts +5 -0
- package/dist/features/products/components/BidHistory.js +9 -1
- package/dist/features/products/components/GroupSettingsPanel.js +25 -3
- package/dist/features/products/components/PrizeDrawDetailPageView.js +1 -1
- package/dist/features/products/components/PrizeDrawEntryActions.d.ts +1 -4
- package/dist/features/products/components/PrizeDrawEntryActions.js +1 -1
- package/dist/features/products/components/ProductDetailActions.d.ts +1 -2
- package/dist/features/products/components/ProductDetailActions.js +1 -1
- package/dist/features/products/components/ProductGrid.js +15 -1
- package/dist/features/products/constants/action-defs.d.ts +1 -0
- package/dist/features/products/constants/action-defs.js +1 -0
- package/dist/features/products/schemas/index.d.ts +5 -0
- package/dist/features/promotions/components/CouponsIndexListing.d.ts +1 -3
- package/dist/features/promotions/components/CouponsIndexListing.js +1 -1
- package/dist/features/search/components/SearchView.d.ts +1 -3
- package/dist/features/search/components/SearchView.js +1 -1
- package/dist/features/seller/components/QuickProductForm.js +2 -1
- package/dist/features/seller/components/SellerBidsView.js +66 -107
- package/dist/features/seller/components/SellerGoogleReviewsView.js +17 -1
- package/dist/features/seller/components/SellerOrdersView.d.ts +15 -3
- package/dist/features/seller/components/SellerOrdersView.js +134 -163
- package/dist/features/seller/components/SellerPayoutMethodsView.js +60 -48
- package/dist/features/seller/components/SellerPayoutSettingsView.js +69 -4
- package/dist/features/seller/components/SellerPayoutsView.d.ts +12 -0
- package/dist/features/seller/components/SellerPayoutsView.js +25 -5
- package/dist/features/seller/components/SellerProductShell.d.ts +10 -3
- package/dist/features/seller/components/SellerProductShell.js +89 -36
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +2 -7
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +4 -4
- package/dist/features/seller/components/SellerProductsView.d.ts +2 -4
- package/dist/features/seller/components/SellerProductsView.js +131 -189
- package/dist/features/seller/components/SellerReviewsView.js +95 -133
- package/dist/features/seller/components/SellerShippingConfigsView.js +47 -67
- package/dist/features/seller/components/SellerShippingView.js +41 -4
- package/dist/features/seller/components/SellerStoreCategoriesView.js +51 -59
- package/dist/features/seller/components/SellerStorefrontView.d.ts +6 -1
- package/dist/features/seller/components/SellerStorefrontView.js +42 -5
- package/dist/features/seller/components/index.d.ts +2 -2
- package/dist/features/seller/components/index.js +2 -2
- package/dist/features/shell/FormShell.d.ts +24 -4
- package/dist/features/shell/FormShell.js +12 -6
- package/dist/features/shell/QuickFormDrawer.js +67 -12
- package/dist/features/shell/StepForm.d.ts +30 -1
- package/dist/features/shell/StepForm.js +47 -4
- package/dist/features/shell/index.d.ts +1 -1
- package/dist/features/shell/index.js +1 -1
- package/dist/features/shipments/components/AdminShipmentEditorView.js +2 -2
- package/dist/features/shipments/schemas/validation.d.ts +14 -4
- package/dist/features/tester/components/AdminTesterFeedbackListView.js +23 -2
- package/dist/features/tester/components/TesterChecklistStepRow.js +1 -1
- package/dist/features/tester/components/TesterHubView.js +3 -2
- package/dist/features/tester/seed-data/orders-tester-seed-data.js +9 -1
- package/dist/features/tester/seed-data/products-tester-seed-data.js +43 -32
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +404 -15
- package/dist/index.d.ts +15 -3
- package/dist/index.js +22 -5
- package/dist/next/routing/route-map.d.ts +11 -0
- package/dist/next/routing/route-map.js +5 -0
- package/dist/providers/email-resend/provider.js +1 -0
- package/dist/providers/firebase-client/auth.d.ts +1 -0
- package/dist/providers/firebase-client/auth.js +7 -1
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.js +1 -0
- package/dist/schemas/registry.d.ts +61 -25
- package/dist/security/pii-mask.js +1 -1
- package/dist/seed/categories-seed-data.js +69 -0
- package/dist/seed/products-auctions-seed-data.js +11 -0
- package/dist/seed/products-standard-seed-data.js +93 -4
- package/dist/seed/site-settings-seed-data.js +13 -1
- package/dist/seed/store-extensions-seed-data.js +1 -1
- package/dist/server-entry.d.ts +2 -1
- package/dist/server-entry.js +20 -2
- package/dist/server.d.ts +7 -2
- package/dist/server.js +8 -3
- package/dist/styles.css +1 -1
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Form.d.ts +11 -2
- package/dist/ui/components/Form.js +4 -3
- package/dist/ui/components/FormField.d.ts +3 -1
- package/dist/ui/components/FormField.js +22 -4
- package/dist/ui/components/ListingLayout.d.ts +1 -2
- package/dist/ui/components/ListingLayout.js +1 -1
- package/dist/ui/components/RecordDetailModal.d.ts +68 -0
- package/dist/ui/components/RecordDetailModal.js +8 -0
- package/dist/ui/components/SlottedListingView.js +9 -1
- package/dist/ui/forms/FormErrorSummary.d.ts +25 -0
- package/dist/ui/forms/FormErrorSummary.js +37 -0
- package/dist/ui/forms/FormShell.d.ts +37 -2
- package/dist/ui/forms/FormShell.js +37 -7
- package/dist/ui/forms/FormShell.style.css +17 -0
- package/dist/ui/forms/index.d.ts +2 -0
- package/dist/ui/forms/index.js +1 -0
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.js +5 -0
- package/dist/utils/media-url.d.ts +3 -1
- package/dist/utils/media-url.js +20 -1
- package/dist/validation/schemas.d.ts +4 -4
- package/package.json +1 -1
- package/dist/_internal/client/features/classified/ClassifiedDetailView.d.ts +0 -9
- package/dist/_internal/client/features/classified/ClassifiedDetailView.js +0 -55
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.d.ts +0 -18
- package/dist/_internal/client/features/digital-code/DigitalCodeDetailView.js +0 -21
- package/dist/_internal/client/features/live/LiveItemDetailView.d.ts +0 -9
- package/dist/_internal/client/features/live/LiveItemDetailView.js +0 -25
- package/dist/_internal/server/jobs/core/prizeRevealClose.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +0 -28
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +0 -61
- package/dist/_internal/server/jobs/core/prizeRevealOpen.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +0 -68
- package/dist/_internal/server/jobs/core/prizeRevealReminder.d.ts +0 -2
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +0 -49
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +0 -2
- package/dist/features/auth/consent-otp.d.ts +0 -57
- package/dist/features/auth/consent-otp.js +0 -127
- package/dist/features/cart/components/CheckoutOtpModal.d.ts +0 -15
- package/dist/features/cart/components/CheckoutOtpModal.js +0 -12
- package/dist/features/checkout/actions/checkout-actions.d.ts +0 -31
- package/dist/features/checkout/actions/checkout-actions.js +0 -124
- package/dist/features/classified/components/ClassifiedIndexListing.d.ts +0 -5
- package/dist/features/classified/components/ClassifiedIndexListing.js +0 -123
- package/dist/features/classified/components/ClassifiedListView.d.ts +0 -6
- package/dist/features/classified/components/ClassifiedListView.js +0 -44
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.d.ts +0 -5
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +0 -114
- package/dist/features/digital-codes/components/DigitalCodesListView.d.ts +0 -6
- package/dist/features/digital-codes/components/DigitalCodesListView.js +0 -38
- package/dist/features/live/components/LiveItemsIndexListing.d.ts +0 -5
- package/dist/features/live/components/LiveItemsIndexListing.js +0 -115
- package/dist/features/live/components/LiveItemsListView.d.ts +0 -6
- package/dist/features/live/components/LiveItemsListView.js +0 -44
- package/dist/features/seller/components/SellerTemplatesView.d.ts +0 -12
- package/dist/features/seller/components/SellerTemplatesView.js +0 -276
- package/dist/react/hooks/useVisibleItems.d.ts +0 -37
- package/dist/react/hooks/useVisibleItems.js +0 -59
- package/dist/ui/components/TabStrip.d.ts +0 -34
- package/dist/ui/components/TabStrip.js +0 -56
- package/dist/ui/components/TabStrip.style.css +0 -97
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useApiMutation } from "@mohasinac/appkit/client";
|
|
3
|
+
import { useApiMutation, sieveFilter, SIEVE_OP, sortBy } from "@mohasinac/appkit/client";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import { Alert, Button, Div, Input, Row, Select, Stack,
|
|
6
|
+
import { Alert, Button, Div, Input, Row, Select, Stack, Text, useToast } from "../../../ui";
|
|
7
7
|
import { apiClient } from "../../../http";
|
|
8
8
|
import { normalizeError } from "../../../errors/normalize";
|
|
9
9
|
import { ACTIONS } from "../../../_internal/shared/actions/action-registry";
|
|
10
|
-
import {
|
|
10
|
+
import { DataListingView } from "../../admin/components/DataListingView";
|
|
11
11
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
12
|
-
const __P = {
|
|
13
|
-
p4: "p-[var(--appkit-space-4)]",
|
|
14
|
-
};
|
|
15
12
|
const CLS_RESPONSE_TEXT = "whitespace-pre-wrap break-words";
|
|
16
13
|
const REVIEW_STATUS_OPTIONS = [
|
|
17
14
|
{ label: "All", value: "all" },
|
|
@@ -19,13 +16,9 @@ const REVIEW_STATUS_OPTIONS = [
|
|
|
19
16
|
{ label: "Approved", value: "approved" },
|
|
20
17
|
{ label: "Flagged", value: "flagged" },
|
|
21
18
|
];
|
|
22
|
-
export function AdminEventEntriesView({ eventId, entriesEndpoint, entryReviewEndpoint, statsEndpoint,
|
|
19
|
+
export function AdminEventEntriesView({ eventId, entriesEndpoint, entryReviewEndpoint, statsEndpoint, }) {
|
|
23
20
|
const queryClient = useQueryClient();
|
|
24
21
|
const { showToast } = useToast();
|
|
25
|
-
const [page, setPage] = React.useState(1);
|
|
26
|
-
const [pageSize] = React.useState(20);
|
|
27
|
-
const [statusFilter, setStatusFilter] = React.useState("all");
|
|
28
|
-
const [searchQuery, setSearchQuery] = React.useState("");
|
|
29
22
|
const resolvedEntriesEndpoint = React.useMemo(() => {
|
|
30
23
|
if (!eventId)
|
|
31
24
|
return "";
|
|
@@ -36,29 +29,6 @@ export function AdminEventEntriesView({ eventId, entriesEndpoint, entryReviewEnd
|
|
|
36
29
|
return "";
|
|
37
30
|
return statsEndpoint?.(eventId) ?? ADMIN_ENDPOINTS.EVENT_STATS(eventId);
|
|
38
31
|
}, [eventId, statsEndpoint]);
|
|
39
|
-
const entriesQuery = useQuery({
|
|
40
|
-
queryKey: [
|
|
41
|
-
"admin-event-entries",
|
|
42
|
-
eventId,
|
|
43
|
-
resolvedEntriesEndpoint,
|
|
44
|
-
page,
|
|
45
|
-
pageSize,
|
|
46
|
-
statusFilter,
|
|
47
|
-
searchQuery,
|
|
48
|
-
],
|
|
49
|
-
queryFn: () => {
|
|
50
|
-
const sp = new URLSearchParams();
|
|
51
|
-
sp.set("page", String(page));
|
|
52
|
-
sp.set("pageSize", String(pageSize));
|
|
53
|
-
if (statusFilter !== "all")
|
|
54
|
-
sp.set("reviewStatus", statusFilter);
|
|
55
|
-
if (searchQuery.trim())
|
|
56
|
-
sp.set("q", searchQuery.trim());
|
|
57
|
-
return apiClient.get(`${resolvedEntriesEndpoint}?${sp.toString()}`);
|
|
58
|
-
},
|
|
59
|
-
enabled: Boolean(eventId && resolvedEntriesEndpoint),
|
|
60
|
-
staleTime: 15000,
|
|
61
|
-
});
|
|
62
32
|
const statsQuery = useQuery({
|
|
63
33
|
queryKey: ["admin-event-stats", eventId, resolvedStatsEndpoint],
|
|
64
34
|
queryFn: () => apiClient.get(resolvedStatsEndpoint),
|
|
@@ -95,8 +65,31 @@ export function AdminEventEntriesView({ eventId, entriesEndpoint, entryReviewEnd
|
|
|
95
65
|
await queryClient.invalidateQueries({ queryKey: ["admin-event-entries", eventId] });
|
|
96
66
|
},
|
|
97
67
|
});
|
|
98
|
-
const
|
|
99
|
-
|
|
68
|
+
const handleExportReport = async () => {
|
|
69
|
+
if (!eventId)
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
const blob = await apiClient.blob(ADMIN_ENDPOINTS.EVENT_ENTRIES_EXPORT(eventId));
|
|
73
|
+
const url = URL.createObjectURL(blob);
|
|
74
|
+
const a = document.createElement("a");
|
|
75
|
+
a.href = url;
|
|
76
|
+
a.download = `event-entries-${eventId}-${new Date().toISOString().slice(0, 10)}.md`;
|
|
77
|
+
a.click();
|
|
78
|
+
URL.revokeObjectURL(url);
|
|
79
|
+
}
|
|
80
|
+
catch (_err) {
|
|
81
|
+
void normalizeError(_err);
|
|
82
|
+
showToast("Report export failed.", "error");
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const pollOptionLabels = React.useMemo(() => {
|
|
86
|
+
const map = new Map();
|
|
87
|
+
for (const opt of statsQuery.data?.event?.pollConfig?.options ?? []) {
|
|
88
|
+
map.set(opt.id, opt.label);
|
|
89
|
+
}
|
|
90
|
+
return map;
|
|
91
|
+
}, [statsQuery.data]);
|
|
92
|
+
const columns = [
|
|
100
93
|
{
|
|
101
94
|
key: "submittedAt",
|
|
102
95
|
header: "Submitted",
|
|
@@ -115,7 +108,7 @@ export function AdminEventEntriesView({ eventId, entriesEndpoint, entryReviewEnd
|
|
|
115
108
|
{
|
|
116
109
|
key: "points",
|
|
117
110
|
header: "Points",
|
|
118
|
-
render: (row) => (_jsxs(Row, { gap: "xs",
|
|
111
|
+
render: (row) => (_jsxs(Row, { gap: "xs", align: "center", children: [_jsx(Input, { bare: true, type: "number", min: 0, className: "w-20", placeholder: "0", value: pointsInputs[row.id] ?? (row.points !== undefined ? String(row.points) : ""), onChange: (e) => setPointsInputs((prev) => ({ ...prev, [row.id]: e.target.value })) }), _jsx(Button, { size: "sm", variant: "outline", disabled: pointsMutation.isPending || !(row.id in pointsInputs), onClick: () => {
|
|
119
112
|
const val = Number(pointsInputs[row.id]);
|
|
120
113
|
if (!isNaN(val)) {
|
|
121
114
|
pointsMutation.mutate({ entryId: row.id, points: val, currentStatus: row.reviewStatus });
|
|
@@ -126,58 +119,32 @@ export function AdminEventEntriesView({ eventId, entriesEndpoint, entryReviewEnd
|
|
|
126
119
|
{
|
|
127
120
|
key: "actions",
|
|
128
121
|
header: "Actions",
|
|
129
|
-
render: (row) =>
|
|
130
|
-
|
|
122
|
+
render: (row) => {
|
|
123
|
+
const hasFormResponses = Boolean(row.formResponses && Object.keys(row.formResponses).length > 0);
|
|
124
|
+
const hasPollVotes = Boolean(row.pollVotes && row.pollVotes.length > 0);
|
|
125
|
+
const isExpanded = expandedEntryId === row.id;
|
|
126
|
+
return (_jsxs(Stack, { gap: "sm", children: [_jsxs(Row, { align: "center", gap: "sm", wrap: true, children: [_jsx(Button, { size: "sm", variant: "secondary", disabled: reviewMutation.isPending || row.reviewStatus === "approved", onClick: () => reviewMutation.mutate({ entryId: row.id, status: "approved" }), children: "Approve" }), _jsx(Button, { size: "sm", variant: "outline", disabled: reviewMutation.isPending || row.reviewStatus === "flagged", onClick: () => reviewMutation.mutate({ entryId: row.id, status: "flagged" }), children: "Flag" }), (hasFormResponses || hasPollVotes) && (_jsx(Button, { size: "sm", variant: "outline", onClick: () => setExpandedEntryId((prev) => (prev === row.id ? null : row.id)), children: isExpanded ? "Hide" : "Responses" }))] }), isExpanded && (hasFormResponses || hasPollVotes) && (_jsxs(Stack, { className: "p-[var(--appkit-space-3)]", gap: "3", rounded: "xl", surface: "muted", border: "default", children: [hasPollVotes && (_jsxs(Stack, { gap: "sm", children: [_jsx(Text, { size: "xs", weight: "medium", color: "muted", children: "Poll votes" }), _jsx(Text, { className: CLS_RESPONSE_TEXT, color: "primary", size: "sm", children: row.pollVotes.map((id) => pollOptionLabels.get(id) ?? id).join(", ") }), row.pollComment && (_jsxs(_Fragment, { children: [_jsx(Text, { size: "xs", weight: "medium", color: "muted", children: "Comment" }), _jsx(Text, { className: CLS_RESPONSE_TEXT, color: "primary", size: "sm", children: row.pollComment })] }))] })), hasFormResponses && (_jsx(Stack, { gap: "sm", children: Object.entries(row.formResponses).map(([key, value]) => (_jsxs(Stack, { gap: "none", children: [_jsx(Text, { size: "xs", weight: "medium", color: "muted", children: key }), _jsx(Text, { className: CLS_RESPONSE_TEXT, color: "primary", size: "sm", children: Array.isArray(value) ? value.join(", ") : String(value ?? "—") })] }, key))) }))] }))] }));
|
|
127
|
+
},
|
|
131
128
|
},
|
|
132
|
-
]
|
|
133
|
-
const handleExportReport = async () => {
|
|
134
|
-
if (!eventId)
|
|
135
|
-
return;
|
|
136
|
-
try {
|
|
137
|
-
const blob = await apiClient.blob(ADMIN_ENDPOINTS.EVENT_ENTRIES_EXPORT(eventId));
|
|
138
|
-
const url = URL.createObjectURL(blob);
|
|
139
|
-
const a = document.createElement("a");
|
|
140
|
-
a.href = url;
|
|
141
|
-
a.download = `event-entries-${eventId}-${new Date().toISOString().slice(0, 10)}.md`;
|
|
142
|
-
a.click();
|
|
143
|
-
URL.revokeObjectURL(url);
|
|
144
|
-
}
|
|
145
|
-
catch (_err) {
|
|
146
|
-
void normalizeError(_err);
|
|
147
|
-
showToast("Report export failed.", "error");
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
const exportSection = eventId ? (_jsx(Row, { justify: "end", children: _jsx(Button, { variant: "ghost", action: ACTIONS.ADMIN["export-event-entries"], onClick: handleExportReport }) })) : null;
|
|
151
|
-
const statsSection = (_jsxs(Div, { layout: "grid", gap: "3", className: "grid-cols-1 sm:grid-cols-3", children: [_jsx(Alert, { variant: "info", title: "Total entries", children: String(statsQuery.data?.stats?.totalEntries ?? 0) }), _jsx(Alert, { variant: "success", title: "Approved", children: String(statsQuery.data?.stats?.approvedEntries ?? 0) }), _jsx(Alert, { variant: "warning", title: "Flagged", children: String(statsQuery.data?.stats?.flaggedEntries ?? 0) })] }));
|
|
152
|
-
const filtersSection = (_jsxs(Div, { layout: "grid", gap: "3", className: "grid-cols-1 md:grid-cols-3", children: [_jsx(Input, { label: "Search entries", value: searchQuery, onChange: (event) => {
|
|
153
|
-
setPage(1);
|
|
154
|
-
setSearchQuery(event.target.value);
|
|
155
|
-
}, placeholder: "Search by user, email, or id" }), _jsx(Select, { label: "Review status", value: statusFilter, options: REVIEW_STATUS_OPTIONS, onChange: (event) => {
|
|
156
|
-
setPage(1);
|
|
157
|
-
setStatusFilter(event.target.value);
|
|
158
|
-
} })] }));
|
|
159
|
-
const pollOptionLabels = React.useMemo(() => {
|
|
160
|
-
const map = new Map();
|
|
161
|
-
for (const opt of statsQuery.data?.event?.pollConfig?.options ?? []) {
|
|
162
|
-
map.set(opt.id, opt.label);
|
|
163
|
-
}
|
|
164
|
-
return map;
|
|
165
|
-
}, [statsQuery.data]);
|
|
166
|
-
const expandedEntry = expandedEntryId ? rows.find((r) => r.id === expandedEntryId) : null;
|
|
167
|
-
const expandedHasFormResponses = Boolean(expandedEntry?.formResponses && Object.keys(expandedEntry.formResponses).length > 0);
|
|
168
|
-
const expandedHasPollVotes = Boolean(expandedEntry?.pollVotes && expandedEntry.pollVotes.length > 0);
|
|
169
|
-
const responsesPanelSection = expandedEntry && (expandedHasFormResponses || expandedHasPollVotes) ? (_jsxs(Stack, { className: `${__P.p4}`, gap: "3", rounded: "xl", surface: "muted", border: "default", children: [_jsxs(Text, { size: "sm", weight: "semibold", color: "primary", children: ["Responses \u2014 ", expandedEntry.userDisplayName || expandedEntry.userId || "Anonymous"] }), expandedHasPollVotes && (_jsxs(Stack, { gap: "sm", children: [_jsx(Text, { size: "xs", weight: "medium", color: "muted", children: "Poll votes" }), _jsx(Text, { className: CLS_RESPONSE_TEXT, color: "primary", size: "sm", children: expandedEntry.pollVotes.map((id) => pollOptionLabels.get(id) ?? id).join(", ") }), expandedEntry.pollComment && (_jsxs(_Fragment, { children: [_jsx(Text, { size: "xs", weight: "medium", color: "muted", children: "Comment" }), _jsx(Text, { className: CLS_RESPONSE_TEXT, color: "primary", size: "sm", children: expandedEntry.pollComment })] }))] })), expandedHasFormResponses && (_jsx(Stack, { gap: "sm", children: Object.entries(expandedEntry.formResponses).map(([key, value]) => (_jsxs(Stack, { gap: "none", className: "", children: [_jsx(Text, { size: "xs", weight: "medium", color: "muted", children: key }), _jsx(Text, { className: CLS_RESPONSE_TEXT, color: "primary", size: "sm", children: Array.isArray(value) ? value.join(", ") : String(value ?? "—") })] }, key))) }))] })) : null;
|
|
170
|
-
const tableSection = (_jsx(DataTable, { columns: columns, rows: rows, isLoading: entriesQuery.isLoading, currentPage: entriesQuery.data?.page ?? page, totalPages: entriesQuery.data?.totalPages ?? 1, onPageChange: setPage, emptyLabel: "No entries found" }));
|
|
129
|
+
];
|
|
171
130
|
const eventTitle = statsQuery.data?.event?.title;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
131
|
+
const config = {
|
|
132
|
+
portal: "admin",
|
|
133
|
+
title: eventTitle ? `${eventTitle} Entries` : "Event Entries",
|
|
134
|
+
searchPlaceholder: "Search by user, email, or id",
|
|
135
|
+
emptyLabel: "No entries found",
|
|
136
|
+
filterKeys: ["reviewStatus"],
|
|
137
|
+
defaultSort: sortBy("submittedAt", "DESC"),
|
|
138
|
+
queryKey: ["admin-event-entries", eventId, resolvedEntriesEndpoint],
|
|
139
|
+
endpoint: resolvedEntriesEndpoint,
|
|
140
|
+
sortOptions: [{ value: sortBy("submittedAt", "DESC"), label: "Most recent" }],
|
|
141
|
+
columns,
|
|
142
|
+
mapRows: (response) => response.items ?? [],
|
|
143
|
+
getTotal: (response) => response.total ?? (response.items ?? []).length,
|
|
144
|
+
buildFilters: (state) => state.reviewStatus ? sieveFilter("reviewStatus", SIEVE_OP.EQ, state.reviewStatus) : undefined,
|
|
145
|
+
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(Select, { label: "Review status", value: pendingFilters.reviewStatus || "all", options: REVIEW_STATUS_OPTIONS, onChange: (e) => setPendingFilters((p) => ({ ...p, reviewStatus: e.target.value === "all" ? "" : e.target.value })) })),
|
|
146
|
+
toolbarExtra: eventId ? (_jsx(Button, { variant: "ghost", action: ACTIONS.ADMIN["export-event-entries"], onClick: handleExportReport })) : undefined,
|
|
147
|
+
renderAboveContent: () => (_jsxs(Stack, { gap: "3", className: "px-[var(--appkit-space-3)] pb-[var(--appkit-space-2)]", children: [!eventId ? (_jsx(Alert, { variant: "warning", title: "Missing event id", children: "Event id is required to load entries." })) : null, statsQuery.error ? (_jsx(Alert, { variant: "error", title: "Could not load event stats", children: statsQuery.error instanceof Error ? statsQuery.error.message : "Unknown error" })) : null, _jsxs(Div, { layout: "grid", gap: "3", className: "grid-cols-1 sm:grid-cols-3", children: [_jsx(Alert, { variant: "info", title: "Total entries", children: String(statsQuery.data?.stats?.totalEntries ?? 0) }), _jsx(Alert, { variant: "success", title: "Approved", children: String(statsQuery.data?.stats?.approvedEntries ?? 0) }), _jsx(Alert, { variant: "warning", title: "Flagged", children: String(statsQuery.data?.stats?.flaggedEntries ?? 0) })] })] })),
|
|
148
|
+
};
|
|
149
|
+
return _jsx(DataListingView, { config: config });
|
|
183
150
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Stack } from "../../../ui";
|
|
3
|
-
export function EventFormDrawer({ isOpen,
|
|
3
|
+
export function EventFormDrawer({ isOpen,
|
|
4
|
+
// audit-dead-underscore-prop-ok: required for the public contract (callers'
|
|
5
|
+
// own renderHeader/renderFooter closures already have onClose in scope to
|
|
6
|
+
// wire a close button); this shell renders slots only, no default chrome.
|
|
7
|
+
onClose: _onClose, renderHeader, renderBaseFields, renderMediaFields, renderTypeConfig, renderTypeSelector, renderFooter, className = "", }) {
|
|
4
8
|
if (!isOpen)
|
|
5
9
|
return null;
|
|
6
10
|
return (_jsxs(Stack, { className: `${className}`, gap: "lg", children: [renderHeader?.(), renderTypeSelector?.(), renderBaseFields?.(), renderMediaFields?.(), renderTypeConfig?.(), renderFooter?.()] }));
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface EventRaffleEntryFormProps {
|
|
3
|
-
/** Event id used for the entry POST. */
|
|
4
|
-
eventId: string;
|
|
5
3
|
/** Raffle prize label rendered prominently above the form. */
|
|
6
4
|
prizeLabel?: string;
|
|
7
5
|
/** Raffle type — drives the helper copy. */
|
|
@@ -23,4 +21,4 @@ export interface EventRaffleEntryFormProps {
|
|
|
23
21
|
* eligibility status, an optional message field, and a submit button. Server
|
|
24
22
|
* action wiring stays with the caller via the `onSubmit` prop.
|
|
25
23
|
*/
|
|
26
|
-
export declare function EventRaffleEntryForm({
|
|
24
|
+
export declare function EventRaffleEntryForm({ prizeLabel, raffleType, topN, userEntryCount, maxEntriesPerUser, submitted, onSubmit, }: EventRaffleEntryFormProps): React.JSX.Element;
|
|
@@ -15,7 +15,7 @@ const __P = {
|
|
|
15
15
|
* eligibility status, an optional message field, and a submit button. Server
|
|
16
16
|
* action wiring stays with the caller via the `onSubmit` prop.
|
|
17
17
|
*/
|
|
18
|
-
export function EventRaffleEntryForm({
|
|
18
|
+
export function EventRaffleEntryForm({ prizeLabel, raffleType = "open_raffle", topN, userEntryCount = 0, maxEntriesPerUser = 1, submitted = false, onSubmit, }) {
|
|
19
19
|
const [message, setMessage] = useState("");
|
|
20
20
|
const [busy, setBusy] = useState(false);
|
|
21
21
|
const overLimit = userEntryCount >= maxEntriesPerUser;
|
|
@@ -450,6 +450,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
450
450
|
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
451
451
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
452
452
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
453
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
453
454
|
}, "strip", z.ZodTypeAny, {
|
|
454
455
|
type: "video" | "image" | "file";
|
|
455
456
|
url: string;
|
|
@@ -457,6 +458,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
457
458
|
alt?: string | undefined;
|
|
458
459
|
thumbnailUrl?: string | undefined;
|
|
459
460
|
youtubeId?: string | undefined;
|
|
461
|
+
duration?: number | undefined;
|
|
460
462
|
}, {
|
|
461
463
|
type: "video" | "image" | "file";
|
|
462
464
|
url: string;
|
|
@@ -464,6 +466,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
464
466
|
alt?: string | undefined;
|
|
465
467
|
thumbnailUrl?: string | undefined;
|
|
466
468
|
youtubeId?: string | undefined;
|
|
469
|
+
duration?: number | undefined;
|
|
467
470
|
}>, z.ZodEffects<z.ZodString, {
|
|
468
471
|
url: string;
|
|
469
472
|
type: "image";
|
|
@@ -474,6 +477,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
474
477
|
alt?: string | undefined;
|
|
475
478
|
thumbnailUrl?: string | undefined;
|
|
476
479
|
youtubeId?: string | undefined;
|
|
480
|
+
duration?: number | undefined;
|
|
477
481
|
} | {
|
|
478
482
|
url: string;
|
|
479
483
|
type: "image";
|
|
@@ -484,6 +488,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
484
488
|
alt?: string | undefined;
|
|
485
489
|
thumbnailUrl?: string | undefined;
|
|
486
490
|
youtubeId?: string | undefined;
|
|
491
|
+
duration?: number | undefined;
|
|
487
492
|
} | null | undefined>;
|
|
488
493
|
coverImageUrl: z.ZodOptional<z.ZodString>;
|
|
489
494
|
eventImages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -493,6 +498,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
493
498
|
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
494
499
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
495
500
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
501
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
496
502
|
}, "strip", z.ZodTypeAny, {
|
|
497
503
|
type: "video" | "image" | "file";
|
|
498
504
|
url: string;
|
|
@@ -500,6 +506,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
500
506
|
alt?: string | undefined;
|
|
501
507
|
thumbnailUrl?: string | undefined;
|
|
502
508
|
youtubeId?: string | undefined;
|
|
509
|
+
duration?: number | undefined;
|
|
503
510
|
}, {
|
|
504
511
|
type: "video" | "image" | "file";
|
|
505
512
|
url: string;
|
|
@@ -507,6 +514,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
507
514
|
alt?: string | undefined;
|
|
508
515
|
thumbnailUrl?: string | undefined;
|
|
509
516
|
youtubeId?: string | undefined;
|
|
517
|
+
duration?: number | undefined;
|
|
510
518
|
}>, "many">>>;
|
|
511
519
|
winnerImages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
512
520
|
url: z.ZodString;
|
|
@@ -515,6 +523,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
515
523
|
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
516
524
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
517
525
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
526
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
518
527
|
}, "strip", z.ZodTypeAny, {
|
|
519
528
|
type: "video" | "image" | "file";
|
|
520
529
|
url: string;
|
|
@@ -522,6 +531,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
522
531
|
alt?: string | undefined;
|
|
523
532
|
thumbnailUrl?: string | undefined;
|
|
524
533
|
youtubeId?: string | undefined;
|
|
534
|
+
duration?: number | undefined;
|
|
525
535
|
}, {
|
|
526
536
|
type: "video" | "image" | "file";
|
|
527
537
|
url: string;
|
|
@@ -529,6 +539,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
529
539
|
alt?: string | undefined;
|
|
530
540
|
thumbnailUrl?: string | undefined;
|
|
531
541
|
youtubeId?: string | undefined;
|
|
542
|
+
duration?: number | undefined;
|
|
532
543
|
}>, "many">>>;
|
|
533
544
|
additionalImages: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
534
545
|
url: z.ZodString;
|
|
@@ -537,6 +548,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
537
548
|
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
538
549
|
source: z.ZodOptional<z.ZodEnum<["upload", "youtube", "external"]>>;
|
|
539
550
|
youtubeId: z.ZodOptional<z.ZodString>;
|
|
551
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
540
552
|
}, "strip", z.ZodTypeAny, {
|
|
541
553
|
type: "video" | "image" | "file";
|
|
542
554
|
url: string;
|
|
@@ -544,6 +556,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
544
556
|
alt?: string | undefined;
|
|
545
557
|
thumbnailUrl?: string | undefined;
|
|
546
558
|
youtubeId?: string | undefined;
|
|
559
|
+
duration?: number | undefined;
|
|
547
560
|
}, {
|
|
548
561
|
type: "video" | "image" | "file";
|
|
549
562
|
url: string;
|
|
@@ -551,6 +564,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
551
564
|
alt?: string | undefined;
|
|
552
565
|
thumbnailUrl?: string | undefined;
|
|
553
566
|
youtubeId?: string | undefined;
|
|
567
|
+
duration?: number | undefined;
|
|
554
568
|
}>, "many">>>;
|
|
555
569
|
saleConfig: z.ZodOptional<z.ZodObject<{
|
|
556
570
|
discountPercent: z.ZodNumber;
|
|
@@ -945,6 +959,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
945
959
|
alt?: string | undefined;
|
|
946
960
|
thumbnailUrl?: string | undefined;
|
|
947
961
|
youtubeId?: string | undefined;
|
|
962
|
+
duration?: number | undefined;
|
|
948
963
|
} | {
|
|
949
964
|
url: string;
|
|
950
965
|
type: "image";
|
|
@@ -956,6 +971,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
956
971
|
alt?: string | undefined;
|
|
957
972
|
thumbnailUrl?: string | undefined;
|
|
958
973
|
youtubeId?: string | undefined;
|
|
974
|
+
duration?: number | undefined;
|
|
959
975
|
}[];
|
|
960
976
|
winnerImages: {
|
|
961
977
|
type: "video" | "image" | "file";
|
|
@@ -964,6 +980,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
964
980
|
alt?: string | undefined;
|
|
965
981
|
thumbnailUrl?: string | undefined;
|
|
966
982
|
youtubeId?: string | undefined;
|
|
983
|
+
duration?: number | undefined;
|
|
967
984
|
}[];
|
|
968
985
|
additionalImages: {
|
|
969
986
|
type: "video" | "image" | "file";
|
|
@@ -972,6 +989,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
972
989
|
alt?: string | undefined;
|
|
973
990
|
thumbnailUrl?: string | undefined;
|
|
974
991
|
youtubeId?: string | undefined;
|
|
992
|
+
duration?: number | undefined;
|
|
975
993
|
}[];
|
|
976
994
|
slug?: string | undefined;
|
|
977
995
|
lotteryConfig?: {
|
|
@@ -1131,6 +1149,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
1131
1149
|
alt?: string | undefined;
|
|
1132
1150
|
thumbnailUrl?: string | undefined;
|
|
1133
1151
|
youtubeId?: string | undefined;
|
|
1152
|
+
duration?: number | undefined;
|
|
1134
1153
|
} | null | undefined;
|
|
1135
1154
|
coverImageUrl?: string | undefined;
|
|
1136
1155
|
eventImages?: {
|
|
@@ -1140,6 +1159,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
1140
1159
|
alt?: string | undefined;
|
|
1141
1160
|
thumbnailUrl?: string | undefined;
|
|
1142
1161
|
youtubeId?: string | undefined;
|
|
1162
|
+
duration?: number | undefined;
|
|
1143
1163
|
}[] | undefined;
|
|
1144
1164
|
winnerImages?: {
|
|
1145
1165
|
type: "video" | "image" | "file";
|
|
@@ -1148,6 +1168,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
1148
1168
|
alt?: string | undefined;
|
|
1149
1169
|
thumbnailUrl?: string | undefined;
|
|
1150
1170
|
youtubeId?: string | undefined;
|
|
1171
|
+
duration?: number | undefined;
|
|
1151
1172
|
}[] | undefined;
|
|
1152
1173
|
additionalImages?: {
|
|
1153
1174
|
type: "video" | "image" | "file";
|
|
@@ -1156,6 +1177,7 @@ export declare const eventItemSchema: z.ZodObject<{
|
|
|
1156
1177
|
alt?: string | undefined;
|
|
1157
1178
|
thumbnailUrl?: string | undefined;
|
|
1158
1179
|
youtubeId?: string | undefined;
|
|
1180
|
+
duration?: number | undefined;
|
|
1159
1181
|
}[] | undefined;
|
|
1160
1182
|
saleConfig?: {
|
|
1161
1183
|
discountPercent: number;
|
|
@@ -3,7 +3,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { pluginFor } from "../../../_internal/shared/listing-types/_registry";
|
|
4
4
|
import { SectionCarousel } from "../../homepage/components/SectionCarousel";
|
|
5
5
|
import { ProductCard } from "../../products/components/ProductGrid";
|
|
6
|
-
|
|
6
|
+
// Must come from _internal/shared — importing this as a VALUE from
|
|
7
|
+
// _internal/server/.../data.ts pulled firebase-admin into the client bundle
|
|
8
|
+
// and failed the Turbopack production build (Root Cause #6).
|
|
9
|
+
import { toProductItem } from "../../../_internal/shared/features/products/to-product-item";
|
|
7
10
|
import { CAROUSEL_PER_VIEW } from "../../homepage/constants/carousel-per-view";
|
|
8
11
|
import { Stack } from "../../../ui";
|
|
9
12
|
const GROUP_THEME_TITLE = {
|
|
@@ -13,5 +13,9 @@ export declare class GroupedListingsRepository extends BaseRepository<GroupedLis
|
|
|
13
13
|
* precomputed field, not a fresh recompute).
|
|
14
14
|
*/
|
|
15
15
|
findByProductId(productId: string): Promise<GroupedListingDocument[]>;
|
|
16
|
+
/** Groups tagged to a category, same eligibility filter as findByProductId. */
|
|
17
|
+
findByCategorySlug(categorySlug: string): Promise<GroupedListingDocument[]>;
|
|
18
|
+
/** Groups tagged to a brand, same eligibility filter as findByProductId. */
|
|
19
|
+
findByBrandSlug(brandSlug: string): Promise<GroupedListingDocument[]>;
|
|
16
20
|
}
|
|
17
21
|
export declare const groupedListingsRepository: GroupedListingsRepository;
|
|
@@ -24,5 +24,23 @@ export class GroupedListingsRepository extends BaseRepository {
|
|
|
24
24
|
.get();
|
|
25
25
|
return snap.docs.map((doc) => this.mapDoc(doc));
|
|
26
26
|
}
|
|
27
|
+
/** Groups tagged to a category, same eligibility filter as findByProductId. */
|
|
28
|
+
async findByCategorySlug(categorySlug) {
|
|
29
|
+
const snap = await this.getCollection()
|
|
30
|
+
.where(PRODUCT_FIELDS.CATEGORY_SLUG, "==", categorySlug)
|
|
31
|
+
.where(PRODUCT_FIELDS.IS_ACTIVE, "==", true)
|
|
32
|
+
.where("visibilityStatus", "==", "visible")
|
|
33
|
+
.get();
|
|
34
|
+
return snap.docs.map((doc) => this.mapDoc(doc));
|
|
35
|
+
}
|
|
36
|
+
/** Groups tagged to a brand, same eligibility filter as findByProductId. */
|
|
37
|
+
async findByBrandSlug(brandSlug) {
|
|
38
|
+
const snap = await this.getCollection()
|
|
39
|
+
.where(PRODUCT_FIELDS.BRAND_SLUG, "==", brandSlug)
|
|
40
|
+
.where(PRODUCT_FIELDS.IS_ACTIVE, "==", true)
|
|
41
|
+
.where("visibilityStatus", "==", "visible")
|
|
42
|
+
.get();
|
|
43
|
+
return snap.docs.map((doc) => this.mapDoc(doc));
|
|
44
|
+
}
|
|
27
45
|
}
|
|
28
46
|
export const groupedListingsRepository = new GroupedListingsRepository();
|