virtua 0.13.0 → 0.14.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.
@@ -1,5 +1,4 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from "react";
2
- import { VirtualStore } from "../core/store";
3
2
  import { ListResizer } from "../core/resizer";
4
3
  /**
5
4
  * Props of customized item component for {@link VList}.
@@ -12,10 +11,11 @@ export type CustomItemComponent = React.ForwardRefExoticComponent<React.PropsWit
12
11
  type ListItemProps = {
13
12
  _children: ReactNode;
14
13
  _resizer: ListResizer;
15
- _store: VirtualStore;
16
14
  _index: number;
15
+ _offset: number;
16
+ _hide: boolean;
17
17
  _element: "div";
18
18
  _isHorizontal: boolean;
19
19
  };
20
- export declare const ListItem: import("react").MemoExoticComponent<({ _children: children, _resizer: resizer, _store: store, _index: index, _element: Element, _isHorizontal: isHorizontal, }: ListItemProps) => ReactElement>;
20
+ export declare const ListItem: import("react").MemoExoticComponent<({ _children: children, _resizer: resizer, _index: index, _offset: offset, _hide: hide, _element: Element, _isHorizontal: isHorizontal, }: ListItemProps) => ReactElement>;
21
21
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactNode } from "react";
2
- import { CustomViewportComponent, ViewportComponentAttributes } from "..";
2
+ import { CustomViewportComponent, ViewportComponentAttributes } from "./Viewport";
3
3
  /**
4
4
  * Props of customized cell component for {@link VGrid}.
5
5
  */
@@ -1,6 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { ViewportComponentAttributes } from "..";
3
- import { CustomViewportComponent } from "./Viewport";
2
+ import { CustomViewportComponent, ViewportComponentAttributes } from "./Viewport";
4
3
  import { CustomItemComponent } from "./ListItem";
5
4
  import { CacheSnapshot, ScrollToIndexAlign } from "../core/types";
6
5
  type CustomItemComponentOrElement = keyof JSX.IntrinsicElements | CustomItemComponent;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- import { CacheSnapshot, ViewportComponentAttributes } from "..";
3
- import { CustomViewportComponent } from "./Viewport";
2
+ import { CacheSnapshot } from "../core/types";
3
+ import { CustomViewportComponent, ViewportComponentAttributes } from "./Viewport";
4
4
  import { CustomItemComponent } from "./ListItem";
5
5
  type CustomItemComponentOrElement = keyof JSX.IntrinsicElements | CustomItemComponent;
6
6
  /**
@@ -0,0 +1 @@
1
+ export declare const useRerender: () => (() => void);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "virtua",
3
- "version": "0.13.0",
4
- "description": "A zero-config, fast and small (~3kB) virtual list and grid component for React.",
3
+ "version": "0.14.0",
4
+ "description": "A zero-config, fast and small (~3kB) virtual list (and grid) component for React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
7
7
  "types": "lib/index.d.ts",
@@ -42,9 +42,9 @@
42
42
  "@playwright/test": "^1.37.0",
43
43
  "@radix-ui/colors": "2.1.0",
44
44
  "@radix-ui/react-scroll-area": "1.0.5",
45
- "@rollup/plugin-babel": "6.0.3",
46
- "@rollup/plugin-terser": "0.4.3",
47
- "@rollup/plugin-typescript": "11.1.4",
45
+ "@rollup/plugin-babel": "6.0.4",
46
+ "@rollup/plugin-terser": "0.4.4",
47
+ "@rollup/plugin-typescript": "11.1.5",
48
48
  "@size-limit/preset-small-lib": "^9.0.0",
49
49
  "@storybook/addon-storysource": "7.4.5",
50
50
  "@storybook/react": "7.4.5",
@@ -76,15 +76,15 @@
76
76
  "react-virtuoso": "4.6.0",
77
77
  "react-window": "1.8.9",
78
78
  "rimraf": "5.0.1",
79
- "rollup": "3.29.4",
79
+ "rollup": "4.1.1",
80
80
  "rollup-plugin-banner2": "1.2.2",
81
81
  "size-limit": "^9.0.0",
82
82
  "storybook": "^7.4.5",
83
83
  "ts-jest": "29.1.1",
84
84
  "typedoc": "0.24.8",
85
85
  "typedoc-plugin-markdown": "3.15.4",
86
- "typescript": "5.1.6",
87
- "virtua": "^0.11.0",
86
+ "typescript": "5.2.2",
87
+ "virtua": "^0.13.0",
88
88
  "vite": "4.4.9",
89
89
  "wait-on": "7.0.1"
90
90
  },
@@ -105,6 +105,7 @@
105
105
  "grid",
106
106
  "table",
107
107
  "flex",
108
+ "scroll",
108
109
  "scroller",
109
110
  "scrolling",
110
111
  "virtual",
@@ -1,2 +0,0 @@
1
- import { VirtualStore } from "../core/store";
2
- export declare const useSelector: <T>(store: VirtualStore, getSnapShot: () => T, target: number, shouldGetLatest?: boolean) => T;