etudes 6.1.1 → 6.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.
|
@@ -11,7 +11,7 @@ export type SwipeContainerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
11
11
|
* An empty component with a backing `<div>` element that detects swipe
|
|
12
12
|
* gestures.
|
|
13
13
|
*/
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const SwipeRegion: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
15
15
|
isEnabled?: boolean;
|
|
16
16
|
threshold?: number;
|
|
17
17
|
onSwipeDown?: () => void;
|
|
@@ -5,7 +5,7 @@ import { Point } from 'spase';
|
|
|
5
5
|
* An empty component with a backing `<div>` element that detects swipe
|
|
6
6
|
* gestures.
|
|
7
7
|
*/
|
|
8
|
-
export const
|
|
8
|
+
export const SwipeRegion = forwardRef(({ children, isEnabled = true, threshold = 0.5, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, ...props }, ref) => {
|
|
9
9
|
const [dragStartPosition, setDragStartPosition] = useState(undefined);
|
|
10
10
|
const [dragEndPosition, setDragEndPosition] = useState(undefined);
|
|
11
11
|
const [dragStartTime, setDragStartTime] = useState(NaN);
|
|
@@ -64,4 +64,4 @@ export const SwipeContainer = forwardRef(({ children, isEnabled = true, threshol
|
|
|
64
64
|
};
|
|
65
65
|
return (_jsx("div", { ...props, ref: ref, onMouseDown: event => onDragStart(event.clientX, event.clientY), onMouseLeave: () => onDragCancel(), onMouseMove: event => onDragMove(event.clientX, event.clientY), onMouseUp: () => onDragEnd(), onTouchEnd: () => onDragEnd(), onTouchMove: event => onDragMove(event.targetTouches[0].clientX, event.targetTouches[0].clientY), onTouchStart: event => onDragStart(event.targetTouches[0].clientX, event.targetTouches[0].clientY), children: children }));
|
|
66
66
|
});
|
|
67
|
-
Object.defineProperty(
|
|
67
|
+
Object.defineProperty(SwipeRegion, 'displayName', { value: 'SwipeRegion', writable: false });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "etudes",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "A study of headless React components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -74,5 +74,6 @@
|
|
|
74
74
|
"optionalDependencies": {
|
|
75
75
|
"react-router": "^6.26.2",
|
|
76
76
|
"react-router-dom": "^6.26.2"
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf"
|
|
78
79
|
}
|