@mohasinac/appkit 2.6.3 → 2.6.5
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/server/features/account/data.js +2 -2
- package/dist/_internal/server/features/bundles/data.d.ts +26 -6
- package/dist/_internal/server/features/bundles/data.js +41 -6
- package/dist/_internal/server/features/bundles/index.d.ts +3 -2
- package/dist/_internal/server/features/bundles/index.js +4 -2
- package/dist/_internal/server/features/bundles/metadata.d.ts +20 -0
- package/dist/_internal/server/features/bundles/metadata.js +46 -0
- package/dist/_internal/server/features/bundles/og.d.ts +38 -0
- package/dist/_internal/server/features/bundles/og.js +122 -0
- package/dist/_internal/server/features/checkout/actions.js +192 -133
- package/dist/_internal/server/features/checkout/bundle-expansion.d.ts +57 -0
- package/dist/_internal/server/features/checkout/bundle-expansion.js +70 -0
- package/dist/_internal/server/features/checkout/prize-bundle-gates.d.ts +5 -15
- package/dist/_internal/server/features/checkout/prize-bundle-gates.js +5 -21
- package/dist/_internal/server/features/media/contextGuards.js +15 -1
- package/dist/_internal/server/features/payouts/actions.d.ts +19 -0
- package/dist/_internal/server/features/payouts/actions.js +38 -0
- package/dist/_internal/server/features/products/data.js +1 -2
- package/dist/_internal/server/features/raffle/actions.d.ts +11 -0
- package/dist/_internal/server/features/raffle/actions.js +31 -0
- package/dist/_internal/server/features/refunds/actions.d.ts +31 -0
- package/dist/_internal/server/features/refunds/actions.js +77 -0
- package/dist/_internal/server/jobs/core/adminAnalytics.d.ts +28 -0
- package/dist/_internal/server/jobs/core/adminAnalytics.js +98 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.d.ts +19 -0
- package/dist/_internal/server/jobs/core/assignSpinPrize.js +81 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.d.ts +2 -0
- package/dist/_internal/server/jobs/core/auctionSettlement.js +70 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.d.ts +2 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +109 -0
- package/dist/_internal/server/jobs/core/bundleStockSync.d.ts +10 -0
- package/dist/_internal/server/jobs/core/bundleStockSync.js +71 -0
- package/dist/_internal/server/jobs/core/cartPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/cartPrune.js +13 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.d.ts +2 -0
- package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +45 -0
- package/dist/_internal/server/jobs/core/countersReconcile.d.ts +2 -0
- package/dist/_internal/server/jobs/core/countersReconcile.js +107 -0
- package/dist/_internal/server/jobs/core/couponExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/couponExpiry.js +13 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.d.ts +2 -0
- package/dist/_internal/server/jobs/core/dailyDataCleanup.js +20 -0
- package/dist/_internal/server/jobs/core/index.d.ts +44 -0
- package/dist/_internal/server/jobs/core/index.js +47 -0
- package/dist/_internal/server/jobs/core/listingProcessor.d.ts +30 -0
- package/dist/_internal/server/jobs/core/listingProcessor.js +138 -0
- package/dist/_internal/server/jobs/core/mediaTmpCleanup.d.ts +14 -0
- package/dist/_internal/server/jobs/core/mediaTmpCleanup.js +68 -0
- package/dist/_internal/server/jobs/core/notificationPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/notificationPrune.js +13 -0
- package/dist/_internal/server/jobs/core/offerExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/offerExpiry.js +50 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.d.ts +15 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.js +59 -0
- package/dist/_internal/server/jobs/core/onCategoryWrite.d.ts +14 -0
- package/dist/_internal/server/jobs/core/onCategoryWrite.js +134 -0
- package/dist/_internal/server/jobs/core/onOrderCreate.d.ts +18 -0
- package/dist/_internal/server/jobs/core/onOrderCreate.js +78 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +19 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.js +139 -0
- package/dist/_internal/server/jobs/core/onProductStockChange.d.ts +23 -0
- package/dist/_internal/server/jobs/core/onProductStockChange.js +130 -0
- package/dist/_internal/server/jobs/core/onProductWrite.d.ts +12 -0
- package/dist/_internal/server/jobs/core/onProductWrite.js +94 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.d.ts +7 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.js +49 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.d.ts +12 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.js +7 -0
- package/dist/_internal/server/jobs/core/payoutBatch.d.ts +8 -0
- package/dist/_internal/server/jobs/core/payoutBatch.js +102 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.d.ts +2 -0
- package/dist/_internal/server/jobs/core/pendingOrderTimeout.js +27 -0
- package/dist/_internal/server/jobs/core/positionsReconcile.d.ts +7 -0
- package/dist/_internal/server/jobs/core/positionsReconcile.js +87 -0
- package/dist/_internal/server/jobs/core/prizeRevealClose.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealClose.js +22 -0
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealExpiry.js +50 -0
- package/dist/_internal/server/jobs/core/prizeRevealOpen.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealOpen.js +56 -0
- package/dist/_internal/server/jobs/core/prizeRevealReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/core/prizeRevealReminder.js +38 -0
- package/dist/_internal/server/jobs/core/productStatsSync.d.ts +8 -0
- package/dist/_internal/server/jobs/core/productStatsSync.js +36 -0
- package/dist/_internal/server/jobs/core/promotions.d.ts +12 -0
- package/dist/_internal/server/jobs/core/promotions.js +43 -0
- package/dist/_internal/server/jobs/core/storeAnalytics.d.ts +30 -0
- package/dist/_internal/server/jobs/core/storeAnalytics.js +109 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.d.ts +19 -0
- package/dist/_internal/server/jobs/core/triggerEventRaffle.js +86 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +6 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +85 -0
- package/dist/_internal/server/jobs/handlers/adminAnalytics.d.ts +2 -26
- package/dist/_internal/server/jobs/handlers/adminAnalytics.js +2 -98
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.d.ts +1 -22
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +2 -86
- package/dist/_internal/server/jobs/handlers/auctionSettlement.js +2 -70
- package/dist/_internal/server/jobs/handlers/autoPayoutEligibility.js +2 -110
- package/dist/_internal/server/jobs/handlers/bundleStockSync.d.ts +0 -16
- package/dist/_internal/server/jobs/handlers/bundleStockSync.js +2 -80
- package/dist/_internal/server/jobs/handlers/cartPrune.js +2 -13
- package/dist/_internal/server/jobs/handlers/cleanupRtdbEvents.js +2 -45
- package/dist/_internal/server/jobs/handlers/countersReconcile.js +2 -109
- package/dist/_internal/server/jobs/handlers/couponExpiry.js +2 -13
- package/dist/_internal/server/jobs/handlers/dailyDataCleanup.js +2 -20
- package/dist/_internal/server/jobs/handlers/listingProcessor.d.ts +3 -28
- package/dist/_internal/server/jobs/handlers/listingProcessor.js +3 -138
- package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.d.ts +0 -12
- package/dist/_internal/server/jobs/handlers/mediaTmpCleanup.js +2 -69
- package/dist/_internal/server/jobs/handlers/notificationPrune.js +2 -13
- package/dist/_internal/server/jobs/handlers/offerExpiry.js +2 -50
- package/dist/_internal/server/jobs/handlers/onBidPlaced.d.ts +1 -10
- package/dist/_internal/server/jobs/handlers/onBidPlaced.js +2 -56
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.d.ts +1 -8
- package/dist/_internal/server/jobs/handlers/onCategoryWrite.js +6 -134
- package/dist/_internal/server/jobs/handlers/onOrderCreate.d.ts +1 -12
- package/dist/_internal/server/jobs/handlers/onOrderCreate.js +2 -76
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.d.ts +1 -12
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +2 -139
- package/dist/_internal/server/jobs/handlers/onProductStockChange.d.ts +0 -13
- package/dist/_internal/server/jobs/handlers/onProductStockChange.js +7 -134
- package/dist/_internal/server/jobs/handlers/onProductWrite.d.ts +1 -6
- package/dist/_internal/server/jobs/handlers/onProductWrite.js +6 -106
- package/dist/_internal/server/jobs/handlers/onReviewWrite.js +2 -49
- package/dist/_internal/server/jobs/handlers/onStoreWrite.d.ts +1 -8
- package/dist/_internal/server/jobs/handlers/onStoreWrite.js +7 -8
- package/dist/_internal/server/jobs/handlers/payoutBatch.d.ts +0 -9
- package/dist/_internal/server/jobs/handlers/payoutBatch.js +2 -104
- package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/pendingOrderTimeout.js +2 -33
- package/dist/_internal/server/jobs/handlers/positionsReconcile.d.ts +0 -5
- package/dist/_internal/server/jobs/handlers/positionsReconcile.js +2 -87
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.d.ts +0 -7
- package/dist/_internal/server/jobs/handlers/prizeRevealClose.js +2 -29
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.d.ts +0 -8
- package/dist/_internal/server/jobs/handlers/prizeRevealExpiry.js +2 -58
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.d.ts +0 -8
- package/dist/_internal/server/jobs/handlers/prizeRevealOpen.js +2 -65
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.d.ts +0 -7
- package/dist/_internal/server/jobs/handlers/prizeRevealReminder.js +2 -45
- package/dist/_internal/server/jobs/handlers/productStatsSync.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/productStatsSync.js +2 -36
- package/dist/_internal/server/jobs/handlers/promotions.d.ts +2 -10
- package/dist/_internal/server/jobs/handlers/promotions.js +2 -43
- package/dist/_internal/server/jobs/handlers/storeAnalytics.d.ts +2 -28
- package/dist/_internal/server/jobs/handlers/storeAnalytics.js +2 -109
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.d.ts +1 -28
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +2 -94
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.d.ts +0 -6
- package/dist/_internal/server/jobs/handlers/weeklyPayoutEligibility.js +2 -87
- package/dist/_internal/server/jobs/index.d.ts +1 -0
- package/dist/_internal/server/jobs/index.js +1 -0
- package/dist/_internal/server/jobs/runtime/adapters/firebase.js +21 -0
- package/dist/_internal/shared/actions/action-registry.d.ts +84 -0
- package/dist/_internal/shared/actions/action-registry.js +160 -0
- package/dist/_internal/shared/checkout/rules/_defaults.d.ts +3 -0
- package/dist/_internal/shared/checkout/rules/_defaults.js +22 -0
- package/dist/_internal/shared/checkout/rules/_limits.d.ts +19 -0
- package/dist/_internal/shared/checkout/rules/_limits.js +19 -0
- package/dist/_internal/shared/checkout/rules/_registry.d.ts +44 -0
- package/dist/_internal/shared/checkout/rules/_registry.js +87 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.js +10 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.d.ts +11 -0
- package/dist/_internal/shared/checkout/rules/bundle.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.js +9 -0
- package/dist/_internal/shared/checkout/rules/digital-code.rule.d.ts +8 -0
- package/dist/_internal/shared/checkout/rules/digital-code.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +12 -0
- package/dist/_internal/shared/checkout/rules/index.js +12 -0
- package/dist/_internal/shared/checkout/rules/live.rule.d.ts +10 -0
- package/dist/_internal/shared/checkout/rules/live.rule.js +6 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/offer.rule.js +9 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/preorder.rule.js +28 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +65 -0
- package/dist/_internal/shared/checkout/rules/standard.rule.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/standard.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +125 -0
- package/dist/_internal/shared/checkout/rules/types.js +13 -0
- package/dist/_internal/shared/features/cart/schema.d.ts +6 -6
- package/dist/_internal/shared/features/categories/bundle-copy.d.ts +123 -0
- package/dist/_internal/shared/features/categories/bundle-copy.js +134 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +318 -0
- package/dist/_internal/shared/features/categories/bundle-schemas.js +55 -0
- package/dist/_internal/shared/features/events/schema.d.ts +4 -4
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +36 -0
- package/dist/_internal/shared/features/orders/refund-copy.js +40 -0
- package/dist/_internal/shared/features/orders/schema.d.ts +4 -4
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/_internal/shared/listing-types/_registry.d.ts +27 -0
- package/dist/_internal/shared/listing-types/_registry.js +8 -0
- package/dist/_internal/shared/listing-types/action-tracker.d.ts +41 -0
- package/dist/_internal/shared/listing-types/action-tracker.js +70 -0
- package/dist/_internal/shared/listing-types/capabilities.js +25 -0
- package/dist/_internal/shared/listing-types/cart-shipping.d.ts +37 -0
- package/dist/_internal/shared/listing-types/cart-shipping.js +46 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/classified/config.js +8 -0
- package/dist/_internal/shared/listing-types/classified/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/classified/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/og.js +1 -0
- package/dist/_internal/shared/listing-types/classified/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/schema.js +1 -0
- package/dist/_internal/shared/listing-types/classified/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/classified/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +8 -0
- package/dist/_internal/shared/listing-types/digital-code/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/digital-code/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/og.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/schema.js +1 -0
- package/dist/_internal/shared/listing-types/digital-code/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/digital-code/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +34 -0
- package/dist/_internal/shared/listing-types/feature-flags.js +45 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +7 -0
- package/dist/_internal/shared/listing-types/live/config.js +8 -0
- package/dist/_internal/shared/listing-types/live/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/live/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/og.js +1 -0
- package/dist/_internal/shared/listing-types/live/schema.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/schema.js +1 -0
- package/dist/_internal/shared/listing-types/live/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/live/seed-factory.js +1 -0
- package/dist/_internal/shared/media/limits.js +8 -0
- package/dist/client.d.ts +10 -5
- package/dist/client.js +16 -3
- package/dist/configs/next.js +7 -0
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +4 -0
- package/dist/core/hooks/useSyncManager.js +13 -1
- package/dist/core/unit-of-work.d.ts +1 -1
- package/dist/core/unit-of-work.js +2 -2
- package/dist/features/account/actions/address-actions.d.ts +1 -1
- package/dist/features/account/actions/address-actions.js +15 -7
- package/dist/features/account/schemas/firestore.d.ts +8 -43
- package/dist/features/account/schemas/firestore.js +8 -54
- package/dist/features/account/schemas/index.d.ts +6 -6
- package/dist/features/account/server.d.ts +1 -1
- package/dist/features/account/server.js +3 -1
- package/dist/features/addresses/index.d.ts +2 -0
- package/dist/features/addresses/index.js +2 -0
- package/dist/features/addresses/repository/addresses.repository.d.ts +29 -0
- package/dist/features/addresses/repository/addresses.repository.js +157 -0
- package/dist/features/addresses/schemas/firestore.d.ts +53 -0
- package/dist/features/addresses/schemas/firestore.js +68 -0
- package/dist/features/{bundles → addresses}/schemas/index.d.ts +0 -1
- package/dist/features/{bundles → addresses}/schemas/index.js +0 -1
- package/dist/features/addresses/server.d.ts +2 -0
- package/dist/features/addresses/server.js +2 -0
- package/dist/features/admin/components/AdminAllEventEntriesView.js +4 -3
- package/dist/features/admin/components/AdminBidsView.js +4 -3
- package/dist/features/admin/components/AdminBlogView.js +8 -3
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +9 -0
- package/dist/features/admin/components/AdminBundleEditorView.js +209 -0
- package/dist/features/admin/components/AdminBundlesView.d.ts +9 -0
- package/dist/features/admin/components/AdminBundlesView.js +59 -0
- package/dist/features/admin/components/AdminCartsView.js +13 -3
- package/dist/features/admin/components/AdminContactView.js +4 -3
- package/dist/features/admin/components/AdminCouponsView.js +32 -13
- package/dist/features/admin/components/AdminNewsletterView.js +4 -3
- package/dist/features/admin/components/AdminOrdersView.js +15 -7
- package/dist/features/admin/components/AdminPayoutsView.js +4 -3
- package/dist/features/admin/components/AdminPrizeDrawsView.d.ts +4 -0
- package/dist/features/admin/components/AdminPrizeDrawsView.js +135 -0
- package/dist/features/admin/components/AdminProductsView.js +6 -5
- package/dist/features/admin/components/AdminReviewsView.js +5 -4
- package/dist/features/admin/components/AdminStoresView.js +4 -3
- package/dist/features/admin/components/AdminUsersView.js +15 -5
- package/dist/features/admin/components/AdminWishlistsView.js +10 -1
- package/dist/features/admin/components/DataTable.d.ts +5 -1
- package/dist/features/admin/components/DataTable.js +24 -20
- package/dist/features/admin/components/index.d.ts +6 -0
- package/dist/features/admin/components/index.js +5 -0
- package/dist/features/admin/constants/filter-tabs.d.ts +435 -0
- package/dist/features/admin/constants/filter-tabs.js +216 -0
- package/dist/features/admin/hooks/useAdminListingData.d.ts +1 -0
- package/dist/features/admin/hooks/useAdminListingData.js +1 -0
- package/dist/features/admin/schemas/firestore.d.ts +15 -0
- package/dist/features/admin/schemas/firestore.js +18 -0
- package/dist/features/admin/types/product.types.d.ts +2 -2
- package/dist/features/auctions/components/AuctionCard.d.ts +4 -1
- package/dist/features/auctions/components/AuctionCard.js +5 -3
- package/dist/features/auctions/components/AuctionDetailPageView.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +2 -2
- package/dist/features/auctions/components/PlaceBidFormClient.js +12 -2
- package/dist/features/auctions/schemas/index.d.ts +2 -2
- package/dist/features/auth/index.d.ts +1 -0
- package/dist/features/auth/index.js +1 -0
- package/dist/features/auth/role-predicates.d.ts +16 -0
- package/dist/features/auth/role-predicates.js +15 -0
- package/dist/features/blog/components/BlogFeaturedCard.d.ts +4 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +5 -3
- package/dist/features/cart/actions/cart-actions.d.ts +1 -0
- package/dist/features/cart/actions/cart-actions.js +16 -0
- package/dist/features/cart/components/CartView.d.ts +19 -1
- package/dist/features/cart/components/CartView.js +2 -2
- package/dist/features/cart/components/ShippingPicker.d.ts +13 -0
- package/dist/features/cart/components/ShippingPicker.js +48 -0
- package/dist/features/cart/components/index.d.ts +3 -1
- package/dist/features/cart/components/index.js +1 -0
- package/dist/features/cart/hooks/useCartCount.js +7 -1
- package/dist/features/cart/repository/cart.repository.d.ts +1 -0
- package/dist/features/cart/repository/cart.repository.js +35 -0
- package/dist/features/cart/schemas/firestore.d.ts +27 -2
- package/dist/features/categories/components/BundleAddToCartCta.d.ts +16 -0
- package/dist/features/categories/components/BundleAddToCartCta.js +54 -0
- package/dist/features/categories/components/BundleBuyNowCta.d.ts +8 -0
- package/dist/features/categories/components/BundleBuyNowCta.js +37 -0
- package/dist/features/categories/components/BundleDetailView.d.ts +22 -0
- package/dist/features/categories/components/BundleDetailView.js +31 -0
- package/dist/features/categories/components/BundleDynamicRuleEditor.d.ts +18 -0
- package/dist/features/categories/components/BundleDynamicRuleEditor.js +60 -0
- package/dist/features/categories/components/BundleItemsPicker.d.ts +26 -0
- package/dist/features/categories/components/BundleItemsPicker.js +135 -0
- package/dist/features/categories/components/BundlesListView.d.ts +13 -0
- package/dist/features/categories/components/BundlesListView.js +27 -0
- package/dist/features/categories/components/index.d.ts +12 -0
- package/dist/features/categories/components/index.js +9 -0
- package/dist/features/checkout/actions/checkout-actions.js +10 -3
- package/dist/features/events/components/AdminEventEditorView.js +108 -2
- package/dist/features/events/components/AdminEventsView.js +16 -4
- package/dist/features/events/components/EventCard.d.ts +4 -1
- package/dist/features/events/components/EventCard.js +7 -3
- package/dist/features/events/components/EventRaffleWinnerView.d.ts +21 -0
- package/dist/features/events/components/EventRaffleWinnerView.js +18 -0
- package/dist/features/events/components/SpinWheelView.d.ts +27 -0
- package/dist/features/events/components/SpinWheelView.js +64 -0
- package/dist/features/events/components/index.d.ts +4 -0
- package/dist/features/events/components/index.js +2 -0
- package/dist/features/events/schemas/firestore.d.ts +27 -1
- package/dist/features/events/schemas/firestore.js +7 -0
- package/dist/features/events/types/index.d.ts +27 -1
- package/dist/features/homepage/components/FeaturedBundlesSection.d.ts +16 -0
- package/dist/features/homepage/components/FeaturedBundlesSection.js +24 -0
- package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -1
- package/dist/features/homepage/components/WhatsAppCommunitySection.js +2 -2
- package/dist/features/homepage/lib/section-renderer.d.ts +2 -0
- package/dist/features/homepage/lib/section-renderer.js +5 -5
- package/dist/features/layout/NavbarLayout.d.ts +3 -1
- package/dist/features/layout/NavbarLayout.js +32 -3
- package/dist/features/layout/TitleBarLayout.d.ts +6 -3
- package/dist/features/layout/TitleBarLayout.js +22 -7
- package/dist/features/media/upload/MediaUploadField.d.ts +15 -1
- package/dist/features/media/upload/MediaUploadField.js +22 -1
- package/dist/features/orders/components/MarketplaceOrderCard.js +4 -2
- package/dist/features/orders/components/OrderSiblingPayments.d.ts +8 -0
- package/dist/features/orders/components/OrderSiblingPayments.js +16 -0
- package/dist/features/orders/components/RefundHistoryTable.d.ts +6 -0
- package/dist/features/orders/components/RefundHistoryTable.js +23 -0
- package/dist/features/orders/components/RefundRequestView.d.ts +8 -0
- package/dist/features/orders/components/RefundRequestView.js +42 -0
- package/dist/features/orders/components/index.d.ts +6 -0
- package/dist/features/orders/components/index.js +3 -0
- package/dist/features/orders/index.d.ts +1 -0
- package/dist/features/orders/index.js +2 -0
- package/dist/features/orders/repository/orders.repository.d.ts +20 -1
- package/dist/features/orders/repository/orders.repository.js +30 -1
- package/dist/features/orders/schemas/firestore.d.ts +63 -13
- package/dist/features/orders/schemas/firestore.js +5 -5
- package/dist/features/orders/schemas/index.d.ts +4 -4
- package/dist/features/orders/types/index.d.ts +12 -2
- package/dist/features/orders/utils/bundle-grouping.d.ts +48 -0
- package/dist/features/orders/utils/bundle-grouping.js +54 -0
- package/dist/features/orders/utils/order-splitter.d.ts +9 -10
- package/dist/features/orders/utils/order-splitter.js +24 -30
- package/dist/features/payments/repository/payout.repository.d.ts +17 -1
- package/dist/features/payments/repository/payout.repository.js +47 -0
- package/dist/features/payments/schemas/firestore.d.ts +26 -0
- package/dist/features/pre-orders/components/PreorderCard.d.ts +4 -1
- package/dist/features/pre-orders/components/PreorderCard.js +8 -6
- package/dist/features/products/actions/product-actions.d.ts +1 -1
- package/dist/features/products/actions/product-actions.js +1 -1
- package/dist/features/products/components/CompareOverlay.d.ts +2 -2
- package/dist/features/products/components/CompareOverlay.js +4 -4
- package/dist/features/products/components/InteractiveProductCard.js +7 -12
- package/dist/features/products/components/NonRefundableConsentModal.d.ts +1 -1
- package/dist/features/products/components/NonRefundableConsentModal.js +0 -10
- package/dist/features/products/components/ProductGrid.js +28 -12
- package/dist/features/products/components/ShowGroupSection.js +3 -3
- package/dist/features/products/components/SublistingCarouselSection.js +2 -2
- package/dist/features/products/components/index.d.ts +0 -4
- package/dist/features/products/components/index.js +5 -2
- package/dist/features/products/index.d.ts +1 -1
- package/dist/features/products/index.js +3 -1
- package/dist/features/products/repository/products.repository.js +4 -0
- package/dist/features/products/schemas/catalog-product.d.ts +70 -0
- package/dist/features/products/schemas/catalog-product.js +50 -0
- package/dist/features/products/schemas/firestore.d.ts +110 -2
- package/dist/features/products/schemas/firestore.js +30 -0
- package/dist/features/products/schemas/index.d.ts +8 -8
- package/dist/features/products/types/index.d.ts +1 -1
- package/dist/features/products/utils/listing-type.d.ts +9 -0
- package/dist/features/products/utils/listing-type.js +4 -0
- package/dist/features/promotions/actions/coupon-actions.d.ts +2 -2
- package/dist/features/promotions/actions/coupon-actions.js +1 -1
- package/dist/features/promotions/components/CouponCard.d.ts +28 -10
- package/dist/features/promotions/components/CouponCard.js +116 -14
- package/dist/features/promotions/hooks/useCouponValidate.d.ts +1 -1
- package/dist/features/promotions/repository/coupons.repository.d.ts +1 -1
- package/dist/features/reviews/schemas/index.d.ts +2 -2
- package/dist/features/search/schemas/index.d.ts +2 -2
- package/dist/features/search/types/index.d.ts +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +4 -5
- package/dist/features/seller/components/SellerBidsView.js +5 -13
- package/dist/features/seller/components/SellerCouponsView.js +31 -67
- package/dist/features/seller/components/SellerOffersView.js +4 -5
- package/dist/features/seller/components/SellerOrdersView.js +4 -5
- package/dist/features/seller/components/SellerPayoutsView.js +4 -5
- package/dist/features/seller/components/SellerPreOrdersView.d.ts +4 -0
- package/dist/features/seller/components/SellerPreOrdersView.js +141 -0
- package/dist/features/seller/components/SellerPrizeDrawsView.d.ts +4 -0
- package/dist/features/seller/components/SellerPrizeDrawsView.js +138 -0
- package/dist/features/seller/components/SellerProductsView.js +4 -8
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/schemas/index.d.ts +2 -2
- package/dist/features/stores/actions/store-address-actions.d.ts +10 -6
- package/dist/features/stores/actions/store-address-actions.js +8 -7
- package/dist/features/stores/components/InteractiveStoreCard.js +3 -10
- package/dist/features/stores/components/StoreDetailLayoutView.js +20 -5
- package/dist/features/stores/schemas/firestore.d.ts +45 -38
- package/dist/features/stores/schemas/firestore.js +2 -49
- package/dist/features/stores/server.d.ts +0 -1
- package/dist/features/stores/server.js +2 -1
- package/dist/features/wishlist/hooks/useWishlistCount.d.ts +7 -9
- package/dist/features/wishlist/hooks/useWishlistCount.js +67 -86
- package/dist/features/wishlist/types/index.d.ts +1 -1
- package/dist/index.d.ts +56 -9
- package/dist/index.js +66 -11
- package/dist/next/routing/route-map.d.ts +6 -0
- package/dist/next/routing/route-map.js +4 -0
- package/dist/providers/db-firebase/admin.d.ts +6 -2
- package/dist/providers/db-firebase/admin.js +23 -0
- package/dist/repositories/index.d.ts +1 -2
- package/dist/repositories/index.js +5 -2
- package/dist/security/authorization.d.ts +2 -1
- package/dist/security/authorization.js +3 -2
- package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
- package/dist/seed/bids-seed-data.d.ts +2 -2
- package/dist/seed/bids-seed-data.js +77 -2
- package/dist/seed/cart-seed-data.d.ts +10 -10
- package/dist/seed/cart-seed-data.js +15 -15
- package/dist/seed/events-seed-data.js +77 -0
- package/dist/seed/manifest.js +16 -8
- package/dist/seed/orders-seed-data.js +41 -2
- package/dist/seed/payouts-seed-data.js +18 -2
- package/dist/seed/stores-seed-data.js +55 -0
- package/dist/server-entry.d.ts +1 -0
- package/dist/server-entry.js +2 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +8 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/FilterChipGroup.d.ts +39 -0
- package/dist/ui/components/FilterChipGroup.js +15 -0
- package/dist/ui/components/HorizontalScroller.js +32 -7
- package/dist/ui/components/HorizontalScroller.style.css +6 -0
- package/dist/ui/components/SiteLogo.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/utils/id-generators.d.ts +11 -0
- package/dist/utils/id-generators.js +16 -0
- package/package.json +1 -1
- package/dist/_internal/shared/features/bundles/config.d.ts +0 -6
- package/dist/_internal/shared/features/bundles/config.js +0 -6
- package/dist/_internal/shared/schema-versions.d.ts +0 -76
- package/dist/_internal/shared/schema-versions.js +0 -82
- package/dist/features/account/migrations.d.ts +0 -2
- package/dist/features/account/migrations.js +0 -10
- package/dist/features/admin/migrations.d.ts +0 -2
- package/dist/features/admin/migrations.js +0 -10
- package/dist/features/auctions/migrations.d.ts +0 -2
- package/dist/features/auctions/migrations.js +0 -10
- package/dist/features/auth/migrations.d.ts +0 -2
- package/dist/features/auth/migrations.js +0 -10
- package/dist/features/blog/migrations.d.ts +0 -2
- package/dist/features/blog/migrations.js +0 -10
- package/dist/features/brands/actions/brand-actions.d.ts +0 -2
- package/dist/features/brands/actions/brand-actions.js +0 -5
- package/dist/features/brands/index.d.ts +0 -3
- package/dist/features/brands/index.js +0 -3
- package/dist/features/brands/migrations.d.ts +0 -2
- package/dist/features/brands/migrations.js +0 -10
- package/dist/features/brands/repository/brands.repository.d.ts +0 -13
- package/dist/features/brands/repository/brands.repository.js +0 -60
- package/dist/features/brands/schemas/index.d.ts +0 -33
- package/dist/features/brands/schemas/index.js +0 -15
- package/dist/features/brands/server.d.ts +0 -7
- package/dist/features/brands/server.js +0 -7
- package/dist/features/bundles/components/AdminBundleEditorView.d.ts +0 -8
- package/dist/features/bundles/components/AdminBundleEditorView.js +0 -7
- package/dist/features/bundles/components/BundleDetailPageView.d.ts +0 -9
- package/dist/features/bundles/components/BundleDetailPageView.js +0 -45
- package/dist/features/bundles/components/BundleForm.d.ts +0 -12
- package/dist/features/bundles/components/BundleForm.js +0 -126
- package/dist/features/bundles/components/BundleItemsPicker.d.ts +0 -9
- package/dist/features/bundles/components/BundleItemsPicker.js +0 -77
- package/dist/features/bundles/components/BundlesByCategoryListing.d.ts +0 -6
- package/dist/features/bundles/components/BundlesByCategoryListing.js +0 -50
- package/dist/features/bundles/components/BundlesListingView.d.ts +0 -17
- package/dist/features/bundles/components/BundlesListingView.js +0 -50
- package/dist/features/bundles/components/FeaturedBundlesSection.d.ts +0 -5
- package/dist/features/bundles/components/FeaturedBundlesSection.js +0 -55
- package/dist/features/bundles/components/SellerBundleCreateView.d.ts +0 -8
- package/dist/features/bundles/components/SellerBundleCreateView.js +0 -7
- package/dist/features/bundles/components/SellerBundleEditView.d.ts +0 -9
- package/dist/features/bundles/components/SellerBundleEditView.js +0 -7
- package/dist/features/bundles/components/index.d.ts +0 -18
- package/dist/features/bundles/components/index.js +0 -9
- package/dist/features/bundles/constants/index.d.ts +0 -32
- package/dist/features/bundles/constants/index.js +0 -35
- package/dist/features/bundles/index.d.ts +0 -2
- package/dist/features/bundles/index.js +0 -2
- package/dist/features/bundles/migrations.d.ts +0 -2
- package/dist/features/bundles/migrations.js +0 -10
- package/dist/features/bundles/repository/bundles.repository.d.ts +0 -36
- package/dist/features/bundles/repository/bundles.repository.js +0 -148
- package/dist/features/bundles/repository/index.d.ts +0 -1
- package/dist/features/bundles/repository/index.js +0 -1
- package/dist/features/bundles/schemas/firestore.d.ts +0 -88
- package/dist/features/bundles/schemas/firestore.js +0 -29
- package/dist/features/bundles/schemas/zod.d.ts +0 -377
- package/dist/features/bundles/schemas/zod.js +0 -71
- package/dist/features/cart/migrations.d.ts +0 -2
- package/dist/features/cart/migrations.js +0 -10
- package/dist/features/categories/migrations.d.ts +0 -2
- package/dist/features/categories/migrations.js +0 -10
- package/dist/features/events/migrations.d.ts +0 -2
- package/dist/features/events/migrations.js +0 -10
- package/dist/features/faq/migrations.d.ts +0 -2
- package/dist/features/faq/migrations.js +0 -10
- package/dist/features/grouped/migrations.d.ts +0 -2
- package/dist/features/grouped/migrations.js +0 -10
- package/dist/features/history/migrations.d.ts +0 -2
- package/dist/features/history/migrations.js +0 -10
- package/dist/features/messages/migrations.d.ts +0 -2
- package/dist/features/messages/migrations.js +0 -10
- package/dist/features/orders/migrations.d.ts +0 -2
- package/dist/features/orders/migrations.js +0 -10
- package/dist/features/payments/migrations.d.ts +0 -2
- package/dist/features/payments/migrations.js +0 -10
- package/dist/features/products/migrations.d.ts +0 -2
- package/dist/features/products/migrations.js +0 -10
- package/dist/features/products/repository/sublisting-categories.repository.d.ts +0 -16
- package/dist/features/products/repository/sublisting-categories.repository.js +0 -126
- package/dist/features/products/schemas/sublisting-categories.d.ts +0 -45
- package/dist/features/products/schemas/sublisting-categories.js +0 -16
- package/dist/features/promotions/migrations.d.ts +0 -2
- package/dist/features/promotions/migrations.js +0 -10
- package/dist/features/reviews/migrations.d.ts +0 -2
- package/dist/features/reviews/migrations.js +0 -10
- package/dist/features/scams/migrations.d.ts +0 -2
- package/dist/features/scams/migrations.js +0 -10
- package/dist/features/seller/migrations.d.ts +0 -2
- package/dist/features/seller/migrations.js +0 -10
- package/dist/features/stores/migrations.d.ts +0 -2
- package/dist/features/stores/migrations.js +0 -10
- package/dist/features/sublisting/migrations.d.ts +0 -2
- package/dist/features/sublisting/migrations.js +0 -10
- package/dist/features/sublisting/schemas/firestore.d.ts +0 -32
- package/dist/features/sublisting/schemas/firestore.js +0 -19
- package/dist/features/support/migrations.d.ts +0 -2
- package/dist/features/support/migrations.js +0 -10
- package/dist/features/wishlist/migrations.d.ts +0 -2
- package/dist/features/wishlist/migrations.js +0 -10
- package/dist/seed/_bundle-constants.d.ts +0 -14
- package/dist/seed/_bundle-constants.js +0 -14
- package/dist/seed/anime-figures-seed-data.d.ts +0 -8
- package/dist/seed/anime-figures-seed-data.js +0 -1033
- package/dist/seed/beyblade-seed-data.d.ts +0 -7
- package/dist/seed/beyblade-seed-data.js +0 -1129
- package/dist/seed/brands-seed-data.d.ts +0 -7
- package/dist/seed/brands-seed-data.js +0 -410
- package/dist/seed/bundles-seed-data.d.ts +0 -13
- package/dist/seed/bundles-seed-data.js +0 -229
- package/dist/seed/cosplay-accessories-seed-data.d.ts +0 -8
- package/dist/seed/cosplay-accessories-seed-data.js +0 -647
- package/dist/seed/hot-wheels-seed-data.d.ts +0 -7
- package/dist/seed/hot-wheels-seed-data.js +0 -1612
- package/dist/seed/letitrip-official-seed-data.d.ts +0 -8
- package/dist/seed/letitrip-official-seed-data.js +0 -399
- package/dist/seed/pokemon-carousel-slides-seed-data.d.ts +0 -8
- package/dist/seed/pokemon-carousel-slides-seed-data.js +0 -322
- package/dist/seed/pokemon-categories-seed-data.d.ts +0 -24
- package/dist/seed/pokemon-categories-seed-data.js +0 -547
- package/dist/seed/pokemon-coupons-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-coupons-seed-data.js +0 -465
- package/dist/seed/pokemon-homepage-sections-seed-data.d.ts +0 -7
- package/dist/seed/pokemon-homepage-sections-seed-data.js +0 -241
- package/dist/seed/pokemon-products-seed-data.d.ts +0 -9
- package/dist/seed/pokemon-products-seed-data.js +0 -1791
- package/dist/seed/pokemon-seed-bundle.d.ts +0 -47
- package/dist/seed/pokemon-seed-bundle.js +0 -71
- package/dist/seed/pokemon-stores-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-stores-seed-data.js +0 -179
- package/dist/seed/pokemon-users-seed-data.d.ts +0 -6
- package/dist/seed/pokemon-users-seed-data.js +0 -521
- package/dist/seed/products-seed-data.d.ts +0 -6
- package/dist/seed/products-seed-data.js +0 -2530
- package/dist/seed/retro-gaming-seed-data.d.ts +0 -8
- package/dist/seed/retro-gaming-seed-data.js +0 -801
- package/dist/seed/server.d.ts +0 -2
- package/dist/seed/server.js +0 -7
- package/dist/seed/sublisting-categories-seed-data.d.ts +0 -7
- package/dist/seed/sublisting-categories-seed-data.js +0 -159
- package/dist/seed/transformers-seed-data.d.ts +0 -7
- package/dist/seed/transformers-seed-data.js +0 -530
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FilterChipGroup — labelled wrap-group of pill buttons.
|
|
3
|
+
*
|
|
4
|
+
* The canonical primitive for the "Status / Type / Role" filter chips found
|
|
5
|
+
* on every admin and seller listing view. Replaces the 14-line inline render
|
|
6
|
+
* loop that used to be duplicated across 18+ view components.
|
|
7
|
+
*
|
|
8
|
+
* The `"All"` sentinel collapses to an empty filter string when picked so
|
|
9
|
+
* callers can write `setFilters(p => ({ ...p, status: id }))` directly.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <FilterChipGroup
|
|
14
|
+
* label="Status"
|
|
15
|
+
* tabs={ADMIN_ORDER_STATUS_TABS}
|
|
16
|
+
* value={pendingFilters.status}
|
|
17
|
+
* onChange={(id) => setPendingFilters((p) => ({ ...p, status: id }))}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export interface FilterChipGroupTab {
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
export interface FilterChipGroupProps {
|
|
26
|
+
/** Section label shown above the chips. */
|
|
27
|
+
label: string;
|
|
28
|
+
/** Tab definitions. Pass a constant from `appkit/src/features/admin/constants/filter-tabs.ts`. */
|
|
29
|
+
tabs: readonly FilterChipGroupTab[];
|
|
30
|
+
/** Current filter value (empty string = "All" selected). */
|
|
31
|
+
value: string;
|
|
32
|
+
/** Called with the new filter value (`""` when `All` is picked). */
|
|
33
|
+
onChange: (value: string) => void;
|
|
34
|
+
/** Sentinel id treated as "no filter" — defaults to `"All"`. */
|
|
35
|
+
allId?: string;
|
|
36
|
+
/** Optional className spread onto the outer wrapper. */
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare function FilterChipGroup({ label, tabs, value, onChange, allId, className, }: FilterChipGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Div } from "./Div";
|
|
4
|
+
import { Text } from "./Typography";
|
|
5
|
+
const ACTIVE_CLS = "bg-[var(--appkit-color-primary)] text-white border-[var(--appkit-color-primary)]";
|
|
6
|
+
const INACTIVE_CLS = "border-zinc-300 dark:border-slate-600 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-slate-800";
|
|
7
|
+
const CHIP_BASE_CLS = "rounded-full px-3 py-1 text-xs font-medium border transition-colors";
|
|
8
|
+
const LABEL_CLS = "text-xs font-semibold uppercase tracking-widest text-zinc-500 dark:text-zinc-400";
|
|
9
|
+
export function FilterChipGroup({ label, tabs, value, onChange, allId = "All", className, }) {
|
|
10
|
+
const current = value || allId;
|
|
11
|
+
return (_jsxs(Div, { className: `space-y-2 ${className ?? ""}`.trim(), children: [_jsx(Text, { as: "p", className: LABEL_CLS, children: label }), _jsx(Div, { className: "flex flex-wrap gap-2", children: tabs.map((tab) => {
|
|
12
|
+
const isActive = current === tab.id;
|
|
13
|
+
return (_jsx("button", { type: "button", "aria-pressed": isActive, onClick: () => onChange(tab.id === allId ? "" : tab.id), className: `${CHIP_BASE_CLS} ${isActive ? ACTIVE_CLS : INACTIVE_CLS}`, children: tab.label }, tab.id));
|
|
14
|
+
}) })] }));
|
|
15
|
+
}
|
|
@@ -24,6 +24,8 @@ function resolvePerView(perView, containerWidth) {
|
|
|
24
24
|
export function HorizontalScroller({ children, className = "", gap = 16, snapToItems, showArrows, arrowSize = "md", showScrollbar, showFadeEdges, scrollContainerRef: externalRef, onScroll, items, renderItem, keyExtractor, perView, rows = 1, autoScroll, autoScrollInterval = 3500, minItemWidth, pauseOnHover = false, itemClassName = "", loop = false, }) {
|
|
25
25
|
const [itemWidth, setItemWidth] = useState(undefined);
|
|
26
26
|
const [isPaused, setIsPaused] = useState(false);
|
|
27
|
+
const [atStart, setAtStart] = useState(true);
|
|
28
|
+
const [atEnd, setAtEnd] = useState(true);
|
|
27
29
|
const internalRef = useRef(null);
|
|
28
30
|
const containerRef = (externalRef ??
|
|
29
31
|
internalRef);
|
|
@@ -96,6 +98,20 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
96
98
|
const width = el.clientWidth;
|
|
97
99
|
el.scrollBy({ left: direction * width * 0.8, behavior: "smooth" });
|
|
98
100
|
}, [containerRef]);
|
|
101
|
+
const updateExtents = useCallback(() => {
|
|
102
|
+
const el = containerRef.current;
|
|
103
|
+
if (!el)
|
|
104
|
+
return;
|
|
105
|
+
// 1px tolerance for sub-pixel rounding
|
|
106
|
+
const maxScroll = el.scrollWidth - el.clientWidth;
|
|
107
|
+
if (maxScroll <= 1) {
|
|
108
|
+
setAtStart(true);
|
|
109
|
+
setAtEnd(true);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
setAtStart(el.scrollLeft <= 1);
|
|
113
|
+
setAtEnd(el.scrollLeft >= maxScroll - 1);
|
|
114
|
+
}, [containerRef]);
|
|
99
115
|
const handleKeyDown = useCallback((e) => {
|
|
100
116
|
if (e.key === "ArrowRight") {
|
|
101
117
|
e.preventDefault();
|
|
@@ -130,10 +146,15 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
130
146
|
if (count > 0) {
|
|
131
147
|
setItemWidth((w - (count - 1) * gap) / count);
|
|
132
148
|
}
|
|
149
|
+
updateExtents();
|
|
133
150
|
});
|
|
134
151
|
observer.observe(el);
|
|
135
152
|
return () => observer.disconnect();
|
|
136
|
-
}, [perView, gap, containerRef]);
|
|
153
|
+
}, [perView, gap, containerRef, updateExtents]);
|
|
154
|
+
// Recompute extents when content size changes (itemWidth resolved, items count changes).
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
updateExtents();
|
|
157
|
+
}, [updateExtents, itemWidth, itemCount]);
|
|
137
158
|
const content = itemsMode ? (rows > 1 ? (
|
|
138
159
|
// Grid mode: group items into slides with rows x cols
|
|
139
160
|
normalizedItems.reduce((slides, item, i) => {
|
|
@@ -203,16 +224,20 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
203
224
|
onMouseLeave: () => setIsPaused(false),
|
|
204
225
|
}
|
|
205
226
|
: {};
|
|
206
|
-
const combinedOnScroll =
|
|
207
|
-
|
|
227
|
+
const combinedOnScroll = () => {
|
|
228
|
+
if (loop)
|
|
208
229
|
handleScrollLoop();
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
230
|
+
if (!loop)
|
|
231
|
+
updateExtents();
|
|
232
|
+
onScroll?.();
|
|
233
|
+
};
|
|
212
234
|
if (showArrows) {
|
|
235
|
+
const prevDisabled = !loop && atStart;
|
|
236
|
+
const nextDisabled = !loop && atEnd;
|
|
237
|
+
const arrowsHidden = !loop && atStart && atEnd; // no scrollable overflow
|
|
213
238
|
return (_jsxs("div", { className: ["appkit-hscroller appkit-hscroller--with-arrows", className]
|
|
214
239
|
.filter(Boolean)
|
|
215
|
-
.join(" "), tabIndex: 0, onKeyDown: handleKeyDown, ...hoverHandlers, "data-section": "horizontalscroller-div-511", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), _jsx("button", { type: "button", onClick: () => scrollBy(-1), "aria-label": "Previous", className: `appkit-hscroller__arrow appkit-hscroller__arrow--prev appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronLeft, { className: "w-4 h-4" }) }), _jsx("div", { ref: containerRef, onScroll: combinedOnScroll, className: scrollerCls(snapToItems, showScrollbar), style: { gap: `${gap}px`, paddingLeft: 36, paddingRight: 36 }, "data-section": "horizontalscroller-div-512", children: content }), _jsx("button", { type: "button", onClick: () => scrollBy(1), "aria-label": "Next", className: `appkit-hscroller__arrow appkit-hscroller__arrow--next appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronRight, { className: "w-4 h-4" }) })] }));
|
|
240
|
+
.join(" "), tabIndex: 0, onKeyDown: handleKeyDown, ...hoverHandlers, "data-section": "horizontalscroller-div-511", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), !arrowsHidden && (_jsx("button", { type: "button", onClick: () => scrollBy(-1), "aria-label": "Previous", "aria-disabled": prevDisabled || undefined, disabled: prevDisabled, className: `appkit-hscroller__arrow appkit-hscroller__arrow--prev appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronLeft, { className: "w-4 h-4" }) })), _jsx("div", { ref: containerRef, onScroll: combinedOnScroll, className: scrollerCls(snapToItems, showScrollbar), style: { gap: `${gap}px`, paddingLeft: 36, paddingRight: 36 }, "data-section": "horizontalscroller-div-512", children: content }), !arrowsHidden && (_jsx("button", { type: "button", onClick: () => scrollBy(1), "aria-label": "Next", "aria-disabled": nextDisabled || undefined, disabled: nextDisabled, className: `appkit-hscroller__arrow appkit-hscroller__arrow--next appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronRight, { className: "w-4 h-4" }) }))] }));
|
|
216
241
|
}
|
|
217
242
|
return (_jsxs("div", { className: ["appkit-hscroller", className].filter(Boolean).join(" "), tabIndex: 0, onKeyDown: handleKeyDown, ...hoverHandlers, "data-section": "horizontalscroller-div-513", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), _jsx("div", { ref: containerRef, onScroll: combinedOnScroll, className: scrollerCls(snapToItems, showScrollbar), style: { gap: `${gap}px` }, "data-section": "horizontalscroller-div-514", children: content })] }));
|
|
218
243
|
}
|
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
.appkit-hscroller__arrow:hover {
|
|
61
61
|
background: var(--appkit-color-surface);
|
|
62
62
|
}
|
|
63
|
+
.appkit-hscroller__arrow:disabled,
|
|
64
|
+
.appkit-hscroller__arrow[aria-disabled="true"] {
|
|
65
|
+
opacity: 0.35;
|
|
66
|
+
cursor: not-allowed;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
}
|
|
63
69
|
|
|
64
70
|
.appkit-hscroller__arrow--prev { left: 0; }
|
|
65
71
|
.appkit-hscroller__arrow--next { right: 0; }
|
|
@@ -14,5 +14,5 @@ export function SiteLogo({ className = "h-7", title = "LetItRip.in", variant = "
|
|
|
14
14
|
_jsx("img", { src: src, alt: title, className: `block w-auto object-contain ${className}` }));
|
|
15
15
|
}
|
|
16
16
|
const fill = variant === "gradient" ? `url(#${GRADIENT_ID})` : "currentColor";
|
|
17
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0
|
|
17
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 226 56", role: "img", "aria-label": title, className: `block w-auto ${className}`, children: [_jsx("title", { children: title }), variant === "gradient" && (_jsx("defs", { children: _jsxs("linearGradient", { id: GRADIENT_ID, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [_jsx("stop", { offset: "0%", style: { stopColor: "var(--appkit-color-primary-700, #1343de)" } }), _jsx("stop", { offset: "55%", style: { stopColor: "var(--appkit-color-cobalt, #3570fc)" } }), _jsx("stop", { offset: "100%", style: { stopColor: "var(--appkit-color-secondary-400, #84e122)" } })] }) })), _jsx("text", { x: "0", y: "44", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "800", fontSize: "44", letterSpacing: "-1.5", fill: fill, children: "LetItRip" }), _jsx("rect", { x: "181", y: "5", width: "43", height: "21", rx: "10.5", fill: fill, opacity: "0.12" }), _jsx("text", { x: "186", y: "21", fontFamily: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif", fontWeight: "700", fontSize: "15", letterSpacing: "0.2", fill: fill, children: ".in" })] }));
|
|
18
18
|
}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { Section, Article, Main, Aside, Nav, BlockHeader, BlockFooter, Header, F
|
|
|
6
6
|
export type { DivProps } from "./components/Div";
|
|
7
7
|
export { Div } from "./components/Div";
|
|
8
8
|
export { Heading, Text, Label, Caption, Span } from "./components/Typography";
|
|
9
|
+
export { FilterChipGroup } from "./components/FilterChipGroup";
|
|
10
|
+
export type { FilterChipGroupProps, FilterChipGroupTab, } from "./components/FilterChipGroup";
|
|
9
11
|
export type { SpinnerProps } from "./components/Spinner";
|
|
10
12
|
export { Spinner } from "./components/Spinner";
|
|
11
13
|
export { PageLoader } from "./components/PageLoader";
|
package/dist/ui/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export { Section, Article, Main, Aside, Nav, BlockHeader, BlockFooter, Header, F
|
|
|
5
5
|
export { Div } from "./components/Div";
|
|
6
6
|
// --- Typography primitives ----------------------------------------------------
|
|
7
7
|
export { Heading, Text, Label, Caption, Span } from "./components/Typography";
|
|
8
|
+
// --- Filter chip group (SB10-C completion, S8 2026-05-13) --------------------
|
|
9
|
+
export { FilterChipGroup } from "./components/FilterChipGroup";
|
|
8
10
|
export { Spinner } from "./components/Spinner";
|
|
9
11
|
export { PageLoader } from "./components/PageLoader";
|
|
10
12
|
export { SiteLogo } from "./components/SiteLogo";
|
|
@@ -249,5 +249,16 @@ export type MediaFilenameContext = ({
|
|
|
249
249
|
type: "payout-doc";
|
|
250
250
|
sellerName: string;
|
|
251
251
|
date?: Date;
|
|
252
|
+
} | {
|
|
253
|
+
type: "shipping-proof";
|
|
254
|
+
orderId: string;
|
|
255
|
+
ext?: string;
|
|
256
|
+
date?: Date;
|
|
257
|
+
} | {
|
|
258
|
+
type: "refund-proof";
|
|
259
|
+
orderId: string;
|
|
260
|
+
refundId: string;
|
|
261
|
+
ext?: string;
|
|
262
|
+
date?: Date;
|
|
252
263
|
};
|
|
253
264
|
export declare function generateMediaFilename(ctx: MediaFilenameContext): string;
|
|
@@ -368,5 +368,21 @@ export function generateMediaFilename(ctx) {
|
|
|
368
368
|
return generateInvoiceFilename(ctx.orderId, ctx.date);
|
|
369
369
|
case "payout-doc":
|
|
370
370
|
return generatePayoutDocFilename(ctx.sellerName, ctx.date);
|
|
371
|
+
case "shipping-proof": {
|
|
372
|
+
const d = ctx.date ?? new Date();
|
|
373
|
+
const y = d.getFullYear();
|
|
374
|
+
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
375
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
376
|
+
const ext = ctx.ext ?? "pdf";
|
|
377
|
+
return `shipping-proof-${ctx.orderId}-${y}${m}${day}.${ext}`;
|
|
378
|
+
}
|
|
379
|
+
case "refund-proof": {
|
|
380
|
+
const d = ctx.date ?? new Date();
|
|
381
|
+
const y = d.getFullYear();
|
|
382
|
+
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
383
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
384
|
+
const ext = ctx.ext ?? "pdf";
|
|
385
|
+
return `refund-proof-${ctx.orderId}-${ctx.refundId}-${y}${m}${day}.${ext}`;
|
|
386
|
+
}
|
|
371
387
|
}
|
|
372
388
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bundles is a consumer-facing label for the `groupedListings` collection.
|
|
3
|
-
* No separate collection exists; all limits/page-sizes flow through the
|
|
4
|
-
* grouped-listings shared config.
|
|
5
|
-
*/
|
|
6
|
-
export { GROUPED_LISTINGS_PAGE_SIZE as BUNDLES_PAGE_SIZE, GROUPED_LISTINGS_FEATURED_LIMIT as BUNDLES_FEATURED_LIMIT, GROUPED_LISTINGS_SITEMAP_LIMIT as BUNDLES_SITEMAP_LIMIT, } from "../grouped/config";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bundles is a consumer-facing label for the `groupedListings` collection.
|
|
3
|
-
* No separate collection exists; all limits/page-sizes flow through the
|
|
4
|
-
* grouped-listings shared config.
|
|
5
|
-
*/
|
|
6
|
-
export { GROUPED_LISTINGS_PAGE_SIZE as BUNDLES_PAGE_SIZE, GROUPED_LISTINGS_FEATURED_LIMIT as BUNDLES_FEATURED_LIMIT, GROUPED_LISTINGS_SITEMAP_LIMIT as BUNDLES_SITEMAP_LIMIT, } from "../grouped/config";
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Firestore document schema versions — SB-UNI X3.
|
|
3
|
-
*
|
|
4
|
-
* Every persisted document type carries an optional `schemaVersion?: number`
|
|
5
|
-
* field. When absent, repositories default to v1. When out-of-date, the
|
|
6
|
-
* repository's per-feature `migrations.ts` runs the in-flight migration
|
|
7
|
-
* before returning the doc.
|
|
8
|
-
*
|
|
9
|
-
* This is Pattern 4 from the SB-UNI plan — a one-time tax that prevents
|
|
10
|
-
* future migration pain by giving every document a version handle.
|
|
11
|
-
*
|
|
12
|
-
* Adding a migration:
|
|
13
|
-
* 1. Bump the entry below (e.g. `product: 2`)
|
|
14
|
-
* 2. Add a `migrations.ts` row keyed `1: (doc) => migrateProductV1ToV2(doc)`
|
|
15
|
-
* 3. Repository handles the rest via `migrateDocument()`.
|
|
16
|
-
*/
|
|
17
|
-
export declare const SCHEMA_VERSIONS: {
|
|
18
|
-
readonly address: 1;
|
|
19
|
-
readonly bid: 1;
|
|
20
|
-
readonly blogPost: 1;
|
|
21
|
-
readonly brand: 1;
|
|
22
|
-
readonly bundle: 1;
|
|
23
|
-
readonly carouselSlide: 1;
|
|
24
|
-
readonly cart: 1;
|
|
25
|
-
readonly cartItem: 1;
|
|
26
|
-
readonly category: 1;
|
|
27
|
-
readonly chatRoom: 1;
|
|
28
|
-
readonly contactSubmission: 1;
|
|
29
|
-
readonly conversation: 1;
|
|
30
|
-
readonly copilotLog: 1;
|
|
31
|
-
readonly coupon: 1;
|
|
32
|
-
readonly couponUsage: 1;
|
|
33
|
-
readonly emailVerificationToken: 1;
|
|
34
|
-
readonly event: 1;
|
|
35
|
-
readonly eventEntry: 1;
|
|
36
|
-
readonly faq: 1;
|
|
37
|
-
readonly groupedListing: 1;
|
|
38
|
-
readonly history: 1;
|
|
39
|
-
readonly newsletterSubscriber: 1;
|
|
40
|
-
readonly notification: 1;
|
|
41
|
-
readonly offer: 1;
|
|
42
|
-
readonly order: 1;
|
|
43
|
-
readonly passwordResetToken: 1;
|
|
44
|
-
readonly payout: 1;
|
|
45
|
-
readonly product: 1;
|
|
46
|
-
readonly productFeature: 1;
|
|
47
|
-
readonly productTemplate: 1;
|
|
48
|
-
readonly review: 1;
|
|
49
|
-
readonly scammer: 1;
|
|
50
|
-
readonly scammerComment: 1;
|
|
51
|
-
readonly scammerContest: 1;
|
|
52
|
-
readonly scammerIncident: 1;
|
|
53
|
-
readonly session: 1;
|
|
54
|
-
readonly siteSettings: 1;
|
|
55
|
-
readonly smsCounter: 1;
|
|
56
|
-
readonly store: 1;
|
|
57
|
-
readonly storeAddress: 1;
|
|
58
|
-
readonly sublistingCategory: 1;
|
|
59
|
-
readonly supportTicket: 1;
|
|
60
|
-
readonly user: 1;
|
|
61
|
-
readonly wishlist: 1;
|
|
62
|
-
};
|
|
63
|
-
export type SchemaCollection = keyof typeof SCHEMA_VERSIONS;
|
|
64
|
-
export interface SchemaVersioned {
|
|
65
|
-
schemaVersion?: number;
|
|
66
|
-
}
|
|
67
|
-
export type MigrationStep<T> = (doc: T) => T;
|
|
68
|
-
/**
|
|
69
|
-
* Migrate a document from its persisted `schemaVersion` to the current
|
|
70
|
-
* collection version. Passes through unchanged when the doc is already
|
|
71
|
-
* current, missing version (treated as v1), or no migrations are defined.
|
|
72
|
-
*
|
|
73
|
-
* Migrations is a map keyed by the FROM-version (e.g. `1: (doc) => v2(doc)`
|
|
74
|
-
* upgrades a v1 doc to v2). Multi-step migrations chain automatically.
|
|
75
|
-
*/
|
|
76
|
-
export declare function migrateDocument<T extends SchemaVersioned>(doc: T, current: number, migrations: Record<number, MigrationStep<T>>): T;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Firestore document schema versions — SB-UNI X3.
|
|
3
|
-
*
|
|
4
|
-
* Every persisted document type carries an optional `schemaVersion?: number`
|
|
5
|
-
* field. When absent, repositories default to v1. When out-of-date, the
|
|
6
|
-
* repository's per-feature `migrations.ts` runs the in-flight migration
|
|
7
|
-
* before returning the doc.
|
|
8
|
-
*
|
|
9
|
-
* This is Pattern 4 from the SB-UNI plan — a one-time tax that prevents
|
|
10
|
-
* future migration pain by giving every document a version handle.
|
|
11
|
-
*
|
|
12
|
-
* Adding a migration:
|
|
13
|
-
* 1. Bump the entry below (e.g. `product: 2`)
|
|
14
|
-
* 2. Add a `migrations.ts` row keyed `1: (doc) => migrateProductV1ToV2(doc)`
|
|
15
|
-
* 3. Repository handles the rest via `migrateDocument()`.
|
|
16
|
-
*/
|
|
17
|
-
export const SCHEMA_VERSIONS = {
|
|
18
|
-
address: 1,
|
|
19
|
-
bid: 1,
|
|
20
|
-
blogPost: 1,
|
|
21
|
-
brand: 1,
|
|
22
|
-
bundle: 1,
|
|
23
|
-
carouselSlide: 1,
|
|
24
|
-
cart: 1,
|
|
25
|
-
cartItem: 1,
|
|
26
|
-
category: 1,
|
|
27
|
-
chatRoom: 1,
|
|
28
|
-
contactSubmission: 1,
|
|
29
|
-
conversation: 1,
|
|
30
|
-
copilotLog: 1,
|
|
31
|
-
coupon: 1,
|
|
32
|
-
couponUsage: 1,
|
|
33
|
-
emailVerificationToken: 1,
|
|
34
|
-
event: 1,
|
|
35
|
-
eventEntry: 1,
|
|
36
|
-
faq: 1,
|
|
37
|
-
groupedListing: 1,
|
|
38
|
-
history: 1,
|
|
39
|
-
newsletterSubscriber: 1,
|
|
40
|
-
notification: 1,
|
|
41
|
-
offer: 1,
|
|
42
|
-
order: 1,
|
|
43
|
-
passwordResetToken: 1,
|
|
44
|
-
payout: 1,
|
|
45
|
-
product: 1,
|
|
46
|
-
productFeature: 1,
|
|
47
|
-
productTemplate: 1,
|
|
48
|
-
review: 1,
|
|
49
|
-
scammer: 1,
|
|
50
|
-
scammerComment: 1,
|
|
51
|
-
scammerContest: 1,
|
|
52
|
-
scammerIncident: 1,
|
|
53
|
-
session: 1,
|
|
54
|
-
siteSettings: 1,
|
|
55
|
-
smsCounter: 1,
|
|
56
|
-
store: 1,
|
|
57
|
-
storeAddress: 1,
|
|
58
|
-
sublistingCategory: 1,
|
|
59
|
-
supportTicket: 1,
|
|
60
|
-
user: 1,
|
|
61
|
-
wishlist: 1,
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Migrate a document from its persisted `schemaVersion` to the current
|
|
65
|
-
* collection version. Passes through unchanged when the doc is already
|
|
66
|
-
* current, missing version (treated as v1), or no migrations are defined.
|
|
67
|
-
*
|
|
68
|
-
* Migrations is a map keyed by the FROM-version (e.g. `1: (doc) => v2(doc)`
|
|
69
|
-
* upgrades a v1 doc to v2). Multi-step migrations chain automatically.
|
|
70
|
-
*/
|
|
71
|
-
export function migrateDocument(doc, current, migrations) {
|
|
72
|
-
let working = doc;
|
|
73
|
-
let version = doc.schemaVersion ?? 1;
|
|
74
|
-
while (version < current) {
|
|
75
|
-
const step = migrations[version];
|
|
76
|
-
if (!step)
|
|
77
|
-
break;
|
|
78
|
-
working = step(working);
|
|
79
|
-
version += 1;
|
|
80
|
-
}
|
|
81
|
-
return { ...working, schemaVersion: current };
|
|
82
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// SB-UNI X3 — migrations shell for address.
|
|
2
|
-
// v1 schema is current; no migrations needed yet.
|
|
3
|
-
//
|
|
4
|
-
// To add a migration:
|
|
5
|
-
// 1. Bump the relevant SCHEMA_VERSIONS entry in
|
|
6
|
-
// `_internal/shared/schema-versions.ts` (e.g. `account: 2`)
|
|
7
|
-
// 2. Add a row below keyed by the FROM-version, returning the upgraded doc
|
|
8
|
-
// 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const migrations = {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// SB-UNI X3 — migrations shell for notification/chatRoom/siteSettings.
|
|
2
|
-
// v1 schema is current; no migrations needed yet.
|
|
3
|
-
//
|
|
4
|
-
// To add a migration:
|
|
5
|
-
// 1. Bump the relevant SCHEMA_VERSIONS entry in
|
|
6
|
-
// `_internal/shared/schema-versions.ts` (e.g. `admin: 2`)
|
|
7
|
-
// 2. Add a row below keyed by the FROM-version, returning the upgraded doc
|
|
8
|
-
// 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const migrations = {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// SB-UNI X3 — migrations shell for bid.
|
|
2
|
-
// v1 schema is current; no migrations needed yet.
|
|
3
|
-
//
|
|
4
|
-
// To add a migration:
|
|
5
|
-
// 1. Bump the relevant SCHEMA_VERSIONS entry in
|
|
6
|
-
// `_internal/shared/schema-versions.ts` (e.g. `auctions: 2`)
|
|
7
|
-
// 2. Add a row below keyed by the FROM-version, returning the upgraded doc
|
|
8
|
-
// 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const migrations = {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// SB-UNI X3 — migrations shell for user/session/token.
|
|
2
|
-
// v1 schema is current; no migrations needed yet.
|
|
3
|
-
//
|
|
4
|
-
// To add a migration:
|
|
5
|
-
// 1. Bump the relevant SCHEMA_VERSIONS entry in
|
|
6
|
-
// `_internal/shared/schema-versions.ts` (e.g. `auth: 2`)
|
|
7
|
-
// 2. Add a row below keyed by the FROM-version, returning the upgraded doc
|
|
8
|
-
// 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const migrations = {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// SB-UNI X3 — migrations shell for blogPost.
|
|
2
|
-
// v1 schema is current; no migrations needed yet.
|
|
3
|
-
//
|
|
4
|
-
// To add a migration:
|
|
5
|
-
// 1. Bump the relevant SCHEMA_VERSIONS entry in
|
|
6
|
-
// `_internal/shared/schema-versions.ts` (e.g. `blog: 2`)
|
|
7
|
-
// 2. Add a row below keyed by the FROM-version, returning the upgraded doc
|
|
8
|
-
// 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const migrations = {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// SB-UNI X3 — migrations shell for brand.
|
|
2
|
-
// v1 schema is current; no migrations needed yet.
|
|
3
|
-
//
|
|
4
|
-
// To add a migration:
|
|
5
|
-
// 1. Bump the relevant SCHEMA_VERSIONS entry in
|
|
6
|
-
// `_internal/shared/schema-versions.ts` (e.g. `brands: 2`)
|
|
7
|
-
// 2. Add a row below keyed by the FROM-version, returning the upgraded doc
|
|
8
|
-
// 3. Repository wraps reads with `migrateDocument(doc, current, migrations)`
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
export const migrations = {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BaseRepository, type FirebaseSieveFields, type FirebaseSieveResult, type SieveModel } from "../../../providers/db-firebase";
|
|
2
|
-
import { type BrandDocument, type BrandCreateInput, type BrandUpdateInput } from "../schemas";
|
|
3
|
-
export declare class BrandsRepository extends BaseRepository<BrandDocument> {
|
|
4
|
-
constructor();
|
|
5
|
-
static readonly SIEVE_FIELDS: FirebaseSieveFields;
|
|
6
|
-
list(model: SieveModel): Promise<FirebaseSieveResult<BrandDocument>>;
|
|
7
|
-
findBySlug(slug: string): Promise<BrandDocument | null>;
|
|
8
|
-
findActive(): Promise<BrandDocument[]>;
|
|
9
|
-
create(input: BrandCreateInput): Promise<BrandDocument>;
|
|
10
|
-
update(id: string, input: BrandUpdateInput): Promise<BrandDocument>;
|
|
11
|
-
delete(id: string): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export declare const brandsRepository: BrandsRepository;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { BaseRepository, prepareForFirestore, } from "../../../providers/db-firebase";
|
|
2
|
-
import { BRANDS_COLLECTION, BRAND_FIELDS, } from "../schemas";
|
|
3
|
-
import { serverLogger } from "../../../monitoring";
|
|
4
|
-
export class BrandsRepository extends BaseRepository {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(BRANDS_COLLECTION);
|
|
7
|
-
}
|
|
8
|
-
async list(model) {
|
|
9
|
-
return this.sieveQuery(model, BrandsRepository.SIEVE_FIELDS);
|
|
10
|
-
}
|
|
11
|
-
async findBySlug(slug) {
|
|
12
|
-
const snap = await this.getCollection()
|
|
13
|
-
.where(BRAND_FIELDS.SLUG, "==", slug)
|
|
14
|
-
.limit(1)
|
|
15
|
-
.get();
|
|
16
|
-
if (snap.empty)
|
|
17
|
-
return null;
|
|
18
|
-
return this.mapDoc(snap.docs[0]);
|
|
19
|
-
}
|
|
20
|
-
async findActive() {
|
|
21
|
-
const snap = await this.getCollection()
|
|
22
|
-
.where(BRAND_FIELDS.IS_ACTIVE, "==", true)
|
|
23
|
-
.orderBy(BRAND_FIELDS.DISPLAY_ORDER)
|
|
24
|
-
.get();
|
|
25
|
-
return snap.docs.map((d) => this.mapDoc(d));
|
|
26
|
-
}
|
|
27
|
-
async create(input) {
|
|
28
|
-
const now = new Date();
|
|
29
|
-
const ref = this.getCollection().doc(input.slug);
|
|
30
|
-
const data = prepareForFirestore({
|
|
31
|
-
...input,
|
|
32
|
-
id: ref.id,
|
|
33
|
-
createdAt: now,
|
|
34
|
-
updatedAt: now,
|
|
35
|
-
});
|
|
36
|
-
await ref.set(data);
|
|
37
|
-
serverLogger.info("Brand created", { id: ref.id, name: input.name });
|
|
38
|
-
return { ...data, id: ref.id };
|
|
39
|
-
}
|
|
40
|
-
async update(id, input) {
|
|
41
|
-
const data = prepareForFirestore({ ...input, updatedAt: new Date() });
|
|
42
|
-
await this.getCollection().doc(id).update(data);
|
|
43
|
-
const updated = await this.findById(id);
|
|
44
|
-
if (!updated)
|
|
45
|
-
throw new Error(`Brand ${id} not found after update`);
|
|
46
|
-
return updated;
|
|
47
|
-
}
|
|
48
|
-
async delete(id) {
|
|
49
|
-
await this.getCollection().doc(id).delete();
|
|
50
|
-
serverLogger.info("Brand deleted", { id });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
BrandsRepository.SIEVE_FIELDS = {
|
|
54
|
-
name: { canFilter: true, canSort: true },
|
|
55
|
-
slug: { canFilter: true, canSort: false },
|
|
56
|
-
isActive: { canFilter: true, canSort: false },
|
|
57
|
-
displayOrder: { canFilter: false, canSort: true },
|
|
58
|
-
createdAt: { canFilter: true, canSort: true },
|
|
59
|
-
};
|
|
60
|
-
export const brandsRepository = new BrandsRepository();
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const BRANDS_COLLECTION: "brands";
|
|
2
|
-
export interface BrandDocument {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
slug: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
logoURL?: string;
|
|
8
|
-
bannerURL?: string;
|
|
9
|
-
website?: string;
|
|
10
|
-
country?: string;
|
|
11
|
-
founded?: number;
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
displayOrder?: number;
|
|
14
|
-
productCount?: number;
|
|
15
|
-
createdAt: Date;
|
|
16
|
-
updatedAt: Date;
|
|
17
|
-
}
|
|
18
|
-
export type BrandCreateInput = Omit<BrandDocument, "id" | "createdAt" | "updatedAt" | "productCount">;
|
|
19
|
-
export type BrandUpdateInput = Partial<BrandCreateInput>;
|
|
20
|
-
export declare const BRAND_FIELDS: {
|
|
21
|
-
readonly ID: "id";
|
|
22
|
-
readonly NAME: "name";
|
|
23
|
-
readonly SLUG: "slug";
|
|
24
|
-
readonly DESCRIPTION: "description";
|
|
25
|
-
readonly LOGO_URL: "logoURL";
|
|
26
|
-
readonly BANNER_URL: "bannerURL";
|
|
27
|
-
readonly WEBSITE: "website";
|
|
28
|
-
readonly IS_ACTIVE: "isActive";
|
|
29
|
-
readonly DISPLAY_ORDER: "displayOrder";
|
|
30
|
-
readonly PRODUCT_COUNT: "productCount";
|
|
31
|
-
readonly CREATED_AT: "createdAt";
|
|
32
|
-
readonly UPDATED_AT: "updatedAt";
|
|
33
|
-
};
|