@aiquants/swipe-overlay 1.2.4 → 1.2.5
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/index.d.mts +2 -32
- package/dist/index.d.ts +2 -32
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import * as react from
|
|
2
|
-
import { CSSProperties } from
|
|
3
|
-
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { CSSProperties } from "react";
|
|
4
3
|
type SwipeCloseGuardContextValue = {
|
|
5
4
|
isBlocked: boolean;
|
|
6
5
|
requestBlock: () => () => void;
|
|
7
6
|
};
|
|
8
|
-
/**
|
|
9
|
-
* Provides swipe-dismiss guard controls for mobile overlays.
|
|
10
|
-
* モバイルオーバーレイのスワイプクローズ操作を制御するガード機構を提供。
|
|
11
|
-
*/
|
|
12
7
|
declare const SwipeCloseGuardContext: react.Context<SwipeCloseGuardContextValue | null>;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the swipe-dismiss guard handlers for overlay content.
|
|
15
|
-
* オーバーレイコンテンツ用のスワイプクローズガード制御を取得するフック。
|
|
16
|
-
*/
|
|
17
8
|
declare const useSwipeCloseGuard: () => SwipeCloseGuardContextValue;
|
|
18
9
|
type OverlayEscapeEntry = {
|
|
19
10
|
id: string;
|
|
20
11
|
onEscape: (e: KeyboardEvent) => boolean;
|
|
21
12
|
};
|
|
22
|
-
/**
|
|
23
|
-
* Manages a LIFO stack for Escape key handling in overlays.
|
|
24
|
-
* オーバーレイでの Escape キー処理を LIFO (後入れ先出し) で管理するフック。
|
|
25
|
-
*/
|
|
26
13
|
declare const useOverlayEscapeStack: () => (entry: OverlayEscapeEntry) => () => void;
|
|
27
14
|
type SwipeDismissHookResult = {
|
|
28
15
|
overlayRef: (node: HTMLDivElement | null) => void;
|
|
@@ -31,10 +18,6 @@ type SwipeDismissHookResult = {
|
|
|
31
18
|
isSwiping: boolean;
|
|
32
19
|
element: HTMLDivElement | null;
|
|
33
20
|
};
|
|
34
|
-
/**
|
|
35
|
-
* Manages swipe-to-dismiss interactions on the mobile overlay panel.
|
|
36
|
-
* モバイルオーバーレイパネルのスワイプクローズ操作を管理。
|
|
37
|
-
*/
|
|
38
21
|
declare const useSwipeToDismissOverlay: ({ isOpen, onClose, isCloseBlocked, skipWhenTextSelected, swipeThreshold, flickVelocity, flickDistance, }: {
|
|
39
22
|
isOpen: boolean;
|
|
40
23
|
onClose: () => void;
|
|
@@ -44,24 +27,12 @@ declare const useSwipeToDismissOverlay: ({ isOpen, onClose, isCloseBlocked, skip
|
|
|
44
27
|
flickVelocity?: number;
|
|
45
28
|
flickDistance?: number;
|
|
46
29
|
}) => SwipeDismissHookResult;
|
|
47
|
-
/**
|
|
48
|
-
* Manages the blocking state for swipe-to-dismiss interactions.
|
|
49
|
-
* スワイプクローズ操作のブロック状態を管理するフック。
|
|
50
|
-
*/
|
|
51
30
|
declare const useSwipeGuardState: () => {
|
|
52
31
|
isBlocked: boolean;
|
|
53
32
|
requestBlock: () => () => void;
|
|
54
33
|
reset: () => void;
|
|
55
34
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Keeps the last non-null value while the overlay is closing to allow exit animations.
|
|
58
|
-
* オーバーレイが閉じるアニメーション中も、直前の非 null 値を保持します。
|
|
59
|
-
*/
|
|
60
35
|
declare function useTransitionDisplay<T>(isOpen: boolean, current: T | null): T | null;
|
|
61
|
-
/**
|
|
62
|
-
* Hook to distinguish between tap and scroll gestures.
|
|
63
|
-
* タップとスクロール操作を区別するフック。
|
|
64
|
-
*/
|
|
65
36
|
declare const useTapClick: (onTap: () => void, threshold?: number) => {
|
|
66
37
|
onPointerDown: (e: React.PointerEvent) => void;
|
|
67
38
|
onPointerUp: (e: React.PointerEvent) => void;
|
|
@@ -69,5 +40,4 @@ declare const useTapClick: (onTap: () => void, threshold?: number) => {
|
|
|
69
40
|
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
70
41
|
onClick: (e: React.MouseEvent) => void;
|
|
71
42
|
};
|
|
72
|
-
|
|
73
43
|
export { SwipeCloseGuardContext, type SwipeCloseGuardContextValue, type SwipeDismissHookResult, useOverlayEscapeStack, useSwipeCloseGuard, useSwipeGuardState, useSwipeToDismissOverlay, useTapClick, useTransitionDisplay };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import * as react from
|
|
2
|
-
import { CSSProperties } from
|
|
3
|
-
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { CSSProperties } from "react";
|
|
4
3
|
type SwipeCloseGuardContextValue = {
|
|
5
4
|
isBlocked: boolean;
|
|
6
5
|
requestBlock: () => () => void;
|
|
7
6
|
};
|
|
8
|
-
/**
|
|
9
|
-
* Provides swipe-dismiss guard controls for mobile overlays.
|
|
10
|
-
* モバイルオーバーレイのスワイプクローズ操作を制御するガード機構を提供。
|
|
11
|
-
*/
|
|
12
7
|
declare const SwipeCloseGuardContext: react.Context<SwipeCloseGuardContextValue | null>;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the swipe-dismiss guard handlers for overlay content.
|
|
15
|
-
* オーバーレイコンテンツ用のスワイプクローズガード制御を取得するフック。
|
|
16
|
-
*/
|
|
17
8
|
declare const useSwipeCloseGuard: () => SwipeCloseGuardContextValue;
|
|
18
9
|
type OverlayEscapeEntry = {
|
|
19
10
|
id: string;
|
|
20
11
|
onEscape: (e: KeyboardEvent) => boolean;
|
|
21
12
|
};
|
|
22
|
-
/**
|
|
23
|
-
* Manages a LIFO stack for Escape key handling in overlays.
|
|
24
|
-
* オーバーレイでの Escape キー処理を LIFO (後入れ先出し) で管理するフック。
|
|
25
|
-
*/
|
|
26
13
|
declare const useOverlayEscapeStack: () => (entry: OverlayEscapeEntry) => () => void;
|
|
27
14
|
type SwipeDismissHookResult = {
|
|
28
15
|
overlayRef: (node: HTMLDivElement | null) => void;
|
|
@@ -31,10 +18,6 @@ type SwipeDismissHookResult = {
|
|
|
31
18
|
isSwiping: boolean;
|
|
32
19
|
element: HTMLDivElement | null;
|
|
33
20
|
};
|
|
34
|
-
/**
|
|
35
|
-
* Manages swipe-to-dismiss interactions on the mobile overlay panel.
|
|
36
|
-
* モバイルオーバーレイパネルのスワイプクローズ操作を管理。
|
|
37
|
-
*/
|
|
38
21
|
declare const useSwipeToDismissOverlay: ({ isOpen, onClose, isCloseBlocked, skipWhenTextSelected, swipeThreshold, flickVelocity, flickDistance, }: {
|
|
39
22
|
isOpen: boolean;
|
|
40
23
|
onClose: () => void;
|
|
@@ -44,24 +27,12 @@ declare const useSwipeToDismissOverlay: ({ isOpen, onClose, isCloseBlocked, skip
|
|
|
44
27
|
flickVelocity?: number;
|
|
45
28
|
flickDistance?: number;
|
|
46
29
|
}) => SwipeDismissHookResult;
|
|
47
|
-
/**
|
|
48
|
-
* Manages the blocking state for swipe-to-dismiss interactions.
|
|
49
|
-
* スワイプクローズ操作のブロック状態を管理するフック。
|
|
50
|
-
*/
|
|
51
30
|
declare const useSwipeGuardState: () => {
|
|
52
31
|
isBlocked: boolean;
|
|
53
32
|
requestBlock: () => () => void;
|
|
54
33
|
reset: () => void;
|
|
55
34
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Keeps the last non-null value while the overlay is closing to allow exit animations.
|
|
58
|
-
* オーバーレイが閉じるアニメーション中も、直前の非 null 値を保持します。
|
|
59
|
-
*/
|
|
60
35
|
declare function useTransitionDisplay<T>(isOpen: boolean, current: T | null): T | null;
|
|
61
|
-
/**
|
|
62
|
-
* Hook to distinguish between tap and scroll gestures.
|
|
63
|
-
* タップとスクロール操作を区別するフック。
|
|
64
|
-
*/
|
|
65
36
|
declare const useTapClick: (onTap: () => void, threshold?: number) => {
|
|
66
37
|
onPointerDown: (e: React.PointerEvent) => void;
|
|
67
38
|
onPointerUp: (e: React.PointerEvent) => void;
|
|
@@ -69,5 +40,4 @@ declare const useTapClick: (onTap: () => void, threshold?: number) => {
|
|
|
69
40
|
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
70
41
|
onClick: (e: React.MouseEvent) => void;
|
|
71
42
|
};
|
|
72
|
-
|
|
73
43
|
export { SwipeCloseGuardContext, type SwipeCloseGuardContextValue, type SwipeDismissHookResult, useOverlayEscapeStack, useSwipeCloseGuard, useSwipeGuardState, useSwipeToDismissOverlay, useTapClick, useTransitionDisplay };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/swipe-overlay",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "React hooks and context for swipe-to-dismiss overlay interactions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
|
-
"build": "tsup",
|
|
58
|
+
"build": "tsup && node ../../.config/scripts/strip-dts-comments.mjs dist",
|
|
59
59
|
"build:watch": "tsup --watch",
|
|
60
60
|
"dev": "tsup --watch",
|
|
61
61
|
"watch": "tsup --watch",
|