vue-virtual-flow 0.0.9 → 0.1.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +94 -10
  3. package/README.vi.md +87 -10
  4. package/dist/components/ChatVirtualScroll.d.cts +29 -2
  5. package/dist/components/ChatVirtualScroll.d.ts +29 -2
  6. package/dist/components/DynamicVirtualScroll.d.cts +3 -3
  7. package/dist/components/DynamicVirtualScroll.d.ts +3 -3
  8. package/dist/components/ShortMediaFeed.d.cts +2 -2
  9. package/dist/components/ShortMediaFeed.d.ts +2 -2
  10. package/dist/components/VirtualCarousel.d.cts +15 -2
  11. package/dist/components/VirtualCarousel.d.ts +15 -2
  12. package/dist/components/VirtualScroll.d.cts +3 -3
  13. package/dist/components/VirtualScroll.d.ts +3 -3
  14. package/dist/components/WindowDynamicVirtualScroll.d.cts +3 -3
  15. package/dist/components/WindowDynamicVirtualScroll.d.ts +3 -3
  16. package/dist/components/WindowGirdVirtualScroll.d.cts +3 -3
  17. package/dist/components/WindowGirdVirtualScroll.d.ts +3 -3
  18. package/dist/composables/useCarouselAutoplay.d.cts +15 -0
  19. package/dist/composables/useCarouselAutoplay.d.ts +15 -0
  20. package/dist/composables/useCarouselInteraction.d.cts +40 -0
  21. package/dist/composables/useCarouselInteraction.d.ts +40 -0
  22. package/dist/composables/useScrollActivity.d.cts +28 -0
  23. package/dist/composables/useScrollActivity.d.ts +28 -0
  24. package/dist/index.d.cts +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/types.d.cts +46 -0
  27. package/dist/types.d.ts +46 -0
  28. package/dist/utils/carouselLayout.d.cts +8 -0
  29. package/dist/utils/carouselLayout.d.ts +8 -0
  30. package/dist/utils/carouselMotion.d.cts +5 -0
  31. package/dist/utils/carouselMotion.d.ts +5 -0
  32. package/dist/utils/keyedSizeIndex.d.cts +19 -0
  33. package/dist/utils/keyedSizeIndex.d.ts +19 -0
  34. package/dist/vue-virtual-flow.cjs +1 -1
  35. package/dist/vue-virtual-flow.css +1 -1
  36. package/dist/vue-virtual-flow.js +2191 -1523
  37. package/package.json +3 -2
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.js';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  estimatedItemSize?: number;
10
10
  height?: number | string;
@@ -40,7 +40,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
40
40
  refreshing: boolean;
41
41
  }): unknown;
42
42
  };
43
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
43
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
44
44
  }>) => import('vue').VNode & {
45
45
  __ctx?: Awaited<typeof __VLS_setup>;
46
46
  };
@@ -1,9 +1,9 @@
1
1
  import { ItemKey, ShortMediaFeedChangeEvent, ShortMediaFeedExpose } from '../types.cjs';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onChange?: ((event: ShortMediaFeedChangeEvent<T>) => any) | undefined;
4
5
  readonly onLoadMore?: (() => any) | undefined;
5
6
  readonly "onUpdate:activeIndex"?: ((index: number) => any) | undefined;
6
- readonly onChange?: ((event: ShortMediaFeedChangeEvent<T>) => any) | undefined;
7
7
  readonly onReachStart?: (() => any) | undefined;
8
8
  readonly onReachEnd?: (() => any) | undefined;
9
9
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onLoadMore" | "onUpdate:activeIndex" | "onReachStart" | "onReachEnd"> & {
@@ -27,7 +27,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
27
27
  }): unknown;
28
28
  empty?(): unknown;
29
29
  };
30
- emit: ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "change", event: ShortMediaFeedChangeEvent<T>) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
30
+ emit: ((evt: "change", event: ShortMediaFeedChangeEvent<T>) => void) & ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
31
31
  }>) => import('vue').VNode & {
32
32
  __ctx?: Awaited<typeof __VLS_setup>;
33
33
  };
@@ -1,9 +1,9 @@
1
1
  import { ItemKey, ShortMediaFeedChangeEvent, ShortMediaFeedExpose } from '../types.js';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onChange?: ((event: ShortMediaFeedChangeEvent<T>) => any) | undefined;
4
5
  readonly onLoadMore?: (() => any) | undefined;
