@mohasinac/appkit 4.59.0 โ 4.60.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/.build-stamp.json +3 -3
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +62 -5
- package/dist/_internal/client/features/maintenance/views/MaintenanceDashboardView.js +2 -2
- package/dist/_internal/server/features/brands/actions.js +78 -4
- package/dist/_internal/server/features/checkout/actions.d.ts +36 -13
- package/dist/_internal/server/features/checkout/actions.js +668 -183
- package/dist/_internal/server/features/checkout/supplier-identity.js +18 -1
- package/dist/_internal/server/features/gateway-events/index.d.ts +10 -0
- package/dist/_internal/server/features/gateway-events/index.js +10 -0
- package/dist/_internal/server/features/gateway-events/ingest.d.ts +127 -0
- package/dist/_internal/server/features/gateway-events/ingest.js +188 -0
- package/dist/_internal/server/features/gateway-events/redact.d.ts +66 -0
- package/dist/_internal/server/features/gateway-events/redact.js +151 -0
- package/dist/_internal/server/features/grievance/actions.d.ts +63 -0
- package/dist/_internal/server/features/grievance/actions.js +173 -0
- package/dist/_internal/server/features/grievance/index.d.ts +8 -0
- package/dist/_internal/server/features/grievance/index.js +8 -0
- package/dist/_internal/server/features/grouped/data.js +28 -3
- package/dist/_internal/server/features/lottery/actions.js +99 -4
- package/dist/_internal/server/features/order-completion/actions.d.ts +92 -0
- package/dist/_internal/server/features/order-completion/actions.js +336 -0
- package/dist/_internal/server/features/order-completion/index.d.ts +7 -0
- package/dist/_internal/server/features/order-completion/index.js +7 -0
- package/dist/_internal/server/features/orders/actions.d.ts +13 -0
- package/dist/_internal/server/features/orders/actions.js +56 -2
- package/dist/_internal/server/features/orders/adapters.d.ts +20 -2
- package/dist/_internal/server/features/orders/adapters.js +44 -0
- package/dist/_internal/server/features/orders/cancellation-refund.d.ts +116 -0
- package/dist/_internal/server/features/orders/cancellation-refund.js +466 -0
- package/dist/_internal/server/features/orders/index.d.ts +2 -1
- package/dist/_internal/server/features/orders/index.js +1 -1
- package/dist/_internal/server/features/orders/service.d.ts +60 -0
- package/dist/_internal/server/features/orders/service.js +74 -0
- package/dist/_internal/server/features/payment-cases/disputes.d.ts +76 -0
- package/dist/_internal/server/features/payment-cases/disputes.js +241 -0
- package/dist/_internal/server/features/payment-cases/index.d.ts +9 -0
- package/dist/_internal/server/features/payment-cases/index.js +9 -0
- package/dist/_internal/server/features/payouts/actions.d.ts +28 -3
- package/dist/_internal/server/features/payouts/actions.js +84 -10
- package/dist/_internal/server/features/points/adjust.d.ts +61 -0
- package/dist/_internal/server/features/points/adjust.js +121 -0
- package/dist/_internal/server/features/points/award.d.ts +65 -0
- package/dist/_internal/server/features/points/award.js +145 -0
- package/dist/_internal/server/features/price-index/market.d.ts +33 -0
- package/dist/_internal/server/features/price-index/market.js +54 -1
- package/dist/_internal/server/features/products/data.js +40 -22
- package/dist/_internal/server/features/protection-claims/actions.d.ts +72 -0
- package/dist/_internal/server/features/protection-claims/actions.js +228 -0
- package/dist/_internal/server/features/protection-claims/index.d.ts +8 -0
- package/dist/_internal/server/features/protection-claims/index.js +8 -0
- package/dist/_internal/server/features/refunds/actions.d.ts +20 -0
- package/dist/_internal/server/features/refunds/actions.js +259 -17
- package/dist/_internal/server/features/refunds/capacity.d.ts +29 -0
- package/dist/_internal/server/features/refunds/capacity.js +37 -0
- package/dist/_internal/server/features/reviews/actions.js +3 -2
- package/dist/_internal/server/features/search/index-build/sources.js +20 -1
- package/dist/_internal/server/features/shipping/reconcile.d.ts +10 -1
- package/dist/_internal/server/features/shipping/reconcile.js +34 -3
- package/dist/_internal/server/features/shipping/reimbursement.d.ts +117 -0
- package/dist/_internal/server/features/shipping/reimbursement.js +223 -0
- package/dist/_internal/server/features/stores/tabs.d.ts +19 -4
- package/dist/_internal/server/features/stores/tabs.js +24 -4
- package/dist/_internal/server/functions/https.d.ts +31 -1
- package/dist/_internal/server/functions/https.js +52 -1
- package/dist/_internal/server/functions/scheduled.d.ts +72 -1
- package/dist/_internal/server/functions/scheduled.js +124 -1
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +62 -16
- package/dist/_internal/server/jobs/core/boxRollupReconcile.d.ts +46 -0
- package/dist/_internal/server/jobs/core/boxRollupReconcile.js +142 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.js +149 -1
- package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +14 -0
- package/dist/_internal/server/jobs/core/dailyStatusDigest.js +79 -1
- package/dist/_internal/server/jobs/core/index.d.ts +2 -0
- package/dist/_internal/server/jobs/core/index.js +2 -0
- package/dist/_internal/server/jobs/core/marketPriceRollup.d.ts +64 -0
- package/dist/_internal/server/jobs/core/marketPriceRollup.js +153 -0
- package/dist/_internal/server/jobs/core/obligationSweep.d.ts +36 -0
- package/dist/_internal/server/jobs/core/obligationSweep.js +503 -0
- package/dist/_internal/server/jobs/core/paymentReconcile.d.ts +79 -0
- package/dist/_internal/server/jobs/core/paymentReconcile.js +614 -0
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +34 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +35 -4
- package/dist/_internal/server/jobs/handlers/boxRollupReconcile.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/boxRollupReconcile.js +15 -0
- package/dist/_internal/server/jobs/handlers/countersReconcileNow.d.ts +65 -0
- package/dist/_internal/server/jobs/handlers/countersReconcileNow.js +89 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +5 -0
- package/dist/_internal/server/jobs/handlers/index.js +5 -0
- package/dist/_internal/server/jobs/handlers/marketPriceRollup.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/marketPriceRollup.js +2 -0
- package/dist/_internal/server/jobs/handlers/obligationSweep.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/obligationSweep.js +15 -0
- package/dist/_internal/server/jobs/handlers/onShipmentAllocationSync.js +30 -1
- package/dist/_internal/server/jobs/handlers/paymentReconcile.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/paymentReconcile.js +6 -0
- package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
- package/dist/_internal/shared/actions/action-registry.js +71 -0
- package/dist/_internal/shared/checkout/coupon-discount.d.ts +73 -0
- package/dist/_internal/shared/checkout/coupon-discount.js +103 -0
- package/dist/_internal/shared/checkout/lanes.d.ts +42 -0
- package/dist/_internal/shared/checkout/lanes.js +46 -0
- package/dist/_internal/shared/checkout/order-math.d.ts +149 -1
- package/dist/_internal/shared/checkout/order-math.js +251 -3
- package/dist/_internal/shared/checkout/refundable-base.d.ts +116 -0
- package/dist/_internal/shared/checkout/refundable-base.js +122 -0
- package/dist/_internal/shared/features/auctions/config.d.ts +14 -1
- package/dist/_internal/shared/features/auctions/config.js +30 -1
- package/dist/_internal/shared/features/brands/schema.d.ts +42 -0
- package/dist/_internal/shared/features/brands/schema.js +18 -0
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +22 -0
- package/dist/_internal/shared/features/orders/refund-copy.js +34 -0
- package/dist/_internal/shared/features/print/label-profiles.d.ts +198 -0
- package/dist/_internal/shared/features/print/label-profiles.js +350 -0
- package/dist/_internal/shared/features/products/to-product-item.js +33 -5
- package/dist/_internal/shared/fees/calculator.d.ts +31 -2
- package/dist/_internal/shared/fees/calculator.js +103 -5
- package/dist/_internal/shared/fees/india-states.d.ts +195 -0
- package/dist/_internal/shared/fees/india-states.js +190 -0
- package/dist/_internal/shared/fees/payout-hold.d.ts +80 -0
- package/dist/_internal/shared/fees/payout-hold.js +74 -0
- package/dist/_internal/shared/obligations/deadlines.d.ts +94 -0
- package/dist/_internal/shared/obligations/deadlines.js +155 -0
- package/dist/_internal/shared/shipping/quote.d.ts +96 -0
- package/dist/_internal/shared/shipping/quote.js +67 -0
- package/dist/_internal/shared/time/business-days.d.ts +91 -0
- package/dist/_internal/shared/time/business-days.js +185 -0
- package/dist/cli/index.js +0 -2
- package/dist/client.d.ts +10 -4
- package/dist/client.js +29 -3
- package/dist/configs/tailwind.d.ts +0 -12
- package/dist/configs/tailwind.js +28 -15
- package/dist/constants/api-endpoints.d.ts +51 -9
- package/dist/constants/api-endpoints.js +23 -7
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/payment.d.ts +131 -0
- package/dist/features/about/components/AboutView.js +1 -1
- package/dist/features/about/components/DeveloperView.js +5 -2
- package/dist/features/about/components/FAQPageView.js +2 -1
- package/dist/features/about/components/FeesView.js +2 -1
- package/dist/features/about/components/HelpPageView.js +2 -1
- package/dist/features/about/components/HowAuctionsWorkView.js +2 -1
- package/dist/features/about/components/HowCheckoutWorksView.js +2 -1
- package/dist/features/about/components/HowEmiWorksView.js +2 -1
- package/dist/features/about/components/HowOffersWorkView.js +2 -1
- package/dist/features/about/components/HowOrdersWorkView.js +2 -1
- package/dist/features/about/components/HowPayoutsWorkView.js +2 -1
- package/dist/features/about/components/HowPreOrdersWorkView.js +2 -1
- package/dist/features/about/components/HowReviewsWorkView.js +2 -1
- package/dist/features/about/components/PolicyPageView.js +2 -1
- package/dist/features/about/components/ProseHero.d.ts +73 -0
- package/dist/features/about/components/ProseHero.js +18 -0
- package/dist/features/about/components/SecurityPrivacyView.js +2 -1
- package/dist/features/about/components/ShippingPolicyView.js +2 -1
- package/dist/features/about/components/TrackOrderView.js +2 -1
- package/dist/features/about/components/UnauthorizedView.js +1 -1
- package/dist/features/about/index.d.ts +2 -0
- package/dist/features/about/index.js +5 -0
- package/dist/features/account/actions/address-actions.d.ts +26 -2
- package/dist/features/account/actions/address-actions.js +25 -1
- package/dist/features/account/components/BuyerShoppingGuideView.js +1 -1
- package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
- package/dist/features/account/components/UserOrdersView.js +17 -0
- package/dist/features/account/components/UserSidebar.js +1 -1
- package/dist/features/account/hooks/useNotifications.js +29 -0
- package/dist/features/admin/actions/admin-coupon-actions.js +36 -0
- package/dist/features/admin/components/AdminBeysView.js +2 -2
- package/dist/features/admin/components/AdminBlogEditorView.js +2 -2
- package/dist/features/admin/components/AdminBrandEditorView.js +32 -2
- package/dist/features/admin/components/AdminBundleEditorView.js +1 -1
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
- package/dist/features/admin/components/AdminCategoriesView.js +1 -1
- package/dist/features/admin/components/AdminCategoryEditorView.js +73 -17
- package/dist/features/admin/components/AdminContactEditorView.js +1 -1
- package/dist/features/admin/components/AdminCouponEditorView.js +26 -1
- package/dist/features/admin/components/AdminFaqEditorView.js +1 -1
- package/dist/features/admin/components/AdminFaqsView.js +2 -2
- package/dist/features/admin/components/AdminGatewayEventsView.d.ts +54 -0
- package/dist/features/admin/components/AdminGatewayEventsView.js +209 -0
- package/dist/features/admin/components/AdminGuideHubView.js +1 -1
- package/dist/features/admin/components/AdminMoneyCasesView.d.ts +60 -0
- package/dist/features/admin/components/AdminMoneyCasesView.js +287 -0
- package/dist/features/admin/components/AdminPartsView.js +2 -2
- package/dist/features/admin/components/AdminProductsView.js +75 -4
- package/dist/features/admin/components/AdminSidebar.js +2 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +65 -7
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +2 -0
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +1 -1
- package/dist/features/admin/components/AdminSupportTicketsView.js +2 -2
- package/dist/features/admin/components/AdminTesterChecklistView.js +2 -2
- package/dist/features/admin/components/AdminUsersView.js +72 -1
- package/dist/features/admin/components/AdminViewCards.d.ts +3 -1
- package/dist/features/admin/components/AdminViewCards.js +4 -4
- package/dist/features/admin/components/DataListingView.d.ts +28 -0
- package/dist/features/admin/components/DataListingView.js +175 -14
- package/dist/features/admin/components/DataTable.d.ts +12 -1
- package/dist/features/admin/components/DataTable.js +3 -3
- package/dist/features/admin/components/OwnerQuickActions.d.ts +1 -1
- package/dist/features/admin/components/OwnerQuickActions.js +60 -2
- package/dist/features/admin/components/RecordOwnerQuickActions.d.ts +1 -1
- package/dist/features/admin/components/RecordOwnerQuickActions.js +61 -14
- package/dist/features/admin/components/analytics/AdminStatCard.d.ts +35 -1
- package/dist/features/admin/components/analytics/AdminStatCard.js +77 -2
- package/dist/features/admin/components/index.d.ts +4 -0
- package/dist/features/admin/components/index.js +6 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +156 -0
- package/dist/features/admin/constants/filter-tabs.js +106 -0
- package/dist/features/admin/repository/site-settings.repository.d.ts +22 -0
- package/dist/features/admin/repository/site-settings.repository.js +82 -1
- package/dist/features/admin/schemas/admin-editor-forms.d.ts +21 -0
- package/dist/features/admin/schemas/admin-editor-forms.js +44 -0
- package/dist/features/admin/schemas/firestore.js +5 -1
- package/dist/features/admin/schemas/site-settings-form.js +30 -1
- package/dist/features/auctions/actions/bid-actions.js +13 -1
- package/dist/features/auctions/components/AuctionBottomActions.js +2 -2
- package/dist/features/auctions/components/AuctionDetailPageView.js +3 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +11 -0
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +5 -3
- package/dist/features/auctions/components/PlaceBidFormClient.d.ts +8 -1
- package/dist/features/auctions/components/PlaceBidFormClient.js +2 -2
- package/dist/features/audit-log/schemas/firestore.d.ts +28 -0
- package/dist/features/audit-log/schemas/firestore.js +14 -0
- package/dist/features/auth/permissions/constants.d.ts +17 -1
- package/dist/features/auth/permissions/constants.js +18 -0
- package/dist/features/blog/components/BlogPostView.js +1 -1
- package/dist/features/catalogue/components/AdminCatalogueApprovalsView.js +1 -1
- package/dist/features/categories/api/[id]/description-template/route.js +107 -1
- package/dist/features/categories/components/BrandDetailPageView.js +2 -2
- package/dist/features/categories/components/BreadcrumbTrail.js +7 -1
- package/dist/features/categories/components/BundleDetailView.js +1 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +2 -2
- package/dist/features/categories/components/CategoryForm.js +12 -1
- package/dist/features/categories/components/CategoryTemplatePicker.js +38 -5
- package/dist/features/categories/repository/market-price-index.repository.d.ts +123 -0
- package/dist/features/categories/repository/market-price-index.repository.js +105 -0
- package/dist/features/categories/repository/price-observation.repository.d.ts +166 -0
- package/dist/features/categories/repository/price-observation.repository.js +132 -0
- package/dist/features/events/components/EventSaleBanner.js +1 -1
- package/dist/features/events/components/EventStatusBadge.js +1 -1
- package/dist/features/faq/components/FAQAccordion.js +2 -1
- package/dist/features/faq/components/FAQCategorySidebar.js +2 -2
- package/dist/features/faq/components/FAQHelpfulButtons.js +4 -4
- package/dist/features/faq/components/RelatedFAQs.js +1 -1
- package/dist/features/filters/FilterFacetSection.js +1 -1
- package/dist/features/filters/SwitchFilter.js +1 -1
- package/dist/features/gateway-events/repository/gateway-events.repository.d.ts +117 -0
- package/dist/features/gateway-events/repository/gateway-events.repository.js +274 -0
- package/dist/features/gateway-events/schemas/firestore.d.ts +217 -0
- package/dist/features/gateway-events/schemas/firestore.js +125 -0
- package/dist/features/gateway-events/schemas/index.d.ts +81 -0
- package/dist/features/gateway-events/schemas/index.js +79 -0
- package/dist/features/grouped/components/GroupedListingDetailView.js +1 -1
- package/dist/features/homepage/components/AnnouncementBar.js +37 -1
- package/dist/features/homepage/components/AnnouncementBar.style.css +30 -0
- package/dist/features/homepage/components/BrandsSection.js +1 -1
- package/dist/features/homepage/components/CTABannerSection.js +1 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.js +14 -24
- package/dist/features/homepage/components/HeroCarousel.js +2 -2
- package/dist/features/homepage/components/SocialPostCard.js +1 -1
- package/dist/features/inventory/components/AdminMoveLedgerView.d.ts +7 -0
- package/dist/features/inventory/components/AdminMoveLedgerView.js +157 -0
- package/dist/features/inventory/components/AdminStorageBoxesView.d.ts +11 -0
- package/dist/features/inventory/components/AdminStorageBoxesView.js +168 -0
- package/dist/features/inventory/components/ReceiveStationView.d.ts +39 -0
- package/dist/features/inventory/components/ReceiveStationView.js +413 -0
- package/dist/features/inventory/components/operator-message.d.ts +29 -0
- package/dist/features/inventory/components/operator-message.js +41 -0
- package/dist/features/inventory/index.d.ts +13 -0
- package/dist/features/inventory/index.js +28 -0
- package/dist/features/inventory/repository/inventory-movements.repository.d.ts +97 -0
- package/dist/features/inventory/repository/inventory-movements.repository.js +186 -0
- package/dist/features/inventory/repository/inventory-placements.repository.d.ts +179 -0
- package/dist/features/inventory/repository/inventory-placements.repository.js +345 -0
- package/dist/features/inventory/repository/storage-boxes.repository.d.ts +83 -0
- package/dist/features/inventory/repository/storage-boxes.repository.js +127 -0
- package/dist/features/inventory/schemas/firestore.d.ts +197 -0
- package/dist/features/inventory/schemas/firestore.js +159 -0
- package/dist/features/layout/AppLayoutShell.d.ts +12 -1
- package/dist/features/layout/AppLayoutShell.js +25 -12
- package/dist/features/layout/AutoBreadcrumbs.js +162 -3
- package/dist/features/layout/AutoBreadcrumbs.style.css +45 -0
- package/dist/features/layout/BottomNavbar.d.ts +1 -1
- package/dist/features/layout/BottomNavbar.js +2 -2
- package/dist/features/media/MediaAvatar.js +1 -1
- package/dist/features/media/MediaImage.d.ts +24 -4
- package/dist/features/media/MediaImage.js +44 -4
- package/dist/features/media/MediaLightbox.js +1 -1
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/modals/ImageEditor.js +1 -1
- package/dist/features/media/upload/MediaUploadField.js +91 -3
- package/dist/features/obligations/constants/policies.d.ts +92 -0
- package/dist/features/obligations/constants/policies.js +378 -0
- package/dist/features/obligations/repository/obligations.repository.d.ts +68 -0
- package/dist/features/obligations/repository/obligations.repository.js +158 -0
- package/dist/features/obligations/schemas/firestore.d.ts +160 -0
- package/dist/features/obligations/schemas/firestore.js +87 -0
- package/dist/features/orders/actions/order-actions.d.ts +43 -4
- package/dist/features/orders/actions/order-actions.js +60 -3
- package/dist/features/orders/actions/refund-actions.js +70 -10
- package/dist/features/orders/components/OrderCompletionPanel.d.ts +27 -0
- package/dist/features/orders/components/OrderCompletionPanel.js +192 -0
- package/dist/features/orders/components/OrdersList.js +2 -2
- package/dist/features/orders/components/RefundHistoryTable.js +3 -1
- package/dist/features/orders/components/index.d.ts +2 -0
- package/dist/features/orders/components/index.js +6 -0
- package/dist/features/orders/constants/transitions.d.ts +59 -0
- package/dist/features/orders/constants/transitions.js +104 -0
- package/dist/features/orders/repository/orders.repository.d.ts +109 -6
- package/dist/features/orders/repository/orders.repository.js +464 -21
- package/dist/features/orders/schemas/firestore.d.ts +270 -0
- package/dist/features/orders/schemas/firestore.js +24 -0
- package/dist/features/orders/schemas/index.d.ts +61 -0
- package/dist/features/orders/schemas/index.js +22 -0
- package/dist/features/orders/types/index.d.ts +79 -0
- package/dist/features/parts/components/PartsIndexPageView.js +8 -1
- package/dist/features/payment-cases/repository/payment-cases.repository.d.ts +170 -0
- package/dist/features/payment-cases/repository/payment-cases.repository.js +342 -0
- package/dist/features/payment-cases/schemas/firestore.d.ts +229 -0
- package/dist/features/payment-cases/schemas/firestore.js +105 -0
- package/dist/features/payment-cases/schemas/resolve-form.d.ts +97 -0
- package/dist/features/payment-cases/schemas/resolve-form.js +114 -0
- package/dist/features/payments/repository/payout.repository.d.ts +0 -1
- package/dist/features/payments/repository/payout.repository.js +0 -1
- package/dist/features/points/repository/points.repository.d.ts +122 -0
- package/dist/features/points/repository/points.repository.js +304 -1
- package/dist/features/points/schemas/adjust-form.d.ts +58 -0
- package/dist/features/points/schemas/adjust-form.js +63 -0
- package/dist/features/points/schemas/firestore.d.ts +108 -1
- package/dist/features/points/schemas/firestore.js +84 -0
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +3 -3
- package/dist/features/pre-orders/components/PreOrderBadge.js +1 -1
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -1
- package/dist/features/price-index/components/PriceIndexToolView.d.ts +23 -4
- package/dist/features/price-index/components/PriceIndexToolView.js +71 -6
- package/dist/features/price-index/market-stats.d.ts +82 -0
- package/dist/features/price-index/market-stats.js +230 -0
- package/dist/features/print/components/BoxLabelPrintView.d.ts +25 -0
- package/dist/features/print/components/BoxLabelPrintView.js +66 -0
- package/dist/features/print/components/LabelProfilePicker.d.ts +13 -0
- package/dist/features/print/components/LabelProfilePicker.js +38 -0
- package/dist/features/print/components/labels.d.ts +117 -0
- package/dist/features/print/components/labels.js +258 -0
- package/dist/features/print/components/labels.style.css +46 -0
- package/dist/features/print/index.d.ts +6 -0
- package/dist/features/print/index.js +16 -0
- package/dist/features/products/columns/productTableColumns.js +5 -4
- package/dist/features/products/components/MarketplaceBundleCard.js +2 -2
- package/dist/features/products/components/MarketplacePrizeDrawCard.js +6 -6
- package/dist/features/products/components/PrizeDrawCollage.js +1 -1
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
- package/dist/features/products/components/PrizeRevealModal.js +2 -2
- package/dist/features/products/components/ProductDetailPageView.js +18 -4
- package/dist/features/products/components/ProductForm.js +34 -23
- package/dist/features/products/components/ProductGrid.js +86 -62
- package/dist/features/products/constants/card-badges.d.ts +97 -0
- package/dist/features/products/constants/card-badges.js +100 -0
- package/dist/features/products/repository/products.repository.js +34 -1
- package/dist/features/products/schemas/firestore.d.ts +46 -3
- package/dist/features/products/schemas/firestore.js +21 -0
- package/dist/features/promotions/components/PromotionsView.js +1 -1
- package/dist/features/promotions/repository/claimed-coupons.repository.d.ts +32 -0
- package/dist/features/promotions/repository/claimed-coupons.repository.js +58 -0
- package/dist/features/promotions/schemas/firestore.js +30 -3
- package/dist/features/promotions/schemas/index.d.ts +6 -6
- package/dist/features/protection-claims/repository/protection-claims.repository.d.ts +54 -0
- package/dist/features/protection-claims/repository/protection-claims.repository.js +174 -0
- package/dist/features/protection-claims/schemas/firestore.d.ts +168 -0
- package/dist/features/protection-claims/schemas/firestore.js +130 -0
- package/dist/features/reviews/actions/review-actions.js +3 -2
- package/dist/features/reviews/components/ReviewModal.js +1 -1
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/reviews/schemas/firestore.d.ts +20 -1
- package/dist/features/scams/constants/scam-types.d.ts +2 -0
- package/dist/features/scams/constants/scam-types.js +18 -0
- package/dist/features/scams/schemas/report-form.d.ts +3 -3
- package/dist/features/scams/schemas/report-form.js +26 -1
- package/dist/features/search/components/Search.js +9 -9
- package/dist/features/search/components/SearchResultsClient.js +18 -3
- package/dist/features/search/components/SearchResultsPageView.d.ts +1 -6
- package/dist/features/search/components/SearchResultsPageView.js +2 -2
- package/dist/features/seller/actions/offer-actions.js +16 -1
- package/dist/features/seller/actions/seller-actions.js +14 -3
- package/dist/features/seller/components/CategoryInlineSelect.js +75 -11
- package/dist/features/seller/components/PrintCenterView.d.ts +5 -0
- package/dist/features/seller/components/PrintCenterView.js +41 -30
- package/dist/features/seller/components/SellerOrdersView.js +1 -1
- package/dist/features/seller/components/SellerPayoutRequestView.js +16 -5
- package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
- package/dist/features/seller/components/SellerProductShell.d.ts +16 -0
- package/dist/features/seller/components/SellerProductShell.js +123 -13
- package/dist/features/seller/components/SellerReviewsView.js +4 -2
- package/dist/features/seller/components/SellerSidebar.js +1 -1
- package/dist/features/seller/schemas/coupon-form.d.ts +26 -0
- package/dist/features/seller/schemas/coupon-form.js +27 -0
- package/dist/features/seller/schemas/product-form.d.ts +3 -0
- package/dist/features/seller/schemas/product-form.js +5 -0
- package/dist/features/shell/FormShell.js +2 -2
- package/dist/features/shell/QuickFormDrawer.js +14 -0
- package/dist/features/shell/SectionForm.d.ts +19 -0
- package/dist/features/shell/SectionForm.js +133 -9
- package/dist/features/shell/SectionForm.style.css +54 -0
- package/dist/features/shipments/components/AdminShipmentsView.js +16 -1
- package/dist/features/shipments/repository/shipment-items.repository.d.ts +9 -0
- package/dist/features/shipments/repository/shipment-items.repository.js +14 -0
- package/dist/features/site-settings/components/ActionPermissionsManager.js +1 -1
- package/dist/features/sticker-trace/components/StickerCommitPanel.js +1 -1
- package/dist/features/store-extensions/schemas/report-review-form.d.ts +8 -8
- package/dist/features/stores/components/StoreGuideHubView.js +1 -1
- package/dist/features/stores/components/StoreHeader.js +1 -1
- package/dist/features/support/schemas/firestore.d.ts +73 -2
- package/dist/features/support/schemas/firestore.js +59 -0
- package/dist/index.d.ts +16 -24
- package/dist/index.js +38 -47
- package/dist/next/ErrorBoundary.js +1 -1
- package/dist/next/routing/route-map.d.ts +24 -0
- package/dist/next/routing/route-map.js +40 -0
- package/dist/providers/payment-manual/index.d.ts +15 -1
- package/dist/providers/payment-manual/index.js +37 -0
- package/dist/providers/payment-phonepe/index.d.ts +14 -1
- package/dist/providers/payment-phonepe/index.js +36 -0
- package/dist/providers/payment-razorpay/index.d.ts +44 -1
- package/dist/providers/payment-razorpay/index.js +99 -0
- package/dist/providers/shipping-shiprocket/index.d.ts +18 -0
- package/dist/providers/shipping-shiprocket/index.js +18 -0
- package/dist/schemas/registry.d.ts +44 -11
- package/dist/server-entry.d.ts +2 -0
- package/dist/server-entry.js +27 -0
- package/dist/server.d.ts +43 -0
- package/dist/server.js +98 -0
- package/dist/styles.css +418 -149
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/default-dark.js +15 -12
- package/dist/tokens/themes/default-light.js +14 -11
- package/dist/tokens/tokens.css +106 -23
- package/dist/ui/DataTable.style.css +4 -4
- package/dist/ui/columns/cell-renderers.d.ts +20 -0
- package/dist/ui/columns/cell-renderers.js +26 -1
- package/dist/ui/columns/index.d.ts +1 -1
- package/dist/ui/columns/index.js +4 -1
- package/dist/ui/components/Badge.style.css +1 -1
- package/dist/ui/components/Breadcrumb.js +19 -1
- package/dist/ui/components/BulkActionBar.style.css +4 -4
- package/dist/ui/components/Button.style.css +1 -1
- package/dist/ui/components/Checkbox.style.css +1 -1
- package/dist/ui/components/FallbackShell.js +1 -1
- package/dist/ui/components/Form.d.ts +14 -1
- package/dist/ui/components/Form.js +2 -2
- package/dist/ui/components/FormField.js +18 -4
- package/dist/ui/components/FormField.style.css +43 -3
- package/dist/ui/components/GatedPrice.style.css +1 -1
- package/dist/ui/components/IconButton.style.css +1 -1
- package/dist/ui/components/Input.js +22 -1
- package/dist/ui/components/Input.style.css +38 -22
- package/dist/ui/components/ListingFilterDrawer.js +1 -1
- package/dist/ui/components/ListingToolbar.js +1 -1
- package/dist/ui/components/PaginatedSelect.js +0 -0
- package/dist/ui/components/Radio.style.css +1 -1
- package/dist/ui/components/Repeater.d.ts +53 -0
- package/dist/ui/components/Repeater.js +7 -0
- package/dist/ui/components/RichTextEditor.d.ts +20 -1
- package/dist/ui/components/RichTextEditor.js +23 -2
- package/dist/ui/components/Select.style.css +7 -21
- package/dist/ui/components/Semantic.js +27 -3
- package/dist/ui/components/TagInput.style.css +4 -9
- package/dist/ui/components/Textarea.style.css +4 -18
- package/dist/ui/components/Toggle.style.css +1 -1
- package/dist/ui/components/Typography.d.ts +3 -3
- package/dist/ui/components/Typography.js +15 -15
- package/dist/ui/components/ViewToggle.style.css +4 -4
- package/dist/ui/forms/AddAnotherToggle.d.ts +16 -0
- package/dist/ui/forms/AddAnotherToggle.js +56 -0
- package/dist/ui/forms/ColorPickerField.js +15 -2
- package/dist/ui/forms/FieldCheckbox.js +15 -2
- package/dist/ui/forms/FieldInput.d.ts +22 -1
- package/dist/ui/forms/FieldInput.js +19 -5
- package/dist/ui/forms/FieldLabel.d.ts +35 -0
- package/dist/ui/forms/FieldLabel.js +70 -0
- package/dist/ui/forms/FieldSelect.d.ts +4 -1
- package/dist/ui/forms/FieldSelect.js +27 -5
- package/dist/ui/forms/FieldTextarea.d.ts +4 -1
- package/dist/ui/forms/FieldTextarea.js +22 -5
- package/dist/ui/forms/FormShell.d.ts +17 -1
- package/dist/ui/forms/FormShell.js +36 -2
- package/dist/ui/forms/FormShell.style.css +41 -33
- package/dist/ui/forms/index.d.ts +5 -1
- package/dist/ui/forms/index.js +2 -0
- package/dist/ui/icons/icon-registry.d.ts +1 -0
- package/dist/ui/icons/icon-registry.js +17 -1
- package/dist/utils/id-generators.d.ts +80 -0
- package/dist/utils/id-generators.js +93 -0
- package/dist/utils/search-txt-builders.d.ts +12 -0
- package/dist/utils/search-txt-builders.js +17 -0
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +106 -5
- package/dist/features/loyalty/api/admin/loyalty/grant/route.d.ts +0 -12
- package/dist/features/loyalty/api/admin/loyalty/grant/route.js +0 -38
- package/dist/features/loyalty/api/balance/route.d.ts +0 -12
- package/dist/features/loyalty/api/balance/route.js +0 -41
- package/dist/features/loyalty/api/earn/route.d.ts +0 -12
- package/dist/features/loyalty/api/earn/route.js +0 -38
- package/dist/features/loyalty/api/history/route.d.ts +0 -12
- package/dist/features/loyalty/api/history/route.js +0 -58
- package/dist/features/loyalty/api/redeem/route.d.ts +0 -12
- package/dist/features/loyalty/api/redeem/route.js +0 -38
- package/dist/features/loyalty/columns/index.d.ts +0 -17
- package/dist/features/loyalty/columns/index.js +0 -40
- package/dist/features/loyalty/components/CoinsDisplay.d.ts +0 -12
- package/dist/features/loyalty/components/CoinsDisplay.js +0 -10
- package/dist/features/loyalty/components/index.d.ts +0 -1
- package/dist/features/loyalty/components/index.js +0 -1
- package/dist/features/loyalty/hooks/useLoyaltyBalance.d.ts +0 -4
- package/dist/features/loyalty/hooks/useLoyaltyBalance.js +0 -25
- package/dist/features/loyalty/index.d.ts +0 -6
- package/dist/features/loyalty/index.js +0 -6
- package/dist/features/loyalty/manifest.d.ts +0 -2
- package/dist/features/loyalty/manifest.js +0 -16
- package/dist/features/loyalty/messages/en.json +0 -19
- package/dist/features/loyalty/repository/loyalty.repository.d.ts +0 -8
- package/dist/features/loyalty/repository/loyalty.repository.js +0 -22
- package/dist/features/loyalty/schemas/index.d.ts +0 -85
- package/dist/features/loyalty/schemas/index.js +0 -40
- package/dist/features/loyalty/server.d.ts +0 -6
- package/dist/features/loyalty/server.js +0 -6
- package/dist/features/loyalty/types/index.d.ts +0 -31
- package/dist/features/loyalty/types/index.js +0 -1
- package/dist/features/loyalty/types/loyalty-config.d.ts +0 -7
- package/dist/features/loyalty/types/loyalty-config.js +0 -1
- package/dist/features/loyalty/types/loyalty-math.d.ts +0 -9
- package/dist/features/loyalty/types/loyalty-math.js +0 -27
- package/dist/features/products/components/ProductOwnerQuickActions.d.ts +0 -11
- package/dist/features/products/components/ProductOwnerQuickActions.js +0 -120
|
@@ -4,9 +4,11 @@ import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "r
|
|
|
4
4
|
import { Button } from "../../ui/components/Button.js";
|
|
5
5
|
import { CollapsibleSection } from "../../ui/components/CollapsibleSection.js";
|
|
6
6
|
import { Badge } from "../../ui/components/Badge.js";
|
|
7
|
-
import { Div, Row, Span, Stack } from "../../ui/index.js";
|
|
7
|
+
import { Div, Nav, Row, Span, Stack } from "../../ui/index.js";
|
|
8
8
|
import { FormShellContext } from "../../ui/forms/FormShell.js";
|
|
9
|
+
import { LabelPlacementContext, } from "../../ui/forms/FieldLabel.js";
|
|
9
10
|
import { useFormBottomActions } from "../layout/hooks/useFormBottomActions.js";
|
|
11
|
+
import { useIsDesktop } from "../layout/useIsDesktop.js";
|
|
10
12
|
import { useSectionState } from "../account/hooks/useCollapsedSections.js";
|
|
11
13
|
import { FormSchemaContext } from "./FormShell.js";
|
|
12
14
|
import { EASE_OUT_MS } from "../../tokens/motion.js";
|
|
@@ -38,7 +40,32 @@ export function useSectionFormNav(sections, values, opts) {
|
|
|
38
40
|
return orderSections(visible);
|
|
39
41
|
}, [sections, values]);
|
|
40
42
|
const sectionIds = useMemo(() => ordered.map((s) => s.id), [ordered]);
|
|
41
|
-
|
|
43
|
+
/*
|
|
44
|
+
* ๐ `undefined` WHEN NOTHING IS REQUIRED, not an empty array.
|
|
45
|
+
*
|
|
46
|
+
* This returned the required section ids unconditionally, and
|
|
47
|
+
* `useSectionState` documents `[]` as meaning "all collapsed" โ its
|
|
48
|
+
* first-section-open default only applies when `defaultOpen` is absent. So a
|
|
49
|
+
* form whose sections are all optional opened with EVERY section collapsed:
|
|
50
|
+
* a stack of grey strips and a Save button, with no content on screen.
|
|
51
|
+
*
|
|
52
|
+
* `/admin/site` is the worst case and is what the audit screenshotted. It
|
|
53
|
+
* builds each of its 19 tabs through `SettingsTabForm`, which declares one
|
|
54
|
+
* section and marks nothing required โ so picking any tab showed the
|
|
55
|
+
* tab's name on a collapsed bar above ~450px of empty white. A settings
|
|
56
|
+
* page that renders none of its settings.
|
|
57
|
+
*
|
|
58
|
+
* Falling back to `undefined` hands the decision to the hook, whose default
|
|
59
|
+
* is "first section open". For a single-section form that means open, which
|
|
60
|
+
* is the only sensible state: collapsing exists to navigate AMONG sections,
|
|
61
|
+
* and a lone section has nothing to navigate.
|
|
62
|
+
*
|
|
63
|
+
* A form that genuinely wants everything shut can still pass its own state.
|
|
64
|
+
*/
|
|
65
|
+
const defaultOpen = useMemo(() => {
|
|
66
|
+
const required = ordered.filter((s) => s.required).map((s) => s.id);
|
|
67
|
+
return required.length > 0 ? required : undefined;
|
|
68
|
+
}, [ordered]);
|
|
42
69
|
/*
|
|
43
70
|
* The open set is `useSectionState`, not a local `useState` โ which is what
|
|
44
71
|
* makes "expand section 3, reload, find it still expanded" true. `scope: ""`
|
|
@@ -307,6 +334,14 @@ export function SectionForm({ sections, values, onChange, onSubmit, submitLabel
|
|
|
307
334
|
destructiveAction,
|
|
308
335
|
enabled: bottomBar && !hideActions,
|
|
309
336
|
});
|
|
337
|
+
/*
|
|
338
|
+
* The bar above and the in-flow row at the end of this form are ONE
|
|
339
|
+
* decision about where the primary action lives, so they are decided
|
|
340
|
+
* together here rather than each guessing. `BottomActions` unmounts on
|
|
341
|
+
* desktop via this same hook; the row is its complement. See the row.
|
|
342
|
+
*/
|
|
343
|
+
const isDesktop = useIsDesktop();
|
|
344
|
+
const showInlineActions = isDesktop || !bottomBar;
|
|
310
345
|
const toggle = useCallback((id) => {
|
|
311
346
|
/*
|
|
312
347
|
* A DIRECT click on the header always wins. `forceOpenIds` exists to
|
|
@@ -329,7 +364,67 @@ export function SectionForm({ sections, values, onChange, onSubmit, submitLabel
|
|
|
329
364
|
return 0;
|
|
330
365
|
return section.fields.filter((f) => Object.keys(fieldErrors).some((k) => k === f || k.startsWith(`${f}.`))).length;
|
|
331
366
|
}, [fieldErrors]);
|
|
332
|
-
|
|
367
|
+
/*
|
|
368
|
+
* โโ THE SECTION RAIL โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
369
|
+
*
|
|
370
|
+
* ๐ EVERY EDITOR IN THIS APP WAS ONE NARROW COLUMN AT EVERY WIDTH. This
|
|
371
|
+
* component had no `lg:` branch anywhere, so on a 2560px display the
|
|
372
|
+
* category editor rendered four stacked accordions and `SellerProductShell`
|
|
373
|
+
* eight โ ~44 controls in a single column with the whole right half of the
|
|
374
|
+
* screen empty, and the only way to reach section six was to scroll past
|
|
375
|
+
* five you were not editing.
|
|
376
|
+
*
|
|
377
|
+
* The rail is a RENDERER OVER STATE THAT ALREADY EXISTED: `ordered`,
|
|
378
|
+
* `openIds`, `errorCountFor` and the module-level `scrollToSection` are all
|
|
379
|
+
* here for the submit handler's "jump to the first invalid section"
|
|
380
|
+
* behaviour. Nothing new is stored, so the rail and the panels cannot
|
|
381
|
+
* disagree about which section is open.
|
|
382
|
+
*
|
|
383
|
+
* ๐ FIELDS ARE NOT REFLOWED INTO TWO COLUMNS, and that is deliberate. A
|
|
384
|
+
* two-column field grid reorders tab sequence against reading order, and a
|
|
385
|
+
* form where Tab jumps right-then-left is worse than a long one. Sections
|
|
386
|
+
* side by side is safe; fields inside a section are not.
|
|
387
|
+
*
|
|
388
|
+
* ๐ Below three sections it does not render. A two-section form has
|
|
389
|
+
* nothing to navigate โ the same reasoning `useSectionFormNav` already
|
|
390
|
+
* applies to a lone section ("collapsing exists to navigate AMONG
|
|
391
|
+
* sections").
|
|
392
|
+
*/
|
|
393
|
+
const showRail = ordered.length >= 3;
|
|
394
|
+
/*
|
|
395
|
+
* `sticky` under the measured header, and it publishes NO height: per the
|
|
396
|
+
* three-tier rule a sticky element CONSUMES the tier and never joins it.
|
|
397
|
+
* `hidden lg:block` because below `lg` there is no horizontal room and the
|
|
398
|
+
* accordion headers are already the navigation.
|
|
399
|
+
*
|
|
400
|
+
* The offset is a `top-[calc(โฆ)]` UTILITY rather than an inline style โ the
|
|
401
|
+
* sticky convention this repo already uses, and `audit-inline-styles` is
|
|
402
|
+
* strict-zero with its marker among the 24 banned ones. Scrolling is the
|
|
403
|
+
* `overflow` PROP, not a raw `overflow-y-auto`, which `audit-inline-styles`
|
|
404
|
+
* also blocks on an appkit primitive.
|
|
405
|
+
*
|
|
406
|
+
* ๐ This comment lives ABOVE the statement because a `{/* โฆ *โฃ/}` block
|
|
407
|
+
* inside the ternary's parentheses is EXPRESSION position, where JSX
|
|
408
|
+
* comment syntax does not parse. That is the fourth time today; the rule is
|
|
409
|
+
* simply that JSX comments belong in CHILDREN position and nowhere else.
|
|
410
|
+
*/
|
|
411
|
+
const rail = showRail ? (_jsx(Div, { overflow: "auto", className: "hidden lg:block w-56 flex-shrink-0 sticky self-start top-[calc(var(--header-height,3.5rem)+1rem)] max-h-[calc(100vh-var(--header-height,3.5rem)-2rem)]", children: _jsx(Nav, { "aria-label": "Form sections", children: _jsx(Stack, { gap: "px", children: ordered.map((section) => {
|
|
412
|
+
const errorCount = errorCountFor(section);
|
|
413
|
+
const isOpen = section.required === true ||
|
|
414
|
+
openIds.includes(section.id) ||
|
|
415
|
+
forceOpenIds.includes(section.id);
|
|
416
|
+
return (_jsxs(Button, { type: "button",
|
|
417
|
+
/* `ghost`, not `bare` โ UI_BUTTON has no `bare` variant. */
|
|
418
|
+
variant: "ghost", size: "sm", justify: "between", gap: "sm", className: `w-full text-left ${isOpen ? "appkit-section-rail__item--active" : ""}`, "aria-current": isOpen ? "true" : undefined, onClick: () => {
|
|
419
|
+
if (!openIds.includes(section.id)) {
|
|
420
|
+
setOpenIds(expandMode === "single"
|
|
421
|
+
? [section.id]
|
|
422
|
+
: [...openIds, section.id]);
|
|
423
|
+
}
|
|
424
|
+
scrollToSection(section.id);
|
|
425
|
+
}, children: [_jsx(Span, { size: "sm", color: isOpen ? "primary" : "muted", children: section.label }), errorCount > 0 && (_jsx(Span, { size: "xs", color: "error", weight: "semibold", children: errorCount }))] }, section.id));
|
|
426
|
+
}) }) }) })) : null;
|
|
427
|
+
const panels = (_jsxs(Stack, { gap: "md", children: [ordered.map((section) => {
|
|
333
428
|
const isRequired = section.required === true;
|
|
334
429
|
/*
|
|
335
430
|
* A required section is always open โ it holds the fields without
|
|
@@ -357,13 +452,33 @@ export function SectionForm({ sections, values, onChange, onSubmit, submitLabel
|
|
|
357
452
|
/* Only after the user has tried to save โ see `submitAttempted` above. */
|
|
358
453
|
submitAttempted && errorCount > 0
|
|
359
454
|
? () => (_jsxs(Badge, { variant: "danger", children: [errorCount, " ", errorCount === 1 ? "issue" : "issues"] }))
|
|
360
|
-
: undefined, children: section.render({
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}), !hideActions && (
|
|
455
|
+
: undefined, children: _jsx(LabelPlacementContext.Provider, { value: section.labelPlacement ?? "above", children: section.render({
|
|
456
|
+
values,
|
|
457
|
+
onChange: handleFieldChange,
|
|
458
|
+
errors: submitAttempted ? fieldErrors : EMPTY_ERRORS,
|
|
459
|
+
}) }) }, section.id));
|
|
460
|
+
}), !hideActions && showInlineActions && (
|
|
366
461
|
/*
|
|
462
|
+
* ๐ DESKTOP ONLY โ the exact complement of the pinned bar.
|
|
463
|
+
*
|
|
464
|
+
* This row and `useFormBottomActions`' bar both render a Save, and
|
|
465
|
+
* the comment below explains why the row exists: the bar is mobile
|
|
466
|
+
* only, so desktop needed one. What neither accounted for is that on
|
|
467
|
+
* MOBILE both appear โ the row at the end of the form and the fixed
|
|
468
|
+
* bar over it. That is the audit's duplicate-CTA finding, and its
|
|
469
|
+
* mobile checkout screenshot: two stacked CTAs ~60px apart with the
|
|
470
|
+
* in-flow one clipped by the bar sitting on top of it.
|
|
471
|
+
*
|
|
472
|
+
* Gated on `useIsDesktop()` โ the SAME hook `BottomActions` uses to
|
|
473
|
+
* decide it should unmount โ rather than a `lg:` class, so the two
|
|
474
|
+
* cannot disagree about where the boundary is. A class would also
|
|
475
|
+
* leave this row in the DOM, where it still takes focus and still
|
|
476
|
+
* answers a query, which is how it was counted as a second button on
|
|
477
|
+
* desktop in the first place.
|
|
478
|
+
*
|
|
479
|
+
* `|| !bottomBar` keeps a caller that opted out of the bar from
|
|
480
|
+
* losing its only submit control on mobile.
|
|
481
|
+
*
|
|
367
482
|
* `justify="between"` so a destructive action sits opposite Save
|
|
368
483
|
* rather than beside it. With no destructive action the empty <Div>
|
|
369
484
|
* still holds the left edge, keeping Save right-aligned.
|
|
@@ -374,5 +489,14 @@ export function SectionForm({ sections, values, onChange, onSubmit, submitLabel
|
|
|
374
489
|
* `store/categories/new`, which had one before.
|
|
375
490
|
*/
|
|
376
491
|
_jsxs(Row, { justify: "between", align: "center", paddingY: "y-sm", gap: "sm", wrap: true, children: [_jsx(Div, { children: destructiveAction && (_jsx(Button, { variant: "danger", type: "button", onClick: destructiveAction.onClick, disabled: destructiveAction.disabled || isLoading, children: destructiveAction.label })) }), _jsxs(Row, { gap: "sm", children: [onCancel && (_jsx(Button, { variant: "ghost", type: "button", onClick: onCancel, disabled: isLoading, children: cancelLabel })), _jsx(Button, { variant: "primary", type: "submit", onClick: handleSubmit, isLoading: isLoading, disabled: isLoading, children: submitLabel })] })] }))] }));
|
|
492
|
+
if (!rail)
|
|
493
|
+
return panels;
|
|
494
|
+
/*
|
|
495
|
+
* `min-w-0` on the panel column is load-bearing: a flex child defaults to
|
|
496
|
+
* `min-width: auto`, so one wide table or a long unbroken string inside a
|
|
497
|
+
* section would push the column past the container instead of wrapping, and
|
|
498
|
+
* the rail would be shoved off-screen.
|
|
499
|
+
*/
|
|
500
|
+
return (_jsxs(Row, { gap: "lg", align: "start", children: [rail, _jsx(Div, { className: "min-w-0 flex-1", children: panels })] }));
|
|
377
501
|
}
|
|
378
502
|
export default SectionForm;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The section rail โ `SectionForm`'s `lg+` navigation column.
|
|
3
|
+
*
|
|
4
|
+
* ๐ THIS FILE EXISTS BECAUSE `audit-dead-css-classes` CAUGHT ME INVENTING A
|
|
5
|
+
* CLASS WITH NO RULE. `appkit-section-rail__item--active` was written into the
|
|
6
|
+
* component and defined nowhere, so the active item would have been
|
|
7
|
+
* indistinguishable from the rest โ a rail whose whole job is to say "you are
|
|
8
|
+
* here" saying nothing. Tailwind silently drops an unknown utility and a
|
|
9
|
+
* hand-written BEM class simply never matches, so neither failure announces
|
|
10
|
+
* itself; the audit is the only thing that does.
|
|
11
|
+
*
|
|
12
|
+
* โโ WHY A CLASS RATHER THAN A VARIANT PROP โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
13
|
+
*
|
|
14
|
+
* Root Cause #21 says styling goes through variant props, and that is right
|
|
15
|
+
* for anything a primitive already models. This is the exception the rule
|
|
16
|
+
* allows: the active marker is a left border INSIDE the button's own box plus
|
|
17
|
+
* a tinted surface, and `Button` exposes neither a "selected" state nor a
|
|
18
|
+
* border-inline-start variant. Adding both to `Button` for one consumer would
|
|
19
|
+
* be the wider change.
|
|
20
|
+
*
|
|
21
|
+
* The ink is still carried by a prop (`<Span color="primary">` vs `"muted"`),
|
|
22
|
+
* so this file only draws the parts a variant cannot.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
.appkit-section-rail__item--active {
|
|
26
|
+
/*
|
|
27
|
+
* ๐ A THEME-RELATIVE SURFACE, NOT A NAMED PALETTE TINT. Root Cause #79: a
|
|
28
|
+
* `bg-primary-50`-style tint is the same near-white fill in every theme, so
|
|
29
|
+
* under dark ink it is white-on-white. `--appkit-color-primary-surface` is
|
|
30
|
+
* declared per theme and inverts with it.
|
|
31
|
+
*/
|
|
32
|
+
background: var(--appkit-color-primary-surface);
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* `border-inline-start`, not `border-left` โ the app ships an RTL-capable
|
|
36
|
+
* locale set and the marker belongs on the reading-order edge.
|
|
37
|
+
*
|
|
38
|
+
* Inset via a transparent border on the inactive state would be cleaner, but
|
|
39
|
+
* `Button` owns its own padding; a box-shadow draws the bar without
|
|
40
|
+
* participating in layout, so the label does not shift by 2px when a section
|
|
41
|
+
* opens.
|
|
42
|
+
*/
|
|
43
|
+
box-shadow: inset 2px 0 0 0 var(--appkit-color-primary);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* ๐ `:hover` must not out-rank the active state. Both configs set
|
|
48
|
+
* `important: true`, so a Tailwind hover utility on the Button would beat this
|
|
49
|
+
* file's normal declaration โ which is why the active marker is a
|
|
50
|
+
* `box-shadow` (nothing sets that) and a `background` applied through a
|
|
51
|
+
* dedicated class rather than a utility that a hover variant could tie with.
|
|
52
|
+
* See Root Cause #106: for `!important`, un-layered CSS sorts LOWEST, so a
|
|
53
|
+
* plain file like this one can never win an importance tie.
|
|
54
|
+
*/
|
|
@@ -3,7 +3,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit/client";
|
|
4
4
|
import { sortBy } from "@mohasinac/appkit/client";
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { FilterChipGroup, ListingLayout } from "../../../ui/index.js";
|
|
6
|
+
import { FilterChipGroup, ListingLayout, TextLink } from "../../../ui/index.js";
|
|
7
|
+
// ๐ From the DEFINING module, not `@mohasinac/appkit/client` โ this file is a
|
|
8
|
+
// client component, but `ROUTES` is a runtime value and the `/client` entry is
|
|
9
|
+
// where Root Cause #76's React #441 comes from when a server component touches
|
|
10
|
+
// the same import. One spelling everywhere is cheaper than two rules.
|
|
11
|
+
import { ROUTES } from "../../../next/routing/route-map.js";
|
|
7
12
|
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints.js";
|
|
8
13
|
import { toRecordArray, toRelativeDate, toStringValue, } from "../../admin/hooks/useAdminListingData.js";
|
|
9
14
|
import { DataListingView } from "../../admin/components/DataListingView.js";
|
|
@@ -75,6 +80,16 @@ export function AdminShipmentsView({ children, ...props }) {
|
|
|
75
80
|
onClick: () => selection.clearSelection(),
|
|
76
81
|
})),
|
|
77
82
|
renderFilterPanel: ({ pendingFilters, setPendingFilters }) => (_jsx(FilterChipGroup, { label: "Status", tabs: STATUS_OPTIONS, value: pendingFilters.status ?? "", onChange: (id) => setPendingFilters((p) => ({ ...p, status: id })) })),
|
|
83
|
+
/*
|
|
84
|
+
* ๐ THE ONLY LINK TO THE RECEIVE STATION.
|
|
85
|
+
*
|
|
86
|
+
* `ROUTES.ADMIN.SHIPMENT_RECEIVE` existed with ZERO consumers โ a built
|
|
87
|
+
* page reachable only by typing its URL, which is Root Cause #37's shape
|
|
88
|
+
* and the reason ~25 working admin features sat unreachable. Receiving
|
|
89
|
+
* belongs on the row rather than in the nav because it is always about one
|
|
90
|
+
* shipment; a nav entry would have to ask which.
|
|
91
|
+
*/
|
|
92
|
+
renderRowActions: (row) => (_jsx(TextLink, { href: String(ROUTES.ADMIN.SHIPMENT_RECEIVE(row.id)), children: "Receive" })),
|
|
78
93
|
renderEditor: ({ editId, closePanel }) => (_jsx(AdminShipmentEditorView, { shipmentId: editId ?? undefined, onSaved: closePanel, embedded: true })),
|
|
79
94
|
resolveEditorTitle: ({ isCreate }) => (isCreate ? "New Shipment" : "Edit Shipment"),
|
|
80
95
|
};
|
|
@@ -9,6 +9,15 @@ import { type ShipmentItem, type ShipmentItemCreateInput, type ShipmentItemUpdat
|
|
|
9
9
|
export declare class ShipmentItemsRepository extends BaseRepository<ShipmentItem> {
|
|
10
10
|
constructor();
|
|
11
11
|
listByLot(lotId: string, model?: SieveModel): Promise<FirebaseSieveResult<ShipmentItem>>;
|
|
12
|
+
/**
|
|
13
|
+
* Every tracked item across a shipment's lots, in one query.
|
|
14
|
+
*
|
|
15
|
+
* The receive station needs this: an operator opening a crate works through
|
|
16
|
+
* the whole shipment, not one lot at a time, and walking the lots to fetch
|
|
17
|
+
* items per lot is an N+1 against Rule #6's ~3-round-trip budget for a page
|
|
18
|
+
* that already has a 50-row ceiling.
|
|
19
|
+
*/
|
|
20
|
+
listByShipment(shipmentId: string, model?: SieveModel): Promise<FirebaseSieveResult<ShipmentItem>>;
|
|
12
21
|
countByLot(lotId: string): Promise<number>;
|
|
13
22
|
/** Cheap bounded existence check โ any item in this lot still linked to a product? */
|
|
14
23
|
hasLinkedItemsInLot(lotId: string): Promise<boolean>;
|
|
@@ -15,6 +15,20 @@ export class ShipmentItemsRepository extends BaseRepository {
|
|
|
15
15
|
async listByLot(lotId, model) {
|
|
16
16
|
return this.sieveQuery({ ...(model ?? {}), filters: sieveAnd(sieveFilter("lotId", SIEVE_OP.EQ, lotId), model?.filters) }, ShipmentItemsRepository.SIEVE_FIELDS, { defaultPageSize: 50, maxPageSize: 100 });
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Every tracked item across a shipment's lots, in one query.
|
|
20
|
+
*
|
|
21
|
+
* The receive station needs this: an operator opening a crate works through
|
|
22
|
+
* the whole shipment, not one lot at a time, and walking the lots to fetch
|
|
23
|
+
* items per lot is an N+1 against Rule #6's ~3-round-trip budget for a page
|
|
24
|
+
* that already has a 50-row ceiling.
|
|
25
|
+
*/
|
|
26
|
+
async listByShipment(shipmentId, model) {
|
|
27
|
+
return this.sieveQuery({
|
|
28
|
+
...(model ?? {}),
|
|
29
|
+
filters: sieveAnd(sieveFilter("shipmentId", SIEVE_OP.EQ, shipmentId), model?.filters),
|
|
30
|
+
}, ShipmentItemsRepository.SIEVE_FIELDS, { defaultPageSize: 50, maxPageSize: 100 });
|
|
31
|
+
}
|
|
18
32
|
async countByLot(lotId) {
|
|
19
33
|
const snap = await this.getCollection().where(SHIPMENT_ITEM_FIELDS.LOT_ID, "==", lotId).count().get();
|
|
20
34
|
return snap.data().count;
|
|
@@ -57,7 +57,7 @@ const CATEGORY_COLORS = {
|
|
|
57
57
|
"Messaging": "bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300",
|
|
58
58
|
"Seller": "bg-warning-surface text-warning dark:bg-warning-surface dark:text-warning",
|
|
59
59
|
"Orders": "bg-lime-100 text-lime-800 dark:bg-lime-900/30 dark:text-lime-300",
|
|
60
|
-
"Account": "bg-[var(--appkit-color-surface
|
|
60
|
+
"Account": "bg-[var(--appkit-color-surface-elevated)] text-[var(--appkit-color-text-muted)]",
|
|
61
61
|
};
|
|
62
62
|
const ALL_ACTION_IDS = Object.values(ACTION_ID);
|
|
63
63
|
export function ActionPermissionsManager({ initialConfig, onUpdate }) {
|
|
@@ -87,7 +87,7 @@ export function StickerCommitPanel({ file, dimensions, onCommit, onCommitted, })
|
|
|
87
87
|
}
|
|
88
88
|
}, [file, dimensions, title, tier, onCommit, onCommitted]);
|
|
89
89
|
if (!file) {
|
|
90
|
-
return (_jsx(Card, { variant: "default", children: _jsx(Text, { color: "muted", children: "Pick a scan and tune it above
|
|
90
|
+
return (_jsx(Card, { variant: "default", children: _jsx(Text, { color: "muted", children: "Pick a scan and tune it above to commit a run." }) }));
|
|
91
91
|
}
|
|
92
92
|
return (_jsx(Card, { variant: "default", children: _jsx(Form, { onSubmit: (e) => e.preventDefault(), children: _jsxs(Stack, { gap: "comfortable", children: [_jsx(Heading, { level: 3, children: "Commit this as a run" }), _jsxs(Text, { size: "sm", color: "muted", children: ["Uploads ", _jsx(Text, { as: "span", weight: "semibold", children: file.name }), " (", sizeMb, " MB) and traces it at full resolution on the server. The parameters you tuned above are the starting point; a run keeps its own copy, so later edits here never change what an earlier run recorded."] }), error ? _jsx(Alert, { variant: "error", children: error }) : null, _jsx(FieldInput, { name: "title", label: "Name this sheet", required: true, value: title, onChange: setTitle }), _jsx(Text, { size: "xs", color: "muted", children: "Required \u2014 nothing processes without one. Name it so you recognise it next to the others: \u201CDriger G, matte scan 600dpi\u201D." }), _jsx(FieldSelect, { name: "tier", label: "Tier", value: tier, options: TIERS.map((t) => ({ value: t, label: TIER_HELP[t].title })), onChange: (v) => setTier(v) }), _jsx(Text, { size: "xs", color: "muted", children: TIER_HELP[tier].body }), tier === "max" ? (_jsx(Alert, { variant: "warning", children: "Max is expensive in both time and quota, and its finer simplify can push a busy sheet past Design Space's node ceiling. Try precise first unless a halftone scan is merging two stickers." })) : null, !dimensions ? (_jsx(Text, { size: "xs", color: "muted", children: "Waiting for the scan to finish decoding\u2026" })) : null, _jsx(Button, { type: "submit", variant: "primary", isLoading: pending, disabled: !ready, onClick: submit, children: pending ? "Uploading and startingโฆ" : "Upload and run" })] }) }) }));
|
|
93
93
|
}
|
|
@@ -15,16 +15,16 @@ export declare const reportReviewFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
15
15
|
status: z.ZodEnum<["under-review", "actioned", "dismissed"]>;
|
|
16
16
|
resolution: z.ZodOptional<z.ZodString>;
|
|
17
17
|
}, "strict", z.ZodTypeAny, {
|
|
18
|
-
status: "
|
|
18
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
19
19
|
resolution?: string | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
status: "
|
|
21
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
22
22
|
resolution?: string | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
status: "
|
|
24
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
25
25
|
resolution?: string | undefined;
|
|
26
26
|
}, {
|
|
27
|
-
status: "
|
|
27
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
28
28
|
resolution?: string | undefined;
|
|
29
29
|
}>;
|
|
30
30
|
export type ReportReviewFormValues = z.infer<typeof reportReviewFormSchema>;
|
|
@@ -33,15 +33,15 @@ export declare const reportReviewUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
33
33
|
status: z.ZodEnum<["under-review", "actioned", "dismissed"]>;
|
|
34
34
|
resolution: z.ZodOptional<z.ZodString>;
|
|
35
35
|
}, "strict", z.ZodTypeAny, {
|
|
36
|
-
status: "
|
|
36
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
37
37
|
resolution?: string | undefined;
|
|
38
38
|
}, {
|
|
39
|
-
status: "
|
|
39
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
40
40
|
resolution?: string | undefined;
|
|
41
41
|
}>, {
|
|
42
|
-
status: "
|
|
42
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
43
43
|
resolution?: string | undefined;
|
|
44
44
|
}, {
|
|
45
|
-
status: "
|
|
45
|
+
status: "under-review" | "actioned" | "dismissed";
|
|
46
46
|
resolution?: string | undefined;
|
|
47
47
|
}>;
|
|
@@ -77,7 +77,7 @@ export function StoreGuideHubView({ store }) {
|
|
|
77
77
|
const storeName = store?.storeName ?? "Your Store";
|
|
78
78
|
const steps = buildChecklist(store);
|
|
79
79
|
const completedCount = steps.filter((s) => s.done).length;
|
|
80
|
-
return (_jsxs(Stack, { gap: "xl", padding: "b-2xl", children: [_jsx(Section, { overflow: "hidden", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", rounded: "2xl", shadow: "sm", children: _jsxs(Div, { paddingX: "x-md-xl", paddingY: "y-xl", className: "[background:linear-gradient(135deg,var(--appkit-color-primary-700)_0%,var(--appkit-color-cobalt)_60%,var(--appkit-color-secondary-400)_100%)]", children: [_jsxs(Row, { className: "mb-3", align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-10 h-10", surface: "default", align: "center", justify: "center", rounded: "xl", children: _jsx(BookOpen, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { color: "inverse", className: "
|
|
80
|
+
return (_jsxs(Stack, { gap: "xl", padding: "b-2xl", children: [_jsx(Section, { overflow: "hidden", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", rounded: "2xl", shadow: "sm", children: _jsxs(Div, { paddingX: "x-md-xl", paddingY: "y-xl", className: "[background:linear-gradient(135deg,var(--appkit-color-primary-700)_0%,var(--appkit-color-cobalt)_60%,var(--appkit-color-secondary-400)_100%)]", children: [_jsxs(Row, { className: "mb-3", align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-10 h-10", surface: "default", align: "center", justify: "center", rounded: "xl", children: _jsx(BookOpen, { className: "w-5 h-5 text-white" }) }), _jsx(Text, { color: "inverse-muted", className: "tracking-widest", size: "sm", weight: "semibold", transform: "uppercase", children: "Seller Guide" })] }), _jsx(Heading, { color: "inverse", level: 1, className: "mb-2", mdSize: "3xl", size: "2xl", weight: "bold", children: storeName }), _jsx(Text, { color: "inverse-muted", size: "base", children: "Everything you need to know about selling on LetItRip." })] }) }), _jsxs(Div, { layout: "grid", gap: "8", className: "grid-cols-1 lg:grid-cols-3", children: [_jsxs(Stack, { className: "lg:col-span-2", gap: "md", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text)]", size: "lg", weight: "semibold", children: "Guides" }), _jsx(Grid, { cols: "cardsWide", gap: "md", children: GUIDE_CARDS.map(({ Icon, title, description, href }) => (_jsxs(TextLink, { variant: "bare", href: href, rounded: "xl", layout: "flex-col", gap: "md", paddingX: "lg", paddingY: "lg", shadow: "hover-md", className: "group border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] hover:border-[var(--appkit-color-primary)] transition-all", children: [_jsxs(Row, { align: "center", gap: "3", children: [_jsx(Row, { className: "flex-shrink-0 w-9 h-9 [background:linear-gradient(135deg,var(--appkit-color-primary-700)_0%,var(--appkit-color-cobalt)_100%)]", align: "center", justify: "center", rounded: "lg", children: _jsx(Icon, { className: "w-4 h-4 text-white" }) }), _jsx(Text, { className: "text-[var(--appkit-color-text)] group-hover:text-[var(--appkit-color-primary)] transition-colors", weight: "semibold", children: title })] }), _jsx(Text, { className: "text-[var(--appkit-color-text-muted)] leading-relaxed", size: "sm", children: description }), _jsx(Text, { className: "text-[var(--appkit-color-primary)] mt-auto", size: "xs", weight: "medium", children: "Read guide \u2192" })] }, title))) })] }), _jsxs(Stack, { gap: "md", children: [_jsx(Heading, { level: 2, className: "text-[var(--appkit-color-text)]", size: "lg", weight: "semibold", children: "Getting started" }), _jsxs(Div, { overflow: "hidden", className: "border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", rounded: "xl", children: [_jsxs(Div, { className: "px-[1.25rem] pt-[1.25rem] border-b border-[var(--appkit-color-border)]", padding: "b-md", children: [_jsxs(Row, { className: "mb-2", align: "center", justify: "between", children: [_jsxs(Text, { className: "text-[var(--appkit-color-text)]", size: "sm", weight: "medium", children: [completedCount, " of ", steps.length, " complete"] }), _jsxs(Text, { className: "text-[var(--appkit-color-text-muted)]", size: "xs", children: [Math.round((completedCount / steps.length) * 100), "%"] })] }), _jsx(Progress, { value: completedCount, max: steps.length, size: "sm", variant: "gradient" })] }), _jsx(Div, { className: "divide-y divide-[var(--appkit-color-border)]", children: steps.map(({ label, done, href }) => (_jsxs(TextLink, { variant: "bare", href: done ? "#" : href, "aria-disabled": done, layout: "flex", align: "center", gap: "sm", paddingX: "lg", paddingY: "sm-tall", size: "sm", className: `transition-colors ${done
|
|
81
81
|
? "cursor-default"
|
|
82
82
|
: "hover:bg-[var(--appkit-color-border)]/30"}`, children: [done ? (_jsx(CheckCircle2, { className: CLS_CHECK_ICON })) : (_jsx(Circle, { className: "w-5 h-5 flex-shrink-0 text-[var(--appkit-color-text-muted)]" })), _jsx(Text, { className: `leading-snug ${done
|
|
83
83
|
? "line-through text-[var(--appkit-color-text-muted)]"
|
|
@@ -14,7 +14,7 @@ const CLS_STARS = "inline-flex items-center gap-[var(--appkit-space-1)] text-war
|
|
|
14
14
|
const CLS_FOLLOW_BTN = "rounded-lg border border-warning px-[var(--appkit-space-4)] py-[var(--appkit-space-2)] text-[length:var(--appkit-text-sm)] font-medium text-warning hover:bg-warning-surface transition-colors";
|
|
15
15
|
const CLS_WARN_BANNER = "mt-3 rounded-lg bg-warning-surface dark:bg-warning-surface border border-warning dark:border-warning px-[var(--appkit-space-3)] py-[var(--appkit-space-2)] text-[length:var(--appkit-text-sm)] text-warning dark:text-warning";
|
|
16
16
|
export function StoreHeader({ store, labels = {}, onFollow, className = "", trust, }) {
|
|
17
|
-
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (_jsx(Div, { className: `relative h-40 md:h-56 ${__O.hidden} bg-[var(--appkit-color-surface)] bg-[var(--appkit-color-surface-elevated)]`, children: _jsx(MediaImage, { src: store.storeBannerURL, alt: `${store.storeName} banner`, size: "banner" }) })), _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, { className: "relative -mt-8 h-16 w-16 border-2 border-white", rounded: "xl", shadow: "sm", overflow: "hidden", children: _jsx(MediaImage, { src: store.storeLogoURL, alt: store.storeName, size: "avatar" }) })) : (_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-[var(--appkit-color-text)]", 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)] })), trust && _jsx(SellerTrustBadge, { trust: trust }), _jsx(OwnerQuickActions, { resource: "STORE", placement: "detail", editHref: String(ROUTES.ADMIN.STORE_DETAIL(store.storeSlug)), recordLabel: store.storeName })
|
|
17
|
+
return (_jsxs(Section, { surface: "default", border: "bottom", className: className, children: [store.storeBannerURL && (_jsx(Div, { className: `relative h-40 md:h-56 ${__O.hidden} bg-[var(--appkit-color-surface)] bg-[var(--appkit-color-surface-elevated)]`, children: _jsx(MediaImage, { src: store.storeBannerURL, alt: `${store.storeName} banner`, size: "banner" }) })), _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, { className: "relative -mt-8 h-16 w-16 border-2 border-white", rounded: "xl", shadow: "sm", overflow: "hidden", children: _jsx(MediaImage, { src: store.storeLogoURL, alt: store.storeName, size: "avatar" }) })) : (_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-[var(--appkit-color-text)]", 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)] })), trust && _jsx(SellerTrustBadge, { trust: trust })] }), _jsx(OwnerQuickActions, { resource: "STORE", placement: "detail", editHref: String(ROUTES.ADMIN.STORE_DETAIL(store.storeSlug)), recordLabel: store.storeName }), _jsxs(Row, { textSize: "xs", className: "text-[var(--appkit-color-text-muted)] 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 ??
|
|
18
18
|
labels.vacationMode ??
|
|
19
19
|
"Store is on vacation mode" }))] })] }));
|
|
20
20
|
}
|
|
@@ -28,6 +28,7 @@ export declare const TicketCategoryValues: {
|
|
|
28
28
|
readonly GENERAL: "general";
|
|
29
29
|
readonly STORE_CHANGE_REQUEST: "store_change_request";
|
|
30
30
|
readonly ORDER_MODIFICATION_REQUEST: "order_modification_request";
|
|
31
|
+
readonly GRIEVANCE: "grievance";
|
|
31
32
|
readonly UNBAN_REQUEST: "unban_request";
|
|
32
33
|
};
|
|
33
34
|
export type TicketCategory = (typeof TicketCategoryValues)[keyof typeof TicketCategoryValues];
|
|
@@ -49,7 +50,52 @@ export type TicketPriority = (typeof TicketPriorityValues)[keyof typeof TicketPr
|
|
|
49
50
|
/** Statuses considered "active" for limit-enforcement purposes. */
|
|
50
51
|
export declare const ACTIVE_TICKET_STATUSES: TicketStatus[];
|
|
51
52
|
/** Order statuses that are eligible for a support ticket. */
|
|
52
|
-
|
|
53
|
+
/**
|
|
54
|
+
* ๐ THIS CONSTANT IS DEAD โ it has no consumer, and that CORRECTS D22.
|
|
55
|
+
*
|
|
56
|
+
* The plan records: *"`DELIVERED` is absent from
|
|
57
|
+
* `ELIGIBLE_ORDER_STATUSES_FOR_TICKET` โ the status most money complaints arise
|
|
58
|
+
* in โ as is `REFUNDED`"*, and concludes a buyer whose delivered order is wrong
|
|
59
|
+
* *"may be unable to attach a ticket to it"*.
|
|
60
|
+
*
|
|
61
|
+
* Measured: the only references anywhere are this declaration and its
|
|
62
|
+
* re-export from `appkit/src/index.ts`. **`createTicket` applies no order-status
|
|
63
|
+
* gate at all**, so nothing is excluded and no buyer is blocked. The list is
|
|
64
|
+
* also in UPPERCASE while `OrderStatus` is lowercase, so had anything compared
|
|
65
|
+
* against it directly it would have matched *nothing* and blocked EVERY order โ
|
|
66
|
+
* the Root Cause #33 shape, latent.
|
|
67
|
+
*
|
|
68
|
+
* Left in place rather than deleted: it is exported from the public barrel, so
|
|
69
|
+
* removing it is a breaking change for a consumer, and `DELIVERED`/`REFUNDED`
|
|
70
|
+
* are added so that if anything ever does consume it, it is correct on the day
|
|
71
|
+
* it becomes live rather than wrong in the direction the plan feared.
|
|
72
|
+
*
|
|
73
|
+
* The plan's other D22 claims are also stale and worth recording:
|
|
74
|
+
* `resolvedAt`/`closedAt` DO have a writer (`support.repository.ts` stamps them
|
|
75
|
+
* on the transition into RESOLVED, fixed 2026-08-26), and no per-order ticket
|
|
76
|
+
* limit is enforced anywhere. What was genuinely missing is the CLOCK โ
|
|
77
|
+
* `acknowledgedAt`, `dueAt`, `firstResponseAt`, `disputedAmount` โ which Phase
|
|
78
|
+
* 10 adds above.
|
|
79
|
+
*/
|
|
80
|
+
export declare const ELIGIBLE_ORDER_STATUSES_FOR_TICKET: readonly ["PENDING", "PROCESSING", "SHIPPED", "RETURN_REQUESTED", "DELIVERED", "REFUNDED"];
|
|
81
|
+
/**
|
|
82
|
+
* Statutory grievance periods, in hours. **Defaults, pending the owner.**
|
|
83
|
+
*
|
|
84
|
+
* ๐ I am not asserting the real statutory numbers from memory. These are
|
|
85
|
+
* placeholders chosen to be *shorter* than any plausible statutory period, so
|
|
86
|
+
* the internal clock fires EARLY rather than late โ a deadline we beat is
|
|
87
|
+
* harmless, one we miss is the thing the regime exists to punish.
|
|
88
|
+
*
|
|
89
|
+
* Nothing published reads these. The public `/grievance` page is untouched
|
|
90
|
+
* until the owner supplies a named officer and the actual periods (D17), at
|
|
91
|
+
* which point these become the `settingPath`-backed values.
|
|
92
|
+
*/
|
|
93
|
+
export declare const GRIEVANCE_PERIODS: {
|
|
94
|
+
/** Acknowledge receipt within this. */
|
|
95
|
+
readonly acknowledgeHours: 48;
|
|
96
|
+
/** Resolve within this. */
|
|
97
|
+
readonly resolveHours: number;
|
|
98
|
+
};
|
|
53
99
|
export type TicketMessage = {
|
|
54
100
|
id: string;
|
|
55
101
|
authorId: string;
|
|
@@ -151,6 +197,31 @@ export interface SupportTicketDocument extends BaseDocument {
|
|
|
151
197
|
*/
|
|
152
198
|
resolvedAt?: Date;
|
|
153
199
|
closedAt?: Date;
|
|
200
|
+
/** When we acknowledged receipt. Server-stamped at intake. */
|
|
201
|
+
acknowledgedAt?: Date;
|
|
202
|
+
/**
|
|
203
|
+
* The resolution deadline.
|
|
204
|
+
*
|
|
205
|
+
* ๐ A hard date, like a chargeback's `respond_by` โ not an SLA we invented
|
|
206
|
+
* for comfort. It is what makes "how long do tickets take" answerable for
|
|
207
|
+
* the first time, which is the evidence a grievance regime actually requires.
|
|
208
|
+
*/
|
|
209
|
+
dueAt?: Date;
|
|
210
|
+
/**
|
|
211
|
+
* When a human first replied โ distinct from `acknowledgedAt`, which is
|
|
212
|
+
* automatic. An acknowledgement is a receipt; a first response is a person.
|
|
213
|
+
* Conflating them would let an auto-reply satisfy a human obligation.
|
|
214
|
+
*/
|
|
215
|
+
firstResponseAt?: Date;
|
|
216
|
+
/**
|
|
217
|
+
* The amount in dispute, in decimal rupees.
|
|
218
|
+
*
|
|
219
|
+
* Structured rather than left in the prose, because a money complaint whose
|
|
220
|
+
* amount an admin has to read out of a paragraph cannot be sorted, totalled
|
|
221
|
+
* or prioritised โ and "which open grievances are worth the most" is the
|
|
222
|
+
* first question anyone asks of this queue.
|
|
223
|
+
*/
|
|
224
|
+
disputedAmount?: number;
|
|
154
225
|
/**
|
|
155
226
|
* Who changed what, when, and why. See ยง "Status History" in CLAUDE.md.
|
|
156
227
|
* Append-only, capped at STATUS_HISTORY_MAX, oldest evicted first.
|
|
@@ -177,7 +248,7 @@ export declare const SUPPORT_TICKET_TRACKED_FIELDS: readonly ["status", "priorit
|
|
|
177
248
|
* (`assignedTo`) and never the name.
|
|
178
249
|
*/
|
|
179
250
|
export declare const SUPPORT_TICKET_PII_FIELDS: readonly ["userEmail", "userDisplayName", "assignedToName"];
|
|
180
|
-
export type SupportTicketCreateInput = Pick<SupportTicketPlain, "userId" | "userEmail" | "userDisplayName" | "category" | "subject" | "description" | "orderId" | "storeId">;
|
|
251
|
+
export type SupportTicketCreateInput = Pick<SupportTicketPlain, "userId" | "userEmail" | "userDisplayName" | "category" | "subject" | "description" | "orderId" | "storeId" | "acknowledgedAt" | "dueAt" | "disputedAmount">;
|
|
181
252
|
export type SupportTicketUpdateInput = Partial<Pick<SupportTicketPlain, "status" | "priority" | "assignedTo" | "assignedToName" | "internalNotes" | "relatedParties">>;
|
|
182
253
|
export declare const SUPPORT_TICKET_COLLECTION: "supportTickets";
|
|
183
254
|
export declare const SUPPORT_TICKET_ID_PREFIX: "ticket-";
|
|
@@ -32,6 +32,16 @@ export const TicketCategoryValues = {
|
|
|
32
32
|
// ST-3 โ buyers/sellers request mutation of order line items
|
|
33
33
|
// (wrong item shipped, partial fulfilment, bundle correction).
|
|
34
34
|
ORDER_MODIFICATION_REQUEST: "order_modification_request",
|
|
35
|
+
/*
|
|
36
|
+
* Phase 10 โ a formal grievance, with a statutory clock.
|
|
37
|
+
*
|
|
38
|
+
* ๐ Its own category rather than `general` with a flag, because the
|
|
39
|
+
* category is what the admin queue filters by and what decides whether
|
|
40
|
+
* `dueAt` is set. A grievance filed as `general` is a grievance nobody can
|
|
41
|
+
* find, and the clock would be invisible โ which is the whole failure this
|
|
42
|
+
* closes (D18: no form, no route, no record, only a `mailto:`).
|
|
43
|
+
*/
|
|
44
|
+
GRIEVANCE: "grievance",
|
|
35
45
|
// ST-5 โ users appeal a soft-ban or hard-ban via this category.
|
|
36
46
|
// Server bypasses the create_support_tickets soft-ban guard and the
|
|
37
47
|
// active-ticket limit so the user always has an appeal channel.
|
|
@@ -57,12 +67,61 @@ export const ACTIVE_TICKET_STATUSES = [
|
|
|
57
67
|
"waiting_on_user",
|
|
58
68
|
];
|
|
59
69
|
/** Order statuses that are eligible for a support ticket. */
|
|
70
|
+
/**
|
|
71
|
+
* ๐ THIS CONSTANT IS DEAD โ it has no consumer, and that CORRECTS D22.
|
|
72
|
+
*
|
|
73
|
+
* The plan records: *"`DELIVERED` is absent from
|
|
74
|
+
* `ELIGIBLE_ORDER_STATUSES_FOR_TICKET` โ the status most money complaints arise
|
|
75
|
+
* in โ as is `REFUNDED`"*, and concludes a buyer whose delivered order is wrong
|
|
76
|
+
* *"may be unable to attach a ticket to it"*.
|
|
77
|
+
*
|
|
78
|
+
* Measured: the only references anywhere are this declaration and its
|
|
79
|
+
* re-export from `appkit/src/index.ts`. **`createTicket` applies no order-status
|
|
80
|
+
* gate at all**, so nothing is excluded and no buyer is blocked. The list is
|
|
81
|
+
* also in UPPERCASE while `OrderStatus` is lowercase, so had anything compared
|
|
82
|
+
* against it directly it would have matched *nothing* and blocked EVERY order โ
|
|
83
|
+
* the Root Cause #33 shape, latent.
|
|
84
|
+
*
|
|
85
|
+
* Left in place rather than deleted: it is exported from the public barrel, so
|
|
86
|
+
* removing it is a breaking change for a consumer, and `DELIVERED`/`REFUNDED`
|
|
87
|
+
* are added so that if anything ever does consume it, it is correct on the day
|
|
88
|
+
* it becomes live rather than wrong in the direction the plan feared.
|
|
89
|
+
*
|
|
90
|
+
* The plan's other D22 claims are also stale and worth recording:
|
|
91
|
+
* `resolvedAt`/`closedAt` DO have a writer (`support.repository.ts` stamps them
|
|
92
|
+
* on the transition into RESOLVED, fixed 2026-08-26), and no per-order ticket
|
|
93
|
+
* limit is enforced anywhere. What was genuinely missing is the CLOCK โ
|
|
94
|
+
* `acknowledgedAt`, `dueAt`, `firstResponseAt`, `disputedAmount` โ which Phase
|
|
95
|
+
* 10 adds above.
|
|
96
|
+
*/
|
|
60
97
|
export const ELIGIBLE_ORDER_STATUSES_FOR_TICKET = [
|
|
61
98
|
"PENDING",
|
|
62
99
|
"PROCESSING",
|
|
63
100
|
"SHIPPED",
|
|
64
101
|
"RETURN_REQUESTED",
|
|
102
|
+
// Added for correctness-if-ever-used: these are the statuses most money
|
|
103
|
+
// complaints arise in, and their absence is what D22 flagged.
|
|
104
|
+
"DELIVERED",
|
|
105
|
+
"REFUNDED",
|
|
65
106
|
];
|
|
107
|
+
/**
|
|
108
|
+
* Statutory grievance periods, in hours. **Defaults, pending the owner.**
|
|
109
|
+
*
|
|
110
|
+
* ๐ I am not asserting the real statutory numbers from memory. These are
|
|
111
|
+
* placeholders chosen to be *shorter* than any plausible statutory period, so
|
|
112
|
+
* the internal clock fires EARLY rather than late โ a deadline we beat is
|
|
113
|
+
* harmless, one we miss is the thing the regime exists to punish.
|
|
114
|
+
*
|
|
115
|
+
* Nothing published reads these. The public `/grievance` page is untouched
|
|
116
|
+
* until the owner supplies a named officer and the actual periods (D17), at
|
|
117
|
+
* which point these become the `settingPath`-backed values.
|
|
118
|
+
*/
|
|
119
|
+
export const GRIEVANCE_PERIODS = {
|
|
120
|
+
/** Acknowledge receipt within this. */
|
|
121
|
+
acknowledgeHours: 48,
|
|
122
|
+
/** Resolve within this. */
|
|
123
|
+
resolveHours: 30 * 24,
|
|
124
|
+
};
|
|
66
125
|
/**
|
|
67
126
|
* The fields whose changes earn a timeline entry.
|
|
68
127
|
*
|