@humanspeak/svelte-virtual-list 0.3.10 → 0.3.12
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/SvelteVirtualList.svelte +34 -17
- package/package.json +16 -16
|
@@ -697,7 +697,7 @@
|
|
|
697
697
|
})
|
|
698
698
|
heightManager.endDynamicUpdate()
|
|
699
699
|
},
|
|
700
|
-
lastMeasuredIndex < 0 ? 0 : 100, // debounceTime (no debounce on first pass)
|
|
700
|
+
lastMeasuredIndex < 0 || dirtyItems.size > 0 ? 0 : 100, // debounceTime (no debounce on first pass or when dirty items exist)
|
|
701
701
|
dirtyItems, // Pass dirty items for processing
|
|
702
702
|
0, // Don't pass ReactiveListManager state - let each system manage its own totals
|
|
703
703
|
0, // Don't pass ReactiveListManager state - let each system manage its own totals
|
|
@@ -1347,6 +1347,38 @@
|
|
|
1347
1347
|
}
|
|
1348
1348
|
})
|
|
1349
1349
|
|
|
1350
|
+
// Call debugFunction in an effect to avoid state_unsafe_mutation when
|
|
1351
|
+
// the callback writes to $state (which is forbidden during render effects)
|
|
1352
|
+
$effect(() => {
|
|
1353
|
+
if (!debug) return
|
|
1354
|
+
const currentVisibleRange = visibleItems()
|
|
1355
|
+
if (
|
|
1356
|
+
!shouldShowDebugInfo(
|
|
1357
|
+
prevVisibleRange,
|
|
1358
|
+
currentVisibleRange,
|
|
1359
|
+
prevHeight,
|
|
1360
|
+
heightManager.averageHeight
|
|
1361
|
+
)
|
|
1362
|
+
)
|
|
1363
|
+
return
|
|
1364
|
+
|
|
1365
|
+
const info = createDebugInfo(
|
|
1366
|
+
currentVisibleRange,
|
|
1367
|
+
items.length,
|
|
1368
|
+
Object.keys(heightManager.getHeightCache()).length,
|
|
1369
|
+
heightManager.averageHeight,
|
|
1370
|
+
heightManager.scrollTop,
|
|
1371
|
+
height || 0,
|
|
1372
|
+
totalHeight()
|
|
1373
|
+
)
|
|
1374
|
+
|
|
1375
|
+
if (debugFunction) {
|
|
1376
|
+
debugFunction(info)
|
|
1377
|
+
} else {
|
|
1378
|
+
console.info('Virtual List Debug:', info)
|
|
1379
|
+
}
|
|
1380
|
+
})
|
|
1381
|
+
|
|
1350
1382
|
/**
|
|
1351
1383
|
* Scrolls the virtual list to the item at the given index.
|
|
1352
1384
|
*
|
|
@@ -1599,22 +1631,7 @@
|
|
|
1599
1631
|
class={itemsClass ?? 'virtual-list-items'}
|
|
1600
1632
|
style:transform="translateY({transformY()}px)"
|
|
1601
1633
|
>
|
|
1602
|
-
{#each displayItems() as currentItemWithIndex,
|
|
1603
|
-
<!-- Only debug when visible range or average height changes -->
|
|
1604
|
-
{#if debug && i === 0 && shouldShowDebugInfo(prevVisibleRange, visibleItems(), prevHeight, heightManager.averageHeight)}
|
|
1605
|
-
{@const debugInfo = createDebugInfo(
|
|
1606
|
-
visibleItems(),
|
|
1607
|
-
items.length,
|
|
1608
|
-
Object.keys(heightManager.getHeightCache()).length,
|
|
1609
|
-
heightManager.averageHeight,
|
|
1610
|
-
heightManager.scrollTop,
|
|
1611
|
-
height || 0,
|
|
1612
|
-
totalHeight()
|
|
1613
|
-
)}
|
|
1614
|
-
{debugFunction
|
|
1615
|
-
? debugFunction(debugInfo)
|
|
1616
|
-
: console.info('Virtual List Debug:', debugInfo)}
|
|
1617
|
-
{/if}
|
|
1634
|
+
{#each displayItems() as currentItemWithIndex, _i (currentItemWithIndex.originalIndex)}
|
|
1618
1635
|
<!-- Render each visible item -->
|
|
1619
1636
|
<div
|
|
1620
1637
|
bind:this={itemElements[currentItemWithIndex.sliceIndex]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humanspeak/svelte-virtual-list",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "A lightweight, high-performance virtual list component for Svelte 5 that renders large datasets with minimal memory usage. Features include dynamic height support, smooth scrolling, TypeScript support, and efficient DOM recycling. Ideal for infinite scrolling lists, data tables, chat interfaces, and any application requiring the rendering of thousands of items without compromising performance. Zero dependencies and fully customizable.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelte",
|
|
@@ -60,42 +60,42 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@eslint/compat": "^2.0.2",
|
|
63
|
-
"@eslint/js": "^
|
|
64
|
-
"@faker-js/faker": "^10.
|
|
65
|
-
"@playwright/test": "^1.58.
|
|
66
|
-
"@sveltejs/adapter-auto": "^7.0.
|
|
67
|
-
"@sveltejs/kit": "^2.
|
|
63
|
+
"@eslint/js": "^10.0.1",
|
|
64
|
+
"@faker-js/faker": "^10.3.0",
|
|
65
|
+
"@playwright/test": "^1.58.2",
|
|
66
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
67
|
+
"@sveltejs/kit": "^2.52.0",
|
|
68
68
|
"@sveltejs/package": "^2.5.7",
|
|
69
69
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
70
70
|
"@tailwindcss/vite": "^4.1.18",
|
|
71
71
|
"@testing-library/jest-dom": "^6.9.1",
|
|
72
72
|
"@testing-library/svelte": "^5.3.1",
|
|
73
73
|
"@testing-library/user-event": "^14.6.1",
|
|
74
|
-
"@types/node": "^25.2.
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
76
|
-
"@typescript-eslint/parser": "^8.
|
|
74
|
+
"@types/node": "^25.2.3",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
76
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
77
77
|
"@vitest/coverage-v8": "^4.0.18",
|
|
78
78
|
"concurrently": "^9.2.1",
|
|
79
|
-
"eslint": "^
|
|
79
|
+
"eslint": "^10.0.0",
|
|
80
80
|
"eslint-config-prettier": "^10.1.8",
|
|
81
81
|
"eslint-plugin-import": "^2.32.0",
|
|
82
|
-
"eslint-plugin-svelte": "^3.
|
|
83
|
-
"eslint-plugin-unused-imports": "^4.
|
|
82
|
+
"eslint-plugin-svelte": "^3.15.0",
|
|
83
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
84
84
|
"globals": "^17.3.0",
|
|
85
85
|
"husky": "^9.1.7",
|
|
86
|
-
"jsdom": "^28.
|
|
86
|
+
"jsdom": "^28.1.0",
|
|
87
87
|
"prettier": "^3.8.1",
|
|
88
88
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
89
89
|
"prettier-plugin-sort-json": "^4.2.0",
|
|
90
90
|
"prettier-plugin-svelte": "^3.4.1",
|
|
91
91
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
92
92
|
"publint": "^0.3.17",
|
|
93
|
-
"svelte": "^5.
|
|
94
|
-
"svelte-check": "^4.
|
|
93
|
+
"svelte": "^5.51.2",
|
|
94
|
+
"svelte-check": "^4.4.0",
|
|
95
95
|
"tailwindcss": "^4.1.18",
|
|
96
96
|
"tw-animate-css": "^1.4.0",
|
|
97
97
|
"typescript": "^5.9.3",
|
|
98
|
-
"typescript-eslint": "^8.
|
|
98
|
+
"typescript-eslint": "^8.55.0",
|
|
99
99
|
"vite": "^7.3.1",
|
|
100
100
|
"vitest": "^4.0.18"
|
|
101
101
|
},
|