5
6
  readonly "onUpdate:activeIndex"?: ((index: number) => any) | undefined;
6
- readonly onChange?: ((event: ShortMediaFeedChangeEvent<T>) => any) | undefined;
7
7
  readonly onReachStart?: (() => any) | undefined;
8
8
  readonly onReachEnd?: (() => any) | undefined;
9
9
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onLoadMore" | "onUpdate:activeIndex" | "onReachStart" | "onReachEnd"> & {
@@ -27,7 +27,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
27
27
  }): unknown;
28
28
  empty?(): unknown;
29
29
  };
30
- emit: ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "change", event: ShortMediaFeedChangeEvent<T>) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
30
+ emit: ((evt: "change", event: ShortMediaFeedChangeEvent<T>) => void) & ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
31
31
  }>) => import('vue').VNode & {
32
32
  __ctx?: Awaited<typeof __VLS_setup>;
33
33
  };
@@ -1,9 +1,9 @@
1
1
  import { ItemKey, ResponsiveBreakpoint, VirtualCarouselChangeEvent, VirtualCarouselExpose } from '../types.cjs';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onChange?: ((event: VirtualCarouselChangeEvent<T>) => any) | undefined;
4
5
  readonly onLoadMore?: (() => any) | undefined;
5
6
  readonly "onUpdate:activeIndex"?: ((index: number) => any) | undefined;
6
- readonly onChange?: ((event: VirtualCarouselChangeEvent<T>) => any) | undefined;
7
7
  readonly onReachStart?: (() => any) | undefined;
8
8
  readonly onReachEnd?: (() => any) | undefined;
9
9
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onLoadMore" | "onUpdate:activeIndex" | "onReachStart" | "onReachEnd"> & {
@@ -23,6 +23,18 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
23
23
  autoplayDelay?: number;
24
24
  autoplayLoop?: boolean;
25
25
  pauseOnHover?: boolean;
26
+ mouseDrag?: boolean;
27
+ dragThreshold?: number;
28
+ momentum?: boolean;
29
+ settleDuration?: number;
30
+ nativeSnap?: boolean;
31
+ autoWidth?: boolean;
32
+ estimatedItemWidth?: number;
33
+ rtl?: boolean;
34
+ loop?: boolean;
35
+ keepAlive?: boolean;
36
+ maxCachedItems?: number;
37
+ pinnedIndexes?: readonly number[];
26
38
  responsive?: ResponsiveBreakpoint[];
27
39
  } & Partial<{}>> & import('vue').PublicProps;
28
40
  expose(exposed: import('vue').ShallowUnwrapRef<VirtualCarouselExpose>): void;
@@ -33,10 +45,11 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
33
45
  index: number;
34
46
  active: boolean;
35
47
  visible: boolean;
48
+ inViewport: boolean;
36
49
  }): unknown;
37
50
  empty?(): unknown;
38
51
  };
39
- emit: ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "change", event: VirtualCarouselChangeEvent<T>) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
52
+ emit: ((evt: "change", event: VirtualCarouselChangeEvent<T>) => void) & ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
40
53
  }>) => import('vue').VNode & {
41
54
  __ctx?: Awaited<typeof __VLS_setup>;
42
55
  };
@@ -1,9 +1,9 @@
1
1
  import { ItemKey, ResponsiveBreakpoint, VirtualCarouselChangeEvent, VirtualCarouselExpose } from '../types.js';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onChange?: ((event: VirtualCarouselChangeEvent<T>) => any) | undefined;
4
5
  readonly onLoadMore?: (() => any) | undefined;
5
6
  readonly "onUpdate:activeIndex"?: ((index: number) => any) | undefined;
6
- readonly onChange?: ((event: VirtualCarouselChangeEvent<T>) => any) | undefined;
7
7
  readonly onReachStart?: (() => any) | undefined;
8
8
  readonly onReachEnd?: (() => any) | undefined;
9
9
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onLoadMore" | "onUpdate:activeIndex" | "onReachStart" | "onReachEnd"> & {
@@ -23,6 +23,18 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
23
23
  autoplayDelay?: number;
24
24
  autoplayLoop?: boolean;
25
25
  pauseOnHover?: boolean;
