@rovela-ai/sdk 0.1.2 → 0.1.4
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/admin/api/auth.d.ts +32 -0
- package/dist/admin/api/auth.d.ts.map +1 -0
- package/dist/admin/api/auth.js +43 -0
- package/dist/admin/api/auth.js.map +1 -0
- package/dist/admin/api/categories.d.ts +68 -0
- package/dist/admin/api/categories.d.ts.map +1 -0
- package/dist/admin/api/categories.js +247 -0
- package/dist/admin/api/categories.js.map +1 -0
- package/dist/admin/api/customers.d.ts +41 -0
- package/dist/admin/api/customers.d.ts.map +1 -0
- package/dist/admin/api/customers.js +113 -0
- package/dist/admin/api/customers.js.map +1 -0
- package/dist/admin/api/index.d.ts +56 -0
- package/dist/admin/api/index.d.ts.map +1 -0
- package/dist/admin/api/index.js +87 -0
- package/dist/admin/api/index.js.map +1 -0
- package/dist/admin/api/orders.d.ts +59 -0
- package/dist/admin/api/orders.d.ts.map +1 -0
- package/dist/admin/api/orders.js +209 -0
- package/dist/admin/api/orders.js.map +1 -0
- package/dist/admin/api/products.d.ts +103 -0
- package/dist/admin/api/products.d.ts.map +1 -0
- package/dist/admin/api/products.js +329 -0
- package/dist/admin/api/products.js.map +1 -0
- package/dist/admin/api/refund.d.ts +29 -0
- package/dist/admin/api/refund.d.ts.map +1 -0
- package/dist/admin/api/refund.js +136 -0
- package/dist/admin/api/refund.js.map +1 -0
- package/dist/admin/api/stats.d.ts +40 -0
- package/dist/admin/api/stats.d.ts.map +1 -0
- package/dist/admin/api/stats.js +74 -0
- package/dist/admin/api/stats.js.map +1 -0
- package/dist/admin/components/AdminGuard.d.ts +40 -0
- package/dist/admin/components/AdminGuard.d.ts.map +1 -0
- package/dist/admin/components/AdminGuard.js +97 -0
- package/dist/admin/components/AdminGuard.js.map +1 -0
- package/dist/admin/components/AdminHeader.d.ts +18 -0
- package/dist/admin/components/AdminHeader.d.ts.map +1 -0
- package/dist/admin/components/AdminHeader.js +33 -0
- package/dist/admin/components/AdminHeader.js.map +1 -0
- package/dist/admin/components/AdminLayout.d.ts +50 -0
- package/dist/admin/components/AdminLayout.d.ts.map +1 -0
- package/dist/admin/components/AdminLayout.js +46 -0
- package/dist/admin/components/AdminLayout.js.map +1 -0
- package/dist/admin/components/AdminLoginForm.d.ts +18 -0
- package/dist/admin/components/AdminLoginForm.d.ts.map +1 -0
- package/dist/admin/components/AdminLoginForm.js +58 -0
- package/dist/admin/components/AdminLoginForm.js.map +1 -0
- package/dist/admin/components/AdminNav.d.ts +34 -0
- package/dist/admin/components/AdminNav.d.ts.map +1 -0
- package/dist/admin/components/AdminNav.js +61 -0
- package/dist/admin/components/AdminNav.js.map +1 -0
- package/dist/admin/components/InventoryEditor.d.ts +15 -0
- package/dist/admin/components/InventoryEditor.d.ts.map +1 -0
- package/dist/admin/components/InventoryEditor.js +83 -0
- package/dist/admin/components/InventoryEditor.js.map +1 -0
- package/dist/admin/components/LowStockAlert.d.ts +11 -0
- package/dist/admin/components/LowStockAlert.d.ts.map +1 -0
- package/dist/admin/components/LowStockAlert.js +35 -0
- package/dist/admin/components/LowStockAlert.js.map +1 -0
- package/dist/admin/components/OrderDetails.d.ts +14 -0
- package/dist/admin/components/OrderDetails.d.ts.map +1 -0
- package/dist/admin/components/OrderDetails.js +94 -0
- package/dist/admin/components/OrderDetails.js.map +1 -0
- package/dist/admin/components/OrderTable.d.ts +13 -0
- package/dist/admin/components/OrderTable.d.ts.map +1 -0
- package/dist/admin/components/OrderTable.js +89 -0
- package/dist/admin/components/OrderTable.js.map +1 -0
- package/dist/admin/components/ProductForm.d.ts +18 -0
- package/dist/admin/components/ProductForm.d.ts.map +1 -0
- package/dist/admin/components/ProductForm.js +127 -0
- package/dist/admin/components/ProductForm.js.map +1 -0
- package/dist/admin/components/ProductTable.d.ts +13 -0
- package/dist/admin/components/ProductTable.d.ts.map +1 -0
- package/dist/admin/components/ProductTable.js +81 -0
- package/dist/admin/components/ProductTable.js.map +1 -0
- package/dist/admin/components/RecentOrders.d.ts +11 -0
- package/dist/admin/components/RecentOrders.d.ts.map +1 -0
- package/dist/admin/components/RecentOrders.js +58 -0
- package/dist/admin/components/RecentOrders.js.map +1 -0
- package/dist/admin/components/RefundDialog.d.ts +17 -0
- package/dist/admin/components/RefundDialog.d.ts.map +1 -0
- package/dist/admin/components/RefundDialog.js +86 -0
- package/dist/admin/components/RefundDialog.js.map +1 -0
- package/dist/admin/components/StatsCards.d.ts +23 -0
- package/dist/admin/components/StatsCards.d.ts.map +1 -0
- package/dist/admin/components/StatsCards.js +82 -0
- package/dist/admin/components/StatsCards.js.map +1 -0
- package/dist/admin/components/StoreSettings.d.ts +14 -0
- package/dist/admin/components/StoreSettings.d.ts.map +1 -0
- package/dist/admin/components/StoreSettings.js +88 -0
- package/dist/admin/components/StoreSettings.js.map +1 -0
- package/dist/admin/components/index.d.ts +21 -0
- package/dist/admin/components/index.d.ts.map +1 -0
- package/dist/admin/components/index.js +57 -0
- package/dist/admin/components/index.js.map +1 -0
- package/dist/admin/config.d.ts +74 -0
- package/dist/admin/config.d.ts.map +1 -0
- package/dist/admin/config.js +229 -0
- package/dist/admin/config.js.map +1 -0
- package/dist/admin/hooks/index.d.ts +10 -0
- package/dist/admin/hooks/index.d.ts.map +1 -0
- package/dist/admin/hooks/index.js +17 -0
- package/dist/admin/hooks/index.js.map +1 -0
- package/dist/admin/hooks/useAdminOrders.d.ts +41 -0
- package/dist/admin/hooks/useAdminOrders.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminOrders.js +191 -0
- package/dist/admin/hooks/useAdminOrders.js.map +1 -0
- package/dist/admin/hooks/useAdminProducts.d.ts +39 -0
- package/dist/admin/hooks/useAdminProducts.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminProducts.js +235 -0
- package/dist/admin/hooks/useAdminProducts.js.map +1 -0
- package/dist/admin/hooks/useAdminStats.d.ts +50 -0
- package/dist/admin/hooks/useAdminStats.d.ts.map +1 -0
- package/dist/admin/hooks/useAdminStats.js +111 -0
- package/dist/admin/hooks/useAdminStats.js.map +1 -0
- package/dist/admin/index.d.ts +63 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +148 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/server/admin-service.d.ts +130 -0
- package/dist/admin/server/admin-service.d.ts.map +1 -0
- package/dist/admin/server/admin-service.js +298 -0
- package/dist/admin/server/admin-service.js.map +1 -0
- package/dist/admin/server/index.d.ts +8 -0
- package/dist/admin/server/index.d.ts.map +1 -0
- package/dist/admin/server/index.js +25 -0
- package/dist/admin/server/index.js.map +1 -0
- package/dist/admin/types.d.ts +549 -0
- package/dist/admin/types.d.ts.map +1 -0
- package/dist/admin/types.js +11 -0
- package/dist/admin/types.js.map +1 -0
- package/dist/auth/api/auth.d.ts +54 -0
- package/dist/auth/api/auth.d.ts.map +1 -0
- package/dist/auth/api/auth.js +67 -0
- package/dist/auth/api/auth.js.map +1 -0
- package/dist/auth/api/forgot-password.d.ts +41 -0
- package/dist/auth/api/forgot-password.d.ts.map +1 -0
- package/dist/auth/api/forgot-password.js +68 -0
- package/dist/auth/api/forgot-password.js.map +1 -0
- package/dist/auth/api/index.d.ts +34 -0
- package/dist/auth/api/index.d.ts.map +1 -0
- package/dist/auth/api/index.js +52 -0
- package/dist/auth/api/index.js.map +1 -0
- package/dist/auth/api/register.d.ts +41 -0
- package/dist/auth/api/register.d.ts.map +1 -0
- package/dist/auth/api/register.js +93 -0
- package/dist/auth/api/register.js.map +1 -0
- package/dist/auth/api/resend-verification.d.ts +41 -0
- package/dist/auth/api/resend-verification.d.ts.map +1 -0
- package/dist/auth/api/resend-verification.js +71 -0
- package/dist/auth/api/resend-verification.js.map +1 -0
- package/dist/auth/api/reset-password.d.ts +67 -0
- package/dist/auth/api/reset-password.d.ts.map +1 -0
- package/dist/auth/api/reset-password.js +110 -0
- package/dist/auth/api/reset-password.js.map +1 -0
- package/dist/auth/api/verify-email.d.ts +47 -0
- package/dist/auth/api/verify-email.d.ts.map +1 -0
- package/dist/auth/api/verify-email.js +94 -0
- package/dist/auth/api/verify-email.js.map +1 -0
- package/dist/auth/components/AuthGuard.d.ts +52 -0
- package/dist/auth/components/AuthGuard.d.ts.map +1 -0
- package/dist/auth/components/AuthGuard.js +113 -0
- package/dist/auth/components/AuthGuard.js.map +1 -0
- package/dist/auth/components/ForgotPasswordForm.d.ts +15 -0
- package/dist/auth/components/ForgotPasswordForm.d.ts.map +1 -0
- package/dist/auth/components/ForgotPasswordForm.js +44 -0
- package/dist/auth/components/ForgotPasswordForm.js.map +1 -0
- package/dist/auth/components/ResetPasswordForm.d.ts +18 -0
- package/dist/auth/components/ResetPasswordForm.d.ts.map +1 -0
- package/dist/auth/components/ResetPasswordForm.js +88 -0
- package/dist/auth/components/ResetPasswordForm.js.map +1 -0
- package/dist/auth/components/SignInForm.d.ts +21 -0
- package/dist/auth/components/SignInForm.d.ts.map +1 -0
- package/dist/auth/components/SignInForm.js +63 -0
- package/dist/auth/components/SignInForm.js.map +1 -0
- package/dist/auth/components/SignUpForm.d.ts +18 -0
- package/dist/auth/components/SignUpForm.d.ts.map +1 -0
- package/dist/auth/components/SignUpForm.js +79 -0
- package/dist/auth/components/SignUpForm.js.map +1 -0
- package/dist/auth/components/UserMenu.d.ts +18 -0
- package/dist/auth/components/UserMenu.d.ts.map +1 -0
- package/dist/auth/components/UserMenu.js +75 -0
- package/dist/auth/components/UserMenu.js.map +1 -0
- package/dist/auth/components/VerifyEmailNotice.d.ts +20 -0
- package/dist/auth/components/VerifyEmailNotice.d.ts.map +1 -0
- package/dist/auth/components/VerifyEmailNotice.js +59 -0
- package/dist/auth/components/VerifyEmailNotice.js.map +1 -0
- package/dist/auth/components/index.d.ts +13 -0
- package/dist/auth/components/index.d.ts.map +1 -0
- package/dist/auth/components/index.js +24 -0
- package/dist/auth/components/index.js.map +1 -0
- package/dist/auth/config.d.ts +42 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/config.js +174 -0
- package/dist/auth/config.js.map +1 -0
- package/dist/auth/hooks/index.d.ts +7 -0
- package/dist/auth/hooks/index.d.ts.map +1 -0
- package/dist/auth/hooks/index.js +11 -0
- package/dist/auth/hooks/index.js.map +1 -0
- package/dist/auth/index.d.ts +54 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +88 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/server/customer-service.d.ts +138 -0
- package/dist/auth/server/customer-service.d.ts.map +1 -0
- package/dist/auth/server/customer-service.js +309 -0
- package/dist/auth/server/customer-service.js.map +1 -0
- package/dist/auth/server/email-sender.d.ts +64 -0
- package/dist/auth/server/email-sender.d.ts.map +1 -0
- package/dist/auth/server/email-sender.js +112 -0
- package/dist/auth/server/email-sender.js.map +1 -0
- package/dist/auth/server/index.d.ts +13 -0
- package/dist/auth/server/index.d.ts.map +1 -0
- package/dist/auth/server/index.js +48 -0
- package/dist/auth/server/index.js.map +1 -0
- package/dist/auth/server/password-reset-service.d.ts +86 -0
- package/dist/auth/server/password-reset-service.d.ts.map +1 -0
- package/dist/auth/server/password-reset-service.js +236 -0
- package/dist/auth/server/password-reset-service.js.map +1 -0
- package/dist/auth/server/password.d.ts +58 -0
- package/dist/auth/server/password.d.ts.map +1 -0
- package/dist/auth/server/password.js +94 -0
- package/dist/auth/server/password.js.map +1 -0
- package/dist/auth/server/verification-service.d.ts +87 -0
- package/dist/auth/server/verification-service.d.ts.map +1 -0
- package/dist/auth/server/verification-service.js +268 -0
- package/dist/auth/server/verification-service.js.map +1 -0
- package/dist/auth/types.d.ts +305 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +8 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/cart/CartProvider.d.ts +65 -0
- package/dist/cart/CartProvider.d.ts.map +1 -0
- package/dist/cart/CartProvider.js +101 -0
- package/dist/cart/CartProvider.js.map +1 -0
- package/dist/cart/components/AddToCartButton.d.ts +77 -0
- package/dist/cart/components/AddToCartButton.d.ts.map +1 -0
- package/dist/cart/components/AddToCartButton.js +124 -0
- package/dist/cart/components/AddToCartButton.js.map +1 -0
- package/dist/cart/components/CartDrawer.d.ts +71 -0
- package/dist/cart/components/CartDrawer.d.ts.map +1 -0
- package/dist/cart/components/CartDrawer.js +108 -0
- package/dist/cart/components/CartDrawer.js.map +1 -0
- package/dist/cart/components/CartIcon.d.ts +36 -0
- package/dist/cart/components/CartIcon.d.ts.map +1 -0
- package/dist/cart/components/CartIcon.js +70 -0
- package/dist/cart/components/CartIcon.js.map +1 -0
- package/dist/cart/components/CartItem.d.ts +52 -0
- package/dist/cart/components/CartItem.d.ts.map +1 -0
- package/dist/cart/components/CartItem.js +55 -0
- package/dist/cart/components/CartItem.js.map +1 -0
- package/dist/cart/components/CartSummary.d.ts +43 -0
- package/dist/cart/components/CartSummary.d.ts.map +1 -0
- package/dist/cart/components/CartSummary.js +58 -0
- package/dist/cart/components/CartSummary.js.map +1 -0
- package/dist/cart/components/QuantitySelector.d.ts +39 -0
- package/dist/cart/components/QuantitySelector.d.ts.map +1 -0
- package/dist/cart/components/QuantitySelector.js +87 -0
- package/dist/cart/components/QuantitySelector.js.map +1 -0
- package/dist/cart/components/index.d.ts +18 -0
- package/dist/cart/components/index.d.ts.map +1 -0
- package/dist/cart/components/index.js +21 -0
- package/dist/cart/components/index.js.map +1 -0
- package/dist/cart/index.d.ts +109 -0
- package/dist/cart/index.d.ts.map +1 -0
- package/dist/cart/index.js +129 -0
- package/dist/cart/index.js.map +1 -0
- package/dist/cart/store.d.ts +101 -0
- package/dist/cart/store.d.ts.map +1 -0
- package/dist/cart/store.js +207 -0
- package/dist/cart/store.js.map +1 -0
- package/dist/checkout/api/checkout.d.ts +31 -0
- package/dist/checkout/api/checkout.d.ts.map +1 -0
- package/dist/checkout/api/checkout.js +103 -0
- package/dist/checkout/api/checkout.js.map +1 -0
- package/dist/checkout/api/index.d.ts +8 -0
- package/dist/checkout/api/index.d.ts.map +1 -0
- package/dist/checkout/api/index.js +13 -0
- package/dist/checkout/api/index.js.map +1 -0
- package/dist/checkout/api/webhook.d.ts +30 -0
- package/dist/checkout/api/webhook.d.ts.map +1 -0
- package/dist/checkout/api/webhook.js +58 -0
- package/dist/checkout/api/webhook.js.map +1 -0
- package/dist/checkout/components/CheckoutButton.d.ts +44 -0
- package/dist/checkout/components/CheckoutButton.d.ts.map +1 -0
- package/dist/checkout/components/CheckoutButton.js +97 -0
- package/dist/checkout/components/CheckoutButton.js.map +1 -0
- package/dist/checkout/components/CheckoutSuccess.d.ts +29 -0
- package/dist/checkout/components/CheckoutSuccess.d.ts.map +1 -0
- package/dist/checkout/components/CheckoutSuccess.js +60 -0
- package/dist/checkout/components/CheckoutSuccess.js.map +1 -0
- package/dist/checkout/components/OrderSummary.d.ts +37 -0
- package/dist/checkout/components/OrderSummary.d.ts.map +1 -0
- package/dist/checkout/components/OrderSummary.js +70 -0
- package/dist/checkout/components/OrderSummary.js.map +1 -0
- package/dist/checkout/components/ShippingForm.d.ts +30 -0
- package/dist/checkout/components/ShippingForm.d.ts.map +1 -0
- package/dist/checkout/components/ShippingForm.js +125 -0
- package/dist/checkout/components/ShippingForm.js.map +1 -0
- package/dist/checkout/components/index.d.ts +10 -0
- package/dist/checkout/components/index.d.ts.map +1 -0
- package/dist/checkout/components/index.js +17 -0
- package/dist/checkout/components/index.js.map +1 -0
- package/dist/checkout/hooks/index.d.ts +7 -0
- package/dist/checkout/hooks/index.d.ts.map +1 -0
- package/dist/checkout/hooks/index.js +12 -0
- package/dist/checkout/hooks/index.js.map +1 -0
- package/dist/checkout/hooks/useCheckout.d.ts +61 -0
- package/dist/checkout/hooks/useCheckout.d.ts.map +1 -0
- package/dist/checkout/hooks/useCheckout.js +174 -0
- package/dist/checkout/hooks/useCheckout.js.map +1 -0
- package/dist/checkout/index.d.ts +111 -0
- package/dist/checkout/index.d.ts.map +1 -0
- package/dist/checkout/index.js +148 -0
- package/dist/checkout/index.js.map +1 -0
- package/dist/checkout/server/create-checkout-session.d.ts +69 -0
- package/dist/checkout/server/create-checkout-session.d.ts.map +1 -0
- package/dist/checkout/server/create-checkout-session.js +190 -0
- package/dist/checkout/server/create-checkout-session.js.map +1 -0
- package/dist/checkout/server/handle-webhook.d.ts +35 -0
- package/dist/checkout/server/handle-webhook.d.ts.map +1 -0
- package/dist/checkout/server/handle-webhook.js +279 -0
- package/dist/checkout/server/handle-webhook.js.map +1 -0
- package/dist/checkout/server/index.d.ts +10 -0
- package/dist/checkout/server/index.d.ts.map +1 -0
- package/dist/checkout/server/index.js +19 -0
- package/dist/checkout/server/index.js.map +1 -0
- package/dist/checkout/server/order-service.d.ts +43 -0
- package/dist/checkout/server/order-service.d.ts.map +1 -0
- package/dist/checkout/server/order-service.js +196 -0
- package/dist/checkout/server/order-service.js.map +1 -0
- package/dist/checkout/stripe/client.d.ts +72 -0
- package/dist/checkout/stripe/client.d.ts.map +1 -0
- package/dist/checkout/stripe/client.js +189 -0
- package/dist/checkout/stripe/client.js.map +1 -0
- package/dist/checkout/stripe/index.d.ts +7 -0
- package/dist/checkout/stripe/index.d.ts.map +1 -0
- package/dist/checkout/stripe/index.js +21 -0
- package/dist/checkout/stripe/index.js.map +1 -0
- package/dist/checkout/types.d.ts +263 -0
- package/dist/checkout/types.d.ts.map +1 -0
- package/dist/checkout/types.js +9 -0
- package/dist/checkout/types.js.map +1 -0
- package/dist/core/config.d.ts +296 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +162 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/db/client.d.ts +69 -0
- package/dist/core/db/client.d.ts.map +1 -0
- package/dist/core/db/client.js +202 -0
- package/dist/core/db/client.js.map +1 -0
- package/dist/core/db/index.d.ts +11 -0
- package/dist/core/db/index.d.ts.map +1 -0
- package/dist/core/db/index.js +109 -0
- package/dist/core/db/index.js.map +1 -0
- package/dist/core/db/queries.d.ts +627 -0
- package/dist/core/db/queries.d.ts.map +1 -0
- package/dist/core/db/queries.js +730 -0
- package/dist/core/db/queries.js.map +1 -0
- package/dist/core/db/schema.d.ts +1628 -0
- package/dist/core/db/schema.d.ts.map +1 -0
- package/dist/core/db/schema.js +262 -0
- package/dist/core/db/schema.js.map +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +71 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/server/index.d.ts +17 -0
- package/dist/core/server/index.d.ts.map +1 -0
- package/dist/core/server/index.js +96 -0
- package/dist/core/server/index.js.map +1 -0
- package/dist/core/types.d.ts +230 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +9 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils.d.ts +153 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +356 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/emails/config.d.ts +42 -0
- package/dist/emails/config.d.ts.map +1 -0
- package/dist/emails/config.js +89 -0
- package/dist/emails/config.js.map +1 -0
- package/dist/emails/index.d.ts +85 -0
- package/dist/emails/index.d.ts.map +1 -0
- package/dist/emails/index.js +170 -0
- package/dist/emails/index.js.map +1 -0
- package/dist/emails/send/auth.d.ts +91 -0
- package/dist/emails/send/auth.d.ts.map +1 -0
- package/dist/emails/send/auth.js +132 -0
- package/dist/emails/send/auth.js.map +1 -0
- package/dist/emails/send/index.d.ts +10 -0
- package/dist/emails/send/index.d.ts.map +1 -0
- package/dist/emails/send/index.js +33 -0
- package/dist/emails/send/index.js.map +1 -0
- package/dist/emails/send/orders.d.ts +180 -0
- package/dist/emails/send/orders.d.ts.map +1 -0
- package/dist/emails/send/orders.js +259 -0
- package/dist/emails/send/orders.js.map +1 -0
- package/dist/emails/sender.d.ts +72 -0
- package/dist/emails/sender.d.ts.map +1 -0
- package/dist/emails/sender.js +118 -0
- package/dist/emails/sender.js.map +1 -0
- package/dist/emails/templates/base.d.ts +105 -0
- package/dist/emails/templates/base.d.ts.map +1 -0
- package/dist/emails/templates/base.js +291 -0
- package/dist/emails/templates/base.js.map +1 -0
- package/dist/emails/templates/email-verification.d.ts +28 -0
- package/dist/emails/templates/email-verification.d.ts.map +1 -0
- package/dist/emails/templates/email-verification.js +56 -0
- package/dist/emails/templates/email-verification.js.map +1 -0
- package/dist/emails/templates/index.d.ts +15 -0
- package/dist/emails/templates/index.d.ts.map +1 -0
- package/dist/emails/templates/index.js +58 -0
- package/dist/emails/templates/index.js.map +1 -0
- package/dist/emails/templates/order-cancelled.d.ts +30 -0
- package/dist/emails/templates/order-cancelled.d.ts.map +1 -0
- package/dist/emails/templates/order-cancelled.js +87 -0
- package/dist/emails/templates/order-cancelled.js.map +1 -0
- package/dist/emails/templates/order-confirmation.d.ts +36 -0
- package/dist/emails/templates/order-confirmation.d.ts.map +1 -0
- package/dist/emails/templates/order-confirmation.js +161 -0
- package/dist/emails/templates/order-confirmation.js.map +1 -0
- package/dist/emails/templates/order-delivered.d.ts +31 -0
- package/dist/emails/templates/order-delivered.d.ts.map +1 -0
- package/dist/emails/templates/order-delivered.js +95 -0
- package/dist/emails/templates/order-delivered.js.map +1 -0
- package/dist/emails/templates/order-shipped.d.ts +32 -0
- package/dist/emails/templates/order-shipped.d.ts.map +1 -0
- package/dist/emails/templates/order-shipped.js +87 -0
- package/dist/emails/templates/order-shipped.js.map +1 -0
- package/dist/emails/templates/password-reset.d.ts +27 -0
- package/dist/emails/templates/password-reset.d.ts.map +1 -0
- package/dist/emails/templates/password-reset.js +55 -0
- package/dist/emails/templates/password-reset.js.map +1 -0
- package/dist/emails/templates/refund-processed.d.ts +32 -0
- package/dist/emails/templates/refund-processed.d.ts.map +1 -0
- package/dist/emails/templates/refund-processed.js +96 -0
- package/dist/emails/templates/refund-processed.js.map +1 -0
- package/dist/emails/templates/welcome.d.ts +27 -0
- package/dist/emails/templates/welcome.d.ts.map +1 -0
- package/dist/emails/templates/welcome.js +56 -0
- package/dist/emails/templates/welcome.js.map +1 -0
- package/dist/emails/types.d.ts +202 -0
- package/dist/emails/types.d.ts.map +1 -0
- package/dist/emails/types.js +8 -0
- package/dist/emails/types.js.map +1 -0
- package/dist/emails/utils.d.ts +94 -0
- package/dist/emails/utils.d.ts.map +1 -0
- package/dist/emails/utils.js +229 -0
- package/dist/emails/utils.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +225 -0
- package/dist/index.js.map +1 -0
- package/dist/products/api/categories.d.ts +29 -0
- package/dist/products/api/categories.d.ts.map +1 -0
- package/dist/products/api/categories.js +49 -0
- package/dist/products/api/categories.js.map +1 -0
- package/dist/products/api/index.d.ts +24 -0
- package/dist/products/api/index.d.ts.map +1 -0
- package/dist/products/api/index.js +30 -0
- package/dist/products/api/index.js.map +1 -0
- package/dist/products/api/product.d.ts +36 -0
- package/dist/products/api/product.d.ts.map +1 -0
- package/dist/products/api/product.js +70 -0
- package/dist/products/api/product.js.map +1 -0
- package/dist/products/api/products.d.ts +41 -0
- package/dist/products/api/products.d.ts.map +1 -0
- package/dist/products/api/products.js +102 -0
- package/dist/products/api/products.js.map +1 -0
- package/dist/products/components/CategoryNav.d.ts +51 -0
- package/dist/products/components/CategoryNav.d.ts.map +1 -0
- package/dist/products/components/CategoryNav.js +115 -0
- package/dist/products/components/CategoryNav.js.map +1 -0
- package/dist/products/components/ProductBreadcrumb.d.ts +52 -0
- package/dist/products/components/ProductBreadcrumb.d.ts.map +1 -0
- package/dist/products/components/ProductBreadcrumb.js +78 -0
- package/dist/products/components/ProductBreadcrumb.js.map +1 -0
- package/dist/products/components/ProductCard.d.ts +54 -0
- package/dist/products/components/ProductCard.d.ts.map +1 -0
- package/dist/products/components/ProductCard.js +65 -0
- package/dist/products/components/ProductCard.js.map +1 -0
- package/dist/products/components/ProductDetails.d.ts +63 -0
- package/dist/products/components/ProductDetails.d.ts.map +1 -0
- package/dist/products/components/ProductDetails.js +105 -0
- package/dist/products/components/ProductDetails.js.map +1 -0
- package/dist/products/components/ProductFilters.d.ts +70 -0
- package/dist/products/components/ProductFilters.d.ts.map +1 -0
- package/dist/products/components/ProductFilters.js +127 -0
- package/dist/products/components/ProductFilters.js.map +1 -0
- package/dist/products/components/ProductGallery.d.ts +37 -0
- package/dist/products/components/ProductGallery.d.ts.map +1 -0
- package/dist/products/components/ProductGallery.js +80 -0
- package/dist/products/components/ProductGallery.js.map +1 -0
- package/dist/products/components/ProductGrid.d.ts +50 -0
- package/dist/products/components/ProductGrid.d.ts.map +1 -0
- package/dist/products/components/ProductGrid.js +83 -0
- package/dist/products/components/ProductGrid.js.map +1 -0
- package/dist/products/components/ProductSearch.d.ts +43 -0
- package/dist/products/components/ProductSearch.d.ts.map +1 -0
- package/dist/products/components/ProductSearch.js +99 -0
- package/dist/products/components/ProductSearch.js.map +1 -0
- package/dist/products/components/ProductSort.d.ts +43 -0
- package/dist/products/components/ProductSort.d.ts.map +1 -0
- package/dist/products/components/ProductSort.js +61 -0
- package/dist/products/components/ProductSort.js.map +1 -0
- package/dist/products/components/VariantSelector.d.ts +43 -0
- package/dist/products/components/VariantSelector.d.ts.map +1 -0
- package/dist/products/components/VariantSelector.js +147 -0
- package/dist/products/components/VariantSelector.js.map +1 -0
- package/dist/products/components/index.d.ts +26 -0
- package/dist/products/components/index.d.ts.map +1 -0
- package/dist/products/components/index.js +32 -0
- package/dist/products/components/index.js.map +1 -0
- package/dist/products/hooks/index.d.ts +14 -0
- package/dist/products/hooks/index.d.ts.map +1 -0
- package/dist/products/hooks/index.js +17 -0
- package/dist/products/hooks/index.js.map +1 -0
- package/dist/products/hooks/useCategories.d.ts +56 -0
- package/dist/products/hooks/useCategories.d.ts.map +1 -0
- package/dist/products/hooks/useCategories.js +126 -0
- package/dist/products/hooks/useCategories.js.map +1 -0
- package/dist/products/hooks/useProduct.d.ts +44 -0
- package/dist/products/hooks/useProduct.d.ts.map +1 -0
- package/dist/products/hooks/useProduct.js +86 -0
- package/dist/products/hooks/useProduct.js.map +1 -0
- package/dist/products/hooks/useProductAttributes.d.ts +59 -0
- package/dist/products/hooks/useProductAttributes.d.ts.map +1 -0
- package/dist/products/hooks/useProductAttributes.js +148 -0
- package/dist/products/hooks/useProductAttributes.js.map +1 -0
- package/dist/products/hooks/useProducts.d.ts +67 -0
- package/dist/products/hooks/useProducts.d.ts.map +1 -0
- package/dist/products/hooks/useProducts.js +132 -0
- package/dist/products/hooks/useProducts.js.map +1 -0
- package/dist/products/index.d.ts +94 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +123 -0
- package/dist/products/index.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +70 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +77 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/colors.d.ts +148 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +219 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/defaults.d.ts +212 -0
- package/dist/theme/defaults.d.ts.map +1 -0
- package/dist/theme/defaults.js +278 -0
- package/dist/theme/defaults.js.map +1 -0
- package/dist/theme/fonts.d.ts +59 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +202 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/generator.d.ts +50 -0
- package/dist/theme/generator.d.ts.map +1 -0
- package/dist/theme/generator.js +322 -0
- package/dist/theme/generator.js.map +1 -0
- package/dist/theme/hooks.d.ts +110 -0
- package/dist/theme/hooks.d.ts.map +1 -0
- package/dist/theme/hooks.js +106 -0
- package/dist/theme/hooks.js.map +1 -0
- package/dist/theme/index.d.ts +37 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +85 -0
- package/dist/theme/index.js.map +1 -0
- package/package.json +7 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/products/components
|
|
4
|
+
*
|
|
5
|
+
* Product catalog UI components.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ProductFilterPanel = exports.ProductSort = exports.ProductSearch = exports.ProductBreadcrumb = exports.CategoryNav = exports.ProductGallery = exports.VariantSelector = exports.ProductDetails = exports.ProductGrid = exports.ProductCard = void 0;
|
|
9
|
+
// Core components
|
|
10
|
+
var ProductCard_1 = require("./ProductCard");
|
|
11
|
+
Object.defineProperty(exports, "ProductCard", { enumerable: true, get: function () { return ProductCard_1.ProductCard; } });
|
|
12
|
+
var ProductGrid_1 = require("./ProductGrid");
|
|
13
|
+
Object.defineProperty(exports, "ProductGrid", { enumerable: true, get: function () { return ProductGrid_1.ProductGrid; } });
|
|
14
|
+
var ProductDetails_1 = require("./ProductDetails");
|
|
15
|
+
Object.defineProperty(exports, "ProductDetails", { enumerable: true, get: function () { return ProductDetails_1.ProductDetails; } });
|
|
16
|
+
var VariantSelector_1 = require("./VariantSelector");
|
|
17
|
+
Object.defineProperty(exports, "VariantSelector", { enumerable: true, get: function () { return VariantSelector_1.VariantSelector; } });
|
|
18
|
+
var ProductGallery_1 = require("./ProductGallery");
|
|
19
|
+
Object.defineProperty(exports, "ProductGallery", { enumerable: true, get: function () { return ProductGallery_1.ProductGallery; } });
|
|
20
|
+
// Navigation components
|
|
21
|
+
var CategoryNav_1 = require("./CategoryNav");
|
|
22
|
+
Object.defineProperty(exports, "CategoryNav", { enumerable: true, get: function () { return CategoryNav_1.CategoryNav; } });
|
|
23
|
+
var ProductBreadcrumb_1 = require("./ProductBreadcrumb");
|
|
24
|
+
Object.defineProperty(exports, "ProductBreadcrumb", { enumerable: true, get: function () { return ProductBreadcrumb_1.ProductBreadcrumb; } });
|
|
25
|
+
// Filtering components
|
|
26
|
+
var ProductSearch_1 = require("./ProductSearch");
|
|
27
|
+
Object.defineProperty(exports, "ProductSearch", { enumerable: true, get: function () { return ProductSearch_1.ProductSearch; } });
|
|
28
|
+
var ProductSort_1 = require("./ProductSort");
|
|
29
|
+
Object.defineProperty(exports, "ProductSort", { enumerable: true, get: function () { return ProductSort_1.ProductSort; } });
|
|
30
|
+
var ProductFilters_1 = require("./ProductFilters");
|
|
31
|
+
Object.defineProperty(exports, "ProductFilterPanel", { enumerable: true, get: function () { return ProductFilters_1.ProductFilterPanel; } });
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/products/components/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,kBAAkB;AAClB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAGpB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAGpB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AAGvB,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AAGxB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AAGvB,wBAAwB;AACxB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAGpB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAG1B,uBAAuB;AACvB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AAGtB,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAGpB,mDAAqD;AAA5C,oHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rovela/sdk/products/hooks
|
|
3
|
+
*
|
|
4
|
+
* React hooks for product data fetching.
|
|
5
|
+
*/
|
|
6
|
+
export { useProducts } from './useProducts';
|
|
7
|
+
export type { UseProductsOptions, UseProductsReturn } from './useProducts';
|
|
8
|
+
export { useProduct } from './useProduct';
|
|
9
|
+
export type { UseProductOptions, UseProductReturn } from './useProduct';
|
|
10
|
+
export { useCategories } from './useCategories';
|
|
11
|
+
export type { UseCategoriesOptions, UseCategoriesReturn, CategoryWithChildren, } from './useCategories';
|
|
12
|
+
export { useProductAttributes } from './useProductAttributes';
|
|
13
|
+
export type { UseProductAttributesOptions, UseProductAttributesReturn, ProductAttribute, PriceRange, } from './useProductAttributes';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/products/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,GACX,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @rovela/sdk/products/hooks
|
|
4
|
+
*
|
|
5
|
+
* React hooks for product data fetching.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.useProductAttributes = exports.useCategories = exports.useProduct = exports.useProducts = void 0;
|
|
9
|
+
var useProducts_1 = require("./useProducts");
|
|
10
|
+
Object.defineProperty(exports, "useProducts", { enumerable: true, get: function () { return useProducts_1.useProducts; } });
|
|
11
|
+
var useProduct_1 = require("./useProduct");
|
|
12
|
+
Object.defineProperty(exports, "useProduct", { enumerable: true, get: function () { return useProduct_1.useProduct; } });
|
|
13
|
+
var useCategories_1 = require("./useCategories");
|
|
14
|
+
Object.defineProperty(exports, "useCategories", { enumerable: true, get: function () { return useCategories_1.useCategories; } });
|
|
15
|
+
var useProductAttributes_1 = require("./useProductAttributes");
|
|
16
|
+
Object.defineProperty(exports, "useProductAttributes", { enumerable: true, get: function () { return useProductAttributes_1.useProductAttributes; } });
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/products/hooks/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AAGpB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAGnB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AAOtB,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Category } from '../../core/types';
|
|
2
|
+
export interface CategoryWithChildren extends Category {
|
|
3
|
+
children: CategoryWithChildren[];
|
|
4
|
+
}
|
|
5
|
+
export interface UseCategoriesOptions {
|
|
6
|
+
/** API endpoint (default /api/categories) */
|
|
7
|
+
endpoint?: string;
|
|
8
|
+
/** Skip fetching */
|
|
9
|
+
skip?: boolean;
|
|
10
|
+
/** Initial data (for SSR hydration) */
|
|
11
|
+
initialData?: Category[];
|
|
12
|
+
}
|
|
13
|
+
export interface UseCategoriesReturn {
|
|
14
|
+
/** Flat list of all categories */
|
|
15
|
+
categories: Category[];
|
|
16
|
+
/** Hierarchical category tree (root categories with nested children) */
|
|
17
|
+
tree: CategoryWithChildren[];
|
|
18
|
+
/** Whether data is currently loading */
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
/** Error if request failed */
|
|
21
|
+
error: Error | null;
|
|
22
|
+
/** Refresh the categories */
|
|
23
|
+
refresh: () => void;
|
|
24
|
+
/** Get a category by ID */
|
|
25
|
+
getCategoryById: (id: string) => Category | undefined;
|
|
26
|
+
/** Get a category by slug */
|
|
27
|
+
getCategoryBySlug: (slug: string) => Category | undefined;
|
|
28
|
+
/** Get child categories of a parent */
|
|
29
|
+
getChildren: (parentId: string | null) => Category[];
|
|
30
|
+
/** Get breadcrumb path for a category */
|
|
31
|
+
getBreadcrumb: (categoryId: string) => Category[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Hook for fetching and managing categories.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* import { useCategories } from '@rovela/sdk/products'
|
|
39
|
+
*
|
|
40
|
+
* function CategoryNav() {
|
|
41
|
+
* const { tree, isLoading } = useCategories()
|
|
42
|
+
*
|
|
43
|
+
* if (isLoading) return <div>Loading...</div>
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <nav>
|
|
47
|
+
* {tree.map(category => (
|
|
48
|
+
* <CategoryLink key={category.id} category={category} />
|
|
49
|
+
* ))}
|
|
50
|
+
* </nav>
|
|
51
|
+
* )
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function useCategories(options?: UseCategoriesOptions): UseCategoriesReturn;
|
|
56
|
+
//# sourceMappingURL=useCategories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCategories.d.ts","sourceRoot":"","sources":["../../../src/products/hooks/useCategories.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAMhD,MAAM,WAAW,oBAAqB,SAAQ,QAAQ;IACpD,QAAQ,EAAE,oBAAoB,EAAE,CAAA;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oBAAoB;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,uCAAuC;IACvC,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAA;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,UAAU,EAAE,QAAQ,EAAE,CAAA;IACtB,wEAAwE;IACxE,IAAI,EAAE,oBAAoB,EAAE,CAAA;IAC5B,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,2BAA2B;IAC3B,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAA;IACrD,6BAA6B;IAC7B,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAA;IACzD,uCAAuC;IACvC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,QAAQ,EAAE,CAAA;IACpD,yCAAyC;IACzC,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,QAAQ,EAAE,CAAA;CAClD;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CA4HrB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useCategories = useCategories;
|
|
5
|
+
/**
|
|
6
|
+
* @rovela/sdk/products/hooks/useCategories
|
|
7
|
+
*
|
|
8
|
+
* Hook for fetching category tree.
|
|
9
|
+
*/
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Hook
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Hook for fetching and managing categories.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { useCategories } from '@rovela/sdk/products'
|
|
20
|
+
*
|
|
21
|
+
* function CategoryNav() {
|
|
22
|
+
* const { tree, isLoading } = useCategories()
|
|
23
|
+
*
|
|
24
|
+
* if (isLoading) return <div>Loading...</div>
|
|
25
|
+
*
|
|
26
|
+
* return (
|
|
27
|
+
* <nav>
|
|
28
|
+
* {tree.map(category => (
|
|
29
|
+
* <CategoryLink key={category.id} category={category} />
|
|
30
|
+
* ))}
|
|
31
|
+
* </nav>
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function useCategories(options = {}) {
|
|
37
|
+
const { endpoint = '/api/categories', skip = false, initialData, } = options;
|
|
38
|
+
const [categories, setCategories] = (0, react_1.useState)(initialData || []);
|
|
39
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(!initialData && !skip);
|
|
40
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
41
|
+
// Fetch categories
|
|
42
|
+
const fetchCategories = (0, react_1.useCallback)(async () => {
|
|
43
|
+
if (skip)
|
|
44
|
+
return;
|
|
45
|
+
setIsLoading(true);
|
|
46
|
+
setError(null);
|
|
47
|
+
try {
|
|
48
|
+
const response = await fetch(endpoint);
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
const errorData = await response.json().catch(() => ({}));
|
|
51
|
+
throw new Error(errorData.error || `HTTP ${response.status}`);
|
|
52
|
+
}
|
|
53
|
+
const data = await response.json();
|
|
54
|
+
setCategories(data.data || []);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
setError(err instanceof Error ? err : new Error('Failed to fetch categories'));
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
setIsLoading(false);
|
|
61
|
+
}
|
|
62
|
+
}, [endpoint, skip]);
|
|
63
|
+
// Fetch on mount
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
|
+
if (!initialData) {
|
|
66
|
+
fetchCategories();
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
69
|
+
// Build category tree
|
|
70
|
+
const tree = (0, react_1.useMemo)(() => {
|
|
71
|
+
const categoryMap = new Map();
|
|
72
|
+
// First pass: create all nodes with empty children
|
|
73
|
+
categories.forEach((cat) => {
|
|
74
|
+
categoryMap.set(cat.id, { ...cat, children: [] });
|
|
75
|
+
});
|
|
76
|
+
// Second pass: build tree structure
|
|
77
|
+
const roots = [];
|
|
78
|
+
categories.forEach((cat) => {
|
|
79
|
+
const node = categoryMap.get(cat.id);
|
|
80
|
+
if (cat.parentId && categoryMap.has(cat.parentId)) {
|
|
81
|
+
const parent = categoryMap.get(cat.parentId);
|
|
82
|
+
parent.children.push(node);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
roots.push(node);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
// Sort children by order
|
|
89
|
+
const sortChildren = (nodes) => {
|
|
90
|
+
nodes.sort((a, b) => a.order - b.order);
|
|
91
|
+
nodes.forEach((node) => sortChildren(node.children));
|
|
92
|
+
};
|
|
93
|
+
sortChildren(roots);
|
|
94
|
+
return roots;
|
|
95
|
+
}, [categories]);
|
|
96
|
+
// Helper: get category by ID
|
|
97
|
+
const getCategoryById = (0, react_1.useCallback)((id) => categories.find((c) => c.id === id), [categories]);
|
|
98
|
+
// Helper: get category by slug
|
|
99
|
+
const getCategoryBySlug = (0, react_1.useCallback)((slug) => categories.find((c) => c.slug === slug), [categories]);
|
|
100
|
+
// Helper: get children of a parent
|
|
101
|
+
const getChildren = (0, react_1.useCallback)((parentId) => categories
|
|
102
|
+
.filter((c) => c.parentId === parentId)
|
|
103
|
+
.sort((a, b) => a.order - b.order), [categories]);
|
|
104
|
+
// Helper: get breadcrumb path
|
|
105
|
+
const getBreadcrumb = (0, react_1.useCallback)((categoryId) => {
|
|
106
|
+
const path = [];
|
|
107
|
+
let current = getCategoryById(categoryId);
|
|
108
|
+
while (current) {
|
|
109
|
+
path.unshift(current);
|
|
110
|
+
current = current.parentId ? getCategoryById(current.parentId) : undefined;
|
|
111
|
+
}
|
|
112
|
+
return path;
|
|
113
|
+
}, [getCategoryById]);
|
|
114
|
+
return {
|
|
115
|
+
categories,
|
|
116
|
+
tree,
|
|
117
|
+
isLoading,
|
|
118
|
+
error,
|
|
119
|
+
refresh: fetchCategories,
|
|
120
|
+
getCategoryById,
|
|
121
|
+
getCategoryBySlug,
|
|
122
|
+
getChildren,
|
|
123
|
+
getBreadcrumb,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=useCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/products/hooks/useCategories.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AA2EZ,sCA8HC;AAvMD;;;;GAIG;AAEH,iCAAiE;AAyCjE,gFAAgF;AAChF,OAAO;AACP,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,aAAa,CAC3B,UAAgC,EAAE;IAElC,MAAM,EACJ,QAAQ,GAAG,iBAAiB,EAC5B,IAAI,GAAG,KAAK,EACZ,WAAW,GACZ,GAAG,OAAO,CAAA;IAEX,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAa,WAAW,IAAI,EAAE,CAAC,CAAA;IAC3E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,CAAA;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAe,IAAI,CAAC,CAAA;IAEtD,mBAAmB;IACnB,MAAM,eAAe,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC7C,IAAI,IAAI;YAAE,OAAM;QAEhB,YAAY,CAAC,IAAI,CAAC,CAAA;QAClB,QAAQ,CAAC,IAAI,CAAC,CAAA;QAEd,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,C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AU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EACzD,CAAC,UAAU,CAAC,CACb,CAAA;IAED,mCAAmC;IACnC,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,CAAC,QAAuB,EAAE,EAAE,CAC1B,UAAU;SACP,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;SACtC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,EACtC,CAAC,UAAU,CAAC,CACb,CAAA;IAED,8BAA8B;IAC9B,MAAM,aAAa,GAAG,IAAA,mBAAW,EAC/B,CAAC,UAAkB,EAAc,EAAE;QACjC,MAAM,IAAI,GAAe,EAAE,CAAA;QAC3B,IAAI,OAAO,GAAG,eAAe,CAAC,UAAU,CAAC,CAAA;QAEzC,OAAO,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YACrB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC5E,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC,EACD,CAAC,eAAe,CAAC,CAClB,CAAA;IAED,OAAO;QACL,UAAU;QACV,IAAI;QACJ,SAAS;QACT,KAAK;QACL,OAAO,EAAE,eAAe;QACxB,eAAe;QACf,iBAAiB;QACjB,WAAW;QACX,aAAa;KACd,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Product, ProductVariant } from '../../core/types';
|
|
2
|
+
export interface UseProductOptions {
|
|
3
|
+
/** API endpoint (default /api/products) */
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
/** Skip fetching (useful for SSR data) */
|
|
6
|
+
skip?: boolean;
|
|
7
|
+
/** Initial product data (for SSR hydration) */
|
|
8
|
+
initialData?: {
|
|
9
|
+
product: Product;
|
|
10
|
+
variants: ProductVariant[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface UseProductReturn {
|
|
14
|
+
/** The product */
|
|
15
|
+
product: Product | null;
|
|
16
|
+
/** Product variants */
|
|
17
|
+
variants: ProductVariant[];
|
|
18
|
+
/** Whether data is currently loading */
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
/** Error if request failed */
|
|
21
|
+
error: Error | null;
|
|
22
|
+
/** Refresh the product data */
|
|
23
|
+
refresh: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook for fetching a single product by slug.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* import { useProduct } from '@rovela/sdk/products'
|
|
31
|
+
*
|
|
32
|
+
* function ProductPage({ slug }: { slug: string }) {
|
|
33
|
+
* const { product, variants, isLoading, error } = useProduct(slug)
|
|
34
|
+
*
|
|
35
|
+
* if (isLoading) return <div>Loading...</div>
|
|
36
|
+
* if (error) return <div>Error: {error.message}</div>
|
|
37
|
+
* if (!product) return <div>Product not found</div>
|
|
38
|
+
*
|
|
39
|
+
* return <ProductDetails product={product} variants={variants} />
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function useProduct(slug: string, options?: UseProductOptions): UseProductReturn;
|
|
44
|
+
//# sourceMappingURL=useProduct.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProduct.d.ts","sourceRoot":"","sources":["../../../src/products/hooks/useProduct.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAM/D,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE;QACZ,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,cAAc,EAAE,CAAA;KAC3B,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB;IAClB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,uBAAuB;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB,CAoElB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useProduct = useProduct;
|
|
5
|
+
/**
|
|
6
|
+
* @rovela/sdk/products/hooks/useProduct
|
|
7
|
+
*
|
|
8
|
+
* Hook for fetching a single product by slug with its variants.
|
|
9
|
+
*/
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Hook
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Hook for fetching a single product by slug.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { useProduct } from '@rovela/sdk/products'
|
|
20
|
+
*
|
|
21
|
+
* function ProductPage({ slug }: { slug: string }) {
|
|
22
|
+
* const { product, variants, isLoading, error } = useProduct(slug)
|
|
23
|
+
*
|
|
24
|
+
* if (isLoading) return <div>Loading...</div>
|
|
25
|
+
* if (error) return <div>Error: {error.message}</div>
|
|
26
|
+
* if (!product) return <div>Product not found</div>
|
|
27
|
+
*
|
|
28
|
+
* return <ProductDetails product={product} variants={variants} />
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function useProduct(slug, options = {}) {
|
|
33
|
+
const { endpoint = '/api/products', skip = false, initialData, } = options;
|
|
34
|
+
const [product, setProduct] = (0, react_1.useState)(initialData?.product || null);
|
|
35
|
+
const [variants, setVariants] = (0, react_1.useState)(initialData?.variants || []);
|
|
36
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(!initialData && !skip);
|
|
37
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
38
|
+
// Fetch product
|
|
39
|
+
const fetchProduct = (0, react_1.useCallback)(async () => {
|
|
40
|
+
if (!slug || skip)
|
|
41
|
+
return;
|
|
42
|
+
setIsLoading(true);
|
|
43
|
+
setError(null);
|
|
44
|
+
try {
|
|
45
|
+
const response = await fetch(`${endpoint}/${encodeURIComponent(slug)}`);
|
|
46
|
+
if (!response.ok) {
|
|
47
|
+
if (response.status === 404) {
|
|
48
|
+
setProduct(null);
|
|
49
|
+
setVariants([]);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const errorData = await response.json().catch(() => ({}));
|
|
53
|
+
throw new Error(errorData.error || `HTTP ${response.status}`);
|
|
54
|
+
}
|
|
55
|
+
const data = await response.json();
|
|
56
|
+
setProduct(data.product);
|
|
57
|
+
setVariants(data.variants || []);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
setError(err instanceof Error ? err : new Error('Failed to fetch product'));
|
|
61
|
+
setProduct(null);
|
|
62
|
+
setVariants([]);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
setIsLoading(false);
|
|
66
|
+
}
|
|
67
|
+
}, [slug, endpoint, skip]);
|
|
68
|
+
// Fetch on mount and when slug changes
|
|
69
|
+
(0, react_1.useEffect)(() => {
|
|
70
|
+
if (!initialData) {
|
|
71
|
+
fetchProduct();
|
|
72
|
+
}
|
|
73
|
+
}, [slug]);
|
|
74
|
+
// Refresh function
|
|
75
|
+
const refresh = (0, react_1.useCallback)(() => {
|
|
76
|
+
fetchProduct();
|
|
77
|
+
}, [fetchProduct]);
|
|
78
|
+
return {
|
|
79
|
+
product,
|
|
80
|
+
variants,
|
|
81
|
+
isLoading,
|
|
82
|
+
error,
|
|
83
|
+
refresh,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=useProduct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProduct.js","sourceRoot":"","sources":["../../../src/products/hooks/useProduct.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AA8DZ,gCAuEC;AAnID;;;;GAIG;AAEH,iCAAwD;AAgCxD,gFAAgF;AAChF,OAAO;AACP,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,UAAU,CACxB,IAAY,EACZ,UAA6B,EAAE;IAE/B,MAAM,EACJ,QAAQ,GAAG,eAAe,EAC1B,IAAI,GAAG,KAAK,EACZ,WAAW,GACZ,GAAG,OAAO,CAAA;IAEX,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EACpC,WAAW,EAAE,OAAO,IAAI,IAAI,CAC7B,CAAA;IACD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EACtC,WAAW,EAAE,QAAQ,IAAI,EAAE,CAC5B,CAAA;IACD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,CAAA;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAe,IAAI,CAAC,CAAA;IAEtD,gBAAgB;IAChB,MAAM,YAAY,GAAG,IAAA,mBAAW,EA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,EAAE,IAAI,CAAC,CAAC,CAAA;IAE1B,uCAAuC;IACvC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,YAAY,EAAE,CAAA;QAChB,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,mBAAmB;IACnB,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC/B,YAAY,EAAE,CAAA;IAChB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAElB,OAAO;QACL,OAAO;QACP,QAAQ;QACR,SAAS;QACT,KAAK;QACL,OAAO;KACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface ProductAttribute {
|
|
2
|
+
/** Attribute name (e.g., "color", "size") */
|
|
3
|
+
name: string;
|
|
4
|
+
/** All unique values for this attribute */
|
|
5
|
+
values: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface PriceRange {
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UseProductAttributesOptions {
|
|
12
|
+
/** Category to filter by (fetches products from this category) */
|
|
13
|
+
categoryId?: string;
|
|
14
|
+
/** API endpoint for products */
|
|
15
|
+
endpoint?: string;
|
|
16
|
+
/** Skip fetching */
|
|
17
|
+
skip?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface UseProductAttributesReturn {
|
|
20
|
+
/** Available filter attributes with their values */
|
|
21
|
+
attributes: ProductAttribute[];
|
|
22
|
+
/** Price range across all products */
|
|
23
|
+
priceRange: PriceRange | null;
|
|
24
|
+
/** Whether data is currently loading */
|
|
25
|
+
isLoading: boolean;
|
|
26
|
+
/** Error if request failed */
|
|
27
|
+
error: Error | null;
|
|
28
|
+
/** Refresh the attributes */
|
|
29
|
+
refresh: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hook for extracting available product attributes for filtering.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import { useProductAttributes } from '@rovela/sdk/products'
|
|
37
|
+
*
|
|
38
|
+
* function ProductFilters({ categoryId }: { categoryId?: string }) {
|
|
39
|
+
* const { attributes, priceRange, isLoading } = useProductAttributes({
|
|
40
|
+
* categoryId,
|
|
41
|
+
* })
|
|
42
|
+
*
|
|
43
|
+
* if (isLoading) return <div>Loading filters...</div>
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <div>
|
|
47
|
+
* {attributes.map(attr => (
|
|
48
|
+
* <FilterGroup key={attr.name} name={attr.name} values={attr.values} />
|
|
49
|
+
* ))}
|
|
50
|
+
* {priceRange && (
|
|
51
|
+
* <PriceSlider min={priceRange.min} max={priceRange.max} />
|
|
52
|
+
* )}
|
|
53
|
+
* </div>
|
|
54
|
+
* )
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function useProductAttributes(options?: UseProductAttributesOptions): UseProductAttributesReturn;
|
|
59
|
+
//# sourceMappingURL=useProductAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProductAttributes.d.ts","sourceRoot":"","sources":["../../../src/products/hooks/useProductAttributes.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,2BAA2B;IAC1C,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oBAAoB;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,UAAU,EAAE,gBAAgB,EAAE,CAAA;IAC9B,sCAAsC;IACtC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IAC7B,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAA;IAClB,8BAA8B;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,GAAE,2BAAgC,GACxC,0BAA0B,CA2H5B"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useProductAttributes = useProductAttributes;
|
|
5
|
+
/**
|
|
6
|
+
* @rovela/sdk/products/hooks/useProductAttributes
|
|
7
|
+
*
|
|
8
|
+
* Hook for extracting available filter attributes from products.
|
|
9
|
+
* Used to build dynamic filter UI based on variant attributes.
|
|
10
|
+
*/
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// Hook
|
|
14
|
+
// =============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Hook for extracting available product attributes for filtering.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { useProductAttributes } from '@rovela/sdk/products'
|
|
21
|
+
*
|
|
22
|
+
* function ProductFilters({ categoryId }: { categoryId?: string }) {
|
|
23
|
+
* const { attributes, priceRange, isLoading } = useProductAttributes({
|
|
24
|
+
* categoryId,
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* if (isLoading) return <div>Loading filters...</div>
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <div>
|
|
31
|
+
* {attributes.map(attr => (
|
|
32
|
+
* <FilterGroup key={attr.name} name={attr.name} values={attr.values} />
|
|
33
|
+
* ))}
|
|
34
|
+
* {priceRange && (
|
|
35
|
+
* <PriceSlider min={priceRange.min} max={priceRange.max} />
|
|
36
|
+
* )}
|
|
37
|
+
* </div>
|
|
38
|
+
* )
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
function useProductAttributes(options = {}) {
|
|
43
|
+
const { categoryId, endpoint = '/api/products', skip = false, } = options;
|
|
44
|
+
const [products, setProducts] = (0, react_1.useState)([]);
|
|
45
|
+
const [variants, setVariants] = (0, react_1.useState)([]);
|
|
46
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(!skip);
|
|
47
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
48
|
+
// Fetch products to extract attributes
|
|
49
|
+
const fetchProducts = (0, react_1.useCallback)(async () => {
|
|
50
|
+
if (skip)
|
|
51
|
+
return;
|
|
52
|
+
setIsLoading(true);
|
|
53
|
+
setError(null);
|
|
54
|
+
try {
|
|
55
|
+
const params = new URLSearchParams();
|
|
56
|
+
params.set('limit', '100'); // Get enough products for attribute extraction
|
|
57
|
+
params.set('status', 'active');
|
|
58
|
+
if (categoryId) {
|
|
59
|
+
params.set('category', categoryId);
|
|
60
|
+
}
|
|
61
|
+
const response = await fetch(`${endpoint}?${params}`);
|
|
62
|
+
if (!response.ok) {
|
|
63
|
+
const errorData = await response.json().catch(() => ({}));
|
|
64
|
+
throw new Error(errorData.error || `HTTP ${response.status}`);
|
|
65
|
+
}
|
|
66
|
+
const data = await response.json();
|
|
67
|
+
setProducts(data.data || []);
|
|
68
|
+
// For products with variants, we'd need to fetch variants
|
|
69
|
+
// In production, this would be a separate endpoint or included in products response
|
|
70
|
+
// For now, we extract what we can from product data
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
setError(err instanceof Error ? err : new Error('Failed to fetch products'));
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
setIsLoading(false);
|
|
77
|
+
}
|
|
78
|
+
}, [categoryId, endpoint, skip]);
|
|
79
|
+
// Fetch on mount and when category changes
|
|
80
|
+
(0, react_1.useEffect)(() => {
|
|
81
|
+
fetchProducts();
|
|
82
|
+
}, [categoryId]);
|
|
83
|
+
// Extract attributes from variants
|
|
84
|
+
const attributes = (0, react_1.useMemo)(() => {
|
|
85
|
+
const attributeMap = new Map();
|
|
86
|
+
// Extract from variants
|
|
87
|
+
variants.forEach((variant) => {
|
|
88
|
+
if (variant.attributes) {
|
|
89
|
+
Object.entries(variant.attributes).forEach(([key, value]) => {
|
|
90
|
+
if (!attributeMap.has(key)) {
|
|
91
|
+
attributeMap.set(key, new Set());
|
|
92
|
+
}
|
|
93
|
+
attributeMap.get(key).add(value);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
// Convert to array and sort
|
|
98
|
+
const result = [];
|
|
99
|
+
attributeMap.forEach((values, name) => {
|
|
100
|
+
result.push({
|
|
101
|
+
name,
|
|
102
|
+
values: Array.from(values).sort(),
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
// Sort attributes by name
|
|
106
|
+
result.sort((a, b) => a.name.localeCompare(b.name));
|
|
107
|
+
return result;
|
|
108
|
+
}, [variants]);
|
|
109
|
+
// Calculate price range
|
|
110
|
+
const priceRange = (0, react_1.useMemo)(() => {
|
|
111
|
+
if (products.length === 0)
|
|
112
|
+
return null;
|
|
113
|
+
let min = Infinity;
|
|
114
|
+
let max = -Infinity;
|
|
115
|
+
products.forEach((product) => {
|
|
116
|
+
const price = typeof product.price === 'string'
|
|
117
|
+
? parseFloat(product.price)
|
|
118
|
+
: product.price;
|
|
119
|
+
if (price < min)
|
|
120
|
+
min = price;
|
|
121
|
+
if (price > max)
|
|
122
|
+
max = price;
|
|
123
|
+
});
|
|
124
|
+
// Include compare prices in range
|
|
125
|
+
products.forEach((product) => {
|
|
126
|
+
if (product.comparePrice) {
|
|
127
|
+
const comparePrice = typeof product.comparePrice === 'string'
|
|
128
|
+
? parseFloat(product.comparePrice)
|
|
129
|
+
: product.comparePrice;
|
|
130
|
+
if (comparePrice < min)
|
|
131
|
+
min = comparePrice;
|
|
132
|
+
if (comparePrice > max)
|
|
133
|
+
max = comparePrice;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
if (min === Infinity || max === -Infinity)
|
|
137
|
+
return null;
|
|
138
|
+
return { min, max };
|
|
139
|
+
}, [products]);
|
|
140
|
+
return {
|
|
141
|
+
attributes,
|
|
142
|
+
priceRange,
|
|
143
|
+
isLoading,
|
|
144
|
+
error,
|
|
145
|
+
refresh: fetchProducts,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=useProductAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProductAttributes.js","sourceRoot":"","sources":["../../../src/products/hooks/useProductAttributes.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AAiFZ,oDA6HC;AA5MD;;;;;GAKG;AAEH,iCAAiE;AAyCjE,gFAAgF;AAChF,OAAO;AACP,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,SAAgB,oBAAoB,CAClC,UAAuC,EAAE;IAEzC,MAAM,EACJ,UAAU,EACV,QAAQ,GAAG,eAAe,EAC1B,IAAI,GAAG,KAAK,GACb,GAAG,OAAO,CAAA;IAEX,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAY,EAAE,CAAC,CAAA;IACvD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAmB,EAAE,CAAC,CAAA;IAC9D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,IAAI,CAAC,CAAA;IACjD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAe,IAAI,CAAC,CAAA;IAEtD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