virtua 0.4.2 → 0.4.4

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.
@@ -98,7 +98,7 @@ export interface VGridProps extends WindowComponentAttributes {
98
98
  rtl?: boolean;
99
99
  /**
100
100
  * Customized element type for scrollable element. This element will get {@link CustomWindowComponentProps} as props.
101
- * @defaultValue {@link DefaultWindow}
101
+ * @defaultValue {@link Window}
102
102
  */
103
103
  element?: CustomWindowComponent;
104
104
  /**
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { WindowComponentAttributes } from "..";
3
- import { CustomWindowComponent } from "./DefaultWindow";
3
+ import { CustomWindowComponent } from "./Window";
4
4
  import { CustomItemComponent } from "./ListItem";
5
5
  export type ScrollMode = "reverse" | "rtl";
6
6
  type CustomItemComponentOrElement = keyof JSX.IntrinsicElements | CustomItemComponent;
@@ -73,7 +73,7 @@ export interface VListProps extends WindowComponentAttributes {
73
73
  mode?: ScrollMode;
74
74
  /**
75
75
  * Customized element type for scrollable element. This element will get {@link CustomWindowComponentProps} as props.
76
- * @defaultValue {@link DefaultWindow}
76
+ * @defaultValue {@link Window}
77
77
  */
78
78
  element?: CustomWindowComponent;
79
79
  /**
@@ -1,6 +1,6 @@
1
1
  import { ReactElement, ReactNode } from "react";
2
2
  import { WindowComponentAttributes } from "..";
3
- import { CustomWindowComponent } from "./DefaultWindow";
3
+ import { CustomWindowComponent } from "./Window";
4
4
  import { CustomItemComponent } from "./ListItem";
5
5
  type CustomItemComponentOrElement = keyof JSX.IntrinsicElements | CustomItemComponent;
6
6
  /**
@@ -33,7 +33,7 @@ export interface WVListProps extends WindowComponentAttributes {
33
33
  horizontal?: boolean;
34
34
  /**
35
35
  * Customized element type for scrollable element. This element will get {@link CustomWindowComponentProps} as props.
36
- * @defaultValue {@link DefaultWindow}
36
+ * @defaultValue {@link Window}
37
37
  */
38
38
  element?: CustomWindowComponent;
39
39
  /**
@@ -41,11 +41,6 @@ export interface WVListProps extends WindowComponentAttributes {
41
41
  * @defaultValue "div"
42
42
  */
43
43
  itemElement?: CustomItemComponentOrElement;
44
- /**
45
- * Callback invoked whenever scroll offset changes.
46
- * @param offset Current scrollTop or scrollLeft.
47
- */
48
- onScroll?: (offset: number) => void;
49
44
  /**
50
45
  * Callback invoked when scrolling stops.
51
46
  */
@@ -71,5 +66,5 @@ export interface WVListProps extends WindowComponentAttributes {
71
66
  /**
72
67
  * Virtualized list component controlled by the window scrolling. See {@link WVListProps}.
73
68
  */
74
- export declare const WVList: ({ children, overscan, initialItemSize, initialItemCount, horizontal: horizontalProp, element, itemElement, onScroll: onScrollProp, onScrollStop: onScrollStopProp, onRangeChange: onRangeChangeProp, ...windowAttrs }: WVListProps) => ReactElement;
69
+ export declare const WVList: ({ children, overscan, initialItemSize, initialItemCount, horizontal: horizontalProp, element: Window, itemElement, onScrollStop: onScrollStopProp, onRangeChange: onRangeChangeProp, ...windowAttrs }: WVListProps) => ReactElement;
75
70
  export {};
@@ -25,5 +25,5 @@ export interface CustomWindowComponentProps {
25
25
  */
26
26
  scrolling: boolean;
27
27
  }
28
- export declare const DefaultWindow: import("react").ForwardRefExoticComponent<CustomWindowComponentProps & import("react").RefAttributes<any>>;
29
- export type CustomWindowComponent = typeof DefaultWindow;
28
+ export declare const Window: import("react").ForwardRefExoticComponent<CustomWindowComponentProps & import("react").RefAttributes<any>>;
29
+ export type CustomWindowComponent = typeof Window;
@@ -0,0 +1,2 @@
1
+ import { VirtualStore } from "../core/store";
2
+ export declare const useSelector: <T>(store: VirtualStore, getSnapShot: () => T, shouldGetLatest?: boolean) => T;
@@ -1,3 +1,3 @@
1
- import { ReactNode } from "react";
1
+ import { ReactElement, ReactFragment, ReactNode } from "react";
2
2
  export declare const refKey = "current";
3
- export declare const isInvalidElement: <T extends ReactNode>(e: T) => e is Extract<T, boolean | null | undefined>;
3
+ export declare const flattenChildren: (children: ReactNode) => (string | number | ReactElement<any, string | import("react").JSXElementConstructor<any>> | ReactFragment)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtua",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
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",
@@ -30,26 +30,26 @@
30
30
  "@emotion/styled": "11.10.8",
31
31
  "@faker-js/faker": "8.0.2",
32
32
  "@mui/material": "5.12.3",
33
- "@playwright/test": "^1.34.3",
33
+ "@playwright/test": "^1.36.1",
34
34
  "@rollup/plugin-babel": "6.0.3",
35
35
  "@rollup/plugin-terser": "0.4.3",
36
36
  "@rollup/plugin-typescript": "11.1.2",
37
37
  "@size-limit/preset-small-lib": "^8.2.6",
38
- "@storybook/addon-docs": "7.0.18",
39
- "@storybook/react": "7.0.18",
40
- "@storybook/react-vite": "^7.0.18",
41
- "@storybook/test-runner": "0.10.0",
38
+ "@storybook/addon-docs": "7.1.0",
39
+ "@storybook/react": "7.1.0",
40
+ "@storybook/react-vite": "^7.1.0",
41
+ "@storybook/test-runner": "0.11.0",
42
42
  "@tanstack/react-virtual": "3.0.0-alpha.0",
43
43
  "@testing-library/react": "14.0.0",
44
44
  "@types/react": "18.2.14",
45
45
  "@types/react-virtualized": "9.21.22",
46
46
  "@types/react-window": "1.8.5",
47
- "@typescript-eslint/parser": "5.59.2",
48
- "concurrently": "8.0.1",
49
- "eslint": "8.42.0",
47
+ "@typescript-eslint/parser": "6.1.0",
48
+ "concurrently": "8.2.0",
49
+ "eslint": "8.45.0",
50
50
  "eslint-plugin-react-hooks": "4.6.0",
51
- "jest": "29.5.0",
52
- "jest-environment-jsdom": "29.5.0",
51
+ "jest": "29.6.1",
52
+ "jest-environment-jsdom": "29.6.1",
53
53
  "re-resizable": "6.9.9",
54
54
  "react": "18.2.0",
55
55
  "react-content-loader": "6.2.1",
@@ -60,19 +60,19 @@
60
60
  "react-pull-to-refresh": "2.0.1",
61
61
  "react-select": "5.7.3",
62
62
  "react-virtualized": "9.22.5",
63
- "react-virtuoso": "4.3.11",
63
+ "react-virtuoso": "4.4.1",
64
64
  "react-window": "1.8.9",
65
65
  "rimraf": "5.0.0",
66
66
  "rollup": "3.23.0",
67
67
  "rollup-plugin-banner2": "1.2.2",
68
68
  "size-limit": "^8.2.6",
69
- "storybook": "^7.0.18",
69
+ "storybook": "^7.1.0",
70
70
  "ts-jest": "29.1.0",
71
71
  "typedoc": "0.24.7",
72
72
  "typedoc-plugin-markdown": "3.15.3",
73
- "typescript": "5.1.3",
74
- "virtua": "^0.4.0",
75
- "vite": "4.3.9",
73
+ "typescript": "5.1.6",
74
+ "virtua": "^0.4.3",
75
+ "vite": "4.4.4",
76
76
  "wait-on": "7.0.1"
77
77
  },
78
78
  "peerDependencies": {
@@ -1,2 +0,0 @@
1
- import { VirtualStore } from "../core/store";
2
- export declare const useStore: <T>(store: VirtualStore, getSnapShot: () => T, shouldGetLatest?: boolean) => T;