@mohasinac/appkit 2.7.56 → 2.7.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/client/features/layout/DashboardLayoutClient.d.ts +7 -1
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +8 -2
- package/dist/_internal/shared/actions/action-registry.js +31 -5
- package/dist/client.d.ts +2 -4
- package/dist/client.js +2 -3
- package/dist/configs/tailwind.d.ts +16 -3
- package/dist/configs/tailwind.js +18 -5
- package/dist/constants/field-names.d.ts +3 -0
- package/dist/constants/field-names.js +3 -0
- package/dist/features/about/components/FAQPageView.js +2 -2
- package/dist/features/about/components/FeesView.js +1 -1
- package/dist/features/about/components/PolicyPageView.js +1 -1
- package/dist/features/about/components/PublicProfileView.js +1 -1
- package/dist/features/account/components/AddressBook.js +1 -1
- package/dist/features/account/components/AddressesIndexListing.js +1 -1
- package/dist/features/account/components/BuyerAccountGuideView.js +7 -7
- package/dist/features/account/components/BuyerAuctionsGuideView.js +7 -7
- package/dist/features/account/components/BuyerOrdersGuideView.js +6 -6
- package/dist/features/account/components/BuyerShoppingGuideView.js +7 -7
- package/dist/features/account/components/MessagesView.js +1 -1
- package/dist/features/account/components/NotificationPreferencesPanel.js +12 -3
- package/dist/features/account/components/UserOffersPanel.js +2 -2
- package/dist/features/account/components/UserSidebar.js +3 -3
- package/dist/features/account/components/UserSupportView.js +5 -5
- package/dist/features/admin/components/AdminAdsView.js +1 -1
- package/dist/features/admin/components/AdminAllEventEntriesView.js +2 -2
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +3 -3
- package/dist/features/admin/components/AdminBidsView.js +6 -2
- package/dist/features/admin/components/AdminBlogView.js +7 -2
- package/dist/features/admin/components/AdminBrandsView.js +7 -2
- package/dist/features/admin/components/AdminBundleEditorView.js +13 -9
- package/dist/features/admin/components/AdminBundlesView.js +4 -2
- package/dist/features/admin/components/AdminCarouselEditorView.js +7 -8
- package/dist/features/admin/components/AdminCarouselView.js +6 -4
- package/dist/features/admin/components/AdminCartsView.js +1 -1
- package/dist/features/admin/components/AdminCatalogGuideView.js +5 -5
- package/dist/features/admin/components/AdminCategoriesView.js +7 -2
- package/dist/features/admin/components/AdminContactEditorView.js +2 -2
- package/dist/features/admin/components/AdminContactView.js +4 -2
- package/dist/features/admin/components/AdminContentGuideView.js +6 -6
- package/dist/features/admin/components/AdminCouponsView.js +4 -2
- package/dist/features/admin/components/AdminEmployeeEditorView.js +1 -1
- package/dist/features/admin/components/AdminFaqsView.js +4 -2
- package/dist/features/admin/components/AdminFeatureFlagsView.js +1 -1
- package/dist/features/admin/components/AdminFeaturesView.js +5 -1
- package/dist/features/admin/components/AdminGuideHubView.js +1 -1
- package/dist/features/admin/components/AdminHistoryView.js +1 -1
- package/dist/features/admin/components/AdminListingScaffold.js +1 -1
- package/dist/features/admin/components/AdminMediaView.js +10 -5
- package/dist/features/admin/components/AdminNavigationView.js +1 -1
- package/dist/features/admin/components/AdminNewsletterView.js +4 -2
- package/dist/features/admin/components/AdminNotificationsView.js +7 -2
- package/dist/features/admin/components/AdminOrdersGuideView.js +5 -5
- package/dist/features/admin/components/AdminOrdersView.js +11 -2
- package/dist/features/admin/components/AdminPayoutsView.js +6 -2
- package/dist/features/admin/components/AdminPrizeDrawsView.js +4 -0
- package/dist/features/admin/components/AdminProductsView.js +14 -2
- package/dist/features/admin/components/AdminReturnRequestsView.js +1 -1
- package/dist/features/admin/components/AdminReviewsView.js +7 -2
- package/dist/features/admin/components/AdminScammerEditorView.js +3 -3
- package/dist/features/admin/components/AdminScammersView.js +5 -5
- package/dist/features/admin/components/AdminSectionsView.js +2 -2
- package/dist/features/admin/components/AdminSessionsView.js +6 -2
- package/dist/features/admin/components/AdminSidebar.js +3 -3
- package/dist/features/admin/components/AdminSiteSettingsView.js +1 -1
- package/dist/features/admin/components/AdminStoreAddressesView.js +1 -1
- package/dist/features/admin/components/AdminStoreEditorView.js +1 -1
- package/dist/features/admin/components/AdminStoresGuideView.js +6 -6
- package/dist/features/admin/components/AdminStoresView.js +7 -2
- package/dist/features/admin/components/AdminSublistingCategoriesView.js +3 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +4 -4
- package/dist/features/admin/components/AdminSupportTicketsView.js +8 -8
- package/dist/features/admin/components/AdminTeamGuideView.js +4 -4
- package/dist/features/admin/components/AdminTeamView.js +4 -2
- package/dist/features/admin/components/AdminTrustGuideView.js +5 -5
- package/dist/features/admin/components/AdminUserEditorView.js +2 -2
- package/dist/features/admin/components/AdminUsersGuideView.js +5 -5
- package/dist/features/admin/components/AdminUsersView.js +6 -2
- package/dist/features/admin/components/AdminViewCards.js +3 -3
- package/dist/features/admin/components/AdminWishlistsView.js +1 -1
- package/dist/features/admin/components/DataTable.js +1 -1
- package/dist/features/admin/constants/filter-tabs.d.ts +9 -0
- package/dist/features/admin/constants/filter-tabs.js +3 -0
- package/dist/features/auctions/components/AuctionBidsTable.js +1 -1
- package/dist/features/auctions/components/AuctionBottomActions.d.ts +7 -0
- package/dist/features/auctions/components/AuctionBottomActions.js +24 -0
- package/dist/features/auctions/components/AuctionDetailPageView.js +7 -7
- package/dist/features/auctions/components/AuctionsListView.js +1 -1
- package/dist/features/auctions/components/MarketplaceAuctionCard.js +2 -2
- package/dist/features/auctions/components/MarketplaceAuctionGrid.js +1 -1
- package/dist/features/auctions/components/PlaceBidFormClient.js +1 -1
- package/dist/features/auth/components/LoginForm.js +1 -1
- package/dist/features/auth/components/VerifyEmailView.js +2 -2
- package/dist/features/before-after/components/BeforeAfterGallery.js +1 -1
- package/dist/features/blog/components/BlogFeaturedCard.js +1 -1
- package/dist/features/blog/components/BlogIndexListing.js +1 -1
- package/dist/features/blog/components/BlogListView.js +2 -2
- package/dist/features/blog/components/BlogPostView.js +8 -8
- package/dist/features/cart/components/CartDrawer.js +2 -2
- package/dist/features/cart/repository/cart.repository.js +11 -4
- package/dist/features/cart/schemas/firestore.d.ts +3 -0
- package/dist/features/categories/components/BrandDetailPageView.js +1 -1
- package/dist/features/categories/components/CategoriesIndexListing.js +1 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +39 -3
- package/dist/features/categories/components/CategoryDetailTabs.d.ts +4 -1
- package/dist/features/categories/components/CategoryDetailTabs.js +7 -2
- package/dist/features/categories/components/CategoryGrid.js +1 -1
- package/dist/features/categories/components/CategoryProductsView.js +1 -1
- package/dist/features/categories/components/CategoryStoresListing.d.ts +5 -0
- package/dist/features/categories/components/CategoryStoresListing.js +11 -0
- package/dist/features/categories/components/CategoryTableColumns.js +2 -2
- package/dist/features/categories/components/CategoryTree.js +1 -1
- package/dist/features/categories/components/index.d.ts +2 -0
- package/dist/features/categories/components/index.js +1 -0
- package/dist/features/checkout/components/CheckoutStepper.js +2 -2
- package/dist/features/classified/components/ClassifiedIndexListing.js +2 -0
- package/dist/features/classified/components/ClassifiedListView.js +1 -1
- package/dist/features/collections/components/CollectionCard.js +1 -1
- package/dist/features/contact/components/ContactInfoSidebar.js +1 -1
- package/dist/features/copilot/components/AdminCopilotView.js +2 -2
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +2 -0
- package/dist/features/digital-codes/components/DigitalCodesListView.js +1 -1
- package/dist/features/events/components/AdminEventsView.js +5 -1
- package/dist/features/events/components/EventCard.js +1 -1
- package/dist/features/events/components/EventPollWidget.js +3 -3
- package/dist/features/events/components/EventStatusBadge.js +5 -5
- package/dist/features/events/components/EventsIndexListing.js +1 -1
- package/dist/features/events/components/EventsListView.js +2 -2
- package/dist/features/events/components/SpinWheelView.js +5 -3
- package/dist/features/faq/components/FAQAccordion.js +2 -2
- package/dist/features/filters/AsyncFacetSection.js +3 -3
- package/dist/features/filters/FilterFacetSection.js +5 -5
- package/dist/features/filters/RangeFilter.js +1 -1
- package/dist/features/forms/Input.js +5 -5
- package/dist/features/forms/Select.js +3 -3
- package/dist/features/forms/Slider.js +1 -1
- package/dist/features/forms/Textarea.js +3 -3
- package/dist/features/forms/utils.d.ts +2 -2
- package/dist/features/forms/utils.js +2 -2
- package/dist/features/history/hooks/useHistory.js +23 -10
- package/dist/features/homepage/components/AdvertisementBanner.js +2 -2
- package/dist/features/homepage/components/CharacterHotspotForm.js +2 -2
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
- package/dist/features/homepage/components/HeroSection.js +1 -1
- package/dist/features/homepage/components/NewsletterSection.js +1 -1
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/layout/BottomActions.js +2 -2
- package/dist/features/layout/ListingLayout.js +3 -3
- package/dist/features/layout/TitleBarLayout.js +1 -1
- package/dist/features/live/components/LiveItemsIndexListing.js +2 -0
- package/dist/features/live/components/LiveItemsListView.js +1 -1
- package/dist/features/media/index.d.ts +2 -0
- package/dist/features/media/index.js +1 -0
- package/dist/features/media/modals/ImageCropModal.js +1 -1
- package/dist/features/media/modals/ImageEditor.d.ts +12 -0
- package/dist/features/media/modals/ImageEditor.js +73 -0
- package/dist/features/media/upload/ImageUpload.d.ts +5 -1
- package/dist/features/media/upload/ImageUpload.js +33 -8
- package/dist/features/media/upload/MediaUploadField.d.ts +5 -1
- package/dist/features/media/upload/MediaUploadField.js +26 -12
- package/dist/features/orders/components/OrdersList.js +12 -12
- package/dist/features/orders/components/RefundHistoryTable.js +2 -2
- package/dist/features/orders/components/RefundRequestView.js +3 -3
- package/dist/features/pre-orders/components/MarketplacePreorderCard.js +1 -1
- package/dist/features/pre-orders/components/PreOrderActionsClient.js +1 -1
- package/dist/features/pre-orders/components/PreOrderBadge.js +5 -5
- package/dist/features/pre-orders/components/PreOrderBottomActions.d.ts +5 -0
- package/dist/features/pre-orders/components/PreOrderBottomActions.js +22 -0
- package/dist/features/pre-orders/components/PreOrderDetailPageView.js +5 -5
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +47 -0
- package/dist/features/pre-orders/components/PreOrdersListView.js +1 -1
- package/dist/features/pre-orders/components/PreorderCard.js +3 -3
- package/dist/features/products/components/AuctionsIndexListing.js +23 -0
- package/dist/features/products/components/BidHistory.js +2 -2
- package/dist/features/products/components/CompareOverlay.js +1 -1
- package/dist/features/products/components/CustomFieldsEditor.js +1 -1
- package/dist/features/products/components/CustomSectionTabContent.js +1 -1
- package/dist/features/products/components/CustomSectionsEditor.js +1 -1
- package/dist/features/products/components/GroupSettingsPanel.js +2 -2
- package/dist/features/products/components/MakeOfferButton.js +2 -2
- package/dist/features/products/components/PrizeDrawBottomActions.d.ts +6 -0
- package/dist/features/products/components/PrizeDrawBottomActions.js +24 -0
- package/dist/features/products/components/PrizeDrawDetailPageView.js +5 -7
- package/dist/features/products/components/PrizeDrawEntryActions.js +5 -18
- package/dist/features/products/components/PrizeDrawItemsEditor.js +3 -3
- package/dist/features/products/components/PrizeRevealModal.js +7 -4
- package/dist/features/products/components/ProductDetailActions.d.ts +6 -1
- package/dist/features/products/components/ProductDetailActions.js +36 -6
- package/dist/features/products/components/ProductDetailPageView.js +19 -18
- package/dist/features/products/components/ProductFeaturesSelector.js +1 -1
- package/dist/features/products/components/ProductGalleryClient.js +1 -1
- package/dist/features/products/components/ProductGrid.js +8 -8
- package/dist/features/products/components/ProductTabs.js +1 -1
- package/dist/features/products/components/ProductTabsShell.js +1 -1
- package/dist/features/products/components/ProductsIndexListing.js +47 -0
- package/dist/features/products/components/RelatedProducts.js +1 -1
- package/dist/features/products/components/ShowGroupSection.js +1 -1
- package/dist/features/products/components/SublistingCarouselSection.js +1 -1
- package/dist/features/products/components/SublistingCategorySelect.js +1 -1
- package/dist/features/products/components/index.d.ts +0 -2
- package/dist/features/products/components/index.js +0 -1
- package/dist/features/products/constants/action-defs.d.ts +7 -0
- package/dist/features/products/constants/action-defs.js +14 -0
- package/dist/features/products/constants/listing-tabs.d.ts +6 -0
- package/dist/features/products/constants/listing-tabs.js +1 -0
- package/dist/features/promotions/components/CouponCard.js +3 -3
- package/dist/features/promotions/components/CouponsIndexListing.js +2 -2
- package/dist/features/promotions/components/PromotionsView.js +1 -1
- package/dist/features/reviews/components/ReviewDetailPageView.js +1 -1
- package/dist/features/reviews/components/ReviewDetailShell.js +4 -4
- package/dist/features/reviews/components/ReviewModal.js +2 -2
- package/dist/features/reviews/components/ReviewSummary.js +1 -1
- package/dist/features/reviews/components/ReviewsIndexListing.js +1 -1
- package/dist/features/reviews/components/ReviewsList.js +1 -1
- package/dist/features/seller/components/SellerAddressesView.js +4 -3
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +2 -2
- package/dist/features/seller/components/SellerAuctionsView.js +11 -4
- package/dist/features/seller/components/SellerBidsView.js +22 -7
- package/dist/features/seller/components/SellerBundlesView.js +11 -4
- package/dist/features/seller/components/SellerClassifiedView.js +12 -5
- package/dist/features/seller/components/SellerCouponEditorView.js +2 -2
- package/dist/features/seller/components/SellerCouponsView.js +13 -4
- package/dist/features/seller/components/SellerDigitalCodesView.js +11 -4
- package/dist/features/seller/components/SellerFeaturesView.js +1 -1
- package/dist/features/seller/components/SellerGoogleReviewsView.js +10 -5
- package/dist/features/seller/components/SellerGroupedListingsView.js +2 -0
- package/dist/features/seller/components/SellerLiveView.js +13 -6
- package/dist/features/seller/components/SellerOffersPanel.js +2 -2
- package/dist/features/seller/components/SellerOffersView.js +2 -2
- package/dist/features/seller/components/SellerOrdersView.js +41 -18
- package/dist/features/seller/components/SellerPayoutMethodsView.js +14 -5
- package/dist/features/seller/components/SellerPayoutsView.js +2 -2
- package/dist/features/seller/components/SellerPreOrdersView.js +7 -2
- package/dist/features/seller/components/SellerPrizeDrawsView.js +7 -2
- package/dist/features/seller/components/SellerProductShell.js +27 -9
- package/dist/features/seller/components/SellerProductsCards.js +2 -1
- package/dist/features/seller/components/SellerProductsView.js +22 -9
- package/dist/features/seller/components/SellerReviewsView.js +9 -1
- package/dist/features/seller/components/SellerShippingConfigsView.js +15 -6
- package/dist/features/seller/components/SellerSidebar.js +2 -2
- package/dist/features/seller/components/SellerStoreCategoriesView.js +11 -4
- package/dist/features/seller/components/SellerTemplatesView.js +20 -7
- package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -1
- package/dist/features/shell/StepForm.js +9 -3
- package/dist/features/site-settings/components/ActionPermissionsManager.js +1 -1
- package/dist/features/site-settings/components/NavPermissionsManager.js +1 -1
- package/dist/features/stores/components/InteractiveStoreCard.js +1 -1
- package/dist/features/stores/components/StoreDetailLayoutView.js +1 -1
- package/dist/features/stores/components/StoreFinanceGuideView.js +2 -2
- package/dist/features/stores/components/StoreHeader.js +1 -1
- package/dist/features/stores/components/StoreListingsGuideView.js +3 -3
- package/dist/features/stores/components/StoreOrdersGuideView.js +4 -4
- package/dist/features/stores/components/StoreReviewsListing.js +1 -1
- package/dist/features/stores/components/StoreSettingsGuideView.js +2 -2
- package/dist/features/stores/components/StoresIndexListing.js +17 -1
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +4 -4
- package/dist/features/wishlist/components/WishlistPage.js +3 -3
- package/dist/features/wishlist/hooks/useWishlistToggle.js +6 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +9 -3
- package/dist/react/hooks/use-action-dispatch.d.ts +5 -0
- package/dist/react/hooks/use-action-dispatch.js +10 -0
- package/dist/seed/cart-seed-data.js +50 -3
- package/dist/seed/categories-seed-data.js +80 -16
- package/dist/seed/index.d.ts +3 -0
- package/dist/seed/index.js +3 -0
- package/dist/seed/manifest.js +15 -1
- package/dist/seed/products-classifieds-seed-data.d.ts +10 -0
- package/dist/seed/products-classifieds-seed-data.js +197 -0
- package/dist/seed/products-digital-codes-seed-data.d.ts +10 -0
- package/dist/seed/products-digital-codes-seed-data.js +204 -0
- package/dist/seed/products-live-items-seed-data.d.ts +13 -0
- package/dist/seed/products-live-items-seed-data.js +190 -0
- package/dist/styles.css +301 -3
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.js +3 -3
- package/dist/tokens/motion.d.ts +162 -0
- package/dist/tokens/motion.js +89 -0
- package/dist/ui/DataTable.js +6 -5
- package/dist/ui/components/Accordion.js +2 -1
- package/dist/ui/components/Button.style.css +15 -0
- package/dist/ui/components/Card.d.ts +5 -2
- package/dist/ui/components/Card.js +29 -11
- package/dist/ui/components/Div.d.ts +2 -16
- package/dist/ui/components/Div.js +2 -16
- package/dist/ui/components/Input.js +1 -1
- package/dist/ui/components/Layout.d.ts +9 -19
- package/dist/ui/components/Layout.js +9 -7
- package/dist/ui/components/ListingToolbar.js +1 -1
- package/dist/ui/components/Modal.js +7 -4
- package/dist/ui/components/Motion.d.ts +75 -0
- package/dist/ui/components/Motion.js +122 -0
- package/dist/ui/components/Select.js +1 -1
- package/dist/ui/components/Semantic.d.ts +81 -14
- package/dist/ui/components/Semantic.js +75 -10
- package/dist/ui/components/Semantic.style.css +261 -2
- package/dist/ui/components/SideDrawer.d.ts +1 -1
- package/dist/ui/components/SideDrawer.js +8 -6
- package/dist/ui/components/SideModal.d.ts +1 -1
- package/dist/ui/components/SideModal.js +11 -9
- package/dist/ui/components/StackedViewShell.js +6 -1
- package/dist/ui/components/StatsGrid.js +1 -1
- package/dist/ui/components/Toast.js +5 -2
- package/dist/ui/components/Typography.d.ts +44 -3
- package/dist/ui/components/Typography.js +15 -30
- package/dist/ui/components/Typography.style.css +24 -0
- package/dist/ui/components/VacationBanner.js +2 -1
- package/dist/ui/components/surface-tokens.d.ts +70 -0
- package/dist/ui/components/surface-tokens.js +68 -0
- package/dist/ui/forms/FormShell.d.ts +6 -1
- package/dist/ui/forms/FormShell.js +32 -4
- package/dist/ui/index.d.ts +9 -6
- package/dist/ui/index.js +4 -4
- package/dist/validation/schemas.d.ts +28 -28
- package/package.json +3 -1
- package/dist/_internal/client/features/seller/print-center/InventoryLabel.d.ts +0 -12
- package/dist/_internal/client/features/seller/print-center/InventoryLabel.js +0 -49
- package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.d.ts +0 -7
- package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.js +0 -32
- package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.d.ts +0 -28
- package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.js +0 -33
- package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.d.ts +0 -12
- package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.js +0 -30
- package/dist/_internal/client/features/seller/print-center/PrintCenterView.d.ts +0 -12
- package/dist/_internal/client/features/seller/print-center/PrintCenterView.js +0 -102
- package/dist/_internal/client/features/seller/print-center/PrintGrid.d.ts +0 -12
- package/dist/_internal/client/features/seller/print-center/PrintGrid.js +0 -13
- package/dist/_internal/client/features/seller/print-center/StoreCard.d.ts +0 -19
- package/dist/_internal/client/features/seller/print-center/StoreCard.js +0 -30
- package/dist/_internal/client/features/seller/print-center/WebsiteCard.d.ts +0 -11
- package/dist/_internal/client/features/seller/print-center/WebsiteCard.js +0 -25
- package/dist/_internal/client/features/seller/print-center/index.d.ts +0 -11
- package/dist/_internal/client/features/seller/print-center/index.js +0 -10
- package/dist/_internal/client/features/seller/print-center/types.d.ts +0 -20
- package/dist/_internal/client/features/seller/print-center/types.js +0 -20
- package/dist/_internal/client/features/seller/print-center/useInventoryPdf.d.ts +0 -18
- package/dist/_internal/client/features/seller/print-center/useInventoryPdf.js +0 -76
- package/dist/features/account/repository/address.repository.d.ts +0 -17
- package/dist/features/account/repository/address.repository.js +0 -184
- package/dist/features/auctions/components/AuctionCard.d.ts +0 -29
- package/dist/features/auctions/components/AuctionCard.js +0 -38
- package/dist/features/categories/components/BundleAddToCartCta.d.ts +0 -16
- package/dist/features/categories/components/BundleAddToCartCta.js +0 -54
- package/dist/features/categories/components/CategoriesListView.d.ts +0 -31
- package/dist/features/categories/components/CategoriesListView.js +0 -27
- package/dist/features/products/components/AuctionsView.d.ts +0 -6
- package/dist/features/products/components/AuctionsView.js +0 -5
- package/dist/features/products/components/BuyBar.d.ts +0 -21
- package/dist/features/products/components/BuyBar.js +0 -19
- package/dist/features/products/components/PreOrdersView.d.ts +0 -6
- package/dist/features/products/components/PreOrdersView.js +0 -5
- package/dist/features/reviews/components/ReviewsListView.d.ts +0 -31
- package/dist/features/reviews/components/ReviewsListView.js +0 -16
- package/dist/features/stores/components/StoresListView.d.ts +0 -19
- package/dist/features/stores/components/StoresListView.js +0 -25
- package/dist/features/stores/repository/store-address.repository.d.ts +0 -55
- package/dist/features/stores/repository/store-address.repository.js +0 -187
- package/dist/ui/components/BulkActionsBar.d.ts +0 -18
- package/dist/ui/components/BulkActionsBar.js +0 -25
- package/dist/ui/components/CollageLightbox.d.ts +0 -18
- package/dist/ui/components/CollageLightbox.js +0 -41
- package/dist/ui/components/StickyBottomBar.d.ts +0 -22
- package/dist/ui/components/StickyBottomBar.js +0 -20
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export function OrderPackingLabel({ order, design, qrDataUrl, barcodeDataUrl, brandName = "" }) {
|
|
4
|
-
const { size, show, colorScheme } = design;
|
|
5
|
-
const isDark = colorScheme === "dark";
|
|
6
|
-
const bg = isDark ? "#1a1a1a" : "#ffffff";
|
|
7
|
-
const fg = isDark ? "#f5f5f5" : "#111111";
|
|
8
|
-
const muted = isDark ? "#999999" : "#666666";
|
|
9
|
-
const border = isDark ? "#333333" : "#e5e5e5";
|
|
10
|
-
const MAX_ITEMS = 4;
|
|
11
|
-
const shownItems = order.items.slice(0, MAX_ITEMS);
|
|
12
|
-
const extraCount = order.items.length - MAX_ITEMS;
|
|
13
|
-
const loc = order.physicalLocation;
|
|
14
|
-
const locStr = loc ? `${loc.zone} / ${loc.shelf} / ${loc.bin}` : null;
|
|
15
|
-
const dateStr = order.createdAt ? new Date(order.createdAt).toLocaleDateString("en-IN") : "";
|
|
16
|
-
return (_jsxs("div", { style: {
|
|
17
|
-
width: `${size.widthMm}mm`,
|
|
18
|
-
height: `${size.heightMm}mm`,
|
|
19
|
-
background: bg,
|
|
20
|
-
color: fg,
|
|
21
|
-
border: `1px solid ${border}`,
|
|
22
|
-
borderRadius: "2px",
|
|
23
|
-
padding: "2mm",
|
|
24
|
-
fontFamily: "monospace, sans-serif",
|
|
25
|
-
fontSize: "7pt",
|
|
26
|
-
display: "flex",
|
|
27
|
-
flexDirection: "column",
|
|
28
|
-
gap: "1mm",
|
|
29
|
-
overflow: "hidden",
|
|
30
|
-
boxSizing: "border-box",
|
|
31
|
-
pageBreakInside: "avoid",
|
|
32
|
-
}, children: [_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [_jsx("span", { style: { fontWeight: 700, fontSize: "9pt", letterSpacing: "0.1em" }, children: "PACKING SLIP" }), show.logo && brandName && _jsx("span", { style: { fontSize: "6pt", color: muted }, children: brandName })] }), _jsx("div", { style: { fontWeight: 700, fontSize: "8pt" }, children: order.id }), _jsxs("div", { style: { fontSize: "6pt", color: muted }, children: [dateStr, order.status ? ` · ${order.status}` : ""] }), _jsxs("div", { style: { borderTop: `1px solid ${border}`, paddingTop: "1mm", flex: 1 }, children: [shownItems.map((item, i) => (_jsxs("div", { style: { display: "flex", justifyContent: "space-between", fontSize: "6pt", marginBottom: "0.5mm" }, children: [_jsxs("span", { style: { flex: 1, overflow: "hidden" }, children: ["x", item.quantity, " ", item.productName] }), _jsxs("span", { children: ["Rs.", (item.price / 100).toFixed(0)] })] }, i))), extraCount > 0 && _jsxs("div", { style: { fontSize: "6pt", color: muted }, children: ["+", extraCount, " more"] })] }), (order.buyerDisplayName || order.buyerCity) && (_jsxs("div", { style: { fontSize: "6pt" }, children: [order.buyerDisplayName?.split(" ")[0], order.buyerCity ? ` · ${order.buyerCity}` : ""] })), show.location && locStr && _jsxs("div", { style: { fontSize: "6pt", color: muted }, children: ["Stage: ", locStr] }), (show.barcode || qrDataUrl) && (_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginTop: "auto" }, children: [show.barcode && barcodeDataUrl && (_jsx("img", { src: barcodeDataUrl, alt: "barcode", style: { height: "8mm", maxWidth: "65%" } })), qrDataUrl && _jsx("img", { src: qrDataUrl, alt: "qr", style: { width: "10mm", height: "10mm" } })] }))] }));
|
|
33
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface PhysicalLocation {
|
|
2
|
-
zone: string;
|
|
3
|
-
shelf: string;
|
|
4
|
-
bin: string;
|
|
5
|
-
}
|
|
6
|
-
interface PhysicalLocationModalProps {
|
|
7
|
-
count: number;
|
|
8
|
-
onSave: (loc: PhysicalLocation) => Promise<void>;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function PhysicalLocationModal({ count, onSave, onClose }: PhysicalLocationModalProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { Modal } from "../../../../../ui/components/Modal";
|
|
5
|
-
import { Input } from "../../../../../ui/components/Input";
|
|
6
|
-
import { Button } from "../../../../../ui/components/Button";
|
|
7
|
-
import { Row } from "../../../../../ui/components/Layout";
|
|
8
|
-
import { Text } from "../../../../../ui/components/Typography";
|
|
9
|
-
export function PhysicalLocationModal({ count, onSave, onClose }) {
|
|
10
|
-
const [zone, setZone] = useState("");
|
|
11
|
-
const [shelf, setShelf] = useState("");
|
|
12
|
-
const [bin, setBin] = useState("");
|
|
13
|
-
const [saving, setSaving] = useState(false);
|
|
14
|
-
const [error, setError] = useState("");
|
|
15
|
-
const handleSave = async () => {
|
|
16
|
-
setSaving(true);
|
|
17
|
-
setError("");
|
|
18
|
-
try {
|
|
19
|
-
await onSave({ zone: zone.trim(), shelf: shelf.trim(), bin: bin.trim() });
|
|
20
|
-
onClose();
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
setError(e instanceof Error ? e.message : "Failed to save location");
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
setSaving(false);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return (_jsx(Modal, { isOpen: true, onClose: onClose, title: `Set Location — ${count} item${count !== 1 ? "s" : ""}`, size: "sm", actions: _jsxs(Row, { gap: "sm", justify: "end", children: [_jsx(Button, { variant: "ghost", onClick: onClose, disabled: saving, children: "Cancel" }), _jsx(Button, { variant: "primary", onClick: handleSave, disabled: saving, children: saving ? "Saving..." : "Save" })] }), children: _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [_jsx(Text, { variant: "muted", children: "Assign a physical storage location to the selected items. All fields are optional." }), _jsx(Input, { label: "Zone (e.g. A, B, Storage-1)", value: zone, onChange: e => setZone(e.target.value), placeholder: "A" }), _jsx(Input, { label: "Shelf (e.g. 3, Top, Middle)", value: shelf, onChange: e => setShelf(e.target.value), placeholder: "3" }), _jsx(Input, { label: "Bin (e.g. Blue, Box-12)", value: bin, onChange: e => setBin(e.target.value), placeholder: "Blue" }), error && _jsx(Text, { variant: "error", children: error })] }) }));
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ProductItem } from "../../../../../features/products/types";
|
|
2
|
-
import { type OrderForLabel } from "./OrderPackingLabel";
|
|
3
|
-
import { type StoreForCard } from "./StoreCard";
|
|
4
|
-
export interface PrintCenterViewProps {
|
|
5
|
-
store: StoreForCard | null;
|
|
6
|
-
publicBaseUrl: string;
|
|
7
|
-
isAdmin?: boolean;
|
|
8
|
-
initialProducts?: ProductItem[];
|
|
9
|
-
initialOrders?: OrderForLabel[];
|
|
10
|
-
brandName?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function PrintCenterView({ store, publicBaseUrl, isAdmin, initialProducts, initialOrders, brandName, }: PrintCenterViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect, useCallback } from "react";
|
|
4
|
-
import { Tabs, TabsList, TabsTrigger, TabsContent } from "../../../../../ui/components/Tabs";
|
|
5
|
-
import { Button } from "../../../../../ui/components/Button";
|
|
6
|
-
import { Input } from "../../../../../ui/components/Input";
|
|
7
|
-
import { Text } from "../../../../../ui/components/Typography";
|
|
8
|
-
import { Row } from "../../../../../ui/components/Layout";
|
|
9
|
-
import { DEFAULT_PRODUCT_LABEL_DESIGN, DEFAULT_ORDER_LABEL_DESIGN, DEFAULT_CARD_DESIGN, LABEL_DESIGN_STORAGE_KEY, } from "./types";
|
|
10
|
-
import { LabelDesignPicker } from "./LabelDesignPicker";
|
|
11
|
-
import { PrintGrid } from "./PrintGrid";
|
|
12
|
-
import { InventoryLabel } from "./InventoryLabel";
|
|
13
|
-
import { OrderPackingLabel } from "./OrderPackingLabel";
|
|
14
|
-
import { StoreCard } from "./StoreCard";
|
|
15
|
-
import { WebsiteCard } from "./WebsiteCard";
|
|
16
|
-
import { useInventoryPdf } from "./useInventoryPdf";
|
|
17
|
-
function loadSavedDesign(def) {
|
|
18
|
-
try {
|
|
19
|
-
const raw = localStorage.getItem(LABEL_DESIGN_STORAGE_KEY);
|
|
20
|
-
if (raw)
|
|
21
|
-
return { ...def, ...JSON.parse(raw) };
|
|
22
|
-
}
|
|
23
|
-
catch { /* noop */ }
|
|
24
|
-
return def;
|
|
25
|
-
}
|
|
26
|
-
async function generateLabelData(id, qrUrl) {
|
|
27
|
-
try {
|
|
28
|
-
const [qrcode, jsbarcodeModule] = await Promise.all([
|
|
29
|
-
import("qrcode"),
|
|
30
|
-
import("jsbarcode"),
|
|
31
|
-
]);
|
|
32
|
-
const JsBarcode = jsbarcodeModule.default;
|
|
33
|
-
const qrDataUrl = await qrcode.toDataURL(qrUrl, { width: 80, margin: 1 });
|
|
34
|
-
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
35
|
-
JsBarcode(svg, id, { format: "CODE128", width: 1, height: 25, displayValue: false });
|
|
36
|
-
const barcodeDataUrl = "data:image/svg+xml;base64," + btoa(new XMLSerializer().serializeToString(svg));
|
|
37
|
-
return { qrDataUrl, barcodeDataUrl };
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export function PrintCenterView({ store, publicBaseUrl, isAdmin = false, initialProducts = [], initialOrders = [], brandName = "", }) {
|
|
44
|
-
const [tab, setTab] = useState("products");
|
|
45
|
-
const [productDesign, setProductDesign] = useState(() => loadSavedDesign(DEFAULT_PRODUCT_LABEL_DESIGN));
|
|
46
|
-
const [orderDesign, setOrderDesign] = useState(DEFAULT_ORDER_LABEL_DESIGN);
|
|
47
|
-
const [cardDesign, setCardDesign] = useState(DEFAULT_CARD_DESIGN);
|
|
48
|
-
const [selectedProductIds, setSelectedProductIds] = useState(new Set());
|
|
49
|
-
const [selectedOrderIds, setSelectedOrderIds] = useState(new Set());
|
|
50
|
-
const [storeCardCopies, setStoreCardCopies] = useState(1);
|
|
51
|
-
const [websiteCardCopies, setWebsiteCardCopies] = useState(1);
|
|
52
|
-
const [labelCache, setLabelCache] = useState({});
|
|
53
|
-
const [showGrid, setShowGrid] = useState(false);
|
|
54
|
-
const [printMode, setPrintMode] = useState("products");
|
|
55
|
-
const selectedProducts = initialProducts.filter(p => selectedProductIds.has(p.id));
|
|
56
|
-
const selectedOrders = initialOrders.filter(o => selectedOrderIds.has(o.id));
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
const items = [
|
|
59
|
-
...initialProducts.map(p => ({ id: p.id, url: `${publicBaseUrl}/products/${p.id}` })),
|
|
60
|
-
...initialOrders.map(o => ({ id: o.id, url: `${publicBaseUrl}/store/orders/${o.id}/view` })),
|
|
61
|
-
...(store ? [{ id: store.id, url: `${publicBaseUrl}/stores/${store.id}` }] : []),
|
|
62
|
-
];
|
|
63
|
-
for (const item of items) {
|
|
64
|
-
if (labelCache[item.id])
|
|
65
|
-
continue;
|
|
66
|
-
generateLabelData(item.id, item.url).then(data => setLabelCache(prev => ({ ...prev, [item.id]: data })));
|
|
67
|
-
}
|
|
68
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
|
-
}, [initialProducts.length, initialOrders.length, store?.id, publicBaseUrl]);
|
|
70
|
-
const { downloadPdf: dlProducts, isGenerating: genProducts } = useInventoryPdf({ products: selectedProducts, design: productDesign, publicBaseUrl, brandName });
|
|
71
|
-
const { downloadPdf: dlOrders, isGenerating: genOrders } = useInventoryPdf({ orders: selectedOrders, design: orderDesign, publicBaseUrl, brandName });
|
|
72
|
-
const { downloadPdf: dlStore, isGenerating: genStore } = useInventoryPdf({ storeCards: store ? Array(storeCardCopies).fill(store) : [], design: cardDesign, publicBaseUrl, brandName });
|
|
73
|
-
const { downloadPdf: dlWebsite, isGenerating: genWebsite } = useInventoryPdf({ websiteCards: store ? Array(websiteCardCopies).fill(store) : [], design: cardDesign, publicBaseUrl, brandName });
|
|
74
|
-
const toggleProduct = useCallback((id) => {
|
|
75
|
-
setSelectedProductIds(prev => { const s = new Set(prev); if (s.has(id))
|
|
76
|
-
s.delete(id);
|
|
77
|
-
else
|
|
78
|
-
s.add(id); return s; });
|
|
79
|
-
}, []);
|
|
80
|
-
const toggleOrder = useCallback((id) => {
|
|
81
|
-
setSelectedOrderIds(prev => { const s = new Set(prev); if (s.has(id))
|
|
82
|
-
s.delete(id);
|
|
83
|
-
else
|
|
84
|
-
s.add(id); return s; });
|
|
85
|
-
}, []);
|
|
86
|
-
if (showGrid && printMode === "products") {
|
|
87
|
-
return _jsx(PrintGrid, { items: selectedProducts.map(p => _jsx(InventoryLabel, { product: p, publicBaseUrl: publicBaseUrl, design: productDesign, qrDataUrl: labelCache[p.id]?.qrDataUrl, barcodeDataUrl: labelCache[p.id]?.barcodeDataUrl }, p.id)), columns: 4, onBack: () => setShowGrid(false), onDownloadPdf: dlProducts, isGeneratingPdf: genProducts });
|
|
88
|
-
}
|
|
89
|
-
if (showGrid && printMode === "orders") {
|
|
90
|
-
return _jsx(PrintGrid, { items: selectedOrders.map(o => _jsx(OrderPackingLabel, { order: o, storeBaseUrl: publicBaseUrl, design: orderDesign, qrDataUrl: labelCache[o.id]?.qrDataUrl, barcodeDataUrl: labelCache[o.id]?.barcodeDataUrl }, o.id)), columns: 4, onBack: () => setShowGrid(false), onDownloadPdf: dlOrders, isGeneratingPdf: genOrders });
|
|
91
|
-
}
|
|
92
|
-
if (showGrid && printMode === "store" && store) {
|
|
93
|
-
return _jsx(PrintGrid, { items: Array.from({ length: storeCardCopies }, (_, i) => _jsx(StoreCard, { store: store, publicBaseUrl: publicBaseUrl, design: cardDesign, qrDataUrl: labelCache[store.id]?.qrDataUrl, barcodeDataUrl: labelCache[store.id]?.barcodeDataUrl }, i)), columns: 4, onBack: () => setShowGrid(false), onDownloadPdf: dlStore, isGeneratingPdf: genStore });
|
|
94
|
-
}
|
|
95
|
-
if (showGrid && printMode === "website" && store) {
|
|
96
|
-
return _jsx(PrintGrid, { items: Array.from({ length: websiteCardCopies }, (_, i) => _jsx(WebsiteCard, { store: store, publicBaseUrl: publicBaseUrl, design: cardDesign, qrDataUrl: labelCache[store.id]?.qrDataUrl, brandName: brandName }, i)), columns: 4, onBack: () => setShowGrid(false), onDownloadPdf: dlWebsite, isGeneratingPdf: genWebsite });
|
|
97
|
-
}
|
|
98
|
-
const PANEL_STYLE = { border: "1px solid #e5e7eb", borderRadius: "6px", overflow: "hidden" };
|
|
99
|
-
const PANEL_HEAD = { padding: "12px", borderBottom: "1px solid #e5e7eb", fontWeight: 600, fontSize: "13px" };
|
|
100
|
-
const GRID_LAYOUT = { display: "grid", gridTemplateColumns: "1fr 280px", gap: "16px", marginTop: "16px" };
|
|
101
|
-
return (_jsxs("div", { style: { maxWidth: "960px" }, children: [isAdmin && (_jsxs("div", { style: { marginBottom: "16px", padding: "12px", background: "var(--appkit-color-primary, #6d28d9)", color: "#fff", borderRadius: "6px", fontSize: "13px" }, children: ["Admin mode \u2014 generating materials for: ", store?.storeName ?? "all stores"] })), _jsxs(Tabs, { value: tab, onChange: setTab, children: [_jsxs(TabsList, { children: [_jsx(TabsTrigger, { value: "products", children: "Product Labels" }), _jsx(TabsTrigger, { value: "orders", children: "Packing Slips" }), _jsx(TabsTrigger, { value: "store", children: "Store Cards" }), _jsx(TabsTrigger, { value: "website", children: "Website Cards" })] }), _jsx(TabsContent, { value: "products", children: _jsxs("div", { style: GRID_LAYOUT, children: [_jsxs("div", { style: { minWidth: 0 }, children: [_jsxs(Text, { variant: "muted", style: { marginBottom: "8px", display: "block" }, children: ["Select products (", selectedProductIds.size, " selected)"] }), _jsxs("div", { style: PANEL_STYLE, children: [initialProducts.length === 0 && (_jsx("div", { style: { padding: "24px", textAlign: "center", color: "#9ca3af" }, children: "No products loaded" })), initialProducts.map(p => (_jsxs("label", { style: { display: "flex", alignItems: "center", gap: "10px", padding: "10px 14px", borderBottom: "1px solid #f3f4f6", cursor: "pointer", background: selectedProductIds.has(p.id) ? "#f5f3ff" : "#fff" }, children: [_jsx("input", { type: "checkbox", checked: selectedProductIds.has(p.id), onChange: () => toggleProduct(p.id) }), _jsx("span", { style: { flex: 1, fontSize: "13px", fontWeight: 500 }, children: p.title }), _jsx("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: p.listingType ?? "standard" }), p.physicalLocation && (_jsxs("span", { style: { fontSize: "11px", color: "#6b7280", background: "#f3f4f6", padding: "2px 6px", borderRadius: "4px" }, children: [p.physicalLocation.zone, "/", p.physicalLocation.shelf, "/", p.physicalLocation.bin] }))] }, p.id)))] }), initialProducts.length > 0 && (_jsxs(Row, { gap: "sm", style: { marginTop: "6px" }, children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setSelectedProductIds(new Set(initialProducts.map(p => p.id))), children: "All" }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setSelectedProductIds(new Set()), children: "Clear" })] })), _jsxs(Row, { gap: "sm", style: { marginTop: "12px" }, children: [_jsxs(Button, { variant: "primary", disabled: selectedProductIds.size === 0, onClick: () => { setPrintMode("products"); setShowGrid(true); }, children: ["Print", selectedProductIds.size > 0 ? ` (${selectedProductIds.size})` : ""] }), _jsx(Button, { variant: "outline", disabled: selectedProductIds.size === 0 || genProducts, onClick: dlProducts, children: genProducts ? "Generating..." : "Download PDF" })] })] }), _jsxs("div", { style: PANEL_STYLE, children: [_jsx("div", { style: PANEL_HEAD, children: "Label Design" }), _jsx(LabelDesignPicker, { value: productDesign, onChange: setProductDesign })] })] }) }), _jsx(TabsContent, { value: "orders", children: _jsxs("div", { style: GRID_LAYOUT, children: [_jsxs("div", { style: { minWidth: 0 }, children: [_jsxs(Text, { variant: "muted", style: { marginBottom: "8px", display: "block" }, children: ["Select orders (", selectedOrderIds.size, " selected)"] }), _jsxs("div", { style: PANEL_STYLE, children: [initialOrders.length === 0 && (_jsx("div", { style: { padding: "24px", textAlign: "center", color: "#9ca3af" }, children: "No orders loaded" })), initialOrders.map(o => (_jsxs("label", { style: { display: "flex", alignItems: "center", gap: "10px", padding: "10px 14px", borderBottom: "1px solid #f3f4f6", cursor: "pointer", background: selectedOrderIds.has(o.id) ? "#f5f3ff" : "#fff" }, children: [_jsx("input", { type: "checkbox", checked: selectedOrderIds.has(o.id), onChange: () => toggleOrder(o.id) }), _jsx("span", { style: { flex: 1, fontSize: "13px", fontWeight: 500 }, children: o.id }), _jsxs("span", { style: { fontSize: "11px", color: "#9ca3af" }, children: [o.items.length, " item", o.items.length !== 1 ? "s" : ""] })] }, o.id)))] }), initialOrders.length > 0 && (_jsxs(Row, { gap: "sm", style: { marginTop: "6px" }, children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setSelectedOrderIds(new Set(initialOrders.map(o => o.id))), children: "All" }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setSelectedOrderIds(new Set()), children: "Clear" })] })), _jsxs(Row, { gap: "sm", style: { marginTop: "12px" }, children: [_jsxs(Button, { variant: "primary", disabled: selectedOrderIds.size === 0, onClick: () => { setPrintMode("orders"); setShowGrid(true); }, children: ["Print", selectedOrderIds.size > 0 ? ` (${selectedOrderIds.size})` : ""] }), _jsx(Button, { variant: "outline", disabled: selectedOrderIds.size === 0 || genOrders, onClick: dlOrders, children: genOrders ? "Generating..." : "Download PDF" })] })] }), _jsxs("div", { style: PANEL_STYLE, children: [_jsx("div", { style: PANEL_HEAD, children: "Label Design" }), _jsx(LabelDesignPicker, { value: orderDesign, onChange: setOrderDesign })] })] }) }), _jsx(TabsContent, { value: "store", children: _jsxs("div", { style: GRID_LAYOUT, children: [_jsx("div", { style: { minWidth: 0 }, children: !store ? (_jsx(Text, { variant: "muted", children: "No store data available." })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { variant: "muted", style: { marginBottom: "12px", display: "block" }, children: ["Business cards for ", _jsx("strong", { children: store.storeName })] }), _jsxs(Row, { gap: "sm", style: { alignItems: "center", marginBottom: "16px" }, children: [_jsx("span", { style: { fontSize: "13px", fontWeight: 500 }, children: "Copies:" }), _jsx(Input, { type: "number", value: storeCardCopies, onChange: e => setStoreCardCopies(Math.max(1, Math.min(100, Number(e.target.value)))), style: { width: "80px" } })] }), _jsx("div", { style: { marginBottom: "16px" }, children: _jsx(StoreCard, { store: store, publicBaseUrl: publicBaseUrl, design: cardDesign, qrDataUrl: labelCache[store.id]?.qrDataUrl, barcodeDataUrl: labelCache[store.id]?.barcodeDataUrl }) }), _jsxs(Row, { gap: "sm", children: [_jsxs(Button, { variant: "primary", onClick: () => { setPrintMode("store"); setShowGrid(true); }, children: ["Print ", storeCardCopies, " card", storeCardCopies !== 1 ? "s" : ""] }), _jsx(Button, { variant: "outline", disabled: genStore, onClick: dlStore, children: genStore ? "Generating..." : "Download PDF" })] })] })) }), _jsxs("div", { style: PANEL_STYLE, children: [_jsx("div", { style: PANEL_HEAD, children: "Card Design" }), _jsx(LabelDesignPicker, { value: cardDesign, onChange: setCardDesign })] })] }) }), _jsx(TabsContent, { value: "website", children: _jsxs("div", { style: GRID_LAYOUT, children: [_jsx("div", { style: { minWidth: 0 }, children: !store ? (_jsx(Text, { variant: "muted", children: "No store data available." })) : (_jsxs(_Fragment, { children: [_jsx(Text, { variant: "muted", style: { marginBottom: "12px", display: "block" }, children: "Promotional cards to hand out at physical stalls and events." }), _jsxs(Row, { gap: "sm", style: { alignItems: "center", marginBottom: "16px" }, children: [_jsx("span", { style: { fontSize: "13px", fontWeight: 500 }, children: "Copies:" }), _jsx(Input, { type: "number", value: websiteCardCopies, onChange: e => setWebsiteCardCopies(Math.max(1, Math.min(100, Number(e.target.value)))), style: { width: "80px" } })] }), _jsx("div", { style: { marginBottom: "16px" }, children: _jsx(WebsiteCard, { store: store, publicBaseUrl: publicBaseUrl, design: cardDesign, qrDataUrl: labelCache[store.id]?.qrDataUrl, brandName: brandName }) }), _jsxs(Row, { gap: "sm", children: [_jsxs(Button, { variant: "primary", onClick: () => { setPrintMode("website"); setShowGrid(true); }, children: ["Print ", websiteCardCopies, " card", websiteCardCopies !== 1 ? "s" : ""] }), _jsx(Button, { variant: "outline", disabled: genWebsite, onClick: dlWebsite, children: genWebsite ? "Generating..." : "Download PDF" })] })] })) }), _jsxs("div", { style: PANEL_STYLE, children: [_jsx("div", { style: PANEL_HEAD, children: "Card Design" }), _jsx(LabelDesignPicker, { value: cardDesign, onChange: setCardDesign })] })] }) })] })] }));
|
|
102
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface PrintGridProps {
|
|
3
|
-
items: React.ReactNode[];
|
|
4
|
-
columns?: 2 | 4;
|
|
5
|
-
pageSize?: "A4" | "Letter" | "Label";
|
|
6
|
-
autoprint?: boolean;
|
|
7
|
-
onBack?: () => void;
|
|
8
|
-
onDownloadPdf?: () => void;
|
|
9
|
-
isGeneratingPdf?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function PrintGrid({ items, columns, autoprint, onBack, onDownloadPdf, isGeneratingPdf }: PrintGridProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
import { Button } from "../../../../../ui/components/Button";
|
|
5
|
-
export function PrintGrid({ items, columns = 4, autoprint = false, onBack, onDownloadPdf, isGeneratingPdf = false }) {
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
if (!autoprint || items.length === 0)
|
|
8
|
-
return;
|
|
9
|
-
const t = setTimeout(() => window.print(), 500);
|
|
10
|
-
return () => clearTimeout(t);
|
|
11
|
-
}, [autoprint, items.length]);
|
|
12
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "appkit-print-hide", style: { display: "flex", gap: "8px", marginBottom: "16px", alignItems: "center" }, children: [onBack && _jsx(Button, { variant: "ghost", onClick: onBack, children: "Back" }), _jsx(Button, { variant: "outline", onClick: () => window.print(), children: "Print" }), onDownloadPdf && (_jsx(Button, { variant: "primary", onClick: onDownloadPdf, disabled: isGeneratingPdf, children: isGeneratingPdf ? "Generating..." : "Download PDF" }))] }), _jsx("style", { children: `@media print { .appkit-print-hide { display: none !important; } body { margin: 0; } }` }), _jsx("div", { style: { display: "grid", gridTemplateColumns: `repeat(${columns}, auto)`, gap: "4mm", justifyContent: "start" }, children: items.map((item, i) => (_jsx("div", { style: { pageBreakInside: "avoid" }, children: item }, i))) })] }));
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { LabelDesign } from "./types";
|
|
2
|
-
export interface StoreForCard {
|
|
3
|
-
id: string;
|
|
4
|
-
storeName: string;
|
|
5
|
-
storeDescription?: string;
|
|
6
|
-
storeLogoURL?: string;
|
|
7
|
-
storeCategory?: string;
|
|
8
|
-
primaryAddress?: string;
|
|
9
|
-
}
|
|
10
|
-
interface StoreCardProps {
|
|
11
|
-
store: StoreForCard;
|
|
12
|
-
publicBaseUrl: string;
|
|
13
|
-
design: LabelDesign;
|
|
14
|
-
qrDataUrl?: string;
|
|
15
|
-
barcodeDataUrl?: string;
|
|
16
|
-
brandName?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare function StoreCard({ store, publicBaseUrl, design, qrDataUrl, barcodeDataUrl, brandName }: StoreCardProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export function StoreCard({ store, publicBaseUrl, design, qrDataUrl, barcodeDataUrl, brandName }) {
|
|
4
|
-
const { size, show, colorScheme } = design;
|
|
5
|
-
const isDark = colorScheme === "dark";
|
|
6
|
-
const bg = isDark ? "#1a1a1a" : "#ffffff";
|
|
7
|
-
const fg = isDark ? "#f5f5f5" : "#111111";
|
|
8
|
-
const muted = isDark ? "#999999" : "#666666";
|
|
9
|
-
const border = isDark ? "#333333" : "#e5e5e5";
|
|
10
|
-
const desc = store.storeDescription
|
|
11
|
-
? store.storeDescription.slice(0, 80) + (store.storeDescription.length > 80 ? "..." : "")
|
|
12
|
-
: null;
|
|
13
|
-
return (_jsxs("div", { style: {
|
|
14
|
-
width: `${size.widthMm}mm`,
|
|
15
|
-
height: `${size.heightMm}mm`,
|
|
16
|
-
background: bg,
|
|
17
|
-
color: fg,
|
|
18
|
-
border: `1px solid ${border}`,
|
|
19
|
-
borderRadius: "3px",
|
|
20
|
-
padding: "3mm",
|
|
21
|
-
fontFamily: "sans-serif",
|
|
22
|
-
fontSize: "7pt",
|
|
23
|
-
display: "flex",
|
|
24
|
-
flexDirection: "column",
|
|
25
|
-
gap: "1.5mm",
|
|
26
|
-
overflow: "hidden",
|
|
27
|
-
boxSizing: "border-box",
|
|
28
|
-
pageBreakInside: "avoid",
|
|
29
|
-
}, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2mm" }, children: [show.logo && store.storeLogoURL && (_jsx("img", { src: store.storeLogoURL, alt: store.storeName, style: { width: "8mm", height: "8mm", borderRadius: "2px", objectFit: "cover" } })), _jsxs(_Fragment, { children: [_jsx("div", { style: { fontWeight: 700, fontSize: "9pt" }, children: store.storeName }), store.storeCategory && _jsx("div", { style: { fontSize: "6pt", color: muted }, children: store.storeCategory })] })] }), desc && _jsx("div", { style: { fontSize: "6pt", color: muted, flex: 1 }, children: desc }), store.primaryAddress && _jsx("div", { style: { fontSize: "6pt", color: muted }, children: store.primaryAddress }), (show.barcode || qrDataUrl) && (_jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginTop: "auto" }, children: [show.barcode && barcodeDataUrl && (_jsx("img", { src: barcodeDataUrl, alt: "barcode", style: { height: "7mm", maxWidth: "55%" } })), qrDataUrl && _jsx("img", { src: qrDataUrl, alt: "qr", style: { width: "12mm", height: "12mm" } })] })), brandName && (_jsxs("div", { style: { fontSize: "5pt", color: muted, textAlign: "center", borderTop: `1px solid ${border}`, paddingTop: "1mm" }, children: [brandName, " \u00B7 ", publicBaseUrl.replace(/^https?:\/\//, "")] }))] }));
|
|
30
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { StoreForCard } from "./StoreCard";
|
|
2
|
-
import type { LabelDesign } from "./types";
|
|
3
|
-
interface WebsiteCardProps {
|
|
4
|
-
store: StoreForCard;
|
|
5
|
-
publicBaseUrl: string;
|
|
6
|
-
design: LabelDesign;
|
|
7
|
-
qrDataUrl?: string;
|
|
8
|
-
brandName?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function WebsiteCard({ store, publicBaseUrl, design, qrDataUrl, brandName }: WebsiteCardProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export function WebsiteCard({ store, publicBaseUrl, design, qrDataUrl, brandName = "" }) {
|
|
4
|
-
const { size, colorScheme } = design;
|
|
5
|
-
const isDark = colorScheme === "dark";
|
|
6
|
-
const bg = isDark ? "#2d1b69" : "#6d28d9";
|
|
7
|
-
return (_jsxs("div", { style: {
|
|
8
|
-
width: `${size.widthMm}mm`,
|
|
9
|
-
height: `${size.heightMm}mm`,
|
|
10
|
-
background: bg,
|
|
11
|
-
color: "#ffffff",
|
|
12
|
-
borderRadius: "3px",
|
|
13
|
-
padding: "3mm",
|
|
14
|
-
fontFamily: "sans-serif",
|
|
15
|
-
fontSize: "7pt",
|
|
16
|
-
display: "flex",
|
|
17
|
-
flexDirection: "column",
|
|
18
|
-
alignItems: "center",
|
|
19
|
-
justifyContent: "space-between",
|
|
20
|
-
overflow: "hidden",
|
|
21
|
-
boxSizing: "border-box",
|
|
22
|
-
pageBreakInside: "avoid",
|
|
23
|
-
textAlign: "center",
|
|
24
|
-
}, children: [brandName && _jsx("div", { style: { fontWeight: 800, fontSize: "11pt", letterSpacing: "0.05em" }, children: brandName }), qrDataUrl && (_jsx("img", { src: qrDataUrl, alt: "qr", style: { width: "16mm", height: "16mm", background: "#fff", padding: "1mm", borderRadius: "2px" } })), _jsxs("div", { style: { textAlign: "center" }, children: [_jsx("div", { style: { fontSize: "8pt", fontWeight: 600 }, children: "Scan to shop" }), _jsxs("div", { style: { fontSize: "6pt", color: "rgba(255,255,255,0.75)" }, children: [store.storeName, brandName ? ` on ${brandName}` : ""] }), _jsx("div", { style: { fontSize: "5pt", color: "rgba(255,255,255,0.55)", marginTop: "0.5mm" }, children: publicBaseUrl.replace(/^https?:\/\//, "") })] })] }));
|
|
25
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { InventoryLabel } from "./InventoryLabel";
|
|
2
|
-
export { OrderPackingLabel, type OrderForLabel } from "./OrderPackingLabel";
|
|
3
|
-
export { StoreCard } from "./StoreCard";
|
|
4
|
-
export { WebsiteCard } from "./WebsiteCard";
|
|
5
|
-
export { LabelDesignPicker } from "./LabelDesignPicker";
|
|
6
|
-
export { PrintGrid } from "./PrintGrid";
|
|
7
|
-
export { PhysicalLocationModal } from "./PhysicalLocationModal";
|
|
8
|
-
export { PrintCenterView } from "./PrintCenterView";
|
|
9
|
-
export { useInventoryPdf } from "./useInventoryPdf";
|
|
10
|
-
export type { LabelDesign } from "./types";
|
|
11
|
-
export { DEFAULT_PRODUCT_LABEL_DESIGN, DEFAULT_ORDER_LABEL_DESIGN, DEFAULT_CARD_DESIGN, LABEL_DESIGN_STORAGE_KEY, } from "./types";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { InventoryLabel } from "./InventoryLabel";
|
|
2
|
-
export { OrderPackingLabel } from "./OrderPackingLabel";
|
|
3
|
-
export { StoreCard } from "./StoreCard";
|
|
4
|
-
export { WebsiteCard } from "./WebsiteCard";
|
|
5
|
-
export { LabelDesignPicker } from "./LabelDesignPicker";
|
|
6
|
-
export { PrintGrid } from "./PrintGrid";
|
|
7
|
-
export { PhysicalLocationModal } from "./PhysicalLocationModal";
|
|
8
|
-
export { PrintCenterView } from "./PrintCenterView";
|
|
9
|
-
export { useInventoryPdf } from "./useInventoryPdf";
|
|
10
|
-
export { DEFAULT_PRODUCT_LABEL_DESIGN, DEFAULT_ORDER_LABEL_DESIGN, DEFAULT_CARD_DESIGN, LABEL_DESIGN_STORAGE_KEY, } from "./types";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface LabelDesign {
|
|
2
|
-
template: "minimal" | "detailed" | "branded";
|
|
3
|
-
colorScheme: "light" | "dark" | "store-primary";
|
|
4
|
-
size: {
|
|
5
|
-
widthMm: number;
|
|
6
|
-
heightMm: number;
|
|
7
|
-
};
|
|
8
|
-
show: {
|
|
9
|
-
logo: boolean;
|
|
10
|
-
price: boolean;
|
|
11
|
-
stock: boolean;
|
|
12
|
-
barcode: boolean;
|
|
13
|
-
location: boolean;
|
|
14
|
-
listingTypeBadge: boolean;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export declare const LABEL_DESIGN_STORAGE_KEY = "print-center:label-design";
|
|
18
|
-
export declare const DEFAULT_PRODUCT_LABEL_DESIGN: LabelDesign;
|
|
19
|
-
export declare const DEFAULT_ORDER_LABEL_DESIGN: LabelDesign;
|
|
20
|
-
export declare const DEFAULT_CARD_DESIGN: LabelDesign;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
export const LABEL_DESIGN_STORAGE_KEY = "print-center:label-design";
|
|
3
|
-
export const DEFAULT_PRODUCT_LABEL_DESIGN = {
|
|
4
|
-
template: "detailed",
|
|
5
|
-
colorScheme: "light",
|
|
6
|
-
size: { widthMm: 62, heightMm: 38 },
|
|
7
|
-
show: { logo: true, price: true, stock: true, barcode: true, location: true, listingTypeBadge: true },
|
|
8
|
-
};
|
|
9
|
-
export const DEFAULT_ORDER_LABEL_DESIGN = {
|
|
10
|
-
template: "detailed",
|
|
11
|
-
colorScheme: "light",
|
|
12
|
-
size: { widthMm: 100, heightMm: 70 },
|
|
13
|
-
show: { logo: true, price: false, stock: false, barcode: true, location: true, listingTypeBadge: false },
|
|
14
|
-
};
|
|
15
|
-
export const DEFAULT_CARD_DESIGN = {
|
|
16
|
-
template: "branded",
|
|
17
|
-
colorScheme: "light",
|
|
18
|
-
size: { widthMm: 85, heightMm: 54 },
|
|
19
|
-
show: { logo: true, price: false, stock: false, barcode: true, location: false, listingTypeBadge: false },
|
|
20
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ProductItem } from "../../../../../features/products/types";
|
|
2
|
-
import type { OrderForLabel } from "./OrderPackingLabel";
|
|
3
|
-
import type { StoreForCard } from "./StoreCard";
|
|
4
|
-
import type { LabelDesign } from "./types";
|
|
5
|
-
interface UseInventoryPdfOptions {
|
|
6
|
-
products?: ProductItem[];
|
|
7
|
-
orders?: OrderForLabel[];
|
|
8
|
-
storeCards?: StoreForCard[];
|
|
9
|
-
websiteCards?: StoreForCard[];
|
|
10
|
-
design: LabelDesign;
|
|
11
|
-
publicBaseUrl: string;
|
|
12
|
-
brandName?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function useInventoryPdf({ products, orders, storeCards, websiteCards, design, publicBaseUrl, brandName, }: UseInventoryPdfOptions): {
|
|
15
|
-
downloadPdf: () => Promise<void>;
|
|
16
|
-
isGenerating: boolean;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState, useCallback } from "react";
|
|
3
|
-
const MM_TO_PT = 2.8346;
|
|
4
|
-
export function useInventoryPdf({ products = [], orders = [], storeCards = [], websiteCards = [], design, publicBaseUrl, brandName = "", }) {
|
|
5
|
-
const [isGenerating, setIsGenerating] = useState(false);
|
|
6
|
-
const downloadPdf = useCallback(async () => {
|
|
7
|
-
setIsGenerating(true);
|
|
8
|
-
try {
|
|
9
|
-
const [{ jsPDF }, qrcode, jsbarcodeModule] = await Promise.all([
|
|
10
|
-
import("jspdf"),
|
|
11
|
-
import("qrcode"),
|
|
12
|
-
import("jsbarcode"),
|
|
13
|
-
]);
|
|
14
|
-
const JsBarcode = jsbarcodeModule.default;
|
|
15
|
-
const wPt = design.size.widthMm * MM_TO_PT;
|
|
16
|
-
const hPt = design.size.heightMm * MM_TO_PT;
|
|
17
|
-
const pdf = new jsPDF({
|
|
18
|
-
orientation: wPt > hPt ? "landscape" : "portrait",
|
|
19
|
-
unit: "pt",
|
|
20
|
-
format: [wPt, hPt],
|
|
21
|
-
});
|
|
22
|
-
let isFirst = true;
|
|
23
|
-
const genQr = (url) => qrcode.toDataURL(url, { width: 80, margin: 1 });
|
|
24
|
-
const genBarcode = (value) => {
|
|
25
|
-
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
26
|
-
JsBarcode(svg, value, { format: "CODE128", width: 1, height: 25, displayValue: false });
|
|
27
|
-
const xml = new XMLSerializer().serializeToString(svg);
|
|
28
|
-
return "data:image/svg+xml;base64," + btoa(xml);
|
|
29
|
-
};
|
|
30
|
-
const addPage = async (title, subtitle, qrUrl, barcodeValue, id) => {
|
|
31
|
-
if (!isFirst)
|
|
32
|
-
pdf.addPage([wPt, hPt]);
|
|
33
|
-
isFirst = false;
|
|
34
|
-
const qr = await genQr(qrUrl);
|
|
35
|
-
const barSvg = genBarcode(barcodeValue);
|
|
36
|
-
pdf.setFontSize(6);
|
|
37
|
-
pdf.setTextColor(150, 150, 150);
|
|
38
|
-
if (brandName)
|
|
39
|
-
pdf.text(brandName, 5, 9);
|
|
40
|
-
pdf.setFontSize(8);
|
|
41
|
-
pdf.setTextColor(20, 20, 20);
|
|
42
|
-
pdf.text(title.slice(0, 50), 5, 18);
|
|
43
|
-
if (subtitle) {
|
|
44
|
-
pdf.setFontSize(6);
|
|
45
|
-
pdf.setTextColor(100, 100, 100);
|
|
46
|
-
pdf.text(subtitle.slice(0, 60), 5, 25);
|
|
47
|
-
}
|
|
48
|
-
if (design.show.barcode) {
|
|
49
|
-
pdf.addImage(barSvg, "SVG", 5, hPt - 20, wPt * 0.6, 12);
|
|
50
|
-
}
|
|
51
|
-
pdf.addImage(qr, "PNG", wPt - 30, hPt - 32, 26, 26);
|
|
52
|
-
pdf.setFontSize(5);
|
|
53
|
-
pdf.setTextColor(180, 180, 180);
|
|
54
|
-
pdf.text(id, wPt / 2, hPt - 3, { align: "center" });
|
|
55
|
-
};
|
|
56
|
-
for (const p of products) {
|
|
57
|
-
const priceStr = p.price != null ? `Rs.${(p.price / 100).toFixed(2)}` : "";
|
|
58
|
-
await addPage(p.title, priceStr, `${publicBaseUrl}/products/${p.id}`, p.id, p.id);
|
|
59
|
-
}
|
|
60
|
-
for (const o of orders) {
|
|
61
|
-
await addPage(`Order: ${o.id}`, `${o.items.length} item(s)`, `${publicBaseUrl}/store/orders/${o.id}/view`, o.id, o.id);
|
|
62
|
-
}
|
|
63
|
-
for (const s of storeCards) {
|
|
64
|
-
await addPage(s.storeName, s.storeDescription?.slice(0, 60) ?? "", `${publicBaseUrl}/stores/${s.id}`, s.id, s.id);
|
|
65
|
-
}
|
|
66
|
-
for (const s of websiteCards) {
|
|
67
|
-
await addPage(brandName ? `${brandName} - ${s.storeName}` : s.storeName, "Scan to shop", `${publicBaseUrl}/stores/${s.id}`, s.id, s.id);
|
|
68
|
-
}
|
|
69
|
-
pdf.save(`labels-${Date.now()}.pdf`);
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
setIsGenerating(false);
|
|
73
|
-
}
|
|
74
|
-
}, [products, orders, storeCards, websiteCards, design, publicBaseUrl]);
|
|
75
|
-
return { downloadPdf, isGenerating };
|
|
76
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type AddressCreateInput, type AddressDocument, type AddressUpdateInput } from "../schemas";
|
|
2
|
-
export declare class AddressRepository {
|
|
3
|
-
private getCollection;
|
|
4
|
-
private decryptAddress;
|
|
5
|
-
private encryptAddressData;
|
|
6
|
-
findByUser(userId: string): Promise<AddressDocument[]>;
|
|
7
|
-
findById(userId: string, addressId: string): Promise<AddressDocument | null>;
|
|
8
|
-
findByIdOrFail(userId: string, addressId: string): Promise<AddressDocument>;
|
|
9
|
-
count(userId: string): Promise<number>;
|
|
10
|
-
create(userId: string, input: AddressCreateInput): Promise<AddressDocument>;
|
|
11
|
-
update(userId: string, addressId: string, input: AddressUpdateInput): Promise<AddressDocument>;
|
|
12
|
-
delete(userId: string, addressId: string): Promise<void>;
|
|
13
|
-
setDefault(userId: string, addressId: string): Promise<AddressDocument>;
|
|
14
|
-
private clearDefaultFlag;
|
|
15
|
-
deleteAllByUser(userId: string): Promise<number>;
|
|
16
|
-
}
|
|
17
|
-
export declare const addressRepository: AddressRepository;
|