@mohasinac/appkit 3.2.19 → 3.3.0
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/checkout/actions.d.ts +2 -0
- package/dist/_internal/server/features/checkout/actions.js +239 -190
- package/dist/_internal/server/functions/scheduled.d.ts +2 -1
- package/dist/_internal/server/functions/scheduled.js +9 -1
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +8 -11
- package/dist/_internal/server/jobs/core/emiInstallmentReminder.d.ts +8 -0
- package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +78 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.d.ts +2 -2
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +15 -10
- package/dist/_internal/server/jobs/handlers/emiInstallmentReminder.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/emiInstallmentReminder.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
- package/dist/_internal/server/jobs/handlers/index.js +2 -0
- package/dist/_internal/server/providers/index.d.ts +4 -4
- package/dist/_internal/server/providers/index.js +4 -4
- package/dist/_internal/server/providers/payment/razorpay-mock.d.ts +3 -2
- package/dist/_internal/server/providers/payment/razorpay-mock.js +3 -1
- package/dist/_internal/server/providers/resolve.d.ts +10 -13
- package/dist/_internal/server/providers/resolve.js +9 -15
- package/dist/_internal/shared/actions/action-registry.js +28 -0
- package/dist/_internal/shared/checkout/rules/_defaults.js +1 -0
- package/dist/_internal/shared/checkout/rules/_registry.js +4 -0
- package/dist/_internal/shared/checkout/rules/art.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/art.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/auction.rule.js +1 -0
- package/dist/_internal/shared/checkout/rules/classified.rule.js +1 -0
- package/dist/_internal/shared/checkout/rules/index.d.ts +2 -0
- package/dist/_internal/shared/checkout/rules/index.js +2 -0
- package/dist/_internal/shared/checkout/rules/stickers.rule.d.ts +9 -0
- package/dist/_internal/shared/checkout/rules/stickers.rule.js +5 -0
- package/dist/_internal/shared/checkout/rules/types.d.ts +6 -0
- package/dist/_internal/shared/features/checkout/config.d.ts +16 -1
- package/dist/_internal/shared/features/checkout/config.js +16 -1
- package/dist/_internal/shared/features/emi/schedule.d.ts +63 -0
- package/dist/_internal/shared/features/emi/schedule.js +62 -0
- package/dist/_internal/shared/fees/calculator.d.ts +53 -0
- package/dist/_internal/shared/fees/calculator.js +40 -0
- package/dist/_internal/shared/listing-types/_registry.d.ts +22 -66
- package/dist/_internal/shared/listing-types/_registry.js +19 -2
- package/dist/_internal/shared/listing-types/art/config.d.ts +15 -0
- package/dist/_internal/shared/listing-types/art/config.js +14 -0
- package/dist/_internal/shared/listing-types/art/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/art/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/og.js +1 -0
- package/dist/_internal/shared/listing-types/art/schema.d.ts +2 -0
- package/dist/_internal/shared/listing-types/art/schema.js +3 -0
- package/dist/_internal/shared/listing-types/art/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/art/seed-factory.js +1 -0
- package/dist/_internal/shared/listing-types/auction/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/auction/config.js +6 -0
- package/dist/_internal/shared/listing-types/capabilities.js +17 -0
- package/dist/_internal/shared/listing-types/classified/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/classified/config.js +6 -0
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/digital-code/config.js +6 -0
- package/dist/_internal/shared/listing-types/live/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/live/config.js +6 -0
- package/dist/_internal/shared/listing-types/pre-order/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/pre-order/config.js +6 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/prize-draw/config.js +6 -0
- package/dist/_internal/shared/listing-types/standard/config.d.ts +8 -0
- package/dist/_internal/shared/listing-types/standard/config.js +6 -0
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +15 -0
- package/dist/_internal/shared/listing-types/stickers/config.js +14 -0
- package/dist/_internal/shared/listing-types/stickers/ctas.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/ctas.js +3 -0
- package/dist/_internal/shared/listing-types/stickers/og.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/og.js +1 -0
- package/dist/_internal/shared/listing-types/stickers/schema.d.ts +2 -0
- package/dist/_internal/shared/listing-types/stickers/schema.js +3 -0
- package/dist/_internal/shared/listing-types/stickers/seed-factory.d.ts +1 -0
- package/dist/_internal/shared/listing-types/stickers/seed-factory.js +1 -0
- package/dist/client.d.ts +7 -2
- package/dist/client.js +4 -2
- package/dist/constants/field-names.d.ts +2 -6
- package/dist/constants/field-names.js +2 -6
- package/dist/contracts/index.d.ts +4 -2
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/payment.d.ts +14 -9
- package/dist/contracts/payment.js +11 -1
- package/dist/contracts/shipping.d.ts +14 -9
- package/dist/contracts/shipping.js +11 -1
- package/dist/features/about/components/PublicProfileView.js +3 -6
- package/dist/features/account/components/UserOffersPanel.js +0 -1
- package/dist/features/admin/components/AdminAddressBookView.d.ts +11 -0
- package/dist/features/admin/components/AdminAddressBookView.js +30 -0
- package/dist/features/admin/components/AdminArtView.d.ts +3 -0
- package/dist/features/admin/components/AdminArtView.js +45 -0
- package/dist/features/admin/components/AdminCarouselEditorView.js +2 -3
- package/dist/features/admin/components/AdminFulfillmentView.js +0 -1
- package/dist/features/admin/components/AdminSiteConfigGuideView.js +1 -1
- package/dist/features/admin/components/AdminSiteSettingsView.js +14 -9
- package/dist/features/admin/components/AdminStickersView.d.ts +3 -0
- package/dist/features/admin/components/AdminStickersView.js +45 -0
- package/dist/features/admin/components/index.d.ts +6 -0
- package/dist/features/admin/components/index.js +4 -0
- package/dist/features/admin/hooks/useChat.js +0 -1
- package/dist/features/admin/schemas/firestore.d.ts +19 -11
- package/dist/features/admin/schemas/firestore.js +12 -2
- package/dist/features/auctions/components/MarketplaceAuctionCard.d.ts +3 -2
- package/dist/features/auth/hooks/useAuth.js +35 -10
- package/dist/features/auth/schemas/firestore.d.ts +2 -6
- package/dist/features/cart/schemas/firestore.d.ts +3 -2
- package/dist/features/consultation/schemas/index.d.ts +2 -2
- package/dist/features/history/hooks/useHistory.js +0 -1
- package/dist/features/loyalty/schemas/index.d.ts +6 -6
- package/dist/features/messages/hooks/useConversation.js +0 -1
- package/dist/features/messages/hooks/useConversations.js +0 -1
- package/dist/features/orders/repository/orders.repository.d.ts +20 -2
- package/dist/features/orders/repository/orders.repository.js +34 -5
- package/dist/features/orders/schemas/firestore.d.ts +33 -7
- package/dist/features/orders/schemas/firestore.js +1 -1
- package/dist/features/orders/schemas/index.d.ts +176 -31
- package/dist/features/orders/schemas/index.js +20 -6
- package/dist/features/orders/types/index.d.ts +3 -3
- package/dist/features/payments/repository/payout.repository.js +2 -2
- package/dist/features/payments/schemas/firestore.d.ts +3 -3
- package/dist/features/payments/schemas/firestore.js +2 -2
- package/dist/features/payments/schemas/index.d.ts +5 -5
- package/dist/features/payments/schemas/index.js +2 -2
- package/dist/features/products/api/[id]/route.js +4 -1
- package/dist/features/products/api/route.js +4 -1
- package/dist/features/products/components/CompareOverlay.js +7 -9
- package/dist/features/products/components/ProductDetailPageView.d.ts +3 -1
- package/dist/features/products/components/ProductDetailPageView.js +2 -2
- package/dist/features/products/components/ProductForm.js +18 -7
- package/dist/features/products/components/ProductGrid.js +7 -12
- package/dist/features/products/components/ShowGroupSection.js +3 -5
- package/dist/features/products/components/SublistingCarouselSection.js +3 -6
- package/dist/features/products/constants/listing-tabs.d.ts +32 -0
- package/dist/features/products/constants/listing-tabs.js +8 -0
- package/dist/features/products/index.d.ts +1 -1
- package/dist/features/products/index.js +3 -1
- package/dist/features/products/schemas/firestore.d.ts +20 -1
- package/dist/features/products/schemas/firestore.js +2 -0
- package/dist/features/products/schemas/index.d.ts +48 -0
- package/dist/features/products/schemas/index.js +9 -0
- package/dist/features/products/schemas/product-features.d.ts +1 -1
- package/dist/features/products/types/index.d.ts +5 -3
- package/dist/features/products/utils/listing-type.d.ts +6 -0
- package/dist/features/products/utils/listing-type.js +3 -0
- package/dist/features/reviews/api/[id]/route.js +5 -4
- package/dist/features/seller/actions/seller-actions.d.ts +29 -14
- package/dist/features/seller/actions/seller-actions.js +101 -27
- package/dist/features/seller/components/FulfillmentView.js +0 -1
- package/dist/features/seller/components/SellerAddressesView.js +0 -1
- package/dist/features/seller/components/SellerArtView.d.ts +7 -0
- package/dist/features/seller/components/SellerArtView.js +114 -0
- package/dist/features/seller/components/SellerOffersPanel.js +0 -1
- package/dist/features/seller/components/SellerOrdersView.js +38 -1
- package/dist/features/seller/components/SellerProductShell.d.ts +5 -1
- package/dist/features/seller/components/SellerProductShell.js +69 -59
- package/dist/features/seller/components/SellerReviewsView.js +0 -1
- package/dist/features/seller/components/SellerShippingView.js +6 -25
- package/dist/features/seller/components/SellerStickersView.d.ts +7 -0
- package/dist/features/seller/components/SellerStickersView.js +114 -0
- package/dist/features/seller/components/index.d.ts +4 -0
- package/dist/features/seller/components/index.js +2 -0
- package/dist/features/seller/messages/en.json +1 -1
- package/dist/features/seller/schemas/index.d.ts +7 -7
- package/dist/features/seller/schemas/index.js +1 -1
- package/dist/features/seller/types/index.d.ts +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +18 -2
- package/dist/features/stores/schemas/firestore.d.ts +7 -1
- package/dist/features/stores/schemas/index.d.ts +19 -16
- package/dist/features/stores/schemas/index.js +1 -1
- package/dist/index.d.ts +21 -36
- package/dist/index.js +27 -39
- package/dist/next/routing/route-map.d.ts +22 -0
- package/dist/next/routing/route-map.js +10 -0
- package/dist/providers/payment-manual/index.d.ts +40 -0
- package/dist/providers/payment-manual/index.js +91 -0
- package/dist/providers/payment-razorpay/index.d.ts +4 -2
- package/dist/providers/payment-razorpay/index.js +4 -1
- package/dist/providers/shipping-manual/index.d.ts +22 -0
- package/dist/providers/shipping-manual/index.js +47 -0
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +5 -3
- package/dist/schemas/registry.d.ts +129 -70
- package/dist/schemas/registry.js +0 -4
- package/dist/security/pii-encrypt.js +0 -7
- package/dist/security/pii-redact.js +0 -1
- package/dist/seed/conversations-seed-data.js +2 -2
- package/dist/seed/faq-seed-data.js +7 -7
- package/dist/seed/grouped-listings-seed-data.d.ts +2 -0
- package/dist/seed/index.d.ts +2 -0
- package/dist/seed/index.js +2 -0
- package/dist/seed/manifest.js +20 -16
- package/dist/seed/payouts-seed-data.js +5 -5
- package/dist/seed/products-art-seed-data.d.ts +11 -0
- package/dist/seed/products-art-seed-data.js +125 -0
- package/dist/seed/products-preorders-seed-data.d.ts +2 -0
- package/dist/seed/products-stickers-seed-data.d.ts +11 -0
- package/dist/seed/products-stickers-seed-data.js +125 -0
- package/dist/seed/site-settings-seed-data.js +13 -4
- package/dist/seed/stores-seed-data.js +11 -11
- package/dist/server.d.ts +7 -15
- package/dist/server.js +17 -42
- package/dist/ui/rich-text/RichText.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/client.d.ts
CHANGED
|
@@ -269,7 +269,7 @@ export { useHistory, useHistoryMergeOnLogin, getGuestHistory, trackGuestHistory,
|
|
|
269
269
|
export type { GuestHistoryItem, GuestHistoryType, UserHistoryItem, HistoryProductType, HistoryItemSnapshot, } from "./features/history/index";
|
|
270
270
|
export type { TrackArgs as TrackHistoryArgs } from "./features/history/hooks/useHistory";
|
|
271
271
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
|
|
272
|
-
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, } from "./features/products/utils/listing-type";
|
|
272
|
+
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, isArtListing, isStickersListing, } from "./features/products/utils/listing-type";
|
|
273
273
|
export { isListingTypeEnabled, isCategoryTypeEnabled, enabledListingTypes, enabledCategoryTypes, } from "./_internal/shared/listing-types/feature-flags";
|
|
274
274
|
export { actionTracker, setActionTrackerSink, resetActionTrackerSink, type ActionEvent, type ActionTrackerSink, } from "./_internal/shared/listing-types/action-tracker";
|
|
275
275
|
export { cartRequiresShipping, cartIsDigitalOnly, cartIsChatOnly, } from "./_internal/shared/listing-types/cart-shipping";
|
|
@@ -281,8 +281,9 @@ export type { DashboardLayoutClientProps, RoleGuardProps, } from "./_internal/cl
|
|
|
281
281
|
export type { LayoutBreakpoint, DashboardVariant, LayoutRole, SidebarNavItem, SidebarNavGroup, MainNavItem as LayoutMainNavItem, BrandingConfig, FooterConfig, SectionResponsive, SectionTheming, LayoutConfig, DashboardLayoutConfig, } from "./_internal/shared/features/layout/index";
|
|
282
282
|
export { LISTING_TYPE_CAPABILITIES, capabilityFor, canAddToCart, canBid, supportsShipping, requiresVendorVerified, requiresJurisdictionCheck, hasInstantFulfillment, assertNever, } from "./_internal/shared/listing-types/capabilities";
|
|
283
283
|
export type { ListingTypeCapability } from "./_internal/shared/listing-types/capabilities";
|
|
284
|
-
export { LISTING_TYPE_REGISTRY, pluginFor } from "./_internal/shared/listing-types/_registry";
|
|
284
|
+
export { LISTING_TYPE_REGISTRY, pluginFor, detectListingTypeFromSlug } from "./_internal/shared/listing-types/_registry";
|
|
285
285
|
export type { ListingTypePlugin } from "./_internal/shared/listing-types/_registry";
|
|
286
|
+
export type { ListingType } from "./features/products/types/index";
|
|
286
287
|
export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, } from "./_internal/shared/media/limits";
|
|
287
288
|
export type { MediaKind, AllowedImageMime, AllowedVideoMime, AllowedDocMime, AllowedMime, } from "./_internal/shared/media/limits";
|
|
288
289
|
export { ScamAwarenessModal } from "./features/scams/components/ScamAwarenessModal";
|
|
@@ -317,6 +318,10 @@ export { SellerBundlesView } from "./features/seller/components/SellerBundlesVie
|
|
|
317
318
|
export type { SellerBundlesViewProps } from "./features/seller/components/SellerBundlesView";
|
|
318
319
|
export { SellerClassifiedView } from "./features/seller/components/SellerClassifiedView";
|
|
319
320
|
export type { SellerClassifiedViewProps } from "./features/seller/components/SellerClassifiedView";
|
|
321
|
+
export { SellerArtView } from "./features/seller/components/SellerArtView";
|
|
322
|
+
export type { SellerArtViewProps } from "./features/seller/components/SellerArtView";
|
|
323
|
+
export { SellerStickersView } from "./features/seller/components/SellerStickersView";
|
|
324
|
+
export type { SellerStickersViewProps } from "./features/seller/components/SellerStickersView";
|
|
320
325
|
export { SellerDigitalCodesView } from "./features/seller/components/SellerDigitalCodesView";
|
|
321
326
|
export type { SellerDigitalCodesViewProps } from "./features/seller/components/SellerDigitalCodesView";
|
|
322
327
|
export { SellerLiveView } from "./features/seller/components/SellerLiveView";
|
package/dist/client.js
CHANGED
|
@@ -274,7 +274,7 @@ export { useHistory, useHistoryMergeOnLogin, getGuestHistory, trackGuestHistory,
|
|
|
274
274
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, } from "./constants/limits";
|
|
275
275
|
// SB1-G canonical listing-type accessors (pure functions, client-safe).
|
|
276
276
|
// SB-UNI-F 2026-05-13 — Phase 2 predicates surfaced through client barrel.
|
|
277
|
-
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, } from "./features/products/utils/listing-type";
|
|
277
|
+
export { normalizeListingType, isAuctionListing, isPreOrderListing, isStandardListing, isPrizeDrawListing, isClassifiedListing, isDigitalCodeListing, isLiveListing, isArtListing, isStickersListing, } from "./features/products/utils/listing-type";
|
|
278
278
|
// SB-UNI-X4 2026-05-13 — per-type feature-flag helpers (client-safe).
|
|
279
279
|
export { isListingTypeEnabled, isCategoryTypeEnabled, enabledListingTypes, enabledCategoryTypes, } from "./_internal/shared/listing-types/feature-flags";
|
|
280
280
|
// SB-UNI-X5 2026-05-13 — action telemetry sink (client-safe; defaults to
|
|
@@ -292,7 +292,7 @@ export { isAdminUser, isSellerUser, isModeratorUser, isEmployeeUser, isBuyerUser
|
|
|
292
292
|
export { DashboardLayoutClient, RoleGuard } from "./_internal/client/features/layout/index";
|
|
293
293
|
// Listing-type capability registry — SB-UNI X1.
|
|
294
294
|
export { LISTING_TYPE_CAPABILITIES, capabilityFor, canAddToCart, canBid, supportsShipping, requiresVendorVerified, requiresJurisdictionCheck, hasInstantFulfillment, assertNever, } from "./_internal/shared/listing-types/capabilities";
|
|
295
|
-
export { LISTING_TYPE_REGISTRY, pluginFor } from "./_internal/shared/listing-types/_registry";
|
|
295
|
+
export { LISTING_TYPE_REGISTRY, pluginFor, detectListingTypeFromSlug } from "./_internal/shared/listing-types/_registry";
|
|
296
296
|
// Media upload limits — shared by client uploaders + server sign/finalize routes.
|
|
297
297
|
export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, } from "./_internal/shared/media/limits";
|
|
298
298
|
export { ScamAwarenessModal } from "./features/scams/components/ScamAwarenessModal";
|
|
@@ -315,6 +315,8 @@ export { SellerShippingConfigsView } from "./features/seller/components/SellerSh
|
|
|
315
315
|
export { SellerGoogleReviewsView } from "./features/seller/components/SellerGoogleReviewsView";
|
|
316
316
|
export { SellerBundlesView } from "./features/seller/components/SellerBundlesView";
|
|
317
317
|
export { SellerClassifiedView } from "./features/seller/components/SellerClassifiedView";
|
|
318
|
+
export { SellerArtView } from "./features/seller/components/SellerArtView";
|
|
319
|
+
export { SellerStickersView } from "./features/seller/components/SellerStickersView";
|
|
318
320
|
export { SellerDigitalCodesView } from "./features/seller/components/SellerDigitalCodesView";
|
|
319
321
|
export { SellerLiveView } from "./features/seller/components/SellerLiveView";
|
|
320
322
|
// ── Central schema registry (W1) ──────────────────────────────────────────────
|
|
@@ -121,6 +121,8 @@ export declare const PRODUCT_FIELDS: {
|
|
|
121
121
|
readonly CLASSIFIED: "classified";
|
|
122
122
|
readonly DIGITAL_CODE: "digital-code";
|
|
123
123
|
readonly LIVE: "live";
|
|
124
|
+
readonly ART: "art";
|
|
125
|
+
readonly STICKERS: "stickers";
|
|
124
126
|
};
|
|
125
127
|
};
|
|
126
128
|
export declare const PRODUCT_STATUS_TRANSITIONS: Record<string, readonly string[]>;
|
|
@@ -160,11 +162,6 @@ export declare const ORDER_FIELDS: {
|
|
|
160
162
|
readonly SHIPPING_METHOD: "shippingMethod";
|
|
161
163
|
readonly SHIPPING_CARRIER: "shippingCarrier";
|
|
162
164
|
readonly TRACKING_URL: "trackingUrl";
|
|
163
|
-
readonly SHIPROCKET_ORDER_ID: "shiprocketOrderId";
|
|
164
|
-
readonly SHIPROCKET_SHIPMENT_ID: "shiprocketShipmentId";
|
|
165
|
-
readonly SHIPROCKET_AWB: "shiprocketAWB";
|
|
166
|
-
readonly SHIPROCKET_STATUS: "shiprocketStatus";
|
|
167
|
-
readonly SHIPROCKET_UPDATED_AT: "shiprocketUpdatedAt";
|
|
168
165
|
readonly ITEMS: "items";
|
|
169
166
|
readonly TOTAL_AMOUNT: "totalAmount";
|
|
170
167
|
readonly BUYER_ID: "buyerId";
|
|
@@ -195,7 +192,6 @@ export declare const ORDER_FIELDS: {
|
|
|
195
192
|
};
|
|
196
193
|
readonly SHIPPING_METHOD_VALUES: {
|
|
197
194
|
readonly CUSTOM: "custom";
|
|
198
|
-
readonly SHIPROCKET: "shiprocket";
|
|
199
195
|
};
|
|
200
196
|
};
|
|
201
197
|
export declare const REVIEW_FIELDS: {
|
|
@@ -126,6 +126,8 @@ export const PRODUCT_FIELDS = {
|
|
|
126
126
|
CLASSIFIED: "classified",
|
|
127
127
|
DIGITAL_CODE: "digital-code",
|
|
128
128
|
LIVE: "live",
|
|
129
|
+
ART: "art",
|
|
130
|
+
STICKERS: "stickers",
|
|
129
131
|
},
|
|
130
132
|
};
|
|
131
133
|
export const PRODUCT_STATUS_TRANSITIONS = {
|
|
@@ -173,11 +175,6 @@ export const ORDER_FIELDS = {
|
|
|
173
175
|
SHIPPING_METHOD: "shippingMethod",
|
|
174
176
|
SHIPPING_CARRIER: "shippingCarrier",
|
|
175
177
|
TRACKING_URL: "trackingUrl",
|
|
176
|
-
SHIPROCKET_ORDER_ID: "shiprocketOrderId",
|
|
177
|
-
SHIPROCKET_SHIPMENT_ID: "shiprocketShipmentId",
|
|
178
|
-
SHIPROCKET_AWB: "shiprocketAWB",
|
|
179
|
-
SHIPROCKET_STATUS: "shiprocketStatus",
|
|
180
|
-
SHIPROCKET_UPDATED_AT: "shiprocketUpdatedAt",
|
|
181
178
|
ITEMS: "items",
|
|
182
179
|
TOTAL_AMOUNT: "totalAmount",
|
|
183
180
|
BUYER_ID: "buyerId",
|
|
@@ -208,7 +205,6 @@ export const ORDER_FIELDS = {
|
|
|
208
205
|
},
|
|
209
206
|
SHIPPING_METHOD_VALUES: {
|
|
210
207
|
CUSTOM: "custom",
|
|
211
|
-
SHIPROCKET: "shiprocket",
|
|
212
208
|
},
|
|
213
209
|
};
|
|
214
210
|
// ============================================================================
|
|
@@ -2,8 +2,10 @@ export type { WhereOp, SieveQuery, PagedResult, IReadRepository, IWriteRepositor
|
|
|
2
2
|
export type { AuthPayload, AuthUser, CreateUserInput, IAuthProvider, ISessionProvider, } from "./auth";
|
|
3
3
|
export type { EmailAttachment, EmailOptions, EmailResult, IEmailProvider, } from "./email";
|
|
4
4
|
export type { UploadOptions, StorageFile, IStorageProvider } from "./storage";
|
|
5
|
-
export type { PaymentOrder, PaymentCapture, Refund
|
|
6
|
-
export
|
|
5
|
+
export type { PaymentOrder, PaymentCapture, Refund } from "./payment";
|
|
6
|
+
export { IPaymentProvider } from "./payment";
|
|
7
|
+
export type { ShippingAddress, CreateShipmentInput, Shipment, TrackingEvent, TrackingInfo, ServiceabilityResult, } from "./shipping";
|
|
8
|
+
export { IShippingProvider } from "./shipping";
|
|
7
9
|
export type { SearchOptions, SearchHit, SearchResult, SuggestOptions, ISearchProvider, } from "./search";
|
|
8
10
|
export type { ICacheProvider, QueueJob, IQueueProvider, EventHandler, IEventBus, } from "./infra";
|
|
9
11
|
export type { IStyleAdapter } from "./style";
|
package/dist/contracts/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// @mohasinac/contracts
|
|
2
2
|
// Pure TypeScript interfaces and shared types — no concrete code.
|
|
3
3
|
// Every other @mohasinac/* package depends on this package.
|
|
4
|
+
// IPaymentProvider is an abstract class (not a pure type) — subclasses need
|
|
5
|
+
// the runtime constructor to `extends` it, so it's a value export.
|
|
6
|
+
export { IPaymentProvider } from "./payment";
|
|
7
|
+
// IShippingProvider is an abstract class (not a pure type) — subclasses need
|
|
8
|
+
// the runtime constructor to `extends` it, so it's a value export.
|
|
9
|
+
export { IShippingProvider } from "./shipping";
|
|
4
10
|
export { registerProviders, getProviders, _resetProviders } from "./registry";
|
|
5
11
|
export { setCollectionHooks, getCollectionHooks, removeCollectionHooks, _resetCollectionHooks, } from "./repository";
|
|
6
12
|
export { registerFormFields, resolveFormFields, removeFormFields, _resetFormFields, } from "./form";
|
|
@@ -26,15 +26,20 @@ export interface Refund {
|
|
|
26
26
|
createdAt: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Payment gateway adapter contract.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* Payment gateway adapter contract. An abstract base class rather than a
|
|
30
|
+
* plain interface so every provider (manual, Razorpay, and any future
|
|
31
|
+
* gateway) extends one shared type — adding a new provider is a subclass,
|
|
32
|
+
* not a fresh reimplementation of the shape.
|
|
33
|
+
*
|
|
34
|
+
* Implemented by the manual provider (default), Razorpay, and their mocks.
|
|
32
35
|
*/
|
|
33
|
-
export
|
|
34
|
-
|
|
36
|
+
export declare abstract class IPaymentProvider {
|
|
37
|
+
/** Short discriminator used by admin dev tooling to confirm which provider is registered. */
|
|
38
|
+
abstract readonly name: string;
|
|
39
|
+
abstract createOrder(amount: number, currency: string, metadata?: Record<string, JsonValue>): Promise<PaymentOrder>;
|
|
35
40
|
/** Returns true if the webhook signature is valid. */
|
|
36
|
-
verifyWebhook(payload: string, signature: string): boolean;
|
|
37
|
-
capturePayment(orderId: string): Promise<PaymentCapture>;
|
|
38
|
-
refund(paymentId: string, amount?: number): Promise<Refund>;
|
|
39
|
-
getOrder(orderId: string): Promise<PaymentOrder>;
|
|
41
|
+
abstract verifyWebhook(payload: string, signature: string): boolean;
|
|
42
|
+
abstract capturePayment(orderId: string): Promise<PaymentCapture>;
|
|
43
|
+
abstract refund(paymentId: string, amount?: number): Promise<Refund>;
|
|
44
|
+
abstract getOrder(orderId: string): Promise<PaymentOrder>;
|
|
40
45
|
}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
// --- Payment Shared Types -----------------------------------------------------
|
|
2
|
-
|
|
2
|
+
// --- Payment Contract -----------------------------------------------------
|
|
3
|
+
/**
|
|
4
|
+
* Payment gateway adapter contract. An abstract base class rather than a
|
|
5
|
+
* plain interface so every provider (manual, Razorpay, and any future
|
|
6
|
+
* gateway) extends one shared type — adding a new provider is a subclass,
|
|
7
|
+
* not a fresh reimplementation of the shape.
|
|
8
|
+
*
|
|
9
|
+
* Implemented by the manual provider (default), Razorpay, and their mocks.
|
|
10
|
+
*/
|
|
11
|
+
export class IPaymentProvider {
|
|
12
|
+
}
|
|
@@ -51,14 +51,19 @@ export interface ServiceabilityResult {
|
|
|
51
51
|
}>;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Shipping carrier adapter contract.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* Shipping carrier adapter contract. An abstract base class rather than a
|
|
55
|
+
* plain interface so every provider (manual, and any future carrier
|
|
56
|
+
* integration) extends one shared type — adding a new carrier is a
|
|
57
|
+
* subclass, not a fresh reimplementation of the shape.
|
|
58
|
+
*
|
|
59
|
+
* Implemented by the manual provider (default) and its mock.
|
|
57
60
|
*/
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
export declare abstract class IShippingProvider {
|
|
62
|
+
/** Short discriminator used by admin dev tooling to confirm which provider is registered. */
|
|
63
|
+
abstract readonly name: string;
|
|
64
|
+
abstract createShipment(data: CreateShipmentInput): Promise<Shipment>;
|
|
65
|
+
abstract trackShipment(trackingId: string): Promise<TrackingInfo>;
|
|
66
|
+
abstract cancelShipment(shipmentId: string): Promise<void>;
|
|
67
|
+
abstract checkServiceability(pincode: string, weight: number): Promise<ServiceabilityResult>;
|
|
68
|
+
abstract generateLabel(shipmentId: string): Promise<ArrayBuffer>;
|
|
64
69
|
}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
// --- Shipping Shared Types ----------------------------------------------------
|
|
2
|
-
|
|
2
|
+
// --- Shipping Contract ------------------------------------------------------
|
|
3
|
+
/**
|
|
4
|
+
* Shipping carrier adapter contract. An abstract base class rather than a
|
|
5
|
+
* plain interface so every provider (manual, and any future carrier
|
|
6
|
+
* integration) extends one shared type — adding a new carrier is a
|
|
7
|
+
* subclass, not a fresh reimplementation of the shape.
|
|
8
|
+
*
|
|
9
|
+
* Implemented by the manual provider (default) and its mock.
|
|
10
|
+
*/
|
|
11
|
+
export class IShippingProvider {
|
|
12
|
+
}
|
|
@@ -9,7 +9,8 @@ import { Anchor, Div, Grid, Heading, Row, Section, Span, Stack, Text } from "../
|
|
|
9
9
|
import { MediaImage } from "../../media/MediaImage";
|
|
10
10
|
import { ProductCard } from "../../products/components/ProductGrid";
|
|
11
11
|
import { ReviewCard } from "../../reviews/components/ReviewsList";
|
|
12
|
-
import {
|
|
12
|
+
import { pluginFor } from "../../../_internal/shared/listing-types/_registry";
|
|
13
|
+
import { normalizeListingType } from "../../products/utils/listing-type";
|
|
13
14
|
import { isAdminUser, isSellerUser } from "../../auth/role-predicates";
|
|
14
15
|
import { User, Star, ShoppingBag, Package, Trophy, Globe, MapPin, ExternalLink } from "lucide-react";
|
|
15
16
|
const __P = {
|
|
@@ -50,11 +51,7 @@ function toProductItem(p) {
|
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
function getProductHref(p) {
|
|
53
|
-
|
|
54
|
-
return String(ROUTES.PUBLIC.AUCTION_DETAIL(p.id));
|
|
55
|
-
if (isPreOrderListing(p))
|
|
56
|
-
return String(ROUTES.PUBLIC.PRE_ORDER_DETAIL(p.id));
|
|
57
|
-
return String(ROUTES.PUBLIC.PRODUCT_DETAIL(p.id));
|
|
54
|
+
return pluginFor(normalizeListingType(p)).detailRoute(p.id);
|
|
58
55
|
}
|
|
59
56
|
export async function PublicProfileView({ userId, }) {
|
|
60
57
|
const page = { container: PAGE_CONTAINER };
|
|
@@ -67,7 +67,6 @@ export function UserOffersPanel({ fetchEndpoint = "/api/user/offers", onAcceptCo
|
|
|
67
67
|
const [fetchError, setFetchError] = useState("");
|
|
68
68
|
const [showLoginModal, setShowLoginModal] = useState(false);
|
|
69
69
|
const loadOffers = useCallback(async () => {
|
|
70
|
-
// toast-intentionally-silent: background data loader — error displayed in inline fetchError state
|
|
71
70
|
setLoading(true);
|
|
72
71
|
setFetchError("");
|
|
73
72
|
try {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AdminAddressBookView — admin lookup of the addresses collection by owner.
|
|
3
|
+
* The list endpoint (GET /api/admin/addresses) only supports per-owner or
|
|
4
|
+
* per-banStatus queries, not a global browse, so this is a search-by-owner
|
|
5
|
+
* tool rather than a paginated DataListingView.
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
export interface AdminAddressBookViewProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function AdminAddressBookView(_props: AdminAddressBookViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* AdminAddressBookView — admin lookup of the addresses collection by owner.
|
|
5
|
+
* The list endpoint (GET /api/admin/addresses) only supports per-owner or
|
|
6
|
+
* per-banStatus queries, not a global browse, so this is a search-by-owner
|
|
7
|
+
* tool rather than a paginated DataListingView.
|
|
8
|
+
*/
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { useQuery } from "@tanstack/react-query";
|
|
11
|
+
import { Badge, Button, Card, FieldSelect, Heading, Input, Row, Stack, Text, TextLink, } from "../../../ui";
|
|
12
|
+
import { apiClient } from "../../../http";
|
|
13
|
+
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
14
|
+
import { ROUTES } from "../../../next/routing/route-map";
|
|
15
|
+
const OWNER_TYPE_OPTIONS = [
|
|
16
|
+
{ value: "user", label: "User" },
|
|
17
|
+
{ value: "store", label: "Store" },
|
|
18
|
+
];
|
|
19
|
+
export function AdminAddressBookView(_props) {
|
|
20
|
+
const [ownerType, setOwnerType] = React.useState("user");
|
|
21
|
+
const [ownerIdInput, setOwnerIdInput] = React.useState("");
|
|
22
|
+
const [searchedOwnerId, setSearchedOwnerId] = React.useState(null);
|
|
23
|
+
const { data, isLoading, error } = useQuery({
|
|
24
|
+
queryKey: ["admin", "addresses", "by-owner", ownerType, searchedOwnerId],
|
|
25
|
+
queryFn: () => apiClient.get(`${ADMIN_ENDPOINTS.ADDRESSES}?ownerType=${ownerType}&ownerId=${encodeURIComponent(searchedOwnerId)}`),
|
|
26
|
+
enabled: !!searchedOwnerId,
|
|
27
|
+
});
|
|
28
|
+
const addresses = data?.items ?? [];
|
|
29
|
+
return (_jsxs(Stack, { gap: "lg", padding: "page", children: [_jsxs(Row, { justify: "between", align: "center", children: [_jsxs(Stack, { gap: "none", children: [_jsx(Heading, { level: 2, size: "lg", weight: "semibold", color: "primary", children: "Addresses" }), _jsx(Text, { size: "sm", color: "muted", className: "mt-1", children: "Look up a user's or store's saved addresses by owner ID." })] }), _jsx(TextLink, { href: String(ROUTES.ADMIN.ADDRESSES_NEW), children: _jsx(Button, { type: "button", children: "+ New address" }) })] }), _jsx(Card, { variant: "outlined", padding: "md", children: _jsxs(Row, { gap: "md", align: "end", wrap: true, children: [_jsx(FieldSelect, { name: "ownerType", label: "Owner type", value: ownerType, onChange: (v) => setOwnerType(v), options: OWNER_TYPE_OPTIONS }), _jsx(Input, { name: "ownerId", label: "Owner ID", placeholder: ownerType === "user" ? "user-..." : "store-...", value: ownerIdInput, onChange: (e) => setOwnerIdInput(e.target.value) }), _jsx(Button, { type: "button", isLoading: isLoading, disabled: !ownerIdInput.trim(), onClick: () => setSearchedOwnerId(ownerIdInput.trim()), children: "Search" })] }) }), error && (_jsx(Text, { size: "sm", color: "danger", children: error?.message ?? "Failed to load addresses." })), searchedOwnerId && !isLoading && addresses.length === 0 && !error && (_jsx(Text, { size: "sm", color: "muted", children: "No addresses found for this owner." })), addresses.length > 0 && (_jsx(Stack, { gap: "sm", children: addresses.map((addr) => (_jsx(Card, { variant: "outlined", padding: "md", children: _jsxs(Row, { justify: "between", align: "center", wrap: true, children: [_jsxs(Stack, { gap: "none", children: [_jsxs(Row, { gap: "sm", align: "center", children: [_jsx(Text, { weight: "medium", children: addr.label }), addr.isDefault && _jsx(Badge, { variant: "secondary", size: "sm", children: "Default" })] }), _jsx(Text, { size: "sm", color: "muted", children: addr.fullName }), _jsx(Text, { size: "sm", color: "muted", children: [addr.addressLine1, addr.city, addr.state, addr.postalCode].filter(Boolean).join(", ") })] }), _jsx(TextLink, { href: String(ROUTES.ADMIN.ADDRESSES_EDIT(addr.id)), children: _jsx(Button, { type: "button", variant: "secondary", children: "Edit" }) })] }) }, addr.id))) }))] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* AdminArtView — admin browse of art print listings (EMI/art-stickers session).
|
|
5
|
+
* Mirrors AdminClassifiedView's thin config-driven pattern.
|
|
6
|
+
*/
|
|
7
|
+
import { sortBy } from "@mohasinac/appkit";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { ListingLayout } from "../../../ui";
|
|
10
|
+
import { ADMIN_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
11
|
+
import { toRecordArray, toRelativeDate, toRupees, toStringValue, } from "../hooks/useAdminListingData";
|
|
12
|
+
import { DataListingView } from "./DataListingView";
|
|
13
|
+
const ADMIN_ART_CONFIG = {
|
|
14
|
+
portal: "admin",
|
|
15
|
+
title: "Art",
|
|
16
|
+
searchPlaceholder: "Search art prints by name or seller",
|
|
17
|
+
emptyLabel: "No art listings",
|
|
18
|
+
filterKeys: [],
|
|
19
|
+
defaultSort: sortBy("createdAt", "DESC"),
|
|
20
|
+
queryKey: ["admin", "art", "listing"],
|
|
21
|
+
endpoint: ADMIN_ENDPOINTS.PRODUCTS,
|
|
22
|
+
sortOptions: [
|
|
23
|
+
{ value: sortBy("createdAt", "DESC"), label: "Newest" },
|
|
24
|
+
{ value: sortBy("createdAt", "ASC"), label: "Oldest" },
|
|
25
|
+
{ value: "title", label: "Title A–Z" },
|
|
26
|
+
],
|
|
27
|
+
mapRows: (response) => toRecordArray(response.items).map((item, index) => ({
|
|
28
|
+
id: toStringValue(item.id, `art-${index}`),
|
|
29
|
+
primary: toStringValue(item.title ?? item.productTitle, "Untitled print"),
|
|
30
|
+
secondary: [
|
|
31
|
+
toStringValue(item.sellerName, "Unknown seller"),
|
|
32
|
+
toRupees(item.price),
|
|
33
|
+
].join(" · "),
|
|
34
|
+
status: toStringValue(item.status, "draft"),
|
|
35
|
+
updatedAt: toRelativeDate(item.updatedAt ?? item.createdAt),
|
|
36
|
+
})),
|
|
37
|
+
getTotal: (response, mappedRows) => typeof response.total === "number" ? response.total : mappedRows.length,
|
|
38
|
+
buildFilters: () => "listingType==art",
|
|
39
|
+
};
|
|
40
|
+
export function AdminArtView({ children, ...props }) {
|
|
41
|
+
if (React.Children.count(children) > 0) {
|
|
42
|
+
return (_jsx(ListingLayout, { portal: "admin", ...props, children: children }));
|
|
43
|
+
}
|
|
44
|
+
return _jsx(DataListingView, { config: ADMIN_ART_CONFIG });
|
|
45
|
+
}
|
|
@@ -26,7 +26,7 @@ function makeCard(zone = 1) {
|
|
|
26
26
|
id: `card-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
|
27
27
|
zone,
|
|
28
28
|
background: { type: "color", color: "var(--appkit-color-primary)" },
|
|
29
|
-
content: { title: "", subtitle: "", textColor: "#ffffff", textAlign: "left" },
|
|
29
|
+
content: { title: "", subtitle: "", textColor: "#ffffff", textAlign: "left" },
|
|
30
30
|
buttons: [],
|
|
31
31
|
hover: { effect: "scale" },
|
|
32
32
|
};
|
|
@@ -78,8 +78,7 @@ function ZonePicker({ selected, onChange, disabled, }) {
|
|
|
78
78
|
// ── Background Editor ────────────────────────────────────────────────────────
|
|
79
79
|
function BackgroundEditor({ value, onChange, prefix, }) {
|
|
80
80
|
const set = (patch) => onChange({ ...value, ...patch });
|
|
81
|
-
return (_jsxs(Stack, { gap: "3", children: [_jsx(Select, { label: "Background type", value: value.type, onChange: (e) => onChange({ type: e.target.value }), options: BG_TYPE_OPTIONS }), (value.type === "image" || value.type === "video") && (_jsxs(_Fragment, { children: [_jsx(Input, { label: `${value.type === "image" ? "Image" : "Video"} URL`, value: value.url ?? "", onChange: (e) => set({ url: e.target.value }), placeholder: "https://..." }), _jsx(Input, { label: "Mobile URL (optional)", value: value.mobileUrl ?? "", onChange: (e) => set({ mobileUrl: e.target.value || undefined }), placeholder: "https://... (portrait crop)" }), value.type === "video" && (_jsx(Input, { label: "Poster / thumbnail URL", value: value.thumbnail ?? "", onChange: (e) => set({ thumbnail: e.target.value || undefined }), placeholder: "https://..." })), _jsxs(Stack, { className: `${__P.p3}`, gap: "sm", rounded: "lg", border: "default", children: [_jsx(Toggle, { label: "Dim overlay", checked: value.dimOverlay?.enabled ?? false, onChange: (v) => set({ dimOverlay: { enabled: v, opacity: value.dimOverlay?.opacity ?? 40 } }) }), value.dimOverlay?.enabled && (_jsxs(Div, { children: [_jsxs(Text, { className: "mb-1", size: "sm", weight: "medium", children: ["Opacity (", value.dimOverlay.opacity, "%)"] }), _jsx("input", { type: "range", min: 0, max: 90, step: 5, value: value.dimOverlay.opacity, onChange: (e) => set({ dimOverlay: { enabled: true, opacity: Number(e.target.value) } }), className: "w-full" })] }))] })] })), value.type === "color" && (_jsx(Input, { label: "Colour (CSS token or hex)", value: value.color ?? "", onChange: (e) => set({ color: e.target.value }), placeholder: "var(--appkit-color-primary) or #1a1a2e"
|
|
82
|
-
})), value.type === "gradient" && (_jsxs(_Fragment, { children: [_jsx(Input, { label: "From colour", value: value.gradientFrom ?? "", onChange: (e) => set({ gradientFrom: e.target.value }), placeholder: "var(--appkit-color-primary)" }), _jsx(Input, { label: "To colour", value: value.gradientTo ?? "", onChange: (e) => set({ gradientTo: e.target.value }), placeholder: "var(--appkit-color-secondary)" }), _jsx(Input, { label: "Angle (degrees)", type: "number", value: String(value.gradientAngle ?? 135), onChange: (e) => set({ gradientAngle: Number(e.target.value) }), min: 0, max: 360 })] }))] }));
|
|
81
|
+
return (_jsxs(Stack, { gap: "3", children: [_jsx(Select, { label: "Background type", value: value.type, onChange: (e) => onChange({ type: e.target.value }), options: BG_TYPE_OPTIONS }), (value.type === "image" || value.type === "video") && (_jsxs(_Fragment, { children: [_jsx(Input, { label: `${value.type === "image" ? "Image" : "Video"} URL`, value: value.url ?? "", onChange: (e) => set({ url: e.target.value }), placeholder: "https://..." }), _jsx(Input, { label: "Mobile URL (optional)", value: value.mobileUrl ?? "", onChange: (e) => set({ mobileUrl: e.target.value || undefined }), placeholder: "https://... (portrait crop)" }), value.type === "video" && (_jsx(Input, { label: "Poster / thumbnail URL", value: value.thumbnail ?? "", onChange: (e) => set({ thumbnail: e.target.value || undefined }), placeholder: "https://..." })), _jsxs(Stack, { className: `${__P.p3}`, gap: "sm", rounded: "lg", border: "default", children: [_jsx(Toggle, { label: "Dim overlay", checked: value.dimOverlay?.enabled ?? false, onChange: (v) => set({ dimOverlay: { enabled: v, opacity: value.dimOverlay?.opacity ?? 40 } }) }), value.dimOverlay?.enabled && (_jsxs(Div, { children: [_jsxs(Text, { className: "mb-1", size: "sm", weight: "medium", children: ["Opacity (", value.dimOverlay.opacity, "%)"] }), _jsx("input", { type: "range", min: 0, max: 90, step: 5, value: value.dimOverlay.opacity, onChange: (e) => set({ dimOverlay: { enabled: true, opacity: Number(e.target.value) } }), className: "w-full" })] }))] })] })), value.type === "color" && (_jsx(Input, { label: "Colour (CSS token or hex)", value: value.color ?? "", onChange: (e) => set({ color: e.target.value }), placeholder: "var(--appkit-color-primary) or #1a1a2e" })), value.type === "gradient" && (_jsxs(_Fragment, { children: [_jsx(Input, { label: "From colour", value: value.gradientFrom ?? "", onChange: (e) => set({ gradientFrom: e.target.value }), placeholder: "var(--appkit-color-primary)" }), _jsx(Input, { label: "To colour", value: value.gradientTo ?? "", onChange: (e) => set({ gradientTo: e.target.value }), placeholder: "var(--appkit-color-secondary)" }), _jsx(Input, { label: "Angle (degrees)", type: "number", value: String(value.gradientAngle ?? 135), onChange: (e) => set({ gradientAngle: Number(e.target.value) }), min: 0, max: 360 })] }))] }));
|
|
83
82
|
}
|
|
84
83
|
// ── Card Editor ──────────────────────────────────────────────────────────────
|
|
85
84
|
function CardEditor({ card, index, otherZones, onChange, onRemove, }) {
|
|
@@ -34,7 +34,6 @@ export function AdminFulfillmentView({ initialStoreId, initialStoreName, }) {
|
|
|
34
34
|
const [actionLoadingId, setActionLoadingId] = useState(null);
|
|
35
35
|
const { showToast } = useToast();
|
|
36
36
|
const fetchOrders = useCallback(async (sid) => {
|
|
37
|
-
// toast-intentionally-silent: background data loader — normalizeError logs, no user-facing toast needed
|
|
38
37
|
setIsLoading(true);
|
|
39
38
|
try {
|
|
40
39
|
const res = await apiClient.get(ADMIN_ENDPOINTS.ADMIN_FULFILLMENT(sid));
|
|
@@ -12,7 +12,7 @@ export function AdminSiteConfigGuideView() {
|
|
|
12
12
|
{ name: "contactSocial", desc: "Email, phone, social media URLs, WhatsApp business number." },
|
|
13
13
|
{ name: "watermark", desc: "Watermark text and opacity applied to all product images via the /api/media proxy." },
|
|
14
14
|
{ name: "fees", desc: "platformFee (%), Razorpay gateway fee pass-through toggle, GST rate on platform fees." },
|
|
15
|
-
{ name: "integrations", desc: "API keys: Razorpay (live/test
|
|
15
|
+
{ name: "integrations", desc: "API keys: Razorpay (live/test, disabled by default — manual payment is the default), Resend, WhatsApp Cloud API. Keys are encrypted at rest — never log or export." },
|
|
16
16
|
{ name: "shipping", desc: "Default shipping carriers, free shipping threshold (paise), COD availability toggle." },
|
|
17
17
|
{ name: "auctionConfig", desc: "Global bid increment default, auto-extend window (minutes), minimum auction duration." },
|
|
18
18
|
{ name: "platformLimits", desc: "Cart item cap (50), wishlist cap (20), history cap (50), support ticket limits (2 general + 1 per order)." },
|