@react-hive/honey-layout 10.3.0 → 10.4.1

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.
@@ -1,6 +1,6 @@
1
1
  import type { FastOmit } from '@react-hive/honey-style';
2
2
  import type { ReactNode } from 'react';
3
- import type { HoneyActiveOverlay, HoneyOverlayId, Nullable } from '../types';
3
+ import type { HoneyActiveOverlay, HoneyOverlayId, Nullable } from '~/types';
4
4
  import type { HoneyFlexProps } from './HoneyFlex';
5
5
  export interface HoneyOverlayContext {
6
6
  /**
@@ -1,8 +1,8 @@
1
1
  import type { RefObject } from 'react';
2
- import type { Nullable } from '../types';
2
+ import { Axis } from '@react-hive/honey-utils';
3
+ import type { Nullable } from '~/types';
3
4
  import type { HoneyDragHandlers } from './use-honey-drag';
4
- type Axis = 'x' | 'y' | 'both';
5
- interface ApplyAxisScrollParams {
5
+ interface ResolveAxisTranslateOptions {
6
6
  /**
7
7
  * Drag delta for the axis (deltaX or deltaY).
8
8
  */
@@ -10,7 +10,7 @@ interface ApplyAxisScrollParams {
10
10
  /**
11
11
  * Current translate value for the axis.
12
12
  */
13
- currentTranslate: number;
13
+ translate: number;
14
14
  /**
15
15
  * Visible container size for the axis (width or height).
16
16
  */
@@ -24,13 +24,7 @@ interface ApplyAxisScrollParams {
24
24
  */
25
25
  overscrollPct: number;
26
26
  }
27
- /**
28
- * Calculates the next translate value for a single scroll axis
29
- * and determines whether movement is allowed within bounds.
30
- *
31
- * @returns The next translate value, or `null` if movement is not allowed.
32
- */
33
- export declare const applyAxisScroll: ({ delta, currentTranslate, containerSize, overflowSize, overscrollPct, }: ApplyAxisScrollParams) => Nullable<number>;
27
+ export declare const resolveAxisTranslate: ({ delta, translate, containerSize, overflowSize, overscrollPct, }: ResolveAxisTranslateOptions) => Nullable<number>;
34
28
  export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> extends Pick<HoneyDragHandlers<Element>, 'onStartDrag' | 'onEndDrag'> {
35
29
  /**
36
30
  * Axis along which synthetic scrolling is enabled.
@@ -62,6 +56,19 @@ export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> ext
62
56
  * @default true
63
57
  */
64
58
  resetOnResize?: boolean;
59
+ /**
60
+ * Enables synthetic scrolling driven by pointer-based scroll input,
61
+ * such as mouse wheels and trackpads.
62
+ *
63
+ * When enabled, scroll input is intercepted and converted into bounded
64
+ * translation using the same logic as drag gestures.
65
+ *
66
+ * When disabled, native scrolling behavior is preserved and no scroll
67
+ * input is handled by this hook.
68
+ *
69
+ * @default true
70
+ */
71
+ enablePointerScroll?: boolean;
65
72
  }
66
73
  /**
67
74
  * Enables synthetic scrolling for a container using pointer-based drag gestures.
@@ -85,5 +92,5 @@ export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> ext
85
92
  *
86
93
  * @returns A ref that must be attached to the scrollable container element.
87
94
  */
88
- export declare const useHoneySyntheticScroll: <Element extends HTMLElement>({ axis, overscrollPct, onStartDrag, onEndDrag, resetOnResize, }?: UseHoneySyntheticScrollOptions<Element>) => RefObject<Nullable<Element>>;
95
+ export declare const useHoneySyntheticScroll: <Element extends HTMLElement>({ axis, overscrollPct, onStartDrag, onEndDrag, resetOnResize, enablePointerScroll, }?: UseHoneySyntheticScrollOptions<Element>) => RefObject<Nullable<Element>>;
89
96
  export {};