@simpleapps-com/augur-hooks 2.4.0 → 2026.11.2

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 (103) hide show
  1. package/EXPORTS.md +25 -65
  2. package/README.md +21 -246
  3. package/dist/checkout/create-checkout-provider.d.ts +25 -0
  4. package/dist/checkout/create-checkout-provider.d.ts.map +1 -0
  5. package/dist/checkout/index.cjs +123 -106
  6. package/dist/checkout/index.cjs.map +1 -1
  7. package/dist/checkout/index.d.ts +5 -293
  8. package/dist/checkout/index.d.ts.map +1 -0
  9. package/dist/checkout/index.js +99 -82
  10. package/dist/checkout/index.js.map +1 -1
  11. package/dist/checkout/{index.d.cts → types.d.ts} +18 -40
  12. package/dist/checkout/types.d.ts.map +1 -0
  13. package/dist/chunk-6Z6JGK2C.cjs.map +1 -1
  14. package/dist/chunk-JJX23M5N.js +532 -0
  15. package/dist/chunk-JJX23M5N.js.map +1 -0
  16. package/dist/chunk-UZAFXUAO.cjs +532 -0
  17. package/dist/chunk-UZAFXUAO.cjs.map +1 -0
  18. package/dist/duration.d.ts +16 -0
  19. package/dist/duration.d.ts.map +1 -0
  20. package/dist/hooks/use-cart-actions.d.ts +68 -0
  21. package/dist/hooks/use-cart-actions.d.ts.map +1 -0
  22. package/dist/hooks/use-cart-initialization.d.ts +60 -0
  23. package/dist/hooks/use-cart-initialization.d.ts.map +1 -0
  24. package/dist/hooks/use-cart-pricing.d.ts +41 -0
  25. package/dist/hooks/use-cart-pricing.d.ts.map +1 -0
  26. package/dist/hooks/use-checkout-persistence.d.ts +41 -0
  27. package/dist/hooks/use-checkout-persistence.d.ts.map +1 -0
  28. package/dist/hooks/use-debounce.d.ts +6 -0
  29. package/dist/hooks/use-debounce.d.ts.map +1 -0
  30. package/dist/hooks/use-format-price.d.ts +29 -0
  31. package/dist/hooks/use-format-price.d.ts.map +1 -0
  32. package/dist/hooks/use-latest.d.ts +8 -0
  33. package/dist/hooks/use-latest.d.ts.map +1 -0
  34. package/dist/hooks/use-modal-lifecycle.d.ts +11 -0
  35. package/dist/hooks/use-modal-lifecycle.d.ts.map +1 -0
  36. package/dist/hooks/use-order-readiness.d.ts +47 -0
  37. package/dist/hooks/use-order-readiness.d.ts.map +1 -0
  38. package/dist/hooks/use-pagination-prefetch.d.ts +27 -0
  39. package/dist/hooks/use-pagination-prefetch.d.ts.map +1 -0
  40. package/dist/{use-order-readiness-DZTIfRzw.d.ts → hooks/use-payment-flow.d.ts} +23 -67
  41. package/dist/hooks/use-payment-flow.d.ts.map +1 -0
  42. package/dist/hooks/use-stock.d.ts +32 -0
  43. package/dist/hooks/use-stock.d.ts.map +1 -0
  44. package/dist/index.cjs +227 -184
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.ts +32 -456
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +205 -162
  49. package/dist/index.js.map +1 -1
  50. package/dist/persistence/apply-limits.d.ts +8 -0
  51. package/dist/persistence/apply-limits.d.ts.map +1 -0
  52. package/dist/persistence/create-persister.d.ts +10 -0
  53. package/dist/persistence/create-persister.d.ts.map +1 -0
  54. package/dist/persistence/serializer.d.ts +11 -0
  55. package/dist/persistence/serializer.d.ts.map +1 -0
  56. package/dist/persistence/use-persistence.d.ts +59 -0
  57. package/dist/persistence/use-persistence.d.ts.map +1 -0
  58. package/dist/persistence/use-storage-monitor.d.ts +11 -0
  59. package/dist/persistence/use-storage-monitor.d.ts.map +1 -0
  60. package/dist/provider.d.ts +89 -0
  61. package/dist/provider.d.ts.map +1 -0
  62. package/dist/queries/batch-query.d.ts +23 -0
  63. package/dist/queries/batch-query.d.ts.map +1 -0
  64. package/dist/queries/index.d.ts +3 -0
  65. package/dist/queries/index.d.ts.map +1 -0
  66. package/dist/query-action-registry.d.ts +19 -0
  67. package/dist/query-action-registry.d.ts.map +1 -0
  68. package/dist/rules.d.ts +133 -0
  69. package/dist/rules.d.ts.map +1 -0
  70. package/dist/server.cjs +2 -1
  71. package/dist/server.cjs.map +1 -1
  72. package/dist/server.d.ts +10 -12
  73. package/dist/server.d.ts.map +1 -0
  74. package/dist/server.js +2 -1
  75. package/dist/server.js.map +1 -1
  76. package/dist/stores/cart-store.d.ts +51 -0
  77. package/dist/stores/cart-store.d.ts.map +1 -0
  78. package/dist/stores/items-filters-store.d.ts +30 -0
  79. package/dist/stores/items-filters-store.d.ts.map +1 -0
  80. package/dist/types.d.ts +48 -0
  81. package/dist/types.d.ts.map +1 -0
  82. package/dist/web/use-image-with-fallback.d.ts +16 -0
  83. package/dist/web/use-image-with-fallback.d.ts.map +1 -0
  84. package/dist/web/use-mobile-detection.d.ts +28 -0
  85. package/dist/web/use-mobile-detection.d.ts.map +1 -0
  86. package/dist/web/use-mobile-optimized-intersection.d.ts +17 -0
  87. package/dist/web/use-mobile-optimized-intersection.d.ts.map +1 -0
  88. package/dist/web.cjs.map +1 -1
  89. package/dist/web.d.ts +4 -60
  90. package/dist/web.d.ts.map +1 -0
  91. package/dist/web.js.map +1 -1
  92. package/llms.txt +76 -54
  93. package/package.json +26 -14
  94. package/dist/batch-query-CTlvxSmL.d.cts +0 -165
  95. package/dist/batch-query-CTlvxSmL.d.ts +0 -165
  96. package/dist/chunk-F5DUFW57.cjs +0 -383
  97. package/dist/chunk-F5DUFW57.cjs.map +0 -1
  98. package/dist/chunk-JNOHB4OP.js +0 -383
  99. package/dist/chunk-JNOHB4OP.js.map +0 -1
  100. package/dist/index.d.cts +0 -456
  101. package/dist/server.d.cts +0 -44
  102. package/dist/use-order-readiness-DZTIfRzw.d.cts +0 -137
  103. package/dist/web.d.cts +0 -60
