scroll-system 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +138 -3
  2. package/dist/components/AriaLiveRegion.d.ts +18 -0
  3. package/dist/components/AriaLiveRegion.d.ts.map +1 -0
  4. package/dist/components/ControlledView.d.ts +16 -0
  5. package/dist/components/ControlledView.d.ts.map +1 -0
  6. package/dist/components/FullView.d.ts +20 -0
  7. package/dist/components/FullView.d.ts.map +1 -0
  8. package/dist/components/LazyView.d.ts +33 -0
  9. package/dist/components/LazyView.d.ts.map +1 -0
  10. package/dist/components/NestedScrollView.d.ts +38 -0
  11. package/dist/components/NestedScrollView.d.ts.map +1 -0
  12. package/dist/components/ScrollContainer.d.ts +9 -0
  13. package/dist/components/ScrollContainer.d.ts.map +1 -0
  14. package/dist/components/ScrollDebugOverlay.d.ts +17 -0
  15. package/dist/components/ScrollDebugOverlay.d.ts.map +1 -0
  16. package/dist/components/ScrollLockedView.d.ts +10 -0
  17. package/dist/components/ScrollLockedView.d.ts.map +1 -0
  18. package/dist/components/index.d.ts +9 -0
  19. package/dist/components/index.d.ts.map +1 -0
  20. package/dist/constants.d.ts +17 -0
  21. package/dist/constants.d.ts.map +1 -0
  22. package/dist/hooks/index.d.ts +21 -0
  23. package/dist/hooks/index.d.ts.map +1 -0
  24. package/dist/hooks/useAutoScroll.d.ts +41 -0
  25. package/dist/hooks/useAutoScroll.d.ts.map +1 -0
  26. package/dist/hooks/useDragHandler.d.ts +28 -0
  27. package/dist/hooks/useDragHandler.d.ts.map +1 -0
  28. package/dist/hooks/useFocusManagement.d.ts +19 -0
  29. package/dist/hooks/useFocusManagement.d.ts.map +1 -0
  30. package/dist/hooks/useGestureConfig.d.ts +37 -0
  31. package/dist/hooks/useGestureConfig.d.ts.map +1 -0
  32. package/dist/hooks/useGlobalProgress.d.ts +36 -0
  33. package/dist/hooks/useGlobalProgress.d.ts.map +1 -0
  34. package/dist/hooks/useHashSync.d.ts +24 -0
  35. package/dist/hooks/useHashSync.d.ts.map +1 -0
  36. package/dist/hooks/useInfiniteScroll.d.ts +41 -0
  37. package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
  38. package/dist/hooks/useKeyboardHandler.d.ts +20 -0
  39. package/dist/hooks/useKeyboardHandler.d.ts.map +1 -0
  40. package/dist/hooks/useMetricsReporter.d.ts +23 -0
  41. package/dist/hooks/useMetricsReporter.d.ts.map +1 -0
  42. package/dist/hooks/useNavigation.d.ts +42 -0
  43. package/dist/hooks/useNavigation.d.ts.map +1 -0
  44. package/dist/hooks/useParallax.d.ts +33 -0
  45. package/dist/hooks/useParallax.d.ts.map +1 -0
  46. package/dist/hooks/usePreload.d.ts +31 -0
  47. package/dist/hooks/usePreload.d.ts.map +1 -0
  48. package/dist/hooks/useScrollAnalytics.d.ts +40 -0
  49. package/dist/hooks/useScrollAnalytics.d.ts.map +1 -0
  50. package/dist/hooks/useScrollLock.d.ts +40 -0
  51. package/dist/hooks/useScrollLock.d.ts.map +1 -0
  52. package/dist/hooks/useScrollSystem.d.ts +16 -0
  53. package/dist/hooks/useScrollSystem.d.ts.map +1 -0
  54. package/dist/hooks/useSnapPoints.d.ts +77 -0
  55. package/dist/hooks/useSnapPoints.d.ts.map +1 -0
  56. package/dist/hooks/useTouchHandler.d.ts +12 -0
  57. package/dist/hooks/useTouchHandler.d.ts.map +1 -0
  58. package/dist/hooks/useViewProgress.d.ts +22 -0
  59. package/dist/hooks/useViewProgress.d.ts.map +1 -0
  60. package/dist/hooks/useViewRegistration.d.ts +25 -0
  61. package/dist/hooks/useViewRegistration.d.ts.map +1 -0
  62. package/dist/hooks/useWheelHandler.d.ts +8 -0
  63. package/dist/hooks/useWheelHandler.d.ts.map +1 -0
  64. package/dist/index.d.ts +16 -2009
  65. package/dist/index.d.ts.map +1 -0
  66. package/dist/index.js +860 -284
  67. package/dist/index.mjs +799 -212
  68. package/dist/store/index.d.ts +2 -0
  69. package/dist/store/index.d.ts.map +1 -0
  70. package/dist/store/navigation.store.d.ts +23 -0
  71. package/dist/store/navigation.store.d.ts.map +1 -0
  72. package/dist/types/index.d.ts +315 -0
  73. package/dist/types/index.d.ts.map +1 -0
  74. package/dist/utils/index.d.ts +21 -0
  75. package/dist/utils/index.d.ts.map +1 -0
  76. package/dist/utils/normalizeWheel.d.ts +10 -0
  77. package/dist/utils/normalizeWheel.d.ts.map +1 -0
  78. package/package.json +4 -2
  79. package/dist/index.d.mts +0 -2010
