@raxonltd/raxon-core 1.1.6 → 1.1.8

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.
Files changed (66) hide show
  1. package/core/component/general.image.tsx +86 -0
  2. package/core/context/cart.context.tsx +446 -0
  3. package/core/context/security.context.tsx +151 -0
  4. package/core/feature/address/api/places.api.ts +76 -0
  5. package/core/feature/address/form/address-search-input.tsx +125 -0
  6. package/core/feature/address/hook/use.addres.tsx +63 -0
  7. package/core/feature/address/hook/use.address-autocomplete.ts +116 -0
  8. package/core/feature/address/util/address.types.ts +38 -0
  9. package/core/feature/address/util/parse-google-place.ts +66 -0
  10. package/core/feature/analytic-event/analytic.event.api.ts +27 -0
  11. package/core/feature/analytic-event/analytic.event.context.tsx +180 -0
  12. package/core/feature/analytic-event/analytic.event.util.ts +42 -0
  13. package/core/feature/analytic-event/use.analytic.auto.tsx +114 -0
  14. package/core/feature/article/hook/use.article.tsx +33 -0
  15. package/core/feature/attribute/hook/use.attribute.tsx +24 -0
  16. package/core/feature/auth/hook/use.auth.tsx +141 -0
  17. package/core/feature/auth/modal/modal.auth.tsx +80 -0
  18. package/core/feature/auth/view/view.login.tsx +199 -0
  19. package/core/feature/auth/view/view.register.tsx +333 -0
  20. package/core/feature/bank-account/hook/use.bank.account.tsx +47 -0
  21. package/core/feature/brand/hook/use.brand.tsx +24 -0
  22. package/core/feature/cart/component/cart.order.summary.tsx +89 -0
  23. package/core/feature/cart/component/cart.promo.code.section.tsx +208 -0
  24. package/core/feature/cart/hook/use.cart.tsx +267 -0
  25. package/core/feature/cart/util/basket-pay.response.ts +67 -0
  26. package/core/feature/cart/util/cart-optimistic.ts +425 -0
  27. package/core/feature/cart/util/garanti-payment.ts +27 -0
  28. package/core/feature/collection/hook/use.collection.tsx +32 -0
  29. package/core/feature/delivery-method/hook/use.delivery.method.tsx +40 -0
  30. package/core/feature/delivery-method/util/checkout.delivery.method.ts +11 -0
  31. package/core/feature/faq/hook/use.faq.tsx +23 -0
  32. package/core/feature/favorite/hook/use.favorite.tsx +48 -0
  33. package/core/feature/form-submit/form/form.contact.tsx +118 -0
  34. package/core/feature/form-submit/hook/use.form.submit.tsx +16 -0
  35. package/core/feature/invoice/hook/use.invoice.tsx +51 -0
  36. package/core/feature/newsletter/hook/use.newsletter.tsx +124 -0
  37. package/core/feature/newsletter/modal/modal.newsletter.product.tsx +163 -0
  38. package/core/feature/order/hook/use.order.tsx +31 -0
  39. package/core/feature/payment-method/checkout.payment.options.ts +117 -0
  40. package/core/feature/payment-method/hook/use.payment.method.tsx +44 -0
  41. package/core/feature/product/hook/use.product.tsx +122 -0
  42. package/core/feature/profile/hook/use.profile.tsx +126 -0
  43. package/core/feature/promo-code/hook/use.promo.code.tsx +27 -0
  44. package/core/interface/basket.interface.ts +360 -0
  45. package/core/interface/bootstrap.interface.ts +39 -0
  46. package/core/interface/context.interface.ts +9 -0
  47. package/core/interface/inventory.interface.ts +88 -0
  48. package/core/interface/nexine.interface.ts +4 -0
  49. package/core/interface/prisma.interface.ts +8844 -0
  50. package/core/interface/product.interface.ts +111 -0
  51. package/core/raxon.context.tsx +256 -0
  52. package/core/schema/checkout.schema.ts +103 -0
  53. package/core/util/basket.item.display.ts +19 -0
  54. package/core/util/category.nav.ts +46 -0
  55. package/core/util/client-ip.ts +35 -0
  56. package/core/util/collection.util.ts +433 -0
  57. package/core/util/fetch.bootstrap.ts +21 -0
  58. package/core/util/garanti-payment.ts +5 -0
  59. package/core/util/nexine.axios.tsx +104 -0
  60. package/core/util/no-cache.ts +6 -0
  61. package/core/util/util.ts +191 -0
  62. package/core/view/view.checkout.tsx +1964 -0
  63. package/dist/core/view/view.checkout.js +2 -2
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +12 -3
  66. package/tailwind.css +11 -0
@@ -910,7 +910,7 @@ function CheckoutMainView() {
910
910
  window.addEventListener(LOGIN_SUCCESS_EVENT, handleLoginSuccess);
911
911
  return () => window.removeEventListener(LOGIN_SUCCESS_EVENT, handleLoginSuccess);
912
912
  }, []);
