@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.
- package/dist/components/HoneyBox/HoneyBox.d.ts +1 -1
- package/dist/components/HoneyFlex/HoneyFlex.d.ts +1 -1
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +1 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +1 -1
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistryContext.d.ts +1 -1
- package/dist/components/HoneyList/HoneyListStyled.d.ts +1 -1
- package/dist/components/HoneyOverlay.d.ts +1 -1
- package/dist/components/HoneyPopup/HoneyPopupContent.d.ts +1 -1
- package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +1 -1
- package/dist/components/HoneyPopup/hooks/use-honey-popup-context.d.ts +1 -1
- package/dist/contexts/HoneyLayoutContext.d.ts +1 -1
- package/dist/helpers/helpers.d.ts +1 -1
- package/dist/hooks/use-honey-document-key-up.d.ts +1 -1
- package/dist/hooks/use-honey-drag.d.ts +1 -1
- package/dist/hooks/use-honey-layout.d.ts +1 -1
- package/dist/hooks/use-honey-media-query.d.ts +1 -1
- package/dist/hooks/use-honey-overlay.d.ts +2 -2
- package/dist/hooks/use-honey-synthetic-scroll.d.ts +50 -3
- package/dist/hooks/use-register-honey-overlay.d.ts +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +161 -150
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/providers/HoneyLayoutProvider.d.ts +1 -1
- package/dist/providers/hooks/use-honey-overlays.d.ts +2 -2
- package/package.json +20 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HoneyOverlayId, HoneyOverlayEventListenerHandler } from '
|
|
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("
|
|
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 '
|
|
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 {};
|