26
+ mouseDrag?: boolean;
27
+ dragThreshold?: number;
28
+ momentum?: boolean;
29
+ settleDuration?: number;
30
+ nativeSnap?: boolean;
31
+ autoWidth?: boolean;
32
+ estimatedItemWidth?: number;
33
+ rtl?: boolean;
34
+ loop?: boolean;
35
+ keepAlive?: boolean;
36
+ maxCachedItems?: number;
37
+ pinnedIndexes?: readonly number[];
26
38
  responsive?: ResponsiveBreakpoint[];
27
39
  } & Partial<{}>> & import('vue').PublicProps;
28
40
  expose(exposed: import('vue').ShallowUnwrapRef<VirtualCarouselExpose>): void;
@@ -33,10 +45,11 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
33
45
  index: number;
34
46
  active: boolean;
35
47
  visible: boolean;
48
+ inViewport: boolean;
36
49
  }): unknown;
37
50
  empty?(): unknown;
38
51
  };
39
- emit: ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "change", event: VirtualCarouselChangeEvent<T>) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
52
+ emit: ((evt: "change", event: VirtualCarouselChangeEvent<T>) => void) & ((evt: "loadMore") => void) & ((evt: "update:activeIndex", index: number) => void) & ((evt: "reachStart") => void) & ((evt: "reachEnd") => void);
40
53
  }>) => import('vue').VNode & {
41
54
  __ctx?: Awaited<typeof __VLS_setup>;
42
55
  };
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.cjs';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  itemSize: number;
10
10
  height?: number | string;
@@ -40,7 +40,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
40
40
  refreshing: boolean;
41
41
  }): unknown;
42
42
  };
43
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
43
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
44
44
  }>) => import('vue').VNode & {
45
45
  __ctx?: Awaited<typeof __VLS_setup>;
46
46
  };
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.js';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  itemSize: number;
10
10
  height?: number | string;
@@ -40,7 +40,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
40
40
  refreshing: boolean;
41
41
  }): unknown;
42
42
  };
43
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
43
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
44
44
  }>) => import('vue').VNode & {
45
45
  __ctx?: Awaited<typeof __VLS_setup>;
46
46
  };
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.cjs';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  estimatedItemSize?: number;
10
10
  overscan?: number;
@@ -39,7 +39,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
39
39
  refreshing: boolean;
40
40
  }): unknown;
41
41
  };
42
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
42
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
43
43
  }>) => import('vue').VNode & {
44
44
  __ctx?: Awaited<typeof __VLS_setup>;
45
45
  };
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.js';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  estimatedItemSize?: number;
10
10
  overscan?: number;
@@ -39,7 +39,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
39
39
  refreshing: boolean;
40
40
  }): unknown;
41
41
  };
42
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
42
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
43
43
  }>) => import('vue').VNode & {
44
44
  __ctx?: Awaited<typeof __VLS_setup>;
45
45
  };
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.cjs';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  itemSize: number;
10
10
  columns?: number;
@@ -43,7 +43,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
43
43
  refreshing: boolean;
44
44
  }): unknown;
45
45
  };
46
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
46
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
47
47
  }>) => import('vue').VNode & {
48
48
  __ctx?: Awaited<typeof __VLS_setup>;
49
49
  };
@@ -2,9 +2,9 @@ import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.js';
2
2
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
5
- readonly onLoadMore?: (() => any) | undefined;
6
5
  readonly onRefresh?: (() => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
6
+ readonly onLoadMore?: (() => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onRefresh" | "onLoadMore"> & {
8
8
  items: readonly T[];
9
9
  itemSize: number;
10
10
  columns?: number;
@@ -43,7 +43,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
43
43
  refreshing: boolean;
44
44
  }): unknown;
45
45
  };
46
- emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
46
+ emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "refresh") => void) & ((evt: "loadMore") => void);
47
47
  }>) => import('vue').VNode & {
48
48
  __ctx?: Awaited<typeof __VLS_setup>;
49
49
  };
