@react-hive/honey-layout 14.0.0 → 14.2.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.
@@ -1,4 +1,4 @@
1
- import type { HoneyOverlayId, HoneyOverlayEventListenerHandler } from '~/types';
1
+ import type { HoneyOverlayId, HoneyOverlayEventListenerHandler } from '../types';
2
2
  interface UseHoneyOverlayOptions {
3
3
  onKeyUp?: HoneyOverlayEventListenerHandler;
4
4
  }
@@ -26,5 +26,5 @@ interface UseHoneyOverlayOptions {
26
26
  * });
27
27
  * ```
28
28
  */
29
- export declare const useHoneyOverlay: (targetOverlayId: HoneyOverlayId, { onKeyUp }?: UseHoneyOverlayOptions) => import("~/types").HoneyActiveOverlay | undefined;
29
+ export declare const useHoneyOverlay: (targetOverlayId: HoneyOverlayId, { onKeyUp }?: UseHoneyOverlayOptions) => import("../types").HoneyActiveOverlay | undefined;
30
30
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { RefObject } from 'react';
2
- import { Axis } from '@react-hive/honey-utils';
3
- import type { Nullable } from '~/types';
2
+ import type { Axis } from '@react-hive/honey-utils';
3
+ import type { Nullable } from '../types';
4
4
  import type { UseHoneyDragHandlers } from './use-honey-drag';
5
5
  interface ResolveAxisTranslateOptions {
6
6
  /**
@@ -48,6 +48,33 @@ export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> ext
48
48
  * @default 0
49
49
  */
50
50
  overscrollPct?: number;
51
+ /**
52
+ * Controls how the hook applies scroll-related interaction styles
53
+ * (`touch-action` and `overscroll-behavior`) to the container.
54
+ *
55
+ * Synthetic scrolling often requires restricting native browser scrolling
56
+ * behavior to ensure consistent drag and wheel handling.
57
+ *
58
+ * However, in some embedded layouts (such as carousels placed inside a
59
+ * vertically scrollable page), applying these styles can unintentionally
60
+ * block natural page scrolling.
61
+ *
62
+ * ### Modes
63
+ * - `'default'` — Applies restrictive interaction styles:
64
+ * - `overscroll-behavior: contain`
65
+ * - Axis-aware `touch-action` (`pan-y`, `pan-x`, or `none`)
66
+ *
67
+ * Recommended for standalone synthetic scroll containers.
68
+ *
69
+ * - `'embedded'` — Does not apply any interaction-blocking styles.
70
+ *
71
+ * Recommended when the container is integrated into another scrollable
72
+ * context (e.g. horizontal carousel inside a page), where native scroll
73
+ * chaining must remain intact.
74
+ *
75
+ * @default 'default'
76
+ */
77
+ scrollMode?: 'default' | 'embedded';
51
78
  /**
52
79
  * Whether to clear any applied translation transforms when the window resizes.
53
80
  *
@@ -69,6 +96,26 @@ export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> ext
69
96
  * @default true
70
97
  */
71
98
  enablePointerScroll?: boolean;
99
+ /**
100
+ * Master toggle for the synthetic scroll behavior.
101
+ *
102
+ * When `true`, the hook:
103
+ * - Enables drag-based translation via {@link useHoneyDrag}.
104
+ * - Optionally resets transforms on resize via {@link useHoneyResize}.
105
+ * - Applies overscroll and touch-action styles.
106
+ * - Intercepts wheel / trackpad scroll input if {@link enablePointerScroll} is enabled.
107
+ *
108
+ * When `false`, the hook becomes completely inert:
109
+ * - No drag or wheel listeners are attached.
110
+ * - No transforms are applied.
111
+ * - Native scrolling behavior is preserved.
112
+ *
113
+ * Useful for conditionally disabling synthetic scrolling
114
+ * (e.g. mobile layouts, reduced motion, or feature flags).
115
+ *
116
+ * @default true
117
+ */
118
+ enabled?: boolean;
72
119
  }
73
120
  /**
74
121
  * Enables synthetic scrolling for a container using pointer-based drag gestures.
@@ -92,5 +139,5 @@ export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> ext
92
139
  *
93
140
  * @returns A ref that must be attached to the scrollable container element.
94
141
  */
95
- export declare const useHoneySyntheticScroll: <Element extends HTMLElement>({ axis, overscrollPct, onStartDrag, onEndDrag, resetOnResize, enablePointerScroll, }?: UseHoneySyntheticScrollOptions<Element>) => RefObject<Nullable<Element>>;
142
+ export declare const useHoneySyntheticScroll: <Element extends HTMLElement>({ axis, overscrollPct, onStartDrag, onEndDrag, scrollMode, resetOnResize, enablePointerScroll, enabled, }?: UseHoneySyntheticScrollOptions<Element>) => RefObject<Nullable<Element>>;
96
143
  export {};
@@ -1,4 +1,4 @@
1
- import type { HoneyActiveOverlay, HoneyOverlayConfig, Nullable } from '~/types';
1
+ import type { HoneyActiveOverlay, HoneyOverlayConfig, Nullable } from '../types';
2
2
  /**
3
3
  * A hook for registering and managing an overlay in the layout system.
4
4
  *