Skip to content

Commit c0230c4

Browse files
committed
fix: svelte gesture dep usage
1 parent c3e3b19 commit c0230c4

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

platforms/pictique/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@
5050
"vite": "^6.2.6"
5151
},
5252
"dependencies": {
53-
"-": "^0.0.1",
5453
"@sveltejs/adapter-node": "^5.2.12",
55-
"D": "^1.0.0",
5654
"axios": "^1.6.7",
5755
"moment": "^2.30.1",
5856
"svelte-qrcode": "^1.0.1",

platforms/pictique/src/lib/fragments/Drawer/Drawer.svelte

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import { CupertinoPane } from 'cupertino-pane';
44
import type { HTMLAttributes } from 'svelte/elements';
55
import { cn } from '$lib/utils';
6-
import { swipe } from 'svelte-gestures';
7-
import type { SwipeCustomEvent } from 'svelte-gestures';
6+
import { useSwipe, type GestureCustomEvent, type SwipeCustomEvent } from 'svelte-gestures';
87
98
interface IDrawerProps extends HTMLAttributes<HTMLDivElement> {
109
drawer?: CupertinoPane;
@@ -19,11 +18,9 @@
1918
if (drawer) drawer.destroy({ animate: true });
2019
}
2120
22-
const handleDrawerSwipe = (event: SwipeCustomEvent) => {
23-
if (event.detail.direction === ('down' as string)) {
24-
drawer?.destroy({ animate: true });
25-
}
26-
};
21+
function downSwipeHandler() {
22+
drawer?.destroy({ animate: true });
23+
}
2724
2825
onMount(() => {
2926
if (!drawerElement) return;
@@ -48,11 +45,16 @@
4845
<div
4946
bind:this={drawerElement}
5047
{...restProps}
51-
use:swipe={() => ({
52-
timeframe: 300,
53-
minSwipeDistance: 60
54-
})}
55-
onswipe={handleDrawerSwipe}
48+
{...useSwipe(
49+
() => {},
50+
() => ({
51+
timeframe: 300,
52+
minSwipeDistance: 60
53+
}),
54+
{
55+
onswipedown: downSwipeHandler
56+
}
57+
)}
5658
class={cn(restProps.class)}
5759
>
5860
<div class="h-[100%] overflow-y-scroll">

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)