@tvuikit/scroll-react 0.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.
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/useScrollNavigation.d.ts +44 -0
- package/dist/useScrollNavigation.d.ts.map +1 -0
- package/dist/useScrollState.d.ts +19 -0
- package/dist/useScrollState.d.ts.map +1 -0
- package/dist/useScroller.d.ts +20 -0
- package/dist/useScroller.d.ts.map +1 -0
- package/dist/useVirtualRange.d.ts +17 -0
- package/dist/useVirtualRange.d.ts.map +1 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useScroller } from "./useScroller.js";
|
|
2
|
+
export { useScrollState, type ScrollState } from "./useScrollState.js";
|
|
3
|
+
export { useVirtualRange } from "./useVirtualRange.js";
|
|
4
|
+
export { useScrollNavigation, type UseScrollNavigationOptions } from "./useScrollNavigation.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useMemo as i, useEffect as r, useCallback as o, useSyncExternalStore as a, useRef as c } from "react";
|
|
2
|
+
import { createScroller as d, createVirtualizer as g, connectScrollToNavigation as z } from "@tvuikit/scroll";
|
|
3
|
+
function v(e) {
|
|
4
|
+
const t = i(() => d(e), []);
|
|
5
|
+
return r(() => () => {
|
|
6
|
+
t.dispose();
|
|
7
|
+
}, [t]), t;
|
|
8
|
+
}
|
|
9
|
+
function R(e) {
|
|
10
|
+
const t = o(
|
|
11
|
+
(s) => e.subscribe(s),
|
|
12
|
+
[e]
|
|
13
|
+
), n = o(() => e.getSnapshot(), [e]), u = o(() => 0, []);
|
|
14
|
+
return a(t, n, u), {
|
|
15
|
+
scrollOffset: e.scrollOffset,
|
|
16
|
+
focusedIndex: e.focusedIndex,
|
|
17
|
+
isAnimating: e.isAnimating
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function p(e, t) {
|
|
21
|
+
const n = i(
|
|
22
|
+
() => g(0, e.offsets, e.sizes, e.itemCount, {
|
|
23
|
+
overscan: t ?? 2
|
|
24
|
+
}),
|
|
25
|
+
[e]
|
|
26
|
+
// intentionally minimal — scroller internals accessed via ref
|
|
27
|
+
), u = o(
|
|
28
|
+
(S) => e.subscribe(S),
|
|
29
|
+
[e]
|
|
30
|
+
), s = o(() => e.getSnapshot(), [e]), f = o(() => 0, []);
|
|
31
|
+
return a(u, s, f), n.setLayout(e.offsets, e.sizes, e.itemCount), n.setViewportSize(e.viewportSize), n.update(e.scrollOffset);
|
|
32
|
+
}
|
|
33
|
+
function x(e) {
|
|
34
|
+
const t = c(e.nodeToIndex), n = c(e.onFocusResize);
|
|
35
|
+
t.current = e.nodeToIndex, n.current = e.onFocusResize, r(() => z(
|
|
36
|
+
e.scroller,
|
|
37
|
+
e.navStore,
|
|
38
|
+
(s) => t.current(s),
|
|
39
|
+
{
|
|
40
|
+
onFocusResize: (s) => n.current?.(s) ?? null,
|
|
41
|
+
scrollToOptions: e.scrollToOptions
|
|
42
|
+
}
|
|
43
|
+
), [e.scroller, e.navStore, e.scrollToOptions]);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
x as useScrollNavigation,
|
|
47
|
+
R as useScrollState,
|
|
48
|
+
v as useScroller,
|
|
49
|
+
p as useVirtualRange
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/useScroller.ts","../src/useScrollState.ts","../src/useVirtualRange.ts","../src/useScrollNavigation.ts"],"sourcesContent":["import { useMemo, useEffect } from \"react\";\nimport type { Scroller, ScrollerOptions } from \"@tvuikit/scroll\";\nimport { createScroller } from \"@tvuikit/scroll\";\n\n/**\n * Create and lifecycle-manage a Scroller instance.\n *\n * The scroller is created once on mount and disposed on unmount.\n * Returns a stable reference across renders.\n *\n * @example\n * ```tsx\n * const scroller = useScroller({\n * axis: \"horizontal\",\n * viewportSize: 1920,\n * itemCount: 50,\n * itemSize: 300,\n * animation: { tweenTo: gsap.to.bind(gsap) },\n * });\n * ```\n */\nexport function useScroller(options: ScrollerOptions): Scroller {\n // Create scroller once — options are captured at mount time.\n // Consumers should use scroller mutation methods for runtime changes.\n const scroller = useMemo(() => createScroller(options), []); // intentionally empty — options captured at mount\n\n useEffect(() => {\n return () => {\n scroller.dispose();\n };\n }, [scroller]);\n\n return scroller;\n}\n","import { useCallback, useSyncExternalStore } from \"react\";\nimport type { Scroller } from \"@tvuikit/scroll\";\n\nexport type ScrollState = {\n scrollOffset: number;\n focusedIndex: number;\n isAnimating: boolean;\n};\n\n/**\n * Reactively read scroll state from a Scroller using useSyncExternalStore.\n *\n * Re-renders the component when the scroller's version counter changes\n * (on every scroll position update, size change, etc.).\n *\n * @example\n * ```tsx\n * const { scrollOffset, focusedIndex, isAnimating } = useScrollState(scroller);\n * ```\n */\nexport function useScrollState(scroller: Scroller): ScrollState {\n const subscribe = useCallback(\n (onStoreChange: () => void) => scroller.subscribe(onStoreChange),\n [scroller]\n );\n\n const getSnapshot = useCallback(() => scroller.getSnapshot(), [scroller]);\n\n const getServerSnapshot = useCallback(() => 0, []);\n\n // useSyncExternalStore triggers re-render when version changes\n useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n\n // Read current values directly from the scroller (guaranteed fresh after version bump)\n return {\n scrollOffset: scroller.scrollOffset,\n focusedIndex: scroller.focusedIndex,\n isAnimating: scroller.isAnimating,\n };\n}\n","import { useCallback, useMemo, useSyncExternalStore } from \"react\";\nimport type { Scroller, VirtualRange } from \"@tvuikit/scroll\";\nimport { createVirtualizer } from \"@tvuikit/scroll\";\n\n/**\n * Reactively compute the visible item range from a Scroller.\n *\n * Creates an internal Virtualizer and updates it whenever the scroller's\n * state changes. Returns a VirtualRange with start/end indices and overscan.\n *\n * @example\n * ```tsx\n * const range = useVirtualRange(scroller, 3);\n * for (let i = range.overscanStart; i < range.overscanEnd; i++) {\n * renderItem(i);\n * }\n * ```\n */\nexport function useVirtualRange(scroller: Scroller, overscan?: number): VirtualRange {\n const virtualizer = useMemo(\n () =>\n createVirtualizer(0, scroller.offsets, scroller.sizes, scroller.itemCount, {\n overscan: overscan ?? 2,\n }),\n [scroller] // intentionally minimal — scroller internals accessed via ref\n );\n\n const subscribe = useCallback(\n (onStoreChange: () => void) => scroller.subscribe(onStoreChange),\n [scroller]\n );\n\n const getSnapshot = useCallback(() => scroller.getSnapshot(), [scroller]);\n const getServerSnapshot = useCallback(() => 0, []);\n\n useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n\n // Sync virtualizer layout with scroller state\n virtualizer.setLayout(scroller.offsets, scroller.sizes, scroller.itemCount);\n virtualizer.setViewportSize(scroller.viewportSize);\n\n // Compute and return visible range\n return virtualizer.update(scroller.scrollOffset);\n}\n","import { useEffect, useRef } from \"react\";\nimport type { Scroller, ScrollToOptions } from \"@tvuikit/scroll\";\nimport { connectScrollToNavigation } from \"@tvuikit/scroll\";\n\n/**\n * Structural type for the NavigationStore's event interface.\n * Avoids hard dependency on @tvuikit/navigation in this package.\n */\ntype NavigationStoreLike = {\n addEventListener(\n type: string,\n listener: (event: Event) => void,\n options?: AddEventListenerOptions\n ): void;\n removeEventListener(\n type: string,\n listener: (event: Event) => void,\n options?: EventListenerOptions\n ): void;\n};\n\nexport type UseScrollNavigationOptions = {\n /** The scroller to drive. */\n scroller: Scroller;\n /** The navigation store to listen to. */\n navStore: NavigationStoreLike;\n /** Maps a navigation node ID to a scroller item index. Return null for unrelated nodes. */\n nodeToIndex: (nodeId: string) => number | null;\n /** Called when an item receives focus. Return new size for resize-on-focus, or null. */\n onFocusResize?: (index: number) => { size: number } | null;\n /** Override scroll animation options for focus-driven scrolls. */\n scrollToOptions?: ScrollToOptions;\n};\n\n/**\n * Connect navigation focus events to a scroller.\n *\n * When the navigation system focuses a node that maps to a scroller item,\n * the scroller automatically scrolls to that item.\n *\n * @example\n * ```tsx\n * useScrollNavigation({\n * scroller,\n * navStore: store,\n * nodeToIndex: (id) => {\n * if (!id.startsWith(\"pixi:tile-\")) return null;\n * return parseInt(id.slice(\"pixi:tile-\".length), 10);\n * },\n * });\n * ```\n */\nexport function useScrollNavigation(options: UseScrollNavigationOptions): void {\n // Use refs for callbacks to avoid reconnecting on every render\n const nodeToIndexRef = useRef(options.nodeToIndex);\n const onFocusResizeRef = useRef(options.onFocusResize);\n nodeToIndexRef.current = options.nodeToIndex;\n onFocusResizeRef.current = options.onFocusResize;\n\n useEffect(() => {\n const disconnect = connectScrollToNavigation(\n options.scroller,\n options.navStore,\n (nodeId) => nodeToIndexRef.current(nodeId),\n {\n onFocusResize: (index) => onFocusResizeRef.current?.(index) ?? null,\n scrollToOptions: options.scrollToOptions,\n }\n );\n\n return disconnect;\n }, [options.scroller, options.navStore, options.scrollToOptions]);\n}\n"],"names":["useScroller","options","scroller","useMemo","createScroller","useEffect","useScrollState","subscribe","useCallback","onStoreChange","getSnapshot","getServerSnapshot","useSyncExternalStore","useVirtualRange","overscan","virtualizer","createVirtualizer","useScrollNavigation","nodeToIndexRef","useRef","onFocusResizeRef","connectScrollToNavigation","nodeId","index"],"mappings":";;AAqBO,SAASA,EAAYC,GAAoC;AAG9D,QAAMC,IAAWC,EAAQ,MAAMC,EAAeH,CAAO,GAAG,CAAA,CAAE;AAE1D,SAAAI,EAAU,MACD,MAAM;AACX,IAAAH,EAAS,QAAA;AAAA,EACX,GACC,CAACA,CAAQ,CAAC,GAENA;AACT;ACbO,SAASI,EAAeJ,GAAiC;AAC9D,QAAMK,IAAYC;AAAA,IAChB,CAACC,MAA8BP,EAAS,UAAUO,CAAa;AAAA,IAC/D,CAACP,CAAQ;AAAA,EAAA,GAGLQ,IAAcF,EAAY,MAAMN,EAAS,eAAe,CAACA,CAAQ,CAAC,GAElES,IAAoBH,EAAY,MAAM,GAAG,CAAA,CAAE;AAGjD,SAAAI,EAAqBL,GAAWG,GAAaC,CAAiB,GAGvD;AAAA,IACL,cAAcT,EAAS;AAAA,IACvB,cAAcA,EAAS;AAAA,IACvB,aAAaA,EAAS;AAAA,EAAA;AAE1B;ACrBO,SAASW,EAAgBX,GAAoBY,GAAiC;AACnF,QAAMC,IAAcZ;AAAA,IAClB,MACEa,EAAkB,GAAGd,EAAS,SAASA,EAAS,OAAOA,EAAS,WAAW;AAAA,MACzE,UAAUY,KAAY;AAAA,IAAA,CACvB;AAAA,IACH,CAACZ,CAAQ;AAAA;AAAA,EAAA,GAGLK,IAAYC;AAAA,IAChB,CAACC,MAA8BP,EAAS,UAAUO,CAAa;AAAA,IAC/D,CAACP,CAAQ;AAAA,EAAA,GAGLQ,IAAcF,EAAY,MAAMN,EAAS,eAAe,CAACA,CAAQ,CAAC,GAClES,IAAoBH,EAAY,MAAM,GAAG,CAAA,CAAE;AAEjD,SAAAI,EAAqBL,GAAWG,GAAaC,CAAiB,GAG9DI,EAAY,UAAUb,EAAS,SAASA,EAAS,OAAOA,EAAS,SAAS,GAC1Ea,EAAY,gBAAgBb,EAAS,YAAY,GAG1Ca,EAAY,OAAOb,EAAS,YAAY;AACjD;ACSO,SAASe,EAAoBhB,GAA2C;AAE7E,QAAMiB,IAAiBC,EAAOlB,EAAQ,WAAW,GAC3CmB,IAAmBD,EAAOlB,EAAQ,aAAa;AACrD,EAAAiB,EAAe,UAAUjB,EAAQ,aACjCmB,EAAiB,UAAUnB,EAAQ,eAEnCI,EAAU,MACWgB;AAAA,IACjBpB,EAAQ;AAAA,IACRA,EAAQ;AAAA,IACR,CAACqB,MAAWJ,EAAe,QAAQI,CAAM;AAAA,IACzC;AAAA,MACE,eAAe,CAACC,MAAUH,EAAiB,UAAUG,CAAK,KAAK;AAAA,MAC/D,iBAAiBtB,EAAQ;AAAA,IAAA;AAAA,EAC3B,GAID,CAACA,EAAQ,UAAUA,EAAQ,UAAUA,EAAQ,eAAe,CAAC;AAClE;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Scroller, ScrollToOptions } from "@tvuikit/scroll";
|
|
2
|
+
/**
|
|
3
|
+
* Structural type for the NavigationStore's event interface.
|
|
4
|
+
* Avoids hard dependency on @tvuikit/navigation in this package.
|
|
5
|
+
*/
|
|
6
|
+
type NavigationStoreLike = {
|
|
7
|
+
addEventListener(type: string, listener: (event: Event) => void, options?: AddEventListenerOptions): void;
|
|
8
|
+
removeEventListener(type: string, listener: (event: Event) => void, options?: EventListenerOptions): void;
|
|
9
|
+
};
|
|
10
|
+
export type UseScrollNavigationOptions = {
|
|
11
|
+
/** The scroller to drive. */
|
|
12
|
+
scroller: Scroller;
|
|
13
|
+
/** The navigation store to listen to. */
|
|
14
|
+
navStore: NavigationStoreLike;
|
|
15
|
+
/** Maps a navigation node ID to a scroller item index. Return null for unrelated nodes. */
|
|
16
|
+
nodeToIndex: (nodeId: string) => number | null;
|
|
17
|
+
/** Called when an item receives focus. Return new size for resize-on-focus, or null. */
|
|
18
|
+
onFocusResize?: (index: number) => {
|
|
19
|
+
size: number;
|
|
20
|
+
} | null;
|
|
21
|
+
/** Override scroll animation options for focus-driven scrolls. */
|
|
22
|
+
scrollToOptions?: ScrollToOptions;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Connect navigation focus events to a scroller.
|
|
26
|
+
*
|
|
27
|
+
* When the navigation system focuses a node that maps to a scroller item,
|
|
28
|
+
* the scroller automatically scrolls to that item.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* useScrollNavigation({
|
|
33
|
+
* scroller,
|
|
34
|
+
* navStore: store,
|
|
35
|
+
* nodeToIndex: (id) => {
|
|
36
|
+
* if (!id.startsWith("pixi:tile-")) return null;
|
|
37
|
+
* return parseInt(id.slice("pixi:tile-".length), 10);
|
|
38
|
+
* },
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function useScrollNavigation(options: UseScrollNavigationOptions): void;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=useScrollNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollNavigation.d.ts","sourceRoot":"","sources":["../src/useScrollNavigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGjE;;;GAGG;AACH,KAAK,mBAAmB,GAAG;IACzB,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EAChC,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EAChC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,IAAI,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,6BAA6B;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,yCAAyC;IACzC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,2FAA2F;IAC3F,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC/C,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3D,kEAAkE;IAClE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI,CAoB7E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Scroller } from "@tvuikit/scroll";
|
|
2
|
+
export type ScrollState = {
|
|
3
|
+
scrollOffset: number;
|
|
4
|
+
focusedIndex: number;
|
|
5
|
+
isAnimating: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Reactively read scroll state from a Scroller using useSyncExternalStore.
|
|
9
|
+
*
|
|
10
|
+
* Re-renders the component when the scroller's version counter changes
|
|
11
|
+
* (on every scroll position update, size change, etc.).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { scrollOffset, focusedIndex, isAnimating } = useScrollState(scroller);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useScrollState(scroller: Scroller): ScrollState;
|
|
19
|
+
//# sourceMappingURL=useScrollState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollState.d.ts","sourceRoot":"","sources":["../src/useScrollState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAmB9D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Scroller, ScrollerOptions } from "@tvuikit/scroll";
|
|
2
|
+
/**
|
|
3
|
+
* Create and lifecycle-manage a Scroller instance.
|
|
4
|
+
*
|
|
5
|
+
* The scroller is created once on mount and disposed on unmount.
|
|
6
|
+
* Returns a stable reference across renders.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const scroller = useScroller({
|
|
11
|
+
* axis: "horizontal",
|
|
12
|
+
* viewportSize: 1920,
|
|
13
|
+
* itemCount: 50,
|
|
14
|
+
* itemSize: 300,
|
|
15
|
+
* animation: { tweenTo: gsap.to.bind(gsap) },
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function useScroller(options: ScrollerOptions): Scroller;
|
|
20
|
+
//# sourceMappingURL=useScroller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScroller.d.ts","sourceRoot":"","sources":["../src/useScroller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGjE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAY9D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Scroller, VirtualRange } from "@tvuikit/scroll";
|
|
2
|
+
/**
|
|
3
|
+
* Reactively compute the visible item range from a Scroller.
|
|
4
|
+
*
|
|
5
|
+
* Creates an internal Virtualizer and updates it whenever the scroller's
|
|
6
|
+
* state changes. Returns a VirtualRange with start/end indices and overscan.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const range = useVirtualRange(scroller, 3);
|
|
11
|
+
* for (let i = range.overscanStart; i < range.overscanEnd; i++) {
|
|
12
|
+
* renderItem(i);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useVirtualRange(scroller: Scroller, overscan?: number): VirtualRange;
|
|
17
|
+
//# sourceMappingURL=useVirtualRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVirtualRange.d.ts","sourceRoot":"","sources":["../src/useVirtualRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG9D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAyBnF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tvuikit/scroll-react",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "React hooks for @tvuikit/scroll. useSyncExternalStore-based, cross-reconciler compatible.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "TVKit Team",
|
|
9
|
+
"homepage": "https://tvkit.dev/",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/dobreadi/tvkit.git",
|
|
13
|
+
"directory": "packages/scroll-react"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/dobreadi/tvkit/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"tv",
|
|
20
|
+
"scroll",
|
|
21
|
+
"react",
|
|
22
|
+
"hooks",
|
|
23
|
+
"tvkit"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"main": "./dist/index.js",
|
|
38
|
+
"module": "./dist/index.js",
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@tvuikit/scroll": "^0.1.0",
|
|
42
|
+
"react": ">=18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@tvuikit/scroll": "file:../scroll"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "vite build && npm run build:types",
|
|
49
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
50
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
51
|
+
}
|
|
52
|
+
}
|