Skip to content

Commit a3bbf58

Browse files
committed
chore(lockcsrol): migrate to Svelte 5
1 parent 4f1d76b commit a3bbf58

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

.changeset/six-hotels-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@svelte-put/lockscroll': major
3+
---
4+
5+
drop support for Svelte 4. `on:lockscroll:toggle` is now `onlockscrolltoggle`

packages/lockscroll/src/lockscroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function lockscroll(node, param) {
5353
if (_locked !== locked) {
5454
locked = _locked;
5555
locked ? lock() : unlock();
56-
node.dispatchEvent(new CustomEvent('lockscroll:toggle', { detail: { locked } }));
56+
node.dispatchEvent(new CustomEvent('lockscrolltoggle', { detail: { locked } }));
5757
}
5858
}
5959

packages/lockscroll/src/public.d.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,13 @@ import { Readable } from 'svelte/store';
44
import type { createLockScrollStore } from './lockscroll.js';
55

66
export type LockScrollStore = ReturnType<typeof createLockScrollStore>;
7-
8-
/** */
97
export type LockScrollParameter = boolean | LockScrollStorePattern;
10-
118
export type LockScrollStorePattern = LockScrollStore | Readable<boolean>;
12-
13-
/** */
149
export type LockScrollDetail = {
1510
locked: boolean;
1611
};
17-
18-
/** */
1912
export type LockScrollAttributes = {
20-
'on:lockscroll:toggle'?: (event: CustomEvent<LockScrollDetail>) => void;
13+
'onlockscrolltoggle'?: (event: CustomEvent<LockScrollDetail>) => void;
2114
};
22-
23-
/** */
2415
export type LockScrollAction = Action<HTMLElement, LockScrollParameter, LockScrollAttributes>;
25-
26-
/** */
2716
export type LockScrollActionReturn = ActionReturn<LockScrollParameter, LockScrollAttributes>;

0 commit comments

Comments
 (0)