@@ -0,0 +1,15 @@
1
+ interface CarouselAutoplayOptions {
2
+ enabled: () => boolean;
3
+ paused: () => boolean;
4
+ delay: () => number;
5
+ count: () => number;
6
+ atEnd: () => boolean;
7
+ loop: () => boolean;
8
+ advance: () => void;
9
+ rewind: () => void;
10
+ }
11
+ export declare function useCarouselAutoplay(options: CarouselAutoplayOptions): {
12
+ start: () => void;
13
+ stop: () => void;
14
+ };
15
+ export {};
@@ -0,0 +1,15 @@
1
+ interface CarouselAutoplayOptions {
2
+ enabled: () => boolean;
3
+ paused: () => boolean;
4
+ delay: () => number;
5
+ count: () => number;
6
+ atEnd: () => boolean;
7
+ loop: () => boolean;
8
+ advance: () => void;
9
+ rewind: () => void;
10
+ }
11
+ export declare function useCarouselAutoplay(options: CarouselAutoplayOptions): {
12
+ start: () => void;
13
+ stop: () => void;
14
+ };
15
+ export {};
@@ -0,0 +1,40 @@
1
+ import { CarouselInteractionPhase } from '../types.cjs';
2
+ interface CarouselInteractionOptions {
3
+ viewport: () => HTMLElement | undefined;
4
+ track: () => HTMLElement | undefined;
5
+ rtl: () => boolean;
6
+ mouseDrag: () => boolean;
7
+ nativeSnap: () => boolean;
8
+ dragThreshold: () => number;
9
+ momentum: () => boolean;
10
+ settleDuration: () => number;
11
+ limits: () => [number, number];
12
+ step: () => number;
13
+ indexAt: (position: number) => number;
14
+ target: (index: number, from: number, direction?: number) => number;
15
+ canonical: (index: number) => number;
16
+ onPosition: (position: number) => void;
17
+ onCommit: (index: number) => void;
18
+ }
19
+ export declare function useCarouselInteraction(options: CarouselInteractionOptions): {
20
+ phase: import('vue').Ref<CarouselInteractionPhase, CarouselInteractionPhase>;
21
+ busy: import('vue').ComputedRef<boolean>;
22
+ dragging: import('vue').ComputedRef<boolean>;
23
+ transformed: import('vue').Ref<boolean, boolean>;
24
+ read: () => number;
25
+ write: (position: number, behavior?: ScrollBehavior) => void;
26
+ cancel: (preservePosition?: boolean) => number;
27
+ commit: (index: number, behavior?: ScrollBehavior) => void;
28
+ navigate: (index: number, behavior?: ScrollBehavior, travelDirection?: number, transform?: boolean) => void;
29
+ displayedPosition: () => number;
30
+ handleScroll: (event: Event) => void;
31
+ handlePointerDown: (event: PointerEvent) => void;
32
+ handlePointerMove: (event: PointerEvent) => void;
33
+ handlePointerUp: (event: PointerEvent) => void;
34
+ handlePointerCancel: (event: PointerEvent) => void;
35
+ handleLostPointerCapture: (event: PointerEvent) => void;
36
+ handleClick: (event: MouseEvent) => void;
37
+ handleWheel: () => void;
38
+ handleDragStart: (event: DragEvent) => void;
39
+ };
40
+ export {};
@@ -0,0 +1,40 @@
1
+ import { CarouselInteractionPhase } from '../types.js';
2
+ interface CarouselInteractionOptions {
3
+ viewport: () => HTMLElement | undefined;
4
+ track: () => HTMLElement | undefined;
5
+ rtl: () => boolean;
6
+ mouseDrag: () => boolean;
7
+ nativeSnap: () => boolean;
8
+ dragThreshold: () => number;
9
+ momentum: () => boolean;
10
+ settleDuration: () => number;
11
+ limits: () => [number, number];
12
+ step: () => number;
13
+ indexAt: (position: number) => number;
14
+ target: (index: number, from: number, direction?: number) => number;
15
+ canonical: (index: number) => number;
16
+ onPosition: (position: number) => void;
17
+ onCommit: (index: number) => void;
18
+ }
19
+ export declare function useCarouselInteraction(options: CarouselInteractionOptions): {
20
+ phase: import('vue').Ref<CarouselInteractionPhase, CarouselInteractionPhase>;
21
+ busy: import('vue').ComputedRef<boolean>;
22
+ dragging: import('vue').ComputedRef<boolean>;
23
+ transformed: import('vue').Ref<boolean, boolean>;
24
+ read: () => number;
25
+ write: (position: number, behavior?: ScrollBehavior) => void;
26
+ cancel: (preservePosition?: boolean) => number;
27
+ commit: (index: number, behavior?: ScrollBehavior) => void;
28
+ navigate: (index: number, behavior?: ScrollBehavior, travelDirection?: number, transform?: boolean) => void;
29
+ displayedPosition: () => number;
30
+ handleScroll: (event: Event) => void;
31
+ handlePointerDown: (event: PointerEvent) => void;
32
+ handlePointerMove: (event: PointerEvent) => void;
33
+ handlePointerUp: (event: PointerEvent) => void;
34
+ handlePointerCancel: (event: PointerEvent) => void;
35
+ handleLostPointerCapture: (event: PointerEvent) => void;
36
+ handleClick: (event: MouseEvent) => void;
37
+ handleWheel: () => void;
38
+ handleDragStart: (event: DragEvent) => void;
39
+ };
40
+ export {};
@@ -0,0 +1,28 @@
1
+ interface ScrollActivityOptions {
2
+ delay: () => number;
3
+ viewport: () => HTMLElement | undefined;
4
+ hasProgrammaticScroll: () => boolean;
5
+ onInterrupt: () => void;
6
+ onStart: () => void;
7
+ onSettled: () => void;
8
+ onChange: (isScrolling: boolean) => void;
9
+ }
10
+ /**
11
+ * Normalizes wheel, touch, keyboard and scrollbar activity into one lifecycle.
12
+ * The chat layout can defer native scroll corrections until that lifecycle has
13
+ * settled without mixing input-device bookkeeping into measurement logic.
14
+ */
15
+ export declare function useScrollActivity(options: ScrollActivityOptions): {
16
+ isScrolling: import('vue').Ref<boolean, boolean>;
17
+ setScrolling: (value: boolean) => void;
18
+ scheduleScrollEnd: () => void;
19
+ handleScrollEnd: () => void;
20
+ handleTouchStart: () => void;
21
+ handleTouchEnd: (event: TouchEvent) => void;
22
+ handleWheel: () => void;
23
+ handleKeyDown: (event: KeyboardEvent) => void;
24
+ handlePointerDown: (event: PointerEvent) => void;
25
+ handlePointerUp: () => void;
26
+ dispose: () => void;
27
+ };
28
+ export {};
@@ -0,0 +1,28 @@
1
+ interface ScrollActivityOptions {
2
+ delay: () => number;
3
+ viewport: () => HTMLElement | undefined;
4
+ hasProgrammaticScroll: () => boolean;
5
+ onInterrupt: () => void;
6
+ onStart: () => void;
7
+ onSettled: () => void;
8
+ onChange: (isScrolling: boolean) => void;
9
+ }
10
+ /**
11
+ * Normalizes wheel, touch, keyboard and scrollbar activity into one lifecycle.
12
+ * The chat layout can defer native scroll corrections until that lifecycle has
13
+ * settled without mixing input-device bookkeeping into measurement logic.
14
+ */
15
+ export declare function useScrollActivity(options: ScrollActivityOptions): {
16
+ isScrolling: import('vue').Ref<boolean, boolean>;
17
+ setScrolling: (value: boolean) => void;
18
+ scheduleScrollEnd: () => void;
19
+ handleScrollEnd: () => void;
20
+ handleTouchStart: () => void;
21
+ handleTouchEnd: (event: TouchEvent) => void;
22
+ handleWheel: () => void;
23
+ handleKeyDown: (event: KeyboardEvent) => void;
24
+ handlePointerDown: (event: PointerEvent) => void;
25
+ handlePointerUp: () => void;
26
+ dispose: () => void;
27
+ };
28
+ export {};
package/dist/index.d.cts CHANGED
@@ -22,6 +22,6 @@ declare module 'vue' {
22
22
  }
