Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions framework/compiler/jsx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const LIFECYCLE_VUE_VAPOR_PATH = new URL("../src/lifecycle-vue-vapor.ts", import
const OSK_PATH = new URL("../src/osk.tsx", import.meta.url).pathname;
const PLATFORM_PATH = new URL("../src/platform.ts", import.meta.url).pathname;
const PRELUDE_PATH = new URL("../src/prelude.ts", import.meta.url).pathname;
const VIRTUAL_LIST_PATH = new URL("../src/virtual-list.ts", import.meta.url).pathname;
const VUE_VAPOR_RUNTIME_PATH = new URL(
"../../node_modules/vue/dist/vue.runtime-with-vapor.esm-browser.prod.js",
import.meta.url,
Expand Down Expand Up @@ -91,6 +92,7 @@ export const FRAMEWORKS: Record<
platform: PLATFORM_PATH,
prelude: PRELUDE_PATH,
renderer: RENDERER_SOLID_PATH,
"virtual-list": VIRTUAL_LIST_PATH,
},
},
"vue-vapor": {
Expand Down
10 changes: 8 additions & 2 deletions framework/src/kinetics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export interface Scroller {
/** Shift offset AND every in-flight anchor by delta after a prepend, so
* backfill never moves what the user is looking at (the im rebase). */
rebase(delta: number): void;
/** The position the scroller is heading to: the chase/tween target when
* one is in flight, the current offset otherwise. */
intent(): number;
/** At the end of the range, judged on INTENT: the chase/tween target when
* one is in flight, the position otherwise (the im at-bottom rule). */
isAtEnd(slackPx?: number): boolean;
Expand Down Expand Up @@ -264,9 +267,12 @@ export function createScroller(opts: ScrollerOptions): Scroller {
emit(pos + delta);
},

intent(): number {
return state === "chase" ? target : state === "tween" ? tweenTo : pos;
},

isAtEnd(slackPx = 1): boolean {
const intent = state === "chase" ? target : state === "tween" ? tweenTo : pos;
return intent >= opts.max() - slackPx;
return this.intent() >= opts.max() - slackPx;
},

projectFling,
Expand Down
Loading