@mohasinac/appkit 3.0.0 → 3.0.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/SidebarCollapseToggle.js +1 -5
- package/dist/_internal/server/features/auctions/actions.js +0 -1
- package/dist/_internal/server/features/auctions/og.js +0 -1
- package/dist/_internal/server/features/auctions/service.js +0 -4
- package/dist/_internal/server/features/auth/capabilities.js +0 -1
- package/dist/_internal/server/features/blog/actions.js +0 -2
- package/dist/_internal/server/features/brands/actions.js +0 -2
- package/dist/_internal/server/features/cart/actions.js +0 -3
- package/dist/_internal/server/features/checkout/actions.js +11 -20
- package/dist/_internal/server/features/events/actions.js +0 -3
- package/dist/_internal/server/features/events/og.js +0 -1
- package/dist/_internal/server/features/events/service.js +0 -2
- package/dist/_internal/server/features/grouped/data.js +0 -2
- package/dist/_internal/server/features/orders/actions.js +0 -4
- package/dist/_internal/server/features/pre-orders/actions.js +0 -1
- package/dist/_internal/server/features/pre-orders/og.js +0 -1
- package/dist/_internal/server/features/pre-orders/service.js +0 -1
- package/dist/_internal/server/features/products/actions.js +0 -6
- package/dist/_internal/server/features/products/service.js +0 -1
- package/dist/_internal/server/features/promotions/actions.js +0 -3
- package/dist/_internal/server/features/reviews/actions.js +0 -3
- package/dist/_internal/server/functions/https.js +0 -6
- package/dist/_internal/server/functions/manifest.js +0 -1
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
- package/dist/_internal/server/jobs/core/wrapJobHandler.js +0 -1
- package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
- package/dist/_internal/shared/serialization/index.js +0 -4
- package/dist/_internal/shared/styles/themed.js +0 -3
- package/dist/client/api/ApiError.js +1 -4
- package/dist/client/api/surface-error.js +0 -1
- package/dist/client/api/useApiQuery.js +0 -1
- package/dist/configs/next.js +0 -1
- package/dist/configs/tailwind.js +0 -1
- package/dist/contracts/field-ops.js +0 -2
- package/dist/core/EventBus.js +0 -2
- package/dist/core/Logger.js +0 -6
- package/dist/core/Queue.js +0 -2
- package/dist/core/hooks/useSyncManager.js +4 -4
- package/dist/core/mutation-events.js +0 -1
- package/dist/core/newsletter.repository.js +2 -6
- package/dist/errors/api-error.js +0 -1
- package/dist/errors/authentication-error.js +0 -1
- package/dist/errors/authorization-error.js +0 -1
- package/dist/errors/base-error.js +1 -3
- package/dist/errors/database-error.js +0 -1
- package/dist/errors/error-handler.js +1 -5
- package/dist/errors/error-mapping.js +1 -6
- package/dist/errors/normalize.js +0 -4
- package/dist/errors/not-found-error.js +0 -1
- package/dist/errors/razorpay-unreachable.js +0 -1
- package/dist/errors/validation-error.js +0 -1
- package/dist/features/about/components/FAQPageView.js +1 -3
- package/dist/features/about/components/FeesView.js +1 -3
- package/dist/features/about/components/HelpPageView.js +1 -3
- package/dist/features/about/components/PublicProfileView.js +4 -4
- package/dist/features/account/components/AddressBook.js +1 -3
- package/dist/features/account/components/AddressForm.js +0 -1
- package/dist/features/account/components/AddressesIndexListing.js +0 -1
- package/dist/features/account/components/MessagesView.js +1 -3
- package/dist/features/account/components/NotificationBell.js +3 -14
- package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
- package/dist/features/account/components/UserOffersPanel.js +0 -2
- package/dist/features/account/components/UserSidebar.js +1 -3
- package/dist/features/admin/components/AdminBlogEditorView.js +0 -1
- package/dist/features/admin/components/AdminBundleEditorView.js +0 -1
- package/dist/features/admin/components/AdminBundlesView.js +0 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -5
- package/dist/features/admin/components/AdminCarouselView.js +1 -4
- package/dist/features/admin/components/AdminCartsView.js +0 -1
- package/dist/features/admin/components/AdminMediaView.js +1 -3
- package/dist/features/admin/components/AdminPayoutsView.js +0 -1
- package/dist/features/admin/components/AdminProductsView.js +1 -3
- package/dist/features/admin/components/AdminSidebar.js +1 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +1 -5
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -13
- package/dist/features/admin/components/DashboardStats.js +1 -7
- package/dist/features/admin/components/DataListingView.js +1 -5
- package/dist/features/admin/components/DataTable.js +1 -3
- package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +1 -3
- package/dist/features/admin/components/analytics/AdminStatCard.js +1 -7
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -3
- package/dist/features/admin/components/sections/adminSectionsBuildParse.js +0 -5
- package/dist/features/admin/hooks/useAdminListingData.js +0 -5
- package/dist/features/admin/hooks/useChat.js +0 -3
- package/dist/features/admin/repository/chat.repository.js +0 -1
- package/dist/features/admin/repository/notification.repository.js +1 -4
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -7
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -6
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -15
- package/dist/features/auctions/components/PlaceBidFormClient.js +0 -3
- package/dist/features/auctions/repository/bid.repository.js +0 -1
- package/dist/features/auth/components/ForgotPasswordView.js +0 -1
- package/dist/features/auth/components/LoginForm.js +0 -1
- package/dist/features/auth/components/RegisterForm.js +0 -1
- package/dist/features/auth/components/ResetPasswordView.js +0 -1
- package/dist/features/auth/hooks/useAuth.js +0 -1
- package/dist/features/auth/repository/session.repository.js +0 -1
- package/dist/features/auth/repository/token.repository.js +0 -2
- package/dist/features/auth/repository/user.repository.js +0 -1
- package/dist/features/blog/api/[slug]/route.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -5
- package/dist/features/blog/components/BlogIndexListing.js +0 -1
- package/dist/features/blog/components/BlogListView.js +1 -5
- package/dist/features/blog/components/BlogPostView.js +1 -3
- package/dist/features/cart/components/CartDrawer.js +2 -6
- package/dist/features/cart/repository/cart.repository.js +0 -1
- package/dist/features/categories/api/route.js +0 -1
- package/dist/features/categories/components/BrandDetailPageView.js +1 -13
- package/dist/features/categories/components/BundleDetailView.js +1 -5
- package/dist/features/categories/components/BundleItemsPicker.js +1 -5
- package/dist/features/categories/components/CategoriesIndexListing.js +0 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +0 -1
- package/dist/features/categories/components/CategoryBundlesListing.js +1 -3
- package/dist/features/categories/components/CategoryDetailPageView.js +1 -16
- package/dist/features/categories/components/CategoryGrid.js +1 -5
- package/dist/features/categories/components/CategorySelectorCreate.js +0 -1
- package/dist/features/categories/components/CategoryTableColumns.js +2 -6
- package/dist/features/categories/components/CategoryTree.js +1 -3
- package/dist/features/categories/components/ConcernCard.js +1 -3
- package/dist/features/collections/components/CollectionCard.js +1 -5
- package/dist/features/contact/email.js +0 -1
- package/dist/features/events/actions/event-actions.js +0 -1
- package/dist/features/events/api/[id]/route.js +0 -1
- package/dist/features/events/components/AdminEventEditorView.js +1 -2
- package/dist/features/events/components/EventCard.js +2 -8
- package/dist/features/events/components/EventRaffleEntryForm.js +1 -3
- package/dist/features/events/components/EventRaffleWinnerView.js +1 -3
- package/dist/features/events/components/EventRafflesSection.js +0 -1
- package/dist/features/events/components/EventsIndexListing.js +0 -1
- package/dist/features/events/hooks/useBulkEvent.js +0 -1
- package/dist/features/events/repository/event-entry.repository.js +0 -1
- package/dist/features/faq/components/ContactCTA.js +1 -3
- package/dist/features/faq/components/FAQAccordion.js +1 -3
- package/dist/features/faq/components/FAQCategorySidebar.js +1 -3
- package/dist/features/faq/components/RelatedFAQs.js +1 -5
- package/dist/features/filters/AsyncFacetSection.js +1 -3
- package/dist/features/filters/FilterFacetSection.js +4 -14
- package/dist/features/forms/Checkbox.js +1 -3
- package/dist/features/forms/Slider.js +1 -3
- package/dist/features/history/hooks/useHistory.js +0 -1
- package/dist/features/history/repository/user-history.repository.js +0 -2
- package/dist/features/homepage/actions/carousel-actions.js +0 -1
- package/dist/features/homepage/actions/homepage-section-actions.js +1 -3
- package/dist/features/homepage/api/carousel/route.js +0 -1
- package/dist/features/homepage/api/route.js +0 -1
- package/dist/features/homepage/components/AdSlot.js +3 -9
- package/dist/features/homepage/components/AdvertisementBanner.js +2 -12
- package/dist/features/homepage/components/BeforeAfterCard.js +1 -5
- package/dist/features/homepage/components/CharacterHotspotForm.js +2 -10
- package/dist/features/homepage/components/CollectionCardsSection.js +1 -3
- package/dist/features/homepage/components/CustomCardsSection.js +1 -5
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -3
- package/dist/features/homepage/components/GoogleReviewsSection.js +1 -3
- package/dist/features/homepage/components/HeroCarousel.js +5 -26
- package/dist/features/homepage/components/HeroSection.js +2 -6
- package/dist/features/homepage/components/HowItWorksSection.js +2 -8
- package/dist/features/homepage/components/MarketplaceHomepageView.js +0 -8
- package/dist/features/homepage/components/NewsletterBanner.js +2 -10
- package/dist/features/homepage/components/PromoGrid.js +1 -3
- package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -6
- package/dist/features/homepage/components/ShopByCategorySection.js +2 -6
- package/dist/features/homepage/components/SocialPostCard.js +1 -3
- package/dist/features/homepage/components/StatsCounterSection.js +1 -5
- package/dist/features/homepage/components/TrustBadges.js +1 -3
- package/dist/features/homepage/components/TrustFeaturesSection.js +1 -3
- package/dist/features/homepage/components/WelcomeSection.js +2 -16
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -5
- package/dist/features/homepage/lib/social-feed-fetcher.js +0 -8
- package/dist/features/layout/AppLayoutShell.js +1 -3
- package/dist/features/layout/BottomNavbar.js +1 -11
- package/dist/features/media/MediaAudio.js +2 -6
- package/dist/features/media/MediaImage.js +0 -1
- package/dist/features/media/MediaLightbox.js +3 -9
- package/dist/features/media/MediaVideo.js +2 -8
- package/dist/features/media/upload/MediaUploadField.js +1 -3
- package/dist/features/messages/hooks/useConversation.js +0 -2
- package/dist/features/messages/hooks/useConversations.js +0 -1
- package/dist/features/messages/repository/conversations.repository.js +0 -1
- package/dist/features/orders/api/track/[trackingId]/route.js +0 -1
- package/dist/features/orders/components/OrdersList.js +1 -3
- package/dist/features/orders/components/RefundHistoryTable.js +1 -3
- package/dist/features/orders/repository/orders.repository.js +0 -2
- package/dist/features/payments/repository/payout.repository.js +0 -1
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -6
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +0 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -3
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -5
- package/dist/features/products/api/route.js +1 -3
- package/dist/features/products/components/CompareOverlay.js +1 -6
- package/dist/features/products/components/FeatureBadge.js +1 -3
- package/dist/features/products/components/MakeOfferButton.js +0 -2
- package/dist/features/products/components/MarketplaceBundleCard.js +1 -3
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -3
- package/dist/features/products/components/PrizeDrawDetailPageView.js +0 -2
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -3
- package/dist/features/products/components/PrizeDrawsSection.js +1 -3
- package/dist/features/products/components/ProductDetailPageView.js +0 -6
- package/dist/features/products/components/ProductFeatureBadges.js +1 -3
- package/dist/features/products/components/ProductFeaturesSelector.js +0 -1
- package/dist/features/products/components/ProductGrid.js +5 -15
- package/dist/features/products/components/ShareButton.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +3 -7
- package/dist/features/products/components/SublistingCarouselSection.js +2 -4
- package/dist/features/products/repository/product-features.repository.js +0 -1
- package/dist/features/products/repository/products.repository.js +0 -1
- package/dist/features/promotions/components/CouponCard.js +2 -5
- package/dist/features/promotions/repository/coupons.repository.js +0 -1
- package/dist/features/reviews/api/route.js +0 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -13
- package/dist/features/reviews/components/ReviewModal.js +1 -5
- package/dist/features/reviews/components/ReviewSummary.js +2 -6
- package/dist/features/reviews/components/ReviewsIndexListing.js +0 -1
- package/dist/features/reviews/components/ReviewsList.js +1 -7
- package/dist/features/reviews/repository/reviews.repository.js +0 -3
- package/dist/features/scams/actions/scam-actions.js +1 -1
- package/dist/features/scams/components/ScamProfileView.js +1 -3
- package/dist/features/search/components/Search.js +2 -8
- package/dist/features/search/components/SearchFiltersRow.js +1 -3
- package/dist/features/seller/components/PhysicalLocationModal.js +1 -5
- package/dist/features/seller/components/SellerAddressesView.js +1 -6
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -4
- package/dist/features/seller/components/SellerBidsView.js +1 -3
- package/dist/features/seller/components/SellerBundlesView.js +0 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +1 -3
- package/dist/features/seller/components/SellerFeaturesView.js +0 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
- package/dist/features/seller/components/SellerLiveView.js +1 -3
- package/dist/features/seller/components/SellerOffersPanel.js +0 -2
- package/dist/features/seller/components/SellerOrdersView.js +1 -6
- package/dist/features/seller/components/SellerPayoutMethodsView.js +0 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.js +2 -4
- package/dist/features/seller/components/SellerProductsCards.js +1 -3
- package/dist/features/seller/components/SellerProductsView.js +1 -7
- package/dist/features/seller/components/SellerReviewsView.js +1 -4
- package/dist/features/seller/components/SellerShippingConfigsView.js +1 -4
- package/dist/features/seller/components/SellerShippingView.js +1 -1
- package/dist/features/seller/components/SellerSidebar.js +4 -12
- package/dist/features/seller/components/SellerStoreCategoriesView.js +0 -2
- package/dist/features/seller/components/SellerTemplatesView.js +0 -1
- package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -3
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -3
- package/dist/features/seller/hooks/useSellerListingData.js +0 -5
- package/dist/features/seller/repository/offer.repository.js +0 -1
- package/dist/features/shell/FormShell.js +2 -15
- package/dist/features/shell/QuickFormDrawer.js +1 -5
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -3
- package/dist/features/site-settings/components/ThemeManagerView.js +0 -1
- package/dist/features/stores/api/[storeSlug]/reviews/route.js +0 -1
- package/dist/features/stores/components/StoreHeader.js +1 -7
- package/dist/features/stores/components/StoreReviewsListing.js +0 -1
- package/dist/features/stores/components/StoresIndexListing.js +0 -1
- package/dist/features/stores/repository/store.repository.js +0 -2
- package/dist/features/support/repository/support.repository.js +0 -1
- package/dist/features/wishlist/components/WishlistPage.js +1 -3
- package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
- package/dist/features/wishlist/repository/user-wishlist.repository.js +0 -2
- package/dist/http/ApiClient.js +4 -12
- package/dist/index.js +0 -1
- package/dist/monitoring/client-logger.js +7 -22
- package/dist/monitoring/error-tracking.js +0 -1
- package/dist/monitoring/performance.js +0 -1
- package/dist/monitoring/server-logger.js +11 -33
- package/dist/next/api/api-response.js +1 -4
- package/dist/next/api/apiHandler.js +1 -5
- package/dist/next/api/errorHandler.js +0 -3
- package/dist/next/api/parseJsonBody.js +0 -1
- package/dist/next/api/routeHandler.js +1 -6
- package/dist/next/cache-middleware.js +1 -3
- package/dist/next/middleware/chain.js +0 -1
- package/dist/next/middleware/pii-scrubber.js +0 -2
- package/dist/providers/auth-firebase/provider.js +0 -1
- package/dist/providers/db-firebase/admin.js +0 -1
- package/dist/providers/db-firebase/base.js +0 -4
- package/dist/providers/db-firebase/base.repository.js +0 -3
- package/dist/providers/db-firebase/field-ops.js +0 -2
- package/dist/providers/db-firebase/helpers.js +0 -4
- package/dist/providers/db-firebase/realtime.js +3 -15
- package/dist/providers/db-firebase/sieve.js +2 -8
- package/dist/providers/payment-razorpay/index.js +0 -3
- package/dist/providers/shipping-shiprocket/index.js +0 -1
- package/dist/providers/storage-firebase/client.js +0 -4
- package/dist/react/contexts/SessionContext.js +0 -1
- package/dist/react/hooks/useCountdown.js +0 -1
- package/dist/security/authorization.js +0 -1
- package/dist/security/pii-encrypt.js +0 -4
- package/dist/security/pii-redact.js +0 -3
- package/dist/seed/manifest.js +1 -6
- package/dist/seed/runner.js +0 -2
- package/dist/ui/DataTable.js +2 -6
- package/dist/ui/components/Anchor.js +0 -1
- package/dist/ui/components/AvatarDisplay.js +1 -3
- package/dist/ui/components/BackgroundRenderer.js +2 -6
- package/dist/ui/components/BaseListingCard.js +0 -1
- package/dist/ui/components/Button.js +0 -3
- package/dist/ui/components/Card.js +2 -6
- package/dist/ui/components/Details.js +2 -8
- package/dist/ui/components/Dialog.js +0 -1
- package/dist/ui/components/FallbackShell.js +5 -17
- package/dist/ui/components/Fieldset.js +2 -6
- package/dist/ui/components/HorizontalRule.js +0 -1
- package/dist/ui/components/HotspotMarker.js +1 -3
- package/dist/ui/components/IconBox.js +0 -1
- package/dist/ui/components/Iframe.js +0 -1
- package/dist/ui/components/ImageGallery.js +1 -3
- package/dist/ui/components/ImageLightbox.js +1 -5
- package/dist/ui/components/Kbd.js +0 -1
- package/dist/ui/components/Motion.js +1 -3
- package/dist/ui/components/NavbarChevron.js +0 -1
- package/dist/ui/components/PasswordStrengthIndicator.js +1 -3
- package/dist/ui/components/Progress.js +2 -6
- package/dist/ui/components/Quote.js +1 -4
- package/dist/ui/components/Responsive.js +0 -4
- package/dist/ui/components/RowActionMenu.js +1 -3
- package/dist/ui/components/Scrim.js +0 -1
- package/dist/ui/components/SiteLogo.js +1 -9
- package/dist/ui/components/Skeleton.js +1 -3
- package/dist/ui/components/Slider.js +1 -3
- package/dist/ui/components/StickyToolbar.js +0 -1
- package/dist/ui/components/TabStrip.js +1 -3
- package/dist/ui/components/Toast.js +1 -3
- package/dist/ui/components/Tooltip.js +1 -4
- package/dist/ui/components/UnsavedChangesModal.js +1 -3
- package/dist/ui/rich-text/RichText.js +1 -1
- package/dist/utils/action-response.js +0 -1
- package/dist/utils/date.formatter.js +0 -1
- package/dist/utils/object.helper.js +0 -2
- package/dist/utils/schema-ui.js +1 -3
- package/dist/validation/input.validator.js +0 -1
- package/dist/validation/schemas.js +1 -3
- package/package.json +5 -2
- package/scripts/bundle-css.mjs +47 -0
- package/scripts/copy-assets.mjs +34 -0
- package/scripts/dedupe-peer-deps.mjs +81 -0
|
@@ -66,7 +66,6 @@ export function SellerStoreCategoriesView({ onCreateClick, onEditClick, onDelete
|
|
|
66
66
|
raw: item,
|
|
67
67
|
label: String(item.label ?? ""),
|
|
68
68
|
slug: String(item.slug ?? ""),
|
|
69
|
-
// audit-unknown-ok: TS structural escape
|
|
70
69
|
productCount: Number(item.productIds?.length ?? 0),
|
|
71
70
|
isActive: Boolean(item.isActive),
|
|
72
71
|
})),
|
|
@@ -76,7 +75,6 @@ export function SellerStoreCategoriesView({ onCreateClick, onEditClick, onDelete
|
|
|
76
75
|
const totalPages = Math.ceil(total / PAGE_SIZE);
|
|
77
76
|
const selection = useBulkSelection({ items: rows, keyExtractor: (r) => r.id });
|
|
78
77
|
const handleDelete = useCallback(async (id) => {
|
|
79
|
-
// toast-handled-by-hook (useEntityDelete)
|
|
80
78
|
if (!onDelete)
|
|
81
79
|
return;
|
|
82
80
|
await performDelete(id);
|
|
@@ -198,7 +198,6 @@ export function SellerTemplatesView({ onDelete, onBulkDelete, onDuplicate, }) {
|
|
|
198
198
|
}
|
|
199
199
|
}, [draft, drawerMode, editingId, closeDrawer, refetch, showToast]);
|
|
200
200
|
const handleDelete = useCallback(async (id) => {
|
|
201
|
-
// toast-handled-by-hook (useEntityDelete)
|
|
202
201
|
await performDelete(id);
|
|
203
202
|
setDeleteTargetId(null);
|
|
204
203
|
}, [performDelete]);
|
|
@@ -13,9 +13,7 @@ const Tooltip = dynamic(() => import("recharts").then((m) => m.Tooltip), { ssr:
|
|
|
13
13
|
const ResponsiveContainer = dynamic(() => import("recharts").then((m) => m.ResponsiveContainer), { ssr: false });
|
|
14
14
|
export function SellerRevenueChart({ data, labels = {}, formatRevenue = (amount) => String(amount), className = "", }) {
|
|
15
15
|
const hasRevenue = data.some((item) => item.revenue > 0);
|
|
16
|
-
return (
|
|
17
|
-
// audit-variant-ok: card container — sm:p-6 responsive bump over base padding=md
|
|
18
|
-
_jsxs(Div, { className: `border border-neutral-200 dark:border-neutral-800 sm:p-6 ${className}`, rounded: "xl", padding: "md", surface: "default", children: [labels.title && (_jsx(Heading, { level: 3, className: "mb-4", size: "base", weight: "semibold", children: labels.title })), hasRevenue ? (_jsx(Div, { className: "h-[300px]", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(BarChart, { data: data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3", strokeOpacity: 0.3 }), _jsx(XAxis, { dataKey: "month", tick: { fontSize: 11, fill: "currentColor" }, tickLine: false, axisLine: false }), _jsx(YAxis, { tick: { fontSize: 11, fill: "currentColor" }, tickLine: false, axisLine: false, tickFormatter: (value) => formatRevenue(Number(value)) }), _jsx(Tooltip, { formatter: (value) => [
|
|
16
|
+
return (_jsxs(Div, { className: `border border-neutral-200 dark:border-neutral-800 sm:p-6 ${className}`, rounded: "xl", padding: "md", surface: "default", children: [labels.title && (_jsx(Heading, { level: 3, className: "mb-4", size: "base", weight: "semibold", children: labels.title })), hasRevenue ? (_jsx(Div, { className: "h-[300px]", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", children: _jsxs(BarChart, { data: data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3", strokeOpacity: 0.3 }), _jsx(XAxis, { dataKey: "month", tick: { fontSize: 11, fill: "currentColor" }, tickLine: false, axisLine: false }), _jsx(YAxis, { tick: { fontSize: 11, fill: "currentColor" }, tickLine: false, axisLine: false, tickFormatter: (value) => formatRevenue(Number(value)) }), _jsx(Tooltip, { formatter: (value) => [
|
|
19
17
|
formatRevenue(Number(value)),
|
|
20
18
|
labels.revenueLabel ?? "Revenue",
|
|
21
19
|
] }), _jsx(Bar, { dataKey: "revenue", fill: "var(--appkit-color-primary)", radius: [4, 4, 0, 0] })] }) }) })) : (_jsx(Text, { paddingY: "xl", color: "muted", size: "sm", align: "center", children: labels.noData ?? "No data available" }))] }));
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Div, Heading, Row, Span, Text } from "../../../../ui";
|
|
3
3
|
export function SellerTopProducts({ products, labels = {}, formatRevenue = (amount) => String(amount), renderProductLink, renderEmptyAction, className = "", }) {
|
|
4
|
-
return (
|
|
5
|
-
// audit-variant-ok: card container — sm:p-6 responsive bump over base padding=md
|
|
6
|
-
_jsxs(Div, { className: `border border-neutral-200 dark:border-neutral-800 sm:p-6 ${className}`, rounded: "xl", padding: "md", surface: "default", children: [labels.title && (_jsx(Heading, { level: 3, className: "mb-4", size: "base", weight: "semibold", children: labels.title })), products.length > 0 ? (_jsx(Div, { className: "divide-y divide-neutral-100 dark:divide-neutral-800", children: products.map((product, index) => (_jsxs(Row, { align: "center", gap: "md", padding: "y-sm", children: [_jsxs(Span, { size: "sm", weight: "bold", className: "w-6", color: "muted", children: [index + 1, "."] }), _jsxs(Div, { className: "flex-1 min-w-0", children: [_jsx(Text, { className: "truncate", size: "sm", weight: "medium", children: product.title }), _jsxs(Text, { size: "xs", color: "muted", children: [product.orders, " ", labels.ordersLabel ?? "orders"] })] }), _jsxs(Div, { className: "text-right ml-2", children: [_jsx(Span, { size: "sm", weight: "semibold", className: "text-success", children: formatRevenue(product.revenue) }), renderProductLink?.(product)] })] }, product.productId))) })) : (_jsxs(Div, { className: "text-center", padding: "y-xl", children: [_jsx(Text, { size: "sm", weight: "medium", children: labels.noData ?? "No data available" }), labels.noDataDescription && (_jsx(Text, { className: "mt-1", color: "muted", size: "xs", children: labels.noDataDescription })), renderEmptyAction?.()] }))] }));
|
|
4
|
+
return (_jsxs(Div, { className: `border border-neutral-200 dark:border-neutral-800 sm:p-6 ${className}`, rounded: "xl", padding: "md", surface: "default", children: [labels.title && (_jsx(Heading, { level: 3, className: "mb-4", size: "base", weight: "semibold", children: labels.title })), products.length > 0 ? (_jsx(Div, { className: "divide-y divide-neutral-100 dark:divide-neutral-800", children: products.map((product, index) => (_jsxs(Row, { align: "center", gap: "md", padding: "y-sm", children: [_jsxs(Span, { size: "sm", weight: "bold", className: "w-6", color: "muted", children: [index + 1, "."] }), _jsxs(Div, { className: "flex-1 min-w-0", children: [_jsx(Text, { className: "truncate", size: "sm", weight: "medium", children: product.title }), _jsxs(Text, { size: "xs", color: "muted", children: [product.orders, " ", labels.ordersLabel ?? "orders"] })] }), _jsxs(Div, { className: "text-right ml-2", children: [_jsx(Span, { size: "sm", weight: "semibold", className: "text-success", children: formatRevenue(product.revenue) }), renderProductLink?.(product)] })] }, product.productId))) })) : (_jsxs(Div, { className: "text-center", padding: "y-xl", children: [_jsx(Text, { size: "sm", weight: "medium", children: labels.noData ?? "No data available" }), labels.noDataDescription && (_jsx(Text, { className: "mt-1", color: "muted", size: "xs", children: labels.noDataDescription })), renderEmptyAction?.()] }))] }));
|
|
7
5
|
}
|
|
@@ -37,11 +37,9 @@ export function useSellerListingData({ queryKey, endpoint, page = 1, pageSize =
|
|
|
37
37
|
refetch: query.refetch,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
41
40
|
export function toRecordArray(value) {
|
|
42
41
|
return Array.isArray(value) ? value.filter(Boolean) : [];
|
|
43
42
|
}
|
|
44
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
45
43
|
export function toStringValue(value, fallback = "-") {
|
|
46
44
|
if (typeof value === "string") {
|
|
47
45
|
return value.trim() || fallback;
|
|
@@ -51,14 +49,12 @@ export function toStringValue(value, fallback = "-") {
|
|
|
51
49
|
}
|
|
52
50
|
return fallback;
|
|
53
51
|
}
|
|
54
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
55
52
|
export function toRupees(value) {
|
|
56
53
|
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
57
54
|
return "-";
|
|
58
55
|
}
|
|
59
56
|
return `₹${value.toLocaleString("en-IN")}`;
|
|
60
57
|
}
|
|
61
|
-
// audit-unknown-ok: callback entry point — accepts arbitrary payload value
|
|
62
58
|
export function toRelativeDate(value) {
|
|
63
59
|
const date = parseDate(value);
|
|
64
60
|
if (!date) {
|
|
@@ -78,7 +74,6 @@ export function toRelativeDate(value) {
|
|
|
78
74
|
return `${Math.floor(deltaMs / day)}d ago`;
|
|
79
75
|
return date.toLocaleDateString("en-IN", { year: "numeric", month: "short", day: "numeric" });
|
|
80
76
|
}
|
|
81
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
82
77
|
function parseDate(value) {
|
|
83
78
|
if (value instanceof Date)
|
|
84
79
|
return value;
|
|
@@ -16,7 +16,6 @@ class OfferRepository extends BaseRepository {
|
|
|
16
16
|
const raw = super.mapDoc(snap);
|
|
17
17
|
return decryptPiiFields(raw, [
|
|
18
18
|
...OFFER_PII_FIELDS,
|
|
19
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
20
19
|
]);
|
|
21
20
|
}
|
|
22
21
|
// --- Create --------------------------------------------------------------
|
|
@@ -115,21 +115,8 @@ schema: _schema, isDirty = false, isLoading = false, sections, onSaveDraft, onPu
|
|
|
115
115
|
};
|
|
116
116
|
if (!isOpen)
|
|
117
117
|
return null;
|
|
118
|
-
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-sm", className: "fixed inset-0 backdrop-blur-[2px]",
|
|
119
|
-
// audit-inline-style-ok: z-index token
|
|
120
|
-
style: { zIndex: "calc(var(--appkit-z-modal) - 1)" }, "aria-hidden": "true", onClick: attemptClose }), _jsxs(Div, { layout: "flex", ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 bottom-0 left-0 right-0 lg:left-[10%] lg:right-[10%] flex-col bg-[var(--appkit-color-surface)] shadow-2xl",
|
|
121
|
-
// audit-inline-style-ok: z-index token
|
|
122
|
-
style: { zIndex: "var(--appkit-z-modal)" }, children: [_jsxs(Row, { gap: "sm", paddingX: "x-5", className: "flex-shrink-0 sticky top-0 z-10 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", padding: "y-sm", children: [previewMode ? (_jsxs("button", { type: "button", onClick: () => setPreviewMode(false), "aria-label": "Back to edit", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors flex-shrink-0 flex items-center gap-1.5 text-sm", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Back to Edit" })] })) : (_jsx("button", { type: "button", onClick: attemptClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors flex-shrink-0", children: _jsx(X, { className: "w-5 h-5" }) })), _jsxs(Div, { className: "flex-1 min-w-0", children: [breadcrumb && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)] truncate mb-0.5", size: "xs", children: breadcrumb })), _jsx(Text, { className: "text-[var(--appkit-color-text)] truncate", size: "sm", weight: "semibold", children: previewMode ? `Preview — ${title}` : title })] }), _jsx(Row, { gap: "xs", className: "flex-shrink-0", children: previewMode ? null : (_jsxs(_Fragment, { children: [previewSlot && (_jsxs("button", { type: "button", onClick: () => setPreviewMode(true), className: "flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors border border-[var(--appkit-color-border)]", children: [_jsx(Eye, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Preview" })] })), onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsx(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: publishLabel }))] })) })] }), _jsxs(Div, { layout: "flex", className: `flex-1 ${__O.hidden}`, children: [sections && sections.length > 0 && !previewMode && (_jsx("nav", { "aria-label": "Form sections", className: "hidden lg:flex flex-col flex-shrink-0 w-48 border-r border-[var(--appkit-color-border)] py-4 px-3 gap-1 overflow-y-auto", children: sections.map((sec) => (_jsx("button", { type: "button", onClick: () => scrollToSection(sec.id), className: "text-left text-sm px-3 py-2 rounded-lg text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-text)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: sec.label }, sec.id))) })), sections && sections.length > 0 && !previewMode && (
|
|
123
|
-
// audit-variant-ok: mobile section strip — fixed below topbar at lg:hidden + bespoke px-5 + surface bg + bottom border
|
|
124
|
-
_jsx(Row, { gap: "px", className: `lg:hidden fixed top-[var(--form-shell-topbar-h,57px)] left-0 right-0 z-10 ${__O.xAuto} px-5 bg-[var(--appkit-color-surface)] border-b border-[var(--appkit-color-border)]`, padding: "y-xs", children: sections.map((sec) => (_jsx("button", { type: "button", onClick: () => scrollToSection(sec.id), className: "flex-shrink-0 text-xs px-3 py-1.5 rounded-full border border-[var(--appkit-color-border)] text-[var(--appkit-color-text-muted)] hover:border-[var(--appkit-color-primary)] hover:text-[var(--appkit-color-primary)] transition-colors whitespace-nowrap", children: sec.label }, sec.id))) })), _jsx(Div, { ref: bodyRef, className: classNames("flex-1 overflow-y-auto", sections && sections.length > 0 && !previewMode ? "pt-0 lg:pt-0" : ""), children: previewMode && previewSlot ? (_jsxs(_Fragment, { children: [_jsxs(Row, { textSize: "sm", gap: "xs", className: "sticky top-0 z-10 bg-[var(--appkit-color-warning-surface)] border-b border-[var(--appkit-color-warning)] text-[var(--appkit-color-warning-text,var(--appkit-color-warning))]", paddingY: "y-xs", paddingX: "x-md", children: [_jsx(Eye, { className: "w-4 h-4 flex-shrink-0" }), _jsx(Span, { children: "Preview \u2014 not visible to buyers until published" })] }), _jsx(Div, { padding: "y-md", children: previewSlot() })] })) : splitPreview && previewSlot ? (
|
|
118
|
+
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-sm", className: "fixed inset-0 backdrop-blur-[2px]", style: { zIndex: "calc(var(--appkit-z-modal) - 1)" }, "aria-hidden": "true", onClick: attemptClose }), _jsxs(Div, { layout: "flex", ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 bottom-0 left-0 right-0 lg:left-[10%] lg:right-[10%] flex-col bg-[var(--appkit-color-surface)] shadow-2xl", style: { zIndex: "var(--appkit-z-modal)" }, children: [_jsxs(Row, { gap: "sm", paddingX: "x-5", className: "flex-shrink-0 sticky top-0 z-10 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", padding: "y-sm", children: [previewMode ? (_jsxs("button", { type: "button", onClick: () => setPreviewMode(false), "aria-label": "Back to edit", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors flex-shrink-0 flex items-center gap-1.5 text-sm", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Back to Edit" })] })) : (_jsx("button", { type: "button", onClick: attemptClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors flex-shrink-0", children: _jsx(X, { className: "w-5 h-5" }) })), _jsxs(Div, { className: "flex-1 min-w-0", children: [breadcrumb && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)] truncate mb-0.5", size: "xs", children: breadcrumb })), _jsx(Text, { className: "text-[var(--appkit-color-text)] truncate", size: "sm", weight: "semibold", children: previewMode ? `Preview — ${title}` : title })] }), _jsx(Row, { gap: "xs", className: "flex-shrink-0", children: previewMode ? null : (_jsxs(_Fragment, { children: [previewSlot && (_jsxs("button", { type: "button", onClick: () => setPreviewMode(true), className: "flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors border border-[var(--appkit-color-border)]", children: [_jsx(Eye, { className: "w-4 h-4" }), _jsx(Span, { className: "hidden sm:inline", children: "Preview" })] })), onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsx(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: publishLabel }))] })) })] }), _jsxs(Div, { layout: "flex", className: `flex-1 ${__O.hidden}`, children: [sections && sections.length > 0 && !previewMode && (_jsx("nav", { "aria-label": "Form sections", className: "hidden lg:flex flex-col flex-shrink-0 w-48 border-r border-[var(--appkit-color-border)] py-4 px-3 gap-1 overflow-y-auto", children: sections.map((sec) => (_jsx("button", { type: "button", onClick: () => scrollToSection(sec.id), className: "text-left text-sm px-3 py-2 rounded-lg text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-text)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: sec.label }, sec.id))) })), sections && sections.length > 0 && !previewMode && (_jsx(Row, { gap: "px", className: `lg:hidden fixed top-[var(--form-shell-topbar-h,57px)] left-0 right-0 z-10 ${__O.xAuto} px-5 bg-[var(--appkit-color-surface)] border-b border-[var(--appkit-color-border)]`, padding: "y-xs", children: sections.map((sec) => (_jsx("button", { type: "button", onClick: () => scrollToSection(sec.id), className: "flex-shrink-0 text-xs px-3 py-1.5 rounded-full border border-[var(--appkit-color-border)] text-[var(--appkit-color-text-muted)] hover:border-[var(--appkit-color-primary)] hover:text-[var(--appkit-color-primary)] transition-colors whitespace-nowrap", children: sec.label }, sec.id))) })), _jsx(Div, { ref: bodyRef, className: classNames("flex-1 overflow-y-auto", sections && sections.length > 0 && !previewMode ? "pt-0 lg:pt-0" : ""), children: previewMode && previewSlot ? (_jsxs(_Fragment, { children: [_jsxs(Row, { textSize: "sm", gap: "xs", className: "sticky top-0 z-10 bg-[var(--appkit-color-warning-surface)] border-b border-[var(--appkit-color-warning)] text-[var(--appkit-color-warning-text,var(--appkit-color-warning))]", paddingY: "y-xs", paddingX: "x-md", children: [_jsx(Eye, { className: "w-4 h-4 flex-shrink-0" }), _jsx(Span, { children: "Preview \u2014 not visible to buyers until published" })] }), _jsx(Div, { padding: "y-md", children: previewSlot() })] })) : splitPreview && previewSlot ? (
|
|
125
119
|
// S-STORE-3-D — desktop 60/40 split: form left, preview right.
|
|
126
120
|
// Below `lg`, falls back to single-column form (preview-as-modal via existing toggle).
|
|
127
|
-
|
|
128
|
-
_jsxs(Div, { className: "lg:grid lg:grid-cols-[3fr_2fr] lg:gap-6 lg:px-6 lg:py-6 lg:max-w-[1400px] lg:mx-auto", children: [_jsx(Div, { className: "max-w-3xl mx-auto px-5 sm:px-6 lg:max-w-none lg:px-0 lg:py-0", padding: "y-lg", children: children }), _jsxs(Div, { className: `hidden lg:block sticky lg:top-4 lg:self-start lg:max-h-[calc(100vh-6rem)] ${__O.yAuto} border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-raised)] ${__P.p4}`, rounded: "lg", children: [_jsxs(Row, { textWeight: "semibold", textSize: "xs", gap: "xs", className: "mb-3 uppercase tracking-wide text-[var(--appkit-color-text-muted)]", children: [_jsx(Eye, { className: "w-3.5 h-3.5" }), _jsx(Span, { children: "Live preview" })] }), previewSlot()] })] })) : (
|
|
129
|
-
// audit-variant-ok: form single-column wrapper — px-5 + sm:px-6 + max-w-3xl mx-auto centering
|
|
130
|
-
_jsx(Div, { className: "max-w-3xl mx-auto px-5 sm:px-6", padding: "y-lg", children: children })) })] }), !previewMode && renderBottomBar ? (renderBottomBar()) : !previewMode && (onSaveDraft || onPublish) ? (_jsxs(Row, { justify: "between", paddingX: "x-5", className: "flex-shrink-0 sticky bottom-0 z-10 border-t border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", padding: "y-sm", children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: attemptClose, disabled: isLoading, children: FORM_ACTION_META[FORM_ACTION_ID.DISCARD].label }), _jsxs(Row, { gap: "xs", children: [onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsxs(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: [publishLabel, " \u2192"] }))] })] })) : null] }), showUnsaved && (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-lg", className: "fixed inset-0",
|
|
131
|
-
// audit-inline-style-ok: z-index token
|
|
132
|
-
style: { zIndex: "calc(var(--appkit-z-modal) + 5)" }, onClick: () => setShowUnsaved(false) }), _jsxs(Div, { className: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-sm bg-[var(--appkit-color-surface)] shadow-2xl", rounded: "xl", padding: "lg",
|
|
133
|
-
// audit-inline-style-ok: z-index token
|
|
134
|
-
style: { zIndex: "calc(var(--appkit-z-modal) + 5)" }, children: [_jsxs(Row, { gap: "sm", align: "start", className: "mb-4", children: [_jsx(Span, { layout: "flex-center", className: "flex-shrink-0 w-10 h-10 bg-[var(--appkit-color-warning-surface)]", rounded: "full", children: _jsx(AlertTriangle, { className: "w-5 h-5 text-[var(--appkit-color-warning)]" }) }), _jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", weight: "semibold", children: "Unsaved changes" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "You have unsaved changes. Leave without saving?" })] })] }), _jsxs(Row, { gap: "xs", justify: "end", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowUnsaved(false), children: "Stay" }), _jsx(Button, { variant: "danger", size: "sm", onClick: () => { setShowUnsaved(false); onClose(); }, children: "Leave" })] })] })] }))] }));
|
|
121
|
+
_jsxs(Div, { className: "lg:grid lg:grid-cols-[3fr_2fr] lg:gap-6 lg:px-6 lg:py-6 lg:max-w-[1400px] lg:mx-auto", children: [_jsx(Div, { className: "max-w-3xl mx-auto px-5 sm:px-6 lg:max-w-none lg:px-0 lg:py-0", padding: "y-lg", children: children }), _jsxs(Div, { className: `hidden lg:block sticky lg:top-4 lg:self-start lg:max-h-[calc(100vh-6rem)] ${__O.yAuto} border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface-raised)] ${__P.p4}`, rounded: "lg", children: [_jsxs(Row, { textWeight: "semibold", textSize: "xs", gap: "xs", className: "mb-3 uppercase tracking-wide text-[var(--appkit-color-text-muted)]", children: [_jsx(Eye, { className: "w-3.5 h-3.5" }), _jsx(Span, { children: "Live preview" })] }), previewSlot()] })] })) : (_jsx(Div, { className: "max-w-3xl mx-auto px-5 sm:px-6", padding: "y-lg", children: children })) })] }), !previewMode && renderBottomBar ? (renderBottomBar()) : !previewMode && (onSaveDraft || onPublish) ? (_jsxs(Row, { justify: "between", paddingX: "x-5", className: "flex-shrink-0 sticky bottom-0 z-10 border-t border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", padding: "y-sm", children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: attemptClose, disabled: isLoading, children: FORM_ACTION_META[FORM_ACTION_ID.DISCARD].label }), _jsxs(Row, { gap: "xs", children: [onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsxs(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: [publishLabel, " \u2192"] }))] })] })) : null] }), showUnsaved && (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-lg", className: "fixed inset-0", style: { zIndex: "calc(var(--appkit-z-modal) + 5)" }, onClick: () => setShowUnsaved(false) }), _jsxs(Div, { className: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-sm bg-[var(--appkit-color-surface)] shadow-2xl", rounded: "xl", padding: "lg", style: { zIndex: "calc(var(--appkit-z-modal) + 5)" }, children: [_jsxs(Row, { gap: "sm", align: "start", className: "mb-4", children: [_jsx(Span, { layout: "flex-center", className: "flex-shrink-0 w-10 h-10 bg-[var(--appkit-color-warning-surface)]", rounded: "full", children: _jsx(AlertTriangle, { className: "w-5 h-5 text-[var(--appkit-color-warning)]" }) }), _jsxs(Stack, { gap: "xs", children: [_jsx(Text, { className: "text-[var(--appkit-color-text)]", weight: "semibold", children: "Unsaved changes" }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "sm", children: "You have unsaved changes. Leave without saving?" })] })] }), _jsxs(Row, { gap: "xs", justify: "end", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowUnsaved(false), children: "Stay" }), _jsx(Button, { variant: "danger", size: "sm", onClick: () => { setShowUnsaved(false); onClose(); }, children: "Leave" })] })] })] }))] }));
|
|
135
122
|
}
|
|
@@ -121,11 +121,7 @@ export function QuickFormDrawer({ isOpen, onClose, title, fields, defaultValues,
|
|
|
121
121
|
if (!isOpen)
|
|
122
122
|
return null;
|
|
123
123
|
const busy = submitting || isLoading;
|
|
124
|
-
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-xs", className: "fixed inset-0 backdrop-blur-[2px]",
|
|
125
|
-
// audit-inline-style-ok: z-index token
|
|
126
|
-
style: { zIndex: "calc(var(--appkit-z-modal) + 1)" }, "aria-hidden": "true", onClick: handleClose }), _jsxs("div", { ref: drawerRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed inset-y-0 right-0 flex flex-col bg-[var(--appkit-color-surface)] shadow-2xl w-full lg:w-[40%]",
|
|
127
|
-
// audit-inline-style-ok: z-index token
|
|
128
|
-
style: { zIndex: "calc(var(--appkit-z-modal) + 2)" }, children: [_jsxs(Row, { className: "flex-shrink-0 border-b border-[var(--appkit-color-border)]", padding: "md", align: "center", gap: "3", children: [_jsx(Text, { className: "flex-1 text-[var(--appkit-color-text)]", size: "base", weight: "semibold", children: title }), _jsx("button", { type: "button", onClick: handleClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: _jsx(X, { className: "w-5 h-5" }) })] }), _jsxs("form", { className: "flex-1 overflow-y-auto px-4 py-5 space-y-4", onSubmit: handleSubmit, noValidate: true, children: [fields.map((field) => {
|
|
124
|
+
return (_jsxs(_Fragment, { children: [_jsx(Div, { surface: "overlay-xs", className: "fixed inset-0 backdrop-blur-[2px]", style: { zIndex: "calc(var(--appkit-z-modal) + 1)" }, "aria-hidden": "true", onClick: handleClose }), _jsxs("div", { ref: drawerRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed inset-y-0 right-0 flex flex-col bg-[var(--appkit-color-surface)] shadow-2xl w-full lg:w-[40%]", style: { zIndex: "calc(var(--appkit-z-modal) + 2)" }, children: [_jsxs(Row, { className: "flex-shrink-0 border-b border-[var(--appkit-color-border)]", padding: "md", align: "center", gap: "3", children: [_jsx(Text, { className: "flex-1 text-[var(--appkit-color-text)]", size: "base", weight: "semibold", children: title }), _jsx("button", { type: "button", onClick: handleClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: _jsx(X, { className: "w-5 h-5" }) })] }), _jsxs("form", { className: "flex-1 overflow-y-auto px-4 py-5 space-y-4", onSubmit: handleSubmit, noValidate: true, children: [fields.map((field) => {
|
|
129
125
|
const value = values[field.name];
|
|
130
126
|
if (field.type === "toggle") {
|
|
131
127
|
return (_jsxs(Stack, { gap: "xs", children: [_jsx(Toggle, { checked: !!value, onChange: (checked) => set(field.name, checked), label: field.label }), field.helperText && (_jsx(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: field.helperText }))] }, field.name));
|
|
@@ -31,8 +31,6 @@ export function NavPermissionsManager({ initialConfig, navGroups, onUpdate, }) {
|
|
|
31
31
|
return (_jsxs(Tr, { className: [
|
|
32
32
|
idx % 2 === 0 ? "bg-white dark:bg-slate-900" : "bg-zinc-50/50 dark:bg-slate-800/50",
|
|
33
33
|
!enabled ? "opacity-60" : "",
|
|
34
|
-
].join(" "), children: [_jsx(Td, { padding: "md", children: _jsxs(Div, { children: [_jsx(Text, { weight: "medium", color: "primary", children: item.label }), item.id && (_jsx(Text, { size: "xs", color: "faint", children: item.id }))] }) }), _jsx(Td, { padding: "md", children: _jsx(Code, { className: "text-zinc-500 dark:text-zinc-400", size: "xs", children: item.href }) }), _jsx(Td, { padding: "md", children: item.requiredPermission ? (
|
|
35
|
-
// audit-variant-ok: permission badge Code — bg-zinc-100 + px-1.5/py-0.5 micro padding; CODE_PADDING_MAP keys don't quite match
|
|
36
|
-
_jsx(Code, { className: "bg-zinc-100 px-1.5 py-0.5 text-zinc-700 dark:bg-slate-700 dark:text-zinc-300", size: "xs", rounded: "default", children: item.requiredPermission })) : (_jsx(Text, { size: "xs", color: "faint", children: "\u2014" })) }), _jsx(Td, { className: "text-right", padding: "md", children: hasId ? (_jsx(Toggle, { checked: enabled, onChange: (v) => handleToggle(item.id, item.label, v), "aria-label": `Toggle ${item.label}` })) : (_jsx(Text, { className: "italic", size: "xs", color: "faint", children: "Legacy \u2014 always visible" })) })] }, item.href));
|
|
34
|
+
].join(" "), children: [_jsx(Td, { padding: "md", children: _jsxs(Div, { children: [_jsx(Text, { weight: "medium", color: "primary", children: item.label }), item.id && (_jsx(Text, { size: "xs", color: "faint", children: item.id }))] }) }), _jsx(Td, { padding: "md", children: _jsx(Code, { className: "text-zinc-500 dark:text-zinc-400", size: "xs", children: item.href }) }), _jsx(Td, { padding: "md", children: item.requiredPermission ? (_jsx(Code, { className: "bg-zinc-100 px-1.5 py-0.5 text-zinc-700 dark:bg-slate-700 dark:text-zinc-300", size: "xs", rounded: "default", children: item.requiredPermission })) : (_jsx(Text, { size: "xs", color: "faint", children: "\u2014" })) }), _jsx(Td, { className: "text-right", padding: "md", children: hasId ? (_jsx(Toggle, { checked: enabled, onChange: (v) => handleToggle(item.id, item.label, v), "aria-label": `Toggle ${item.label}` })) : (_jsx(Text, { className: "italic", size: "xs", color: "faint", children: "Legacy \u2014 always visible" })) })] }, item.href));
|
|
37
35
|
}) })] }) })] }, group.groupLabel))) }));
|
|
38
36
|
}
|
|
@@ -163,7 +163,6 @@ export function ThemeManagerView({ value, onChange, previewOrigin = "/", }) {
|
|
|
163
163
|
? `${previewOrigin}${previewOrigin.includes("?") ? "&" : "?"}preview-theme=${encodeURIComponent(value.defaultLightThemeId)}`
|
|
164
164
|
: null;
|
|
165
165
|
return (_jsxs(Stack, { gap: "md", children: [_jsx(Text, { size: "sm", color: "muted", children: "Themes drive the site palette. Pick which theme record applies when a user is in light mode and dark mode. The two built-in records cannot be deleted \u2014 duplicate one to start editing." }), _jsxs(Row, { gap: "sm", wrap: true, children: [_jsx(Button, { variant: "primary", onClick: () => startNew("light"), children: "+ New light theme" }), _jsx(Button, { variant: "primary", onClick: () => startNew("dark"), children: "+ New dark theme" })] }), _jsx(Stack, { gap: "sm", children: allThemes.map((theme) => (_jsx(ThemeRow, { theme: theme, isDefaultLight: value.defaultLightThemeId === theme.id, isDefaultDark: value.defaultDarkThemeId === theme.id, onEdit: () => startEdit(theme), onDuplicate: () => startDuplicate(theme), onDelete: () => deleteTheme(theme.id), onSetDefault: (mode) => setDefault(mode, theme.id) }, theme.id))) }), error ? _jsx(Alert, { variant: "error", children: error }) : null, draft ? (_jsx(ThemeEditor, { draft: draft, readOnly: draftIsBuiltIn, onChange: setDraft, onSave: saveDraft, onCancel: cancelDraft })) : null, previewSrc ? (_jsxs(Stack, { gap: "sm", children: [_jsx(Text, { size: "sm", weight: "semibold", children: "Live preview" }), _jsx(Text, { size: "xs", color: "muted", children: "Preview reloads when the default theme id changes. Use the host page\u2019s built-in theme toggle to switch between light and dark." }), _jsx(Div, { surface: "card", border: "default", rounded: "lg", padding: "none", children: _jsx("iframe", { title: "Theme preview", src: previewSrc,
|
|
166
|
-
// audit-variant-ok: ThemeManagerView preview iframe — height is
|
|
167
166
|
// fixed; primitive Iframe doesn't carry a static numeric height variant.
|
|
168
167
|
className: "block w-full h-[600px] rounded-lg" }) })] })) : null] }));
|
|
169
168
|
}
|
|
@@ -117,7 +117,6 @@ export async function GET(request, context) {
|
|
|
117
117
|
// Apply hasImages filter
|
|
118
118
|
if (hasImages) {
|
|
119
119
|
filtered = filtered.filter((r) => {
|
|
120
|
-
// audit-unknown-ok: review images cast — Firestore array shape
|
|
121
120
|
const imgs = r.images;
|
|
122
121
|
return Array.isArray(imgs) && imgs.length > 0;
|
|
123
122
|
});
|
|
@@ -11,13 +11,7 @@ const CLS_STARS = "inline-flex items-center gap-1 text-warning";
|
|
|
11
11
|
const CLS_FOLLOW_BTN = "rounded-lg border border-warning px-4 py-2 text-sm font-medium text-warning hover:bg-warning-surface transition-colors";
|
|
12
12
|
const CLS_WARN_BANNER = "mt-3 rounded-lg bg-warning-surface dark:bg-warning-surface border border-warning dark:border-warning px-3 py-2 text-sm text-warning dark:text-warning";
|
|
13
13
|
export function StoreHeader({ store, labels = {}, onFollow, className = "", }) {
|
|
14
|
-
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (
|
|
15
|
-
// audit-variant-ok: banner Div — h-40/md:h-56 responsive height ladder + bg-gray-100 placeholder while banner loads
|
|
16
|
-
_jsx(Div, { className: `h-40 md:h-56 ${__O.hidden} bg-gray-100 dark:bg-slate-800`, children: _jsx(Div, { role: "img", "aria-label": `${store.storeName} banner`, className: "h-full w-full bg-center bg-cover",
|
|
17
|
-
// audit-inline-style-ok: dynamic image URL
|
|
18
|
-
style: { backgroundImage: `url(${store.storeBannerURL})` } }) })), _jsxs(Div, { paddingX: "x-page", className: "max-w-7xl mx-auto", padding: "y-md", children: [_jsxs(Row, { align: "end", gap: "md", children: [store.storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": store.storeName, className: "-mt-8 h-16 w-16 border-2 border-white bg-center bg-cover", rounded: "xl", shadow: "sm",
|
|
19
|
-
// audit-inline-style-ok: dynamic image URL
|
|
20
|
-
style: { backgroundImage: `url(${store.storeLogoURL})` } })) : (_jsx(Div, { className: CLS_AVATAR, children: store.storeName[0]?.toUpperCase() })), _jsxs(Div, { className: "flex-1 min-w-0", children: [_jsxs(Row, { className: "mb-0.5", align: "center", gap: "sm", wrap: true, children: [_jsx(Heading, { level: 1, className: "text-gray-900", size: "xl", weight: "bold", children: store.storeName }), store.averageRating != null && store.averageRating > 0 && (_jsxs(Span, { size: "sm", weight: "medium", className: CLS_STARS, children: ["\u2605 ", store.averageRating.toFixed(1)] }))] }), _jsxs(Row, { textSize: "xs", className: "text-gray-500 mb-0.5", gap: "3", children: [store.category && _jsx(Span, { transform: "capitalize", children: store.category }), store.totalProducts != null && store.totalProducts > 0 && (_jsxs(Span, { children: [store.totalProducts, " ", labels.products ?? "products"] })), store.totalReviews != null && store.totalReviews > 0 && (_jsxs(Span, { children: [store.totalReviews, " ", labels.reviews ?? "reviews"] })), store.itemsSold != null && store.itemsSold > 0 && (_jsxs(Span, { children: [store.itemsSold, " ", labels.sold ?? "sold"] }))] }), store.storeDescription && (_jsx(RichText, { html: normalizeRichTextHtml(store.storeDescription), copyableCode: true, className: "mt-0.5" }))] }), _jsxs(Row, { gap: "sm", align: "center", className: "shrink-0", children: [_jsx(ShareButton, { title: store.storeName }), onFollow && (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => onFollow(store.storeSlug), className: CLS_FOLLOW_BTN, children: labels.follow ?? "Follow" }))] })] }), store.isVacationMode && (_jsx(Text, { className: CLS_WARN_BANNER, children: store.vacationMessage ??
|
|
14
|
+
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (_jsx(Div, { className: `h-40 md:h-56 ${__O.hidden} bg-gray-100 dark:bg-slate-800`, children: _jsx(Div, { role: "img", "aria-label": `${store.storeName} banner`, className: "h-full w-full bg-center bg-cover", style: { backgroundImage: `url(${store.storeBannerURL})` } }) })), _jsxs(Div, { paddingX: "x-page", className: "max-w-7xl mx-auto", padding: "y-md", children: [_jsxs(Row, { align: "end", gap: "md", children: [store.storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": store.storeName, className: "-mt-8 h-16 w-16 border-2 border-white bg-center bg-cover", rounded: "xl", shadow: "sm", style: { backgroundImage: `url(${store.storeLogoURL})` } })) : (_jsx(Div, { className: CLS_AVATAR, children: store.storeName[0]?.toUpperCase() })), _jsxs(Div, { className: "flex-1 min-w-0", children: [_jsxs(Row, { className: "mb-0.5", align: "center", gap: "sm", wrap: true, children: [_jsx(Heading, { level: 1, className: "text-gray-900", size: "xl", weight: "bold", children: store.storeName }), store.averageRating != null && store.averageRating > 0 && (_jsxs(Span, { size: "sm", weight: "medium", className: CLS_STARS, children: ["\u2605 ", store.averageRating.toFixed(1)] }))] }), _jsxs(Row, { textSize: "xs", className: "text-gray-500 mb-0.5", gap: "3", children: [store.category && _jsx(Span, { transform: "capitalize", children: store.category }), store.totalProducts != null && store.totalProducts > 0 && (_jsxs(Span, { children: [store.totalProducts, " ", labels.products ?? "products"] })), store.totalReviews != null && store.totalReviews > 0 && (_jsxs(Span, { children: [store.totalReviews, " ", labels.reviews ?? "reviews"] })), store.itemsSold != null && store.itemsSold > 0 && (_jsxs(Span, { children: [store.itemsSold, " ", labels.sold ?? "sold"] }))] }), store.storeDescription && (_jsx(RichText, { html: normalizeRichTextHtml(store.storeDescription), copyableCode: true, className: "mt-0.5" }))] }), _jsxs(Row, { gap: "sm", align: "center", className: "shrink-0", children: [_jsx(ShareButton, { title: store.storeName }), onFollow && (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => onFollow(store.storeSlug), className: CLS_FOLLOW_BTN, children: labels.follow ?? "Follow" }))] })] }), store.isVacationMode && (_jsx(Text, { className: CLS_WARN_BANNER, children: store.vacationMessage ??
|
|
21
15
|
labels.vacationMode ??
|
|
22
16
|
"Store is on vacation mode" })), _jsx(Div, { className: "mt-3", children: _jsx(StoreScopedSearch, { storeId: store.storeSlug, storeName: store.storeName }) })] })] }));
|
|
23
17
|
}
|
|
@@ -62,7 +62,6 @@ export function StoreReviewsListing({ storeSlug }) {
|
|
|
62
62
|
buildSieveParams: () => "",
|
|
63
63
|
buildSearchParams: () => "",
|
|
64
64
|
params: new URLSearchParams(),
|
|
65
|
-
// audit-unknown-ok: TS structural escape — table-state type
|
|
66
65
|
}), [pendingFilters]);
|
|
67
66
|
const openFilters = useCallback(() => {
|
|
68
67
|
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
@@ -65,7 +65,6 @@ export function StoresIndexListing({ initialData }) {
|
|
|
65
65
|
buildSieveParams: () => "",
|
|
66
66
|
buildSearchParams: () => "",
|
|
67
67
|
params: new URLSearchParams(),
|
|
68
|
-
// audit-unknown-ok: TS structural escape — table-state type
|
|
69
68
|
}), [pendingFilters]);
|
|
70
69
|
const openFilters = useCallback(() => {
|
|
71
70
|
setPendingFilters(Object.fromEntries(FILTER_KEYS.map((k) => [k, table.get(k)])));
|
|
@@ -32,7 +32,6 @@ export class StoreRepository extends BaseRepository {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
mapDoc(snap) {
|
|
35
|
-
// audit-unknown-ok: TS structural escape — generic param
|
|
36
35
|
return this.decryptSecrets(super.mapDoc(snap));
|
|
37
36
|
}
|
|
38
37
|
async update(id, data) {
|
|
@@ -64,7 +63,6 @@ export class StoreRepository extends BaseRepository {
|
|
|
64
63
|
.collection(this.collection)
|
|
65
64
|
.doc(input.storeSlug)
|
|
66
65
|
.create(prepareForFirestore(this.encryptSecrets(storeData)));
|
|
67
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
68
66
|
}
|
|
69
67
|
catch (err) { // audit-catch-raw-ok: pre-existing-handler-intentional
|
|
70
68
|
// gRPC ALREADY_EXISTS = code 6
|
|
@@ -5,9 +5,7 @@ const CLS_REMOVE_BTN = "self-start text-zinc-400 dark:text-zinc-400 transition h
|
|
|
5
5
|
export function WishlistCard({ item, onRemove, onProductClick, }) {
|
|
6
6
|
return (_jsxs(Div, { layout: "flex", gap: "4", surface: "card", padding: "sm", children: [_jsx(Div, { role: onProductClick ? "button" : undefined, tabIndex: onProductClick ? 0 : undefined, onClick: onProductClick ? () => onProductClick(item) : undefined, onKeyDown: onProductClick
|
|
7
7
|
? (e) => e.key === "Enter" && onProductClick(item)
|
|
8
|
-
: undefined, className: `h-20 w-20 flex-shrink-0 overflow-hidden bg-neutral-100 dark:bg-slate-800 ${onProductClick ? "cursor-pointer" : ""}`, rounded: "lg", children: item.productImage && (_jsx(Div, { role: "img", "aria-label": item.productTitle ?? "", className: "h-full w-full bg-center bg-cover",
|
|
9
|
-
// audit-inline-style-ok: dynamic image URL
|
|
10
|
-
style: { backgroundImage: `url(${item.productImage})` } })) }), _jsxs(Stack, { justify: "between", className: "flex-1", children: [_jsx(Text, { truncate: 2, weight: "medium", color: "primary", children: item.productTitle }), item.productPrice !== undefined && (_jsx(Text, { className: "text-neutral-900 dark:text-neutral-100", size: "sm", weight: "semibold", children: formatCurrency(item.productPrice, item.productCurrency) }))] }), onRemove && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onRemove(item.id), "aria-label": "Remove from wishlist", className: CLS_REMOVE_BTN, children: "\u2715" }))] }));
|
|
8
|
+
: undefined, className: `h-20 w-20 flex-shrink-0 overflow-hidden bg-neutral-100 dark:bg-slate-800 ${onProductClick ? "cursor-pointer" : ""}`, rounded: "lg", children: item.productImage && (_jsx(Div, { role: "img", "aria-label": item.productTitle ?? "", className: "h-full w-full bg-center bg-cover", style: { backgroundImage: `url(${item.productImage})` } })) }), _jsxs(Stack, { justify: "between", className: "flex-1", children: [_jsx(Text, { truncate: 2, weight: "medium", color: "primary", children: item.productTitle }), item.productPrice !== undefined && (_jsx(Text, { className: "text-neutral-900 dark:text-neutral-100", size: "sm", weight: "semibold", children: formatCurrency(item.productPrice, item.productCurrency) }))] }), onRemove && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onRemove(item.id), "aria-label": "Remove from wishlist", className: CLS_REMOVE_BTN, children: "\u2715" }))] }));
|
|
11
9
|
}
|
|
12
10
|
export function WishlistPage({ items, isLoading, onRemove, onProductClick, emptyLabel = "Your wishlist is empty", }) {
|
|
13
11
|
if (isLoading) {
|
|
@@ -77,7 +77,7 @@ export function useWishlistCount(userId) {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
})
|
|
80
|
-
.catch(() => { })
|
|
80
|
+
.catch(() => { })
|
|
81
81
|
.finally(finish);
|
|
82
82
|
}, [userId, queryClient]);
|
|
83
83
|
// Refetch when the user lands on /wishlist or /cart so the badge matches
|
|
@@ -20,7 +20,6 @@ export class WishlistFullError extends Error {
|
|
|
20
20
|
this.current = current;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
24
23
|
function toDate(raw) {
|
|
25
24
|
if (raw instanceof Date)
|
|
26
25
|
return raw;
|
|
@@ -31,7 +30,6 @@ function toDate(raw) {
|
|
|
31
30
|
return new Date(raw);
|
|
32
31
|
return new Date();
|
|
33
32
|
}
|
|
34
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
35
33
|
function normaliseItems(raw) {
|
|
36
34
|
if (!Array.isArray(raw))
|
|
37
35
|
return [];
|
package/dist/http/ApiClient.js
CHANGED
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export class ApiClientError extends Error {
|
|
20
|
-
constructor(message, status,
|
|
21
|
-
// audit-unknown-ok: HTTP body/response — arbitrary JSON
|
|
22
|
-
data) {
|
|
20
|
+
constructor(message, status, data) {
|
|
23
21
|
super(message);
|
|
24
22
|
this.status = status;
|
|
25
23
|
this.data = data;
|
|
@@ -110,27 +108,21 @@ export class ApiClient {
|
|
|
110
108
|
async get(endpoint, config) {
|
|
111
109
|
return this.request(endpoint, { ...config, method: "GET" });
|
|
112
110
|
}
|
|
113
|
-
async post(endpoint,
|
|
114
|
-
// audit-unknown-ok: HTTP body/response — arbitrary JSON
|
|
115
|
-
data, config) {
|
|
111
|
+
async post(endpoint, data, config) {
|
|
116
112
|
return this.request(endpoint, {
|
|
117
113
|
...config,
|
|
118
114
|
method: "POST",
|
|
119
115
|
body: data != null ? JSON.stringify(data) : undefined,
|
|
120
116
|
});
|
|
121
117
|
}
|
|
122
|
-
async put(endpoint,
|
|
123
|
-
// audit-unknown-ok: HTTP body/response — arbitrary JSON
|
|
124
|
-
data, config) {
|
|
118
|
+
async put(endpoint, data, config) {
|
|
125
119
|
return this.request(endpoint, {
|
|
126
120
|
...config,
|
|
127
121
|
method: "PUT",
|
|
128
122
|
body: data != null ? JSON.stringify(data) : undefined,
|
|
129
123
|
});
|
|
130
124
|
}
|
|
131
|
-
async patch(endpoint,
|
|
132
|
-
// audit-unknown-ok: HTTP body/response — arbitrary JSON
|
|
133
|
-
data, config) {
|
|
125
|
+
async patch(endpoint, data, config) {
|
|
134
126
|
return this.request(endpoint, {
|
|
135
127
|
...config,
|
|
136
128
|
method: "PATCH",
|
package/dist/index.js
CHANGED
|
@@ -985,7 +985,6 @@ export { resolvePermissions } from "./security/index";
|
|
|
985
985
|
export { AddressesRepository } from "./repositories/index";
|
|
986
986
|
// S-STORE foundation — 14 schemas + 14 repositories + RBAC.
|
|
987
987
|
// store-extensions barrel: named-export expansion would be ~200 lines.
|
|
988
|
-
// reexport-from-internal-ok
|
|
989
988
|
export * from "./features/store-extensions/index";
|
|
990
989
|
// [DB]-Database layer â€" uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
|
|
991
990
|
// BaseRepository - Shared export for base repository.
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { logger } from "../core/Logger";
|
|
10
10
|
import { AppError } from "../errors";
|
|
11
|
-
function buildClientMeta(
|
|
12
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
13
|
-
error, context) {
|
|
11
|
+
function buildClientMeta(error, context) {
|
|
14
12
|
const base = {
|
|
15
13
|
...context,
|
|
16
14
|
timestamp: new Date().toISOString(),
|
|
@@ -43,9 +41,7 @@ error, context) {
|
|
|
43
41
|
}
|
|
44
42
|
return base;
|
|
45
43
|
}
|
|
46
|
-
export const logClientError = (message,
|
|
47
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
48
|
-
error, context) => {
|
|
44
|
+
export const logClientError = (message, error, context) => {
|
|
49
45
|
logger.error(message, buildClientMeta(error, context));
|
|
50
46
|
};
|
|
51
47
|
export const logClientWarning = (message, data) => {
|
|
@@ -58,7 +54,6 @@ export const logClientDebug = (message, data) => {
|
|
|
58
54
|
logger.debug(message, { ...data, timestamp: new Date().toISOString() });
|
|
59
55
|
};
|
|
60
56
|
export const logApiError = async (endpoint, response, context) => {
|
|
61
|
-
// audit-unknown-ok: client logger — accepts arbitrary serialisable values
|
|
62
57
|
let responseBody;
|
|
63
58
|
try {
|
|
64
59
|
responseBody = await response.clone().json();
|
|
@@ -81,45 +76,35 @@ export const logValidationError = (formName, errors, context) => {
|
|
|
81
76
|
validationErrors: errors,
|
|
82
77
|
});
|
|
83
78
|
};
|
|
84
|
-
export const logNavigationError = (route,
|
|
85
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
86
|
-
error, context) => {
|
|
79
|
+
export const logNavigationError = (route, error, context) => {
|
|
87
80
|
logClientError(`Navigation error to ${route}`, error, {
|
|
88
81
|
...context,
|
|
89
82
|
route,
|
|
90
83
|
type: "navigation",
|
|
91
84
|
});
|
|
92
85
|
};
|
|
93
|
-
export const logAuthError = (operation,
|
|
94
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
95
|
-
error, context) => {
|
|
86
|
+
export const logAuthError = (operation, error, context) => {
|
|
96
87
|
logClientError(`Authentication error: ${operation}`, error, {
|
|
97
88
|
...context,
|
|
98
89
|
operation,
|
|
99
90
|
type: "authentication",
|
|
100
91
|
});
|
|
101
92
|
};
|
|
102
|
-
export const logUploadError = (fileName,
|
|
103
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
104
|
-
error, context) => {
|
|
93
|
+
export const logUploadError = (fileName, error, context) => {
|
|
105
94
|
logClientError(`File upload failed: ${fileName}`, error, {
|
|
106
95
|
...context,
|
|
107
96
|
fileName,
|
|
108
97
|
type: "upload",
|
|
109
98
|
});
|
|
110
99
|
};
|
|
111
|
-
export const logPaymentError = (transactionId,
|
|
112
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
113
|
-
error, context) => {
|
|
100
|
+
export const logPaymentError = (transactionId, error, context) => {
|
|
114
101
|
logClientError(`Payment error: ${transactionId}`, error, {
|
|
115
102
|
...context,
|
|
116
103
|
transactionId,
|
|
117
104
|
type: "payment",
|
|
118
105
|
});
|
|
119
106
|
};
|
|
120
|
-
export const logApplicationError = (category, message,
|
|
121
|
-
// audit-unknown-ok: error-handler entry point — accepts thrown values of any shape
|
|
122
|
-
error, context) => {
|
|
107
|
+
export const logApplicationError = (category, message, error, context) => {
|
|
123
108
|
logClientError(`[${category}] ${message}`, error, {
|
|
124
109
|
...context,
|
|
125
110
|
category,
|
|
@@ -32,7 +32,6 @@ function getTracker() {
|
|
|
32
32
|
}
|
|
33
33
|
/** Override the default console-based tracker with a custom implementation. */
|
|
34
34
|
export function setErrorTracker(fn) {
|
|
35
|
-
// audit-unknown-ok: observability adapter — global type augmentation
|
|
36
35
|
globalThis[TRACKER_KEY] = fn;
|
|
37
36
|
}
|
|
38
37
|
export function trackError(error, category = ErrorCategory.UNKNOWN, severity = ErrorSeverity.MEDIUM, context) {
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
const PROVIDER_KEY = "__mohasinac_perf_provider__";
|
|
12
12
|
/** Register a concrete performance backend (call once in instrumentation). */
|
|
13
13
|
export function setPerformanceProvider(provider) {
|
|
14
|
-
// audit-unknown-ok: performance adapter — global type augmentation
|
|
15
14
|
globalThis[PROVIDER_KEY] = provider;
|
|
16
15
|
}
|
|
17
16
|
function getProvider() {
|
|
@@ -40,10 +40,8 @@ function serializeError(error) {
|
|
|
40
40
|
}
|
|
41
41
|
return serialized;
|
|
42
42
|
}
|
|
43
|
-
// audit-unknown-ok: this is the entry-point normaliser that accepts arbitrary
|
|
44
43
|
// log-data payloads (Error, Date, primitive, object). Output is bounded by the
|
|
45
44
|
// downstream JSON-stringify contract.
|
|
46
|
-
// audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
|
|
47
45
|
function normalizeLogData(data) {
|
|
48
46
|
if (data instanceof Error)
|
|
49
47
|
return serializeError(data);
|
|
@@ -138,12 +136,10 @@ async function writeLog(entry) {
|
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
138
|
export const serverLogger = {
|
|
141
|
-
// audit-unknown-ok: logger entry-point — accepts arbitrary log data, normalised internally
|
|
142
139
|
debug(message, data) {
|
|
143
140
|
const sanitized = data ? redactPii(normalizeLogData(data)) : undefined;
|
|
144
141
|
console.debug(`[DEBUG] ${message}`, sanitized);
|
|
145
142
|
},
|
|
146
|
-
// audit-unknown-ok: logger entry-point — accepts arbitrary log data
|
|
147
143
|
info(message, data) {
|
|
148
144
|
const sanitized = data ? redactPii(normalizeLogData(data)) : undefined;
|
|
149
145
|
const entry = {
|
|
@@ -154,9 +150,8 @@ export const serverLogger = {
|
|
|
154
150
|
};
|
|
155
151
|
console.info(`[INFO] ${message}`, sanitized);
|
|
156
152
|
if (isFileLoggingEnabled)
|
|
157
|
-
writeLog(entry).catch(() => { });
|
|
153
|
+
writeLog(entry).catch(() => { });
|
|
158
154
|
},
|
|
159
|
-
// audit-unknown-ok: logger entry-point — accepts arbitrary log data
|
|
160
155
|
warn(message, data) {
|
|
161
156
|
const sanitized = data ? redactPii(normalizeLogData(data)) : undefined;
|
|
162
157
|
const entry = {
|
|
@@ -167,9 +162,8 @@ export const serverLogger = {
|
|
|
167
162
|
};
|
|
168
163
|
console.warn(`[WARN] ${message}`, sanitized);
|
|
169
164
|
if (isFileLoggingEnabled)
|
|
170
|
-
writeLog(entry).catch(() => { });
|
|
165
|
+
writeLog(entry).catch(() => { });
|
|
171
166
|
},
|
|
172
|
-
// audit-unknown-ok: logger entry-point — accepts arbitrary log data
|
|
173
167
|
error(message, data) {
|
|
174
168
|
const sanitized = data ? redactPii(normalizeLogData(data)) : undefined;
|
|
175
169
|
const entry = {
|
|
@@ -180,7 +174,7 @@ export const serverLogger = {
|
|
|
180
174
|
};
|
|
181
175
|
console.error(`[ERROR] ${message}`, sanitized);
|
|
182
176
|
if (isFileLoggingEnabled)
|
|
183
|
-
writeLog(entry).catch(() => { });
|
|
177
|
+
writeLog(entry).catch(() => { });
|
|
184
178
|
},
|
|
185
179
|
};
|
|
186
180
|
/** Pull the commonly needed headers from a NextRequest in one call. */
|
|
@@ -193,9 +187,7 @@ export const extractRequestMetadata = (request) => ({
|
|
|
193
187
|
"unknown",
|
|
194
188
|
referer: request.headers.get("referer") ?? "none",
|
|
195
189
|
});
|
|
196
|
-
function buildServerMeta(
|
|
197
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
198
|
-
error, context) {
|
|
190
|
+
function buildServerMeta(error, context) {
|
|
199
191
|
const base = {
|
|
200
192
|
...context,
|
|
201
193
|
timestamp: new Date().toISOString(),
|
|
@@ -226,9 +218,7 @@ error, context) {
|
|
|
226
218
|
}
|
|
227
219
|
return base;
|
|
228
220
|
}
|
|
229
|
-
export const logServerError = (message,
|
|
230
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
231
|
-
error, context) => {
|
|
221
|
+
export const logServerError = (message, error, context) => {
|
|
232
222
|
serverLogger.error(message, buildServerMeta(error, context));
|
|
233
223
|
};
|
|
234
224
|
export const logServerWarning = (message, data) => {
|
|
@@ -240,18 +230,14 @@ export const logServerInfo = (message, data) => {
|
|
|
240
230
|
export const logServerDebug = (message, data) => {
|
|
241
231
|
serverLogger.debug(message, { ...data, timestamp: new Date().toISOString() });
|
|
242
232
|
};
|
|
243
|
-
export const logApiRouteError = (endpoint,
|
|
244
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
245
|
-
error, request, context) => {
|
|
233
|
+
export const logApiRouteError = (endpoint, error, request, context) => {
|
|
246
234
|
logServerError(`API Route Error: ${endpoint}`, error, {
|
|
247
235
|
...context,
|
|
248
236
|
endpoint,
|
|
249
237
|
...(request ? extractRequestMetadata(request) : {}),
|
|
250
238
|
});
|
|
251
239
|
};
|
|
252
|
-
export const logDatabaseError = (operation, collection,
|
|
253
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
254
|
-
error, context) => {
|
|
240
|
+
export const logDatabaseError = (operation, collection, error, context) => {
|
|
255
241
|
logServerError(`Database Error: ${operation} on ${collection}`, error, {
|
|
256
242
|
...context,
|
|
257
243
|
operation,
|
|
@@ -259,9 +245,7 @@ error, context) => {
|
|
|
259
245
|
type: "database",
|
|
260
246
|
});
|
|
261
247
|
};
|
|
262
|
-
export const logServerAuthError = (operation,
|
|
263
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
264
|
-
error, context) => {
|
|
248
|
+
export const logServerAuthError = (operation, error, context) => {
|
|
265
249
|
logServerError(`Authentication Error: ${operation}`, error, {
|
|
266
250
|
...context,
|
|
267
251
|
operation,
|
|
@@ -277,18 +261,14 @@ export const logAuthorizationError = (userId, resource, action, context) => {
|
|
|
277
261
|
type: "authorization",
|
|
278
262
|
});
|
|
279
263
|
};
|
|
280
|
-
export const logEmailError = (recipient,
|
|
281
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
282
|
-
error, context) => {
|
|
264
|
+
export const logEmailError = (recipient, error, context) => {
|
|
283
265
|
logServerError(`Email Send Failed to ${recipient}`, error, {
|
|
284
266
|
...context,
|
|
285
267
|
recipient,
|
|
286
268
|
type: "email",
|
|
287
269
|
});
|
|
288
270
|
};
|
|
289
|
-
export const logStorageError = (operation, filePath,
|
|
290
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
291
|
-
error, context) => {
|
|
271
|
+
export const logStorageError = (operation, filePath, error, context) => {
|
|
292
272
|
logServerError(`Storage Error: ${operation} on ${filePath}`, error, {
|
|
293
273
|
...context,
|
|
294
274
|
operation,
|
|
@@ -296,9 +276,7 @@ error, context) => {
|
|
|
296
276
|
type: "storage",
|
|
297
277
|
});
|
|
298
278
|
};
|
|
299
|
-
export const logExternalApiError = (serviceName, endpoint,
|
|
300
|
-
// audit-unknown-ok: error-handler entry point — receives thrown values
|
|
301
|
-
error, context) => {
|
|
279
|
+
export const logExternalApiError = (serviceName, endpoint, error, context) => {
|
|
302
280
|
logServerError(`External API Error: ${serviceName} - ${endpoint}`, error, {
|
|
303
281
|
...context,
|
|
304
282
|
serviceName,
|