23
23
  declare const VirtualList: typeof DynamicVirtualScroll;
24
24
  export { ChatVirtualScroll, DynamicVirtualScroll, ShortMediaFeed, SkeletonLoader, VirtualCarousel, VirtualList, VirtualScroll, WindowDynamicVirtualScroll, WindowGirdVirtualScroll, };
25
- export type { ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, SkeletonLoaderProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, WindowGirdVirtualScrollProps, } from './types.cjs';
25
+ export type { CarouselInteractionPhase, ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, SkeletonLoaderProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, WindowGirdVirtualScrollProps, } from './types.cjs';
26
26
  export declare const VueVirtualScroll: Plugin;
27
27
  export default VueVirtualScroll;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,6 @@ declare module 'vue' {
22
22
  }
23
23
  declare const VirtualList: typeof DynamicVirtualScroll;
24
24
  export { ChatVirtualScroll, DynamicVirtualScroll, ShortMediaFeed, SkeletonLoader, VirtualCarousel, VirtualList, VirtualScroll, WindowDynamicVirtualScroll, WindowGirdVirtualScroll, };
25
- export type { ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, SkeletonLoaderProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, WindowGirdVirtualScrollProps, } from './types.js';
25
+ export type { CarouselInteractionPhase, ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, SkeletonLoaderProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, WindowGirdVirtualScrollProps, } from './types.js';
26
26
  export declare const VueVirtualScroll: Plugin;
