@tanstack/svelte-virtual 3.6.0 → 3.8.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 CHANGED
@@ -1,6 +1,8 @@
1
- import { PartialKeys, Virtualizer, VirtualizerOptions } from '@tanstack/virtual-core';
1
+ /// <reference types="svelte" />
2
+ import { Virtualizer } from '@tanstack/virtual-core';
3
+ import type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core';
4
+ import type { Readable } from 'svelte/store';
2
5
  export * from '@tanstack/virtual-core';
3
- import { Readable } from 'svelte/store';
4
6
  export type SvelteVirtualizer<TScrollElement extends Element | Window, TItemElement extends Element> = Omit<Virtualizer<TScrollElement, TItemElement>, 'setOptions'> & {
5
7
  setOptions: (options: Partial<VirtualizerOptions<TScrollElement, TItemElement>>) => void;
6
8
  };
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
- import { elementScroll, observeElementOffset, observeElementRect, observeWindowOffset, observeWindowRect, Virtualizer, windowScroll, } from '@tanstack/virtual-core';
2
- export * from '@tanstack/virtual-core';
1
+ import { Virtualizer, elementScroll, observeElementOffset, observeElementRect, observeWindowOffset, observeWindowRect, windowScroll, } from '@tanstack/virtual-core';
3
2
  import { derived, writable } from 'svelte/store';
3
+ export * from '@tanstack/virtual-core';
4
4
  function createVirtualizerBase(initialOptions) {
5
5
  const virtualizer = new Virtualizer(initialOptions);
6
6
  const originalSetOptions = virtualizer.setOptions;
7
+ // eslint-disable-next-line prefer-const
7
8
  let virtualizerWritable;
8
9
  const setOptions = (options) => {
9
10
  const resolvedOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/svelte-virtual",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "Headless UI for virtualizing scrollable elements in Svelte",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -40,21 +40,16 @@
40
40
  "src"
41
41
  ],
42
42
  "dependencies": {
43
- "@tanstack/virtual-core": "3.6.0"
43
+ "@tanstack/virtual-core": "3.8.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@sveltejs/package": "^2.2.6",
47
- "@sveltejs/vite-plugin-svelte": "^3.0.2",
48
- "svelte": "^4.2.2",
49
- "svelte-check": "^3.4.6"
46
+ "@sveltejs/package": "^2.3.2",
47
+ "@sveltejs/vite-plugin-svelte": "^3.1.1",
48
+ "svelte": "^4.2.18",
49
+ "svelte-check": "^3.8.4"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "svelte": "^3.48.0 || ^4.0.0"
53
53
  },
54
- "scripts": {
55
- "clean": "rimraf ./dist && rimraf ./coverage",
56
- "test:types": "svelte-check --tsconfig ./tsconfig.json",
57
- "test:build": "publint --strict",
58
- "build": "svelte-package --input ./src --output ./dist"
59
- }
54
+ "scripts": {}
60
55
  }
package/src/index.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
+ Virtualizer,
2
3
  elementScroll,
3
4
  observeElementOffset,
4
5
  observeElementRect,
5
6
  observeWindowOffset,
6
7
  observeWindowRect,
7
- PartialKeys,
8
- Virtualizer,
9
- VirtualizerOptions,
10
8
  windowScroll,
11
9
  } from '@tanstack/virtual-core'
12
- export * from '@tanstack/virtual-core'
10
+ import { derived, writable } from 'svelte/store'
11
+ import type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'
12
+ import type { Readable, Writable } from 'svelte/store'
13
13
 
14
- import { derived, Readable, writable, Writable } from 'svelte/store'
14
+ export * from '@tanstack/virtual-core'
15
15
 
16
16
  export type SvelteVirtualizer<
17
17
  TScrollElement extends Element | Window,
@@ -31,6 +31,7 @@ function createVirtualizerBase<
31
31
  const virtualizer = new Virtualizer(initialOptions)
32
32
  const originalSetOptions = virtualizer.setOptions
33
33
 
34
+ // eslint-disable-next-line prefer-const
34
35
  let virtualizerWritable: Writable<Virtualizer<TScrollElement, TItemElement>>
35
36
 
36
37
  const setOptions = (