@react-hive/honey-layout 11.2.0 → 12.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.
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistry.d.ts +18 -0
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistry.types.d.ts +27 -0
- package/dist/components/HoneyLayerRegistry/HoneyLayerRegistryContext.d.ts +43 -0
- package/dist/components/HoneyLayerRegistry/hooks/index.d.ts +1 -0
- package/dist/components/HoneyLayerRegistry/hooks/use-honey-layer-registry-context.d.ts +9 -0
- package/dist/components/HoneyLayerRegistry/index.d.ts +3 -0
- package/dist/components/HoneyPopup/HoneyPopupContent.d.ts +1 -2
- package/dist/components/HoneyPopup/hooks/use-honey-popup-context.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/HoneyLayoutContext.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/{use-honey-document-key-up-handler.d.ts → use-honey-document-key-up.d.ts} +6 -6
- package/dist/hooks/use-honey-drag.d.ts +13 -13
- 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-raf-loop.d.ts +4 -4
- package/dist/hooks/use-honey-synthetic-scroll.d.ts +2 -2
- package/dist/hooks/use-honey-timer.d.ts +2 -2
- package/dist/hooks/use-register-honey-overlay.d.ts +3 -3
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +309 -133
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +14 -14
- 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 +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Provides a stack-based registry for managing layered UI elements.
|
|
5
|
+
*
|
|
6
|
+
* This component is intentionally generic and UI-agnostic.
|
|
7
|
+
* It can be used to manage:
|
|
8
|
+
* - curtains
|
|
9
|
+
* - modals
|
|
10
|
+
* - drawers
|
|
11
|
+
* - tooltips
|
|
12
|
+
* - popovers
|
|
13
|
+
* - any ordered overlay system
|
|
14
|
+
*
|
|
15
|
+
* If a parent {@link HoneyLayerRegistry} already exists in the tree,
|
|
16
|
+
* this component becomes a no-op and does not create a nested registry.
|
|
17
|
+
*/
|
|
18
|
+
export declare const HoneyLayerRegistry: ({ children }: PropsWithChildren) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unique identifier for a registered layer.
|
|
3
|
+
*
|
|
4
|
+
* The ID is ephemeral and only guaranteed to be unique within the lifetime of the registry.
|
|
5
|
+
*/
|
|
6
|
+
export type HoneyLayerId = string;
|
|
7
|
+
/**
|
|
8
|
+
* A single layer entry stored in the registry.
|
|
9
|
+
*
|
|
10
|
+
* @template TPayload - Optional payload associated with the layer.
|
|
11
|
+
*/
|
|
12
|
+
export interface HoneyLayerEntry<TPayload = undefined> {
|
|
13
|
+
/**
|
|
14
|
+
* Unique identifier of the layer.
|
|
15
|
+
*/
|
|
16
|
+
id: HoneyLayerId;
|
|
17
|
+
/**
|
|
18
|
+
* Arbitrary payload associated with the layer.
|
|
19
|
+
*
|
|
20
|
+
* Can be used to store metadata such as:
|
|
21
|
+
* - layer type
|
|
22
|
+
* - priority
|
|
23
|
+
* - owner component
|
|
24
|
+
* - configuration data
|
|
25
|
+
*/
|
|
26
|
+
payload: TPayload;
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { HoneyLayerId, HoneyLayerEntry } from '~/components';
|
|
2
|
+
/**
|
|
3
|
+
* Context value exposed by {@link HoneyLayerRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* @template TPayload - Payload type associated with registered layers.
|
|
6
|
+
*/
|
|
7
|
+
export interface HoneyLayerRegistryContextValue<TPayload = undefined> {
|
|
8
|
+
/**
|
|
9
|
+
* Ordered list of currently registered layers.
|
|
10
|
+
*
|
|
11
|
+
* The order reflects the registration sequence:
|
|
12
|
+
* - earlier items are "below"
|
|
13
|
+
* - later items are "above"
|
|
14
|
+
*/
|
|
15
|
+
layers: HoneyLayerEntry<TPayload>[];
|
|
16
|
+
/**
|
|
17
|
+
* Registers a new layer in the registry.
|
|
18
|
+
*
|
|
19
|
+
* @param payload - Optional payload associated with the layer.
|
|
20
|
+
*
|
|
21
|
+
* @returns The generated {@link HoneyLayerId}.
|
|
22
|
+
*/
|
|
23
|
+
registerLayer: (payload?: TPayload) => HoneyLayerId;
|
|
24
|
+
/**
|
|
25
|
+
* Unregisters an existing layer.
|
|
26
|
+
*
|
|
27
|
+
* If the layer ID does not exist, this operation is a no-op.
|
|
28
|
+
*
|
|
29
|
+
* @param layerId - ID of the layer to remove.
|
|
30
|
+
*/
|
|
31
|
+
unregisterLayer: (layerId: HoneyLayerId) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the zero-based index of a layer in the stack.
|
|
34
|
+
*
|
|
35
|
+
* @param layerId - ID of the layer.
|
|
36
|
+
*
|
|
37
|
+
* @returns
|
|
38
|
+
* - `0` or greater if the layer is registered
|
|
39
|
+
* - `-1` if the layer is not found
|
|
40
|
+
*/
|
|
41
|
+
getLayerIndex: (layerId: HoneyLayerId) => number;
|
|
42
|
+
}
|
|
43
|
+
export declare const HoneyLayerRegistryContext: import("react").Context<HoneyLayerRegistryContextValue<undefined> | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-honey-layer-registry-context';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HoneyLayerRegistryContextValue } from '../HoneyLayerRegistryContext';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for accessing the nearest {@link HoneyLayerRegistry}.
|
|
4
|
+
*
|
|
5
|
+
* @template TPayload - Expected payload type of the registry.
|
|
6
|
+
*
|
|
7
|
+
* @throws If used outside of a {@link HoneyLayerRegistry} provider.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useHoneyLayerRegistryContext: <TPayload>() => HoneyLayerRegistryContextValue<TPayload>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import type { ReferenceType, FloatingArrowProps, FloatingFocusManagerProps, MiddlewareData } from '@floating-ui/react';
|
|
3
3
|
import type { FastOmit } from '@react-hive/honey-style';
|
|
4
|
+
import type { HoneyPopupContextValue, HoneyOverlayProps } from '~/components';
|
|
4
5
|
import type { HoneyPopupPortalProps } from './HoneyPopupPortal';
|
|
5
6
|
import type { HoneyPopupStyledProps } from './HoneyPopupStyled';
|
|
6
|
-
import type { HoneyPopupContextValue } from './HoneyPopupContext';
|
|
7
7
|
import type { UseHoneyPopupOptions } from './hooks';
|
|
8
|
-
import type { HoneyOverlayProps } from '../HoneyOverlay';
|
|
9
8
|
type InheritedHoneyOverlayProps = FastOmit<HoneyOverlayProps, 'children' | 'active' | 'onDeactivate' | '$position'>;
|
|
10
9
|
export interface HoneyPopupContentProps<Context, Reference extends ReferenceType, UseAutoSize extends boolean> extends UseHoneyPopupOptions<Reference, UseAutoSize> {
|
|
11
10
|
children: ReactNode | ((context: HoneyPopupContextValue<Context, Reference>) => ReactNode);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReferenceType } from '@floating-ui/react';
|
|
2
|
-
import type { HoneyPopupContextValue } from '
|
|
2
|
+
import type { HoneyPopupContextValue } from '~/components';
|
|
3
3
|
export declare const useHoneyPopupContext: <Context, Reference extends ReferenceType = ReferenceType>() => HoneyPopupContextValue<Context, Reference>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HoneyTheme } from '@react-hive/honey-style';
|
|
2
|
-
import type { HoneyOverlayConfig, HoneyScreenState, HoneyOverlayId, HoneyActiveOverlay } from '
|
|
2
|
+
import type { HoneyOverlayConfig, HoneyScreenState, HoneyOverlayId, HoneyActiveOverlay } from '~/types';
|
|
3
3
|
/**
|
|
4
4
|
* Function to unregister a previously registered overlay.
|
|
5
5
|
*/
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './use-honey-on-change';
|
|
2
2
|
export * from './use-honey-media-query';
|
|
3
3
|
export * from './use-honey-drag';
|
|
4
|
-
export * from './use-honey-document-key-up
|
|
4
|
+
export * from './use-honey-document-key-up';
|
|
5
5
|
export * from './use-honey-layout';
|
|
6
6
|
export * from './use-register-honey-overlay';
|
|
7
7
|
export * from './use-honey-overlay';
|
package/dist/hooks/{use-honey-document-key-up-handler.d.ts → use-honey-document-key-up.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { HoneyKeyboardEventCode } from '
|
|
2
|
-
export type
|
|
3
|
-
interface
|
|
1
|
+
import type { HoneyKeyboardEventCode } from '~/types';
|
|
2
|
+
export type UseHoneyDocumentOnKeyUpHandler = (keyCode: HoneyKeyboardEventCode, e: KeyboardEvent) => void;
|
|
3
|
+
interface UseHoneyDocumentKeyUpOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Whether the event listener should be active.
|
|
6
6
|
*
|
|
@@ -22,13 +22,13 @@ interface UseHoneyDocumentKeyUpHandlerOptions {
|
|
|
22
22
|
* This hook adds a `keyup` event listener at the document level and triggers the provided `keyUpHandler`
|
|
23
23
|
* when one of the specified `listenKeys` is released.
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
25
|
+
* @param onKeyUp - The callback function invoked when a matching key is released.
|
|
26
26
|
* @param listenKeys - An array of key codes (`KeyboardEvent.code`) to listen for.
|
|
27
27
|
* @param options - Optional configuration to control event behavior and listener activation.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```tsx
|
|
31
|
-
*
|
|
31
|
+
* useHoneyDocumentKeyUp(
|
|
32
32
|
* (keyCode, event) => {
|
|
33
33
|
* console.log('Key released:', keyCode);
|
|
34
34
|
* },
|
|
@@ -36,5 +36,5 @@ interface UseHoneyDocumentKeyUpHandlerOptions {
|
|
|
36
36
|
* );
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
export declare const
|
|
39
|
+
export declare const useHoneyDocumentKeyUp: (onKeyUp: UseHoneyDocumentOnKeyUpHandler, listenKeys: HoneyKeyboardEventCode[], { enabled, preventDefault }?: UseHoneyDocumentKeyUpOptions) => void;
|
|
40
40
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
import type { Nullable } from '
|
|
2
|
+
import type { Nullable } from '~/types';
|
|
3
3
|
/**
|
|
4
4
|
* Invoked when a drag gesture is about to start.
|
|
5
5
|
*
|
|
@@ -20,14 +20,14 @@ import type { Nullable } from '../types';
|
|
|
20
20
|
* - `true` to allow the drag to begin
|
|
21
21
|
* - `false` to cancel the drag
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type UseHoneyDragOnStartHandler<Element extends HTMLElement> = (draggableElement: Element, e: MouseEvent | TouchEvent) => Promise<boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* Context describing pointer movement during an active drag gesture.
|
|
26
26
|
*
|
|
27
27
|
* All values are expressed in **pixels** and are relative
|
|
28
28
|
* to the drag start or previous frame as noted.
|
|
29
29
|
*/
|
|
30
|
-
export interface
|
|
30
|
+
export interface UseHoneyDragOnMoveContext {
|
|
31
31
|
/**
|
|
32
32
|
* Horizontal delta since the previous move event.
|
|
33
33
|
*
|
|
@@ -64,18 +64,18 @@ export interface HoneyDragMoveContext {
|
|
|
64
64
|
* @param draggableElement - The element being dragged.
|
|
65
65
|
*
|
|
66
66
|
* @returns A function invoked on every pointer move, receiving
|
|
67
|
-
* {@link
|
|
67
|
+
* {@link UseHoneyDragOnMoveContext}, and resolving to:
|
|
68
68
|
* - `true` to continue dragging
|
|
69
69
|
* - `false` to stop dragging immediately
|
|
70
70
|
*/
|
|
71
|
-
export type
|
|
71
|
+
export type UseHoneyDragOnMoveHandler<Element extends HTMLElement> = (draggableElement: Element) => (context: UseHoneyDragOnMoveContext) => Promise<boolean>;
|
|
72
72
|
/**
|
|
73
73
|
* Context describing the final state of a completed drag gesture.
|
|
74
74
|
*
|
|
75
75
|
* This context exposes **release velocity**, which is suitable for
|
|
76
76
|
* inertia, momentum, or decay-based motion systems.
|
|
77
77
|
*/
|
|
78
|
-
interface
|
|
78
|
+
interface UseHoneyDragOnEndContext {
|
|
79
79
|
/**
|
|
80
80
|
* Total horizontal displacement from drag start to release.
|
|
81
81
|
*/
|
|
@@ -117,7 +117,7 @@ interface HoneyDragEndContext {
|
|
|
117
117
|
*
|
|
118
118
|
* @returns A promise that resolves when cleanup or follow-up logic completes.
|
|
119
119
|
*/
|
|
120
|
-
export type
|
|
120
|
+
export type UseHoneyDragOnEndHandler<Element extends HTMLElement> = (context: UseHoneyDragOnEndContext, draggableElement: Element, e: MouseEvent | TouchEvent) => Promise<void>;
|
|
121
121
|
/**
|
|
122
122
|
* Collection of handlers controlling the lifecycle of a drag gesture.
|
|
123
123
|
*
|
|
@@ -126,7 +126,7 @@ export type HoneyDragOnEndHandler<Element extends HTMLElement> = (context: Honey
|
|
|
126
126
|
* - How movement is handled
|
|
127
127
|
* - What happens when dragging ends
|
|
128
128
|
*/
|
|
129
|
-
export interface
|
|
129
|
+
export interface UseHoneyDragHandlers<Element extends HTMLElement> {
|
|
130
130
|
/**
|
|
131
131
|
* Optional handler triggered when the drag operation starts.
|
|
132
132
|
* This is useful for capturing the initial state or performing any setup actions before the drag starts.
|
|
@@ -135,7 +135,7 @@ export interface HoneyDragHandlers<Element extends HTMLElement> {
|
|
|
135
135
|
*
|
|
136
136
|
* @returns A boolean or Promise resolving to a boolean indicating if the drag should proceed.
|
|
137
137
|
*/
|
|
138
|
-
onStartDrag?:
|
|
138
|
+
onStartDrag?: UseHoneyDragOnStartHandler<Element>;
|
|
139
139
|
/**
|
|
140
140
|
* Required handler triggered continuously during the drag operation.
|
|
141
141
|
* This handler is responsible for updating the drag state and typically tracks the element's movement.
|
|
@@ -144,7 +144,7 @@ export interface HoneyDragHandlers<Element extends HTMLElement> {
|
|
|
144
144
|
*
|
|
145
145
|
* @returns A boolean or Promise resolving to a boolean indicating whether the drag should continue.
|
|
146
146
|
*/
|
|
147
|
-
onMoveDrag:
|
|
147
|
+
onMoveDrag: UseHoneyDragOnMoveHandler<Element>;
|
|
148
148
|
/**
|
|
149
149
|
* Optional handler triggered when the drag operation ends.
|
|
150
150
|
* This is commonly used for cleanup or finalizing the drag process.
|
|
@@ -154,7 +154,7 @@ export interface HoneyDragHandlers<Element extends HTMLElement> {
|
|
|
154
154
|
*
|
|
155
155
|
* @returns A Promise.
|
|
156
156
|
*/
|
|
157
|
-
onEndDrag?:
|
|
157
|
+
onEndDrag?: UseHoneyDragOnEndHandler<Element>;
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
160
160
|
* Configuration options controlling drag behavior.
|
|
@@ -162,7 +162,7 @@ export interface HoneyDragHandlers<Element extends HTMLElement> {
|
|
|
162
162
|
* These options affect lifecycle handling and enable/disable logic,
|
|
163
163
|
* but do not influence movement physics directly.
|
|
164
164
|
*/
|
|
165
|
-
export interface
|
|
165
|
+
export interface UseHoneyDragOptions<Element extends HTMLElement> extends UseHoneyDragHandlers<Element> {
|
|
166
166
|
/**
|
|
167
167
|
* Controls whether the `onEndDrag` handler is skipped when the drag operation is forcibly stopped.
|
|
168
168
|
* This can be useful when dragging is interrupted or terminated early due to movement restrictions.
|
|
@@ -196,5 +196,5 @@ export interface HoneyDragOptions<Element extends HTMLElement> extends HoneyDrag
|
|
|
196
196
|
* @param draggableElementRef - Ref pointing to the draggable element.
|
|
197
197
|
* @param options - Drag lifecycle handlers and configuration flags.
|
|
198
198
|
*/
|
|
199
|
-
export declare const useHoneyDrag: <Element extends HTMLElement>(draggableElementRef: RefObject<Nullable<Element>>, { skipOnEndDragWhenStopped, enabled, onMoveDrag, onStartDrag, onEndDrag, }:
|
|
199
|
+
export declare const useHoneyDrag: <Element extends HTMLElement>(draggableElementRef: RefObject<Nullable<Element>>, { skipOnEndDragWhenStopped, enabled, onMoveDrag, onStartDrag, onEndDrag, }: UseHoneyDragOptions<Element>) => void;
|
|
200
200
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HoneyTheme } from '@react-hive/honey-style';
|
|
2
|
-
import type { HoneyScreenState } from '
|
|
2
|
+
import type { HoneyScreenState } from '~/types';
|
|
3
3
|
export interface UseHoneyMediaQueryOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Throttle interval (in milliseconds) for the resize event handler.
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface UseHoneyRafFrameContext {
|
|
2
2
|
/**
|
|
3
3
|
* Immediately terminates the active `requestAnimationFrame` loop.
|
|
4
4
|
*
|
|
@@ -29,9 +29,9 @@ interface HoneyRafFrameContext {
|
|
|
29
29
|
* time steps caused by tab backgrounding, visibility changes,
|
|
30
30
|
* or browser throttling.
|
|
31
31
|
*
|
|
32
|
-
* @param context - RAF lifecycle control context. See {@link
|
|
32
|
+
* @param context - RAF lifecycle control context. See {@link UseHoneyRafFrameContext}.
|
|
33
33
|
*/
|
|
34
|
-
export type
|
|
34
|
+
export type UseHoneyRafOnFrameHandler = (deltaTimeMs: number, context: UseHoneyRafFrameContext) => void;
|
|
35
35
|
/**
|
|
36
36
|
* Configuration options for {@link useHoneyRafLoop}.
|
|
37
37
|
*/
|
|
@@ -160,5 +160,5 @@ export interface HoneyRafLoopApi {
|
|
|
160
160
|
* useHoneyRafLoop(onFrame);
|
|
161
161
|
* ```
|
|
162
162
|
*/
|
|
163
|
-
export declare const useHoneyRafLoop: (onFrame:
|
|
163
|
+
export declare const useHoneyRafLoop: (onFrame: UseHoneyRafOnFrameHandler, { autoStart, resumeOnVisibility, maxDeltaMs, onError, }?: UseHoneyRafLoopOptions) => HoneyRafLoopApi;
|
|
164
164
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
import { Axis } from '@react-hive/honey-utils';
|
|
3
3
|
import type { Nullable } from '~/types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { UseHoneyDragHandlers } from './use-honey-drag';
|
|
5
5
|
interface ResolveAxisTranslateOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Drag delta for the axis (deltaX or deltaY).
|
|
@@ -25,7 +25,7 @@ interface ResolveAxisTranslateOptions {
|
|
|
25
25
|
overscrollPct: number;
|
|
26
26
|
}
|
|
27
27
|
export declare const resolveAxisTranslate: ({ delta, translate, containerSize, overflowSize, overscrollPct, }: ResolveAxisTranslateOptions) => Nullable<number>;
|
|
28
|
-
export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> extends Pick<
|
|
28
|
+
export interface UseHoneySyntheticScrollOptions<Element extends HTMLElement> extends Pick<UseHoneyDragHandlers<Element>, 'onStartDrag' | 'onEndDrag'> {
|
|
29
29
|
/**
|
|
30
30
|
* Axis along which synthetic scrolling is enabled.
|
|
31
31
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - `countup` — increases time until it reaches `targetTimeMs` (if provided)
|
|
6
6
|
*/
|
|
7
7
|
type UseHoneyTimerMode = 'countdown' | 'countup';
|
|
8
|
-
type
|
|
8
|
+
type UseHoneyTimerOnEndHandler = () => void;
|
|
9
9
|
export interface UseHoneyTimerOptions {
|
|
10
10
|
/**
|
|
11
11
|
* Initial timer value in milliseconds.
|
|
@@ -40,7 +40,7 @@ export interface UseHoneyTimerOptions {
|
|
|
40
40
|
/**
|
|
41
41
|
* Optional callback invoked exactly once when the timer reaches the target time.
|
|
42
42
|
*/
|
|
43
|
-
onEnd?:
|
|
43
|
+
onEnd?: UseHoneyTimerOnEndHandler;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Public control API returned by {@link useHoneyTimer}.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { HoneyActiveOverlay, HoneyOverlayConfig, Nullable } from '
|
|
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
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param shouldRegister - A flag indicating whether the overlay should be registered.
|
|
6
6
|
* @param overlayConfig - Configuration object specifying overlay behavior.
|
|
7
7
|
*
|
|
8
8
|
* @returns The registered overlay instance, or null if not registered.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useRegisterHoneyOverlay: (
|
|
10
|
+
export declare const useRegisterHoneyOverlay: (shouldRegister: boolean, overlayConfig: HoneyOverlayConfig) => Nullable<HoneyActiveOverlay>;
|