27
27
  export default VueVirtualScroll;
package/dist/types.d.cts CHANGED
@@ -70,7 +70,11 @@ export interface WindowGirdVirtualScrollProps<T> {
70
70
  }
71
71
  export interface ChatVirtualScrollProps<T> {
72
72
  items: readonly T[];
73
+ /** Increment after mutating/reordering the same array instance in place. */
74
+ itemsVersion?: PropertyKey;
73
75
  estimatedItemSize?: number;
76
+ /** Optional per-message estimate used before the message is measured. */
77
+ estimateItemSize?: (item: T, index: number) => number;
74
78
  height?: number | string;
75
79
  overscan?: number;
76
80
  /** Render budget including overscan; always keeps the viewport filled. */
@@ -83,6 +87,22 @@ export interface ChatVirtualScrollProps<T> {
83
87
  hasOlder?: boolean;
84
88
  loadingOlder?: boolean;
85
89
  loadOlderThreshold?: number;
90
+ /** Idle delay used when the browser does not provide a reliable scrollend event. */
91
+ scrollEndDelay?: number;
92
+ /** Measure newly mounted messages synchronously before paint. */
93
+ syncMeasurement?: boolean;
94
+ /** Message keys that must remain mounted outside the visible range. */
95
+ pinnedKeys?: readonly PropertyKey[];
96
+ maxPinnedItems?: number;
97
+ /** Retain the message containing keyboard focus while it is off-screen. */
98
+ keepFocusedItem?: boolean;
99
+ showNewItemsIndicator?: boolean;
100
+ /** Localizes the built-in new-message control. */
101
+ newItemsLabel?: (count: number) => string;
102
+ /** Return true for appended items that should always move the conversation to the bottom. */
103
+ forceStickToBottom?: (item: T, index: number) => boolean;
104
+ /** Enable layout/paint containment. Disable when non-teleported overlays may escape. */
105
+ contain?: boolean;
86
106
  }
87
107
  export interface ShortMediaFeedProps<T> {
88
108
  items: readonly T[];
@@ -116,8 +136,25 @@ export interface VirtualCarouselProps<T> {
116
136
  autoplayDelay?: number;
117
137
  autoplayLoop?: boolean;
118
138
  pauseOnHover?: boolean;
139
+ mouseDrag?: boolean;
140
+ dragThreshold?: number;
141
+ momentum?: boolean;
142
+ settleDuration?: number;
143
+ /** Disable native snap for nested snap containers; the motion controller settles instead. */
144
+ nativeSnap?: boolean;
145
+ autoWidth?: boolean;
146
+ estimatedItemWidth?: number;
147
+ rtl?: boolean;
148
+ /** Continuous looping; distinct from autoplayLoop's rewind behavior. */
149
+ loop?: boolean;
150
+ keepAlive?: boolean;
151
+ /** Maximum additional off-screen slides retained by keepAlive. */
152
+ maxCachedItems?: number;
153
+ /** Slides to retain, capped by maxCachedItems. */
154
+ pinnedIndexes?: readonly number[];
119
155
  responsive?: ResponsiveBreakpoint[];
120
156
  }
157
+ export type CarouselInteractionPhase = 'idle' | 'pending' | 'dragging' | 'settling' | 'committing';
121
158
  export interface ResponsiveBreakpoint {
122
159
  breakpoint: number;
123
160
  slidesPerView?: number;
@@ -143,6 +180,15 @@ export interface VirtualScrollExpose {
143
180
  }
144
181
  export interface ChatVirtualScrollExpose extends VirtualScrollExpose {
145
182
  readonly isAtBottom: boolean;
183
+ readonly isScrolling: boolean;
184
+ readonly newItemsCount: number;
185
+ clearNewItems: () => void;
186
+ /** Reconcile keys and measurements after an in-place items mutation. */
187
+ refresh: () => void;
188
+ getScrollPosition: () => number;
189
+ scrollToKey: (key: PropertyKey, options?: ScrollToOptions & {
190
+ align?: ScrollAlignment;
191
+ }) => void;
146
192
  scrollToBottom: (behavior?: ScrollBehavior) => void;
147
193
  }
148
194
  export interface ShortMediaFeedExpose {
package/dist/types.d.ts CHANGED
@@ -70,7 +70,11 @@ export interface WindowGirdVirtualScrollProps<T> {
70
70
  }
71
71
  export interface ChatVirtualScrollProps<T> {
72
72
  items: readonly T[];
73
+ /** Increment after mutating/reordering the same array instance in place. */
74
+ itemsVersion?: PropertyKey;
73
75
  estimatedItemSize?: number;
76
+ /** Optional per-message estimate used before the message is measured. */
77
+ estimateItemSize?: (item: T, index: number) => number;
74
78
  height?: number | string;
75
79
  overscan?: number;
76
80
  /** Render budget including overscan; always keeps the viewport filled. */
@@ -83,6 +87,22 @@ export interface ChatVirtualScrollProps<T> {
83
87
  hasOlder?: boolean;
84
88
  loadingOlder?: boolean;
85
89
  loadOlderThreshold?: number;
90
+ /** Idle delay used when the browser does not provide a reliable scrollend event. */
91
+ scrollEndDelay?: number;
92
+ /** Measure newly mounted messages synchronously before paint. */
93
+ syncMeasurement?: boolean;
94
+ /** Message keys that must remain mounted outside the visible range. */
95
+ pinnedKeys?: readonly PropertyKey[];
96
+ maxPinnedItems?: number;
97
+ /** Retain the message containing keyboard focus while it is off-screen. */
98
+ keepFocusedItem?: boolean;
99
+ showNewItemsIndicator?: boolean;
100
+ /** Localizes the built-in new-message control. */
101
+ newItemsLabel?: (count: number) => string;
102
+ /** Return true for appended items that should always move the conversation to the bottom. */
103
+ forceStickToBottom?: (item: T, index: number) => boolean;
104
+ /** Enable layout/paint containment. Disable when non-teleported overlays may escape. */
105
+ contain?: boolean;
86
106
  }
87
107
  export interface ShortMediaFeedProps<T> {
88
108
  items: readonly T[];
@@ -116,8 +136,25 @@ export interface VirtualCarouselProps<T> {
116
136
  autoplayDelay?: number;
117
137
  autoplayLoop?: boolean;
118
138
  pauseOnHover?: boolean;
139
+ mouseDrag?: boolean;
140
+ dragThreshold?: number;
141
+ momentum?: boolean;
142
+ settleDuration?: number;
143
+ /** Disable native snap for nested snap containers; the motion controller settles instead. */
144
+ nativeSnap?: boolean;
145
+ autoWidth?: boolean;
146
+ estimatedItemWidth?: number;
147
+ rtl?: boolean;
148
+ /** Continuous looping; distinct from autoplayLoop's rewind behavior. */
149
+ loop?: boolean;
150
+ keepAlive?: boolean;
151
+ /** Maximum additional off-screen slides retained by keepAlive. */
152
+ maxCachedItems?: number;
153
+ /** Slides to retain, capped by maxCachedItems. */
154
+ pinnedIndexes?: readonly number[];
119
155
  responsive?: ResponsiveBreakpoint[];
120
156
  }
157
+ export type CarouselInteractionPhase = 'idle' | 'pending' | 'dragging' | 'settling' | 'committing';
121
158
  export interface ResponsiveBreakpoint {
122
159
  breakpoint: number;
123
160
  slidesPerView?: number;
@@ -143,6 +180,15 @@ export interface VirtualScrollExpose {
143
180
  }
144
181
  export interface ChatVirtualScrollExpose extends VirtualScrollExpose {
145
182
  readonly isAtBottom: boolean;
183
+ readonly isScrolling: boolean;
184
+ readonly newItemsCount: number;
185
+ clearNewItems: () => void;
186
+ /** Reconcile keys and measurements after an in-place items mutation. */
187
+ refresh: () => void;
188
+ getScrollPosition: () => number;
189
+ scrollToKey: (key: PropertyKey, options?: ScrollToOptions & {
190
+ align?: ScrollAlignment;
191
+ }) => void;
146
192
  scrollToBottom: (behavior?: ScrollBehavior) => void;
147
193
  }
148
194
  export interface ShortMediaFeedExpose {