package/dist/web.d.cts DELETED
@@ -1,60 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import { ReactNode } from 'react';
4
- import { ImageConfig, ImageUrlOptions } from '@simpleapps-com/augur-utils';
5
-
6
- /**
7
- * Returns whether the screen is mobile-sized.
8
- * Uses `useSyncExternalStore` for proper SSR support.
9
- *
10
- * - SSR-safe: returns false on server, updates on client after hydration
11
- * - Single listener: one resize listener regardless of component count
12
- * - Throttled: resize events throttled to prevent excessive re-renders
13
- */
14
- declare function useIsMobile(): boolean;
15
- interface MobileProviderProps {
16
- children: ReactNode;
17
- }
18
- /**
19
- * Optional provider that tracks hydration state.
20
- * Wrap your app with this if you need to conditionally render
21
- * mobile-only content after hydration.
22
- */
23
- declare function MobileProvider({ children }: MobileProviderProps): react_jsx_runtime.JSX.Element;
24
- /**
25
- * Returns true only after the client has hydrated.
26
- * Prevents hydration mismatches with conditional rendering.
27
- */
28
- declare function useIsHydrated(): boolean;
29
-
30
- interface UseMobileOptimizedIntersectionOptions {
31
- rootMarginMobile?: string;
32
- rootMarginDesktop?: string;
33
- threshold?: number;
34
- enabled?: boolean;
35
- mobileBreakpoint?: number;
36
- }
37
- /**
38
- * IntersectionObserver hook with mobile-optimized root margins.
39
- * Uses larger margins on mobile for more aggressive prefetching/lazy loading.
40
- */
41
- declare const useMobileOptimizedIntersection: ({ rootMarginMobile, rootMarginDesktop, threshold, enabled, mobileBreakpoint, }?: UseMobileOptimizedIntersectionOptions) => {
42
- ref: react.RefObject<HTMLDivElement | null>;
43
- isIntersecting: boolean;
44
- };
45
-
46
- interface UseImageWithFallbackResult {
47
- src: string;
48
- isLoading: boolean;
49
- hasError: boolean;
50
- }
51
- /**
52
- * Preloads an agr.media image and shows a fallback while loading.
53
- *
54
- * 1. Returns the default image immediately.
55
- * 2. Preloads the real image via `new Image()`.
56
- * 3. Swaps to the real URL on success; keeps the fallback on error.
57
- */
58
- declare function useImageWithFallback(config: ImageConfig, imagePath: string | undefined, options?: ImageUrlOptions): UseImageWithFallbackResult;
59
-
60
- export { MobileProvider, useImageWithFallback, useIsHydrated, useIsMobile, useMobileOptimizedIntersection };