package/README.md CHANGED
@@ -13,15 +13,28 @@ Built for high-performance marketing sites, portfolios, and web apps that requir
13
13
 
14
14
  | Feature | Description |
15
15
  |---------|-------------|
16
- | **Snap Views** | 3 specialized view types: `FullView`, `ScrollLockedView`, `ControlledView` |
16
+ | **Snap Views** | 4 view types: `FullView`, `ScrollLockedView`, `ControlledView`, `NestedScrollView` |
17
17
  | **1:1 Touch Physics** | Native-feeling drag interaction on mobile (like TikTok/Reels) |
18
18
  | **Deterministic Locking** | Smart state machine handles mixed content without bugs |
19
19
  | **Accessibility** | Focus management, keyboard navigation, screen reader announcements |
20
20
  | **Deep Linking** | URL hash synchronization (`#about`, `#contact`) |
21
21
  | **Horizontal Support** | Works in both vertical and horizontal orientations |
22
- | **Performance** | Lazy loading support and throttled event listeners |
22
+ | **Performance** | Lazy loading, view preloading, throttled event listeners |
23
23
  | **Analytics** | Built-in view engagement tracking |
24
24
 
25
+ ### ✨ New in v1.1.0
26
+
27
+ | Feature | Description |
28
+ |---------|-------------|
29
+ | **AutoScroll** | Automatic view advancement (carousel mode) |
30
+ | **Infinite Scroll** | Loop from last to first view |
31
+ | **Snap Points** | Multiple "stops" within a single view |
32
+ | **Parallax Effects** | Smooth parallax animations |
33
+ | **Gesture Customization** | Configurable swipe thresholds and velocities |
34
+ | **Global Progress** | Track progress across all views |
35
+ | **Programmatic Lock** | Lock/unlock navigation programmatically |
36
+ | **Auto Mobile Optimization** | Automatically prevents pull-to-refresh |
37
+
25
38
  ---
26
39
 
27
40
  ## 📦 Installation
@@ -126,8 +139,14 @@ The root wrapper component. Manages viewport, event listeners, and global state.
126
139
  | `hashPushHistory` | `boolean` | `false` | Use `pushState` instead of `replaceState` |
127
140
  | `enableFocusManagement` | `boolean` | `true` | Move focus to active view for a11y |
128
141
  | `respectReducedMotion` | `boolean` | `true` | Disable animations if OS prefers |
129
- | `onViewChange` | `(from: number, to: number) => void` | - | Callback when view changes |
142
+ | `onViewChange` | `(from, to) => void` | - | Callback when view changes |
130
143
  | `onInitialized` | `() => void` | - | Callback when system initializes |
