ink-virtual-list 0.2.0 → 0.2.1

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
@@ -77,8 +77,32 @@ interface TerminalSize {
77
77
  * Uses Ink's stdout to detect terminal dimensions.
78
78
  */
79
79
  declare function useTerminalSize(): TerminalSize;
80
+ /**
81
+ * Validates that itemHeight is a positive integer.
82
+ * Throws an error if invalid.
83
+ *
84
+ * @param itemHeight - The height to validate
85
+ */
80
86
  declare function validateItemHeight(itemHeight: number): void;
87
+ /**
88
+ * Inner component for VirtualList.
89
+ * Handles the actual rendering logic, state management, and ref exposure.
90
+ */
81
91
  declare function VirtualListInner<T>(props: VirtualListProps<T>, ref: React.ForwardedRef<VirtualListRef>): React.JSX.Element;
92
+ /**
93
+ * A virtualized list component for Ink.
94
+ *
95
+ * Efficiently renders large lists by only rendering items currently visible in the viewport.
96
+ * Supports keyboard navigation, scrolling, and dynamic resizing.
97
+ *
98
+ * @example
99
+ * ```tsx
100
+ * <VirtualList
101
+ * items={['Item 1', 'Item 2']}
102
+ * renderItem={({item}) => <Text>{item}</Text>}
103
+ * />
104
+ * ```
105
+ */
82
106
  declare const VirtualList: <T>(props: VirtualListProps<T> & {
83
107
  ref?: React.ForwardedRef<VirtualListRef>;
84
108
  }) => ReturnType<typeof VirtualListInner>;
package/dist/index.js.map CHANGED
@@ -3,9 +3,9 @@
3
3
  "sources": ["src\\useTerminalSize.ts", "src\\VirtualList.tsx"],
4
4
  "sourcesContent": [
5
5
  "import { useStdout } from \"ink\";\nimport { useEffect, useState } from \"react\";\n\n/**\n * Represents the terminal dimensions.\n */\nexport interface TerminalSize {\n /** Number of rows (lines) in the terminal */\n rows: number;\n /** Number of columns (characters) in the terminal */\n columns: number;\n}\n\nconst DEFAULT_ROWS = 24;\nconst DEFAULT_COLUMNS = 80;\n\n/**\n * Hook that returns the current terminal size and updates on resize.\n * Uses Ink's stdout to detect terminal dimensions.\n */\nexport function useTerminalSize(): TerminalSize {\n const { stdout } = useStdout();\n const [size, setSize] = useState<TerminalSize>({\n rows: stdout.rows ?? DEFAULT_ROWS,\n columns: stdout.columns ?? DEFAULT_COLUMNS,\n });\n\n useEffect(() => {\n // Skip resize listener in non-TTY environments (CI, pipes)\n if (!stdout.isTTY) {\n return;\n }\n\n const handleResize = () => {\n setSize({\n rows: stdout.rows ?? DEFAULT_ROWS,\n columns: stdout.columns ?? DEFAULT_COLUMNS,\n });\n };\n\n stdout.on(\"resize\", handleResize);\n return () => {\n stdout.off(\"resize\", handleResize);\n };\n }, [stdout]);\n\n return size;\n}\n",
6
- "import { Box, Text } from \"ink\";\nimport { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from \"react\";\nimport type { RenderItemProps, ViewportState, VirtualListProps, VirtualListRef } from \"./types\";\nimport { useTerminalSize } from \"./useTerminalSize\";\n\nconst DEFAULT_HEIGHT = 10;\nconst DEFAULT_ITEM_HEIGHT = 1;\n\n/**\n * Attempts to extract a stable key from an item.\n * Checks for 'id' or 'key' properties on objects before falling back to index.\n */\nfunction getDefaultKey<T>(item: T, index: number): string {\n if (item && typeof item === \"object\") {\n const obj = item as Record<string, unknown>;\n if (\"id\" in obj && (typeof obj.id === \"string\" || typeof obj.id === \"number\")) {\n return String(obj.id);\n }\n if (\"key\" in obj && (typeof obj.key === \"string\" || typeof obj.key === \"number\")) {\n return String(obj.key);\n }\n }\n return String(index);\n}\n\nexport function validateItemHeight(itemHeight: number): void {\n if (!Number.isInteger(itemHeight) || itemHeight < 1) {\n throw new Error(`[ink-virtual-list] itemHeight must be a positive integer, got: ${itemHeight}`);\n }\n}\n\nfunction calculateViewportOffset(selectedIndex: number, currentOffset: number, visibleCount: number): number {\n // Selection above viewport - scroll up\n if (selectedIndex < currentOffset) {\n return selectedIndex;\n }\n\n // Selection below viewport - scroll down\n if (selectedIndex >= currentOffset + visibleCount) {\n return selectedIndex - visibleCount + 1;\n }\n\n // Selection visible - no change\n return currentOffset;\n}\n\nfunction VirtualListInner<T>(props: VirtualListProps<T>, ref: React.ForwardedRef<VirtualListRef>): React.JSX.Element {\n const {\n items,\n renderItem,\n selectedIndex = 0,\n keyExtractor,\n height = DEFAULT_HEIGHT,\n reservedLines = 0,\n itemHeight = DEFAULT_ITEM_HEIGHT,\n showOverflowIndicators = true,\n overflowIndicatorThreshold = 1,\n renderOverflowTop,\n renderOverflowBottom,\n renderScrollBar,\n onViewportChange,\n } = props;\n\n // Validate itemHeight\n validateItemHeight(itemHeight);\n\n const { rows: terminalRows } = useTerminalSize();\n\n // Calculate resolved height\n const resolvedHeight = useMemo(() => {\n if (typeof height === \"number\") {\n return height;\n }\n // 'auto' - use terminal rows minus reserved\n return Math.max(1, terminalRows - reservedLines);\n }, [height, terminalRows, reservedLines]);\n\n const resolvedItemHeight = itemHeight ?? DEFAULT_ITEM_HEIGHT;\n\n // Reserve space for overflow indicators within the height budget\n const indicatorLines = showOverflowIndicators ? 2 : 0;\n const availableHeight = Math.max(0, resolvedHeight - indicatorLines);\n\n // Calculate how many items fit in viewport\n const visibleCount = Math.floor(availableHeight / resolvedItemHeight);\n\n // Clamp selectedIndex to valid range\n const clampedSelectedIndex = Math.max(0, Math.min(selectedIndex, items.length - 1));\n\n // Lazy initial offset - positions selection at bottom of viewport if needed\n const [viewportOffset, setViewportOffset] = useState(() => {\n if (items.length === 0) return 0;\n const maxOffset = Math.max(0, items.length - visibleCount);\n if (clampedSelectedIndex >= visibleCount) {\n return Math.min(clampedSelectedIndex - visibleCount + 1, maxOffset);\n }\n return 0;\n });\n\n // Sync viewport when selection changes\n useEffect(() => {\n const maxOffset = Math.max(0, items.length - visibleCount);\n const targetOffset = calculateViewportOffset(clampedSelectedIndex, viewportOffset, visibleCount);\n const clampedOffset = Math.min(Math.max(0, targetOffset), maxOffset);\n if (clampedOffset !== viewportOffset) {\n setViewportOffset(clampedOffset);\n }\n }, [clampedSelectedIndex, viewportOffset, visibleCount, items.length]);\n\n // Build viewport state\n const viewport: ViewportState = useMemo(\n () => ({\n offset: viewportOffset,\n visibleCount,\n totalCount: items.length,\n }),\n [viewportOffset, visibleCount, items.length],\n );\n\n // Notify on viewport change\n useEffect(() => {\n onViewportChange?.(viewport);\n }, [viewport, onViewportChange]);\n\n // Imperative handle\n useImperativeHandle(\n ref,\n () => ({\n scrollToIndex: (index: number, alignment: \"auto\" | \"top\" | \"center\" | \"bottom\" = \"auto\") => {\n const clampedIndex = Math.max(0, Math.min(index, items.length - 1));\n let newOffset: number;\n\n switch (alignment) {\n case \"top\":\n newOffset = clampedIndex;\n break;\n case \"center\":\n newOffset = clampedIndex - Math.floor(visibleCount / 2);\n break;\n case \"bottom\":\n newOffset = clampedIndex - visibleCount + 1;\n break;\n default: // 'auto'\n newOffset = calculateViewportOffset(clampedIndex, viewportOffset, visibleCount);\n }\n\n const maxOffset = Math.max(0, items.length - visibleCount);\n setViewportOffset(Math.min(Math.max(0, newOffset), maxOffset));\n },\n getViewport: () => viewport,\n remeasure: () => {\n // Force recalculation by updating state\n setViewportOffset((prev) => {\n const maxOffset = Math.max(0, items.length - visibleCount);\n return Math.min(prev, maxOffset);\n });\n },\n }),\n [items.length, visibleCount, viewportOffset, viewport],\n );\n\n // Calculate overflow counts\n const overflowTop = viewportOffset;\n const overflowBottom = Math.max(0, items.length - viewportOffset - visibleCount);\n\n // Get visible items\n const visibleItems = items.slice(viewportOffset, viewportOffset + visibleCount);\n\n // Default overflow renderers (paddingLeft aligns with list content)\n const defaultOverflowTop = (count: number) => (\n <Box paddingLeft={2}>\n <Text dimColor>▲ {count} more</Text>\n </Box>\n );\n const defaultOverflowBottom = (count: number) => (\n <Box paddingLeft={2}>\n <Text dimColor>▼ {count} more</Text>\n </Box>\n );\n\n const topIndicator = renderOverflowTop ?? defaultOverflowTop;\n const bottomIndicator = renderOverflowBottom ?? defaultOverflowBottom;\n\n return (\n <Box flexDirection=\"column\">\n {showOverflowIndicators && overflowTop >= overflowIndicatorThreshold && topIndicator(overflowTop)}\n\n {visibleItems.map((item, idx) => {\n const actualIndex = viewportOffset + idx;\n const key = keyExtractor ? keyExtractor(item, actualIndex) : getDefaultKey(item, actualIndex);\n\n const itemProps: RenderItemProps<T> = {\n item,\n index: actualIndex,\n isSelected: actualIndex === clampedSelectedIndex,\n };\n\n return (\n <Box key={key} height={resolvedItemHeight} overflow=\"hidden\">\n {renderItem(itemProps)}\n </Box>\n );\n })}\n\n {showOverflowIndicators && overflowBottom >= overflowIndicatorThreshold && bottomIndicator(overflowBottom)}\n\n {renderScrollBar?.(viewport)}\n </Box>\n );\n}\n\nexport const VirtualList = forwardRef(VirtualListInner) as <T>(\n props: VirtualListProps<T> & { ref?: React.ForwardedRef<VirtualListRef> },\n) => ReturnType<typeof VirtualListInner>;\n"
6
+ "import { Box, Text } from \"ink\";\nimport { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from \"react\";\nimport type { RenderItemProps, ViewportState, VirtualListProps, VirtualListRef } from \"./types\";\nimport { useTerminalSize } from \"./useTerminalSize\";\n\nconst DEFAULT_HEIGHT = 10;\nconst DEFAULT_ITEM_HEIGHT = 1;\n\n/**\n * Attempts to extract a stable key from an item.\n * Checks for 'id' or 'key' properties on objects before falling back to index.\n */\nfunction getDefaultKey<T>(item: T, index: number): string {\n if (item && typeof item === \"object\") {\n const obj = item as Record<string, unknown>;\n if (\"id\" in obj && (typeof obj.id === \"string\" || typeof obj.id === \"number\")) {\n return String(obj.id);\n }\n if (\"key\" in obj && (typeof obj.key === \"string\" || typeof obj.key === \"number\")) {\n return String(obj.key);\n }\n }\n return String(index);\n}\n\n/**\n * Validates that itemHeight is a positive integer.\n * Throws an error if invalid.\n *\n * @param itemHeight - The height to validate\n */\nexport function validateItemHeight(itemHeight: number): void {\n if (!Number.isInteger(itemHeight) || itemHeight < 1) {\n throw new Error(`[ink-virtual-list] itemHeight must be a positive integer, got: ${itemHeight}`);\n }\n}\n\n/**\n * Calculates the new viewport offset (scroll position) to ensure the selected index is visible.\n *\n * @param selectedIndex - The currently selected item index\n * @param currentOffset - The current viewport offset (top visible index)\n * @param visibleCount - The number of items that fit in the viewport\n * @returns The new offset, clamped to ensure the selection is visible\n */\nfunction calculateViewportOffset(selectedIndex: number, currentOffset: number, visibleCount: number): number {\n // Selection above viewport - scroll up\n if (selectedIndex < currentOffset) {\n return selectedIndex;\n }\n\n // Selection below viewport - scroll down\n if (selectedIndex >= currentOffset + visibleCount) {\n return selectedIndex - visibleCount + 1;\n }\n\n // Selection visible - no change\n return currentOffset;\n}\n\n/**\n * Inner component for VirtualList.\n * Handles the actual rendering logic, state management, and ref exposure.\n */\nfunction VirtualListInner<T>(props: VirtualListProps<T>, ref: React.ForwardedRef<VirtualListRef>): React.JSX.Element {\n const {\n items,\n renderItem,\n selectedIndex = 0,\n keyExtractor,\n height = DEFAULT_HEIGHT,\n reservedLines = 0,\n itemHeight = DEFAULT_ITEM_HEIGHT,\n showOverflowIndicators = true,\n overflowIndicatorThreshold = 1,\n renderOverflowTop,\n renderOverflowBottom,\n renderScrollBar,\n onViewportChange,\n } = props;\n\n // Validate itemHeight\n validateItemHeight(itemHeight);\n\n const { rows: terminalRows } = useTerminalSize();\n\n // Calculate resolved height\n const resolvedHeight = useMemo(() => {\n if (typeof height === \"number\") {\n return height;\n }\n // 'auto' - use terminal rows minus reserved\n return Math.max(1, terminalRows - reservedLines);\n }, [height, terminalRows, reservedLines]);\n\n const resolvedItemHeight = itemHeight ?? DEFAULT_ITEM_HEIGHT;\n\n // Reserve space for overflow indicators within the height budget\n const indicatorLines = showOverflowIndicators ? 2 : 0;\n const availableHeight = Math.max(0, resolvedHeight - indicatorLines);\n\n // Calculate how many items fit in viewport\n const visibleCount = Math.floor(availableHeight / resolvedItemHeight);\n\n // Clamp selectedIndex to valid range\n const clampedSelectedIndex = Math.max(0, Math.min(selectedIndex, items.length - 1));\n\n // Lazy initial offset - positions selection at bottom of viewport if needed\n const [viewportOffset, setViewportOffset] = useState(() => {\n if (items.length === 0) return 0;\n const maxOffset = Math.max(0, items.length - visibleCount);\n if (clampedSelectedIndex >= visibleCount) {\n return Math.min(clampedSelectedIndex - visibleCount + 1, maxOffset);\n }\n return 0;\n });\n\n // Sync viewport when selection changes\n useEffect(() => {\n const maxOffset = Math.max(0, items.length - visibleCount);\n const targetOffset = calculateViewportOffset(clampedSelectedIndex, viewportOffset, visibleCount);\n const clampedOffset = Math.min(Math.max(0, targetOffset), maxOffset);\n if (clampedOffset !== viewportOffset) {\n setViewportOffset(clampedOffset);\n }\n }, [clampedSelectedIndex, viewportOffset, visibleCount, items.length]);\n\n // Build viewport state\n const viewport: ViewportState = useMemo(\n () => ({\n offset: viewportOffset,\n visibleCount,\n totalCount: items.length,\n }),\n [viewportOffset, visibleCount, items.length],\n );\n\n // Notify on viewport change\n useEffect(() => {\n onViewportChange?.(viewport);\n }, [viewport, onViewportChange]);\n\n // Imperative handle\n useImperativeHandle(\n ref,\n () => ({\n scrollToIndex: (index: number, alignment: \"auto\" | \"top\" | \"center\" | \"bottom\" = \"auto\") => {\n const clampedIndex = Math.max(0, Math.min(index, items.length - 1));\n let newOffset: number;\n\n switch (alignment) {\n case \"top\":\n newOffset = clampedIndex;\n break;\n case \"center\":\n newOffset = clampedIndex - Math.floor(visibleCount / 2);\n break;\n case \"bottom\":\n newOffset = clampedIndex - visibleCount + 1;\n break;\n default: // 'auto'\n newOffset = calculateViewportOffset(clampedIndex, viewportOffset, visibleCount);\n }\n\n const maxOffset = Math.max(0, items.length - visibleCount);\n setViewportOffset(Math.min(Math.max(0, newOffset), maxOffset));\n },\n getViewport: () => viewport,\n remeasure: () => {\n // Force recalculation by updating state\n setViewportOffset((prev) => {\n const maxOffset = Math.max(0, items.length - visibleCount);\n return Math.min(prev, maxOffset);\n });\n },\n }),\n [items.length, visibleCount, viewportOffset, viewport],\n );\n\n // Calculate overflow counts\n const overflowTop = viewportOffset;\n const overflowBottom = Math.max(0, items.length - viewportOffset - visibleCount);\n\n // Get visible items\n const visibleItems = items.slice(viewportOffset, viewportOffset + visibleCount);\n\n // Default overflow renderers (paddingLeft aligns with list content)\n const defaultOverflowTop = (count: number) => (\n <Box paddingLeft={2}>\n <Text dimColor>▲ {count} more</Text>\n </Box>\n );\n const defaultOverflowBottom = (count: number) => (\n <Box paddingLeft={2}>\n <Text dimColor>▼ {count} more</Text>\n </Box>\n );\n\n const topIndicator = renderOverflowTop ?? defaultOverflowTop;\n const bottomIndicator = renderOverflowBottom ?? defaultOverflowBottom;\n\n return (\n <Box flexDirection=\"column\">\n {showOverflowIndicators && overflowTop >= overflowIndicatorThreshold && topIndicator(overflowTop)}\n\n {visibleItems.map((item, idx) => {\n const actualIndex = viewportOffset + idx;\n const key = keyExtractor ? keyExtractor(item, actualIndex) : getDefaultKey(item, actualIndex);\n\n const itemProps: RenderItemProps<T> = {\n item,\n index: actualIndex,\n isSelected: actualIndex === clampedSelectedIndex,\n };\n\n return (\n <Box key={key} height={resolvedItemHeight} overflow=\"hidden\">\n {renderItem(itemProps)}\n </Box>\n );\n })}\n\n {showOverflowIndicators && overflowBottom >= overflowIndicatorThreshold && bottomIndicator(overflowBottom)}\n\n {renderScrollBar?.(viewport)}\n </Box>\n );\n}\n\n/**\n * A virtualized list component for Ink.\n *\n * Efficiently renders large lists by only rendering items currently visible in the viewport.\n * Supports keyboard navigation, scrolling, and dynamic resizing.\n *\n * @example\n * ```tsx\n * <VirtualList\n * items={['Item 1', 'Item 2']}\n * renderItem={({item}) => <Text>{item}</Text>}\n * />\n * ```\n */\nexport const VirtualList = forwardRef(VirtualListInner) as <T>(\n props: VirtualListProps<T> & { ref?: React.ForwardedRef<VirtualListRef> },\n) => ReturnType<typeof VirtualListInner>;\n"
7
7
  ],
8
- "mappings": ";AAAA;AACA;AAYA,IAAM,eAAe;AACrB,IAAM,kBAAkB;AAMjB,SAAS,eAAe,GAAiB;AAAA,EAC9C,QAAQ,WAAW,UAAU;AAAA,EAC7B,OAAO,MAAM,WAAW,SAAuB;AAAA,IAC7C,MAAM,OAAO,QAAQ;AAAA,IAC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AAW;AAAA,MAE/F,aAAa,IAAI,CAAC,MAAM,QAAQ;AAAA,QAC/B,MAAM,cAAc,iBAAiB;AAAA,QACrC,MAAM,MAAM,eAAe,aAAa,MAAM,WAAW,IAAI,cAAc,MAAM,WAAW;AAAA,QAE5F,MAAM,YAAgC;AAAA,UACpC;AAAA,UACA,OAAO;AAAA,UACP,YAAY,gBAAgB;AAAA,QAC9B;AAAA,QAEA,uBACE,OAEE,KAFF;AAAA,UAAe,QAAQ;AAAA,UAAoB,UAAS;AAAA,UAApD,UACG,WAAW,SAAS;AAAA,WADb,KAAV,sBAEE;AAAA,OAEL;AAAA,MAEA,0BAA0B,kBAAkB,8BAA8B,gBAAgB,cAAc;AAAA,MAExG,kBAAkB,QAAQ;AAAA;AAAA,KAtB7B,gCAuBE;AAAA;AAkBC,IAAM,cAAc,WAAW,gBAAgB;",
9
9
  "debugId": "BD24055224F4B27D64756E2164756E21",
10
10
  "names": []
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ink-virtual-list",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A virtualized list component for Ink terminal applications",
5
5
  "type": "module",
6
6
  "files": [