913
- return (_jsxs("div", { className: "min-h-screen overflow-x-hidden bg-gray-50", children: [_jsx("header", { className: "border-b border-gray-100 bg-white", children: _jsxs("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-5 sm:px-6 lg:px-8", children: [_jsx(Link, { href: "/", className: "flex flex-col items-start gap-1", children: _jsx(GeneralImage, { quality: 85, src: branch?.logoMedia?.relativePath ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${branch.logoMedia.relativePath}` : '', alt: branch?.tradingName ?? 'Logo', width: 120, height: 36, className: "h-7 w-auto object-contain" }) }), _jsx(Link, { href: "/sepet", className: "text-xs font-black uppercase tracking-widest text-gray-900 transition-colors hover:text-[#CF0A2C]", children: "Sepete d\u00F6n" })] }) }), _jsx("div", { className: "mx-auto max-w-7xl px-4 py-10 sm:px-6 sm:py-14 lg:px-8", children: _jsxs("div", { className: "grid grid-cols-1 gap-10 lg:grid-cols-[2fr_1fr] lg:gap-14", children: [_jsxs("div", { className: "rounded-2xl border border-gray-100 bg-white p-6 shadow-sm sm:p-8", children: [_jsx("nav", { className: "mb-8 flex flex-wrap gap-2", "aria-label": "\u00D6deme ad\u0131mlar\u0131", children: ['contact', 'address', 'checkout'].map((step, index) => {
913
+ return (_jsxs("div", { className: "min-h-screen overflow-x-hidden bg-gray-50", children: [_jsx("header", { className: "border-b border-gray-100 bg-white", children: _jsxs("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-5 sm:px-6 lg:px-8", children: [_jsx(Link, { href: "/", className: "flex flex-col items-start gap-1", children: _jsx(GeneralImage, { quality: 85, src: branch?.logoMedia?.relativePath ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${branch.logoMedia.relativePath}` : '', alt: branch?.tradingName ?? 'Logo', width: 120, height: 36, className: "h-7 w-auto object-contain" }) }), _jsx(Link, { href: "/sepet", className: "text-xs font-black uppercase tracking-widest text-gray-900 transition-colors hover:text-[#CF0A2C]", children: "Sepete d\u00F6n" })] }) }), _jsx("div", { className: "mx-auto max-w-7xl px-4 py-10 sm:px-6 sm:py-14 lg:px-8", children: _jsxs("div", { className: "flex flex-col gap-10 md:flex-row md:items-start md:gap-10 lg:gap-14", children: [_jsxs("div", { className: "min-w-0 flex-1 rounded-2xl border border-gray-100 bg-white p-6 shadow-sm sm:p-8", children: [_jsx("nav", { className: "mb-8 flex flex-wrap gap-2", "aria-label": "\u00D6deme ad\u0131mlar\u0131", children: ['contact', 'address', 'checkout'].map((step, index) => {
914
914
  const stepOrder = ['contact', 'address', 'checkout'].indexOf(checkoutStep);
915
915
  const isActive = checkoutStep === step;
916
916
  const isDone = index < stepOrder;
@@ -922,7 +922,7 @@ function CheckoutMainView() {
922
922
  }) }), checkoutStep === 'contact' && (_jsx(ViewStep1, { onContinue: email => {
923
923
  setConfirmedContactEmail(email);
924
924
  setCheckoutStep('address');
925
- } })), checkoutStep === 'address' && (_jsx(ViewStep2, { onComplete: () => setCheckoutStep('checkout'), onBack: () => setCheckoutStep('contact') })), checkoutStep === 'checkout' && _jsx(ViewStepCheckout, { onBack: () => setCheckoutStep('address') })] }), _jsx("div", { children: _jsxs("div", { className: "sticky top-8 rounded-2xl border border-gray-100 bg-white p-6 shadow-sm lg:top-24 lg:p-8", children: [_jsx("span", { className: "text-sm font-black text-[#CF0A2C] uppercase tracking-widest", children: "\u00D6zet" }), _jsx("h2", { className: "mt-2 text-xl font-black text-gray-900 uppercase tracking-tighter", children: "Sipari\u015F \u00F6zeti" }), _jsx("div", { className: "my-6 space-y-5", children: cart?.items?.map(item => {
925
+ } })), checkoutStep === 'address' && (_jsx(ViewStep2, { onComplete: () => setCheckoutStep('checkout'), onBack: () => setCheckoutStep('contact') })), checkoutStep === 'checkout' && _jsx(ViewStepCheckout, { onBack: () => setCheckoutStep('address') })] }), _jsx("aside", { className: "w-full shrink-0 md:w-96 md:sticky md:top-24 md:self-start", children: _jsxs("div", { className: "rounded-2xl border border-gray-100 bg-white p-6 shadow-sm lg:p-8", children: [_jsx("span", { className: "text-sm font-black text-[#CF0A2C] uppercase tracking-widest", children: "\u00D6zet" }), _jsx("h2", { className: "mt-2 text-xl font-black text-gray-900 uppercase tracking-tighter", children: "Sipari\u015F \u00F6zeti" }), _jsx("div", { className: "my-6 space-y-5", children: cart?.items?.map(item => {
926
926
  const linePay = item.linePay ?? 0;
927
927
  const listGross = (item.lineTotal ?? 0) + (item.lineTax ?? 0);
928
928
  const showListStrike = listGross - linePay > 0.01;