144
+ | `skipInitialAnimation` | `boolean` | `false` | Skip animation on first render |
145
+ | `onProgress` | `(progress: number) => void` | - | Global progress callback (0-1) |
146
+ | `gestureConfig` | `GestureConfig` | - | Customize swipe thresholds |
147
+ | `autoScroll` | `AutoScrollConfig` | - | Enable automatic view advancement |
148
+ | `infiniteScroll` | `boolean \| InfiniteScrollConfig` | `false` | Loop from last to first |
149
+ | `preload` | `boolean \| PreloadConfig` | `true` | Preload adjacent views |
131
150
 
132
151
  ---
133
152
 
@@ -317,6 +336,122 @@ return (
317
336
 
318
337
  ---
319
338
 
339
+ ## 🆕 New Hooks (v1.1.0)
340
+
341
+ ### `useGlobalProgress(options)`
342
+
343
+ Track global scroll progress across all views.
344
+
345
+ ```tsx
346
+ const { progress, percentage, activeIndex } = useGlobalProgress({
347
+ onProgress: (p) => console.log(`${p * 100}% complete`)
348
+ });
349
+
350
+ return <ProgressBar value={percentage} />;
351
+ ```
352
+
353
+ ---
354
+
355
+ ### `useScrollLock()`
356
+
357
+ Programmatic control for locking/unlocking navigation.
358
+
359
+ ```tsx
360
+ const { lock, unlock, isLocked, lockView, unlockView } = useScrollLock();
361
+
362
+ const openModal = () => {
363
+ lock(); // Prevents all navigation
364
+ setModalOpen(true);
365
+ };
366
+ ```
367
+
368
+ ---
369
+
370
+ ### `useAutoScroll(config)`
371
+
372
+ Enable automatic view advancement (carousel mode).
373
+
374
+ ```tsx
375
+ const { isPlaying, pause, resume, toggle } = useAutoScroll({
376
+ enabled: true,
377
+ interval: 4000,
378
+ pauseOnInteraction: true,
379
+ resumeDelay: 3000,
380
+ });
381
+
382
+ return (
383
+ <button onClick={toggle}>
384
+ {isPlaying ? '⏸️ Pause' : '▶️ Play'}
385
+ </button>
386
+ );
387
+ ```
388
+
389
+ ---
390
+
391
+ ### `useInfiniteScroll(config)`
392
+
393
+ Enable looping from last view to first.
394
+
395
+ ```tsx
396
+ const { isEnabled, toggle } = useInfiniteScroll({ enabled: true });
397
+
398
+ // Or simply:
399
+ useInfiniteScroll(true);
400
+ ```
401
+
402
+ ---
403
+
404
+ ### `useParallax(viewId, config)`
405
+
406
+ Create parallax effects within views.
407
+
408
+ ```tsx
409
+ function HeroSection() {
410
+ const { style } = useParallax("hero", { speed: 0.3 });
411
+
412
+ return (
413
+ <div style={style}>
414
+ <img src="/background.jpg" alt="Background" />
415
+ </div>
416
+ );
417
+ }
418
+ ```
419
+
420
+ ---
421
+
422
+ ### `useSnapPoints(options)`
423
+
424
+ Manage multiple "stops" within a single view.
425
+
426
+ ```tsx
427
+ const snapPoints = [
428
+ { id: 'intro', position: 0 },
429
+ { id: 'features', position: 0.33 },
430
+ { id: 'pricing', position: 0.66 },
431
+ { id: 'cta', position: 1 },
432
+ ];
433
+
434
+ const { activePoint, goToNextPoint, points } = useSnapPoints({
435
+ viewId: 'landing',
436
+ points: snapPoints,
437
+ });
438
+ ```
439
+
440
+ ---
441
+
442
+ ### `usePreload(config)`
443
+
444
+ Control view preloading for smoother transitions.
445
+
446
+ ```tsx
447
+ const { shouldPreload, preloadedViewIds } = usePreload({
448
+ ahead: 2, // Preload 2 views ahead
449
+ behind: 1, // Preload 1 view behind
450
+ });
451
+ ```
452
+
453
+ ---
454
+
320
455
  ## ⌨️ Keyboard Navigation
321
456
 
322
457
  Built-in keyboard support for accessibility:
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Scroll System - Aria Live Region
3
+ * ==================================
4
+ * Announces view changes to screen readers.
5
+ */
6
+ export interface AriaLiveRegionProps {
7
+ /** Custom announcement template. Use {viewIndex} and {viewId} as placeholders */
8
+ template?: string;
9
+ /** Politeness level for announcements */
10
+ politeness?: "polite" | "assertive";
11
+ }
12
+ /**
13
+ * Invisible component that announces view changes to screen readers.
14
+ * Place inside ScrollContainer.
15
+ */
16
+ export declare function AriaLiveRegion({ template, politeness, }: AriaLiveRegionProps): import("react/jsx-runtime").JSX.Element;
17
+ export default AriaLiveRegion;
18
+ //# sourceMappingURL=AriaLiveRegion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AriaLiveRegion.d.ts","sourceRoot":"","sources":["../../components/AriaLiveRegion.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAA6D,EAC7D,UAAqB,GACtB,EAAE,mBAAmB,2CA8CrB;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * PABRIX Scroll System - Controlled View
3
+ * =======================================
4
+ * Vista controlada programáticamente.
5
+ * La navegación se controla mediante acciones explícitas al Store.
6
+ */
7
+ import type { ControlledViewProps } from "../types";
8
+ export declare function ControlledView({ id, children, className, scrollDirection, allowInternalScroll, canProceed, allowGoBack, onActivate, onDeactivate, onEnterStart, onEnterEnd, onExitStart, onExitEnd, }: ControlledViewProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function useViewControl(viewId: string): {
10
+ unlock: () => void;
11
+ lock: () => void;
12
+ goNext: () => void;
13
+ goPrev: () => void;
14
+ goTo: (to: number | string) => void;
15
+ };
16
+ //# sourceMappingURL=ControlledView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlledView.d.ts","sourceRoot":"","sources":["../../components/ControlledView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AAE1E,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAAwB,EACxB,mBAA2B,EAC3B,UAAkB,EAClB,WAAkB,EAClB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,mBAAmB,2CAqErB;AAMD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;eAc5B,MAAM,GAAG,MAAM;EAI/B"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Scroll System - Full View
3
+ * =================================
4
+ * Vista de pantalla completa sin scroll interno.
5
+ * Cualquier scroll pasa directamente a la siguiente vista.
6
+ */
7
+ import type { FullViewProps } from "../types";
8
+ /**
9
+ * Vista que ocupa el 100% del viewport sin scroll interno.
10
+ * Ideal para hero sections, splash screens, o secciones de impacto visual.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <FullView id="hero">
15
+ * <h1>Welcome to PABRIX</h1>
16
+ * </FullView>
17
+ * ```
18
+ */
19
+ export declare function FullView({ id, children, className, meta, onActivate, onDeactivate, onEnterStart, onEnterEnd, onExitStart, onExitEnd, }: FullViewProps): import("react/jsx-runtime").JSX.Element;
20
+ //# sourceMappingURL=FullView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullView.d.ts","sourceRoot":"","sources":["../../components/FullView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,QAAQ,EACR,SAAc,EACd,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,aAAa,2CAyCf"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Scroll System - Lazy View Wrapper
3
+ * ===================================
4
+ * Wrapper that only renders children when the view is within the
5
+ * active range (current +/- buffer).
6
+ */
7
+ import React from "react";
8
+ export interface LazyViewProps {
9
+ /** The view ID to track */
10
+ viewId: string;
11
+ /** Number of views before/after active to render (default: 1) */
12
+ buffer?: number;
13
+ /** Content to render when lazy loading */
14
+ children: React.ReactNode;
15
+ /** Placeholder to show when not in range */
16
+ placeholder?: React.ReactNode;
17
+ }
18
+ /**
19
+ * Wraps view content to only render when within the active range.
20
+ * Improves performance for apps with many views.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <FullView id="section-3">
25
+ * <LazyView viewId="section-3">
26
+ * <HeavyComponent />
27
+ * </LazyView>
28
+ * </FullView>
29
+ * ```
30
+ */
31
+ export declare function LazyView({ viewId, buffer, children, placeholder, }: LazyViewProps): import("react/jsx-runtime").JSX.Element;
32
+ export default LazyView;
33
+ //# sourceMappingURL=LazyView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LazyView.d.ts","sourceRoot":"","sources":["../../components/LazyView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,MAAU,EACV,QAAQ,EACR,WAAkB,GACnB,EAAE,aAAa,2CAmBf;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * NestedScrollView Component
3
+ * ========================================
4
+ * Enables nested scroll areas within views.
5
+ * Handles scroll direction isolation to prevent interference with main navigation.
6
+ */
7
+ import React from "react";
8
+ import type { NestedScrollViewProps } from "../types";
9
+ /**
10
+ * A view component that supports nested scrolling perpendicular to main navigation.
11
+ * Perfect for horizontal carousels within a vertical scroll system.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <NestedScrollView
16
+ * id="gallery"
17
+ * nestedDirection="horizontal"
18
+ * enableSnap={true}
19
+ * onItemChange={(index) => console.log('Active item:', index)}
20
+ * >
21
+ * <div className="flex">
22
+ * <div className="w-screen flex-shrink-0">Item 1</div>
23
+ * <div className="w-screen flex-shrink-0">Item 2</div>
24
+ * <div className="w-screen flex-shrink-0">Item 3</div>
25
+ * </div>
26
+ * </NestedScrollView>
27
+ * ```
28
+ */
29
+ export declare function NestedScrollView({ id, children, className, nestedDirection, enableSnap, onItemChange, onActivate, onDeactivate, onEnterStart, onEnterEnd, onExitStart, onExitEnd, }: NestedScrollViewProps): import("react/jsx-runtime").JSX.Element;
30
+ /**
31
+ * Helper component for items within NestedScrollView.
32
+ * Ensures proper sizing and snap behavior.
33
+ */
34
+ export declare function NestedScrollItem({ children, className, }: {
35
+ children: React.ReactNode;
36
+ className?: string;
37
+ }): import("react/jsx-runtime").JSX.Element;
38
+ //# sourceMappingURL=NestedScrollView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestedScrollView.d.ts","sourceRoot":"","sources":["../../components/NestedScrollView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAA8B,EAC9B,UAAiB,EACjB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,qBAAqB,2CAmIvB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAc,GACf,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAYA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Scroll System - Scroll Container
3
+ * ========================================
4
+ * Contenedor principal del sistema de scroll.
5
+ * Maneja la disposición de vistas y eventos de navegación.
6
+ */
7
+ import type { ScrollContainerProps } from "../types";
8
+ export declare function ScrollContainer({ children, className, transitionDuration, transitionEasing, onViewChange, onInitialized, enableHashSync, hashPushHistory, hashPrefix, respectReducedMotion, enableFocusManagement, enableDragPhysics, orientation, skipInitialAnimation, onProgress, gestureConfig, autoScroll, infiniteScroll, preload, }: ScrollContainerProps): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=ScrollContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../components/ScrollContainer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,OAAO,KAAK,EAAE,oBAAoB,EAAmC,MAAM,UAAU,CAAC;AAEtF,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAc,EACd,kBAAgD,EAChD,gBAA4C,EAC5C,YAAY,EACZ,aAAa,EAEb,cAAsB,EACtB,eAAuB,EACvB,UAAe,EAEf,oBAA2B,EAC3B,qBAA4B,EAE5B,iBAAyB,EAEzB,WAAwB,EAExB,oBAA4B,EAC5B,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAsB,EACtB,OAAc,GACf,EAAE,oBAAoB,2CA6KtB"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Scroll System - Debug Overlay
3
+ * ===============================
4
+ * Visual debugging component for the scroll system.
5
+ * Shows internal state in real-time for development.
6
+ *
7
+ * Usage: <ScrollDebugOverlay /> inside ScrollContainer
8
+ */
9
+ interface ScrollDebugOverlayProps {
10
+ /** Position of the overlay (default: "bottom-left") */
11
+ position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
12
+ /** Show/hide the overlay (default: true) */
13
+ visible?: boolean;
14
+ }
15
+ export declare function ScrollDebugOverlay({ position, visible, }: ScrollDebugOverlayProps): import("react/jsx-runtime").JSX.Element | null;
16
+ export default ScrollDebugOverlay;
17
+ //# sourceMappingURL=ScrollDebugOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollDebugOverlay.d.ts","sourceRoot":"","sources":["../../components/ScrollDebugOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,UAAU,uBAAuB;IAC/B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACrE,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAwB,EACxB,OAAc,GACf,EAAE,uBAAuB,kDAiEzB;AA8BD,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Scroll System - Scroll Locked View
3
+ * ==========================================
4
+ * Vista con scroll interno.
5
+ * Responsabilidad ÚNICA: Medir y reportar métricas al Store (vía hook).
6
+ * NO decide si bloquear o no.
7
+ */
8
+ import type { ScrollLockedViewProps } from "../types";
9
+ export declare function ScrollLockedView({ id, children, className, scrollDirection, scrollEndThreshold, onScrollProgress, onActivate, onDeactivate, onEnterStart, onEnterEnd, onExitStart, onExitEnd, }: ScrollLockedViewProps): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=ScrollLockedView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollLockedView.d.ts","sourceRoot":"","sources":["../../components/ScrollLockedView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAA4B,EAC5B,kBAAyB,EACzB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,qBAAqB,2CA8CvB"}
@@ -0,0 +1,9 @@
1
+ export * from "./ScrollContainer";
2
+ export * from "./FullView";
3
+ export * from "./ScrollLockedView";
4
+ export * from "./ControlledView";
5
+ export * from "./ScrollDebugOverlay";
6
+ export * from "./AriaLiveRegion";
7
+ export * from "./LazyView";
8
+ export * from "./NestedScrollView";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * PABRIX Scroll System - Constants
3
+ * =================================
4
+ */
5
+ export declare const DEFAULT_TRANSITION_DURATION = 700;
6
+ export declare const DEFAULT_TRANSITION_EASING = "cubic-bezier(0.645, 0.045, 0.355, 1.000)";
7
+ export declare const DEFAULT_SCROLL_END_THRESHOLD = 0.99;
8
+ export declare const DEFAULT_PROGRESS_DEBOUNCE = 16;
9
+ export declare const NAVIGATION_COOLDOWN = 500;
10
+ export declare const NAV_THRESHOLDS: {
11
+ WHEEL: number;
12
+ TOUCH: number;
13
+ };
14
+ export declare const MIN_SWIPE_DISTANCE = 50;
15
+ export declare const MIN_SWIPE_VELOCITY = 0.3;
16
+ export declare const SCROLL_INTENT_THRESHOLD = 40;
17
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,yBAAyB,6CAA6C,CAAC;AAGpF,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAG5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAGvC,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AAGF,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
@@ -0,0 +1,21 @@
1
+ export * from "./useNavigation";
2
+ export * from "./useViewProgress";
3
+ export * from "./useWheelHandler";
4
+ export * from "./useTouchHandler";
5
+ export * from "./useKeyboardHandler";
6
+ export * from "./useHashSync";
7
+ export * from "./useDragHandler";
8
+ export * from "./useFocusManagement";
9
+ export * from "./useScrollAnalytics";
10
+ export * from "./useViewRegistration";
11
+ export * from "./useScrollSystem";
12
+ export * from "./useMetricsReporter";
13
+ export * from "./useGlobalProgress";
14
+ export * from "./useScrollLock";
15
+ export * from "./usePreload";
16
+ export * from "./useAutoScroll";
17
+ export * from "./useParallax";
18
+ export * from "./useSnapPoints";
19
+ export * from "./useInfiniteScroll";
20
+ export * from "./useGestureConfig";
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * useAutoScroll Hook
3
+ * ========================================
4
+ * Enables automatic view advancement (carousel/autoplay functionality).
5
+ * Respects user interaction and can be paused/resumed programmatically.
6
+ */
7
+ import type { AutoScrollConfig } from "../types";
8
+ export interface AutoScrollState {
9
+ /** Whether auto-scroll is currently active (not paused) */
10
+ isPlaying: boolean;
11
+ /** Whether auto-scroll is paused due to user interaction */
12
+ isPaused: boolean;
13
+ /** Manually pause auto-scroll */
14
+ pause: () => void;
15
+ /** Manually resume auto-scroll */
16
+ resume: () => void;
17
+ /** Toggle play/pause state */
18
+ toggle: () => void;
19
+ /** Reset the interval timer */
20
+ reset: () => void;
21
+ }
22
+ /**
23
+ * Hook to enable automatic view advancement.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * const { isPlaying, pause, resume } = useAutoScroll({
28
+ * enabled: true,
29
+ * interval: 4000,
30
+ * pauseOnInteraction: true,
31
+ * });
32
+ *
33
+ * return (
34
+ * <button onClick={isPlaying ? pause : resume}>
35
+ * {isPlaying ? 'Pause' : 'Play'}
36
+ * </button>
37
+ * );
38
+ * ```
39
+ */
40
+ export declare function useAutoScroll(config: AutoScrollConfig): AutoScrollState;
41
+ //# sourceMappingURL=useAutoScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoScroll.d.ts","sourceRoot":"","sources":["../../hooks/useAutoScroll.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAWjD,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,kCAAkC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,eAAe,CAmJvE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Scroll System - Drag Handler (Touch Physics)
3
+ * ==============================================
4
+ * Implements 1:1 direct manipulation for touch devices.
5
+ *
6
+ * Features:
7
+ * - Real-time tracking of finger position
8
+ * - Outputs dragOffset for visual feedback
9
+ * - Spring-based release detection (snap vs. proceed)
10
+ *
11
+ * This hook works alongside useTouchHandler which handles discrete swipes.
12
+ */
13
+ export interface DragState {
14
+ isDragging: boolean;
15
+ dragOffset: number;
16
+ dragDirection: "up" | "down" | null;
17
+ }
18
+ export interface UseDragHandlerOptions {
19
+ /** Enable/disable drag handling (default: true) */
20
+ enabled?: boolean;
21
+ /** Callback when drag state changes */
22
+ onDragUpdate?: (state: DragState) => void;
23
+ /** Callback when drag completes with navigation decision */
24
+ onDragEnd?: (shouldNavigate: boolean, direction: "up" | "down") => void;
25
+ }
26
+ export declare function useDragHandler(options?: UseDragHandlerOptions): DragState;
27
+ export default useDragHandler;
28
+ //# sourceMappingURL=useDragHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDragHandler.d.ts","sourceRoot":"","sources":["../../hooks/useDragHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,4DAA4D;IAC5D,SAAS,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;CACzE;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,aAoJjE;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Scroll System - Focus Management Hook
3
+ * ======================================
4
+ * Manages focus when navigating between views.
5
+ * Moves focus to the active view section for screen reader accessibility.
6
+ */
7
+ export interface UseFocusManagementOptions {
8
+ /** Enable/disable focus management (default: true) */
9
+ enabled?: boolean;
10
+ /** Delay before moving focus (after transition) */
11
+ focusDelay?: number;
12
+ }
13
+ /**
14
+ * Hook that manages keyboard focus when views change.
15
+ * Should be called once in ScrollContainer.
16
+ */
17
+ export declare function useFocusManagement(options?: UseFocusManagementOptions): void;
18
+ export default useFocusManagement;
19
+ //# sourceMappingURL=useFocusManagement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFocusManagement.d.ts","sourceRoot":"","sources":["../../hooks/useFocusManagement.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,QAiCzE;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * useGestureConfig Hook
3
+ * ========================================
4
+ * Manages gesture configuration for scroll interactions.
5
+ * Allows customization of swipe thresholds, velocities, and input methods.
6
+ */
7
+ import type { GestureConfig } from "../types";
8
+ declare const DEFAULT_GESTURE_CONFIG: Required<GestureConfig>;
9
+ export declare const GestureConfigContext: import("react").Context<Required<GestureConfig>>;
10
+ /**
11
+ * Hook to access gesture configuration.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { swipeThreshold, swipeVelocity } = useGestureConfig();
16
+ *
17
+ * // In touch handler:
18
+ * if (Math.abs(deltaY) > swipeThreshold || velocity > swipeVelocity) {
19
+ * navigate();
20
+ * }
21
+ * ```
22
+ */
23
+ export declare function useGestureConfig(): Required<GestureConfig>;
24
+ /**
25
+ * Merge user config with defaults.
26
+ */
27
+ export declare function mergeGestureConfig(config?: GestureConfig): Required<GestureConfig>;
28
+ /**
29
+ * Check if a gesture exceeds the threshold.
30
+ */
31
+ export declare function isGestureTriggered(config: GestureConfig, deltaX: number, deltaY: number, velocity: number, direction: "vertical" | "horizontal"): boolean;
32
+ /**
33
+ * Calculate resistance factor for boundary dragging.
34
+ */
35
+ export declare function calculateResistance(config: GestureConfig, offset: number, isAtBoundary: boolean): number;
36
+ export { DEFAULT_GESTURE_CONFIG };
37
+ //# sourceMappingURL=useGestureConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGestureConfig.d.ts","sourceRoot":"","sources":["../../hooks/useGestureConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,QAAA,MAAM,sBAAsB,EAAE,QAAQ,CAAC,aAAa,CAOnD,CAAC;AAGF,eAAO,MAAM,oBAAoB,kDAAiE,CAAC;AAEnG;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,IAAI,QAAQ,CAAC,aAAa,CAAC,CAE1D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,CAAC,EAAE,aAAa,GACrB,QAAQ,CAAC,aAAa,CAAC,CAKzB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,UAAU,GAAG,YAAY,GACnC,OAAO,CAQT;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,OAAO,GACpB,MAAM,CAQR;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * useGlobalProgress Hook
3
+ * ========================================
4
+ * Reports global scroll progress across all views.
5
+ * Progress is calculated as: (activeIndex + viewProgress) / totalViews
6
+ */
7
+ export interface UseGlobalProgressOptions {
8
+ /** Callback when progress changes */
9
+ onProgress?: (progress: number) => void;
10
+ /** Throttle updates in ms (default: 16 for 60fps) */
11
+ throttle?: number;
12
+ }
13
+ export interface GlobalProgressState {
14
+ /** Current global progress 0-1 */
15
+ progress: number;
16
+ /** Current active view index */
17
+ activeIndex: number;
18
+ /** Total number of views */
19
+ totalViews: number;
20
+ /** Progress percentage (0-100) */
21
+ percentage: number;
22
+ }
23
+ /**
24
+ * Hook to track global scroll progress across all views.
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * const { progress, percentage } = useGlobalProgress({
29
+ * onProgress: (p) => console.log(`Progress: ${p * 100}%`)
30
+ * });
31
+ *
32
+ * return <ProgressBar value={percentage} />;
33
+ * ```
34
+ */
35
+ export declare function useGlobalProgress(options?: UseGlobalProgressOptions): GlobalProgressState;
36
+ //# sourceMappingURL=useGlobalProgress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGlobalProgress.d.ts","sourceRoot":"","sources":["../../hooks/useGlobalProgress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,wBAAwB;IACvC,qCAAqC;IACrC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,mBAAmB,CA0BrB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Scroll System - Hash Sync Handler
3
+ * ==========================================
4
+ * Synchronizes active view with URL hash for deep linking.
5
+ *
6
+ * Features:
7
+ * - Updates URL hash when view changes (pushState or replaceState)
8
+ * - Navigates to view when URL hash changes (popstate)
9
+ * - Handles initial load navigation based on hash
10
+ *
11
+ * Usage:
12
+ * useHashSync({ enabled: true, pushHistory: true })
13
+ */
14
+ export interface UseHashSyncOptions {
15
+ /** Enable/disable hash syncing (default: true) */
16
+ enabled?: boolean;
17
+ /** Use pushState (true) or replaceState (false) for hash updates (default: false) */
18
+ pushHistory?: boolean;
19
+ /** Prefix for hash (e.g., "view-" creates "#view-0") (default: "") */
20
+ hashPrefix?: string;
21
+ }
22
+ export declare function useHashSync(options?: UseHashSyncOptions): void;
23
+ export default useHashSync;
24
+ //# sourceMappingURL=useHashSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHashSync.d.ts","sourceRoot":"","sources":["../../hooks/useHashSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qFAAqF;IACrF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,QAoF3D;AAED,eAAe,WAAW,CAAC"}