Skip to content

Commit

Permalink
fix userData on immediate
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Jun 7, 2024
1 parent 9fb1d74 commit 81cada9
Show file tree
Hide file tree
Showing 20 changed files with 229 additions and 307 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@ See documentation for [lenis/react](https://github.com/darkroomengineering/lenis

## Plugins

- [Loconative-scroll](https://github.com/quentinhocde/loconative-scroll#how-to-switch-from-locomotive-scroll-to-loconative-scroll) by [Quentin Hocde](https://twitter.com/QuentinHocde)
- [react-lenis](https://github.com/darkroomengineering/lenis/tree/main/packages/react-lenis) by [darkroom.engineering](https://darkroom.engineering/)
- [r3f-scroll-rig](https://github.com/14islands/r3f-scroll-rig) by [14islands](https://14islands.com/)
- [Lenis Scroll Snap Plugin](https://github.com/funkhaus/lenis-scroll-snap) by [Funkhaus](https://github.com/funkhaus)
- [locomotive-scroll](https://github.com/locomotivemtl/locomotive-scroll) by [Locomotive](https://locomotive.ca/)
- [vue-lenis](https://github.com/zeokku/vue-lenis) by [ZEOKKU](https://zeokku.com/)
- [nuxt-lenis](https://www.npmjs.com/package/nuxt-lenis) by [Milkshake Studio](https://milkshake.studio/)
Expand Down
16 changes: 8 additions & 8 deletions dist/animate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ export class Animate {
advance(deltaTime: any): void;
value: any;
stop(): void;
isRunning: boolean;
isRunning: boolean | undefined;
fromTo(from: any, to: any, { lerp, duration, easing, onStart, onUpdate }: {
lerp?: number;
duration?: number;
easing?: (t: any) => any;
lerp: any;
duration: any;
easing: any;
onStart: any;
onUpdate: any;
}): void;
from: any;
to: any;
lerp: number;
duration: number;
easing: (t: any) => any;
currentTime: number;
lerp: any;
duration: any;
easing: any;
currentTime: number | undefined;
onUpdate: any;
}
10 changes: 5 additions & 5 deletions dist/dimensions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ export class Dimensions {
constructor({ wrapper, content, autoResize, debounce: debounceValue, }?: {
wrapper: any;
content: any;
autoResize?: boolean;
debounce?: number;
autoResize?: boolean | undefined;
debounce?: number | undefined;
});
wrapper: any;
content: any;
debouncedResize: (...args: any[]) => void;
wrapperResizeObserver: ResizeObserver;
contentResizeObserver: ResizeObserver;
debouncedResize: ((...args: any[]) => void) | undefined;
wrapperResizeObserver: ResizeObserver | undefined;
contentResizeObserver: ResizeObserver | undefined;
destroy(): void;
resize: () => void;
onWrapperResize: () => void;
Expand Down
26 changes: 0 additions & 26 deletions dist/lenis-snap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lenis-snap.js.map

Large diffs are not rendered by default.

62 changes: 29 additions & 33 deletions dist/lenis.d.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
type EasingFunction = (t: number) => number;
type Orientation = 'vertical' | 'horizontal';
type GestureOrientation = 'vertical' | 'horizontal' | 'both';
type LenisOptions = {
wrapper?: Window | HTMLElement;
content?: HTMLElement;
wheelEventsTarget?: Window | HTMLElement;
eventsTarget?: Window | HTMLElement;
smoothWheel?: boolean;
syncTouch?: boolean;
syncTouchLerp?: number;
touchInertiaMultiplier?: number;
duration?: number;
easing?: EasingFunction;
lerp?: number;
infinite?: boolean;
orientation?: Orientation;
gestureOrientation?: GestureOrientation;
touchMultiplier?: number;
wheelMultiplier?: number;
autoResize?: boolean;
prevent?: boolean | ((node: Element) => boolean);
__experimental__naiveDimensions?: boolean;
};
type Scrolling = boolean | 'native' | 'smooth';
type LenisOptions = Partial<{
wrapper: Window | HTMLElement;
content: HTMLElement;
wheelEventsTarget: Window | HTMLElement;
eventsTarget: Window | HTMLElement;
smoothWheel: boolean;
syncTouch: boolean;
syncTouchLerp: number;
touchInertiaMultiplier: number;
duration: number;
easing: EasingFunction;
lerp: number;
infinite: boolean;
orientation: Orientation;
gestureOrientation: GestureOrientation;
touchMultiplier: number;
wheelMultiplier: number;
autoResize: boolean;
prevent: boolean | ((node: Element) => boolean);
__experimental__naiveDimensions: boolean;
}>;
declare class Lenis {
__isScrolling: boolean | 'native' | 'smooth';
__isScrolling: Scrolling;
__isStopped: boolean;
__isLocked: boolean;
time: number;
userData: object;
lastVelocity: number;
velocity: number;
direction: 1 | -1 | undefined;
direction: 1 | -1 | 0;
options: LenisOptions;
targetScroll: number;
animatedScroll: number;
constructor({ wrapper, content, wheelEventsTarget, // deprecated
eventsTarget, smoothWheel, syncTouch, syncTouchLerp, touchInertiaMultiplier, duration, // in seconds
easing, lerp, infinite, orientation, // vertical, horizontal
gestureOrientation, // vertical, horizontal, both
touchMultiplier, wheelMultiplier, autoResize, prevent, __experimental__naiveDimensions, }?: LenisOptions);
constructor({ wrapper, content, wheelEventsTarget, eventsTarget, smoothWheel, syncTouch, syncTouchLerp, touchInertiaMultiplier, duration, easing, lerp, infinite, orientation, gestureOrientation, touchMultiplier, wheelMultiplier, autoResize, prevent, __experimental__naiveDimensions, }?: LenisOptions);
destroy(): void;
on(event: string, callback: Function): any;
off(event: string, callback: Function): any;
Expand All @@ -51,9 +48,7 @@ declare class Lenis {
start(): void;
stop(): void;
raf(time: number): void;
scrollTo(target: number | string | HTMLElement, { offset, immediate, lock, duration, easing, lerp, onStart, onComplete, force, // scroll even if stopped
programmatic, // called from outside of the class
userData, }?: {
scrollTo(target: number | string | HTMLElement, { offset, immediate, lock, duration, easing, lerp, onStart, onComplete, force, programmatic, userData, }?: {
offset?: number;
immediate?: boolean;
lock?: boolean;
Expand All @@ -66,13 +61,14 @@ declare class Lenis {
programmatic?: boolean;
userData?: object;
}): void;
get rootElement(): Window | HTMLElement;
private preventNextNativeScrollEvent;
get rootElement(): HTMLElement;
get limit(): any;
get isHorizontal(): boolean;
get actualScroll(): number;
get scroll(): number;
get progress(): number;
get isScrolling(): boolean;
get isScrolling(): Scrolling;
private set isScrolling(value);
get isStopped(): boolean;
private set isStopped(value);
Expand Down
Loading

0 comments on commit 81cada9

Please sign in to comment.