ngx-virtual-dnd 3.1.2 → 3.1.3
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/README.md +30 -14
- package/fesm2022/ngx-virtual-dnd.mjs +477 -154
- package/fesm2022/ngx-virtual-dnd.mjs.map +1 -1
- package/package.json +4 -4
- package/types/ngx-virtual-dnd.d.ts +47 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-virtual-dnd.mjs","sources":["../../../projects/ngx-virtual-dnd/src/lib/models/drag-drop.models.ts","../../../projects/ngx-virtual-dnd/src/lib/strategies/fixed-height.strategy.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/height-cache.ts","../../../projects/ngx-virtual-dnd/src/lib/strategies/dynamic-height.strategy.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/scroll-container.token.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/virtual-viewport.token.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-state.service.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/attribute-selectors.ts","../../../projects/ngx-virtual-dnd/src/lib/services/position-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-scheduler.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/auto-scroll.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/element-clone.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/keyboard-drag.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/overlay-container.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-index-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/dom-signal-bindings.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/auto-scroll-registration.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-scroll-container.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-preview.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable-group.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/group-resolution.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-sortable-list.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-viewport.component.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/content-header.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-content.component.ts","../../../projects/ngx-virtual-dnd/src/lib/handlers/keyboard-drag.handler.ts","../../../projects/ngx-virtual-dnd/src/lib/handlers/pointer-drag.handler.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/draggable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/scrollable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/virtual-for.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/drop-helpers.ts","../../../projects/ngx-virtual-dnd/src/lib/index.ts","../../../projects/ngx-virtual-dnd/src/public-api.ts","../../../projects/ngx-virtual-dnd/src/ngx-virtual-dnd.ts"],"sourcesContent":["/**\n * Represents the item currently being dragged.\n */\nexport interface DraggedItem {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Reference to the dragged element */\n element: HTMLElement;\n /** Cloned element for use in drag preview (auto-generated) */\n clonedElement?: HTMLElement;\n /** Height of the dragged element in pixels */\n height: number;\n /** Width of the dragged element in pixels */\n width: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Current position of the cursor during drag.\n */\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\n/**\n * Offset from cursor to the top-left corner of the dragged element.\n * Used to maintain grab position during drag.\n */\nexport interface GrabOffset {\n x: number;\n y: number;\n}\n\n/**\n * Complete state of the drag-and-drop system.\n */\nexport interface DragState {\n /** Whether a drag operation is currently in progress */\n isDragging: boolean;\n /** Information about the item being dragged */\n draggedItem: DraggedItem | null;\n /** ID of the droppable where the drag started */\n sourceDroppableId: string | null;\n /** Original index of the dragged item in the source list */\n sourceIndex: number | null;\n /** ID of the droppable currently being hovered over */\n activeDroppableId: string | null;\n /** ID of the item the placeholder should appear before, or 'END_OF_LIST' */\n placeholderId: string | null;\n /** Index where the placeholder should be inserted (more stable than placeholderId) */\n placeholderIndex: number | null;\n /** Current cursor position */\n cursorPosition: CursorPosition | null;\n /** Offset from cursor to element top-left (for maintaining grab position) */\n grabOffset: GrabOffset | null;\n /** Position when drag started (for axis locking) */\n initialPosition: CursorPosition | null;\n /** Axis to lock movement to ('x' = horizontal only, 'y' = vertical only) */\n lockAxis: 'x' | 'y' | null;\n /** Whether this is a keyboard-initiated drag */\n isKeyboardDrag: boolean;\n /** Target index during keyboard navigation */\n keyboardTargetIndex: number | null;\n}\n\n/**\n * Event emitted when a drag operation starts.\n */\nexport interface DragStartEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Position where the drag started */\n position: CursorPosition;\n /** 0-indexed position in the source list (for screen reader announcements) */\n sourceIndex: number;\n}\n\n/**\n * Source information for a drop event.\n */\nexport interface DropSource {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Original index in the source list */\n index: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Destination information for a drop event.\n */\nexport interface DropDestination {\n /** ID of the droppable container receiving the item */\n droppableId: string;\n /** ID of the item to insert before, or 'END_OF_LIST' */\n placeholderId: string;\n /** Target index in the destination list */\n index: number;\n /** Optional user-provided data associated with the droppable */\n data?: unknown;\n}\n\n/**\n * Event emitted when an item is dropped.\n */\nexport interface DropEvent {\n /** Information about where the item came from */\n source: DropSource;\n /** Information about where the item is going */\n destination: DropDestination;\n}\n\n/**\n * Event emitted when a drag operation ends (including cancel).\n */\nexport interface DragEndEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Whether the drag was cancelled (escaped, dropped outside) */\n cancelled: boolean;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Original 0-indexed position in source list (for cancel announcements) */\n sourceIndex: number;\n /** Final 0-indexed position (null if cancelled) */\n destinationIndex: number | null;\n}\n\n/**\n * Initial state for the drag state service.\n */\nexport const INITIAL_DRAG_STATE: DragState = {\n isDragging: false,\n draggedItem: null,\n sourceDroppableId: null,\n sourceIndex: null,\n activeDroppableId: null,\n placeholderId: null,\n placeholderIndex: null,\n cursorPosition: null,\n grabOffset: null,\n initialPosition: null,\n lockAxis: null,\n isKeyboardDrag: false,\n keyboardTargetIndex: null,\n};\n\n/**\n * Placeholder ID used when dropping at the end of a list.\n */\nexport const END_OF_LIST = 'END_OF_LIST';\n","import { signal } from '@angular/core';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\n\n/**\n * Fixed-height virtual scroll strategy.\n *\n * Wraps the existing `index * itemHeight` math with zero overhead — no cache,\n * no measurement. This is the default strategy used when `dynamicItemHeight`\n * is not enabled.\n */\nexport class FixedHeightStrategy implements VirtualScrollStrategy {\n readonly #itemHeight: number;\n\n /** Excluded index during same-list drag (-1 = none) */\n #excludedIndex = -1;\n\n /** Logical item count from setItemKeys (used by drag index calculator) */\n #itemCount = 0;\n\n /** Version signal — bumps when exclusion changes */\n readonly #version = signal(0);\n readonly version = this.#version.asReadonly();\n\n constructor(itemHeight: number) {\n this.#itemHeight = itemHeight;\n }\n\n getTotalHeight(itemCount: number): number {\n return itemCount * this.#itemHeight;\n }\n\n getFirstVisibleIndex(scrollTop: number): number {\n if (this.#itemHeight <= 0) return 0;\n return Math.floor(scrollTop / this.#itemHeight);\n }\n\n getVisibleCount(_startIndex: number, containerHeight: number): number {\n if (containerHeight <= 0 || this.#itemHeight <= 0) return 0;\n return Math.ceil(containerHeight / this.#itemHeight);\n }\n\n getOffsetForIndex(index: number): number {\n if (this.#excludedIndex >= 0 && index > this.#excludedIndex) {\n return (index - 1) * this.#itemHeight;\n }\n return index * this.#itemHeight;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getItemHeight(index: number): number {\n return this.#itemHeight;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setMeasuredHeight(key: unknown, height: number): void {\n // No-op for fixed height strategy\n }\n\n setItemKeys(keys: unknown[]): void {\n const prevCount = this.#itemCount;\n this.#itemCount = keys.length;\n if (prevCount !== this.#itemCount) {\n this.#version.update((v) => v + 1);\n }\n }\n\n setExcludedIndex(index: number | null): void {\n const newIndex = index ?? -1;\n if (this.#excludedIndex !== newIndex) {\n this.#excludedIndex = newIndex;\n this.#version.update((v) => v + 1);\n }\n }\n\n findIndexAtOffset(offset: number): number {\n if (this.#itemHeight <= 0) return 0;\n const visualIndex = Math.floor(offset / this.#itemHeight);\n // When an item is excluded (same-list drag), visual indices at or past\n // the excluded position map to logical index + 1\n if (this.#excludedIndex >= 0 && visualIndex >= this.#excludedIndex) {\n return visualIndex + 1;\n }\n return visualIndex;\n }\n\n getItemCount(): number {\n return this.#itemCount;\n }\n}\n","/**\n * Cache for measured item heights in dynamic virtual scrolling.\n *\n * Tracks heights by trackBy key (survives reordering). Maintains a cumulative\n * offset prefix-sum array, lazily rebuilt on height change. Binary search\n * O(log N) for scroll-to-index lookups.\n *\n * This is a plain class (not a service) — one instance per virtual scroll.\n */\nexport class HeightCache {\n /** Estimated height used for unmeasured items */\n readonly #estimatedHeight: number;\n\n /** Map from trackBy key to measured height */\n readonly #heightsByKey = new Map<unknown, number>();\n\n /** Current ordered list of trackBy keys (index-aligned with item array) */\n #keys: unknown[] = [];\n\n /** Prefix sums: offsets[i] = cumulative height of items 0..i-1 */\n #offsets: number[] = [];\n\n /** Whether offsets need to be rebuilt */\n #dirty = true;\n\n /** Index excluded during same-list drag (-1 = none) */\n #excludedIndex = -1;\n\n constructor(estimatedHeight: number) {\n this.#estimatedHeight = estimatedHeight;\n }\n\n /** Number of measured items */\n get measuredCount(): number {\n return this.#heightsByKey.size;\n }\n\n /** Number of logical items in the cache */\n get itemCount(): number {\n return this.#keys.length;\n }\n\n /**\n * Update the ordered list of trackBy keys.\n * This must be called whenever items change order or the array changes.\n */\n setKeys(keys: unknown[]): boolean {\n const sameOrder =\n keys.length === this.#keys.length &&\n keys.every((key, index) => Object.is(key, this.#keys[index]));\n\n const nextKeySet = new Set(keys);\n let pruned = false;\n for (const key of this.#heightsByKey.keys()) {\n if (!nextKeySet.has(key)) {\n this.#heightsByKey.delete(key);\n pruned = true;\n }\n }\n\n if (sameOrder && !pruned) {\n return false;\n }\n\n this.#keys = keys;\n this.#dirty = true;\n return true;\n }\n\n /**\n * Record a measured height for a trackBy key.\n * @returns true if the height actually changed (triggers version bump)\n */\n setHeight(key: unknown, height: number): boolean {\n const existing = this.#heightsByKey.get(key);\n if (existing === height) return false;\n this.#heightsByKey.set(key, height);\n this.#dirty = true;\n return true;\n }\n\n /**\n * Get the height for a specific index.\n * Returns measured height if available, otherwise the estimated height.\n */\n getHeight(index: number): number {\n if (index < 0 || index >= this.#keys.length) return this.#estimatedHeight;\n const key = this.#keys[index];\n return this.#heightsByKey.get(key) ?? this.#estimatedHeight;\n }\n\n /**\n * Get the pixel offset (top position) for a given item index.\n * Accounts for the excluded index during same-list drag.\n */\n getOffset(index: number): number {\n this.#rebuildIfDirty();\n\n if (this.#excludedIndex < 0) {\n // No exclusion — direct lookup\n return index < this.#offsets.length ? this.#offsets[index] : this.#getTotalHeightRaw();\n }\n\n // With exclusion: subtract the excluded item's height from offsets\n // at or after the excluded index\n if (index <= this.#excludedIndex) {\n return this.#offsets[index] ?? 0;\n }\n\n // index > excludedIndex: offset = raw offset for (index) minus excluded item's height\n const rawOffset =\n index < this.#offsets.length ? this.#offsets[index] : this.#getTotalHeightRaw();\n const excludedHeight = this.getHeight(this.#excludedIndex);\n return rawOffset - excludedHeight;\n }\n\n /**\n * Get total content height for all items.\n * Does NOT exclude the dragged item — the spacer must maintain full height\n * during same-list drag so sibling content (footers etc.) doesn't shift.\n * Uses O(1) prefix-sum lookup when possible.\n */\n getTotalHeight(itemCount: number): number {\n this.#rebuildIfDirty();\n\n if (itemCount <= 0) return 0;\n\n const keyCount = this.#keys.length;\n if (keyCount === 0) return itemCount * this.#estimatedHeight;\n\n if (itemCount >= keyCount) {\n // All known items + estimated for any extras\n return this.#getTotalHeightRaw() + (itemCount - keyCount) * this.#estimatedHeight;\n }\n\n // Partial: prefix sum up to itemCount\n return this.#offsets[itemCount - 1] + this.getHeight(itemCount - 1);\n }\n\n /**\n * Find the first visible index for a given scrollTop.\n * Uses binary search on the prefix-sum offsets (excluding the excluded item).\n */\n findFirstVisibleIndex(scrollTop: number): number {\n this.#rebuildIfDirty();\n\n const count = this.#keys.length;\n if (count === 0) return 0;\n\n // Binary search for the first item whose bottom edge is past scrollTop\n let lo = 0;\n let hi = count - 1;\n let result = 0;\n\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const offset = this.getOffset(mid);\n if (offset <= scrollTop) {\n result = mid;\n lo = mid + 1;\n } else {\n hi = mid - 1;\n }\n }\n\n return result;\n }\n\n /**\n * Count visible items from startIndex within containerHeight.\n */\n getVisibleCount(startIndex: number, containerHeight: number): number {\n if (containerHeight <= 0) return 0;\n\n const count = this.#keys.length;\n let accumulated = 0;\n let visible = 0;\n let stopIndex = count;\n\n for (let i = startIndex; i < count; i++) {\n if (i === this.#excludedIndex) continue;\n accumulated += this.getHeight(i);\n visible++;\n if (accumulated >= containerHeight) {\n stopIndex = i;\n break;\n }\n }\n\n // Add 1 for partially visible items\n if (visible === 0) return 0;\n const hasMoreItems = stopIndex < count - 1;\n return hasMoreItems ? visible + 1 : visible;\n }\n\n /**\n * Find the item index at a given pixel offset.\n * Used for drag index calculations with variable heights.\n */\n findIndexAtOffset(offset: number): number {\n this.#rebuildIfDirty();\n\n const count = this.#keys.length;\n if (count === 0) return 0;\n\n if (!Number.isFinite(offset)) {\n return offset < 0 ? 0 : count;\n }\n\n if (offset <= 0) {\n if (this.#excludedIndex === 0) {\n return count > 1 ? 1 : count;\n }\n return 0;\n }\n\n const excludedIndex = this.#excludedIndex;\n if (excludedIndex < 0 || excludedIndex >= count) {\n return this.#findFirstIndexWithBottomPastOffset(offset, 0, count - 1);\n }\n\n const excludedOffset = this.#offsets[excludedIndex];\n if (offset < excludedOffset && excludedIndex > 0) {\n return this.#findFirstIndexWithBottomPastOffset(offset, 0, excludedIndex - 1);\n }\n\n if (excludedIndex >= count - 1) {\n return count;\n }\n\n const excludedHeight = this.getHeight(excludedIndex);\n return this.#findFirstIndexWithBottomPastOffset(\n offset + excludedHeight,\n excludedIndex + 1,\n count - 1,\n );\n }\n\n /**\n * Set the excluded index for same-list drag.\n */\n setExcludedIndex(index: number | null): boolean {\n const nextIndex = index ?? -1;\n if (this.#excludedIndex === nextIndex) {\n return false;\n }\n\n this.#excludedIndex = nextIndex;\n return true;\n }\n\n /**\n * Find first logical index in [start, end] whose bottom edge is past offset.\n * Returns one-past-end when no match is found.\n */\n #findFirstIndexWithBottomPastOffset(offset: number, start: number, end: number): number {\n if (start > end) {\n return start;\n }\n\n let lo = start;\n let hi = end;\n let result = end + 1;\n\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const midBottom = this.#offsets[mid] + this.getHeight(mid);\n\n if (midBottom > offset) {\n result = mid;\n hi = mid - 1;\n } else {\n lo = mid + 1;\n }\n }\n\n return result;\n }\n\n /** Raw total height without exclusion */\n #getTotalHeightRaw(): number {\n this.#rebuildIfDirty();\n const len = this.#offsets.length;\n if (len === 0) return 0;\n return this.#offsets[len - 1] + this.getHeight(len - 1);\n }\n\n /** Rebuild prefix-sum array if dirty */\n #rebuildIfDirty(): void {\n if (!this.#dirty) return;\n this.#dirty = false;\n\n const count = this.#keys.length;\n if (this.#offsets.length !== count) {\n this.#offsets = new Array<number>(count);\n }\n\n let cumulative = 0;\n for (let i = 0; i < count; i++) {\n this.#offsets[i] = cumulative;\n cumulative += this.getHeight(i);\n }\n }\n}\n","import { signal, type Signal, type WritableSignal } from '@angular/core';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { HeightCache } from '../utils/height-cache';\n\n/**\n * Dynamic-height virtual scroll strategy.\n *\n * Uses a `HeightCache` with prefix-sum offsets and binary search for O(log N)\n * scroll-to-index lookups. Heights are tracked by trackBy key (survive\n * reordering) and auto-measured via ResizeObserver by the directive.\n *\n * The `version` signal bumps whenever heights change, causing dependent\n * computeds to re-evaluate.\n */\nexport class DynamicHeightStrategy implements VirtualScrollStrategy {\n readonly #cache: HeightCache;\n readonly #version: WritableSignal<number> = signal(0);\n\n readonly version: Signal<number> = this.#version.asReadonly();\n\n constructor(estimatedHeight: number) {\n this.#cache = new HeightCache(estimatedHeight);\n }\n\n getTotalHeight(itemCount: number): number {\n // Read version to subscribe to changes\n this.#version();\n return this.#cache.getTotalHeight(itemCount);\n }\n\n getFirstVisibleIndex(scrollTop: number): number {\n this.#version();\n return this.#cache.findFirstVisibleIndex(scrollTop);\n }\n\n getVisibleCount(startIndex: number, containerHeight: number): number {\n this.#version();\n return this.#cache.getVisibleCount(startIndex, containerHeight);\n }\n\n getOffsetForIndex(index: number): number {\n this.#version();\n return this.#cache.getOffset(index);\n }\n\n getItemHeight(index: number): number {\n this.#version();\n return this.#cache.getHeight(index);\n }\n\n setMeasuredHeight(key: unknown, height: number): void {\n const changed = this.#cache.setHeight(key, height);\n if (changed) {\n this.#version.update((v) => v + 1);\n }\n }\n\n setItemKeys(keys: unknown[]): void {\n const changed = this.#cache.setKeys(keys);\n if (changed) {\n this.#version.update((v) => v + 1);\n }\n }\n\n setExcludedIndex(index: number | null): void {\n const changed = this.#cache.setExcludedIndex(index);\n if (changed) {\n this.#version.update((v) => v + 1);\n }\n }\n\n findIndexAtOffset(offset: number): number {\n this.#version();\n return this.#cache.findIndexAtOffset(offset);\n }\n\n getItemCount(): number {\n this.#version();\n return this.#cache.itemCount;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for a scroll container that can be used with VirtualForDirective.\n * Implement this interface to create custom scroll containers.\n *\n * The scrollTop() and containerHeight() methods should return reactive values\n * (internally backed by signals) so that changes trigger re-computation in\n * the virtual scroll directive.\n */\nexport interface VdndScrollContainer {\n /** The native HTML element that handles scrolling */\n readonly nativeElement: HTMLElement;\n\n /** Current scroll position from top in pixels (reactive) */\n scrollTop(): number;\n\n /** Current container height in pixels (reactive) */\n containerHeight(): number;\n\n /** Scroll to a specific position */\n scrollTo(options: ScrollToOptions): void;\n}\n\n/**\n * Injection token for providing a scroll container to VirtualForDirective.\n *\n * Use the `vdndScrollable` directive to provide this token, or implement\n * `VdndScrollContainer` and provide it manually.\n *\n * @example\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n */\nexport const VDND_SCROLL_CONTAINER = new InjectionToken<VdndScrollContainer>(\n 'VDND_SCROLL_CONTAINER'\n);\n","import { InjectionToken } from '@angular/core';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\n\n/**\n * Interface for a virtual viewport that provides wrapper-based positioning.\n * Components implementing this interface provide a content wrapper with\n * GPU-accelerated transform positioning for efficient virtual scrolling.\n */\nexport interface VdndVirtualViewport {\n /** Current scroll position */\n scrollTop(): number;\n\n /** Height of the viewport container */\n containerHeight(): number;\n\n /** Height of each item in pixels */\n itemHeight(): number;\n\n /** Offset for content below headers (page-level scroll scenarios) */\n contentOffset(): number;\n\n /** The native element of the viewport */\n readonly nativeElement: HTMLElement;\n\n /**\n * Called by VirtualForDirective to inform the viewport of the actual\n * first rendered item index (accounting for overscan). The viewport\n * uses this to position the content wrapper correctly.\n */\n setRenderStartIndex(index: number): void;\n\n /**\n * Get the pixel offset for a given item index.\n * Uses the strategy pattern to support both fixed and dynamic heights.\n */\n getOffsetForIndex(index: number): number;\n\n /**\n * The virtual scroll strategy used by this viewport.\n * Available for drag-drop integration and external consumers.\n */\n readonly strategy: VirtualScrollStrategy | null;\n}\n\n/**\n * Injection token for virtual viewport.\n * VirtualForDirective optionally injects this to detect if it's inside\n * a viewport component that handles wrapper-based positioning.\n */\nexport const VDND_VIRTUAL_VIEWPORT = new InjectionToken<VdndVirtualViewport>(\n 'VDND_VIRTUAL_VIEWPORT',\n);\n","import { computed, effect, Injectable, signal } from '@angular/core';\nimport { CursorPosition, DraggedItem, DragState, GrabOffset } from '../models/drag-drop.models';\n\n/**\n * Internal state type without high-frequency fields.\n * `cursorPosition`, `keyboardTargetIndex`, `activeDroppableId`, `placeholderId`\n * and `placeholderIndex` are split into dedicated signals so that high-frequency\n * pointer/placeholder updates don't trigger re-evaluation of rarely-changing\n * computeds (or rebuild the core state object every frame).\n */\ntype CoreDragState = Omit<\n DragState,\n | 'cursorPosition'\n | 'keyboardTargetIndex'\n | 'activeDroppableId'\n | 'placeholderId'\n | 'placeholderIndex'\n>;\n\nconst INITIAL_CORE_STATE: CoreDragState = {\n isDragging: false,\n draggedItem: null,\n sourceDroppableId: null,\n sourceIndex: null,\n grabOffset: null,\n initialPosition: null,\n lockAxis: null,\n isKeyboardDrag: false,\n};\n\n/**\n * Central service for managing drag-and-drop state.\n * Uses signals for reactive state management.\n *\n * Architecture: High-frequency fields (`cursorPosition`, `keyboardTargetIndex`,\n * `activeDroppableId`, `placeholderId`, `placeholderIndex`) are stored in dedicated\n * signals, separate from the core state. This prevents 60fps cursor and\n * placeholder updates from rebuilding the core state object or re-evaluating the\n * 8+ computeds that only depend on rarely-changing properties (isDragging,\n * draggedItem, etc.).\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DragStateService {\n /** Core state signal — contains all rarely-changing properties */\n readonly #state = signal<CoreDragState>(INITIAL_CORE_STATE);\n\n /** High-frequency cursor position — updated at 60fps during pointer drag */\n readonly #cursorPosition = signal<CursorPosition | null>(null);\n\n /** High-frequency keyboard target index — updated on each arrow key press */\n readonly #keyboardTargetIndex = signal<number | null>(null);\n\n /** ID of the droppable currently being hovered over — changes on droppable crossings */\n readonly #activeDroppableId = signal<string | null>(null);\n\n /** ID of the item the placeholder should appear before */\n readonly #placeholderId = signal<string | null>(null);\n\n /** Index where the placeholder should be inserted — updated on each placeholder move */\n readonly #placeholderIndex = signal<number | null>(null);\n\n /** Flag indicating if the last drag was cancelled (not dropped) */\n readonly #wasCancelled = signal<boolean>(false);\n\n /** Whether the last drag was cancelled (for droppable to check before emitting drop) */\n readonly wasCancelled = this.#wasCancelled.asReadonly();\n\n /** Whether a drag operation is in progress */\n readonly isDragging = computed(() => this.#state().isDragging);\n\n /** The currently dragged item, or null */\n readonly draggedItem = computed(() => this.#state().draggedItem);\n\n /** ID of the currently dragged item, or null (convenience signal for filtering) */\n readonly draggedItemId = computed(() => this.#state().draggedItem?.draggableId ?? null);\n\n /** ID of the droppable where the drag started */\n readonly sourceDroppableId = computed(() => this.#state().sourceDroppableId);\n\n /** Original index of the dragged item in the source list */\n readonly sourceIndex = computed(() => this.#state().sourceIndex);\n\n /** ID of the droppable currently being hovered over */\n readonly activeDroppableId = this.#activeDroppableId.asReadonly();\n\n /** ID of the item the placeholder should appear before */\n readonly placeholderId = this.#placeholderId.asReadonly();\n\n /** Index where the placeholder should be inserted */\n readonly placeholderIndex = this.#placeholderIndex.asReadonly();\n\n /** Current cursor position */\n readonly cursorPosition = this.#cursorPosition.asReadonly();\n\n /** Offset from cursor to element top-left (for maintaining grab position) */\n readonly grabOffset = computed(() => this.#state().grabOffset);\n\n /** Position when drag started (for axis locking) */\n readonly initialPosition = computed(() => this.#state().initialPosition);\n\n /** Axis to lock movement to */\n readonly lockAxis = computed(() => this.#state().lockAxis);\n\n /** Whether this is a keyboard-initiated drag */\n readonly isKeyboardDrag = computed(() => this.#state().isKeyboardDrag);\n\n /** Target index during keyboard navigation */\n readonly keyboardTargetIndex = this.#keyboardTargetIndex.asReadonly();\n\n constructor() {\n // Inject cursor styles once (for consistent grabbing cursor during drag)\n if (typeof document !== 'undefined') {\n const styleId = 'vdnd-cursor-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n body.vdnd-dragging,\n body.vdnd-dragging * {\n cursor: grabbing !important;\n }\n `;\n document.head.appendChild(style);\n }\n }\n\n // Effect to toggle body class during drag\n effect(() => {\n if (typeof document === 'undefined') return;\n const isDragging = this.isDragging();\n document.body.classList.toggle('vdnd-dragging', isDragging);\n });\n }\n\n /**\n * Start a drag operation.\n */\n startDrag(\n item: DraggedItem,\n cursorPosition?: CursorPosition,\n grabOffset?: GrabOffset,\n lockAxis?: 'x' | 'y' | null,\n activeDroppableId?: string | null,\n placeholderId?: string | null,\n placeholderIndex?: number | null,\n sourceIndex?: number | null,\n isKeyboardDrag?: boolean,\n axisLockPosition?: CursorPosition,\n ): void {\n // Reset cancellation flag at start of new drag\n this.#wasCancelled.set(false);\n this.#cursorPosition.set(cursorPosition ?? null);\n this.#keyboardTargetIndex.set(isKeyboardDrag ? (sourceIndex ?? 0) : null);\n this.#activeDroppableId.set(activeDroppableId ?? null);\n this.#placeholderId.set(placeholderId ?? null);\n this.#placeholderIndex.set(placeholderIndex ?? null);\n this.#state.set({\n isDragging: true,\n draggedItem: item,\n sourceDroppableId: item.droppableId,\n sourceIndex: sourceIndex ?? null,\n grabOffset: grabOffset ?? null,\n initialPosition: axisLockPosition ?? cursorPosition ?? null,\n lockAxis: lockAxis ?? null,\n isKeyboardDrag: isKeyboardDrag ?? false,\n });\n }\n\n /**\n * Update the drag position and targets.\n */\n updateDragPosition(update: {\n cursorPosition: CursorPosition;\n activeDroppableId: string | null;\n placeholderId: string | null;\n placeholderIndex: number | null;\n }): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n // Write cursor to dedicated high-frequency signal\n this.#cursorPosition.set(update.cursorPosition);\n\n // Each target lives in its own signal, so a placeholder-only frame never\n // rebuilds the core state object or re-fires the rarely-changing computeds.\n // Signals already no-op on identical values, so unconditional sets are safe.\n this.#activeDroppableId.set(update.activeDroppableId);\n this.#placeholderId.set(update.placeholderId);\n this.#placeholderIndex.set(update.placeholderIndex);\n }\n\n /**\n * Update just the active droppable.\n */\n setActiveDroppable(droppableId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#activeDroppableId.set(droppableId);\n }\n\n /**\n * Update just the placeholder position.\n */\n setPlaceholder(placeholderId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#placeholderId.set(placeholderId);\n }\n\n /**\n * Update only the placeholder signals without touching cursor position or active droppable.\n *\n * Used by the autoscroll scroll-only fast path: when a scroll fires, the cursor has not\n * moved, so only the placeholder index needs recalculation. Skipping the cursor and\n * active-droppable writes avoids spurious re-evaluation of computeds that read those signals.\n */\n updateScrollOnlyPlaceholder(placeholderId: string | null, placeholderIndex: number | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#placeholderId.set(placeholderId);\n this.#placeholderIndex.set(placeholderIndex);\n }\n\n /**\n * End the drag operation and reset state (normal drop).\n */\n endDrag(): void {\n this.#wasCancelled.set(false);\n this.#resetHighFrequencySignals();\n this.#state.set(INITIAL_CORE_STATE);\n }\n\n /**\n * Cancel the drag operation (escape key, disabled, etc.).\n */\n cancelDrag(): void {\n this.#wasCancelled.set(true);\n this.#resetHighFrequencySignals();\n this.#state.set(INITIAL_CORE_STATE);\n }\n\n /**\n * Reset the dedicated high-frequency signals to their initial null state.\n */\n #resetHighFrequencySignals(): void {\n this.#cursorPosition.set(null);\n this.#keyboardTargetIndex.set(null);\n this.#activeDroppableId.set(null);\n this.#placeholderId.set(null);\n this.#placeholderIndex.set(null);\n }\n\n /**\n * Check if a specific droppable is currently active.\n */\n isDroppableActive(droppableId: string): boolean {\n return this.#activeDroppableId() === droppableId;\n }\n\n /**\n * Get the current state snapshot (for event creation).\n */\n getStateSnapshot(): DragState {\n return {\n ...this.#state(),\n activeDroppableId: this.#activeDroppableId(),\n placeholderId: this.#placeholderId(),\n placeholderIndex: this.#placeholderIndex(),\n cursorPosition: this.#cursorPosition(),\n keyboardTargetIndex: this.#keyboardTargetIndex(),\n };\n }\n\n /**\n * Update the keyboard target index (for keyboard drag navigation).\n * Also updates placeholder position to match, applying same-list adjustment.\n */\n setKeyboardTargetIndex(targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n const state = this.#state();\n // Same-list adjustment: if target is at or after source, add 1\n // This accounts for the hidden item shifting everything up visually\n const sourceDroppableId = state.draggedItem?.droppableId;\n const activeDroppableId = this.#activeDroppableId();\n const isSameList = sourceDroppableId === activeDroppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n this.#keyboardTargetIndex.set(targetIndex);\n this.#placeholderIndex.set(placeholderIndex);\n }\n\n /**\n * Update the active droppable during keyboard navigation (for cross-list moves).\n */\n setKeyboardActiveDroppable(droppableId: string | null, targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n const state = this.#state();\n // Same-list adjustment: if moving back to source list and target is at or after source, add 1\n const sourceDroppableId = state.draggedItem?.droppableId;\n const isSameList = sourceDroppableId === droppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n this.#keyboardTargetIndex.set(targetIndex);\n this.#activeDroppableId.set(droppableId);\n this.#placeholderIndex.set(placeholderIndex);\n }\n}\n","/**\n * Query by an exact attribute value without interpolating consumer data into a CSS selector.\n *\n * CSS attribute selectors need string-specific escaping that differs from `CSS.escape()`.\n * Filtering candidates by attribute presence avoids selector syntax errors for IDs containing\n * quotes, brackets, backslashes, or other selector-sensitive characters.\n */\nexport function queryByAttribute<T extends Element>(\n root: ParentNode,\n attributeName: string,\n attributeValue: string,\n): T | null {\n const candidates = root.querySelectorAll<T>(`[${attributeName}]`);\n\n for (const candidate of candidates) {\n if (candidate.getAttribute(attributeName) === attributeValue) {\n return candidate;\n }\n }\n\n return null;\n}\n\nexport function queryAllByAttribute<T extends Element>(\n root: ParentNode,\n attributeName: string,\n attributeValue: string,\n): T[] {\n return Array.from(root.querySelectorAll<T>(`[${attributeName}]`)).filter(\n (candidate) => candidate.getAttribute(attributeName) === attributeValue,\n );\n}\n","import { inject, Injectable, isDevMode, NgZone } from '@angular/core';\nimport { queryAllByAttribute, queryByAttribute } from '../utils/attribute-selectors';\n\n/**\n * Snapshot of the candidate droppables for an active drag session.\n * Rects are cached so per-pointermove hit-testing is pure geometry, avoiding the\n * forced layout flush that `document.elementFromPoint` (plus the pointer-events\n * style write it required) imposed on the hottest drag loop.\n */\ninterface DragSessionSnapshot {\n groupName: string;\n /** Candidate droppables in document order (document order === default paint order). */\n candidates: HTMLElement[];\n /** Cached bounding rects, parallel to `candidates`. */\n rects: DOMRect[];\n /** When true, rects are re-read on the next hit-test (set on scroll/resize). */\n dirty: boolean;\n /** Bound scroll/resize listener used to mark rects dirty. */\n onViewportChange: () => void;\n}\n\n/**\n * Service for calculating drop positions and finding elements at cursor positions.\n * This is the core algorithm that makes virtual scroll + drag-and-drop work together.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class PositionCalculatorService {\n readonly #ngZone = inject(NgZone);\n\n /** Data attribute used to identify droppable elements */\n readonly #DROPPABLE_ID_ATTR = 'data-droppable-id';\n\n /** Data attribute used to identify droppable groups */\n readonly #DROPPABLE_GROUP_ATTR = 'data-droppable-group';\n\n /** Data attribute used to identify draggable elements */\n readonly #DRAGGABLE_ID_ATTR = 'data-draggable-id';\n\n /** Maximum DOM levels to traverse when looking for parent elements */\n readonly #MAX_PARENT_TRAVERSAL = 15;\n\n /** Reusable result object for getNearEdge (avoids per-frame allocation) */\n readonly #nearEdgeResult = { top: false, bottom: false, left: false, right: false };\n\n /** Active drag session rect snapshot, or null when no drag is in progress. */\n #session: DragSessionSnapshot | null = null;\n\n /**\n * Begin a drag session: snapshot the candidate droppables for `groupName` and\n * their rects once, then watch for viewport changes (scroll/resize) that would\n * invalidate those rects. While a session is active, `findDroppableAtPoint`\n * runs as pure geometry against the cached rects instead of `elementFromPoint`.\n *\n * Safe to call repeatedly — a new call replaces any previous session.\n */\n beginDragSession(groupName: string): void {\n this.endDragSession();\n\n const candidates = this.#queryDroppables(groupName);\n const onViewportChange = () => {\n if (this.#session) {\n this.#session.dirty = true;\n }\n };\n\n this.#session = {\n groupName,\n candidates,\n rects: candidates.map((el) => el.getBoundingClientRect()),\n dirty: false,\n onViewportChange,\n };\n\n // Capture-phase scroll catches scrolling on any ancestor scroller (scroll does\n // not bubble); resize covers viewport changes. Both only mark rects dirty —\n // the actual re-read is deferred to the next hit-test.\n if (typeof window !== 'undefined') {\n this.#ngZone.runOutsideAngular(() => {\n window.addEventListener('scroll', onViewportChange, { capture: true, passive: true });\n window.addEventListener('resize', onViewportChange, { passive: true });\n });\n }\n }\n\n /**\n * End the current drag session and detach viewport listeners.\n * Safe to call when no session is active.\n */\n endDragSession(): void {\n const session = this.#session;\n if (!session) {\n return;\n }\n this.#session = null;\n if (typeof window !== 'undefined') {\n window.removeEventListener('scroll', session.onViewportChange, { capture: true });\n window.removeEventListener('resize', session.onViewportChange);\n }\n }\n\n /**\n * Mark the cached droppable rects as stale so they are re-read on the next\n * hit-test. Called explicitly from the autoscroll recalculation path, where the\n * scroll event has not yet fired but the container has already moved.\n */\n invalidateDroppableRects(): void {\n if (this.#session) {\n this.#session.dirty = true;\n }\n }\n\n /**\n * Find the droppable element at a given point.\n *\n * Uses pure geometric hit-testing against snapshotted droppable rects. When a\n * drag session is active (see {@link beginDragSession}) the rects are cached and\n * reused across frames; otherwise a one-shot DOM query is performed. The\n * `draggedElement` parameter is retained for API compatibility but no longer\n * needs to be hidden — geometry does not depend on cursor occlusion.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param _draggedElement - The element being dragged (unused; kept for compatibility)\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable element, or null if none found\n */\n findDroppableAtPoint(\n x: number,\n y: number,\n _draggedElement: HTMLElement,\n groupName: string,\n ): HTMLElement | null {\n const session = this.#session;\n if (session && session.groupName === groupName) {\n if (session.dirty) {\n for (let i = 0; i < session.candidates.length; i++) {\n session.rects[i] = session.candidates[i].getBoundingClientRect();\n }\n session.dirty = false;\n }\n return this.#hitTest(x, y, session.candidates, session.rects);\n }\n\n // No active session: one-shot geometric query (still avoids elementFromPoint).\n const candidates = this.#queryDroppables(groupName);\n const rects = candidates.map((el) => el.getBoundingClientRect());\n return this.#hitTest(x, y, candidates, rects);\n }\n\n /**\n * Look up a droppable element by its ID.\n *\n * When a drag session is active, searches the cached candidate list (O(n), avoids a DOM\n * query). Falls back to `document.querySelector` when no session is active.\n *\n * Intended for the autoscroll scroll-only fast path, where the active droppable is already\n * known and only the placeholder index needs recalculation.\n */\n getDroppableById(id: string): HTMLElement | null {\n if (this.#session) {\n for (const candidate of this.#session.candidates) {\n if (candidate.getAttribute(this.#DROPPABLE_ID_ATTR) === id) {\n return candidate;\n }\n }\n return null;\n }\n\n if (typeof document === 'undefined') {\n return null;\n }\n return queryByAttribute<HTMLElement>(document, this.#DROPPABLE_ID_ATTR, id);\n }\n\n /**\n * Query all droppable elements belonging to a group, in document order.\n */\n #queryDroppables(groupName: string): HTMLElement[] {\n if (typeof document === 'undefined') {\n return [];\n }\n return queryAllByAttribute<HTMLElement>(document, this.#DROPPABLE_GROUP_ATTR, groupName);\n }\n\n /**\n * Geometric hit-test: return the last candidate (in document order) whose rect\n * contains the point. \"Last in document order\" reproduces the painter's-order\n * tie-break that `elementFromPoint` provided for free — a nested or later\n * overlapping droppable is painted on top of an earlier/ancestor one.\n */\n #hitTest(x: number, y: number, candidates: HTMLElement[], rects: DOMRect[]): HTMLElement | null {\n let match: HTMLElement | null = null;\n for (let i = 0; i < candidates.length; i++) {\n const r = rects[i];\n if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) {\n match = candidates[i];\n }\n }\n return match;\n }\n\n /**\n * Find the draggable element at a given point.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param draggedElement - The element being dragged (will be temporarily hidden)\n * @returns The draggable element, or null if none found\n */\n findDraggableAtPoint(x: number, y: number, draggedElement: HTMLElement): HTMLElement | null {\n const isHidden = draggedElement.offsetParent === null;\n\n let originalPointerEvents: string | undefined;\n if (!isHidden) {\n originalPointerEvents = draggedElement.style.pointerEvents;\n draggedElement.style.pointerEvents = 'none';\n }\n\n try {\n const elementAtPoint = document.elementFromPoint(x, y);\n if (!elementAtPoint) {\n return null;\n }\n\n return this.getDraggableParent(elementAtPoint as HTMLElement);\n } finally {\n if (!isHidden) {\n draggedElement.style.pointerEvents = originalPointerEvents!;\n }\n }\n }\n\n /**\n * Walk up the DOM tree to find a droppable parent element.\n *\n * @param element - Starting element\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable parent element, or null if none found\n */\n getDroppableParent(element: HTMLElement, groupName: string): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const foundGroup = current.getAttribute(this.#DROPPABLE_GROUP_ATTR);\n\n if (foundGroup && foundGroup === groupName) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Walk up the DOM tree to find a draggable parent element.\n *\n * @param element - Starting element\n * @returns The draggable parent element, or null if none found\n */\n getDraggableParent(element: HTMLElement): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const draggableId = current.getAttribute(this.#DRAGGABLE_ID_ATTR);\n\n if (draggableId) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Get the draggable ID from an element.\n */\n getDraggableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DRAGGABLE_ID_ATTR);\n }\n\n /**\n * Get the droppable ID from an element.\n */\n getDroppableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DROPPABLE_ID_ATTR);\n }\n\n /**\n * Calculate the drop index based on mathematical position.\n *\n * This is an alternative approach that doesn't require the target element\n * to be in the DOM. Useful when the target might be virtualized away.\n *\n * @param scrollTop - Current scroll position of the container\n * @param cursorY - Cursor Y position (viewport-relative)\n * @param containerTop - Top position of the container (viewport-relative)\n * @param itemHeight - Height of each item\n * @param totalItems - Total number of items in the list\n * @returns The calculated drop index\n */\n calculateDropIndex(\n scrollTop: number,\n cursorY: number,\n containerTop: number,\n itemHeight: number,\n totalItems: number,\n ): number {\n // Calculate the position relative to the container's content\n const relativeY = cursorY - containerTop + scrollTop;\n\n // Calculate which item index this corresponds to\n const index = Math.floor(relativeY / itemHeight);\n\n // Clamp to valid range\n return Math.max(0, Math.min(index, totalItems));\n }\n\n /**\n * Check if a point is within a specific threshold of a container's edge.\n *\n * @param position - Current cursor position\n * @param containerRect - Container's bounding rect\n * @param threshold - Distance from edge to trigger (in pixels)\n * @returns Object indicating which edges are near\n */\n getNearEdge(\n position: { x: number; y: number },\n containerRect: DOMRect,\n threshold: number,\n ): { top: boolean; bottom: boolean; left: boolean; right: boolean } {\n this.#nearEdgeResult.top = position.y - containerRect.top <= threshold;\n this.#nearEdgeResult.bottom = containerRect.bottom - position.y <= threshold;\n this.#nearEdgeResult.left = position.x - containerRect.left <= threshold;\n this.#nearEdgeResult.right = containerRect.right - position.x <= threshold;\n return this.#nearEdgeResult;\n }\n\n /**\n * Determine if the cursor is inside a container.\n */\n isInsideContainer(position: { x: number; y: number }, containerRect: DOMRect): boolean {\n return (\n position.x >= containerRect.left &&\n position.x <= containerRect.right &&\n position.y >= containerRect.top &&\n position.y <= containerRect.bottom\n );\n }\n\n /**\n * Find an adjacent droppable in the specified direction (left or right).\n * Used for cross-list keyboard navigation.\n *\n * @param currentDroppableId - The ID of the current droppable\n * @param direction - 'left' or 'right'\n * @param groupName - The drag-and-drop group name\n * @returns Object with droppable info, or null if none found\n */\n findAdjacentDroppable(\n currentDroppableId: string,\n direction: 'left' | 'right',\n groupName: string,\n ): { element: HTMLElement; id: string; itemCount: number } | null {\n // Find all droppables in the same group\n const allDroppables = queryAllByAttribute<HTMLElement>(\n document,\n this.#DROPPABLE_GROUP_ATTR,\n groupName,\n );\n\n if (allDroppables.length <= 1) {\n return null;\n }\n\n // Get bounding rects and IDs, sorted by X position\n const droppableInfos: { element: HTMLElement; id: string; rect: DOMRect }[] = [];\n\n allDroppables.forEach((el) => {\n const htmlEl = el as HTMLElement;\n const id = htmlEl.getAttribute(this.#DROPPABLE_ID_ATTR);\n if (id) {\n droppableInfos.push({\n element: htmlEl,\n id,\n rect: htmlEl.getBoundingClientRect(),\n });\n }\n });\n\n // Sort by X position (left to right)\n droppableInfos.sort((a, b) => a.rect.left - b.rect.left);\n\n // Find current droppable index\n const currentIndex = droppableInfos.findIndex((d) => d.id === currentDroppableId);\n if (currentIndex === -1) {\n return null;\n }\n\n // Get the adjacent droppable\n const targetIndex = direction === 'left' ? currentIndex - 1 : currentIndex + 1;\n if (targetIndex < 0 || targetIndex >= droppableInfos.length) {\n return null;\n }\n\n const target = droppableInfos[targetIndex];\n\n // Get item count from the target droppable\n const itemCount = this.#getDroppableItemCount(target.element);\n\n return {\n element: target.element,\n id: target.id,\n itemCount,\n };\n }\n\n /**\n * Get the total item count in a droppable.\n * Uses spacer height and data attributes if available, otherwise counts DOM elements.\n */\n #getDroppableItemCount(droppableElement: HTMLElement): number {\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n\n if (!configuredHeight) {\n if (isDevMode()) {\n console.error(\n '[ngx-virtual-dnd] vdnd-virtual-scroll requires data-item-height attribute ' +\n 'for keyboard navigation. Cross-list keyboard drag will not work correctly.',\n );\n }\n // Short-circuit: return 0 to prevent navigation to this droppable\n return 0;\n }\n\n // Prefer spacer height over scrollHeight for accuracy\n const spacer = virtualScroll.querySelector(\n '.vdnd-virtual-scroll-spacer',\n ) as HTMLElement | null;\n const totalHeight = spacer\n ? parseFloat(spacer.style.height) || 0\n : (virtualScroll as HTMLElement).scrollHeight;\n\n const itemHeight = parseInt(configuredHeight, 10);\n return Math.floor(totalHeight / itemHeight);\n }\n // Fallback for non-virtual scroll: DOM count is valid\n return droppableElement.querySelectorAll(`[${this.#DRAGGABLE_ID_ATTR}]`).length;\n }\n}\n","import { inject, Injectable, NgZone } from '@angular/core';\nimport { CursorPosition } from '../models/drag-drop.models';\n\n/**\n * Callback invoked each RAF frame with the latest cursor and a dirty flag.\n *\n * @param cursor — Latest cursor position queued via `queueCursorUpdate()`, or null if none.\n * @param cursorDirty — True when cursor was updated since the previous frame.\n */\nexport type SchedulerTickFn = (cursor: CursorPosition | null, cursorDirty: boolean) => void;\n\n/**\n * Single RAF loop that coordinates all drag-frame work in ordered phases:\n *\n * 1. Participant phase (READ+WRITE): registered participants run first.\n * AutoScrollService registers here to perform edge-scroll + immediate\n * placeholder recalculation in the same synchronous frame — preserving\n * the Safari synchronous-callback constraint.\n * 2. Main compute phase (COMPUTE+WRITE): onTick is called with the latest\n * cursor. Only runs when the cursor has changed (cursorDirty=true), so\n * autoscroll-only frames (cursor stationary) incur zero hit-test work.\n *\n * PointerDragHandler calls `queueCursorUpdate()` instead of managing its own\n * RAF per pointermove. This coalesces all moves within a frame into one update\n * and ensures pointer-move work always runs after participant work.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DragSchedulerService {\n readonly #ngZone = inject(NgZone);\n\n #rafId: number | null = null;\n #onTick: SchedulerTickFn | null = null;\n\n /** Latest cursor queued from pointer move events. */\n #pendingCursor: CursorPosition | null = null;\n /** True when a new cursor was queued since the last frame. */\n #cursorDirty = false;\n\n /** Tick participants called before the main compute phase each frame. */\n readonly #participants: (() => void)[] = [];\n\n /**\n * Start the scheduler RAF loop.\n * No-op if already running.\n */\n start(onTick: SchedulerTickFn): void {\n if (this.#rafId !== null) {\n return;\n }\n this.#onTick = onTick;\n this.#ngZone.runOutsideAngular(() => {\n this.#scheduleNextTick();\n });\n }\n\n /**\n * Stop the scheduler and cancel the pending RAF.\n * Safe to call when not running.\n */\n stop(): void {\n if (this.#rafId !== null) {\n cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n // Null out onTick so that any in-flight RAF callback (race between cancel\n // and the browser delivering the frame) is a no-op.\n this.#onTick = null;\n this.#pendingCursor = null;\n this.#cursorDirty = false;\n }\n\n /**\n * Queue a cursor update from a pointer move event.\n * Multiple calls between frames are coalesced — only the latest matters.\n */\n queueCursorUpdate(position: CursorPosition): void {\n this.#pendingCursor = position;\n this.#cursorDirty = true;\n }\n\n /**\n * Register a function to be called at the start of each frame, before the main tick.\n * AutoScrollService registers here to perform edge-scroll within the same frame.\n * No-op if the same function reference is already registered.\n */\n addParticipant(fn: () => void): void {\n if (!this.#participants.includes(fn)) {\n this.#participants.push(fn);\n }\n }\n\n /**\n * Unregister a previously added participant.\n * No-op if the function was not registered.\n */\n removeParticipant(fn: () => void): void {\n const idx = this.#participants.indexOf(fn);\n if (idx !== -1) {\n this.#participants.splice(idx, 1);\n }\n }\n\n #scheduleNextTick(): void {\n this.#rafId = requestAnimationFrame(() => this.#tick());\n }\n\n #tick(): void {\n this.#rafId = null;\n\n // Guard against the race where stop() was called but the browser already\n // queued the callback before cancelAnimationFrame() could prevent delivery.\n if (!this.#onTick) {\n return;\n }\n\n // Snapshot and reset dirty flag before participants run so that any cursor\n // update they trigger (theoretically possible in future extensions) is\n // picked up in the NEXT frame, not folded into this one's compute phase.\n const cursorDirty = this.#cursorDirty;\n this.#cursorDirty = false;\n\n // Phase 1 — participants (autoscroll scroll + synchronous placeholder update)\n for (const participant of this.#participants) {\n participant();\n }\n\n // Phase 2 — main compute (cursor-based hit-test + signal write)\n this.#onTick(this.#pendingCursor, cursorDirty);\n\n // Reschedule only if still active (stop() may have been called by onTick).\n if (this.#onTick !== null) {\n this.#scheduleNextTick();\n }\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { CursorPosition } from '../models/drag-drop.models';\nimport { DragStateService } from './drag-state.service';\nimport { PositionCalculatorService } from './position-calculator.service';\nimport { DragSchedulerService } from './drag-scheduler.service';\n\n/**\n * Configuration for auto-scroll behavior.\n */\nexport interface AutoScrollConfig {\n /** Distance from edge to start scrolling (in pixels) */\n threshold: number;\n /** Maximum scroll speed (in pixels per frame) */\n maxSpeed: number;\n /** Whether to accelerate scroll based on distance from edge */\n accelerate: boolean;\n}\n\n/**\n * Default auto-scroll configuration.\n */\nconst DEFAULT_CONFIG: AutoScrollConfig = {\n threshold: 50,\n maxSpeed: 15,\n accelerate: true,\n};\n\n/**\n * Service that handles auto-scrolling when dragging near container edges.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AutoScrollService {\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #scheduler = inject(DragSchedulerService);\n\n /** Currently registered scrollable containers */\n #scrollableContainers = new Map<\n string,\n {\n element: HTMLElement;\n config: AutoScrollConfig;\n }\n >();\n\n /** Bound reference to #participantTick for stable add/remove with the scheduler. */\n readonly #boundParticipantTick: () => void = () => this.#participantTick();\n\n /** Callback to invoke when scrolling occurs (for placeholder recalculation) */\n #onScrollCallback: (() => void) | null = null;\n\n /** Optional cursor position override for edge detection (bypasses DragState read) */\n #cursorOverride: CursorPosition | null = null;\n\n /** Last tick cursor position for stationary detection */\n #lastTickCursorX = NaN;\n #lastTickCursorY = NaN;\n\n /** Reusable direction object for tick loop (avoids per-frame allocation) */\n readonly #tickDirection = { x: 0, y: 0 };\n\n /** Current scroll state */\n readonly #scrollState: {\n containerId: string | null;\n direction: { x: number; y: number };\n speed: number;\n } = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n\n /**\n * Register a scrollable container for auto-scrolling.\n */\n registerContainer(\n id: string,\n element: HTMLElement,\n config: Partial<AutoScrollConfig> = {},\n ): void {\n this.#scrollableContainers.set(id, {\n element,\n config: { ...DEFAULT_CONFIG, ...config },\n });\n }\n\n /**\n * Unregister a scrollable container.\n */\n unregisterContainer(id: string): void {\n this.#scrollableContainers.delete(id);\n }\n\n /**\n * Start monitoring for auto-scroll.\n * Registers this service as a tick participant in DragSchedulerService.\n * The scheduler drives the RAF loop; this service handles scroll logic each frame.\n * @param onScroll Optional callback to invoke when scrolling occurs (for placeholder recalculation)\n */\n startMonitoring(onScroll?: () => void): void {\n this.#onScrollCallback = onScroll ?? null;\n this.#scheduler.addParticipant(this.#boundParticipantTick);\n }\n\n /**\n * Stop monitoring for auto-scroll.\n * Removes this service from the scheduler's participant list.\n * Call this when a drag ends.\n */\n stopMonitoring(): void {\n this.#scheduler.removeParticipant(this.#boundParticipantTick);\n this.#onScrollCallback = null;\n this.#cursorOverride = null;\n this.#lastTickCursorX = NaN;\n this.#lastTickCursorY = NaN;\n this.#scrollState.containerId = null;\n this.#scrollState.direction.x = 0;\n this.#scrollState.direction.y = 0;\n this.#scrollState.speed = 0;\n }\n\n /**\n * Override the cursor position used for edge detection.\n * When set, #tick() uses this instead of DragStateService.cursorPosition().\n * Used by constrainToContainer to provide a position without grabOffset distortion.\n * @internal\n */\n setCursorOverride(position: CursorPosition): void {\n this.#cursorOverride = position;\n }\n\n /**\n * Participant tick — called by DragSchedulerService each RAF frame.\n *\n * Runs the edge-scroll check and, if a scroll is performed, synchronously\n * invokes #onScrollCallback (the placeholder recalculator) in the same frame.\n * No RAF scheduling here — the scheduler owns the loop.\n */\n #participantTick(): void {\n const cursor = this.#cursorOverride ?? this.#dragState.cursorPosition();\n\n // No cursor yet — nothing to scroll toward.\n if (!cursor) {\n return;\n }\n\n // Skip the container iteration when cursor hasn't moved and scroll is idle.\n if (\n cursor.x === this.#lastTickCursorX &&\n cursor.y === this.#lastTickCursorY &&\n !this.isScrolling()\n ) {\n return;\n }\n this.#lastTickCursorX = cursor.x;\n this.#lastTickCursorY = cursor.y;\n\n let scrollPerformed = false;\n\n for (const [id, { element, config }] of this.#scrollableContainers) {\n const rect = element.getBoundingClientRect();\n const isInside = this.#positionCalculator.isInsideContainer(cursor, rect);\n\n if (!isInside) {\n continue;\n }\n\n const nearEdge = this.#positionCalculator.getNearEdge(cursor, rect, config.threshold);\n\n // Reuse the per-frame direction object to avoid allocation.\n const direction = this.#tickDirection;\n direction.x = 0;\n direction.y = 0;\n let maxDistance = 0;\n\n if (nearEdge.top) {\n direction.y = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.y - rect.top));\n } else if (nearEdge.bottom) {\n direction.y = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.bottom - cursor.y));\n }\n\n if (nearEdge.left) {\n direction.x = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.x - rect.left));\n } else if (nearEdge.right) {\n direction.x = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.right - cursor.x));\n }\n\n if (direction.x !== 0 || direction.y !== 0) {\n let speed = config.maxSpeed;\n if (config.accelerate) {\n const distanceRatio = maxDistance / config.threshold;\n speed = Math.min(config.maxSpeed, Math.max(1, config.maxSpeed * distanceRatio));\n }\n\n this.#scrollState.containerId = id;\n this.#scrollState.direction.x = direction.x;\n this.#scrollState.direction.y = direction.y;\n this.#scrollState.speed = speed;\n this.#performScroll(element, direction, speed);\n scrollPerformed = true;\n break;\n }\n }\n\n if (!scrollPerformed) {\n this.#scrollState.containerId = null;\n this.#scrollState.direction.x = 0;\n this.#scrollState.direction.y = 0;\n this.#scrollState.speed = 0;\n }\n }\n\n /**\n * Perform the actual scroll operation.\n */\n #performScroll(element: HTMLElement, direction: { x: number; y: number }, speed: number): void {\n const scrollX = direction.x * speed;\n const scrollY = direction.y * speed;\n\n // Check bounds before scrolling\n const maxScrollY = element.scrollHeight - element.clientHeight;\n const maxScrollX = element.scrollWidth - element.clientWidth;\n\n if (direction.y < 0 && element.scrollTop <= 0) {\n return;\n }\n if (direction.y > 0 && element.scrollTop >= maxScrollY) {\n return;\n }\n if (direction.x < 0 && element.scrollLeft <= 0) {\n return;\n }\n if (direction.x > 0 && element.scrollLeft >= maxScrollX) {\n return;\n }\n\n // Use direct property assignment for guaranteed synchronous scroll\n // scrollBy() with 'instant' behavior may have async issues in Safari\n if (scrollY !== 0) {\n element.scrollTop += scrollY;\n }\n if (scrollX !== 0) {\n element.scrollLeft += scrollX;\n }\n\n // Notify callback IMMEDIATELY in the same frame (no RAF delay)\n // Delaying via RAF causes cumulative drift during continuous autoscroll\n // because multiple scrolls happen before each delayed callback runs.\n // Note: No ngZone.run() needed here - the callback (DraggableDirective.#recalculatePlaceholder)\n // already enters the zone when updating drag state.\n this.#onScrollCallback?.();\n }\n\n /**\n * Check if auto-scrolling is currently active.\n */\n isScrolling(): boolean {\n return (\n this.#scrollState.containerId !== null &&\n (this.#scrollState.direction.x !== 0 || this.#scrollState.direction.y !== 0)\n );\n }\n\n /**\n * Get the current scroll direction.\n */\n getScrollDirection(): { x: number; y: number } {\n return this.#scrollState.direction;\n }\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service for cloning DOM elements with their computed styles.\n * Used to create visual copies of dragged elements for the drag preview.\n */\n@Injectable({ providedIn: 'root' })\nexport class ElementCloneService {\n /**\n * CSS properties to copy from source to clone, pre-stored in kebab-case.\n * These are the visual properties that affect appearance. Keeping them\n * kebab-case avoids a camelCase→kebab conversion on every property of every\n * node during the recursive clone walk (a drag-start hot path).\n */\n readonly #stylePropsToCopy: readonly string[] = [\n 'background',\n 'background-color',\n 'background-image',\n 'border',\n 'border-radius',\n 'box-shadow',\n 'color',\n 'font',\n 'font-family',\n 'font-size',\n 'font-weight',\n 'line-height',\n 'padding',\n 'margin',\n 'display',\n 'flex-direction',\n 'align-items',\n 'justify-content',\n 'gap',\n 'text-align',\n 'text-decoration',\n 'width',\n 'height',\n 'min-width',\n 'min-height',\n 'max-width',\n 'max-height',\n 'overflow',\n 'opacity',\n 'transform',\n 'box-sizing',\n ];\n\n /**\n * Clone an element with its computed styles.\n * Returns an HTMLElement ready for use as a drag preview.\n */\n cloneElement(source: HTMLElement): HTMLElement {\n const clone = source.cloneNode(true) as HTMLElement;\n\n // Apply computed styles as inline styles\n this.#applyComputedStyles(source, clone);\n\n // Handle special elements (canvas, video, etc.)\n this.#handleSpecialElements(source, clone);\n\n // Sanitize the clone for safe use as preview\n this.#sanitizeClone(clone);\n\n return clone;\n }\n\n /**\n * Apply computed styles from source to target element.\n * Recursively applies to all child elements.\n */\n #applyComputedStyles(source: HTMLElement, target: HTMLElement): void {\n const computed = window.getComputedStyle(source);\n\n // Copy essential visual properties (keys are already kebab-case)\n for (const prop of this.#stylePropsToCopy) {\n const value = computed.getPropertyValue(prop);\n if (value) {\n target.style.setProperty(prop, value);\n }\n }\n\n // Disable animations and transitions on clone\n target.style.animation = 'none';\n target.style.transition = 'none';\n\n // Recursively apply to children\n const sourceChildren = source.children;\n const targetChildren = target.children;\n\n for (let i = 0; i < sourceChildren.length && i < targetChildren.length; i++) {\n const sourceChild = sourceChildren[i];\n const targetChild = targetChildren[i];\n\n if (sourceChild instanceof HTMLElement && targetChild instanceof HTMLElement) {\n this.#applyComputedStyles(sourceChild, targetChild);\n }\n }\n }\n\n /**\n * Handle special elements that require extra processing.\n */\n #handleSpecialElements(source: HTMLElement, clone: HTMLElement): void {\n // Handle canvas elements - copy current content\n const sourceCanvases = source.querySelectorAll('canvas');\n const cloneCanvases = clone.querySelectorAll('canvas');\n\n sourceCanvases.forEach((srcCanvas, i) => {\n const cloneCanvas = cloneCanvases[i] as HTMLCanvasElement;\n if (cloneCanvas) {\n const ctx = cloneCanvas.getContext('2d');\n if (ctx) {\n cloneCanvas.width = srcCanvas.width;\n cloneCanvas.height = srcCanvas.height;\n ctx.drawImage(srcCanvas, 0, 0);\n }\n }\n });\n\n // Handle video elements - replace with poster or placeholder\n const videos = clone.querySelectorAll('video');\n videos.forEach((video) => {\n const poster = video.poster;\n if (poster) {\n const img = document.createElement('img');\n img.src = poster;\n img.style.width = '100%';\n img.style.height = '100%';\n img.style.objectFit = 'cover';\n video.replaceWith(img);\n } else {\n // Create a placeholder\n const placeholder = document.createElement('div');\n placeholder.style.cssText = `\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n video.replaceWith(placeholder);\n }\n });\n\n // Handle iframes - replace with placeholder\n const iframes = clone.querySelectorAll('iframe');\n iframes.forEach((iframe) => {\n const placeholder = document.createElement('div');\n const iframeStyles = window.getComputedStyle(iframe);\n placeholder.style.width = iframeStyles.width;\n placeholder.style.height = iframeStyles.height;\n placeholder.style.display = 'flex';\n placeholder.style.alignItems = 'center';\n placeholder.style.justifyContent = 'center';\n iframe.replaceWith(placeholder);\n });\n }\n\n /**\n * Sanitize the clone to prevent interaction issues.\n */\n #sanitizeClone(clone: HTMLElement): void {\n // Remove draggable directive attributes\n clone.removeAttribute('vdndDraggable');\n clone.removeAttribute('data-draggable-id');\n clone.removeAttribute('data-droppable-id');\n\n // Remove Angular-specific attributes\n const angularAttrs = Array.from(clone.attributes).filter(\n (attr) => attr.name.startsWith('ng-') || attr.name.startsWith('_ng'),\n );\n angularAttrs.forEach((attr) => clone.removeAttribute(attr.name));\n\n // Process all descendant elements\n const allElements = clone.querySelectorAll('*');\n allElements.forEach((el) => {\n if (!(el instanceof HTMLElement)) return;\n\n // Remove event-related attributes\n const attrs = Array.from(el.attributes);\n attrs.forEach((attr) => {\n if (\n attr.name.startsWith('on') ||\n attr.name.startsWith('(') ||\n attr.name.startsWith('ng-') ||\n attr.name.startsWith('_ng')\n ) {\n el.removeAttribute(attr.name);\n }\n });\n\n // Remove draggable attributes from children too\n el.removeAttribute('vdndDraggable');\n el.removeAttribute('data-draggable-id');\n el.removeAttribute('data-droppable-id');\n });\n\n // Disable interactive elements\n const interactiveElements = clone.querySelectorAll(\n 'button, input, textarea, select, a, [contenteditable]',\n );\n interactiveElements.forEach((el) => {\n if (el instanceof HTMLElement) {\n el.style.pointerEvents = 'none';\n el.setAttribute('tabindex', '-1');\n el.setAttribute('aria-hidden', 'true');\n el.setAttribute('disabled', 'true');\n }\n });\n\n // Remove focus styling classes that might interfere\n clone.classList.remove('vdnd-draggable-dragging');\n clone.classList.remove('vdnd-draggable-disabled');\n }\n}\n","import { computed, inject, Injectable, signal } from '@angular/core';\nimport { DragStateService } from './drag-state.service';\nimport { DraggedItem, END_OF_LIST, GrabOffset } from '../models/drag-drop.models';\n\n/**\n * Service for managing keyboard-initiated drag operations.\n * Works in conjunction with DragStateService to provide keyboard drag functionality.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class KeyboardDragService {\n readonly #dragState = inject(DragStateService);\n\n /** Total item count for the current droppable (set by droppable on keyboard drag start) */\n readonly #totalItemCount = signal<number>(0);\n\n /** Whether a keyboard drag is currently active */\n readonly isActive = computed(\n () => this.#dragState.isKeyboardDrag() && this.#dragState.isDragging(),\n );\n\n /** Current target index during keyboard navigation */\n readonly targetIndex = computed(() => this.#dragState.keyboardTargetIndex());\n\n /** Source index where the drag started */\n readonly sourceIndex = computed(() => this.#dragState.sourceIndex());\n\n /** Current active droppable ID */\n readonly activeDroppableId = computed(() => this.#dragState.activeDroppableId());\n\n /**\n * Start a keyboard drag operation.\n */\n startKeyboardDrag(\n item: DraggedItem,\n sourceIndex: number,\n totalItemCount: number,\n activeDroppableId: string,\n ): void {\n this.#totalItemCount.set(totalItemCount);\n\n // For keyboard drag, we position the preview at the element's location\n // We use a grab offset of 0,0 since we're not grabbing at a specific point\n const grabOffset: GrabOffset = { x: 0, y: 0 };\n\n // Get the element's position for the cursor position\n // This positions the preview at the element's original location\n const rect = item.element.getBoundingClientRect();\n const cursorPosition = { x: rect.left, y: rect.top };\n\n // Same-list adjustment: at start, targetIndex equals sourceIndex\n // Since sourceIndex >= sourceIndex is always true, add 1 to placeholderIndex\n // This accounts for the hidden item shifting everything up visually\n const initialPlaceholderIndex = sourceIndex + 1;\n\n this.#dragState.startDrag(\n item,\n cursorPosition,\n grabOffset,\n null, // no axis lock for keyboard drag\n activeDroppableId,\n END_OF_LIST,\n initialPlaceholderIndex,\n sourceIndex,\n true, // isKeyboardDrag\n );\n }\n\n /**\n * Move to a specific index during keyboard drag.\n * Returns the clamped target index.\n */\n moveToIndex(targetIndex: number): number {\n if (!this.isActive()) {\n return targetIndex;\n }\n\n const totalItems = this.#totalItemCount();\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItems));\n\n this.#dragState.setKeyboardTargetIndex(clampedIndex);\n\n return clampedIndex;\n }\n\n /**\n * Move up by one position (ArrowUp).\n * Returns the new target index.\n */\n moveUp(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget - 1);\n }\n\n /**\n * Move down by one position (ArrowDown).\n * Returns the new target index.\n */\n moveDown(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget + 1);\n }\n\n /**\n * Move to an adjacent droppable (ArrowLeft/ArrowRight).\n * The droppable registry is managed externally.\n */\n moveToDroppable(droppableId: string, targetIndex: number, totalItemCount: number): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#totalItemCount.set(totalItemCount);\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItemCount));\n this.#dragState.setKeyboardActiveDroppable(droppableId, clampedIndex);\n }\n\n /**\n * Complete the keyboard drag (Space or Enter to drop).\n */\n completeKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.endDrag();\n }\n\n /**\n * Cancel the keyboard drag (Escape).\n */\n cancelKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.cancelDrag();\n }\n\n /**\n * Update the total item count (when navigating to a new list).\n */\n setTotalItemCount(count: number): void {\n this.#totalItemCount.set(count);\n }\n}\n","import { computed, Injectable, OnDestroy, signal } from '@angular/core';\n\n/**\n * Service that manages a shared overlay container appended to `document.body`.\n *\n * Elements placed inside the overlay container escape any ancestor CSS `transform`,\n * `perspective`, or `filter` that would create a new containing block for\n * `position: fixed` children. This ensures viewport-relative positioning works\n * correctly regardless of where the consuming component sits in the DOM tree.\n *\n * Mirrors the strategy used by Angular CDK's `OverlayContainer`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class OverlayContainerService implements OnDestroy {\n #containerElement: HTMLElement | null = null;\n\n /** Number of mounted drag previews currently rendering via a custom template. */\n readonly #templatePreviewCount = signal(0);\n\n /**\n * Whether at least one mounted drag preview renders via a custom template.\n *\n * When true, DraggableDirective/KeyboardDragHandler skip the expensive\n * drag-start element clone: the clone would never be shown because the\n * template takes precedence (see DragPreviewComponent).\n */\n readonly hasTemplatePreview = computed(() => this.#templatePreviewCount() > 0);\n\n /**\n * Register (`active = true`) or unregister (`active = false`) a preview that\n * renders via a custom template. Calls must be balanced per preview instance.\n */\n setTemplatePreviewActive(active: boolean): void {\n this.#templatePreviewCount.update((count) => Math.max(0, count + (active ? 1 : -1)));\n }\n\n /**\n * Returns the shared overlay container element, lazily creating it on first access.\n * Returns `null` in non-browser environments (SSR).\n */\n getContainerElement(): HTMLElement | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n if (!this.#containerElement) {\n this.#containerElement = document.createElement('div');\n this.#containerElement.classList.add('vdnd-overlay-container');\n document.body.appendChild(this.#containerElement);\n }\n\n return this.#containerElement;\n }\n\n ngOnDestroy(): void {\n this.#containerElement?.remove();\n this.#containerElement = null;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { type CursorPosition, END_OF_LIST, type GrabOffset } from '../models/drag-drop.models';\nimport { PositionCalculatorService } from './position-calculator.service';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\n\ninterface DroppableCache {\n droppableId: string | null;\n containerType: 'virtualScroll' | 'virtualContent' | 'fallback';\n scrollContainer: HTMLElement;\n virtualScrollElement: HTMLElement | null;\n virtualContentElement: HTMLElement | null;\n scrollableParent: HTMLElement | null;\n itemHeight: number;\n isConstrainedToContainer: boolean;\n strategy: VirtualScrollStrategy | null;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DragIndexCalculatorService {\n readonly #positionCalculator = inject(PositionCalculatorService);\n\n /** Registered strategies by droppable ID */\n readonly #strategies = new Map<string, VirtualScrollStrategy>();\n\n /** Cached droppable metadata to avoid repeated DOM queries during drag */\n readonly #droppableCache = new Map<HTMLElement, DroppableCache>();\n\n /**\n * Register a virtual scroll strategy for a droppable.\n * Used by virtual scroll components to provide dynamic height lookups.\n */\n registerStrategy(droppableId: string, strategy: VirtualScrollStrategy): void {\n this.#strategies.set(droppableId, strategy);\n }\n\n /**\n * Unregister a strategy when the droppable is destroyed.\n */\n unregisterStrategy(droppableId: string): void {\n this.#strategies.delete(droppableId);\n }\n\n /**\n * Get the registered strategy for a droppable ID.\n * Used by draggable to calculate source index with variable heights.\n */\n getStrategyForDroppable(droppableId: string): VirtualScrollStrategy | undefined {\n return this.#strategies.get(droppableId);\n }\n\n clearCache(): void {\n this.#droppableCache.clear();\n }\n\n #resolveDroppable(droppableElement: HTMLElement, draggedItemHeight: number): DroppableCache {\n const cached = this.#droppableCache.get(droppableElement);\n if (cached) return cached;\n\n const virtualScrollElement = droppableElement.querySelector(\n 'vdnd-virtual-scroll',\n ) as HTMLElement | null;\n const virtualContentElement = (\n droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content')\n ) as HTMLElement | null;\n\n let containerType: DroppableCache['containerType'];\n let scrollContainer: HTMLElement;\n let scrollableParent: HTMLElement | null = null;\n\n if (virtualScrollElement) {\n containerType = 'virtualScroll';\n scrollContainer = virtualScrollElement;\n } else if (virtualContentElement) {\n containerType = 'virtualContent';\n scrollableParent = virtualContentElement.closest('.vdnd-scrollable') as HTMLElement | null;\n scrollContainer = scrollableParent ?? virtualContentElement;\n } else {\n containerType = 'fallback';\n scrollContainer = droppableElement;\n }\n\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n const strategy = (droppableId ? this.#strategies.get(droppableId) : null) ?? null;\n\n const configuredHeight =\n virtualScrollElement?.getAttribute('data-item-height') ??\n virtualContentElement?.getAttribute('data-item-height');\n const parsedHeight = configuredHeight ? parseFloat(configuredHeight) : Number.NaN;\n const itemHeight = Number.isFinite(parsedHeight)\n ? parsedHeight\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n const isConstrainedToContainer = droppableElement.hasAttribute('data-constrain-to-container');\n\n const entry: DroppableCache = {\n droppableId,\n containerType,\n scrollContainer,\n virtualScrollElement,\n virtualContentElement,\n scrollableParent,\n itemHeight,\n isConstrainedToContainer,\n strategy,\n };\n\n this.#droppableCache.set(droppableElement, entry);\n return entry;\n }\n\n getTotalItemCount(args: {\n droppableElement: HTMLElement;\n isSameList: boolean;\n draggedItemHeight: number;\n }): number {\n return this.#getTotalItemCount(args.droppableElement, args.isSameList, args.draggedItemHeight);\n }\n\n calculatePlaceholderIndex(args: {\n droppableElement: HTMLElement;\n position: CursorPosition;\n previousPosition: CursorPosition | null;\n grabOffset: GrabOffset | null;\n draggedItemHeight: number;\n sourceDroppableId: string | null;\n sourceIndex: number | null;\n }): { index: number; placeholderId: string } {\n const {\n droppableElement,\n position,\n grabOffset,\n draggedItemHeight,\n sourceDroppableId,\n sourceIndex,\n } = args;\n\n // Resolve cached metadata (DOM queries run once per droppable per drag session)\n const cache = this.#resolveDroppable(droppableElement, draggedItemHeight);\n\n // Live reads: getBoundingClientRect() and scrollTop change during scroll\n let currentScrollTop: number;\n let rect: DOMRect;\n\n if (cache.containerType === 'virtualScroll') {\n rect = cache.scrollContainer.getBoundingClientRect();\n currentScrollTop = cache.scrollContainer.scrollTop;\n } else if (cache.containerType === 'virtualContent' && cache.scrollableParent) {\n rect = cache.scrollContainer.getBoundingClientRect();\n const contentOffsetAttr = cache.virtualContentElement!.getAttribute('data-content-offset');\n const contentOffset = contentOffsetAttr ? parseFloat(contentOffsetAttr) : 0;\n const offsetValue = Number.isFinite(contentOffset) ? contentOffset : 0;\n currentScrollTop = cache.scrollContainer.scrollTop - offsetValue;\n } else {\n rect = cache.scrollContainer.getBoundingClientRect();\n currentScrollTop =\n cache.containerType === 'virtualContent' ? 0 : cache.scrollContainer.scrollTop;\n }\n\n const {\n strategy,\n itemHeight,\n droppableId: currentDroppableId,\n isConstrainedToContainer,\n } = cache;\n\n // Calculate preview center position mathematically\n // The preview is positioned at: cursorPosition - grabOffset (see drag-preview.component.ts)\n // So preview center = cursorPosition.y - grabOffset.y + previewHeight/2\n // Using math avoids Safari's stale getBoundingClientRect() issue during autoscroll\n // Use actual dragged item height when available (important for dynamic heights)\n const previewHeight = this.#getDraggedItemHeightFallback(draggedItemHeight, itemHeight);\n const previewTopY = position.y - (grabOffset?.y ?? 0);\n const previewBottomY = previewTopY + previewHeight;\n const previewCenterY = previewTopY + previewHeight / 2;\n\n // Capped center probe: use preview center but limit how deep the probe reaches.\n // The cap prevents a tall preview (e.g. 120px among 60px items) from overshooting\n // multiple positions — the center would land 2+ items away, but the cap keeps it\n // within one item of the top edge.\n const indexProbeY = Math.min(previewCenterY, previewTopY + itemHeight / 2);\n\n // Convert to visual index\n const relativeY = indexProbeY - rect.top + currentScrollTop;\n\n // Determine same-list drag info before strategy branch\n const isSameList = sourceDroppableId !== null && sourceDroppableId === currentDroppableId;\n const sourceIndexValue = isSameList ? (sourceIndex ?? -1) : -1;\n\n let visualIndex: number;\n if (strategy) {\n visualIndex = strategy.findIndexAtOffset(relativeY);\n\n // Midpoint refinement for variable heights:\n // Only advance past an item when the preview top has crossed its midpoint.\n // Without this, a short preview entering a tall item's range triggers\n // displacement at ~20% overlap, which looks like unnatural overlapping.\n const topRelativeY = previewTopY - rect.top + currentScrollTop;\n const targetTop = strategy.getOffsetForIndex(visualIndex);\n const targetBottom = strategy.getOffsetForIndex(visualIndex + 1);\n const targetMidpoint = (targetTop + targetBottom) / 2;\n if (topRelativeY >= targetMidpoint) {\n visualIndex += 1;\n }\n } else {\n // Fixed height: simple division\n visualIndex = Math.floor(relativeY / itemHeight);\n }\n\n // Same-list +1 adjustment:\n // - No strategy: always adjust when visual index is at/after source\n // - Strategy: adjust only if exclusion has not been applied yet\n // (prevents an off-by-one window during early drag updates)\n let placeholderIndex = visualIndex;\n if (isSameList && sourceIndexValue >= 0 && visualIndex >= sourceIndexValue) {\n const needsAdjustment = !strategy || !this.#isSourceIndexExcluded(strategy, sourceIndexValue);\n if (needsAdjustment) {\n placeholderIndex = visualIndex + 1;\n }\n }\n\n // Get total items using cached strategy to avoid duplicate DOM queries\n let totalItems: number;\n const cachedItemCount = strategy?.getItemCount();\n if (cachedItemCount !== undefined && Number.isFinite(cachedItemCount)) {\n totalItems = Math.max(0, cachedItemCount);\n } else {\n totalItems = this.#getTotalItemCount(droppableElement, isSameList, draggedItemHeight);\n }\n\n // Edge detection: allow dropping at the END of the list when cursor is near bottom edge.\n // Due to max scroll limits, the math alone can't reach totalItems when the list is longer\n // than the viewport. If cursor is in the bottom portion of the container and we're at\n // or past the last visible slot, snap to totalItems.\n const cursorRelativeToBottom = rect.bottom - previewCenterY;\n const isNearBottomEdge = cursorRelativeToBottom < itemHeight;\n if (isNearBottomEdge && placeholderIndex >= totalItems - 1) {\n placeholderIndex = totalItems;\n }\n\n // When the preview is constrained to the container bounds, large dragged items can\n // cover the first/last slots while their center never reaches them. Snap to edges\n // using preview bounds so top/bottom drops remain reachable.\n if (isConstrainedToContainer) {\n const droppableRect = droppableElement.getBoundingClientRect();\n const edgeTolerance = 2;\n const distanceToTop = Math.abs(previewTopY - droppableRect.top);\n const distanceToBottom = Math.abs(droppableRect.bottom - previewBottomY);\n\n if (distanceToTop <= edgeTolerance && distanceToTop <= distanceToBottom) {\n placeholderIndex = 0;\n } else if (distanceToBottom <= edgeTolerance) {\n placeholderIndex = totalItems;\n }\n }\n\n // Clamp to valid range\n placeholderIndex = Math.max(0, Math.min(placeholderIndex, totalItems));\n\n return { index: placeholderIndex, placeholderId: END_OF_LIST };\n }\n\n #getTotalItemCount(\n droppableElement: HTMLElement,\n isSameList: boolean,\n draggedItemHeight: number,\n ): number {\n // Check if a registered strategy exists\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n const strategy = droppableId ? this.#strategies.get(droppableId) : null;\n const strategyItemCount = strategy?.getItemCount();\n if (strategyItemCount !== undefined && Number.isFinite(strategyItemCount)) {\n return Math.max(0, strategyItemCount);\n }\n\n // Check for embedded virtual scroll component\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n // Use data-total-items attribute if available (always the true N)\n const totalItemsAttr = virtualScroll.getAttribute('data-total-items');\n if (totalItemsAttr) {\n const count = parseInt(totalItemsAttr, 10);\n if (Number.isFinite(count)) {\n return count;\n }\n }\n\n // Fallback: Use the spacer's height, NOT scrollHeight, to determine item count.\n // scrollHeight can be inflated by absolutely-positioned elements like the placeholder.\n const spacer = virtualScroll.querySelector(\n '.vdnd-virtual-scroll-spacer',\n ) as HTMLElement | null;\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n let totalHeight: number;\n if (spacer) {\n // Get the spacer's explicit height (set via Angular binding)\n totalHeight = parseFloat(spacer.style.height) || 0;\n } else {\n // Fallback: use scrollHeight if spacer not found\n totalHeight = (virtualScroll as HTMLElement).scrollHeight;\n }\n\n // When strategy exists, spacer height already accounts for exclusion.\n // Don't apply same-list +1 adjustment — strategy handles it.\n if (strategy) {\n const count = Math.round(totalHeight / itemHeight);\n return count;\n }\n\n // Spacer height reflects full N items (getTotalHeight no longer excludes)\n const count = Math.floor(totalHeight / itemHeight);\n return count;\n }\n\n // Check for page-level scroll (vdnd-virtual-content)\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n if (virtualContent) {\n // Prefer explicit total items attribute (works for both fixed and dynamic heights)\n const totalItemsAttr = (virtualContent as HTMLElement).getAttribute('data-total-items');\n if (totalItemsAttr) {\n const count = parseInt(totalItemsAttr, 10);\n if (Number.isFinite(count)) {\n // data-total-items is the true total N (derived from strategy item count)\n return count;\n }\n }\n\n // Fallback: use spacer height to determine total items\n const spacer = virtualContent.querySelector('.vdnd-content-spacer') as HTMLElement | null;\n if (spacer) {\n const totalHeight = parseFloat(spacer.style.height) || 0;\n const configuredHeight = virtualContent.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 72);\n return Math.floor(totalHeight / itemHeight);\n }\n }\n\n // Fallback for non-virtual scroll — querySelectorAll finds all N items\n // (including the hidden dragged item), so no adjustment needed\n const items = droppableElement.querySelectorAll('[data-draggable-id]');\n return items.length;\n }\n\n #getDraggedItemHeightFallback(height: number, fallback: number): number {\n return Number.isFinite(height) && height > 0 ? height : fallback;\n }\n\n /**\n * Detect whether a strategy has already excluded the source index.\n *\n * With exclusion applied, the source slot collapses in visual space:\n * offset(sourceIndex + 1) <= offset(sourceIndex). Without exclusion,\n * the next offset is strictly greater.\n */\n #isSourceIndexExcluded(strategy: VirtualScrollStrategy, sourceIndex: number): boolean {\n if (sourceIndex < 0) {\n return false;\n }\n\n const sourceOffset = strategy.getOffsetForIndex(sourceIndex);\n const nextOffset = strategy.getOffsetForIndex(sourceIndex + 1);\n\n return nextOffset <= sourceOffset;\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * Renders an empty placeholder that takes up space in the document flow.\n *\n * This component is used internally by virtual scroll containers to show\n * where an item will be dropped. It's rendered inline with items and\n * takes up the same vertical space as an item.\n *\n * The placeholder is just empty space - no borders, no background.\n * Consumers can style it via CSS if desired.\n */\n@Component({\n selector: 'vdnd-drag-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'vdnd-drag-placeholder vdnd-drag-placeholder-visible',\n '[style.height.px]': 'itemHeight()',\n },\n styles: `\n :host {\n display: block;\n pointer-events: none;\n }\n `,\n template: ``,\n})\nexport class DragPlaceholderComponent {\n /** Item height for sizing */\n itemHeight = input.required<number>();\n}\n","import { NgZone, type WritableSignal } from '@angular/core';\n\nexport function bindRafThrottledScrollTopSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n scrollTop: WritableSignal<number>;\n thresholdPx?: number;\n onCommit?: (scrollTop: number) => void;\n}): () => void {\n const { element, ngZone, scrollTop, thresholdPx = 5, onCommit } = options;\n\n let pendingRaf: number | null = null;\n let lastCommittedScrollTop = element.scrollTop;\n\n const onScroll = () => {\n if (pendingRaf !== null) {\n return;\n }\n\n const currentScrollTop = element.scrollTop;\n if (Math.abs(currentScrollTop - lastCommittedScrollTop) < thresholdPx) {\n return;\n }\n\n pendingRaf = requestAnimationFrame(() => {\n pendingRaf = null;\n const finalScrollTop = element.scrollTop;\n if (Math.abs(finalScrollTop - lastCommittedScrollTop) >= thresholdPx) {\n lastCommittedScrollTop = finalScrollTop;\n scrollTop.set(finalScrollTop);\n onCommit?.(finalScrollTop);\n }\n });\n };\n\n ngZone.runOutsideAngular(() => {\n element.addEventListener('scroll', onScroll, { passive: true });\n });\n\n scrollTop.set(lastCommittedScrollTop);\n\n return () => {\n if (pendingRaf !== null) {\n cancelAnimationFrame(pendingRaf);\n pendingRaf = null;\n }\n element.removeEventListener('scroll', onScroll);\n };\n}\n\nexport function bindResizeObserverHeightSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n height: WritableSignal<number>;\n minDeltaPx?: number;\n}): () => void {\n const { element, ngZone, height, minDeltaPx = 1 } = options;\n\n if (typeof ResizeObserver === 'undefined') {\n height.set(element.clientHeight);\n return () => undefined;\n }\n\n let observer: ResizeObserver | null = null;\n\n ngZone.runOutsideAngular(() => {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const nextHeight = entry.contentRect.height;\n if (Math.abs(nextHeight - height()) > minDeltaPx) {\n height.set(nextHeight);\n }\n }\n });\n observer.observe(element);\n });\n\n height.set(element.clientHeight);\n\n return () => {\n observer?.disconnect();\n observer = null;\n };\n}\n","import { DestroyRef, effect, inject } from '@angular/core';\nimport { type AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\n\ninterface AutoScrollRegistrationOptions {\n autoScrollService: AutoScrollService;\n getElement: () => HTMLElement;\n getId: () => string;\n enabled: () => boolean;\n config: () => Partial<AutoScrollConfig>;\n canRegister?: () => boolean;\n}\n\nexport function createAutoScrollRegistration(options: AutoScrollRegistrationOptions): void {\n const destroyRef = inject(DestroyRef);\n let registeredId: string | null = null;\n\n const unregisterCurrent = (): void => {\n if (registeredId === null) {\n return;\n }\n\n options.autoScrollService.unregisterContainer(registeredId);\n registeredId = null;\n };\n\n effect(() => {\n const enabled = options.enabled();\n const id = options.getId();\n const config = options.config();\n const canRegister = options.canRegister?.() ?? true;\n\n if (!enabled || !canRegister) {\n unregisterCurrent();\n return;\n }\n\n if (registeredId !== null && registeredId !== id) {\n unregisterCurrent();\n }\n\n options.autoScrollService.registerContainer(id, options.getElement(), config);\n registeredId = id;\n });\n\n destroyRef.onDestroy(unregisterCurrent);\n}\n","import {\n afterNextRender,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { DragPlaceholderComponent } from './drag-placeholder.component';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\nimport { queryByAttribute } from '../utils/attribute-selectors';\n\n/**\n * Context provided to the item template.\n */\nexport interface VirtualScrollItemContext<T> {\n /** The item data */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this item is \"sticky\" (always rendered) */\n isSticky: boolean;\n}\n\n/**\n * A virtual scroll container that only renders visible items.\n *\n * Key features:\n * - Only renders items within the visible viewport plus an overscan buffer\n * - Supports \"sticky\" items that are always rendered (used for dragged items)\n * - Uses spacer divs to maintain correct scroll height\n * - Integrates with the drag-and-drop system\n * - Automatic height detection via ResizeObserver when containerHeight is not provided\n * - Supports dynamic item heights via `dynamicItemHeight` input\n *\n * @example\n * ```html\n * <!-- With fixed height items -->\n * <vdnd-virtual-scroll\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [containerHeight]=\"400\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n *\n * <!-- With dynamic height items -->\n * <vdnd-virtual-scroll\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [dynamicItemHeight]=\"true\"\n * [containerHeight]=\"400\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.description }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-scroll',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, DragPlaceholderComponent],\n host: {\n class: 'vdnd-virtual-scroll',\n '[style.height.px]': 'containerHeight() ?? null',\n '[attr.data-item-height]': 'itemHeight()',\n '[attr.data-total-items]': 'items().length',\n },\n template: `\n <!-- Single spacer maintains scroll height -->\n <div class=\"vdnd-virtual-scroll-spacer\" [style.height.px]=\"totalHeight()\"></div>\n\n <!-- Content wrapper positioned via GPU-accelerated transform -->\n <div class=\"vdnd-virtual-scroll-content-wrapper\" [style.transform]=\"contentTransform()\">\n @for (entry of renderedItems(); track trackEntry($index, entry)) {\n @if (entry.type === 'placeholder') {\n <vdnd-drag-placeholder [itemHeight]=\"placeholderHeight()\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate();\n context: {\n $implicit: entry.data,\n index: entry.index,\n isSticky: entry.isSticky,\n }\n \"\n >\n </ng-container>\n }\n }\n </div>\n `,\n styles: `\n :host {\n display: block;\n overflow: auto;\n position: relative;\n /* Disable browser scroll anchoring - this prevents scroll position from being\n adjusted when the DOM changes (e.g., when placeholder position updates).\n Without this, autoscroll UP would fight with browser's scroll restoration. */\n overflow-anchor: none;\n }\n\n .vdnd-virtual-scroll-spacer {\n /* Invisible spacer that maintains scroll height */\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-virtual-scroll-content-wrapper {\n /* GPU-accelerated positioning */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n})\nexport class VirtualScrollContainerComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n readonly #dragState = inject(DragStateService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #autoScrollService = inject(AutoScrollService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n readonly #ngZone = inject(NgZone);\n readonly #injector = inject(Injector);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** ResizeObserver for dynamic height measurement */\n #itemResizeObserver: ResizeObserver | null = null;\n\n /** Map from observed HTMLElement to its trackBy key */\n readonly #observedElements = new WeakMap<HTMLElement, unknown>();\n /** Stable mapping from rendered key to observed element for unobserve cleanup */\n readonly #observedElementByKey = new Map<unknown, HTMLElement>();\n\n /** Measured height from ResizeObserver (used when containerHeight is not provided) */\n readonly #measuredHeight = signal(0);\n\n /** Template for rendering each item - passed as input instead of content child for reliability */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n /**\n * Height of the container in pixels.\n * If not provided, the container will automatically measure its height from CSS.\n * This allows you to set the height via CSS (e.g., flex, height: 100%, etc.)\n * and the component will adapt automatically, including on resize.\n */\n containerHeight = input<number>();\n\n /**\n * Effective height used for calculations.\n * Uses explicit containerHeight if provided, otherwise uses measured height.\n */\n readonly effectiveHeight = computed(() => this.containerHeight() ?? this.#measuredHeight());\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** IDs of items that should always be rendered (e.g., dragged items) */\n stickyItemIds = input<string[]>([]);\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /**\n * ID of the droppable this virtual scroll belongs to.\n * Required for placeholder positioning.\n */\n droppableId = input<string>();\n\n /**\n * Whether to automatically add the dragged item to the sticky list.\n * This ensures the dragged item remains visible during virtual scrolling.\n * @default true\n */\n autoStickyDraggedItem = input<boolean>(true);\n\n // ========== Strategy ==========\n\n /** The virtual scroll strategy, created based on dynamicItemHeight input */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n const height = this.itemHeight();\n return this.dynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n /**\n * Effective track-by function - uses provided trackByFn or derives from itemIdFn.\n */\n protected readonly effectiveTrackByFn = computed(() => {\n const userFn = this.trackByFn();\n if (userFn) return userFn;\n\n const idFn = this.itemIdFn();\n return (_index: number, item: T) => idFn(item);\n });\n\n /**\n * Track function for rendered entries (items + placeholder).\n */\n protected trackEntry(\n _index: number,\n entry: { type: 'item' | 'placeholder'; data: T | null; index: number },\n ): string | number {\n if (entry.type === 'placeholder') {\n return '__placeholder__';\n }\n const trackFn = this.effectiveTrackByFn();\n return trackFn(entry.index, entry.data as T);\n }\n\n /**\n * Effective sticky item IDs - combines user-provided IDs with auto-sticky dragged item.\n */\n protected readonly effectiveStickyIds = computed(() => {\n const userIds = this.stickyItemIds();\n\n if (!this.autoStickyDraggedItem()) {\n return userIds;\n }\n\n const draggedId = this.draggedItemId();\n if (!draggedId) {\n return userIds;\n }\n\n // Avoid creating new array if dragged ID is already in the list\n if (userIds.includes(draggedId)) {\n return userIds;\n }\n\n return [...userIds, draggedId];\n });\n\n /** Current scroll position */\n readonly #scrollTop = signal(0);\n\n /** Total height of all items (for scrollbar) */\n protected readonly totalHeight = computed(() => {\n const count = this.items().length;\n const strategy = this.#strategy();\n strategy.version();\n return strategy.getTotalHeight(count);\n });\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n const strategy = this.#strategy();\n strategy.version();\n return strategy.getFirstVisibleIndex(this.#scrollTop());\n });\n\n /** Number of items visible in the viewport */\n readonly #visibleCount = computed(() => {\n const height = this.effectiveHeight();\n const strategy = this.#strategy();\n strategy.version();\n return strategy.getVisibleCount(this.#firstVisibleIndex(), height);\n });\n\n /** Range of items to render (with overscan) */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.overscan();\n const total = this.items().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Transform offset for content wrapper (position of first rendered item) */\n protected readonly contentTransform = computed(() => {\n const { start } = this.#renderRange();\n const strategy = this.#strategy();\n strategy.version();\n\n const offset = strategy.getOffsetForIndex(start);\n return `translateY(${offset}px)`;\n });\n\n /** The ID of the currently dragged item (if any) */\n protected readonly draggedItemId = computed(() => {\n return this.#dragState.draggedItem()?.draggableId ?? null;\n });\n\n /** Map of item IDs to their indices - rebuilt only when items() changes (O(n) once, then O(1) lookups) */\n readonly #itemIndexMap = computed(() => {\n const items = this.items();\n const idFn = this.itemIdFn();\n const map = new Map<string, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(idFn(items[i]), i);\n }\n return map;\n });\n\n /** The index of the currently dragged item in the items array (-1 if not found or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedId = this.draggedItemId();\n if (!draggedId) return -1;\n return this.#itemIndexMap().get(draggedId) ?? -1;\n });\n\n /** Memoized Set of sticky IDs - rebuilt only when effectiveStickyIds() changes */\n readonly #stickyIdsSet = computed(() => new Set(this.effectiveStickyIds()));\n\n /** Whether the placeholder should be shown in this container */\n protected readonly shouldShowPlaceholder = computed(() => {\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === this.droppableId();\n });\n\n /** The placeholder index when placeholder should be shown */\n protected readonly placeholderIndex = computed(() => {\n if (!this.shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n /** Height for the placeholder — use dragged item's actual height in dynamic mode */\n protected readonly placeholderHeight = computed(() => {\n if (this.dynamicItemHeight()) {\n const draggedItemHeight = this.#dragState.draggedItem()?.height;\n if (draggedItemHeight && draggedItemHeight > 0) return draggedItemHeight;\n }\n return this.itemHeight();\n });\n\n /** Items to render, including sticky items and placeholder */\n protected readonly renderedItems = computed(() => {\n const items = this.items();\n const { start, end } = this.#renderRange();\n const stickyIds = this.#stickyIdsSet();\n const idFn = this.itemIdFn();\n const itemIndexMap = this.#itemIndexMap();\n const draggedId = this.draggedItemId();\n const placeholderIdx = this.placeholderIndex();\n\n const result: {\n type: 'item' | 'placeholder';\n data: T | null;\n index: number;\n isSticky: boolean;\n isDragging: boolean;\n }[] = [];\n const renderedIds = new Set<string>();\n let hasPlaceholder = false;\n\n // Add all items in the visible range, inserting placeholder at correct position\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (placeholderIdx === i && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n const item = items[i];\n const id = idFn(item);\n result.push({\n type: 'item',\n data: item,\n index: i,\n isSticky: stickyIds.has(id),\n isDragging: id === draggedId,\n });\n renderedIds.add(id);\n }\n\n // If placeholder is at the end (after all items), add it\n if (placeholderIdx >= items.length && placeholderIdx >= 0 && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n // Add any sticky items that aren't already rendered\n const missingStickyIndices: { id: string; index: number }[] = [];\n for (const id of stickyIds) {\n if (renderedIds.has(id)) continue;\n const index = itemIndexMap.get(id);\n if (index === undefined) continue;\n missingStickyIndices.push({ id, index });\n }\n if (missingStickyIndices.length > 1) {\n missingStickyIndices.sort((a, b) => a.index - b.index);\n }\n\n for (const { id, index } of missingStickyIndices) {\n const item = items[index];\n if (item === undefined) continue;\n result.push({\n type: 'item',\n data: item,\n index,\n isSticky: true,\n isDragging: id === draggedId,\n });\n }\n\n return result;\n });\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Track previous dragged ID to detect drag end */\n #previousDraggedId: string | null = null;\n\n /** Track previous total height to detect if we were at bottom before drag ended */\n #previousTotalHeight = 0;\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScrollService,\n getElement: () => this.#elementRef.nativeElement,\n getId: () => this.scrollContainerId() ?? this.#generatedScrollId,\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n });\n\n // Keep strategy item keys in sync\n effect(() => {\n const items = this.items();\n const idFn = this.itemIdFn();\n const keys = items.map((item) => idFn(item));\n this.#strategy().setItemKeys(keys);\n });\n\n // Register strategy with drag index calculator for accurate drag calculations\n effect((onCleanup) => {\n const droppableId = this.droppableId();\n const strategy = this.#strategy();\n if (droppableId) {\n this.#dragIndexCalculator.registerStrategy(droppableId, strategy);\n onCleanup(() => this.#dragIndexCalculator.unregisterStrategy(droppableId));\n }\n });\n\n // Set excluded index persistently during same-list drag.\n effect(() => {\n const strategy = this.#strategy();\n const draggedIndex = this.#draggedItemIndex();\n strategy.setExcludedIndex(draggedIndex >= 0 ? draggedIndex : null);\n });\n\n // Keyboard drag autoscroll: scroll to keep target index visible\n effect(() => {\n // Only apply when this droppable is active during keyboard drag\n if (!this.#dragState.isKeyboardDrag()) return;\n const activeDroppable = this.#dragState.activeDroppableId();\n if (activeDroppable !== this.droppableId()) return;\n\n const targetIndex = this.#dragState.keyboardTargetIndex();\n if (targetIndex === null) return;\n\n const strategy = this.#strategy();\n strategy.version();\n const height = this.effectiveHeight();\n if (height <= 0) return;\n\n const element = this.#elementRef.nativeElement;\n const currentScrollTop = element.scrollTop;\n\n // Calculate target item position using strategy\n const targetTop = strategy.getOffsetForIndex(targetIndex);\n const targetBottom = targetTop + strategy.getItemHeight(targetIndex);\n\n // Calculate visible range\n const viewportTop = currentScrollTop;\n const viewportBottom = currentScrollTop + height;\n\n // Check if target is fully visible\n if (targetTop < viewportTop) {\n // Target is above viewport - scroll up\n element.scrollTop = targetTop;\n this.#scrollTop.set(targetTop);\n } else if (targetBottom > viewportBottom) {\n // Target is below viewport - scroll down\n const newScrollTop = targetBottom - height;\n element.scrollTop = newScrollTop;\n this.#scrollTop.set(newScrollTop);\n }\n });\n\n // Preserve scroll position when drag ends at bottom of list.\n // Safety net: totalHeight no longer shrinks during drag (getTotalHeight\n // ignores exclusion), but this logic remains as harmless protection\n // in case future changes reintroduce height variance.\n effect(() => {\n const currentDraggedId = this.draggedItemId();\n const currentTotalHeight = this.totalHeight();\n const element = this.#elementRef.nativeElement;\n\n // Detect drag end (was dragging, now not)\n if (this.#previousDraggedId !== null && currentDraggedId === null) {\n const currentScrollTop = element.scrollTop;\n const strategy = this.#strategy();\n strategy.version();\n const height = this.effectiveHeight();\n const totalItems = this.items().length;\n\n // Calculate if we were at/near bottom (within 10px tolerance)\n // using the height FROM THE PREVIOUS CYCLE (when dragging was active)\n const dragReducedMaxScroll = Math.max(0, this.#previousTotalHeight - height);\n const wasAtBottom = currentScrollTop >= dragReducedMaxScroll - 10;\n\n if (wasAtBottom && dragReducedMaxScroll > 0) {\n // Clear exclusion before calculating new height\n strategy.setExcludedIndex(null);\n\n // Adjust scroll to new bottom position after totalHeight increases\n afterNextRender(\n () => {\n const newTotalHeight = strategy.getTotalHeight(totalItems);\n const newMaxScroll = Math.max(0, newTotalHeight - height);\n element.scrollTop = newMaxScroll;\n this.#scrollTop.set(newMaxScroll);\n },\n { injector: this.#injector },\n );\n }\n }\n\n this.#previousDraggedId = currentDraggedId;\n this.#previousTotalHeight = currentTotalHeight;\n });\n\n // Clamp scrollTop during drag if totalHeight ever shrinks.\n // With the current fix, getTotalHeight no longer excludes the dragged item,\n // so this is effectively a no-op. Kept as a safety net.\n effect(() => {\n const isDragging = this.#dragState.isDragging();\n const totalHeight = this.totalHeight();\n const element = this.#elementRef.nativeElement;\n\n if (isDragging) {\n const containerHeight = this.effectiveHeight();\n const maxScroll = Math.max(0, totalHeight - containerHeight);\n const currentScrollTop = element.scrollTop;\n\n // Clamp scrollTop to valid range\n if (currentScrollTop > maxScroll) {\n element.scrollTop = maxScroll;\n this.#scrollTop.set(maxScroll);\n }\n }\n });\n }\n\n ngOnInit(): void {\n // Set up ResizeObserver for dynamic height measurement\n if (this.dynamicItemHeight()) {\n this.#setupItemResizeObserver();\n }\n }\n\n ngAfterViewInit(): void {\n const element = this.#elementRef.nativeElement;\n\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element,\n ngZone: this.#ngZone,\n height: this.#measuredHeight,\n minDeltaPx: 1,\n });\n\n // Scroll listener outside Angular zone with RAF throttling.\n // This avoids template event binding which would mark the component dirty 60x/sec.\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: 5,\n });\n\n // Observe rendered items for dynamic height measurement\n if (this.dynamicItemHeight()) {\n this.#observeRenderedItems();\n }\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n for (const element of this.#observedElementByKey.values()) {\n this.#itemResizeObserver?.unobserve(element);\n }\n this.#observedElementByKey.clear();\n this.#itemResizeObserver?.disconnect();\n }\n\n /**\n * Set up ResizeObserver for measuring individual item heights.\n */\n #setupItemResizeObserver(): void {\n this.#ngZone.runOutsideAngular(() => {\n this.#itemResizeObserver = new ResizeObserver((entries) => {\n const strategy = this.#strategy();\n for (const entry of entries) {\n const element = entry.target as HTMLElement;\n const key = this.#observedElements.get(element);\n if (key === undefined) continue;\n\n const height = entry.borderBoxSize?.[0]?.blockSize ?? element.offsetHeight;\n if (height > 0) {\n strategy.setMeasuredHeight(key, height);\n }\n }\n });\n });\n }\n\n /**\n * Observe currently rendered items' DOM elements for height changes.\n * Called after view init and on each render cycle in dynamic mode.\n */\n #observeRenderedItems(): void {\n if (!this.#itemResizeObserver) return;\n\n // Use an effect to re-observe whenever rendered items change\n effect(\n () => {\n const rendered = this.renderedItems();\n const idFn = this.itemIdFn();\n const observer = this.#itemResizeObserver;\n if (!observer) return;\n\n // Find the content wrapper and observe item elements\n const wrapper = this.#elementRef.nativeElement.querySelector(\n '.vdnd-virtual-scroll-content-wrapper',\n );\n if (!wrapper) return;\n\n const nextObservedByKey = new Map<unknown, HTMLElement>();\n\n for (const entry of rendered) {\n if (entry.type !== 'item' || !entry.data) continue;\n const key = idFn(entry.data);\n\n // Find the DOM element for this item by its data-draggable-id.\n const el = queryByAttribute<HTMLElement>(wrapper, 'data-draggable-id', key);\n if (el) {\n nextObservedByKey.set(key, el);\n }\n }\n\n for (const [key, oldElement] of this.#observedElementByKey) {\n const nextElement = nextObservedByKey.get(key);\n if (nextElement !== oldElement) {\n observer.unobserve(oldElement);\n }\n }\n\n for (const [key, nextElement] of nextObservedByKey) {\n const currentElement = this.#observedElementByKey.get(key);\n if (currentElement !== nextElement) {\n this.#observedElements.set(nextElement, key);\n observer.observe(nextElement);\n }\n }\n\n this.#observedElementByKey.clear();\n for (const [key, element] of nextObservedByKey) {\n this.#observedElementByKey.set(key, element);\n }\n },\n { injector: this.#injector },\n );\n }\n\n /**\n * Scroll to a specific position.\n */\n scrollTo(position: number): void {\n this.#elementRef.nativeElement.scrollTop = position;\n this.#scrollTop.set(position);\n }\n\n /**\n * Scroll to a specific item index.\n */\n scrollToIndex(index: number): void {\n const strategy = this.#strategy();\n const position = strategy.getOffsetForIndex(index);\n this.scrollTo(position);\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#scrollTop();\n }\n\n /**\n * Get the total scrollable height.\n */\n getScrollHeight(): number {\n return this.totalHeight();\n }\n\n /**\n * Scroll by a delta amount.\n */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(this.getScrollTop() + delta, this.getScrollHeight() - this.effectiveHeight()),\n );\n this.scrollTo(newPosition);\n }\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\n\n/**\n * Context provided to the drag preview template.\n */\nexport interface DragPreviewContext<T = unknown> {\n /** The data associated with the dragged item */\n $implicit: T;\n /** The draggable ID */\n draggableId: string;\n /** The source droppable ID */\n droppableId: string;\n}\n\n/**\n * Renders a preview of the dragged item that follows the cursor.\n *\n * The component automatically teleports itself into a body-level overlay container,\n * so it works correctly even inside ancestors with CSS `transform` (e.g. Ionic pages).\n * It can be placed anywhere in the component tree.\n *\n * @example\n * ```html\n * <vdnd-drag-preview>\n * <ng-template let-data let-id=\"draggableId\">\n * <div class=\"drag-preview\">{{ data.name }}</div>\n * </ng-template>\n * </vdnd-drag-preview>\n * ```\n */\n@Component({\n selector: 'vdnd-drag-preview',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n template: `\n @if (isVisible()) {\n <div\n class=\"vdnd-drag-preview\"\n data-testid=\"vdnd-drag-preview\"\n [style.transform]=\"transform()\"\n [style.width.px]=\"dimensions().width\"\n [style.height.px]=\"dimensions().height\"\n >\n @if (previewTemplate()) {\n <ng-container *ngTemplateOutlet=\"previewTemplate()!; context: templateContext()\">\n </ng-container>\n } @else if (clonedElement()) {\n <div class=\"vdnd-drag-preview-clone\" #cloneContainer></div>\n } @else {\n <div class=\"vdnd-drag-preview-default\">\n {{ dragState.draggedItem()?.draggableId }}\n </div>\n }\n </div>\n }\n `,\n styles: `\n .vdnd-drag-preview {\n box-sizing: border-box;\n position: fixed;\n left: 0;\n top: 0;\n will-change: transform;\n pointer-events: none;\n z-index: 1000;\n }\n\n .vdnd-drag-preview-clone {\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n `,\n})\nexport class DragPreviewComponent<T = unknown> implements OnDestroy {\n protected readonly dragState = inject(DragStateService);\n readonly #overlayContainer = inject(OverlayContainerService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n\n /** Optional custom template for the preview */\n previewTemplate = input<TemplateRef<DragPreviewContext<T>>>();\n\n /** Offset from cursor to preview (to avoid cursor being on top of preview) */\n cursorOffset = input<{ x: number; y: number }>({ x: 8, y: 8 });\n\n /** Reference to the clone container element (cannot use ES private with viewChild) */\n private readonly cloneContainer = viewChild<ElementRef<HTMLElement>>('cloneContainer');\n\n /** Whether this preview's template registration is currently counted (kept balanced). */\n #templateRegistered = false;\n\n /** The cloned element from drag state (used when no custom template is provided) */\n protected readonly clonedElement = computed(() => {\n if (this.previewTemplate()) {\n return null; // Custom template takes precedence\n }\n return this.dragState.draggedItem()?.clonedElement ?? null;\n });\n\n constructor() {\n // Teleport host element into the body-level overlay container after first render.\n // This escapes any ancestor CSS transforms that would break position: fixed.\n afterNextRender(() => {\n const container = this.#overlayContainer.getContainerElement();\n if (container) {\n container.appendChild(this.#elementRef.nativeElement);\n }\n });\n\n // Publish whether this preview renders via a custom template so the drag\n // directives can skip the drag-start element clone when it won't be shown.\n effect(() => {\n const hasTemplate = !!this.previewTemplate();\n if (hasTemplate && !this.#templateRegistered) {\n this.#overlayContainer.setTemplatePreviewActive(true);\n this.#templateRegistered = true;\n } else if (!hasTemplate && this.#templateRegistered) {\n this.#overlayContainer.setTemplatePreviewActive(false);\n this.#templateRegistered = false;\n }\n });\n\n // Effect to insert the cloned element into the container\n effect(() => {\n const container = this.cloneContainer()?.nativeElement;\n const clone = this.clonedElement();\n\n if (!container) {\n return;\n }\n\n // Clear previous content and append the prepared clone element.\n // Avoid cloning again: ElementCloneService already creates a styled/sanitized clone.\n container.innerHTML = '';\n if (clone) {\n container.appendChild(clone);\n }\n });\n }\n\n ngOnDestroy(): void {\n if (this.#templateRegistered) {\n this.#overlayContainer.setTemplatePreviewActive(false);\n this.#templateRegistered = false;\n }\n this.#elementRef.nativeElement.remove();\n }\n\n /** Whether the preview is visible */\n protected readonly isVisible = computed(() => {\n return this.dragState.isDragging() && this.dragState.cursorPosition() !== null;\n });\n\n /** Position of the preview */\n protected readonly position = computed(() => {\n const cursor = this.dragState.cursorPosition();\n const grabOffset = this.dragState.grabOffset();\n const fallbackOffset = this.cursorOffset();\n const initialPosition = this.dragState.initialPosition();\n const lockAxis = this.dragState.lockAxis();\n\n if (!cursor) {\n return { x: 0, y: 0 };\n }\n\n // Use grab offset if available (preserves grab position), otherwise fall back to cursorOffset input\n const offset = grabOffset ?? fallbackOffset;\n\n let x = cursor.x - offset.x;\n let y = cursor.y - offset.y;\n\n // Apply axis locking if configured\n if (lockAxis && initialPosition) {\n if (lockAxis === 'x') {\n // Lock X axis: x stays at initial position\n x = initialPosition.x - offset.x;\n } else if (lockAxis === 'y') {\n // Lock Y axis: y stays at initial position\n y = initialPosition.y - offset.y;\n }\n }\n\n return { x, y };\n });\n\n /** Transform-based positioning for better performance (avoid layout from left/top). */\n protected readonly transform = computed(() => {\n const { x, y } = this.position();\n return `translate3d(${x}px, ${y}px, 0)`;\n });\n\n /** Dimensions of the preview */\n protected readonly dimensions = computed(() => {\n const item = this.dragState.draggedItem();\n\n if (!item) {\n return { width: 100, height: 50 };\n }\n\n return {\n width: item.width,\n height: item.height,\n };\n });\n\n /** Template context */\n protected readonly templateContext = computed((): DragPreviewContext<T> => {\n const item = this.dragState.draggedItem();\n\n return {\n $implicit: (item?.data ?? null) as T,\n draggableId: item?.draggableId ?? '',\n droppableId: item?.droppableId ?? '',\n };\n });\n}\n","import { ChangeDetectionStrategy, Component, input, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * Context provided to the custom placeholder template.\n */\nexport interface PlaceholderContext {\n /** The height of the placeholder in pixels */\n $implicit: number;\n /** The height of the placeholder in pixels (explicit property) */\n height: number;\n}\n\n/**\n * A placeholder component that indicates where a dropped item will be inserted.\n *\n * By default, renders as empty/transparent space. Pass a custom template\n * to customize the placeholder appearance.\n *\n * @example\n * ```html\n * <!-- Default: transparent/empty space -->\n * <vdnd-placeholder [height]=\"50\"></vdnd-placeholder>\n *\n * <!-- Custom template with dashed border -->\n * <vdnd-placeholder [height]=\"50\" [template]=\"customPlaceholder\">\n * <ng-template #customPlaceholder let-height>\n * <div class=\"my-placeholder\" [style.height.px]=\"height\">\n * Drop here\n * </div>\n * </ng-template>\n * </vdnd-placeholder>\n * ```\n */\n@Component({\n selector: 'vdnd-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n host: {\n class: 'vdnd-placeholder',\n '[style.height.px]': 'height()',\n '[attr.data-draggable-id]': '\"placeholder\"',\n },\n template: `\n @if (template()) {\n <ng-container\n *ngTemplateOutlet=\"template()!; context: { $implicit: height(), height: height() }\"\n >\n </ng-container>\n }\n `,\n styles: `\n :host {\n display: block;\n box-sizing: border-box;\n }\n `,\n})\nexport class PlaceholderComponent {\n /** Height of the placeholder in pixels */\n height = input<number>(50);\n\n /** Optional custom template for the placeholder content */\n template = input<TemplateRef<PlaceholderContext>>();\n}\n","import { Directive, InjectionToken, input, Signal } from '@angular/core';\n\n/**\n * Token for injecting the group context from a parent directive.\n * Allows child draggables and droppables to inherit the group name automatically.\n */\nexport const VDND_GROUP_TOKEN = new InjectionToken<VdndGroupContext>('VDND_GROUP_TOKEN');\n\n/**\n * Context provided by the group directive to its children.\n */\nexport interface VdndGroupContext {\n /** The group name signal */\n readonly group: Signal<string>;\n}\n\n/**\n * Provides a group context to child draggable and droppable directives.\n * When applied to a parent element, child directives can inherit the group name\n * automatically without needing to specify it on each element.\n *\n * @example\n * ```html\n * <!-- Without group directive (verbose) -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" vdndDraggableGroup=\"my-group\">Item 1</div>\n * <div vdndDraggable=\"item-2\" vdndDraggableGroup=\"my-group\">Item 2</div>\n * </div>\n *\n * <!-- With group directive (concise) -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\">\n * <div vdndDraggable=\"item-1\">Item 1</div>\n * <div vdndDraggable=\"item-2\">Item 2</div>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndGroup]',\n providers: [\n {\n provide: VDND_GROUP_TOKEN,\n useExisting: DroppableGroupDirective,\n },\n ],\n})\nexport class DroppableGroupDirective implements VdndGroupContext {\n /** The group name that will be inherited by child directives */\n readonly group = input.required<string>({ alias: 'vdndGroup' });\n}\n","import { computed, isDevMode, type Signal } from '@angular/core';\nimport type { VdndGroupContext } from '../directives/droppable-group.directive';\n\n/**\n * Configuration options for creating an effective group signal.\n */\nexport interface GroupResolutionOptions {\n /** The explicit group input signal */\n explicitGroup: Signal<string | undefined>;\n /** The parent group context injected via VDND_GROUP_TOKEN (may be null) */\n parentGroup: VdndGroupContext | null;\n /** The element ID signal for warning messages */\n elementId: Signal<string>;\n /** The type of element ('draggable' or 'droppable') for warning messages */\n elementType: 'draggable' | 'droppable';\n}\n\n/**\n * State tracker for group resolution to avoid repeated warnings.\n */\ninterface GroupResolutionState {\n hasWarnedMissingGroup: boolean;\n}\n\n/**\n * Creates a computed signal that resolves the effective group name for a draggable or droppable.\n *\n * Resolution order:\n * 1. Explicit group input (vdndDraggableGroup or vdndDroppableGroup)\n * 2. Inherited group from parent vdndGroup directive\n * 3. null (with dev-mode warning)\n *\n * @example\n * ```typescript\n * readonly #effectiveGroup = createEffectiveGroupSignal({\n * explicitGroup: this.vdndDraggableGroup,\n * parentGroup: this.#parentGroup,\n * elementId: this.vdndDraggable,\n * elementType: 'draggable',\n * });\n * ```\n */\nexport function createEffectiveGroupSignal(options: GroupResolutionOptions): Signal<string | null> {\n const { explicitGroup, parentGroup, elementId, elementType } = options;\n\n // State object to track whether we've warned (mutable closure state)\n const state: GroupResolutionState = { hasWarnedMissingGroup: false };\n\n return computed((): string | null => {\n const explicit = explicitGroup();\n if (explicit) return explicit;\n\n const inherited = parentGroup?.group();\n if (inherited) return inherited;\n\n if (isDevMode() && !state.hasWarnedMissingGroup) {\n const directive = elementType === 'draggable' ? 'vdndDraggable' : 'vdndDroppable';\n const groupInput = elementType === 'draggable' ? 'vdndDraggableGroup' : 'vdndDroppableGroup';\n const action = elementType === 'draggable' ? 'Drag' : 'Dropping';\n\n console.warn(\n `[ngx-virtual-dnd] [${directive}=\"${elementId()}\"] requires a group. ` +\n `Either set ${groupInput} or wrap in a vdndGroup directive. ` +\n `${action} will be disabled for this element.`,\n );\n state.hasWarnedMissingGroup = true;\n }\n\n return null;\n });\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport { DragState, DropEvent, END_OF_LIST } from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\nimport { createEffectiveGroupSignal } from '../utils/group-resolution';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\nimport { queryByAttribute } from '../utils/attribute-selectors';\n\n/**\n * Marks an element as a valid drop target within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDroppable=\"list-1\"\n * vdndDroppableGroup=\"my-group\"\n * (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\" (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDroppable]',\n host: {\n '[attr.data-droppable-id]': 'vdndDroppable()',\n '[attr.data-droppable-group]': 'effectiveGroup()',\n '[attr.data-constrain-to-container]': 'constrainToContainer() || null',\n '[attr.aria-dropeffect]': '\"move\"',\n '[class.vdnd-droppable]': 'true',\n '[class.vdnd-droppable-active]': 'isActive()',\n '[class.vdnd-droppable-disabled]': 'disabled()',\n },\n})\nexport class DroppableDirective implements OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this droppable */\n vdndDroppable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDroppableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables dropping) if neither is available.\n */\n readonly effectiveGroup = createEffectiveGroupSignal({\n explicitGroup: this.vdndDroppableGroup,\n parentGroup: this.#parentGroup,\n elementId: this.vdndDroppable,\n elementType: 'droppable',\n });\n\n /** Optional data associated with this droppable */\n vdndDroppableData = input<unknown>();\n\n /** Whether this droppable is disabled */\n disabled = input<boolean>(false);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Constrain drag preview and placeholder to container boundaries */\n constrainToContainer = input<boolean>(false);\n\n /** Emits when an item is dropped on this droppable */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n\n /** Whether this droppable is currently being targeted */\n readonly isActive = computed(() => {\n const activeId = this.#dragState.activeDroppableId();\n return activeId === this.vdndDroppable() && !this.disabled();\n });\n\n /** The current placeholder ID when this droppable is active */\n readonly placeholderId = computed(() => {\n if (!this.isActive()) {\n return null;\n }\n return this.#dragState.placeholderId();\n });\n\n /** Track previous active state for cache clearing on leave */\n #wasActive = false;\n\n /** Cached state for handling drop (since state is cleared before effect fires) */\n #cachedDragState: DragState | null = null;\n\n /**\n * Check if this element is actually scrollable.\n */\n #isScrollable(): boolean {\n const el = this.#elementRef.nativeElement;\n const style = window.getComputedStyle(el);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n\n // Check if overflow allows scrolling\n const hasScrollableOverflow =\n overflowY === 'auto' ||\n overflowY === 'scroll' ||\n overflowX === 'auto' ||\n overflowX === 'scroll';\n\n if (!hasScrollableOverflow) {\n return false;\n }\n\n // Check if content is larger than container\n return el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth;\n }\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScroll,\n getElement: () => this.#elementRef.nativeElement,\n getId: () => this.vdndDroppable(),\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n canRegister: () => Boolean(this.effectiveGroup()) && this.#isScrollable(),\n });\n\n // React to state changes and handle drop events\n effect(() => {\n const active = this.isActive();\n const draggedItem = this.#dragState.draggedItem();\n const isDragging = this.#dragState.isDragging();\n\n // Cache state while active for use during drop handling\n if (active && isDragging && draggedItem) {\n this.#cachedDragState = this.#dragState.getStateSnapshot();\n }\n\n // Handle drag end (drop)\n if (!isDragging && this.#wasActive && draggedItem === null) {\n // Check if drag was cancelled (e.g., Escape key)\n if (!this.#dragState.wasCancelled()) {\n // Drag ended normally - this is a drop\n this.#handleDrop();\n }\n this.#cachedDragState = null;\n }\n\n // Clear cached state when leaving without dropping\n if (!active && this.#wasActive && isDragging) {\n this.#cachedDragState = null;\n }\n\n this.#wasActive = active;\n });\n }\n\n ngOnDestroy(): void {\n // Clean up if this droppable is destroyed while being active\n if (this.isActive()) {\n this.#dragState.setActiveDroppable(null);\n }\n\n // Unregister from auto-scroll\n this.#autoScroll.unregisterContainer(this.vdndDroppable());\n }\n\n /**\n * Handle a drop on this droppable.\n */\n #handleDrop(): void {\n // Use cached state since the actual state is cleared before this effect fires\n const state = this.#cachedDragState;\n\n if (!state?.draggedItem || state.activeDroppableId !== this.vdndDroppable()) {\n return;\n }\n\n const sourceDroppableId = state.sourceDroppableId ?? '';\n const placeholderId = state.placeholderId ?? END_OF_LIST;\n\n // Use the stored source index from drag state\n // This is critical for virtual scrolling where the original element may no longer\n // be in the DOM after autoscroll (it gets virtualized out of view)\n const sourceIndex =\n state.sourceIndex ?? this.#getItemIndex(state.draggedItem.draggableId, sourceDroppableId);\n\n // Use the pre-calculated placeholderIndex if available (more reliable)\n // Fall back to DOM-based calculation if not\n let destinationIndex =\n state.placeholderIndex !== null && state.placeholderIndex !== undefined\n ? state.placeholderIndex\n : this.#getDestinationIndex(placeholderId);\n\n // Adjust for same-list reordering: if moving within the same list and\n // the destination is after the source, we need to account for the item\n // being removed from its original position\n if (sourceDroppableId === this.vdndDroppable() && sourceIndex < destinationIndex) {\n destinationIndex--;\n }\n\n this.drop.emit({\n source: {\n draggableId: state.draggedItem.draggableId,\n droppableId: sourceDroppableId,\n index: sourceIndex,\n data: state.draggedItem.data,\n },\n destination: {\n droppableId: this.vdndDroppable(),\n placeholderId,\n index: destinationIndex,\n data: this.vdndDroppableData(),\n },\n });\n }\n\n /**\n * Get the index of an item in a droppable.\n * This is a simplified implementation - in practice, the consumer would track this.\n */\n #getItemIndex(draggableId: string, droppableId: string): number {\n // Find all draggables in the source droppable\n const droppable = queryByAttribute<HTMLElement>(document, 'data-droppable-id', droppableId);\n if (!droppable) {\n return 0;\n }\n\n const draggables = droppable.querySelectorAll('[data-draggable-id]');\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === draggableId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the destination index based on the placeholder.\n */\n #getDestinationIndex(placeholderId: string): number {\n // Exclude placeholder elements from the count\n const draggables = this.#elementRef.nativeElement.querySelectorAll(\n '[data-draggable-id]:not([data-draggable-id=\"placeholder\"])',\n );\n\n if (placeholderId === END_OF_LIST) {\n return draggables.length;\n }\n\n // Find the index of the placeholder item\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === placeholderId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the element reference (for external use).\n */\n getElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Manually scroll this droppable.\n */\n scrollBy(delta: number): void {\n this.#elementRef.nativeElement.scrollTop += delta;\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#elementRef.nativeElement.scrollTop;\n }\n\n /**\n * Get the scroll height.\n */\n getScrollHeight(): number {\n return this.#elementRef.nativeElement.scrollHeight;\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output, TemplateRef } from '@angular/core';\nimport {\n VirtualScrollContainerComponent,\n VirtualScrollItemContext,\n} from './virtual-scroll-container.component';\nimport { DroppableDirective } from '../directives/droppable.directive';\nimport { AutoScrollConfig } from '../services/auto-scroll.service';\nimport { DropEvent } from '../models/drag-drop.models';\n\n/**\n * A high-level component that combines droppable, virtual scroll, and placeholder\n * functionality into a single, easy-to-use component.\n *\n * This component significantly reduces boilerplate by automatically handling:\n * - Placeholder insertion at the correct position\n * - Sticky item management for the dragged item\n * - Virtual scrolling with proper drag-and-drop integration\n * - Droppable container setup\n *\n * @example\n * ```html\n * <!-- Before (verbose): ~45 lines of boilerplate -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"demo\" (drop)=\"onDrop($event)\">\n * <vdnd-virtual-scroll\n * [items]=\"itemsWithPlaceholder()\"\n * [itemHeight]=\"50\"\n * [stickyItemIds]=\"stickyIds()\"\n * [itemIdFn]=\"getItemId\"\n * [trackByFn]=\"trackById\"\n * [itemTemplate]=\"itemTpl\">\n * </vdnd-virtual-scroll>\n * </div>\n *\n * <!-- After (concise): ~8 lines -->\n * <div vdndGroup=\"demo\">\n * <vdnd-sortable-list\n * droppableId=\"list-1\"\n * [items]=\"list()\"\n * [itemHeight]=\"50\"\n * [itemIdFn]=\"getItemId\"\n * [itemTemplate]=\"itemTpl\"\n * (drop)=\"onDrop($event)\">\n * </vdnd-sortable-list>\n * </div>\n * ```\n */\n@Component({\n selector: 'vdnd-sortable-list',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [VirtualScrollContainerComponent, DroppableDirective],\n host: {\n class: 'vdnd-sortable-list',\n },\n template: `\n <div\n class=\"vdnd-sortable-list-droppable\"\n [vdndDroppable]=\"droppableId()\"\n [vdndDroppableGroup]=\"group()\"\n [vdndDroppableData]=\"droppableData()\"\n [disabled]=\"disabled()\"\n [constrainToContainer]=\"constrainToContainer()\"\n (drop)=\"drop.emit($event)\"\n >\n <vdnd-virtual-scroll\n [items]=\"items()\"\n [itemHeight]=\"itemHeight()\"\n [dynamicItemHeight]=\"dynamicItemHeight()\"\n [itemIdFn]=\"itemIdFn()\"\n [trackByFn]=\"trackByFn()\"\n [itemTemplate]=\"itemTemplate()\"\n [droppableId]=\"droppableId()\"\n [autoStickyDraggedItem]=\"true\"\n [containerHeight]=\"containerHeight()\"\n [overscan]=\"overscan()\"\n [autoScrollEnabled]=\"autoScrollEnabled()\"\n [autoScrollConfig]=\"autoScrollConfig()\"\n >\n </vdnd-virtual-scroll>\n </div>\n `,\n styles: `\n :host {\n display: block;\n }\n `,\n})\nexport class VirtualSortableListComponent<T> {\n // ========== Required Inputs ==========\n\n /** Unique identifier for this droppable list */\n droppableId = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n group = input<string>();\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /** Template for rendering each item */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n // ========== Optional Inputs ==========\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /** Optional data associated with this droppable */\n droppableData = input<unknown>();\n\n /** Whether this sortable list is disabled */\n disabled = input<boolean>(false);\n\n /**\n * Height of the container in pixels.\n * If not provided, uses CSS-based height detection.\n */\n containerHeight = input<number>();\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Constrain drag preview and placeholder to container boundaries */\n constrainToContainer = input<boolean>(false);\n\n // ========== Outputs ==========\n\n /** Emits when an item is dropped on this list */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\n\n/**\n * A virtual viewport component that provides efficient wrapper-based positioning\n * for virtual scrolling. This component acts as the scroll container and provides\n * a content wrapper with GPU-accelerated transform positioning.\n *\n * Use this component when you need virtual scrolling with optimal performance.\n * Items rendered inside via `*vdndVirtualFor` will be positioned using a single\n * transform on the wrapper, rather than individual absolute positioning.\n *\n * @example\n * Basic usage:\n * ```html\n * <vdnd-virtual-viewport [itemHeight]=\"50\" style=\"height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n *\n * @example\n * With dynamic item heights:\n * ```html\n * <vdnd-virtual-viewport\n * [itemHeight]=\"50\"\n * [dynamicItemHeight]=\"true\"\n * style=\"height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-viewport',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualViewportComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualViewportComponent },\n ],\n host: {\n class: 'vdnd-virtual-viewport',\n },\n styles: `\n :host {\n display: block;\n overflow: auto;\n position: relative;\n /* Disable browser scroll anchoring to prevent scroll position adjustments\n when DOM changes (e.g., placeholder position updates during drag) */\n overflow-anchor: none;\n }\n\n .vdnd-viewport-spacer {\n position: absolute;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-viewport-content {\n position: absolute;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n template: `\n <!-- Spacer maintains total scroll height -->\n <div\n class=\"vdnd-viewport-spacer\"\n [style.top.px]=\"contentOffset()\"\n [style.height.px]=\"totalHeight()\"\n ></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div\n class=\"vdnd-viewport-content\"\n [style.top.px]=\"contentOffset()\"\n [style.transform]=\"contentTransform()\"\n >\n <ng-content></ng-content>\n </div>\n `,\n})\nexport class VirtualViewportComponent\n implements VdndVirtualViewport, VdndScrollContainer, OnInit, OnDestroy\n{\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-viewport-${Math.random().toString(36).slice(2, 9)}`;\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n /** Offset for content below headers (in pixels) */\n contentOffset = input<number>(0);\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== Strategy ==========\n\n /** The virtual scroll strategy, created based on dynamicItemHeight input */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n const height = this.itemHeight();\n return this.dynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n get strategy(): VirtualScrollStrategy {\n return this.#strategy();\n }\n\n // ========== Computed Values ==========\n\n /** Total height of all items (for scroll height), derived from strategy item count */\n readonly totalHeight = computed(() => {\n const s = this.#strategy();\n s.version();\n return s.getTotalHeight(s.getItemCount());\n });\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const s = this.#strategy();\n s.version();\n const offset = s.getOffsetForIndex(startIndex);\n return `translateY(${offset}px)`;\n });\n\n // ========== VdndVirtualViewport Implementation ==========\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n getOffsetForIndex(index: number): number {\n return this.#strategy().getOffsetForIndex(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScrollService,\n getElement: () => this.nativeElement,\n getId: () => this.scrollContainerId() ?? this.#generatedScrollId,\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n });\n }\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\n/**\n * Marks an element as the header content for a `vdnd-virtual-content` component.\n *\n * Place this directive on a projected element inside `<vdnd-virtual-content>`.\n * The component will automatically measure the header's height via ResizeObserver\n * and use it as the content offset for virtual scroll calculations.\n *\n * This eliminates the need for manual ResizeObserver boilerplate that was\n * previously required with the `[contentOffset]` input.\n *\n * @example\n * ```html\n * <vdnd-virtual-content [itemHeight]=\"50\">\n * <div class=\"page-header\" vdndContentHeader>\n * <h1>My List</h1>\n * </div>\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n * ```\n */\n@Directive({\n selector: '[vdndContentHeader]',\n})\nexport class ContentHeaderDirective {\n readonly elementRef = inject(ElementRef<HTMLElement>);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n inject,\n input,\n NgZone,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\nimport { ContentHeaderDirective } from '../directives/content-header.directive';\n\n/**\n * A virtual content component that provides wrapper-based positioning\n * for virtual scrolling within an EXTERNAL scroll container.\n *\n * Use this component when you need virtual scrolling alongside other content\n * (headers, footers) within a shared scroll container. The component provides\n * a content wrapper with GPU-accelerated transform positioning while delegating\n * scroll handling to the parent `vdndScrollable` container.\n *\n * Headers marked with `vdndContentHeader` are automatically measured via\n * ResizeObserver — no manual offset calculation needed.\n *\n * @example\n * Content projection with auto-measured header:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 100vh;\">\n * <vdnd-virtual-content [itemHeight]=\"50\">\n * <div class=\"header\" vdndContentHeader>Welcome!</div>\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n * </div>\n * ```\n *\n * @example\n * Manual offset (escape hatch):\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 100vh;\">\n * <div class=\"header\" #header>Welcome!</div>\n * <vdnd-virtual-content [itemHeight]=\"50\" [contentOffset]=\"header.offsetHeight\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n * </div>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-content',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualContentComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualContentComponent },\n ],\n host: {\n class: 'vdnd-virtual-content',\n '[attr.data-content-offset]': 'effectiveContentOffset()',\n '[attr.data-item-height]': 'itemHeight()',\n '[attr.data-total-items]': 'totalItems()',\n },\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n .vdnd-virtual-area {\n position: relative;\n }\n\n .vdnd-content-spacer {\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-content-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n template: `\n <!-- Projected header — in normal document flow, auto-measured via ResizeObserver -->\n <ng-content select=\"[vdndContentHeader]\" />\n\n <!-- Virtual area — sized to totalHeight, contains absolute-positioned spacer + wrapper -->\n <div class=\"vdnd-virtual-area\" [style.height.px]=\"totalHeight()\">\n <!-- Spacer maintains scroll height for the virtual list portion -->\n <div class=\"vdnd-content-spacer\" [style.height.px]=\"totalHeight()\"></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div class=\"vdnd-content-wrapper\" [style.transform]=\"contentTransform()\">\n <ng-content />\n </div>\n </div>\n `,\n})\nexport class VirtualContentComponent implements VdndVirtualViewport, VdndScrollContainer {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n\n /**\n * The parent scroll container injected via skip-self to get the actual scrollable element.\n * We provide our own VDND_SCROLL_CONTAINER with adjusted values to children.\n */\n readonly #parentScrollContainer = inject(VDND_SCROLL_CONTAINER, { skipSelf: true });\n\n // ========== Content Queries ==========\n\n /** Projected header directive (if any) */\n private readonly headerDirective = contentChild(ContentHeaderDirective);\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Offset for content above the virtual list (e.g., header height).\n * When a `vdndContentHeader` is projected, this input is ignored —\n * the offset is auto-measured via ResizeObserver.\n * Use this input only when the header lives outside the component.\n */\n contentOffset = input<number>(0);\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n // ========== Internal State ==========\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n /** Auto-measured header height from ResizeObserver */\n readonly #measuredHeaderHeight = signal(0);\n\n // ========== Strategy ==========\n\n /** The virtual scroll strategy, created based on dynamicItemHeight input */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n const height = this.itemHeight();\n return this.dynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n get strategy(): VirtualScrollStrategy {\n return this.#strategy();\n }\n\n // ========== Computed Values ==========\n\n /** Total item count, derived from strategy (populated by VirtualForDirective) */\n readonly totalItems = computed(() => {\n const s = this.#strategy();\n s.version();\n return s.getItemCount();\n });\n\n /** Total height of all items (for scroll height) */\n readonly totalHeight = computed(() => {\n const s = this.#strategy();\n s.version();\n return s.getTotalHeight(s.getItemCount());\n });\n\n /**\n * Effective content offset: when a `vdndContentHeader` directive is projected,\n * returns the auto-measured header height. Otherwise falls back to the\n * `contentOffset` input for backward compatibility.\n */\n readonly effectiveContentOffset = computed(() => {\n const header = this.headerDirective();\n return header ? this.#measuredHeaderHeight() : this.contentOffset();\n });\n\n /**\n * Adjusted scroll position - subtracts the content offset so the virtual scroll\n * calculates visible items correctly relative to where the list starts.\n */\n readonly #adjustedScrollTop = computed(() => {\n return Math.max(0, this.#parentScrollContainer.scrollTop() - this.effectiveContentOffset());\n });\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const s = this.#strategy();\n s.version();\n const offset = s.getOffsetForIndex(startIndex);\n return `translateY(${offset}px)`;\n });\n\n constructor() {\n this.#setupHeaderMeasurement();\n }\n\n // ========== VdndVirtualViewport Implementation ==========\n\n /** Adjusted scroll position relative to the virtual list start */\n scrollTop(): number {\n return this.#adjustedScrollTop();\n }\n\n containerHeight(): number {\n return this.#parentScrollContainer.containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n getOffsetForIndex(index: number): number {\n return this.#strategy().getOffsetForIndex(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n /**\n * Scroll to a specific position, adjusting for content offset.\n */\n scrollTo(options: ScrollToOptions): void {\n const adjustedOptions = { ...options };\n if (adjustedOptions.top !== undefined) {\n // Add offset back when scrolling to ensure correct position\n adjustedOptions.top += this.effectiveContentOffset();\n }\n this.#parentScrollContainer.scrollTo(adjustedOptions);\n }\n\n // ========== Private Methods ==========\n\n /**\n * Sets up an effect that observes the projected header directive's element\n * with a ResizeObserver, keeping `#measuredHeaderHeight` in sync.\n */\n #setupHeaderMeasurement(): void {\n effect((onCleanup) => {\n const dir = this.headerDirective();\n if (!dir) {\n this.#measuredHeaderHeight.set(0);\n return;\n }\n\n const el = dir.elementRef.nativeElement;\n this.#measuredHeaderHeight.set(el.offsetHeight);\n\n let observer: ResizeObserver | null = null;\n this.#ngZone.runOutsideAngular(() => {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const height =\n entry.borderBoxSize?.[0]?.blockSize ?? (entry.target as HTMLElement).offsetHeight;\n this.#measuredHeaderHeight.set(height);\n }\n });\n observer.observe(el, { box: 'border-box' });\n });\n\n onCleanup(() => observer?.disconnect());\n });\n }\n}\n","import { afterNextRender, EnvironmentInjector, NgZone } from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { KeyboardDragService } from '../services/keyboard-drag.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { ElementCloneService } from '../services/element-clone.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\nimport { DragEndEvent, DragStartEvent } from '../models/drag-drop.models';\nimport { queryByAttribute } from '../utils/attribute-selectors';\n\n/**\n * Context from the directive needed for keyboard drag operations.\n */\nexport interface KeyboardDragContext {\n element: HTMLElement;\n draggableId: string;\n groupName: string | null;\n data: unknown;\n}\n\n/**\n * Callbacks from the handler back into the directive for events.\n */\nexport interface KeyboardDragCallbacks {\n onDragStart: (event: DragStartEvent) => void;\n onDragEnd: (event: DragEndEvent) => void;\n getParentDroppableId: () => string | null;\n calculateSourceIndex: (element: HTMLElement, droppableElement: HTMLElement | null) => number;\n}\n\n/**\n * Dependencies injected from the directive (non-injectable handler).\n */\nexport interface KeyboardDragDeps {\n dragState: DragStateService;\n keyboardDrag: KeyboardDragService;\n positionCalculator: PositionCalculatorService;\n dragIndexCalculator: DragIndexCalculatorService;\n elementClone: ElementCloneService;\n overlayContainer: OverlayContainerService;\n ngZone: NgZone;\n envInjector: EnvironmentInjector;\n callbacks: KeyboardDragCallbacks;\n getContext: () => KeyboardDragContext;\n}\n\n/**\n * Handles keyboard-initiated drag operations (Space to start, arrows to move, Space/Enter to drop).\n *\n * Extracted from DraggableDirective to encapsulate:\n * - Starting/completing/cancelling keyboard drags\n * - Document-level keyboard listener during active drag\n * - Focus restoration after drag ends\n * - Cross-list movement via arrow keys\n *\n * Provides a unified `handleKey()` method that eliminates the duplicated\n * key→action dispatch that previously existed in both host bindings and\n * a document-level listener.\n */\nexport class KeyboardDragHandler {\n readonly #deps: KeyboardDragDeps;\n #boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n constructor(deps: KeyboardDragDeps) {\n this.#deps = deps;\n this.#boundKeyDown = this.#onDocumentKeyDown.bind(this);\n }\n\n /**\n * Whether a keyboard drag is currently active.\n */\n isActive(): boolean {\n return this.#deps.keyboardDrag.isActive();\n }\n\n /**\n * Start a keyboard drag operation.\n */\n activate(): void {\n const ctx = this.#deps.getContext();\n if (!ctx.groupName) {\n return;\n }\n\n const element = ctx.element;\n const rect = element.getBoundingClientRect();\n\n // Find the parent droppable\n const droppableElement = this.#deps.positionCalculator.getDroppableParent(\n element,\n ctx.groupName,\n );\n if (!droppableElement) {\n return;\n }\n\n const droppableId = this.#deps.positionCalculator.getDroppableId(droppableElement);\n if (!droppableId) {\n return;\n }\n\n // Calculate source index\n const sourceIndex = this.#deps.callbacks.calculateSourceIndex(element, droppableElement);\n\n // Get total item count from the droppable\n const totalItemCount = this.#deps.dragIndexCalculator.getTotalItemCount({\n droppableElement,\n isSameList: false,\n draggedItemHeight: rect.height,\n });\n\n // Clone element BEFORE updating drag state.\n // Template-first: skip the clone when a template-based preview is mounted.\n const clonedElement = this.#deps.overlayContainer.hasTemplatePreview()\n ? undefined\n : this.#deps.elementClone.cloneElement(element);\n\n // Start keyboard drag\n this.#deps.keyboardDrag.startKeyboardDrag(\n {\n draggableId: ctx.draggableId,\n droppableId,\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: ctx.data,\n },\n sourceIndex,\n totalItemCount,\n droppableId,\n );\n\n // Add document-level keyboard listener (since element is hidden with display:none)\n this.#deps.ngZone.runOutsideAngular(() => {\n document.addEventListener('keydown', this.#boundKeyDown!);\n });\n\n // Emit drag start event\n this.#deps.callbacks.onDragStart({\n draggableId: ctx.draggableId,\n droppableId,\n data: ctx.data,\n position: { x: rect.left, y: rect.top },\n sourceIndex,\n });\n }\n\n /**\n * Unified key dispatch. Returns true if the key was handled.\n * Used by both host bindings and the document-level listener.\n */\n handleKey(event: KeyboardEvent): boolean {\n if (!this.isActive()) {\n return false;\n }\n\n switch (event.key) {\n case ' ': // Space\n case 'Enter':\n event.preventDefault();\n this.complete();\n return true;\n case 'Escape':\n case 'Tab':\n event.preventDefault();\n this.cancel();\n return true;\n case 'ArrowUp':\n event.preventDefault();\n this.#deps.keyboardDrag.moveUp();\n return true;\n case 'ArrowDown':\n event.preventDefault();\n this.#deps.keyboardDrag.moveDown();\n return true;\n case 'ArrowLeft':\n event.preventDefault();\n this.#moveToAdjacentDroppable('left');\n return true;\n case 'ArrowRight':\n event.preventDefault();\n this.#moveToAdjacentDroppable('right');\n return true;\n default:\n return false;\n }\n }\n\n /**\n * Complete a keyboard drag operation (drop the item).\n */\n complete(): void {\n const ctx = this.#deps.getContext();\n const sourceIndex = this.#deps.dragState.sourceIndex() ?? 0;\n const destinationIndex = this.#deps.dragState.placeholderIndex();\n\n // Remove document listener\n this.#cleanupDocumentListener();\n\n // Clear droppable metadata cache from this drag session\n this.#deps.dragIndexCalculator.clearCache();\n\n // Emit drag end event\n this.#deps.callbacks.onDragEnd({\n draggableId: ctx.draggableId,\n droppableId: this.#deps.callbacks.getParentDroppableId() ?? '',\n cancelled: false,\n data: ctx.data,\n sourceIndex,\n destinationIndex,\n });\n\n this.#deps.keyboardDrag.completeKeyboardDrag();\n\n // Restore focus to the moved element after state updates\n this.#restoreFocus(ctx.draggableId);\n }\n\n /**\n * Cancel a keyboard drag operation.\n */\n cancel(): void {\n const ctx = this.#deps.getContext();\n const sourceIndex = this.#deps.dragState.sourceIndex() ?? 0;\n\n // Remove document listener\n this.#cleanupDocumentListener();\n\n // Clear droppable metadata cache from this drag session\n this.#deps.dragIndexCalculator.clearCache();\n\n // Emit drag end event\n this.#deps.callbacks.onDragEnd({\n draggableId: ctx.draggableId,\n droppableId: this.#deps.callbacks.getParentDroppableId() ?? '',\n cancelled: true,\n data: ctx.data,\n sourceIndex,\n destinationIndex: null,\n });\n\n this.#deps.keyboardDrag.cancelKeyboardDrag();\n\n // Restore focus to the original element after state updates\n this.#restoreFocus(ctx.draggableId);\n }\n\n /**\n * Teardown — remove any active document listener.\n */\n destroy(): void {\n this.#cleanupDocumentListener();\n }\n\n /**\n * Restore focus to the dragged element after keyboard drag ends.\n * Uses afterNextRender to ensure Angular has finished updating the DOM\n * (element is no longer hidden after isDragging() becomes false).\n *\n * Uses EnvironmentInjector to ensure callback runs even if the directive\n * is destroyed during cross-list moves.\n */\n #restoreFocus(draggableId: string): void {\n // Capture the destination droppable BEFORE scheduling afterNextRender\n // (the directive may be destroyed during cross-list moves)\n const destinationDroppableId = this.#deps.dragState.activeDroppableId();\n\n afterNextRender(\n () => {\n const element = queryByAttribute<HTMLElement>(document, 'data-draggable-id', draggableId);\n\n if (element) {\n element.focus();\n } else if (destinationDroppableId) {\n // Fallback: focus the first draggable in the destination container\n const destination = queryByAttribute<HTMLElement>(\n document,\n 'data-droppable-id',\n destinationDroppableId,\n );\n const firstDraggable = destination?.querySelector<HTMLElement>('[data-draggable-id]');\n firstDraggable?.focus();\n }\n },\n { injector: this.#deps.envInjector },\n );\n }\n\n /**\n * Move to an adjacent droppable in the specified direction.\n */\n #moveToAdjacentDroppable(direction: 'left' | 'right'): void {\n const currentDroppableId = this.#deps.dragState.activeDroppableId();\n if (!currentDroppableId) {\n return;\n }\n\n const groupName = this.#deps.getContext().groupName;\n if (!groupName) {\n return;\n }\n const adjacent = this.#deps.positionCalculator.findAdjacentDroppable(\n currentDroppableId,\n direction,\n groupName,\n );\n\n if (!adjacent) {\n return;\n }\n\n // Maintain the current target index (clamped to the new list's size)\n const currentTargetIndex = this.#deps.keyboardDrag.targetIndex() ?? 0;\n const targetIndex = Math.min(currentTargetIndex, adjacent.itemCount);\n\n this.#deps.keyboardDrag.moveToDroppable(adjacent.id, targetIndex, adjacent.itemCount);\n }\n\n /**\n * Document-level keydown listener active during keyboard drag.\n */\n #onDocumentKeyDown(event: KeyboardEvent): void {\n this.handleKey(event);\n }\n\n /**\n * Remove the document-level keyboard listener.\n */\n #cleanupDocumentListener(): void {\n if (this.#boundKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyDown);\n }\n }\n}\n","import { NgZone } from '@angular/core';\nimport { CursorPosition } from '../models/drag-drop.models';\n\n/**\n * Callbacks from the handler back into the directive for drag lifecycle.\n */\nexport interface PointerDragCallbacks {\n onDragStart: (position: CursorPosition) => void;\n onDragMove: (position: CursorPosition) => void;\n onDragEnd: (cancelled: boolean) => void;\n onPendingChange: (pending: boolean) => void;\n isDragging: () => boolean;\n}\n\n/**\n * Context from the directive needed for pointer drag operations.\n */\nexport interface PointerDragContext {\n element: HTMLElement;\n groupName: string | null;\n disabled: boolean;\n dragHandle: string | undefined;\n dragThreshold: number;\n dragDelay: number;\n}\n\n/**\n * Dependencies injected from the directive (non-injectable handler).\n */\nexport interface PointerDragDeps {\n ngZone: NgZone;\n callbacks: PointerDragCallbacks;\n getContext: () => PointerDragContext;\n}\n\n/**\n * Handles pointer-based (mouse + touch) drag operations.\n *\n * Extracted from DraggableDirective to encapsulate:\n * - Pointer down / move / up lifecycle\n * - Drag threshold detection\n * - Drag delay timer\n * - RAF throttling for move updates\n * - Document-level listener management\n * - Escape key cancellation during pointer drag\n */\nexport class PointerDragHandler {\n readonly #deps: PointerDragDeps;\n\n /** Starting position of the drag */\n #startPosition: CursorPosition | null = null;\n\n /** Whether we're currently tracking a potential drag */\n #isTracking = false;\n\n /** Bound event handlers for cleanup */\n #boundPointerMove: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundPointerUp: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n /** Timer ID for drag delay */\n #delayTimerId: ReturnType<typeof setTimeout> | null = null;\n\n /** Whether the delay has been satisfied (user held long enough) */\n #delayReady = false;\n\n constructor(deps: PointerDragDeps) {\n this.#deps = deps;\n this.#boundPointerMove = this.#onPointerMove.bind(this);\n this.#boundPointerUp = this.#onPointerUp.bind(this);\n this.#boundKeyDown = this.#onEscapeKeyDown.bind(this);\n }\n\n /**\n * The position where the user initially pressed down.\n * Used by the directive to calculate grab offset when starting drag.\n */\n getStartPosition(): CursorPosition | null {\n return this.#startPosition;\n }\n\n /**\n * Handle pointer down (mouse or touch).\n * Called from the directive's host binding.\n */\n onPointerDown(event: MouseEvent | TouchEvent, isTouch: boolean): void {\n const ctx = this.#deps.getContext();\n\n if (ctx.disabled) {\n return;\n }\n\n // Without a group, this draggable can't participate in DnD (fail gracefully).\n if (!ctx.groupName) {\n return;\n }\n\n // Check for left mouse button only\n if (!isTouch && (event as MouseEvent).button !== 0) {\n return;\n }\n\n // Check if click is on drag handle (if specified)\n if (ctx.dragHandle) {\n const target = event.target as HTMLElement;\n if (!target.closest(ctx.dragHandle)) {\n return;\n }\n }\n\n // Check for elements that should not trigger drag\n const target = event.target as HTMLElement;\n if (\n target.closest('button, input, textarea, select, [contenteditable]') ||\n target.classList.contains('no-drag')\n ) {\n return;\n }\n\n const delay = ctx.dragDelay;\n\n // For touch events with a delay configured, DON'T call preventDefault() on touchstart.\n // This allows native scrolling to work if the user swipes before the delay fires.\n // For mouse events or touch without delay, prevent default immediately to avoid\n // text selection and other default behaviors.\n if (!isTouch || delay === 0) {\n event.preventDefault();\n }\n event.stopPropagation();\n\n this.#isTracking = true;\n this.#startPosition = PointerDragHandler.#getPosition(event);\n\n // Handle drag delay\n if (delay > 0) {\n this.#delayReady = false;\n this.#delayTimerId = setTimeout(() => {\n this.#delayReady = true;\n this.#deps.callbacks.onPendingChange(true); // Emit ready state when delay passes\n this.#delayTimerId = null;\n }, delay);\n } else {\n this.#delayReady = true;\n }\n\n // Add document-level event listeners\n this.#deps.ngZone.runOutsideAngular(() => {\n if (isTouch) {\n document.addEventListener('touchmove', this.#boundPointerMove!, { passive: false });\n document.addEventListener('touchend', this.#boundPointerUp!);\n document.addEventListener('touchcancel', this.#boundPointerUp!);\n } else {\n document.addEventListener('mousemove', this.#boundPointerMove!);\n document.addEventListener('mouseup', this.#boundPointerUp!);\n }\n // Listen for Escape key on document to cancel drag\n document.addEventListener('keydown', this.#boundKeyDown!);\n });\n }\n\n /**\n * Remove listeners + cancel timers.\n * Called after pointer up or when cancelling.\n */\n cleanup(): void {\n this.#isTracking = false;\n this.#startPosition = null;\n this.#deps.callbacks.onPendingChange(false); // Clear pending state on cleanup\n this.#cancelDelayTimer();\n\n // Remove event listeners\n if (this.#boundPointerMove) {\n document.removeEventListener('mousemove', this.#boundPointerMove);\n document.removeEventListener('touchmove', this.#boundPointerMove);\n }\n if (this.#boundPointerUp) {\n document.removeEventListener('mouseup', this.#boundPointerUp);\n document.removeEventListener('touchend', this.#boundPointerUp);\n document.removeEventListener('touchcancel', this.#boundPointerUp);\n }\n if (this.#boundKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyDown);\n }\n }\n\n /**\n * Full teardown — cleanup + null references.\n */\n destroy(): void {\n this.cleanup();\n }\n\n /**\n * Handle pointer move (mouse or touch).\n */\n #onPointerMove(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n const position = PointerDragHandler.#getPosition(event);\n const ctx = this.#deps.getContext();\n\n // Check if we've moved past the threshold\n if (!this.#deps.callbacks.isDragging() && this.#startPosition) {\n const distance = Math.sqrt(\n Math.pow(position.x - this.#startPosition.x, 2) +\n Math.pow(position.y - this.#startPosition.y, 2),\n );\n\n if (distance < ctx.dragThreshold) {\n return;\n }\n\n // If delay is configured and not yet ready, cancel the drag attempt\n // (user moved before the delay was satisfied).\n // DON'T call preventDefault() here - let native scrolling take over.\n if (!this.#delayReady) {\n this.#cancelDelayTimer();\n this.cleanup();\n return;\n }\n\n // Start the drag - now we can prevent default\n event.preventDefault();\n this.#deps.callbacks.onDragStart(position);\n } else if (this.#deps.callbacks.isDragging()) {\n // Already dragging - prevent default to stop scrolling\n event.preventDefault();\n }\n\n // Only update drag if we're actually dragging\n if (!this.#deps.callbacks.isDragging()) {\n return;\n }\n\n // Notify the directive of the new position — it queues this into the scheduler\n // (DragSchedulerService) which coalesces multiple moves per frame into one RAF tick.\n this.#deps.callbacks.onDragMove(position);\n }\n\n /**\n * Handle pointer up (mouse or touch).\n */\n #onPointerUp(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n // Only prevent default if we were actually dragging\n // Otherwise, allow native touch behavior (like scroll momentum) to complete\n if (this.#deps.callbacks.isDragging()) {\n event.preventDefault();\n this.#deps.callbacks.onDragEnd(false);\n }\n\n this.cleanup();\n }\n\n /**\n * Cancel the delay timer if active.\n */\n #cancelDelayTimer(): void {\n if (this.#delayTimerId !== null) {\n clearTimeout(this.#delayTimerId);\n this.#delayTimerId = null;\n }\n this.#delayReady = false;\n }\n\n /**\n * Handle keydown events on document to cancel drag with Escape.\n */\n #onEscapeKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.#deps.callbacks.isDragging()) {\n // No ngZone.run() needed - #endDrag uses signals which work outside zone\n this.#deps.callbacks.onDragEnd(true);\n this.cleanup();\n }\n }\n\n /**\n * Get position from mouse or touch event.\n */\n static #getPosition(event: MouseEvent | TouchEvent): CursorPosition {\n if ('touches' in event) {\n const touch = event.touches[0] ?? event.changedTouches[0];\n return { x: touch.clientX, y: touch.clientY };\n }\n return { x: event.clientX, y: event.clientY };\n }\n}\n","import {\n computed,\n Directive,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n signal,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { AutoScrollService } from '../services/auto-scroll.service';\nimport { ElementCloneService } from '../services/element-clone.service';\nimport { KeyboardDragService } from '../services/keyboard-drag.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\nimport { DragSchedulerService } from '../services/drag-scheduler.service';\nimport {\n CursorPosition,\n DragEndEvent,\n DragStartEvent,\n GrabOffset,\n} from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\nimport { createEffectiveGroupSignal } from '../utils/group-resolution';\nimport { KeyboardDragHandler } from '../handlers/keyboard-drag.handler';\nimport { PointerDragHandler } from '../handlers/pointer-drag.handler';\n\n/**\n * Makes an element draggable within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDraggable=\"item-1\"\n * vdndDraggableGroup=\"my-group\"\n * [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDraggable]',\n host: {\n '[attr.data-draggable-id]': 'vdndDraggable()',\n '[class.vdnd-draggable]': 'true',\n '[class.vdnd-draggable-dragging]': 'isDragging()',\n '[class.vdnd-draggable-disabled]': 'disabled()',\n '[class.vdnd-drag-pending]': 'isPending()',\n '[style.display]': 'isDragging() ? \"none\" : null',\n '[attr.aria-grabbed]': 'isDragging() ? \"true\" : \"false\"',\n '[tabindex]': 'disabled() ? -1 : 0',\n '(mousedown)': 'onPointerDown($event, false)',\n '(touchstart)': 'onPointerDown($event, true)',\n '(keydown.space)': 'onKeyboardActivate($event)',\n '(keydown.enter)': 'onEnterKey($event)',\n '(keydown.arrowup)': 'onArrowKey($event)',\n '(keydown.arrowdown)': 'onArrowKey($event)',\n '(keydown.arrowleft)': 'onArrowKey($event)',\n '(keydown.arrowright)': 'onArrowKey($event)',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class DraggableDirective implements OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #elementClone = inject(ElementCloneService);\n readonly #keyboardDrag = inject(KeyboardDragService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n readonly #overlayContainer = inject(OverlayContainerService);\n readonly #scheduler = inject(DragSchedulerService);\n readonly #ngZone = inject(NgZone);\n readonly #envInjector = inject(EnvironmentInjector);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this draggable */\n vdndDraggable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDraggableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables drag) if neither is available.\n */\n readonly #effectiveGroup = createEffectiveGroupSignal({\n explicitGroup: this.vdndDraggableGroup,\n parentGroup: this.#parentGroup,\n elementId: this.vdndDraggable,\n elementType: 'draggable',\n });\n\n /** Optional data associated with this draggable */\n vdndDraggableData = input<unknown>();\n\n /** Whether this draggable is disabled */\n disabled = input<boolean>(false);\n\n /** CSS selector for drag handle (if not provided, entire element is draggable) */\n dragHandle = input<string>();\n\n /** Minimum distance to move before drag starts (prevents accidental drags) */\n dragThreshold = input<number>(5);\n\n /**\n * Delay in milliseconds before drag starts after pointer down.\n * User must hold without moving for this duration.\n * Set to 0 for immediate drag (default behavior).\n */\n dragDelay = input<number>(0);\n\n /** Lock dragging to a single axis ('x' = horizontal only, 'y' = vertical only) */\n lockAxis = input<'x' | 'y' | null>(null);\n\n /** Emits when drag starts */\n dragStart = output<DragStartEvent>();\n\n /** Emits when drag ends */\n dragEnd = output<DragEndEvent>();\n\n /** Whether this element is in the \"ready to drag\" state (delay has passed) */\n #isPending = signal(false);\n readonly isPending = this.#isPending.asReadonly();\n\n /** Whether this element is currently being dragged (based on global drag state) */\n readonly isDragging = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n return draggedItem?.draggableId === this.vdndDraggable();\n });\n\n #keyboardHandler!: KeyboardDragHandler;\n #pointerHandler!: PointerDragHandler;\n\n /** Cached constraint flag from source droppable */\n #constrainToContainer = false;\n\n /** Element whose rect is used for clamping (scroll container or droppable itself) */\n #constraintElement: HTMLElement | null = null;\n\n /** Last raw pointer position from pointer move events (not clamped) */\n #lastRawPosition: CursorPosition | null = null;\n\n /**\n * Update the pending state and emit the change event.\n */\n #setPending(pending: boolean): void {\n if (this.#isPending() !== pending) {\n this.#isPending.set(pending);\n }\n }\n\n /**\n * Find the element to use for container constraint clamping.\n * If the droppable is inside a scrollable container, use that container's rect\n * (which represents the visible viewport) instead of the droppable's rect\n * (which may extend far beyond the viewport in virtual scroll scenarios).\n */\n #findConstraintElement(droppableElement: HTMLElement | null): HTMLElement | null {\n if (!droppableElement) return null;\n const scrollable = droppableElement.closest('.vdnd-scrollable');\n return (scrollable as HTMLElement) ?? droppableElement;\n }\n\n ngOnInit(): void {\n this.#keyboardHandler = new KeyboardDragHandler({\n dragState: this.#dragState,\n keyboardDrag: this.#keyboardDrag,\n positionCalculator: this.#positionCalculator,\n dragIndexCalculator: this.#dragIndexCalculator,\n elementClone: this.#elementClone,\n overlayContainer: this.#overlayContainer,\n ngZone: this.#ngZone,\n envInjector: this.#envInjector,\n callbacks: {\n onDragStart: (event) => this.dragStart.emit(event),\n onDragEnd: (event) => this.dragEnd.emit(event),\n getParentDroppableId: () => this.#getParentDroppableId(),\n calculateSourceIndex: (el, droppable) => this.#calculateSourceIndex(el, droppable),\n },\n getContext: () => ({\n element: this.#elementRef.nativeElement,\n draggableId: this.vdndDraggable(),\n groupName: this.#effectiveGroup(),\n data: this.vdndDraggableData(),\n }),\n });\n\n this.#pointerHandler = new PointerDragHandler({\n ngZone: this.#ngZone,\n callbacks: {\n onDragStart: (position) => this.#startDrag(position),\n onDragMove: (position) => {\n // Record raw position synchronously (needed for autoscroll cursor override)\n // then queue into the scheduler's RAF loop for coalesced frame-rate processing.\n this.#lastRawPosition = position;\n this.#scheduler.queueCursorUpdate(position);\n },\n onDragEnd: (cancelled) => this.#endDrag(cancelled),\n onPendingChange: (pending) => this.#setPending(pending),\n isDragging: () => this.isDragging(),\n },\n getContext: () => ({\n element: this.#elementRef.nativeElement,\n groupName: this.#effectiveGroup(),\n disabled: this.disabled(),\n dragHandle: this.dragHandle(),\n dragThreshold: this.dragThreshold(),\n dragDelay: this.dragDelay(),\n }),\n });\n }\n\n ngOnDestroy(): void {\n // If destroyed mid-drag, cancel to avoid stale global state / ongoing RAF loops.\n if (this.isDragging()) {\n this.#endDrag(true);\n }\n this.#pointerHandler.destroy();\n this.#keyboardHandler.destroy();\n }\n\n /**\n * Handle pointer down (mouse or touch).\n */\n protected onPointerDown(event: MouseEvent | TouchEvent, isTouch: boolean): void {\n this.#pointerHandler.onPointerDown(event, isTouch);\n }\n\n /**\n * Handle keyboard activation (space key).\n * Starts a keyboard drag if not dragging, or drops if already in keyboard drag mode.\n */\n protected onKeyboardActivate(event: Event): void {\n if (this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation(); // Prevent document listener from receiving this event\n\n // If we're in a keyboard drag, Space drops the item\n if (this.#keyboardHandler.isActive()) {\n this.#keyboardHandler.complete();\n return;\n }\n\n // If we're in a pointer drag, ignore\n if (this.isDragging()) {\n return;\n }\n\n // Start keyboard drag\n this.#keyboardHandler.activate();\n }\n\n /**\n * Handle Enter key (alternative to Space for dropping during keyboard drag).\n */\n protected onEnterKey(event: Event): void {\n if (this.#keyboardHandler.isActive()) {\n event.preventDefault();\n this.#keyboardHandler.complete();\n }\n }\n\n /**\n * Handle arrow keys during keyboard drag.\n */\n protected onArrowKey(event: Event): void {\n if (this.#keyboardHandler.isActive()) {\n this.#keyboardHandler.handleKey(event as KeyboardEvent);\n }\n }\n\n /**\n * Handle escape key to cancel drag (host binding, fires before element is hidden).\n */\n protected onEscape(): boolean {\n if (this.#keyboardHandler.isActive()) {\n this.#keyboardHandler.cancel();\n return false;\n }\n if (this.isDragging()) {\n this.#endDrag(true);\n this.#pointerHandler.cleanup();\n return false; // Prevents default\n }\n return true;\n }\n\n /**\n * Start the drag operation.\n */\n #startDrag(position: CursorPosition): void {\n // Clear pending state - drag is now active\n this.#setPending(false);\n\n const element = this.#elementRef.nativeElement;\n const rect = element.getBoundingClientRect();\n\n // Calculate grab offset using the START position (where user initially pressed down)\n // NOT the current position (where drag threshold was exceeded)\n // This ensures the preview maintains its position relative to where the user grabbed it\n const startPos = this.#pointerHandler.getStartPosition() ?? position;\n const grabOffset: GrabOffset = {\n x: startPos.x - rect.left,\n y: startPos.y - rect.top,\n };\n\n // Clone element BEFORE updating drag state (which triggers display:none via host binding).\n // Template-first: skip the costly getComputedStyle deep-walk when a template-based\n // preview is mounted, since that clone would never be rendered.\n const clonedElement = this.#overlayContainer.hasTemplatePreview()\n ? undefined\n : this.#elementClone.cloneElement(element);\n\n const parentDroppableId = this.#getParentDroppableId();\n\n // Find droppable and calculate initial placeholder position\n // This fixes the UI glitch by ensuring placeholder is set before the element is hidden\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Misconfigured - cancel tracking and don't start drag.\n this.#pointerHandler.cleanup();\n return;\n }\n\n // Snapshot droppable rects for this drag session so subsequent hit-testing is\n // pure geometry (no elementFromPoint layout flush per pointermove).\n this.#positionCalculator.beginDragSession(groupName);\n\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n position.x,\n position.y,\n element,\n groupName,\n );\n\n // Cache constraint flag and element for clamping during drag\n this.#constrainToContainer =\n droppableElement?.hasAttribute('data-constrain-to-container') ?? false;\n this.#constraintElement = this.#constrainToContainer\n ? this.#findConstraintElement(droppableElement)\n : null;\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : parentDroppableId;\n\n // Calculate source index BEFORE the element is hidden (display: none)\n // This is critical because getBoundingClientRect() returns all zeros for hidden elements\n const sourceIndex = this.#calculateSourceIndex(element, droppableElement);\n\n let initialPlaceholderId: string | null = null;\n let initialPlaceholderIndex: number | null = null;\n\n if (droppableElement) {\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position,\n previousPosition: null,\n grabOffset,\n draggedItemHeight: rect.height,\n sourceDroppableId: parentDroppableId,\n sourceIndex,\n });\n initialPlaceholderIndex = indexResult.index;\n initialPlaceholderId = indexResult.placeholderId;\n }\n\n const lockAxis = this.lockAxis();\n\n // Register with drag state service - this triggers isDragging computed to become true\n // which will apply display:none via host binding\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.startDrag(\n {\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: this.vdndDraggableData(),\n },\n position,\n grabOffset,\n lockAxis,\n activeDroppableId,\n initialPlaceholderId,\n initialPlaceholderIndex,\n sourceIndex,\n undefined,\n lockAxis ? startPos : undefined,\n );\n\n // Start the scheduler RAF loop (drives pointer-move updates + autoscroll participant).\n // onTick is called each frame: when cursor is dirty, run full #updateDrag.\n this.#scheduler.start((cursor, cursorDirty) => {\n if (cursorDirty && cursor && this.isDragging()) {\n this.#updateDrag(cursor);\n }\n });\n\n // Start auto-scroll monitoring — registers as a scheduler participant.\n this.#autoScroll.startMonitoring(() => this.#recalculatePlaceholder());\n\n // Emit drag start event\n this.dragStart.emit({\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n data: this.vdndDraggableData(),\n position,\n sourceIndex,\n });\n }\n\n /**\n * Calculate the source index of the dragged element BEFORE it's hidden.\n * This must be called before startDrag updates the state (which triggers display:none).\n * Uses strategy-based lookup when available for accurate handling of variable heights.\n */\n #calculateSourceIndex(element: HTMLElement, droppableElement: HTMLElement | null): number {\n if (!droppableElement) {\n return 0;\n }\n\n const rect = element.getBoundingClientRect();\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n\n let containerRect: DOMRect;\n let scrollTop: number;\n\n if (virtualScroll) {\n containerRect = (virtualScroll as HTMLElement).getBoundingClientRect();\n scrollTop = (virtualScroll as HTMLElement).scrollTop;\n } else if (virtualContent) {\n // Page-level scroll: use scrollable parent rect + content offset so that\n // relativeY is measured from the start of the virtual items, not the header.\n const scrollableParent = virtualContent.closest('.vdnd-scrollable') as HTMLElement | null;\n if (scrollableParent) {\n containerRect = scrollableParent.getBoundingClientRect();\n const contentOffsetAttr = (virtualContent as HTMLElement).getAttribute(\n 'data-content-offset',\n );\n const contentOffset = contentOffsetAttr ? parseFloat(contentOffsetAttr) : 0;\n scrollTop =\n scrollableParent.scrollTop - (Number.isFinite(contentOffset) ? contentOffset : 0);\n } else {\n containerRect = (virtualContent as HTMLElement).getBoundingClientRect();\n scrollTop = 0;\n }\n } else {\n containerRect = droppableElement.getBoundingClientRect();\n scrollTop = droppableElement.scrollTop;\n }\n\n // Try to use registered strategy for accurate offset-based lookup\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n if (droppableId) {\n const strategy = this.#dragIndexCalculator.getStrategyForDroppable(droppableId);\n if (strategy) {\n const relativeY = rect.top - containerRect.top + scrollTop;\n return strategy.findIndexAtOffset(relativeY);\n }\n }\n\n // Fallback: Use fixed-height math if no strategy available\n const itemHeight = rect.height || 50;\n const relativeY = rect.top - containerRect.top + scrollTop;\n return Math.round(relativeY / itemHeight);\n }\n\n /**\n * Recalculate placeholder position (called during auto-scroll).\n *\n * Scroll-only fast path: the cursor has not moved — only `scrollTop` changed.\n * When the active droppable is already known, skip hit-testing entirely and\n * recalculate only the placeholder index within that droppable. This avoids the\n * `findDroppableAtPoint` geometry scan + the `invalidateDroppableRects` DOM round-trip\n * on every autoscroll frame while still recomputing the correct insertion index.\n *\n * Falls back to the full `#updateDrag` pipeline when no droppable is active (e.g.\n * cursor drifted outside all droppables before the scroll tick fired).\n */\n #recalculatePlaceholder(): void {\n const cursorPosition = this.#dragState.cursorPosition();\n if (!cursorPosition || !this.isDragging()) {\n return;\n }\n\n const activeDroppableId = this.#dragState.activeDroppableId();\n if (activeDroppableId) {\n const droppableElement = this.#positionCalculator.getDroppableById(activeDroppableId);\n if (droppableElement) {\n const draggedItemHeight = this.#dragState.draggedItem()?.height ?? 50;\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position: cursorPosition,\n previousPosition: cursorPosition,\n grabOffset: this.#dragState.grabOffset(),\n draggedItemHeight,\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n sourceIndex: this.#dragState.sourceIndex(),\n });\n this.#dragState.updateScrollOnlyPlaceholder(indexResult.placeholderId, indexResult.index);\n return;\n }\n }\n\n // Fallback: full recalculation when no active droppable is known.\n // Mark rects dirty first since autoscroll moved the container before the scroll event fires.\n this.#positionCalculator.invalidateDroppableRects();\n this.#updateDrag(cursorPosition);\n }\n\n /**\n * Clamp cursor position to source container boundaries when constrainToContainer is enabled.\n */\n #clampToContainer(position: CursorPosition): CursorPosition {\n if (!this.#constrainToContainer || !this.#constraintElement) {\n return position;\n }\n\n const containerRect = this.#constraintElement.getBoundingClientRect();\n const grabOffset = this.#dragState.grabOffset();\n if (!grabOffset) {\n return position;\n }\n\n const draggedItem = this.#dragState.draggedItem();\n const itemHeight = draggedItem?.height ?? 0;\n const itemWidth = draggedItem?.width ?? 0;\n\n const minY = containerRect.top + grabOffset.y + 1;\n const maxY = containerRect.bottom - (itemHeight - grabOffset.y) - 1;\n const minX = containerRect.left + grabOffset.x + 1;\n const maxX = containerRect.right - (itemWidth - grabOffset.x) - 1;\n\n return {\n x: Math.max(minX, Math.min(position.x, maxX)),\n y: Math.max(minY, Math.min(position.y, maxY)),\n };\n }\n\n /**\n * Update the drag position.\n * @param position Current cursor position\n */\n #updateDrag(position: CursorPosition): void {\n const element = this.#elementRef.nativeElement;\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Group became unavailable mid-drag; cancel to avoid inconsistent state.\n this.#endDrag(true);\n this.#pointerHandler.cleanup();\n return;\n }\n\n // Apply axis locking to effective position for droppable detection\n // When axis is locked, use the start position for the locked axis\n const axisLock = this.lockAxis();\n const startPos = this.#pointerHandler.getStartPosition();\n let effectivePosition = position;\n\n if (axisLock && startPos) {\n effectivePosition = {\n x: axisLock === 'x' ? startPos.x : position.x,\n y: axisLock === 'y' ? startPos.y : position.y,\n };\n }\n\n // Apply container clamping after axis locking\n effectivePosition = this.#clampToContainer(effectivePosition);\n\n // Update autoscroll cursor: use raw pointer position clamped to container\n // edges (without grabOffset) so autoscroll threshold is reachable regardless\n // of where the user grabbed the item.\n if (this.#constrainToContainer && this.#constraintElement && this.#lastRawPosition) {\n const rect = this.#constraintElement.getBoundingClientRect();\n let scrollCursor: CursorPosition = this.#lastRawPosition;\n if (axisLock && startPos) {\n scrollCursor = {\n x: axisLock === 'x' ? startPos.x : scrollCursor.x,\n y: axisLock === 'y' ? startPos.y : scrollCursor.y,\n };\n }\n this.#autoScroll.setCursorOverride({\n x: Math.max(rect.left, Math.min(scrollCursor.x, rect.right)),\n y: Math.max(rect.top, Math.min(scrollCursor.y, rect.bottom)),\n });\n }\n\n // Find droppable at effective position (respects axis locking and clamping)\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n effectivePosition.x,\n effectivePosition.y,\n element,\n groupName,\n );\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : null;\n\n let placeholderId: string | null = null;\n let placeholderIndex: number | null = null;\n\n if (droppableElement) {\n // Calculate placeholder index based on effective position using mathematical approach\n // This is more stable than DOM-based detection because it doesn't get affected\n // by the placeholder insertion shifting elements around\n const draggedItemHeight = this.#dragState.draggedItem()?.height ?? 50;\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position: effectivePosition,\n previousPosition: this.#dragState.cursorPosition(),\n grabOffset: this.#dragState.grabOffset(),\n draggedItemHeight,\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n sourceIndex: this.#dragState.sourceIndex(),\n });\n placeholderIndex = indexResult.index;\n placeholderId = indexResult.placeholderId;\n }\n\n // Update drag state with effective position (respects axis locking and container clamping)\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.updateDragPosition({\n cursorPosition: effectivePosition,\n activeDroppableId,\n placeholderId,\n placeholderIndex,\n });\n }\n\n /**\n * End the drag operation.\n */\n #endDrag(cancelled: boolean): void {\n // Stop the scheduler RAF loop first, then remove the autoscroll participant.\n this.#scheduler.stop();\n this.#autoScroll.stopMonitoring();\n\n // Tear down the geometric hit-testing snapshot + its viewport listeners\n this.#positionCalculator.endDragSession();\n\n // Clear droppable metadata cache from this drag session\n this.#dragIndexCalculator.clearCache();\n\n // Reset cached constraint state\n this.#constrainToContainer = false;\n this.#constraintElement = null;\n this.#lastRawPosition = null;\n\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n const placeholderIndex = this.#dragState.placeholderIndex();\n let destinationIndex = cancelled ? null : placeholderIndex;\n\n // Keep DragEndEvent semantics consistent with DropEvent.destination.index.\n // During same-list drag, placeholderIndex includes the hidden-item adjustment,\n // but the final insertion index must account for removal of the source item.\n if (!cancelled && placeholderIndex !== null) {\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const activeDroppableId = this.#dragState.activeDroppableId();\n if (sourceDroppableId !== null && sourceDroppableId === activeDroppableId) {\n if (sourceIndex < placeholderIndex) {\n destinationIndex = placeholderIndex - 1;\n }\n }\n }\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId: this.vdndDraggable(),\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex,\n });\n\n // Clear drag state - this triggers isDragging computed to become false\n if (cancelled) {\n this.#dragState.cancelDrag();\n } else {\n this.#dragState.endDrag();\n }\n }\n\n /**\n * Get the parent droppable ID.\n */\n #getParentDroppableId(): string | null {\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return null;\n }\n\n const droppable = this.#positionCalculator.getDroppableParent(\n this.#elementRef.nativeElement,\n groupName,\n );\n\n return droppable ? this.#positionCalculator.getDroppableId(droppable) : null;\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\n\n/**\n * Directive that marks an element as a scrollable container for virtual scrolling.\n *\n * Apply this directive to any scrollable element (with `overflow: auto` or `overflow: scroll`)\n * that contains a `*vdndVirtualFor` directive. The virtual scroll will use this element\n * as its scroll container.\n *\n * @example\n * Basic usage with a custom scroll container:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n *\n * @example\n * With Ionic ion-content:\n * ```html\n * <ion-content vdndScrollable class=\"ion-content-scroll-host\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </ion-content>\n * ```\n *\n * @example\n * With auto-scroll configuration:\n * ```html\n * <div vdndScrollable\n * [autoScrollEnabled]=\"true\"\n * [autoScrollConfig]=\"{ threshold: 80, maxSpeed: 20 }\"\n * style=\"overflow: auto; height: 400px;\">\n * ...\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndScrollable]',\n providers: [{ provide: VDND_SCROLL_CONTAINER, useExisting: ScrollableDirective }],\n host: {\n class: 'vdnd-scrollable',\n '[style.overflow-anchor]': '\"none\"',\n },\n})\nexport class ScrollableDirective implements VdndScrollContainer, OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n // ========== Inputs ==========\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== VdndScrollContainer Implementation ==========\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScrollService,\n getElement: () => this.nativeElement,\n getId: () => this.scrollContainerId() ?? this.#generatedScrollId,\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n });\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n // ========== Additional API ==========\n\n /** Get the measured container height */\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n /** Scroll by a delta amount */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n Injector,\n input,\n isDevMode,\n NgZone,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER } from '../tokens/scroll-container.token';\nimport { VDND_VIRTUAL_VIEWPORT } from '../tokens/virtual-viewport.token';\nimport { DragStateService } from '../services/drag-state.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { DroppableDirective } from './droppable.directive';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\n\n/**\n * Context provided to the template for each virtual item.\n */\nexport interface VirtualForContext<T> {\n /** The item data (also available as implicit context) */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this is the first visible item */\n first: boolean;\n /** Whether this is the last visible item */\n last: boolean;\n /** Count of total items */\n count: number;\n}\n\n/**\n * Represents an item entry in the render queue for virtual scrolling.\n * @internal\n */\ninterface RenderEntry<T> {\n type: 'item' | 'placeholder';\n key: unknown;\n context: VirtualForContext<T> | null;\n visualIndex: number;\n}\n\n/**\n * A structural directive for virtual scrolling within custom scroll containers.\n * Provides maximum flexibility for advanced use cases where the component wrapper\n * is not suitable.\n *\n * The directive must be placed inside a container marked with the `vdndScrollable`\n * directive, which provides the scroll container context via dependency injection.\n *\n * Placeholders are handled automatically by the parent component (vdnd-virtual-scroll\n * or vdnd-virtual-content) - consumers just render their items normally.\n *\n * @example\n * Inside a viewport component (itemHeight and droppableId inherited automatically):\n * ```html\n * <vdnd-virtual-viewport [itemHeight]=\"50\" style=\"height: 400px\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n *\n * @example\n * Standalone usage (itemHeight required):\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndVirtualFor][vdndVirtualForOf]',\n})\nexport class VirtualForDirective<T> implements OnInit, OnDestroy {\n readonly #templateRef = inject(TemplateRef<VirtualForContext<T>>);\n readonly #viewContainer = inject(ViewContainerRef);\n readonly #elementRef = inject(ElementRef<Comment>);\n readonly #scrollContainer = inject(VDND_SCROLL_CONTAINER);\n readonly #injector = inject(Injector);\n readonly #ngZone = inject(NgZone);\n readonly #dragState = inject(DragStateService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n\n /**\n * Optional viewport component that provides wrapper-based positioning.\n * When inside a viewport, items are positioned via the wrapper's transform,\n * so we skip individual absolute positioning.\n */\n readonly #viewport = inject(VDND_VIRTUAL_VIEWPORT, { optional: true });\n\n /**\n * Optional parent droppable directive.\n * When present, droppableId is inherited automatically.\n */\n readonly #droppable = inject(DroppableDirective, { optional: true });\n\n /** Whether we're inside a viewport component (use wrapper positioning) */\n readonly #useViewportPositioning = this.#viewport !== null;\n\n /** Pool of views for reuse */\n readonly #viewPool: EmbeddedViewRef<VirtualForContext<T>>[] = [];\n\n /** Currently active views keyed by their track-by value */\n readonly #activeViews = new Map<unknown, EmbeddedViewRef<VirtualForContext<T>>>();\n\n /** Single spacer element for scroll height */\n #spacer: HTMLDivElement | null = null;\n\n /** Placeholder element for drag operations */\n #placeholder: HTMLDivElement | null = null;\n\n /** Whether placeholder is currently in the DOM */\n #placeholderInDom = false;\n\n /** ResizeObserver for dynamic height measurement */\n #resizeObserver: ResizeObserver | null = null;\n\n /** Map from observed HTMLElement to its trackBy key */\n readonly #observedElements = new WeakMap<HTMLElement, unknown>();\n\n // ========== Inputs ==========\n\n /** The array of items to iterate over */\n vdndVirtualForOf = input.required<T[]>();\n\n /**\n * Height of each item in pixels (used as estimate in dynamic mode).\n * Optional when inside a viewport component — inherited from the viewport's strategy.\n */\n vdndVirtualForItemHeight = input<number>();\n\n /** Track-by function for efficient updates */\n vdndVirtualForTrackBy = input.required<(index: number, item: T) => unknown>();\n\n /** Number of items to render outside the visible area */\n vdndVirtualForOverscan = input<number>(3);\n\n /**\n * ID of the droppable this directive belongs to.\n * Required for placeholder positioning during drag operations.\n */\n vdndVirtualForDroppableId = input<string>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n vdndVirtualForDynamicItemHeight = input<boolean>(false);\n\n // ========== Resolved Values ==========\n\n /**\n * Effective droppable ID — uses explicit input or inherits from parent DroppableDirective.\n */\n readonly #effectiveDroppableId = computed(() => {\n return this.vdndVirtualForDroppableId() ?? this.#droppable?.vdndDroppable() ?? undefined;\n });\n\n // ========== Strategy ==========\n\n /**\n * The virtual scroll strategy.\n * If inside a viewport that has a strategy, use that. Otherwise create our own.\n */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n // If viewport provides a strategy, use it (shared state for drag-drop)\n const viewportStrategy = this.#viewport?.strategy;\n if (viewportStrategy) return viewportStrategy;\n\n // Create our own strategy (standalone mode — itemHeight is required)\n const height = this.vdndVirtualForItemHeight();\n if (height === undefined) {\n if (isDevMode()) {\n console.warn(\n '[ngx-virtual-dnd] vdndVirtualFor requires itemHeight when not inside a viewport component ' +\n '(vdnd-virtual-viewport or vdnd-virtual-content). Falling back to 50px.',\n );\n }\n return new FixedHeightStrategy(50);\n }\n return this.vdndVirtualForDynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n // ========== Placeholder Computed Values ==========\n\n /** Whether the placeholder should be shown in this container */\n readonly #shouldShowPlaceholder = computed(() => {\n const droppableId = this.#effectiveDroppableId();\n if (!droppableId) return false;\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === droppableId;\n });\n\n /** The placeholder index when placeholder should be shown */\n readonly #placeholderIndex = computed(() => {\n if (!this.#shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n // ========== Computed Values ==========\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n const strategy = this.#strategy();\n // Read version to subscribe to dynamic height changes\n strategy.version();\n return strategy.getFirstVisibleIndex(this.#scrollContainer.scrollTop());\n });\n\n /** Number of visible items */\n readonly #visibleCount = computed(() => {\n const height = this.#scrollContainer.containerHeight();\n const strategy = this.#strategy();\n strategy.version();\n const startIndex = this.#firstVisibleIndex();\n return strategy.getVisibleCount(startIndex, height);\n });\n\n /** Range of items to render */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.vdndVirtualForOverscan();\n const total = this.vdndVirtualForOf().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Map of trackBy keys to item indices for quick lookup */\n readonly #itemIndexMap = computed(() => {\n const items = this.vdndVirtualForOf();\n const trackByFn = this.vdndVirtualForTrackBy();\n const map = new Map<unknown, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(trackByFn(i, items[i]), i);\n }\n return map;\n });\n\n /** Index of the dragged item in this list (-1 if not present or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n if (!draggedItem) return -1;\n\n const byId = this.#itemIndexMap().get(draggedItem.draggableId);\n if (byId !== undefined) {\n return byId;\n }\n\n const data = draggedItem.data as T | null | undefined;\n if (data !== null && data !== undefined) {\n return this.vdndVirtualForOf().indexOf(data);\n }\n\n return -1;\n });\n\n constructor() {\n // Keep strategy item keys in sync\n effect(() => {\n const items = this.vdndVirtualForOf();\n const trackByFn = this.vdndVirtualForTrackBy();\n const keys = items.map((item, i) => trackByFn(i, item));\n this.#strategy().setItemKeys(keys);\n });\n\n // Register strategy with drag index calculator for accurate position lookups\n effect((onCleanup) => {\n const droppableId = this.#effectiveDroppableId();\n const strategy = this.#strategy();\n if (droppableId) {\n this.#dragIndexCalculator.registerStrategy(droppableId, strategy);\n onCleanup(() => this.#dragIndexCalculator.unregisterStrategy(droppableId));\n }\n });\n\n // Set excluded index persistently during same-list drag.\n // This ensures ALL strategy methods (getTotalHeight, getOffsetForIndex, etc.)\n // correctly skip the hidden item — not just findIndexAtOffset.\n effect(() => {\n const strategy = this.#strategy();\n const draggedIndex = this.#draggedItemIndex();\n const droppableId = this.#effectiveDroppableId();\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const isDragging = this.#dragState.isDragging();\n\n const isSourceList =\n isDragging && droppableId !== undefined && droppableId === sourceDroppableId;\n\n if (isSourceList && draggedIndex >= 0) {\n strategy.setExcludedIndex(draggedIndex);\n } else {\n strategy.setExcludedIndex(null);\n }\n });\n\n // React to changes and update views\n effect(() => {\n this.#updateViews();\n });\n }\n\n ngOnInit(): void {\n // Only create spacer when NOT inside a viewport component\n // (viewport provides its own spacer and wrapper positioning)\n if (!this.#useViewportPositioning) {\n this.#updateSpacers();\n }\n\n // Create placeholder element for drag operations\n this.#createPlaceholder();\n\n // Set up ResizeObserver for dynamic height mode.\n // Check both the directive's own input and the viewport's strategy (when inherited).\n if (\n this.vdndVirtualForDynamicItemHeight() ||\n this.#strategy() instanceof DynamicHeightStrategy\n ) {\n this.#setupResizeObserver();\n }\n }\n\n ngOnDestroy(): void {\n this.#viewPool.forEach((view) => view.destroy());\n this.#activeViews.forEach((view) => view.destroy());\n\n // Clean up spacer element (only if we created one)\n this.#spacer?.remove();\n\n // Clean up placeholder element\n this.#placeholder?.remove();\n\n // Clean up ResizeObserver\n this.#resizeObserver?.disconnect();\n }\n\n /**\n * Create the placeholder element for drag operations.\n */\n #createPlaceholder(): void {\n const placeholder = document.createElement('div');\n placeholder.className = 'vdnd-drag-placeholder vdnd-drag-placeholder-visible';\n placeholder.style.cssText = 'display: block; pointer-events: none;';\n this.#placeholder = placeholder;\n }\n\n /**\n * Set up spacer element for scroll height.\n */\n #updateSpacers(): void {\n // Create single spacer that maintains total scroll height\n const spacer = document.createElement('div');\n spacer.className = 'vdnd-virtual-for-spacer';\n spacer.style.cssText =\n 'position: absolute; top: 0; left: 0; width: 1px; visibility: hidden; pointer-events: none;';\n\n // Insert spacer before the directive's anchor comment\n const comment = this.#elementRef.nativeElement;\n comment.parentNode?.insertBefore(spacer, comment);\n\n this.#spacer = spacer;\n\n // Update spacer height reactively\n // Must pass injector since we're outside constructor\n effect(\n () => {\n const total = this.vdndVirtualForOf().length;\n const strategy = this.#strategy();\n strategy.version();\n\n // Single spacer with full content height\n spacer.style.height = `${strategy.getTotalHeight(total)}px`;\n },\n { injector: this.#injector },\n );\n }\n\n /**\n * Set up ResizeObserver for dynamic height measurement.\n */\n #setupResizeObserver(): void {\n this.#ngZone.runOutsideAngular(() => {\n this.#resizeObserver = new ResizeObserver((entries) => {\n const strategy = this.#strategy();\n for (const entry of entries) {\n const element = entry.target as HTMLElement;\n const key = this.#observedElements.get(element);\n if (key === undefined) continue;\n\n const height = entry.borderBoxSize?.[0]?.blockSize ?? element.offsetHeight;\n if (height > 0) {\n strategy.setMeasuredHeight(key, height);\n }\n }\n });\n });\n }\n\n /**\n * Observe an element's root nodes for height changes.\n */\n #observeViewElements(view: EmbeddedViewRef<VirtualForContext<T>>, key: unknown): void {\n if (!this.#resizeObserver) return;\n\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n const existingKey = this.#observedElements.get(node);\n if (Object.is(existingKey, key)) {\n continue;\n }\n if (existingKey !== undefined) {\n this.#resizeObserver.unobserve(node);\n }\n this.#observedElements.set(node, key);\n this.#resizeObserver.observe(node);\n }\n }\n }\n\n /**\n * Stop observing an element's root nodes.\n */\n #unobserveViewElements(view: EmbeddedViewRef<VirtualForContext<T>>): void {\n if (!this.#resizeObserver) return;\n\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n this.#observedElements.delete(node);\n this.#resizeObserver.unobserve(node);\n }\n }\n }\n\n /**\n * Update the rendered views with true view recycling.\n * Views are kept in the DOM and have their context updated in place when possible.\n */\n #updateViews(): void {\n const items = this.vdndVirtualForOf();\n const { start, end } = this.#renderRange();\n const strategy = this.#strategy();\n strategy.version();\n const placeholderIndex = this.#placeholderIndex();\n const showPlaceholder = this.#shouldShowPlaceholder();\n const draggedIndex = this.#draggedItemIndex();\n const droppableId = this.#effectiveDroppableId();\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const isSourceList = droppableId ? droppableId === sourceDroppableId : true;\n const shouldKeepDragged =\n this.#dragState.isDragging() &&\n draggedIndex >= 0 &&\n isSourceList &&\n draggedIndex < items.length;\n\n // Notify viewport of render start index for wrapper positioning\n this.#notifyViewportRenderStart(start);\n\n // 1. Build the list of items to render\n const itemsToRender = this.#calculateItemsToRender({\n items,\n start,\n end,\n showPlaceholder,\n placeholderIndex,\n shouldKeepDragged,\n draggedIndex,\n });\n\n // 2. Reconcile views with the DOM\n const placeholderDomPosition = this.#reconcileViews(itemsToRender, showPlaceholder, strategy);\n\n // 3. Position placeholder in DOM\n this.#positionPlaceholder(showPlaceholder, placeholderDomPosition, strategy, placeholderIndex);\n\n // 4. Trim view pool to prevent memory bloat\n this.#trimViewPool();\n }\n\n /**\n * Notify viewport of render start index for wrapper positioning.\n * With persistent excluded index, getOffsetForIndex already accounts for hidden items.\n */\n #notifyViewportRenderStart(start: number): void {\n if (!this.#useViewportPositioning) return;\n this.#viewport?.setRenderStartIndex(start);\n }\n\n /**\n * Calculate the list of items to render, including placeholder positioning\n * and keeping the dragged item alive when scrolled out of range.\n */\n #calculateItemsToRender(params: {\n items: T[];\n start: number;\n end: number;\n showPlaceholder: boolean;\n placeholderIndex: number;\n shouldKeepDragged: boolean;\n draggedIndex: number;\n }): RenderEntry<T>[] {\n const {\n items,\n start,\n end,\n showPlaceholder,\n placeholderIndex,\n shouldKeepDragged,\n draggedIndex,\n } = params;\n const trackByFn = this.vdndVirtualForTrackBy();\n const itemsToRender: RenderEntry<T>[] = [];\n\n // Track placeholder insertion with a flag instead of re-scanning itemsToRender\n // with `.some()` on every iteration (which made the build loop O(n²)).\n let placeholderInserted = false;\n\n // Build render list for visible range\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (showPlaceholder && placeholderIndex === i && !placeholderInserted) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n placeholderInserted = true;\n }\n\n const item = items[i];\n itemsToRender.push({\n type: 'item',\n key: trackByFn(i, item),\n context: {\n $implicit: item,\n index: i,\n first: i === start,\n last: i === end || i === items.length - 1,\n count: items.length,\n },\n visualIndex: i,\n });\n }\n\n // Add placeholder at end if needed\n if (showPlaceholder && placeholderIndex >= items.length && !placeholderInserted) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n }\n\n // Keep dragged item view alive when scrolled out of range\n if (shouldKeepDragged && (draggedIndex < start || draggedIndex > end)) {\n const draggedItem = items[draggedIndex];\n const draggedKey = trackByFn(draggedIndex, draggedItem);\n const alreadyRendered = itemsToRender.some(\n (entry) => entry.type === 'item' && entry.key === draggedKey,\n );\n if (!alreadyRendered) {\n itemsToRender.push({\n type: 'item',\n key: draggedKey,\n context: {\n $implicit: draggedItem,\n index: draggedIndex,\n first: draggedIndex === 0,\n last: draggedIndex === items.length - 1,\n count: items.length,\n },\n visualIndex: draggedIndex,\n });\n }\n }\n\n return itemsToRender;\n }\n\n /**\n * Reconcile views with the calculated items to render.\n * Moves unused views to pool, updates existing views, creates new views as needed.\n * Returns the DOM position where placeholder should be inserted.\n */\n #reconcileViews(\n itemsToRender: RenderEntry<T>[],\n showPlaceholder: boolean,\n strategy: VirtualScrollStrategy,\n ): number {\n // Determine which keys we need\n const neededKeys = new Set(\n itemsToRender.filter((r) => r.type === 'item').map((item) => item.key),\n );\n\n // Move unused views to pool\n for (const [key, view] of this.#activeViews) {\n if (!neededKeys.has(key)) {\n const index = this.#viewContainer.indexOf(view);\n if (index >= 0) {\n this.#viewContainer.detach(index);\n }\n this.#unobserveViewElements(view);\n this.#viewPool.push(view);\n this.#activeViews.delete(key);\n }\n }\n\n // Remove placeholder from DOM if not needed\n if (!showPlaceholder && this.#placeholderInDom && this.#placeholder) {\n this.#placeholder.remove();\n this.#placeholderInDom = false;\n }\n\n // Process items and track placeholder position\n let viewContainerIndex = 0;\n let placeholderDomPosition = -1;\n const renderedKeys = new Set<unknown>();\n\n for (const entry of itemsToRender) {\n if (entry.type === 'placeholder') {\n placeholderDomPosition = viewContainerIndex;\n continue;\n }\n\n if (renderedKeys.has(entry.key)) {\n this.#warnDuplicateTrackByKey(entry.key);\n continue;\n }\n renderedKeys.add(entry.key);\n\n const view = this.#getOrCreateView(entry.key, entry.context!);\n\n // Ensure view is at correct position in ViewContainerRef\n const currentIndex = this.#viewContainer.indexOf(view);\n if (currentIndex !== viewContainerIndex) {\n const targetIndex = this.#getSafeViewContainerIndex(currentIndex, viewContainerIndex);\n if (currentIndex >= 0) {\n if (currentIndex !== targetIndex) {\n this.#viewContainer.move(view, targetIndex);\n }\n } else {\n this.#viewContainer.insert(view, targetIndex);\n }\n }\n\n // Apply absolute positioning when not using viewport wrapper\n if (!this.#useViewportPositioning) {\n const offset = strategy.getOffsetForIndex(entry.visualIndex);\n this.#applyAbsolutePositioning(view, offset);\n }\n\n // Observe for dynamic height measurement\n if (this.#resizeObserver) {\n this.#observeViewElements(view, entry.key);\n }\n\n viewContainerIndex++;\n }\n\n return placeholderDomPosition;\n }\n\n /**\n * Clamp target indices for move/insert to avoid out-of-range operations when\n * reconciliation is given invalid duplicate keys or transiently inconsistent view state.\n */\n #getSafeViewContainerIndex(currentIndex: number, requestedIndex: number): number {\n const length = this.#viewContainer.length;\n\n if (currentIndex >= 0) {\n if (length <= 1) return 0;\n return Math.min(requestedIndex, length - 1);\n }\n\n return Math.min(requestedIndex, length);\n }\n\n /**\n * Duplicate trackBy keys cannot be reconciled to distinct views.\n * Warn in dev mode and skip duplicates to prevent container corruption.\n */\n #warnDuplicateTrackByKey(key: unknown): void {\n if (isDevMode()) {\n console.warn(\n `[ngx-virtual-dnd] Duplicate trackBy key detected in vdndVirtualFor: ${String(key)}. ` +\n 'Skipping duplicate item to avoid view reconciliation errors.',\n );\n }\n }\n\n /**\n * Get an existing view or create/recycle one from the pool.\n */\n #getOrCreateView(\n key: unknown,\n context: VirtualForContext<T>,\n ): EmbeddedViewRef<VirtualForContext<T>> {\n let view = this.#activeViews.get(key);\n\n if (view) {\n // Update existing view context\n Object.assign(view.context, context);\n view.markForCheck();\n } else {\n // Try pool first, then create new\n view = this.#viewPool.pop();\n if (view) {\n Object.assign(view.context, context);\n view.markForCheck();\n } else {\n view = this.#templateRef.createEmbeddedView(context);\n }\n this.#activeViews.set(key, view);\n }\n\n return view;\n }\n\n /**\n * Apply absolute positioning styles to a view's root nodes.\n */\n #applyAbsolutePositioning(view: EmbeddedViewRef<VirtualForContext<T>>, topOffset: number): void {\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n node.style.position = 'absolute';\n node.style.top = `${topOffset}px`;\n node.style.left = '0';\n node.style.right = '0';\n }\n }\n }\n\n /**\n * Position the placeholder element in the DOM at the correct index.\n */\n #positionPlaceholder(\n showPlaceholder: boolean,\n placeholderDomPosition: number,\n strategy: VirtualScrollStrategy,\n placeholderIndex: number,\n ): void {\n if (!showPlaceholder || !this.#placeholder || placeholderDomPosition < 0) {\n return;\n }\n\n // Use the dragged item's height if available, otherwise use strategy height\n const draggedItemHeight = this.#dragState.draggedItem()?.height;\n const height = draggedItemHeight ?? strategy.getItemHeight(placeholderIndex);\n this.#placeholder.style.height = `${height}px`;\n\n const container = this.#viewContainer.element.nativeElement.parentElement;\n if (!container) return;\n\n // The placeholder goes immediately before the item view at placeholderDomPosition\n // (the reconcile pass counts item views only, so this index maps directly to a\n // ViewContainerRef view). Reading the reference node from that view avoids\n // re-querying and filtering container.children on every placeholder move.\n const insertBeforeEl = this.#getViewReferenceNode(placeholderDomPosition);\n\n if (!this.#placeholderInDom) {\n // First insertion\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n this.#placeholderInDom = true;\n } else {\n // Move to correct position if needed\n const currentNextSibling = this.#placeholder.nextElementSibling;\n if (insertBeforeEl !== currentNextSibling) {\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n }\n }\n }\n\n /**\n * Resolve the DOM node the placeholder should be inserted before, given the\n * item-view index produced by the reconcile pass. Returns null when the index\n * is past the last view (placeholder belongs at the end → append).\n */\n #getViewReferenceNode(viewIndex: number): Element | null {\n if (viewIndex < 0 || viewIndex >= this.#viewContainer.length) {\n return null;\n }\n const view = this.#viewContainer.get(viewIndex) as\n | EmbeddedViewRef<VirtualForContext<T>>\n | null\n | undefined;\n if (!view) {\n return null;\n }\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n return node;\n }\n }\n return null;\n }\n\n /**\n * Trim the view pool to prevent memory bloat, keeping a reasonable buffer.\n */\n #trimViewPool(): void {\n const maxPoolSize = 10;\n while (this.#viewPool.length > maxPoolSize) {\n const view = this.#viewPool.pop();\n view?.destroy();\n }\n }\n\n /**\n * Static method for Angular's structural directive microsyntax.\n */\n static ngTemplateContextGuard<T>(\n _dir: VirtualForDirective<T>,\n _ctx: unknown,\n ): _ctx is VirtualForContext<T> {\n return true;\n }\n}\n","import { isDevMode, type WritableSignal } from '@angular/core';\nimport { DropEvent } from '../models/drag-drop.models';\n\n/**\n * Moves an item between signal-based lists based on a drop event.\n * Handles both same-list reordering and cross-list moves.\n *\n * @example\n * ```typescript\n * // In your component:\n * readonly list1 = signal<Item[]>([...]);\n * readonly list2 = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * moveItem(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding WritableSignal arrays\n */\nexport function moveItem<T>(event: DropEvent, lists: Record<string, WritableSignal<T[]>>): void {\n const sourceList = lists[event.source.droppableId];\n const destList = lists[event.destination.droppableId];\n\n if (!sourceList || !destList) {\n if (isDevMode()) {\n console.warn(\n `[ngx-virtual-dnd] [moveItem] Could not find list for droppable \"${event.source.droppableId}\" or \"${event.destination.droppableId}\"`,\n );\n }\n return;\n }\n\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // Same list reorder\n if (event.source.droppableId === event.destination.droppableId) {\n reorderItems(event, sourceList);\n return;\n }\n\n // Cross-list move\n const sourceItems = sourceList();\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n if (isDevMode()) {\n console.warn(`[ngx-virtual-dnd] [moveItem] Could not find item at index ${sourceIndex}`);\n }\n return;\n }\n\n // Remove from source\n sourceList.update((items) => {\n const newItems = [...items];\n newItems.splice(sourceIndex, 1);\n return newItems;\n });\n\n // Insert at destination\n destList.update((items) => {\n const newItems = [...items];\n newItems.splice(destIndex, 0, item);\n return newItems;\n });\n}\n\n/**\n * Reorders items within a single signal-based list.\n *\n * @example\n * ```typescript\n * readonly items = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * reorderItems(event, this.items);\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param list The WritableSignal array to reorder\n */\nexport function reorderItems<T>(event: DropEvent, list: WritableSignal<T[]>): void {\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // No-op if same position\n if (sourceIndex === destIndex) {\n return;\n }\n\n list.update((items) => {\n const newItems = [...items];\n const [removed] = newItems.splice(sourceIndex, 1);\n\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n newItems.splice(destIndex, 0, removed);\n return newItems;\n });\n}\n\n/**\n * Applies a move operation immutably, returning new array objects.\n * Useful for state management patterns that require immutable updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * const { list1, list2 } = applyMove(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * // Use the returned arrays with your state management\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding arrays\n * @returns A new object with the same keys but updated arrays\n */\nexport function applyMove<T>(event: DropEvent, lists: Record<string, T[]>): Record<string, T[]> {\n const result = { ...lists };\n const sourceKey = event.source.droppableId;\n const destKey = event.destination.droppableId;\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n const sourceItems = [...(lists[sourceKey] ?? [])];\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n return result;\n }\n\n // Same list reorder\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n if (sourceKey === destKey) {\n const [removed] = sourceItems.splice(sourceIndex, 1);\n sourceItems.splice(destIndex, 0, removed);\n result[sourceKey] = sourceItems;\n return result;\n }\n\n // Cross-list move\n const destItems = [...(lists[destKey] ?? [])];\n sourceItems.splice(sourceIndex, 1);\n destItems.splice(destIndex, 0, item);\n\n result[sourceKey] = sourceItems;\n result[destKey] = destItems;\n\n return result;\n}\n\n/**\n * Checks if a drop event represents a no-op (item dropped in its original position).\n * Useful for skipping unnecessary state updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * if (isNoOpDrop(event)) {\n * return; // No action needed\n * }\n * moveItem(event, this.lists);\n * }\n * ```\n *\n * @param event The drop event to check\n * @returns true if the drop would result in no change\n */\nexport function isNoOpDrop(event: DropEvent): boolean {\n return (\n event.source.droppableId === event.destination.droppableId &&\n event.source.index === event.destination.index\n );\n}\n\n/**\n * Creates a new list with the item inserted at the specified index.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param item The item to insert\n * @param index The index to insert at\n * @returns A new array with the item inserted\n */\nexport function insertAt<T>(list: T[], item: T, index: number): T[] {\n const result = [...list];\n result.splice(index, 0, item);\n return result;\n}\n\n/**\n * Creates a new list with the item at the specified index removed.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param index The index to remove\n * @returns A new array with the item removed\n */\nexport function removeAt<T>(list: T[], index: number): T[] {\n const result = [...list];\n result.splice(index, 1);\n return result;\n}\n","// Models\nexport * from './models/drag-drop.models';\nexport type { VirtualScrollStrategy } from './models/virtual-scroll-strategy';\n\n// Strategies\nexport { FixedHeightStrategy } from './strategies/fixed-height.strategy';\nexport { DynamicHeightStrategy } from './strategies/dynamic-height.strategy';\n\n// Tokens\nexport { VDND_SCROLL_CONTAINER } from './tokens/scroll-container.token';\nexport type { VdndScrollContainer } from './tokens/scroll-container.token';\nexport { VDND_VIRTUAL_VIEWPORT } from './tokens/virtual-viewport.token';\nexport type { VdndVirtualViewport } from './tokens/virtual-viewport.token';\n\n// Services\nexport { DragStateService } from './services/drag-state.service';\nexport { PositionCalculatorService } from './services/position-calculator.service';\nexport { AutoScrollService } from './services/auto-scroll.service';\nexport type { AutoScrollConfig } from './services/auto-scroll.service';\nexport { ElementCloneService } from './services/element-clone.service';\nexport { KeyboardDragService } from './services/keyboard-drag.service';\nexport { OverlayContainerService } from './services/overlay-container.service';\n\n// Components\nexport { VirtualScrollContainerComponent } from './components/virtual-scroll-container.component';\nexport type { VirtualScrollItemContext } from './components/virtual-scroll-container.component';\nexport { DragPreviewComponent } from './components/drag-preview.component';\nexport type { DragPreviewContext } from './components/drag-preview.component';\nexport { PlaceholderComponent } from './components/placeholder.component';\nexport type { PlaceholderContext } from './components/placeholder.component';\nexport { DragPlaceholderComponent } from './components/drag-placeholder.component';\nexport { VirtualSortableListComponent } from './components/virtual-sortable-list.component';\nexport { VirtualViewportComponent } from './components/virtual-viewport.component';\nexport { VirtualContentComponent } from './components/virtual-content.component';\n\n// Directives\nexport { DraggableDirective } from './directives/draggable.directive';\nexport { DroppableDirective } from './directives/droppable.directive';\nexport { DroppableGroupDirective, VDND_GROUP_TOKEN } from './directives/droppable-group.directive';\nexport type { VdndGroupContext } from './directives/droppable-group.directive';\nexport { ScrollableDirective } from './directives/scrollable.directive';\nexport { VirtualForDirective } from './directives/virtual-for.directive';\nexport type { VirtualForContext } from './directives/virtual-for.directive';\nexport { ContentHeaderDirective } from './directives/content-header.directive';\n\n// Utilities\nexport {\n moveItem,\n reorderItems,\n applyMove,\n isNoOpDrop,\n insertAt,\n removeAt,\n} from './utils/drop-helpers';\n","/*\n * Public API Surface of ngx-virtual-dnd\n */\n\nexport * from './lib/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AA6IA;;AAEG;AACI,MAAM,kBAAkB,GAAc;AAC3C,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,mBAAmB,EAAE,IAAI;;AAG3B;;AAEG;AACI,MAAM,WAAW,GAAG;;AChK3B;;;;;;AAMG;MACU,mBAAmB,CAAA;AACrB,IAAA,WAAW;;IAGpB,cAAc,GAAG,CAAC,CAAC;;IAGnB,UAAU,GAAG,CAAC;;AAGL,IAAA,QAAQ,GAAG,MAAM,CAAC,CAAC,oDAAC;AACpB,IAAA,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AAE7C,IAAA,WAAA,CAAY,UAAkB,EAAA;AAC5B,QAAA,IAAI,CAAC,WAA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AQ,CAAI,IAAS,EAAE,IAAO,EAAE,KAAa,EAAA;AAC3D,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC;AAC7B,IAAA,OAAO,MAAM;AACf;AAEA;;;;;;;AAOG;AACG,SAAU,QAAQ,CAAI,IAAS,EAAE,KAAa,EAAA;AAClD,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;AACxB,IAAA,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACvB,IAAA,OAAO,MAAM;AACf;;ACpNA;;ACAA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-virtual-dnd.mjs","sources":["../../../projects/ngx-virtual-dnd/src/lib/models/drag-drop.models.ts","../../../projects/ngx-virtual-dnd/src/lib/strategies/fixed-height.strategy.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/height-cache.ts","../../../projects/ngx-virtual-dnd/src/lib/strategies/dynamic-height.strategy.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/scroll-container.token.ts","../../../projects/ngx-virtual-dnd/src/lib/tokens/virtual-viewport.token.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-state.service.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/attribute-selectors.ts","../../../projects/ngx-virtual-dnd/src/lib/services/position-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-scheduler.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/auto-scroll.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/element-clone.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/keyboard-drag.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/overlay-container.service.ts","../../../projects/ngx-virtual-dnd/src/lib/services/drag-index-calculator.service.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/dom-signal-bindings.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/auto-scroll-registration.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-scroll-container.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/drag-preview.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/placeholder.component.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable-group.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/group-resolution.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/drop-index-normalization.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/droppable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-sortable-list.component.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-viewport.component.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/content-header.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/components/virtual-content.component.ts","../../../projects/ngx-virtual-dnd/src/lib/handlers/keyboard-drag.handler.ts","../../../projects/ngx-virtual-dnd/src/lib/handlers/pointer-drag.handler.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/draggable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/scrollable.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/directives/virtual-for.directive.ts","../../../projects/ngx-virtual-dnd/src/lib/utils/drop-helpers.ts","../../../projects/ngx-virtual-dnd/src/lib/index.ts","../../../projects/ngx-virtual-dnd/src/public-api.ts","../../../projects/ngx-virtual-dnd/src/ngx-virtual-dnd.ts"],"sourcesContent":["/**\n * Represents the item currently being dragged.\n */\nexport interface DraggedItem {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Reference to the dragged element */\n element: HTMLElement;\n /** Cloned element for use in drag preview (auto-generated) */\n clonedElement?: HTMLElement;\n /** Height of the dragged element in pixels */\n height: number;\n /** Width of the dragged element in pixels */\n width: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Current position of the cursor during drag.\n */\nexport interface CursorPosition {\n x: number;\n y: number;\n}\n\n/**\n * Offset from cursor to the top-left corner of the dragged element.\n * Used to maintain grab position during drag.\n */\nexport interface GrabOffset {\n x: number;\n y: number;\n}\n\n/**\n * Complete state of the drag-and-drop system.\n */\nexport interface DragState {\n /** Whether a drag operation is currently in progress */\n isDragging: boolean;\n /** Information about the item being dragged */\n draggedItem: DraggedItem | null;\n /** ID of the droppable where the drag started */\n sourceDroppableId: string | null;\n /** Original index of the dragged item in the source list */\n sourceIndex: number | null;\n /** ID of the droppable currently being hovered over */\n activeDroppableId: string | null;\n /** ID of the item the placeholder should appear before, or 'END_OF_LIST' */\n placeholderId: string | null;\n /** Index where the placeholder should be inserted (more stable than placeholderId) */\n placeholderIndex: number | null;\n /** Current cursor position */\n cursorPosition: CursorPosition | null;\n /** Offset from cursor to element top-left (for maintaining grab position) */\n grabOffset: GrabOffset | null;\n /** Position when drag started (for axis locking) */\n initialPosition: CursorPosition | null;\n /** Axis to freeze ('x' = X frozen → vertical-only, 'y' = Y frozen → horizontal-only) */\n lockAxis: 'x' | 'y' | null;\n /** Whether this is a keyboard-initiated drag */\n isKeyboardDrag: boolean;\n /** Target index during keyboard navigation */\n keyboardTargetIndex: number | null;\n}\n\n/**\n * Event emitted when a drag operation starts.\n */\nexport interface DragStartEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Position where the drag started */\n position: CursorPosition;\n /** 0-indexed position in the source list (for screen reader announcements) */\n sourceIndex: number;\n}\n\n/**\n * Source information for a drop event.\n */\nexport interface DropSource {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /** Original index in the source list */\n index: number;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n}\n\n/**\n * Destination information for a drop event.\n */\nexport interface DropDestination {\n /** ID of the droppable container receiving the item */\n droppableId: string;\n /** ID of the item to insert before, or 'END_OF_LIST' */\n placeholderId: string;\n /** Target index in the destination list */\n index: number;\n /** Optional user-provided data associated with the droppable */\n data?: unknown;\n}\n\n/**\n * Event emitted when an item is dropped.\n */\nexport interface DropEvent {\n /** Information about where the item came from */\n source: DropSource;\n /** Information about where the item is going */\n destination: DropDestination;\n}\n\n/**\n * Event emitted when a drag operation ends (including cancel).\n */\nexport interface DragEndEvent {\n /** Unique identifier for the draggable item */\n draggableId: string;\n /** ID of the droppable container the item originated from */\n droppableId: string;\n /**\n * Whether the drag was actively cancelled (Escape key). Releasing over no valid\n * target (outside any droppable, or over a disabled droppable) is NOT a cancel —\n * it reports `cancelled: false` with `destinationIndex: null`. Branch on\n * `destinationIndex === null` to detect \"no drop occurred\".\n */\n cancelled: boolean;\n /** Optional user-provided data associated with the item */\n data?: unknown;\n /** Original 0-indexed position in source list (for cancel announcements) */\n sourceIndex: number;\n /**\n * Final 0-indexed insertion position, or `null` when there is no valid drop target —\n * a cancelled drag, a release outside every droppable, or a release over a disabled\n * droppable. A non-null value pairs with a `DropEvent` on the destination.\n */\n destinationIndex: number | null;\n}\n\n/**\n * Initial state for the drag state service.\n */\nexport const INITIAL_DRAG_STATE: DragState = {\n isDragging: false,\n draggedItem: null,\n sourceDroppableId: null,\n sourceIndex: null,\n activeDroppableId: null,\n placeholderId: null,\n placeholderIndex: null,\n cursorPosition: null,\n grabOffset: null,\n initialPosition: null,\n lockAxis: null,\n isKeyboardDrag: false,\n keyboardTargetIndex: null,\n};\n\n/**\n * Placeholder ID used when dropping at the end of a list.\n */\nexport const END_OF_LIST = 'END_OF_LIST';\n","import { signal } from '@angular/core';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\n\n/**\n * Fixed-height virtual scroll strategy.\n *\n * Wraps the existing `index * itemHeight` math with zero overhead — no cache,\n * no measurement. This is the default strategy used when `dynamicItemHeight`\n * is not enabled.\n */\nexport class FixedHeightStrategy implements VirtualScrollStrategy {\n readonly #itemHeight: number;\n\n /** Excluded index during same-list drag (-1 = none) */\n #excludedIndex = -1;\n\n /** Logical item count from setItemKeys (used by drag index calculator) */\n #itemCount = 0;\n\n /** Version signal — bumps when exclusion changes */\n readonly #version = signal(0);\n readonly version = this.#version.asReadonly();\n\n constructor(itemHeight: number) {\n this.#itemHeight = itemHeight;\n }\n\n getTotalHeight(itemCount: number): number {\n return itemCount * this.#itemHeight;\n }\n\n getFirstVisibleIndex(scrollTop: number): number {\n if (this.#itemHeight <= 0) return 0;\n return Math.floor(scrollTop / this.#itemHeight);\n }\n\n getVisibleCount(_startIndex: number, containerHeight: number): number {\n if (containerHeight <= 0 || this.#itemHeight <= 0) return 0;\n return Math.ceil(containerHeight / this.#itemHeight);\n }\n\n getOffsetForIndex(index: number): number {\n if (this.#excludedIndex >= 0 && index > this.#excludedIndex) {\n return (index - 1) * this.#itemHeight;\n }\n return index * this.#itemHeight;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getItemHeight(index: number): number {\n return this.#itemHeight;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setMeasuredHeight(key: unknown, height: number): void {\n // No-op for fixed height strategy\n }\n\n setItemKeys(keys: unknown[]): void {\n const prevCount = this.#itemCount;\n this.#itemCount = keys.length;\n if (prevCount !== this.#itemCount) {\n this.#version.update((v) => v + 1);\n }\n }\n\n setExcludedIndex(index: number | null): void {\n const newIndex = index ?? -1;\n if (this.#excludedIndex !== newIndex) {\n this.#excludedIndex = newIndex;\n this.#version.update((v) => v + 1);\n }\n }\n\n findIndexAtOffset(offset: number): number {\n if (this.#itemHeight <= 0) return 0;\n const visualIndex = Math.floor(offset / this.#itemHeight);\n // When an item is excluded (same-list drag), visual indices at or past\n // the excluded position map to logical index + 1\n if (this.#excludedIndex >= 0 && visualIndex >= this.#excludedIndex) {\n return visualIndex + 1;\n }\n return visualIndex;\n }\n\n getItemCount(): number {\n return this.#itemCount;\n }\n}\n","/**\n * Cache for measured item heights in dynamic virtual scrolling.\n *\n * Tracks heights by trackBy key (survives reordering). Maintains a cumulative\n * offset prefix-sum array, lazily rebuilt on height change. Binary search\n * O(log N) for scroll-to-index lookups.\n *\n * This is a plain class (not a service) — one instance per virtual scroll.\n */\nexport class HeightCache {\n /** Estimated height used for unmeasured items */\n readonly #estimatedHeight: number;\n\n /** Map from trackBy key to measured height */\n readonly #heightsByKey = new Map<unknown, number>();\n\n /** Current ordered list of trackBy keys (index-aligned with item array) */\n #keys: unknown[] = [];\n\n /** Prefix sums: offsets[i] = cumulative height of items 0..i-1 */\n #offsets: number[] = [];\n\n /** Whether offsets need to be rebuilt */\n #dirty = true;\n\n /** Index excluded during same-list drag (-1 = none) */\n #excludedIndex = -1;\n\n constructor(estimatedHeight: number) {\n this.#estimatedHeight = estimatedHeight;\n }\n\n /** Number of measured items */\n get measuredCount(): number {\n return this.#heightsByKey.size;\n }\n\n /** Number of logical items in the cache */\n get itemCount(): number {\n return this.#keys.length;\n }\n\n /**\n * Update the ordered list of trackBy keys.\n * This must be called whenever items change order or the array changes.\n */\n setKeys(keys: unknown[]): boolean {\n const sameOrder =\n keys.length === this.#keys.length &&\n keys.every((key, index) => Object.is(key, this.#keys[index]));\n\n const nextKeySet = new Set(keys);\n let pruned = false;\n for (const key of this.#heightsByKey.keys()) {\n if (!nextKeySet.has(key)) {\n this.#heightsByKey.delete(key);\n pruned = true;\n }\n }\n\n if (sameOrder && !pruned) {\n return false;\n }\n\n this.#keys = keys;\n this.#dirty = true;\n return true;\n }\n\n /**\n * Record a measured height for a trackBy key.\n * @returns true if the height actually changed (triggers version bump)\n */\n setHeight(key: unknown, height: number): boolean {\n const existing = this.#heightsByKey.get(key);\n if (existing === height) return false;\n this.#heightsByKey.set(key, height);\n this.#dirty = true;\n return true;\n }\n\n /**\n * Get the height for a specific index.\n * Returns measured height if available, otherwise the estimated height.\n */\n getHeight(index: number): number {\n if (index < 0 || index >= this.#keys.length) return this.#estimatedHeight;\n const key = this.#keys[index];\n return this.#heightsByKey.get(key) ?? this.#estimatedHeight;\n }\n\n /**\n * Get the pixel offset (top position) for a given item index.\n * Accounts for the excluded index during same-list drag.\n */\n getOffset(index: number): number {\n this.#rebuildIfDirty();\n\n if (this.#excludedIndex < 0) {\n // No exclusion — direct lookup\n return index < this.#offsets.length ? this.#offsets[index] : this.#getTotalHeightRaw();\n }\n\n // With exclusion: subtract the excluded item's height from offsets\n // at or after the excluded index\n if (index <= this.#excludedIndex) {\n return this.#offsets[index] ?? 0;\n }\n\n // index > excludedIndex: offset = raw offset for (index) minus excluded item's height\n const rawOffset =\n index < this.#offsets.length ? this.#offsets[index] : this.#getTotalHeightRaw();\n const excludedHeight = this.getHeight(this.#excludedIndex);\n return rawOffset - excludedHeight;\n }\n\n /**\n * Get total content height for all items.\n * Does NOT exclude the dragged item — the spacer must maintain full height\n * during same-list drag so sibling content (footers etc.) doesn't shift.\n * Uses O(1) prefix-sum lookup when possible.\n */\n getTotalHeight(itemCount: number): number {\n this.#rebuildIfDirty();\n\n if (itemCount <= 0) return 0;\n\n const keyCount = this.#keys.length;\n if (keyCount === 0) return itemCount * this.#estimatedHeight;\n\n if (itemCount >= keyCount) {\n // All known items + estimated for any extras\n return this.#getTotalHeightRaw() + (itemCount - keyCount) * this.#estimatedHeight;\n }\n\n // Partial: prefix sum up to itemCount\n return this.#offsets[itemCount - 1] + this.getHeight(itemCount - 1);\n }\n\n /**\n * Find the first visible index for a given scrollTop.\n * Uses binary search on the prefix-sum offsets (excluding the excluded item).\n */\n findFirstVisibleIndex(scrollTop: number): number {\n this.#rebuildIfDirty();\n\n const count = this.#keys.length;\n if (count === 0) return 0;\n\n // Binary search for the first item whose bottom edge is past scrollTop\n let lo = 0;\n let hi = count - 1;\n let result = 0;\n\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const offset = this.getOffset(mid);\n if (offset <= scrollTop) {\n result = mid;\n lo = mid + 1;\n } else {\n hi = mid - 1;\n }\n }\n\n return result;\n }\n\n /**\n * Count visible items from startIndex within containerHeight.\n */\n getVisibleCount(startIndex: number, containerHeight: number): number {\n if (containerHeight <= 0) return 0;\n\n const count = this.#keys.length;\n let accumulated = 0;\n let visible = 0;\n let stopIndex = count;\n\n for (let i = startIndex; i < count; i++) {\n if (i === this.#excludedIndex) continue;\n accumulated += this.getHeight(i);\n visible++;\n if (accumulated >= containerHeight) {\n stopIndex = i;\n break;\n }\n }\n\n // Add 1 for partially visible items\n if (visible === 0) return 0;\n const hasMoreItems = stopIndex < count - 1;\n return hasMoreItems ? visible + 1 : visible;\n }\n\n /**\n * Find the item index at a given pixel offset.\n * Used for drag index calculations with variable heights.\n */\n findIndexAtOffset(offset: number): number {\n this.#rebuildIfDirty();\n\n const count = this.#keys.length;\n if (count === 0) return 0;\n\n if (!Number.isFinite(offset)) {\n return offset < 0 ? 0 : count;\n }\n\n if (offset <= 0) {\n if (this.#excludedIndex === 0) {\n return count > 1 ? 1 : count;\n }\n return 0;\n }\n\n const excludedIndex = this.#excludedIndex;\n if (excludedIndex < 0 || excludedIndex >= count) {\n return this.#findFirstIndexWithBottomPastOffset(offset, 0, count - 1);\n }\n\n const excludedOffset = this.#offsets[excludedIndex];\n if (offset < excludedOffset && excludedIndex > 0) {\n return this.#findFirstIndexWithBottomPastOffset(offset, 0, excludedIndex - 1);\n }\n\n if (excludedIndex >= count - 1) {\n return count;\n }\n\n const excludedHeight = this.getHeight(excludedIndex);\n return this.#findFirstIndexWithBottomPastOffset(\n offset + excludedHeight,\n excludedIndex + 1,\n count - 1,\n );\n }\n\n /**\n * Set the excluded index for same-list drag.\n */\n setExcludedIndex(index: number | null): boolean {\n const nextIndex = index ?? -1;\n if (this.#excludedIndex === nextIndex) {\n return false;\n }\n\n this.#excludedIndex = nextIndex;\n return true;\n }\n\n /**\n * Find first logical index in [start, end] whose bottom edge is past offset.\n * Returns one-past-end when no match is found.\n */\n #findFirstIndexWithBottomPastOffset(offset: number, start: number, end: number): number {\n if (start > end) {\n return start;\n }\n\n let lo = start;\n let hi = end;\n let result = end + 1;\n\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const midBottom = this.#offsets[mid] + this.getHeight(mid);\n\n if (midBottom > offset) {\n result = mid;\n hi = mid - 1;\n } else {\n lo = mid + 1;\n }\n }\n\n return result;\n }\n\n /** Raw total height without exclusion */\n #getTotalHeightRaw(): number {\n this.#rebuildIfDirty();\n const len = this.#offsets.length;\n if (len === 0) return 0;\n return this.#offsets[len - 1] + this.getHeight(len - 1);\n }\n\n /** Rebuild prefix-sum array if dirty */\n #rebuildIfDirty(): void {\n if (!this.#dirty) return;\n this.#dirty = false;\n\n const count = this.#keys.length;\n if (this.#offsets.length !== count) {\n this.#offsets = new Array<number>(count);\n }\n\n let cumulative = 0;\n for (let i = 0; i < count; i++) {\n this.#offsets[i] = cumulative;\n cumulative += this.getHeight(i);\n }\n }\n}\n","import { signal, type Signal, type WritableSignal } from '@angular/core';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { HeightCache } from '../utils/height-cache';\n\n/**\n * Dynamic-height virtual scroll strategy.\n *\n * Uses a `HeightCache` with prefix-sum offsets and binary search for O(log N)\n * scroll-to-index lookups. Heights are tracked by trackBy key (survive\n * reordering) and auto-measured via ResizeObserver by the directive.\n *\n * The `version` signal bumps whenever heights change, causing dependent\n * computeds to re-evaluate.\n */\nexport class DynamicHeightStrategy implements VirtualScrollStrategy {\n readonly #cache: HeightCache;\n readonly #version: WritableSignal<number> = signal(0);\n\n readonly version: Signal<number> = this.#version.asReadonly();\n\n constructor(estimatedHeight: number) {\n this.#cache = new HeightCache(estimatedHeight);\n }\n\n getTotalHeight(itemCount: number): number {\n // Read version to subscribe to changes\n this.#version();\n return this.#cache.getTotalHeight(itemCount);\n }\n\n getFirstVisibleIndex(scrollTop: number): number {\n this.#version();\n return this.#cache.findFirstVisibleIndex(scrollTop);\n }\n\n getVisibleCount(startIndex: number, containerHeight: number): number {\n this.#version();\n return this.#cache.getVisibleCount(startIndex, containerHeight);\n }\n\n getOffsetForIndex(index: number): number {\n this.#version();\n return this.#cache.getOffset(index);\n }\n\n getItemHeight(index: number): number {\n this.#version();\n return this.#cache.getHeight(index);\n }\n\n setMeasuredHeight(key: unknown, height: number): void {\n const changed = this.#cache.setHeight(key, height);\n if (changed) {\n this.#version.update((v) => v + 1);\n }\n }\n\n setItemKeys(keys: unknown[]): void {\n const changed = this.#cache.setKeys(keys);\n if (changed) {\n this.#version.update((v) => v + 1);\n }\n }\n\n setExcludedIndex(index: number | null): void {\n const changed = this.#cache.setExcludedIndex(index);\n if (changed) {\n this.#version.update((v) => v + 1);\n }\n }\n\n findIndexAtOffset(offset: number): number {\n this.#version();\n return this.#cache.findIndexAtOffset(offset);\n }\n\n getItemCount(): number {\n this.#version();\n return this.#cache.itemCount;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Interface for a scroll container that can be used with VirtualForDirective.\n * Implement this interface to create custom scroll containers.\n *\n * The scrollTop() and containerHeight() methods should return reactive values\n * (internally backed by signals) so that changes trigger re-computation in\n * the virtual scroll directive.\n */\nexport interface VdndScrollContainer {\n /** The native HTML element that handles scrolling */\n readonly nativeElement: HTMLElement;\n\n /** Current scroll position from top in pixels (reactive) */\n scrollTop(): number;\n\n /** Current container height in pixels (reactive) */\n containerHeight(): number;\n\n /** Scroll to a specific position */\n scrollTo(options: ScrollToOptions): void;\n}\n\n/**\n * Injection token for providing a scroll container to VirtualForDirective.\n *\n * Use the `vdndScrollable` directive to provide this token, or implement\n * `VdndScrollContainer` and provide it manually.\n *\n * @example\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n */\nexport const VDND_SCROLL_CONTAINER = new InjectionToken<VdndScrollContainer>(\n 'VDND_SCROLL_CONTAINER'\n);\n","import { InjectionToken } from '@angular/core';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\n\n/**\n * Interface for a virtual viewport that provides wrapper-based positioning.\n * Components implementing this interface provide a content wrapper with\n * GPU-accelerated transform positioning for efficient virtual scrolling.\n */\nexport interface VdndVirtualViewport {\n /** Current scroll position */\n scrollTop(): number;\n\n /** Height of the viewport container */\n containerHeight(): number;\n\n /** Height of each item in pixels */\n itemHeight(): number;\n\n /** Offset for content below headers (page-level scroll scenarios) */\n contentOffset(): number;\n\n /** The native element of the viewport */\n readonly nativeElement: HTMLElement;\n\n /**\n * Called by VirtualForDirective to inform the viewport of the actual\n * first rendered item index (accounting for overscan). The viewport\n * uses this to position the content wrapper correctly.\n */\n setRenderStartIndex(index: number): void;\n\n /**\n * Get the pixel offset for a given item index.\n * Uses the strategy pattern to support both fixed and dynamic heights.\n */\n getOffsetForIndex(index: number): number;\n\n /**\n * The virtual scroll strategy used by this viewport.\n * Available for drag-drop integration and external consumers.\n */\n readonly strategy: VirtualScrollStrategy | null;\n}\n\n/**\n * Injection token for virtual viewport.\n * VirtualForDirective optionally injects this to detect if it's inside\n * a viewport component that handles wrapper-based positioning.\n */\nexport const VDND_VIRTUAL_VIEWPORT = new InjectionToken<VdndVirtualViewport>(\n 'VDND_VIRTUAL_VIEWPORT',\n);\n","import { computed, effect, Injectable, signal } from '@angular/core';\nimport { CursorPosition, DraggedItem, DragState, GrabOffset } from '../models/drag-drop.models';\n\n/**\n * Internal state type without high-frequency fields.\n * `cursorPosition`, `keyboardTargetIndex`, `activeDroppableId`, `placeholderId`\n * and `placeholderIndex` are split into dedicated signals so that high-frequency\n * pointer/placeholder updates don't trigger re-evaluation of rarely-changing\n * computeds (or rebuild the core state object every frame).\n */\ntype CoreDragState = Omit<\n DragState,\n | 'cursorPosition'\n | 'keyboardTargetIndex'\n | 'activeDroppableId'\n | 'placeholderId'\n | 'placeholderIndex'\n>;\n\nconst INITIAL_CORE_STATE: CoreDragState = {\n isDragging: false,\n draggedItem: null,\n sourceDroppableId: null,\n sourceIndex: null,\n grabOffset: null,\n initialPosition: null,\n lockAxis: null,\n isKeyboardDrag: false,\n};\n\n/**\n * Central service for managing drag-and-drop state.\n * Uses signals for reactive state management.\n *\n * Architecture: High-frequency fields (`cursorPosition`, `keyboardTargetIndex`,\n * `activeDroppableId`, `placeholderId`, `placeholderIndex`) are stored in dedicated\n * signals, separate from the core state. This prevents 60fps cursor and\n * placeholder updates from rebuilding the core state object or re-evaluating the\n * 8+ computeds that only depend on rarely-changing properties (isDragging,\n * draggedItem, etc.).\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DragStateService {\n /** Core state signal — contains all rarely-changing properties */\n readonly #state = signal<CoreDragState>(INITIAL_CORE_STATE);\n\n /** High-frequency cursor position — updated at 60fps during pointer drag */\n readonly #cursorPosition = signal<CursorPosition | null>(null);\n\n /** High-frequency keyboard target index — updated on each arrow key press */\n readonly #keyboardTargetIndex = signal<number | null>(null);\n\n /** ID of the droppable currently being hovered over — changes on droppable crossings */\n readonly #activeDroppableId = signal<string | null>(null);\n\n /** ID of the item the placeholder should appear before */\n readonly #placeholderId = signal<string | null>(null);\n\n /** Index where the placeholder should be inserted — updated on each placeholder move */\n readonly #placeholderIndex = signal<number | null>(null);\n\n /** Snapshot captured synchronously immediately before the last drag state reset. */\n readonly #endedDragState = signal<DragState | null>(null);\n\n /** Flag indicating if the last drag was cancelled (not dropped) */\n readonly #wasCancelled = signal<boolean>(false);\n\n /** Whether the last drag was cancelled (for droppable to check before emitting drop) */\n readonly wasCancelled = this.#wasCancelled.asReadonly();\n\n /** Snapshot captured synchronously before the last drag reset. */\n readonly endedDragState = this.#endedDragState.asReadonly();\n\n /** Whether a drag operation is in progress */\n readonly isDragging = computed(() => this.#state().isDragging);\n\n /** The currently dragged item, or null */\n readonly draggedItem = computed(() => this.#state().draggedItem);\n\n /** ID of the currently dragged item, or null (convenience signal for filtering) */\n readonly draggedItemId = computed(() => this.#state().draggedItem?.draggableId ?? null);\n\n /** ID of the droppable where the drag started */\n readonly sourceDroppableId = computed(() => this.#state().sourceDroppableId);\n\n /** Original index of the dragged item in the source list */\n readonly sourceIndex = computed(() => this.#state().sourceIndex);\n\n /** ID of the droppable currently being hovered over */\n readonly activeDroppableId = this.#activeDroppableId.asReadonly();\n\n /** ID of the item the placeholder should appear before */\n readonly placeholderId = this.#placeholderId.asReadonly();\n\n /** Index where the placeholder should be inserted */\n readonly placeholderIndex = this.#placeholderIndex.asReadonly();\n\n /** Current cursor position */\n readonly cursorPosition = this.#cursorPosition.asReadonly();\n\n /** Offset from cursor to element top-left (for maintaining grab position) */\n readonly grabOffset = computed(() => this.#state().grabOffset);\n\n /** Position when drag started (for axis locking) */\n readonly initialPosition = computed(() => this.#state().initialPosition);\n\n /** Axis to lock movement to */\n readonly lockAxis = computed(() => this.#state().lockAxis);\n\n /** Whether this is a keyboard-initiated drag */\n readonly isKeyboardDrag = computed(() => this.#state().isKeyboardDrag);\n\n /** Target index during keyboard navigation */\n readonly keyboardTargetIndex = this.#keyboardTargetIndex.asReadonly();\n\n constructor() {\n // Inject cursor styles once (for consistent grabbing cursor during drag)\n if (typeof document !== 'undefined') {\n const styleId = 'vdnd-cursor-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n body.vdnd-dragging,\n body.vdnd-dragging * {\n cursor: grabbing !important;\n }\n `;\n document.head.appendChild(style);\n }\n }\n\n // Effect to toggle body class during drag\n effect(() => {\n if (typeof document === 'undefined') return;\n const isDragging = this.isDragging();\n document.body.classList.toggle('vdnd-dragging', isDragging);\n });\n }\n\n /**\n * Start a drag operation.\n */\n startDrag(\n item: DraggedItem,\n cursorPosition?: CursorPosition,\n grabOffset?: GrabOffset,\n lockAxis?: 'x' | 'y' | null,\n activeDroppableId?: string | null,\n placeholderId?: string | null,\n placeholderIndex?: number | null,\n sourceIndex?: number | null,\n isKeyboardDrag?: boolean,\n axisLockPosition?: CursorPosition,\n ): void {\n // Reset terminal drag metadata at start of new drag\n this.#endedDragState.set(null);\n this.#wasCancelled.set(false);\n this.#cursorPosition.set(cursorPosition ?? null);\n this.#keyboardTargetIndex.set(isKeyboardDrag ? (sourceIndex ?? 0) : null);\n this.#activeDroppableId.set(activeDroppableId ?? null);\n this.#placeholderId.set(placeholderId ?? null);\n this.#placeholderIndex.set(placeholderIndex ?? null);\n this.#state.set({\n isDragging: true,\n draggedItem: item,\n sourceDroppableId: item.droppableId,\n sourceIndex: sourceIndex ?? null,\n grabOffset: grabOffset ?? null,\n initialPosition: axisLockPosition ?? cursorPosition ?? null,\n lockAxis: lockAxis ?? null,\n isKeyboardDrag: isKeyboardDrag ?? false,\n });\n }\n\n /**\n * Update the drag position and targets.\n */\n updateDragPosition(update: {\n cursorPosition: CursorPosition;\n activeDroppableId: string | null;\n placeholderId: string | null;\n placeholderIndex: number | null;\n }): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n // Write cursor to dedicated high-frequency signal\n this.#cursorPosition.set(update.cursorPosition);\n\n // Each target lives in its own signal, so a placeholder-only frame never\n // rebuilds the core state object or re-fires the rarely-changing computeds.\n // Signals already no-op on identical values, so unconditional sets are safe.\n this.#activeDroppableId.set(update.activeDroppableId);\n this.#placeholderId.set(update.placeholderId);\n this.#placeholderIndex.set(update.placeholderIndex);\n }\n\n /**\n * Update just the active droppable.\n */\n setActiveDroppable(droppableId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#activeDroppableId.set(droppableId);\n }\n\n /**\n * Update just the placeholder position.\n */\n setPlaceholder(placeholderId: string | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#placeholderId.set(placeholderId);\n }\n\n /**\n * Update only the placeholder signals without touching cursor position or active droppable.\n *\n * Used by the autoscroll scroll-only fast path: when a scroll fires, the cursor has not\n * moved, so only the placeholder index needs recalculation. Skipping the cursor and\n * active-droppable writes avoids spurious re-evaluation of computeds that read those signals.\n */\n updateScrollOnlyPlaceholder(placeholderId: string | null, placeholderIndex: number | null): void {\n if (!this.#state().isDragging) {\n return;\n }\n\n this.#placeholderId.set(placeholderId);\n this.#placeholderIndex.set(placeholderIndex);\n }\n\n /**\n * End the drag operation and reset state (normal drop).\n */\n endDrag(): void {\n this.#endedDragState.set(this.getStateSnapshot());\n this.#wasCancelled.set(false);\n this.#resetHighFrequencySignals();\n this.#state.set(INITIAL_CORE_STATE);\n }\n\n /**\n * Cancel the drag operation (escape key, disabled, etc.).\n */\n cancelDrag(): void {\n this.#endedDragState.set(this.getStateSnapshot());\n this.#wasCancelled.set(true);\n this.#resetHighFrequencySignals();\n this.#state.set(INITIAL_CORE_STATE);\n }\n\n /**\n * Reset the dedicated high-frequency signals to their initial null state.\n */\n #resetHighFrequencySignals(): void {\n this.#cursorPosition.set(null);\n this.#keyboardTargetIndex.set(null);\n this.#activeDroppableId.set(null);\n this.#placeholderId.set(null);\n this.#placeholderIndex.set(null);\n }\n\n /**\n * Check if a specific droppable is currently active.\n */\n isDroppableActive(droppableId: string): boolean {\n return this.#activeDroppableId() === droppableId;\n }\n\n /**\n * Get the current state snapshot (for event creation).\n */\n getStateSnapshot(): DragState {\n return {\n ...this.#state(),\n activeDroppableId: this.#activeDroppableId(),\n placeholderId: this.#placeholderId(),\n placeholderIndex: this.#placeholderIndex(),\n cursorPosition: this.#cursorPosition(),\n keyboardTargetIndex: this.#keyboardTargetIndex(),\n };\n }\n\n /**\n * Update the keyboard target index (for keyboard drag navigation).\n * Also updates placeholder position to match, applying same-list adjustment.\n */\n setKeyboardTargetIndex(targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n const state = this.#state();\n // Same-list adjustment: if target is at or after source, add 1\n // This accounts for the hidden item shifting everything up visually\n const sourceDroppableId = state.draggedItem?.droppableId;\n const activeDroppableId = this.#activeDroppableId();\n const isSameList = sourceDroppableId === activeDroppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n this.#keyboardTargetIndex.set(targetIndex);\n this.#placeholderIndex.set(placeholderIndex);\n }\n\n /**\n * Update the active droppable during keyboard navigation (for cross-list moves).\n */\n setKeyboardActiveDroppable(droppableId: string | null, targetIndex: number): void {\n if (!this.#state().isDragging || !this.#state().isKeyboardDrag) {\n return;\n }\n\n const state = this.#state();\n // Same-list adjustment: if moving back to source list and target is at or after source, add 1\n const sourceDroppableId = state.draggedItem?.droppableId;\n const isSameList = sourceDroppableId === droppableId;\n const sourceIndex = state.sourceIndex ?? -1;\n\n let placeholderIndex = targetIndex;\n if (isSameList && sourceIndex >= 0 && targetIndex >= sourceIndex) {\n placeholderIndex = targetIndex + 1;\n }\n\n this.#keyboardTargetIndex.set(targetIndex);\n this.#activeDroppableId.set(droppableId);\n this.#placeholderIndex.set(placeholderIndex);\n }\n}\n","/**\n * Query by an exact attribute value without interpolating consumer data into a CSS selector.\n *\n * CSS attribute selectors need string-specific escaping that differs from `CSS.escape()`.\n * Filtering candidates by attribute presence avoids selector syntax errors for IDs containing\n * quotes, brackets, backslashes, or other selector-sensitive characters.\n */\nexport function queryByAttribute<T extends Element>(\n root: ParentNode,\n attributeName: string,\n attributeValue: string,\n): T | null {\n const candidates = root.querySelectorAll<T>(`[${attributeName}]`);\n\n for (const candidate of candidates) {\n if (candidate.getAttribute(attributeName) === attributeValue) {\n return candidate;\n }\n }\n\n return null;\n}\n\nexport function queryAllByAttribute<T extends Element>(\n root: ParentNode,\n attributeName: string,\n attributeValue: string,\n): T[] {\n return Array.from(root.querySelectorAll<T>(`[${attributeName}]`)).filter(\n (candidate) => candidate.getAttribute(attributeName) === attributeValue,\n );\n}\n","import { inject, Injectable, NgZone } from '@angular/core';\nimport { queryAllByAttribute, queryByAttribute } from '../utils/attribute-selectors';\n\n/**\n * Snapshot of the candidate droppables for an active drag session.\n * Rects are cached so per-pointermove hit-testing is pure geometry, avoiding the\n * forced layout flush that `document.elementFromPoint` (plus the pointer-events\n * style write it required) imposed on the hottest drag loop.\n */\ninterface DragSessionSnapshot {\n groupName: string;\n /** Candidate droppables in document order (document order === default paint order). */\n candidates: HTMLElement[];\n /** Cached bounding rects, parallel to `candidates`. */\n rects: DOMRect[];\n /** When true, rects are re-read on the next hit-test (set on scroll/resize). */\n dirty: boolean;\n /**\n * When true, the candidate *list* (not just its rects) is re-queried on the next\n * hit-test. Set when a droppable is added/removed mid-drag so a newly mounted\n * target becomes hit-testable and a removed one stops lingering.\n */\n candidatesStale: boolean;\n /** Bound scroll/resize listener used to mark rects dirty. */\n onViewportChange: () => void;\n /**\n * ResizeObserver watching the candidate droppables so a container-only layout\n * change (which fires no window scroll/resize) still invalidates cached rects.\n * Null when `ResizeObserver` is unavailable (e.g. SSR / jsdom).\n */\n resizeObserver: ResizeObserver | null;\n}\n\n/**\n * Service for calculating drop positions and finding elements at cursor positions.\n * This is the core algorithm that makes virtual scroll + drag-and-drop work together.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class PositionCalculatorService {\n readonly #ngZone = inject(NgZone);\n\n /** Data attribute used to identify droppable elements */\n readonly #DROPPABLE_ID_ATTR = 'data-droppable-id';\n\n /** Data attribute used to identify droppable groups */\n readonly #DROPPABLE_GROUP_ATTR = 'data-droppable-group';\n\n /** Data attribute reflecting a droppable's disabled state (present === disabled) */\n readonly #DROPPABLE_DISABLED_ATTR = 'data-droppable-disabled';\n\n /** Data attribute used to identify draggable elements */\n readonly #DRAGGABLE_ID_ATTR = 'data-draggable-id';\n\n /** Maximum DOM levels to traverse when looking for parent elements */\n readonly #MAX_PARENT_TRAVERSAL = 15;\n\n /** Reusable result object for getNearEdge (avoids per-frame allocation) */\n readonly #nearEdgeResult = { top: false, bottom: false, left: false, right: false };\n\n /** Active drag session rect snapshot, or null when no drag is in progress. */\n #session: DragSessionSnapshot | null = null;\n\n /**\n * Begin a drag session: snapshot the candidate droppables for `groupName` and\n * their rects once, then watch for viewport changes (scroll/resize) that would\n * invalidate those rects. While a session is active, `findDroppableAtPoint`\n * runs as pure geometry against the cached rects instead of `elementFromPoint`.\n *\n * Safe to call repeatedly — a new call replaces any previous session.\n */\n beginDragSession(groupName: string): void {\n this.endDragSession();\n\n const candidates = this.#queryDroppables(groupName);\n const onViewportChange = () => {\n if (this.#session) {\n this.#session.dirty = true;\n }\n };\n\n this.#session = {\n groupName,\n candidates,\n rects: candidates.map((el) => this.#measureRect(el)),\n dirty: false,\n candidatesStale: false,\n onViewportChange,\n resizeObserver: this.#createResizeObserver(),\n };\n\n // A container-only reflow (an element resize that fires no window scroll/resize)\n // would otherwise leave stale rects — observe the candidates so it marks them dirty.\n this.#observeCandidates(this.#session);\n\n // Capture-phase scroll catches scrolling on any ancestor scroller (scroll does\n // not bubble); resize covers viewport changes. Both only mark rects dirty —\n // the actual re-read is deferred to the next hit-test.\n if (typeof window !== 'undefined') {\n this.#ngZone.runOutsideAngular(() => {\n window.addEventListener('scroll', onViewportChange, { capture: true, passive: true });\n window.addEventListener('resize', onViewportChange, { passive: true });\n });\n }\n }\n\n /**\n * End the current drag session and detach viewport listeners.\n * Safe to call when no session is active.\n */\n endDragSession(): void {\n const session = this.#session;\n if (!session) {\n return;\n }\n this.#session = null;\n session.resizeObserver?.disconnect();\n if (typeof window !== 'undefined') {\n window.removeEventListener('scroll', session.onViewportChange, { capture: true });\n window.removeEventListener('resize', session.onViewportChange);\n }\n }\n\n /**\n * Mark the cached droppable rects as stale so they are re-read on the next\n * hit-test. Called explicitly from the autoscroll recalculation path, where the\n * scroll event has not yet fired but the container has already moved.\n */\n invalidateDroppableRects(): void {\n if (this.#session) {\n this.#session.dirty = true;\n }\n }\n\n /**\n * Re-query the candidate droppable *list* for the active session and re-read their\n * rects. Unlike {@link invalidateDroppableRects} (which only refreshes rects), this\n * picks up droppables added or removed since the snapshot was captured at drag start —\n * the frozen candidate list is otherwise blind to mid-drag mounts/unmounts.\n *\n * Safe to call when no session is active (no-op).\n */\n refreshCandidates(): void {\n const session = this.#session;\n if (!session) {\n return;\n }\n session.candidates = this.#queryDroppables(session.groupName);\n session.rects = session.candidates.map((el) => this.#measureRect(el));\n session.dirty = false;\n session.candidatesStale = false;\n this.#observeCandidates(session);\n }\n\n /**\n * Signal that the set of droppables for `groupName` may have changed (a droppable\n * registered or unregistered mid-drag). Defers the actual re-query to the next\n * hit-test — where a removed element is already gone from the DOM and a newly added\n * one has its data attributes applied — keeping this notification path cheap.\n *\n * Called by {@link DroppableDirective} lifecycle hooks. No-op when the active session\n * belongs to a different group or no session is active.\n */\n notifyCandidatesChanged(groupName: string): void {\n if (this.#session && this.#session.groupName === groupName) {\n this.#session.candidatesStale = true;\n }\n }\n\n /**\n * Find the droppable element at a given point.\n *\n * Uses pure geometric hit-testing against snapshotted droppable rects. When a\n * drag session is active (see {@link beginDragSession}) the rects are cached and\n * reused across frames; otherwise a one-shot DOM query is performed. The\n * `draggedElement` parameter is retained for API compatibility but no longer\n * needs to be hidden — geometry does not depend on cursor occlusion.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param _draggedElement - The element being dragged (unused; kept for compatibility)\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable element, or null if none found\n */\n findDroppableAtPoint(\n x: number,\n y: number,\n _draggedElement: HTMLElement,\n groupName: string,\n ): HTMLElement | null {\n const session = this.#session;\n if (session && session.groupName === groupName) {\n if (session.candidatesStale) {\n // A droppable was added/removed mid-drag: re-query the list (also refreshes rects).\n this.refreshCandidates();\n } else if (session.dirty) {\n for (let i = 0; i < session.candidates.length; i++) {\n session.rects[i] = this.#measureRect(session.candidates[i]);\n }\n session.dirty = false;\n }\n return this.#hitTest(x, y, session.candidates, session.rects);\n }\n\n // No active session: one-shot geometric query (still avoids elementFromPoint).\n const candidates = this.#queryDroppables(groupName);\n const rects = candidates.map((el) => this.#measureRect(el));\n return this.#hitTest(x, y, candidates, rects);\n }\n\n /**\n * Look up a droppable element by its ID.\n *\n * When a drag session is active, searches the cached candidate list (O(n), avoids a DOM\n * query). Falls back to `document.querySelector` when no session is active.\n *\n * Intended for the autoscroll scroll-only fast path, where the active droppable is already\n * known and only the placeholder index needs recalculation.\n */\n getDroppableById(id: string): HTMLElement | null {\n if (this.#session) {\n for (const candidate of this.#session.candidates) {\n if (candidate.getAttribute(this.#DROPPABLE_ID_ATTR) === id) {\n return candidate;\n }\n }\n return null;\n }\n\n if (typeof document === 'undefined') {\n return null;\n }\n return queryByAttribute<HTMLElement>(document, this.#DROPPABLE_ID_ATTR, id);\n }\n\n /**\n * Query all droppable elements belonging to a group, in document order.\n *\n * All group members are included — the disabled check happens per-frame in\n * {@link #hitTest} rather than here, because a droppable can be disabled or\n * re-enabled mid-drag (e.g. a consumer disabling incompatible targets from a\n * `(dragStart)` handler, which fires AFTER the candidate snapshot is captured).\n */\n #queryDroppables(groupName: string): HTMLElement[] {\n if (typeof document === 'undefined') {\n return [];\n }\n return queryAllByAttribute<HTMLElement>(document, this.#DROPPABLE_GROUP_ATTR, groupName);\n }\n\n /**\n * Measure a candidate's hit-test rect, clipped to its nearest `.vdnd-scrollable`\n * ancestor. Without clipping a droppable scrolled mostly out of a clipping container\n * still hit-tests over its full unclipped rect (issue #23 case 3). The intersection is\n * built as a plain DOMRect; an empty intersection yields a negative width/height so the\n * `#hitTest` bounds check can never match it.\n */\n #measureRect(el: HTMLElement): DOMRect {\n const rect = el.getBoundingClientRect();\n const scrollable = el.closest('.vdnd-scrollable');\n if (!scrollable || scrollable === el) {\n return rect;\n }\n\n const clip = scrollable.getBoundingClientRect();\n const top = Math.max(rect.top, clip.top);\n const left = Math.max(rect.left, clip.left);\n const right = Math.min(rect.right, clip.right);\n const bottom = Math.min(rect.bottom, clip.bottom);\n return new DOMRect(left, top, right - left, bottom - top);\n }\n\n /**\n * Create a ResizeObserver (run outside Angular per CLAUDE.md) that marks the session's\n * cached rects dirty when a candidate resizes. Returns null when ResizeObserver is\n * unavailable (SSR / jsdom) so callers degrade gracefully.\n */\n #createResizeObserver(): ResizeObserver | null {\n if (typeof ResizeObserver === 'undefined') {\n return null;\n }\n return this.#ngZone.runOutsideAngular(\n () =>\n new ResizeObserver(() => {\n if (this.#session) {\n this.#session.dirty = true;\n }\n }),\n );\n }\n\n /**\n * Point the session's ResizeObserver at the current candidate list, dropping any\n * previously observed elements. Called on session start and whenever the candidate\n * list is refreshed.\n */\n #observeCandidates(session: DragSessionSnapshot): void {\n const observer = session.resizeObserver;\n if (!observer) {\n return;\n }\n this.#ngZone.runOutsideAngular(() => {\n observer.disconnect();\n for (const candidate of session.candidates) {\n observer.observe(candidate);\n }\n });\n }\n\n /**\n * Whether a droppable element is currently disabled (reflected via the\n * `data-droppable-disabled` attribute by `DroppableDirective`). Read live on each\n * hit-test / navigation step so disabled↔enabled transitions during an active drag\n * take effect immediately. Disabled droppables are excluded from all drag-time\n * candidate sets — pointer hit-testing and keyboard cross-list navigation.\n */\n #isDroppableDisabled(el: HTMLElement): boolean {\n return el.hasAttribute(this.#DROPPABLE_DISABLED_ATTR);\n }\n\n /**\n * Geometric hit-test: return the last candidate (in document order) whose rect\n * contains the point. \"Last in document order\" reproduces the painter's-order\n * tie-break that `elementFromPoint` provided for free — a nested or later\n * overlapping droppable is painted on top of an earlier/ancestor one.\n *\n * Currently-disabled candidates are skipped here (not filtered from the snapshot) so\n * that toggling `disabled` mid-drag takes effect on the very next frame. The check is\n * a cheap `hasAttribute` read that does not force layout, keeping the loop hot.\n */\n #hitTest(x: number, y: number, candidates: HTMLElement[], rects: DOMRect[]): HTMLElement | null {\n let match: HTMLElement | null = null;\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i];\n if (this.#isDroppableDisabled(candidate)) {\n continue;\n }\n const r = rects[i];\n if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) {\n match = candidate;\n }\n }\n return match;\n }\n\n /**\n * Find the draggable element at a given point.\n *\n * @param x - Cursor X coordinate\n * @param y - Cursor Y coordinate\n * @param draggedElement - The element being dragged (will be temporarily hidden)\n * @returns The draggable element, or null if none found\n */\n findDraggableAtPoint(x: number, y: number, draggedElement: HTMLElement): HTMLElement | null {\n const isHidden = draggedElement.offsetParent === null;\n\n let originalPointerEvents: string | undefined;\n if (!isHidden) {\n originalPointerEvents = draggedElement.style.pointerEvents;\n draggedElement.style.pointerEvents = 'none';\n }\n\n try {\n const elementAtPoint = document.elementFromPoint(x, y);\n if (!elementAtPoint) {\n return null;\n }\n\n return this.getDraggableParent(elementAtPoint as HTMLElement);\n } finally {\n if (!isHidden) {\n draggedElement.style.pointerEvents = originalPointerEvents!;\n }\n }\n }\n\n /**\n * Walk up the DOM tree to find a droppable parent element.\n *\n * @param element - Starting element\n * @param groupName - The drag-and-drop group name to filter by\n * @returns The droppable parent element, or null if none found\n */\n getDroppableParent(element: HTMLElement, groupName: string): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const foundGroup = current.getAttribute(this.#DROPPABLE_GROUP_ATTR);\n\n if (foundGroup && foundGroup === groupName) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Walk up the DOM tree to find a draggable parent element.\n *\n * @param element - Starting element\n * @returns The draggable parent element, or null if none found\n */\n getDraggableParent(element: HTMLElement): HTMLElement | null {\n let current: HTMLElement | null = element;\n let count = 0;\n\n while (current && current.tagName !== 'BODY' && count < this.#MAX_PARENT_TRAVERSAL) {\n const draggableId = current.getAttribute(this.#DRAGGABLE_ID_ATTR);\n\n if (draggableId) {\n return current;\n }\n\n current = current.parentElement;\n count++;\n }\n\n return null;\n }\n\n /**\n * Get the draggable ID from an element.\n */\n getDraggableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DRAGGABLE_ID_ATTR);\n }\n\n /**\n * Get the droppable ID from an element.\n */\n getDroppableId(element: HTMLElement): string | null {\n return element.getAttribute(this.#DROPPABLE_ID_ATTR);\n }\n\n /**\n * Calculate the drop index based on mathematical position.\n *\n * This is an alternative approach that doesn't require the target element\n * to be in the DOM. Useful when the target might be virtualized away.\n *\n * @param scrollTop - Current scroll position of the container\n * @param cursorY - Cursor Y position (viewport-relative)\n * @param containerTop - Top position of the container (viewport-relative)\n * @param itemHeight - Height of each item\n * @param totalItems - Total number of items in the list\n * @returns The calculated drop index\n */\n calculateDropIndex(\n scrollTop: number,\n cursorY: number,\n containerTop: number,\n itemHeight: number,\n totalItems: number,\n ): number {\n // Calculate the position relative to the container's content\n const relativeY = cursorY - containerTop + scrollTop;\n\n // Calculate which item index this corresponds to\n const index = Math.floor(relativeY / itemHeight);\n\n // Clamp to valid range\n return Math.max(0, Math.min(index, totalItems));\n }\n\n /**\n * Check if a point is within a specific threshold of a container's edge.\n *\n * @param position - Current cursor position\n * @param containerRect - Container's bounding rect\n * @param threshold - Distance from edge to trigger (in pixels)\n * @returns Object indicating which edges are near\n */\n getNearEdge(\n position: { x: number; y: number },\n containerRect: DOMRect,\n threshold: number,\n ): { top: boolean; bottom: boolean; left: boolean; right: boolean } {\n this.#nearEdgeResult.top = position.y - containerRect.top <= threshold;\n this.#nearEdgeResult.bottom = containerRect.bottom - position.y <= threshold;\n this.#nearEdgeResult.left = position.x - containerRect.left <= threshold;\n this.#nearEdgeResult.right = containerRect.right - position.x <= threshold;\n return this.#nearEdgeResult;\n }\n\n /**\n * Determine if the cursor is inside a container.\n */\n isInsideContainer(position: { x: number; y: number }, containerRect: DOMRect): boolean {\n return (\n position.x >= containerRect.left &&\n position.x <= containerRect.right &&\n position.y >= containerRect.top &&\n position.y <= containerRect.bottom\n );\n }\n\n /**\n * Find an adjacent droppable in the specified direction (left or right).\n * Used for cross-list keyboard navigation.\n *\n * @param currentDroppableId - The ID of the current droppable\n * @param direction - 'left' or 'right'\n * @param groupName - The drag-and-drop group name\n * @returns Object with droppable info, or null if none found\n */\n findAdjacentDroppable(\n currentDroppableId: string,\n direction: 'left' | 'right',\n groupName: string,\n ): { element: HTMLElement; id: string } | null {\n // Include disabled droppables when establishing left-to-right order and locating the\n // current container — otherwise a container disabled mid-drag (its own index becomes\n // -1) would trap the drag with no reachable neighbour. Disabled droppables are skipped\n // as *targets* during the outward scan below instead.\n const allDroppables = queryAllByAttribute<HTMLElement>(\n document,\n this.#DROPPABLE_GROUP_ATTR,\n groupName,\n );\n\n if (allDroppables.length <= 1) {\n return null;\n }\n\n // Get bounding rects, IDs, and disabled state, sorted by X position\n const droppableInfos: { element: HTMLElement; id: string; rect: DOMRect; disabled: boolean }[] =\n [];\n\n allDroppables.forEach((el) => {\n const htmlEl = el as HTMLElement;\n const id = htmlEl.getAttribute(this.#DROPPABLE_ID_ATTR);\n if (id) {\n droppableInfos.push({\n element: htmlEl,\n id,\n rect: htmlEl.getBoundingClientRect(),\n disabled: this.#isDroppableDisabled(htmlEl),\n });\n }\n });\n\n // Sort by X position (left to right)\n droppableInfos.sort((a, b) => a.rect.left - b.rect.left);\n\n // Find current droppable index (among all, including a now-disabled current container)\n const currentIndex = droppableInfos.findIndex((d) => d.id === currentDroppableId);\n if (currentIndex === -1) {\n return null;\n }\n\n // Scan outward in the requested direction, skipping disabled droppables, until the\n // first enabled neighbour (or run off the end of the list).\n const step = direction === 'left' ? -1 : 1;\n for (let i = currentIndex + step; i >= 0 && i < droppableInfos.length; i += step) {\n const target = droppableInfos[i];\n if (target.disabled) {\n continue;\n }\n return {\n element: target.element,\n id: target.id,\n };\n }\n\n return null;\n }\n\n /**\n * Whether the droppable with the given ID is currently disabled. A droppable that cannot\n * be found is reported as disabled (treat missing as not a valid target). Used to\n * revalidate a keyboard drag's active target at drop time, since it may have been disabled\n * after the drag navigated into it.\n */\n isDroppableDisabledById(id: string): boolean {\n const element = this.getDroppableById(id);\n return element === null || this.#isDroppableDisabled(element);\n }\n}\n","import { inject, Injectable, NgZone } from '@angular/core';\nimport { CursorPosition } from '../models/drag-drop.models';\n\n/**\n * Callback invoked each RAF frame with the latest cursor and a dirty flag.\n *\n * @param cursor — Latest cursor position queued via `queueCursorUpdate()`, or null if none.\n * @param cursorDirty — True when cursor was updated since the previous frame.\n */\nexport type SchedulerTickFn = (cursor: CursorPosition | null, cursorDirty: boolean) => void;\n\n/**\n * Single RAF loop that coordinates all drag-frame work in ordered phases:\n *\n * 1. Participant phase (READ+WRITE): registered participants run first.\n * AutoScrollService registers here to perform edge-scroll + immediate\n * placeholder recalculation in the same synchronous frame — preserving\n * the Safari synchronous-callback constraint.\n * 2. Main compute phase (COMPUTE+WRITE): onTick is called with the latest\n * cursor. Only runs when the cursor has changed (cursorDirty=true), so\n * autoscroll-only frames (cursor stationary) incur zero hit-test work.\n *\n * PointerDragHandler calls `queueCursorUpdate()` instead of managing its own\n * RAF per pointermove. This coalesces all moves within a frame into one update\n * and ensures pointer-move work always runs after participant work.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DragSchedulerService {\n readonly #ngZone = inject(NgZone);\n\n #rafId: number | null = null;\n #onTick: SchedulerTickFn | null = null;\n\n /** Latest cursor queued from pointer move events. */\n #pendingCursor: CursorPosition | null = null;\n /** True when a new cursor was queued since the last frame. */\n #cursorDirty = false;\n\n /** Tick participants called before the main compute phase each frame. */\n readonly #participants: (() => void)[] = [];\n\n /**\n * Start the scheduler RAF loop.\n * No-op if already running.\n */\n start(onTick: SchedulerTickFn): void {\n if (this.#rafId !== null) {\n return;\n }\n this.#onTick = onTick;\n this.#ngZone.runOutsideAngular(() => {\n this.#scheduleNextTick();\n });\n }\n\n /**\n * Stop the scheduler and cancel the pending RAF.\n * Safe to call when not running.\n */\n stop(): void {\n if (this.#rafId !== null) {\n cancelAnimationFrame(this.#rafId);\n this.#rafId = null;\n }\n // Null out onTick so that any in-flight RAF callback (race between cancel\n // and the browser delivering the frame) is a no-op.\n this.#onTick = null;\n this.#pendingCursor = null;\n this.#cursorDirty = false;\n }\n\n /**\n * Queue a cursor update from a pointer move event.\n * Multiple calls between frames are coalesced — only the latest matters.\n */\n queueCursorUpdate(position: CursorPosition): void {\n this.#pendingCursor = position;\n this.#cursorDirty = true;\n }\n\n /**\n * Register a function to be called at the start of each frame, before the main tick.\n * AutoScrollService registers here to perform edge-scroll within the same frame.\n * No-op if the same function reference is already registered.\n */\n addParticipant(fn: () => void): void {\n if (!this.#participants.includes(fn)) {\n this.#participants.push(fn);\n }\n }\n\n /**\n * Unregister a previously added participant.\n * No-op if the function was not registered.\n */\n removeParticipant(fn: () => void): void {\n const idx = this.#participants.indexOf(fn);\n if (idx !== -1) {\n this.#participants.splice(idx, 1);\n }\n }\n\n #scheduleNextTick(): void {\n this.#rafId = requestAnimationFrame(() => this.#tick());\n }\n\n #tick(): void {\n this.#rafId = null;\n\n // Guard against the race where stop() was called but the browser already\n // queued the callback before cancelAnimationFrame() could prevent delivery.\n if (!this.#onTick) {\n return;\n }\n\n // Snapshot and reset dirty flag before participants run so that any cursor\n // update they trigger (theoretically possible in future extensions) is\n // picked up in the NEXT frame, not folded into this one's compute phase.\n const cursorDirty = this.#cursorDirty;\n this.#cursorDirty = false;\n\n // Phase 1 — participants (autoscroll scroll + synchronous placeholder update)\n for (const participant of this.#participants) {\n participant();\n }\n\n // Phase 2 — main compute (cursor-based hit-test + signal write)\n this.#onTick(this.#pendingCursor, cursorDirty);\n\n // Reschedule only if still active (stop() may have been called by onTick).\n if (this.#onTick !== null) {\n this.#scheduleNextTick();\n }\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { CursorPosition } from '../models/drag-drop.models';\nimport { DragStateService } from './drag-state.service';\nimport { PositionCalculatorService } from './position-calculator.service';\nimport { DragSchedulerService } from './drag-scheduler.service';\n\n/**\n * Configuration for auto-scroll behavior.\n */\nexport interface AutoScrollConfig {\n /** Distance from edge to start scrolling (in pixels) */\n threshold: number;\n /** Maximum scroll speed in pixels per 60fps frame (about 16.67ms) */\n maxSpeed: number;\n /** Whether to accelerate scroll based on distance from edge */\n accelerate: boolean;\n}\n\n/**\n * Default auto-scroll configuration.\n */\nconst DEFAULT_CONFIG: AutoScrollConfig = {\n threshold: 50,\n maxSpeed: 15,\n accelerate: true,\n};\n\nconst BASE_FRAME_DURATION_MS = 1000 / 60;\nconst MIN_SCROLL_FRAME_SCALE = 1;\nconst MAX_SCROLL_FRAME_SCALE = 6;\n\n/**\n * Service that handles auto-scrolling when dragging near container edges.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AutoScrollService {\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #scheduler = inject(DragSchedulerService);\n\n /** Currently registered scrollable containers */\n #scrollableContainers = new Map<\n string,\n {\n element: HTMLElement;\n config: AutoScrollConfig;\n }\n >();\n\n /**\n * Candidate containers ordered innermost (deepest in the DOM) first, so a\n * nested scrollable wins over its ancestors under the cursor. Rebuilt lazily\n * whenever registrations change (containers rarely move mid-drag) and once per\n * drag (see startMonitoring), not per frame.\n */\n #orderedContainers:\n | { id: string; element: HTMLElement; config: AutoScrollConfig; depth: number }[]\n | null = null;\n\n /** Bound reference to #participantTick for stable add/remove with the scheduler. */\n readonly #boundParticipantTick: () => void = () => this.#participantTick();\n\n /** Callback to invoke when scrolling occurs (for placeholder recalculation) */\n #onScrollCallback: (() => void) | null = null;\n\n /** Optional cursor position override for edge detection (bypasses DragState read) */\n #cursorOverride: CursorPosition | null = null;\n\n /** Last tick cursor position for stationary detection */\n #lastTickCursorX = NaN;\n #lastTickCursorY = NaN;\n\n /**\n * Last timestamp used to scale per-frame autoscroll distance by elapsed frame time.\n * Scale is intentionally floored at 1 to preserve the existing feel on 60fps+ displays while\n * compensating slower frames that would otherwise under-scroll.\n */\n #lastScrollTimestamp = 0;\n\n /** Reusable direction object for tick loop (avoids per-frame allocation) */\n readonly #tickDirection = { x: 0, y: 0 };\n\n /** Current scroll state */\n readonly #scrollState: {\n containerId: string | null;\n direction: { x: number; y: number };\n speed: number;\n } = {\n containerId: null,\n direction: { x: 0, y: 0 },\n speed: 0,\n };\n\n /**\n * Register a scrollable container for auto-scrolling.\n */\n registerContainer(\n id: string,\n element: HTMLElement,\n config: Partial<AutoScrollConfig> = {},\n ): void {\n this.#scrollableContainers.set(id, {\n element,\n config: { ...DEFAULT_CONFIG, ...config },\n });\n this.#orderedContainers = null;\n }\n\n /**\n * Unregister a scrollable container.\n */\n unregisterContainer(id: string): void {\n this.#scrollableContainers.delete(id);\n this.#orderedContainers = null;\n }\n\n /**\n * Build (or reuse) the candidate list ordered innermost-first by DOM depth.\n *\n * Sorting by absolute DOM depth (descending) is a *total* order, unlike an\n * `element.contains()` comparator which returns 0 for unrelated pairs and so\n * violates transitivity — with ≥3 containers a nested pair separated by an\n * unrelated one in registration order could end up never compared, leaving the\n * ancestor ahead of its descendant. Equal-depth (including unrelated) containers\n * keep registration order via the stable sort, so unrelated lists behave as before.\n */\n #getOrderedContainers(): {\n id: string;\n element: HTMLElement;\n config: AutoScrollConfig;\n depth: number;\n }[] {\n if (this.#orderedContainers) {\n return this.#orderedContainers;\n }\n\n const entries: {\n id: string;\n element: HTMLElement;\n config: AutoScrollConfig;\n depth: number;\n }[] = [];\n for (const [id, { element, config }] of this.#scrollableContainers) {\n // Registration is unconditional (directives can't expose DOM size as a signal, so\n // gating registration on it goes stale — see #27). Filter by live scroll geometry\n // here instead: this list is rebuilt per drag (startMonitoring nulls the cache) and\n // on register/unregister, so a container that grew scrollable after init is picked\n // up on the next drag, and one that shrank stops occupying a candidate slot.\n if (!this.#isScrollable(element)) {\n continue;\n }\n entries.push({ id, element, config, depth: this.#domDepth(element) });\n }\n\n // Deepest first; stable sort keeps registration order on ties.\n entries.sort((a, b) => b.depth - a.depth);\n\n this.#orderedContainers = entries;\n return entries;\n }\n\n /**\n * Whether the element currently has room to scroll on either axis. Read fresh each\n * time the candidate list is (re)built — never cached — so it always reflects the\n * live layout at drag start rather than a stale value captured at registration.\n */\n #isScrollable(element: HTMLElement): boolean {\n return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n }\n\n /** Number of ancestor elements — the element's absolute depth in the DOM tree. */\n #domDepth(element: HTMLElement): number {\n let depth = 0;\n for (let parent = element.parentElement; parent; parent = parent.parentElement) {\n depth++;\n }\n return depth;\n }\n\n /**\n * Start monitoring for auto-scroll.\n * Registers this service as a tick participant in DragSchedulerService.\n * The scheduler drives the RAF loop; this service handles scroll logic each frame.\n * @param onScroll Optional callback to invoke when scrolling occurs (for placeholder recalculation)\n */\n startMonitoring(onScroll?: () => void): void {\n this.#onScrollCallback = onScroll ?? null;\n // Recompute containment ordering fresh per drag: a registered container may have\n // been reparented (portal/DOM move) since the cache was built, which register/\n // unregister alone wouldn't catch.\n this.#orderedContainers = null;\n this.#scheduler.addParticipant(this.#boundParticipantTick);\n }\n\n /**\n * Stop monitoring for auto-scroll.\n * Removes this service from the scheduler's participant list.\n * Call this when a drag ends.\n */\n stopMonitoring(): void {\n this.#scheduler.removeParticipant(this.#boundParticipantTick);\n this.#onScrollCallback = null;\n this.#cursorOverride = null;\n this.#lastTickCursorX = NaN;\n this.#lastTickCursorY = NaN;\n this.#lastScrollTimestamp = 0;\n this.#scrollState.containerId = null;\n this.#scrollState.direction.x = 0;\n this.#scrollState.direction.y = 0;\n this.#scrollState.speed = 0;\n }\n\n /**\n * Override the cursor position used for edge detection.\n * When set, #tick() uses this instead of DragStateService.cursorPosition().\n * Used by constrainToContainer to provide a position without grabOffset distortion.\n * @internal\n */\n setCursorOverride(position: CursorPosition): void {\n this.#cursorOverride = position;\n }\n\n /**\n * Participant tick — called by DragSchedulerService each RAF frame.\n *\n * Runs the edge-scroll check and, if a scroll is performed, synchronously\n * invokes #onScrollCallback (the placeholder recalculator) in the same frame.\n * No RAF scheduling here — the scheduler owns the loop.\n */\n #participantTick(): void {\n const cursor = this.#cursorOverride ?? this.#dragState.cursorPosition();\n\n // No cursor yet — nothing to scroll toward.\n if (!cursor) {\n return;\n }\n\n // Skip the container iteration when cursor hasn't moved and scroll is idle.\n if (\n cursor.x === this.#lastTickCursorX &&\n cursor.y === this.#lastTickCursorY &&\n !this.isScrolling()\n ) {\n return;\n }\n this.#lastTickCursorX = cursor.x;\n this.#lastTickCursorY = cursor.y;\n\n let scrollPerformed = false;\n // Frame scale is shared across candidates within a tick; computed lazily on\n // the first scroll attempt so stationary/idle frames don't advance the clock.\n let frameScale = 0;\n\n // Candidates are ordered innermost-first: when the deepest container under the\n // cursor is exhausted at its boundary, the loop falls through to its ancestors.\n for (const { id, element, config } of this.#getOrderedContainers()) {\n const rect = element.getBoundingClientRect();\n const isInside = this.#positionCalculator.isInsideContainer(cursor, rect);\n\n if (!isInside) {\n continue;\n }\n\n const nearEdge = this.#positionCalculator.getNearEdge(cursor, rect, config.threshold);\n\n // Reuse the per-frame direction object to avoid allocation.\n const direction = this.#tickDirection;\n direction.x = 0;\n direction.y = 0;\n let maxDistance = 0;\n\n if (nearEdge.top) {\n direction.y = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.y - rect.top));\n } else if (nearEdge.bottom) {\n direction.y = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.bottom - cursor.y));\n }\n\n if (nearEdge.left) {\n direction.x = -1;\n maxDistance = Math.max(maxDistance, config.threshold - (cursor.x - rect.left));\n } else if (nearEdge.right) {\n direction.x = 1;\n maxDistance = Math.max(maxDistance, config.threshold - (rect.right - cursor.x));\n }\n\n if (direction.x !== 0 || direction.y !== 0) {\n let speed = config.maxSpeed;\n if (config.accelerate) {\n const distanceRatio = maxDistance / config.threshold;\n speed = Math.min(config.maxSpeed, Math.max(1, config.maxSpeed * distanceRatio));\n }\n\n if (frameScale === 0) {\n frameScale = this.#getFrameScale();\n }\n\n // #performScroll reports whether it actually moved the element. Only claim the\n // tick (and stop descending the candidate list) when a scroll really happened —\n // an exhausted container must not block its ancestors from scrolling.\n //\n // Axis independence is per-container: if this container scrolls on *either* axis\n // it claims the whole tick, so a corner where the inner container's Y is exhausted\n // but its X still moves will not additionally apply an ancestor's available Y that\n // same frame. This matches the issue's \"break once a container scrolled\" contract;\n // cross-container axis handoff is intentionally out of scope.\n const scrolled = this.#performScroll(element, direction, frameScale, speed);\n if (scrolled) {\n this.#scrollState.containerId = id;\n this.#scrollState.direction.x = direction.x;\n this.#scrollState.direction.y = direction.y;\n this.#scrollState.speed = speed;\n scrollPerformed = true;\n break;\n }\n }\n }\n\n if (!scrollPerformed) {\n this.#lastScrollTimestamp = 0;\n this.#scrollState.containerId = null;\n this.#scrollState.direction.x = 0;\n this.#scrollState.direction.y = 0;\n this.#scrollState.speed = 0;\n }\n }\n\n /**\n * Perform the actual scroll operation.\n *\n * Each axis is evaluated independently: a boundary-exhausted axis is skipped\n * while the other axis still scrolls (e.g. at a corner where vertical is\n * maxed out but horizontal is available).\n *\n * @returns `true` when at least one axis actually scrolled, `false` when the\n * element was already at its boundary in every requested direction. The\n * caller uses this to fall through to ancestor containers.\n */\n #performScroll(\n element: HTMLElement,\n direction: { x: number; y: number },\n frameScale: number,\n speed: number,\n ): boolean {\n const scrollX = direction.x * speed * frameScale;\n const scrollY = direction.y * speed * frameScale;\n\n // Integer bounds used only as a cheap fast path to skip the assignment.\n // scrollHeight/clientHeight are rounded integers while scrollTop is fractional on\n // WebKit and any non-integer zoom/DPR, so this max can overstate the true one by\n // up to ~1px. It must NOT decide whether a scroll happened — the browser clamps the\n // assignment, so a before/after comparison is the only reliable truth signal.\n // Without it, an element pinned at its fractional max reports `scrolled = true`,\n // permanently claims the tick (blocking ancestor fall-through) and fires the callback\n // every frame against unchanged offsets (the WebKit placeholder-drift family).\n const maxScrollY = element.scrollHeight - element.clientHeight;\n const maxScrollX = element.scrollWidth - element.clientWidth;\n\n let scrolled = false;\n\n // Use direct property assignment for guaranteed synchronous scroll\n // scrollBy() with 'instant' behavior may have async issues in Safari\n if (scrollY !== 0) {\n const canScrollUp = direction.y < 0 && element.scrollTop > 0;\n const canScrollDown = direction.y > 0 && element.scrollTop < maxScrollY;\n if (canScrollUp || canScrollDown) {\n const before = element.scrollTop;\n element.scrollTop += scrollY;\n if (element.scrollTop !== before) {\n scrolled = true;\n }\n }\n }\n\n if (scrollX !== 0) {\n const canScrollLeft = direction.x < 0 && element.scrollLeft > 0;\n const canScrollRight = direction.x > 0 && element.scrollLeft < maxScrollX;\n if (canScrollLeft || canScrollRight) {\n const before = element.scrollLeft;\n element.scrollLeft += scrollX;\n if (element.scrollLeft !== before) {\n scrolled = true;\n }\n }\n }\n\n if (!scrolled) {\n return false;\n }\n\n // Notify callback IMMEDIATELY in the same frame (no RAF delay)\n // Delaying via RAF causes cumulative drift during continuous autoscroll\n // because multiple scrolls happen before each delayed callback runs.\n // Note: No ngZone.run() needed here - the callback (DraggableDirective.#recalculatePlaceholder)\n // already enters the zone when updating drag state.\n this.#onScrollCallback?.();\n\n return true;\n }\n\n #getFrameScale(): number {\n const now = performance.now();\n const elapsedMs =\n this.#lastScrollTimestamp === 0 ? BASE_FRAME_DURATION_MS : now - this.#lastScrollTimestamp;\n\n this.#lastScrollTimestamp = now;\n\n return Math.min(\n Math.max(elapsedMs / BASE_FRAME_DURATION_MS, MIN_SCROLL_FRAME_SCALE),\n MAX_SCROLL_FRAME_SCALE,\n );\n }\n\n /**\n * Check if auto-scrolling is currently active.\n */\n isScrolling(): boolean {\n return (\n this.#scrollState.containerId !== null &&\n (this.#scrollState.direction.x !== 0 || this.#scrollState.direction.y !== 0)\n );\n }\n\n /**\n * Get the current scroll direction.\n */\n getScrollDirection(): { x: number; y: number } {\n return this.#scrollState.direction;\n }\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service for cloning DOM elements with their computed styles.\n * Used to create visual copies of dragged elements for the drag preview.\n */\n@Injectable({ providedIn: 'root' })\nexport class ElementCloneService {\n /**\n * CSS properties to copy from source to clone, pre-stored in kebab-case.\n * These are the visual properties that affect appearance. Keeping them\n * kebab-case avoids a camelCase→kebab conversion on every property of every\n * node during the recursive clone walk (a drag-start hot path).\n */\n readonly #stylePropsToCopy: readonly string[] = [\n 'background',\n 'background-color',\n 'background-image',\n 'border',\n 'border-radius',\n 'box-shadow',\n 'color',\n 'font',\n 'font-family',\n 'font-size',\n 'font-weight',\n 'line-height',\n 'padding',\n 'margin',\n 'display',\n 'flex-direction',\n 'align-items',\n 'justify-content',\n 'gap',\n 'text-align',\n 'text-decoration',\n 'width',\n 'height',\n 'min-width',\n 'min-height',\n 'max-width',\n 'max-height',\n 'overflow',\n 'opacity',\n 'transform',\n 'box-sizing',\n ];\n\n /**\n * Clone an element with its computed styles.\n * Returns an HTMLElement ready for use as a drag preview.\n */\n cloneElement(source: HTMLElement): HTMLElement {\n const clone = source.cloneNode(true) as HTMLElement;\n\n // Apply computed styles as inline styles\n this.#applyComputedStyles(source, clone);\n\n // Handle special elements (canvas, video, etc.)\n this.#handleSpecialElements(source, clone);\n\n // Sanitize the clone for safe use as preview\n this.#sanitizeClone(clone);\n\n return clone;\n }\n\n /**\n * Apply computed styles from source to target element.\n * Recursively applies to all child elements.\n */\n #applyComputedStyles(source: HTMLElement, target: HTMLElement): void {\n const computed = window.getComputedStyle(source);\n\n // Copy essential visual properties (keys are already kebab-case)\n for (const prop of this.#stylePropsToCopy) {\n const value = computed.getPropertyValue(prop);\n if (value) {\n target.style.setProperty(prop, value);\n }\n }\n\n // Disable animations and transitions on clone\n target.style.animation = 'none';\n target.style.transition = 'none';\n\n // Recursively apply to children\n const sourceChildren = source.children;\n const targetChildren = target.children;\n\n for (let i = 0; i < sourceChildren.length && i < targetChildren.length; i++) {\n const sourceChild = sourceChildren[i];\n const targetChild = targetChildren[i];\n\n if (sourceChild instanceof HTMLElement && targetChild instanceof HTMLElement) {\n this.#applyComputedStyles(sourceChild, targetChild);\n }\n }\n }\n\n /**\n * Handle special elements that require extra processing.\n */\n #handleSpecialElements(source: HTMLElement, clone: HTMLElement): void {\n // Handle canvas elements - copy current content\n const sourceCanvases = source.querySelectorAll('canvas');\n const cloneCanvases = clone.querySelectorAll('canvas');\n\n sourceCanvases.forEach((srcCanvas, i) => {\n const cloneCanvas = cloneCanvases[i] as HTMLCanvasElement;\n if (cloneCanvas) {\n const ctx = cloneCanvas.getContext('2d');\n if (ctx) {\n cloneCanvas.width = srcCanvas.width;\n cloneCanvas.height = srcCanvas.height;\n ctx.drawImage(srcCanvas, 0, 0);\n }\n }\n });\n\n // Handle video elements - replace with poster or placeholder\n const videos = clone.querySelectorAll('video');\n videos.forEach((video) => {\n const poster = video.poster;\n if (poster) {\n const img = document.createElement('img');\n img.src = poster;\n img.style.width = '100%';\n img.style.height = '100%';\n img.style.objectFit = 'cover';\n video.replaceWith(img);\n } else {\n // Create a placeholder\n const placeholder = document.createElement('div');\n placeholder.style.cssText = `\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n video.replaceWith(placeholder);\n }\n });\n\n // Handle iframes - replace with placeholder\n const iframes = clone.querySelectorAll('iframe');\n iframes.forEach((iframe) => {\n const placeholder = document.createElement('div');\n const iframeStyles = window.getComputedStyle(iframe);\n placeholder.style.width = iframeStyles.width;\n placeholder.style.height = iframeStyles.height;\n placeholder.style.display = 'flex';\n placeholder.style.alignItems = 'center';\n placeholder.style.justifyContent = 'center';\n iframe.replaceWith(placeholder);\n });\n }\n\n /**\n * Sanitize the clone to prevent interaction issues.\n */\n #sanitizeClone(clone: HTMLElement): void {\n // Remove draggable directive attributes\n clone.removeAttribute('vdndDraggable');\n clone.removeAttribute('data-draggable-id');\n clone.removeAttribute('data-droppable-id');\n\n // Remove Angular-specific attributes\n const angularAttrs = Array.from(clone.attributes).filter(\n (attr) => attr.name.startsWith('ng-') || attr.name.startsWith('_ng'),\n );\n angularAttrs.forEach((attr) => clone.removeAttribute(attr.name));\n\n // Process all descendant elements\n const allElements = clone.querySelectorAll('*');\n allElements.forEach((el) => {\n if (!(el instanceof HTMLElement)) return;\n\n // Remove event-related attributes\n const attrs = Array.from(el.attributes);\n attrs.forEach((attr) => {\n if (\n attr.name.startsWith('on') ||\n attr.name.startsWith('(') ||\n attr.name.startsWith('ng-') ||\n attr.name.startsWith('_ng')\n ) {\n el.removeAttribute(attr.name);\n }\n });\n\n // Remove draggable attributes from children too\n el.removeAttribute('vdndDraggable');\n el.removeAttribute('data-draggable-id');\n el.removeAttribute('data-droppable-id');\n });\n\n // Disable interactive elements\n const interactiveElements = clone.querySelectorAll(\n 'button, input, textarea, select, a, [contenteditable]',\n );\n interactiveElements.forEach((el) => {\n if (el instanceof HTMLElement) {\n el.style.pointerEvents = 'none';\n el.setAttribute('tabindex', '-1');\n el.setAttribute('aria-hidden', 'true');\n el.setAttribute('disabled', 'true');\n }\n });\n\n // Remove focus styling classes that might interfere\n clone.classList.remove('vdnd-draggable-dragging');\n clone.classList.remove('vdnd-draggable-disabled');\n }\n}\n","import { computed, inject, Injectable, signal } from '@angular/core';\nimport { DragStateService } from './drag-state.service';\nimport { DraggedItem, END_OF_LIST, GrabOffset } from '../models/drag-drop.models';\n\n/**\n * Service for managing keyboard-initiated drag operations.\n * Works in conjunction with DragStateService to provide keyboard drag functionality.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class KeyboardDragService {\n readonly #dragState = inject(DragStateService);\n\n /** Total item count for the current droppable (set by droppable on keyboard drag start) */\n readonly #totalItemCount = signal<number>(0);\n\n /** Whether a keyboard drag is currently active */\n readonly isActive = computed(\n () => this.#dragState.isKeyboardDrag() && this.#dragState.isDragging(),\n );\n\n /** Current target index during keyboard navigation */\n readonly targetIndex = computed(() => this.#dragState.keyboardTargetIndex());\n\n /** Source index where the drag started */\n readonly sourceIndex = computed(() => this.#dragState.sourceIndex());\n\n /** Current active droppable ID */\n readonly activeDroppableId = computed(() => this.#dragState.activeDroppableId());\n\n /**\n * Start a keyboard drag operation.\n */\n startKeyboardDrag(\n item: DraggedItem,\n sourceIndex: number,\n totalItemCount: number,\n activeDroppableId: string,\n ): void {\n this.#totalItemCount.set(totalItemCount);\n\n // For keyboard drag, we position the preview at the element's location\n // We use a grab offset of 0,0 since we're not grabbing at a specific point\n const grabOffset: GrabOffset = { x: 0, y: 0 };\n\n // Get the element's position for the cursor position\n // This positions the preview at the element's original location\n const rect = item.element.getBoundingClientRect();\n const cursorPosition = { x: rect.left, y: rect.top };\n\n // Same-list adjustment: at start, targetIndex equals sourceIndex\n // Since sourceIndex >= sourceIndex is always true, add 1 to placeholderIndex\n // This accounts for the hidden item shifting everything up visually\n const initialPlaceholderIndex = sourceIndex + 1;\n\n this.#dragState.startDrag(\n item,\n cursorPosition,\n grabOffset,\n null, // no axis lock for keyboard drag\n activeDroppableId,\n END_OF_LIST,\n initialPlaceholderIndex,\n sourceIndex,\n true, // isKeyboardDrag\n );\n }\n\n /**\n * Move to a specific index during keyboard drag.\n * Returns the clamped target index.\n */\n moveToIndex(targetIndex: number): number {\n if (!this.isActive()) {\n return targetIndex;\n }\n\n const totalItems = this.#totalItemCount();\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItems));\n\n this.#dragState.setKeyboardTargetIndex(clampedIndex);\n\n return clampedIndex;\n }\n\n /**\n * Move up by one position (ArrowUp).\n * Returns the new target index.\n */\n moveUp(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget - 1);\n }\n\n /**\n * Move down by one position (ArrowDown).\n * Returns the new target index.\n */\n moveDown(): number {\n const currentTarget = this.targetIndex() ?? 0;\n return this.moveToIndex(currentTarget + 1);\n }\n\n /**\n * Move to an adjacent droppable (ArrowLeft/ArrowRight).\n * The droppable registry is managed externally.\n */\n moveToDroppable(droppableId: string, targetIndex: number, totalItemCount: number): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#totalItemCount.set(totalItemCount);\n const clampedIndex = Math.max(0, Math.min(targetIndex, totalItemCount));\n this.#dragState.setKeyboardActiveDroppable(droppableId, clampedIndex);\n }\n\n /**\n * Complete the keyboard drag (Space or Enter to drop).\n */\n completeKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.endDrag();\n }\n\n /**\n * Cancel the keyboard drag (Escape).\n */\n cancelKeyboardDrag(): void {\n if (!this.isActive()) {\n return;\n }\n\n this.#dragState.cancelDrag();\n }\n\n /**\n * Update the total item count (when navigating to a new list).\n */\n setTotalItemCount(count: number): void {\n this.#totalItemCount.set(count);\n }\n}\n","import { computed, Injectable, OnDestroy, signal } from '@angular/core';\n\n/**\n * Service that manages a shared overlay container appended to `document.body`.\n *\n * Elements placed inside the overlay container escape any ancestor CSS `transform`,\n * `perspective`, or `filter` that would create a new containing block for\n * `position: fixed` children. This ensures viewport-relative positioning works\n * correctly regardless of where the consuming component sits in the DOM tree.\n *\n * Mirrors the strategy used by Angular CDK's `OverlayContainer`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class OverlayContainerService implements OnDestroy {\n #containerElement: HTMLElement | null = null;\n\n /** Number of mounted drag previews currently rendering via a custom template. */\n readonly #templatePreviewCount = signal(0);\n\n /**\n * Whether at least one mounted drag preview renders via a custom template.\n *\n * When true, DraggableDirective/KeyboardDragHandler skip the expensive\n * drag-start element clone: the clone would never be shown because the\n * template takes precedence (see DragPreviewComponent).\n */\n readonly hasTemplatePreview = computed(() => this.#templatePreviewCount() > 0);\n\n /**\n * Register (`active = true`) or unregister (`active = false`) a preview that\n * renders via a custom template. Calls must be balanced per preview instance.\n */\n setTemplatePreviewActive(active: boolean): void {\n this.#templatePreviewCount.update((count) => Math.max(0, count + (active ? 1 : -1)));\n }\n\n /**\n * Returns the shared overlay container element, lazily creating it on first access.\n * Returns `null` in non-browser environments (SSR).\n */\n getContainerElement(): HTMLElement | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n if (!this.#containerElement) {\n this.#containerElement = document.createElement('div');\n this.#containerElement.classList.add('vdnd-overlay-container');\n document.body.appendChild(this.#containerElement);\n }\n\n return this.#containerElement;\n }\n\n ngOnDestroy(): void {\n this.#containerElement?.remove();\n this.#containerElement = null;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { type CursorPosition, END_OF_LIST, type GrabOffset } from '../models/drag-drop.models';\nimport { PositionCalculatorService } from './position-calculator.service';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\n\ninterface DroppableCache {\n droppableId: string | null;\n containerType: 'virtualScroll' | 'virtualContent' | 'fallback';\n scrollContainer: HTMLElement;\n virtualScrollElement: HTMLElement | null;\n virtualContentElement: HTMLElement | null;\n scrollableParent: HTMLElement | null;\n itemHeight: number;\n isConstrainedToContainer: boolean;\n strategy: VirtualScrollStrategy | null;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DragIndexCalculatorService {\n readonly #positionCalculator = inject(PositionCalculatorService);\n\n /** Registered strategies by droppable ID */\n readonly #strategies = new Map<string, VirtualScrollStrategy>();\n\n /** Cached droppable metadata to avoid repeated DOM queries during drag */\n readonly #droppableCache = new Map<HTMLElement, DroppableCache>();\n\n /**\n * Register a virtual scroll strategy for a droppable.\n * Used by virtual scroll components to provide dynamic height lookups.\n */\n registerStrategy(droppableId: string, strategy: VirtualScrollStrategy): void {\n this.#strategies.set(droppableId, strategy);\n }\n\n /**\n * Unregister a strategy when the droppable is destroyed.\n */\n unregisterStrategy(droppableId: string): void {\n this.#strategies.delete(droppableId);\n }\n\n /**\n * Get the registered strategy for a droppable ID.\n * Used by draggable to calculate source index with variable heights.\n */\n getStrategyForDroppable(droppableId: string): VirtualScrollStrategy | undefined {\n return this.#strategies.get(droppableId);\n }\n\n clearCache(): void {\n this.#droppableCache.clear();\n }\n\n #resolveDroppable(droppableElement: HTMLElement, draggedItemHeight: number): DroppableCache {\n const cached = this.#droppableCache.get(droppableElement);\n if (cached) return cached;\n\n const virtualScrollElement = droppableElement.querySelector(\n 'vdnd-virtual-scroll',\n ) as HTMLElement | null;\n const virtualContentElement = (\n droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content')\n ) as HTMLElement | null;\n\n let containerType: DroppableCache['containerType'];\n let scrollContainer: HTMLElement;\n let scrollableParent: HTMLElement | null = null;\n\n if (virtualScrollElement) {\n containerType = 'virtualScroll';\n scrollContainer = virtualScrollElement;\n } else if (virtualContentElement) {\n containerType = 'virtualContent';\n scrollableParent = virtualContentElement.closest('.vdnd-scrollable') as HTMLElement | null;\n scrollContainer = scrollableParent ?? virtualContentElement;\n } else {\n containerType = 'fallback';\n scrollContainer = droppableElement;\n }\n\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n const strategy = (droppableId ? this.#strategies.get(droppableId) : null) ?? null;\n\n const configuredHeight =\n virtualScrollElement?.getAttribute('data-item-height') ??\n virtualContentElement?.getAttribute('data-item-height');\n const parsedHeight = configuredHeight ? parseFloat(configuredHeight) : Number.NaN;\n const itemHeight = Number.isFinite(parsedHeight)\n ? parsedHeight\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n const isConstrainedToContainer = droppableElement.hasAttribute('data-constrain-to-container');\n\n const entry: DroppableCache = {\n droppableId,\n containerType,\n scrollContainer,\n virtualScrollElement,\n virtualContentElement,\n scrollableParent,\n itemHeight,\n isConstrainedToContainer,\n strategy,\n };\n\n this.#droppableCache.set(droppableElement, entry);\n return entry;\n }\n\n getTotalItemCount(args: {\n droppableElement: HTMLElement;\n isSameList: boolean;\n draggedItemHeight: number;\n }): number {\n return this.#getTotalItemCount(args.droppableElement, args.isSameList, args.draggedItemHeight);\n }\n\n calculatePlaceholderIndex(args: {\n droppableElement: HTMLElement;\n position: CursorPosition;\n previousPosition: CursorPosition | null;\n grabOffset: GrabOffset | null;\n draggedItemHeight: number;\n sourceDroppableId: string | null;\n sourceIndex: number | null;\n }): { index: number; placeholderId: string } {\n const {\n droppableElement,\n position,\n grabOffset,\n draggedItemHeight,\n sourceDroppableId,\n sourceIndex,\n } = args;\n\n // Resolve cached metadata (DOM queries run once per droppable per drag session)\n const cache = this.#resolveDroppable(droppableElement, draggedItemHeight);\n\n // Live reads: getBoundingClientRect() and scrollTop change during scroll\n let currentScrollTop: number;\n let rect: DOMRect;\n\n if (cache.containerType === 'virtualScroll') {\n rect = cache.scrollContainer.getBoundingClientRect();\n currentScrollTop = cache.scrollContainer.scrollTop;\n } else if (cache.containerType === 'virtualContent' && cache.scrollableParent) {\n rect = cache.scrollContainer.getBoundingClientRect();\n const contentOffsetAttr = cache.virtualContentElement!.getAttribute('data-content-offset');\n const contentOffset = contentOffsetAttr ? parseFloat(contentOffsetAttr) : 0;\n const offsetValue = Number.isFinite(contentOffset) ? contentOffset : 0;\n currentScrollTop = cache.scrollContainer.scrollTop - offsetValue;\n } else {\n rect = cache.scrollContainer.getBoundingClientRect();\n currentScrollTop =\n cache.containerType === 'virtualContent' ? 0 : cache.scrollContainer.scrollTop;\n }\n\n const {\n strategy,\n itemHeight,\n droppableId: currentDroppableId,\n isConstrainedToContainer,\n } = cache;\n\n // Calculate preview center position mathematically\n // The preview is positioned at: cursorPosition - grabOffset (see drag-preview.component.ts)\n // So preview center = cursorPosition.y - grabOffset.y + previewHeight/2\n // Using math avoids Safari's stale getBoundingClientRect() issue during autoscroll\n // Use actual dragged item height when available (important for dynamic heights)\n const previewHeight = this.#getDraggedItemHeightFallback(draggedItemHeight, itemHeight);\n const previewTopY = position.y - (grabOffset?.y ?? 0);\n const previewBottomY = previewTopY + previewHeight;\n const previewCenterY = previewTopY + previewHeight / 2;\n\n // Capped center probe: use preview center but limit how deep the probe reaches.\n // The cap prevents a tall preview (e.g. 120px among 60px items) from overshooting\n // multiple positions — the center would land 2+ items away, but the cap keeps it\n // within one item of the top edge.\n const indexProbeY = Math.min(previewCenterY, previewTopY + itemHeight / 2);\n\n // Convert to visual index\n const relativeY = indexProbeY - rect.top + currentScrollTop;\n\n // Determine same-list drag info before strategy branch\n const isSameList = sourceDroppableId !== null && sourceDroppableId === currentDroppableId;\n const sourceIndexValue = isSameList ? (sourceIndex ?? -1) : -1;\n\n let visualIndex: number;\n if (strategy) {\n visualIndex = strategy.findIndexAtOffset(relativeY);\n\n // Midpoint refinement for variable heights:\n // Only advance past an item when the preview top has crossed its midpoint.\n // Without this, a short preview entering a tall item's range triggers\n // displacement at ~20% overlap, which looks like unnatural overlapping.\n const topRelativeY = previewTopY - rect.top + currentScrollTop;\n const targetTop = strategy.getOffsetForIndex(visualIndex);\n const targetBottom = strategy.getOffsetForIndex(visualIndex + 1);\n const targetMidpoint = (targetTop + targetBottom) / 2;\n if (topRelativeY >= targetMidpoint) {\n visualIndex += 1;\n }\n } else {\n // Fixed height: simple division\n visualIndex = Math.floor(relativeY / itemHeight);\n }\n\n // Same-list +1 adjustment:\n // - No strategy: always adjust when visual index is at/after source\n // - Strategy: adjust only if exclusion has not been applied yet\n // (prevents an off-by-one window during early drag updates)\n let placeholderIndex = visualIndex;\n if (isSameList && sourceIndexValue >= 0 && visualIndex >= sourceIndexValue) {\n const needsAdjustment = !strategy || !this.#isSourceIndexExcluded(strategy, sourceIndexValue);\n if (needsAdjustment) {\n placeholderIndex = visualIndex + 1;\n }\n }\n\n // Get total items using cached strategy to avoid duplicate DOM queries\n let totalItems: number;\n const cachedItemCount = strategy?.getItemCount();\n if (cachedItemCount !== undefined && Number.isFinite(cachedItemCount)) {\n totalItems = Math.max(0, cachedItemCount);\n } else {\n totalItems = this.#getTotalItemCount(droppableElement, isSameList, draggedItemHeight);\n }\n\n // Edge detection: allow dropping at the END of the list when cursor is near bottom edge.\n // Due to max scroll limits, the math alone can't reach totalItems when the list is longer\n // than the viewport. If cursor is in the bottom portion of the container and we're at\n // or past the last visible slot, snap to totalItems.\n const cursorRelativeToBottom = rect.bottom - previewCenterY;\n const isNearBottomEdge = cursorRelativeToBottom < itemHeight;\n if (isNearBottomEdge && placeholderIndex >= totalItems - 1) {\n placeholderIndex = totalItems;\n }\n\n // When the preview is constrained to the container bounds, large dragged items can\n // cover the first/last slots while their center never reaches them. Snap to edges\n // using preview bounds so top/bottom drops remain reachable.\n if (isConstrainedToContainer) {\n const droppableRect = droppableElement.getBoundingClientRect();\n const edgeTolerance = 2;\n const distanceToTop = Math.abs(previewTopY - droppableRect.top);\n const distanceToBottom = Math.abs(droppableRect.bottom - previewBottomY);\n\n if (distanceToTop <= edgeTolerance && distanceToTop <= distanceToBottom) {\n placeholderIndex = 0;\n } else if (distanceToBottom <= edgeTolerance) {\n placeholderIndex = totalItems;\n }\n }\n\n // Clamp to valid range\n placeholderIndex = Math.max(0, Math.min(placeholderIndex, totalItems));\n\n return { index: placeholderIndex, placeholderId: END_OF_LIST };\n }\n\n #getTotalItemCount(\n droppableElement: HTMLElement,\n isSameList: boolean,\n draggedItemHeight: number,\n ): number {\n // Check if a registered strategy exists\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n const strategy = droppableId ? this.#strategies.get(droppableId) : null;\n const strategyItemCount = strategy?.getItemCount();\n if (strategyItemCount !== undefined && Number.isFinite(strategyItemCount)) {\n return Math.max(0, strategyItemCount);\n }\n\n // Check for embedded virtual scroll component\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n if (virtualScroll) {\n // Use data-total-items attribute if available (always the true N)\n const totalItemsAttr = virtualScroll.getAttribute('data-total-items');\n if (totalItemsAttr) {\n const count = parseInt(totalItemsAttr, 10);\n if (Number.isFinite(count)) {\n return count;\n }\n }\n\n // Fallback: Use the spacer's height, NOT scrollHeight, to determine item count.\n // scrollHeight can be inflated by absolutely-positioned elements like the placeholder.\n const spacer = virtualScroll.querySelector(\n '.vdnd-virtual-scroll-spacer',\n ) as HTMLElement | null;\n const configuredHeight = virtualScroll.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 50);\n\n let totalHeight: number;\n if (spacer) {\n // Get the spacer's explicit height (set via Angular binding)\n totalHeight = parseFloat(spacer.style.height) || 0;\n } else {\n // Fallback: use scrollHeight if spacer not found\n totalHeight = (virtualScroll as HTMLElement).scrollHeight;\n }\n\n // When strategy exists, spacer height already accounts for exclusion.\n // Don't apply same-list +1 adjustment — strategy handles it.\n if (strategy) {\n const count = Math.round(totalHeight / itemHeight);\n return count;\n }\n\n // Spacer height reflects full N items (getTotalHeight no longer excludes)\n const count = Math.floor(totalHeight / itemHeight);\n return count;\n }\n\n // Check for page-level scroll (vdnd-virtual-content)\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n if (virtualContent) {\n // Prefer explicit total items attribute (works for both fixed and dynamic heights)\n const totalItemsAttr = (virtualContent as HTMLElement).getAttribute('data-total-items');\n if (totalItemsAttr) {\n const count = parseInt(totalItemsAttr, 10);\n if (Number.isFinite(count)) {\n // data-total-items is the true total N (derived from strategy item count)\n return count;\n }\n }\n\n // Fallback: use spacer height to determine total items\n const spacer = virtualContent.querySelector('.vdnd-content-spacer') as HTMLElement | null;\n if (spacer) {\n const totalHeight = parseFloat(spacer.style.height) || 0;\n const configuredHeight = virtualContent.getAttribute('data-item-height');\n const itemHeight = configuredHeight\n ? parseInt(configuredHeight, 10)\n : this.#getDraggedItemHeightFallback(draggedItemHeight, 72);\n return Math.floor(totalHeight / itemHeight);\n }\n }\n\n // Fallback for non-virtual scroll — querySelectorAll finds all N items\n // (including the hidden dragged item), so no adjustment needed\n const items = droppableElement.querySelectorAll('[data-draggable-id]');\n return items.length;\n }\n\n #getDraggedItemHeightFallback(height: number, fallback: number): number {\n return Number.isFinite(height) && height > 0 ? height : fallback;\n }\n\n /**\n * Detect whether a strategy has already excluded the source index.\n *\n * With exclusion applied, the source slot collapses in visual space:\n * offset(sourceIndex + 1) <= offset(sourceIndex). Without exclusion,\n * the next offset is strictly greater.\n */\n #isSourceIndexExcluded(strategy: VirtualScrollStrategy, sourceIndex: number): boolean {\n if (sourceIndex < 0) {\n return false;\n }\n\n const sourceOffset = strategy.getOffsetForIndex(sourceIndex);\n const nextOffset = strategy.getOffsetForIndex(sourceIndex + 1);\n\n return nextOffset <= sourceOffset;\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * Renders an empty placeholder that takes up space in the document flow.\n *\n * This component is used internally by virtual scroll containers to show\n * where an item will be dropped. It's rendered inline with items and\n * takes up the same vertical space as an item.\n *\n * The placeholder is just empty space - no borders, no background.\n * Consumers can style it via CSS if desired.\n */\n@Component({\n selector: 'vdnd-drag-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'vdnd-drag-placeholder vdnd-drag-placeholder-visible',\n '[style.height.px]': 'itemHeight()',\n },\n styles: `\n :host {\n display: block;\n pointer-events: none;\n }\n `,\n template: ``,\n})\nexport class DragPlaceholderComponent {\n /** Item height for sizing */\n itemHeight = input.required<number>();\n}\n","import { NgZone, type WritableSignal } from '@angular/core';\n\nexport function bindRafThrottledScrollTopSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n scrollTop: WritableSignal<number>;\n thresholdPx?: number;\n onCommit?: (scrollTop: number) => void;\n}): () => void {\n const { element, ngZone, scrollTop, thresholdPx = 5, onCommit } = options;\n\n let pendingRaf: number | null = null;\n let lastCommittedScrollTop = element.scrollTop;\n\n const onScroll = () => {\n if (pendingRaf !== null) {\n return;\n }\n\n const currentScrollTop = element.scrollTop;\n if (Math.abs(currentScrollTop - lastCommittedScrollTop) < thresholdPx) {\n return;\n }\n\n pendingRaf = requestAnimationFrame(() => {\n pendingRaf = null;\n const finalScrollTop = element.scrollTop;\n if (Math.abs(finalScrollTop - lastCommittedScrollTop) >= thresholdPx) {\n lastCommittedScrollTop = finalScrollTop;\n scrollTop.set(finalScrollTop);\n onCommit?.(finalScrollTop);\n }\n });\n };\n\n ngZone.runOutsideAngular(() => {\n element.addEventListener('scroll', onScroll, { passive: true });\n });\n\n scrollTop.set(lastCommittedScrollTop);\n\n return () => {\n if (pendingRaf !== null) {\n cancelAnimationFrame(pendingRaf);\n pendingRaf = null;\n }\n element.removeEventListener('scroll', onScroll);\n };\n}\n\nexport function bindResizeObserverHeightSignal(options: {\n element: HTMLElement;\n ngZone: NgZone;\n height: WritableSignal<number>;\n minDeltaPx?: number;\n}): () => void {\n const { element, ngZone, height, minDeltaPx = 1 } = options;\n\n if (typeof ResizeObserver === 'undefined') {\n height.set(element.clientHeight);\n return () => undefined;\n }\n\n let observer: ResizeObserver | null = null;\n\n ngZone.runOutsideAngular(() => {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const nextHeight = entry.contentRect.height;\n if (Math.abs(nextHeight - height()) > minDeltaPx) {\n height.set(nextHeight);\n }\n }\n });\n observer.observe(element);\n });\n\n height.set(element.clientHeight);\n\n return () => {\n observer?.disconnect();\n observer = null;\n };\n}\n","import { DestroyRef, effect, inject } from '@angular/core';\nimport { type AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\n\ninterface AutoScrollRegistrationOptions {\n autoScrollService: AutoScrollService;\n getElement: () => HTMLElement;\n getId: () => string;\n enabled: () => boolean;\n config: () => Partial<AutoScrollConfig>;\n canRegister?: () => boolean;\n}\n\nexport function createAutoScrollRegistration(options: AutoScrollRegistrationOptions): void {\n const destroyRef = inject(DestroyRef);\n let registeredId: string | null = null;\n\n const unregisterCurrent = (): void => {\n if (registeredId === null) {\n return;\n }\n\n options.autoScrollService.unregisterContainer(registeredId);\n registeredId = null;\n };\n\n effect(() => {\n const enabled = options.enabled();\n const id = options.getId();\n const config = options.config();\n const canRegister = options.canRegister?.() ?? true;\n\n if (!enabled || !canRegister) {\n unregisterCurrent();\n return;\n }\n\n if (registeredId !== null && registeredId !== id) {\n unregisterCurrent();\n }\n\n options.autoScrollService.registerContainer(id, options.getElement(), config);\n registeredId = id;\n });\n\n destroyRef.onDestroy(unregisterCurrent);\n}\n","import {\n afterNextRender,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { DragPlaceholderComponent } from './drag-placeholder.component';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\nimport { queryByAttribute } from '../utils/attribute-selectors';\n\n/**\n * Context provided to the item template.\n */\nexport interface VirtualScrollItemContext<T> {\n /** The item data */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this item is \"sticky\" (always rendered) */\n isSticky: boolean;\n}\n\n/**\n * A virtual scroll container that only renders visible items.\n *\n * Key features:\n * - Only renders items within the visible viewport plus an overscan buffer\n * - Supports \"sticky\" items that are always rendered (used for dragged items)\n * - Uses spacer divs to maintain correct scroll height\n * - Integrates with the drag-and-drop system\n * - Automatic height detection via ResizeObserver when containerHeight is not provided\n * - Supports dynamic item heights via `dynamicItemHeight` input\n *\n * @example\n * ```html\n * <!-- With fixed height items -->\n * <vdnd-virtual-scroll\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [containerHeight]=\"400\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n *\n * <!-- With dynamic height items -->\n * <vdnd-virtual-scroll\n * [items]=\"items()\"\n * [itemHeight]=\"50\"\n * [dynamicItemHeight]=\"true\"\n * [containerHeight]=\"400\"\n * [trackByFn]=\"trackById\">\n * <ng-template let-item let-index=\"index\">\n * <div class=\"item\">{{ item.description }}</div>\n * </ng-template>\n * </vdnd-virtual-scroll>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-scroll',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, DragPlaceholderComponent],\n host: {\n class: 'vdnd-virtual-scroll',\n '[style.height.px]': 'containerHeight() ?? null',\n '[attr.data-item-height]': 'itemHeight()',\n '[attr.data-total-items]': 'items().length',\n },\n template: `\n <!-- Single spacer maintains scroll height -->\n <div class=\"vdnd-virtual-scroll-spacer\" [style.height.px]=\"totalHeight()\"></div>\n\n <!-- Content wrapper positioned via GPU-accelerated transform -->\n <div class=\"vdnd-virtual-scroll-content-wrapper\" [style.transform]=\"contentTransform()\">\n @for (entry of renderedItems(); track trackEntry($index, entry)) {\n @if (entry.type === 'placeholder') {\n <vdnd-drag-placeholder [itemHeight]=\"placeholderHeight()\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate();\n context: {\n $implicit: entry.data,\n index: entry.index,\n isSticky: entry.isSticky,\n }\n \"\n >\n </ng-container>\n }\n }\n </div>\n `,\n styles: `\n :host {\n display: block;\n overflow: auto;\n position: relative;\n /* Disable browser scroll anchoring - this prevents scroll position from being\n adjusted when the DOM changes (e.g., when placeholder position updates).\n Without this, autoscroll UP would fight with browser's scroll restoration. */\n overflow-anchor: none;\n }\n\n .vdnd-virtual-scroll-spacer {\n /* Invisible spacer that maintains scroll height */\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-virtual-scroll-content-wrapper {\n /* GPU-accelerated positioning */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n})\nexport class VirtualScrollContainerComponent<T> implements OnInit, AfterViewInit, OnDestroy {\n readonly #dragState = inject(DragStateService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #autoScrollService = inject(AutoScrollService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n readonly #ngZone = inject(NgZone);\n readonly #injector = inject(Injector);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** ResizeObserver for dynamic height measurement */\n #itemResizeObserver: ResizeObserver | null = null;\n\n /** Map from observed HTMLElement to its trackBy key */\n readonly #observedElements = new WeakMap<HTMLElement, unknown>();\n /** Stable mapping from rendered key to observed element for unobserve cleanup */\n readonly #observedElementByKey = new Map<unknown, HTMLElement>();\n\n /** Measured height from ResizeObserver (used when containerHeight is not provided) */\n readonly #measuredHeight = signal(0);\n\n /** Template for rendering each item - passed as input instead of content child for reliability */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n /**\n * Height of the container in pixels.\n * If not provided, the container will automatically measure its height from CSS.\n * This allows you to set the height via CSS (e.g., flex, height: 100%, etc.)\n * and the component will adapt automatically, including on resize.\n */\n containerHeight = input<number>();\n\n /**\n * Effective height used for calculations.\n * Uses explicit containerHeight if provided, otherwise uses measured height.\n */\n readonly effectiveHeight = computed(() => this.containerHeight() ?? this.#measuredHeight());\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** IDs of items that should always be rendered (e.g., dragged items) */\n stickyItemIds = input<string[]>([]);\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /**\n * ID of the droppable this virtual scroll belongs to.\n * Required for placeholder positioning.\n */\n droppableId = input<string>();\n\n /**\n * Whether to automatically add the dragged item to the sticky list.\n * This ensures the dragged item remains visible during virtual scrolling.\n * @default true\n */\n autoStickyDraggedItem = input<boolean>(true);\n\n // ========== Strategy ==========\n\n /** The virtual scroll strategy, created based on dynamicItemHeight input */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n const height = this.itemHeight();\n return this.dynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n /**\n * Effective track-by function - uses provided trackByFn or derives from itemIdFn.\n */\n protected readonly effectiveTrackByFn = computed(() => {\n const userFn = this.trackByFn();\n if (userFn) return userFn;\n\n const idFn = this.itemIdFn();\n return (_index: number, item: T) => idFn(item);\n });\n\n /**\n * Track function for rendered entries (items + placeholder).\n */\n protected trackEntry(\n _index: number,\n entry: { type: 'item' | 'placeholder'; data: T | null; index: number },\n ): string | number {\n if (entry.type === 'placeholder') {\n return '__placeholder__';\n }\n const trackFn = this.effectiveTrackByFn();\n return trackFn(entry.index, entry.data as T);\n }\n\n /**\n * Effective sticky item IDs - combines user-provided IDs with auto-sticky dragged item.\n */\n protected readonly effectiveStickyIds = computed(() => {\n const userIds = this.stickyItemIds();\n\n if (!this.autoStickyDraggedItem()) {\n return userIds;\n }\n\n const draggedId = this.draggedItemId();\n if (!draggedId) {\n return userIds;\n }\n\n // Avoid creating new array if dragged ID is already in the list\n if (userIds.includes(draggedId)) {\n return userIds;\n }\n\n return [...userIds, draggedId];\n });\n\n /** Current scroll position */\n readonly #scrollTop = signal(0);\n\n /** Total height of all items (for scrollbar) */\n protected readonly totalHeight = computed(() => {\n const count = this.items().length;\n const strategy = this.#strategy();\n strategy.version();\n return strategy.getTotalHeight(count);\n });\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n const strategy = this.#strategy();\n strategy.version();\n return strategy.getFirstVisibleIndex(this.#scrollTop());\n });\n\n /** Number of items visible in the viewport */\n readonly #visibleCount = computed(() => {\n const height = this.effectiveHeight();\n const strategy = this.#strategy();\n strategy.version();\n return strategy.getVisibleCount(this.#firstVisibleIndex(), height);\n });\n\n /** Range of items to render (with overscan) */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.overscan();\n const total = this.items().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Transform offset for content wrapper (position of first rendered item) */\n protected readonly contentTransform = computed(() => {\n const { start } = this.#renderRange();\n const strategy = this.#strategy();\n strategy.version();\n\n const offset = strategy.getOffsetForIndex(start);\n return `translateY(${offset}px)`;\n });\n\n /** The ID of the currently dragged item (if any) */\n protected readonly draggedItemId = computed(() => {\n return this.#dragState.draggedItem()?.draggableId ?? null;\n });\n\n /** Map of item IDs to their indices - rebuilt only when items() changes (O(n) once, then O(1) lookups) */\n readonly #itemIndexMap = computed(() => {\n const items = this.items();\n const idFn = this.itemIdFn();\n const map = new Map<string, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(idFn(items[i]), i);\n }\n return map;\n });\n\n /** The index of the currently dragged item in the items array (-1 if not found or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedId = this.draggedItemId();\n if (!draggedId) return -1;\n return this.#itemIndexMap().get(draggedId) ?? -1;\n });\n\n /** Memoized Set of sticky IDs - rebuilt only when effectiveStickyIds() changes */\n readonly #stickyIdsSet = computed(() => new Set(this.effectiveStickyIds()));\n\n /** Whether the placeholder should be shown in this container */\n protected readonly shouldShowPlaceholder = computed(() => {\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === this.droppableId();\n });\n\n /** The placeholder index when placeholder should be shown */\n protected readonly placeholderIndex = computed(() => {\n if (!this.shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n /** Height for the placeholder — use dragged item's actual height in dynamic mode */\n protected readonly placeholderHeight = computed(() => {\n if (this.dynamicItemHeight()) {\n const draggedItemHeight = this.#dragState.draggedItem()?.height;\n if (draggedItemHeight && draggedItemHeight > 0) return draggedItemHeight;\n }\n return this.itemHeight();\n });\n\n /** Items to render, including sticky items and placeholder */\n protected readonly renderedItems = computed(() => {\n const items = this.items();\n const { start, end } = this.#renderRange();\n const stickyIds = this.#stickyIdsSet();\n const idFn = this.itemIdFn();\n const itemIndexMap = this.#itemIndexMap();\n const draggedId = this.draggedItemId();\n const placeholderIdx = this.placeholderIndex();\n\n const result: {\n type: 'item' | 'placeholder';\n data: T | null;\n index: number;\n isSticky: boolean;\n isDragging: boolean;\n }[] = [];\n const renderedIds = new Set<string>();\n let hasPlaceholder = false;\n\n // Add all items in the visible range, inserting placeholder at correct position\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (placeholderIdx === i && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n const item = items[i];\n const id = idFn(item);\n result.push({\n type: 'item',\n data: item,\n index: i,\n isSticky: stickyIds.has(id),\n isDragging: id === draggedId,\n });\n renderedIds.add(id);\n }\n\n // If placeholder is at the end (after all items), add it\n if (placeholderIdx >= items.length && placeholderIdx >= 0 && !hasPlaceholder) {\n result.push({\n type: 'placeholder',\n data: null,\n index: placeholderIdx,\n isSticky: false,\n isDragging: false,\n });\n hasPlaceholder = true;\n }\n\n // Add any sticky items that aren't already rendered\n const missingStickyIndices: { id: string; index: number }[] = [];\n for (const id of stickyIds) {\n if (renderedIds.has(id)) continue;\n const index = itemIndexMap.get(id);\n if (index === undefined) continue;\n missingStickyIndices.push({ id, index });\n }\n if (missingStickyIndices.length > 1) {\n missingStickyIndices.sort((a, b) => a.index - b.index);\n }\n\n for (const { id, index } of missingStickyIndices) {\n const item = items[index];\n if (item === undefined) continue;\n result.push({\n type: 'item',\n data: item,\n index,\n isSticky: true,\n isDragging: id === draggedId,\n });\n }\n\n return result;\n });\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Track previous dragged ID to detect drag end */\n #previousDraggedId: string | null = null;\n\n /** Track previous total height to detect if we were at bottom before drag ended */\n #previousTotalHeight = 0;\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScrollService,\n getElement: () => this.#elementRef.nativeElement,\n getId: () => this.scrollContainerId() ?? this.#generatedScrollId,\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n });\n\n // Keep strategy item keys in sync\n effect(() => {\n const items = this.items();\n const idFn = this.itemIdFn();\n const keys = items.map((item) => idFn(item));\n this.#strategy().setItemKeys(keys);\n });\n\n // Register strategy with drag index calculator for accurate drag calculations\n effect((onCleanup) => {\n const droppableId = this.droppableId();\n const strategy = this.#strategy();\n if (droppableId) {\n this.#dragIndexCalculator.registerStrategy(droppableId, strategy);\n onCleanup(() => this.#dragIndexCalculator.unregisterStrategy(droppableId));\n }\n });\n\n // Set excluded index persistently during same-list drag.\n effect(() => {\n const strategy = this.#strategy();\n const draggedIndex = this.#draggedItemIndex();\n strategy.setExcludedIndex(draggedIndex >= 0 ? draggedIndex : null);\n });\n\n // Keyboard drag autoscroll: scroll to keep target index visible\n effect(() => {\n // Only apply when this droppable is active during keyboard drag\n if (!this.#dragState.isKeyboardDrag()) return;\n const activeDroppable = this.#dragState.activeDroppableId();\n if (activeDroppable !== this.droppableId()) return;\n\n const targetIndex = this.#dragState.keyboardTargetIndex();\n if (targetIndex === null) return;\n\n const strategy = this.#strategy();\n strategy.version();\n const height = this.effectiveHeight();\n if (height <= 0) return;\n\n const element = this.#elementRef.nativeElement;\n const currentScrollTop = element.scrollTop;\n\n // Calculate target item position using strategy\n const targetTop = strategy.getOffsetForIndex(targetIndex);\n const targetBottom = targetTop + strategy.getItemHeight(targetIndex);\n\n // Calculate visible range\n const viewportTop = currentScrollTop;\n const viewportBottom = currentScrollTop + height;\n\n // Check if target is fully visible\n if (targetTop < viewportTop) {\n // Target is above viewport - scroll up\n element.scrollTop = targetTop;\n this.#scrollTop.set(targetTop);\n } else if (targetBottom > viewportBottom) {\n // Target is below viewport - scroll down\n const newScrollTop = targetBottom - height;\n element.scrollTop = newScrollTop;\n this.#scrollTop.set(newScrollTop);\n }\n });\n\n // Preserve scroll position when drag ends at bottom of list.\n // Safety net: totalHeight no longer shrinks during drag (getTotalHeight\n // ignores exclusion), but this logic remains as harmless protection\n // in case future changes reintroduce height variance.\n effect(() => {\n const currentDraggedId = this.draggedItemId();\n const currentTotalHeight = this.totalHeight();\n const element = this.#elementRef.nativeElement;\n\n // Detect drag end (was dragging, now not)\n if (this.#previousDraggedId !== null && currentDraggedId === null) {\n const currentScrollTop = element.scrollTop;\n const strategy = this.#strategy();\n strategy.version();\n const height = this.effectiveHeight();\n const totalItems = this.items().length;\n\n // Calculate if we were at/near bottom (within 10px tolerance)\n // using the height FROM THE PREVIOUS CYCLE (when dragging was active)\n const dragReducedMaxScroll = Math.max(0, this.#previousTotalHeight - height);\n const wasAtBottom = currentScrollTop >= dragReducedMaxScroll - 10;\n\n if (wasAtBottom && dragReducedMaxScroll > 0) {\n // Clear exclusion before calculating new height\n strategy.setExcludedIndex(null);\n\n // Adjust scroll to new bottom position after totalHeight increases\n afterNextRender(\n () => {\n const newTotalHeight = strategy.getTotalHeight(totalItems);\n const newMaxScroll = Math.max(0, newTotalHeight - height);\n element.scrollTop = newMaxScroll;\n this.#scrollTop.set(newMaxScroll);\n },\n { injector: this.#injector },\n );\n }\n }\n\n this.#previousDraggedId = currentDraggedId;\n this.#previousTotalHeight = currentTotalHeight;\n });\n\n // Clamp scrollTop during drag if totalHeight ever shrinks.\n // With the current fix, getTotalHeight no longer excludes the dragged item,\n // so this is effectively a no-op. Kept as a safety net.\n effect(() => {\n const isDragging = this.#dragState.isDragging();\n const totalHeight = this.totalHeight();\n const element = this.#elementRef.nativeElement;\n\n if (isDragging) {\n const containerHeight = this.effectiveHeight();\n const maxScroll = Math.max(0, totalHeight - containerHeight);\n const currentScrollTop = element.scrollTop;\n\n // Clamp scrollTop to valid range\n if (currentScrollTop > maxScroll) {\n element.scrollTop = maxScroll;\n this.#scrollTop.set(maxScroll);\n }\n }\n });\n }\n\n ngOnInit(): void {\n // Set up ResizeObserver for dynamic height measurement\n if (this.dynamicItemHeight()) {\n this.#setupItemResizeObserver();\n }\n }\n\n ngAfterViewInit(): void {\n const element = this.#elementRef.nativeElement;\n\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element,\n ngZone: this.#ngZone,\n height: this.#measuredHeight,\n minDeltaPx: 1,\n });\n\n // Scroll listener outside Angular zone with RAF throttling.\n // This avoids template event binding which would mark the component dirty 60x/sec.\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: 5,\n });\n\n // Observe rendered items for dynamic height measurement\n if (this.dynamicItemHeight()) {\n this.#observeRenderedItems();\n }\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n for (const element of this.#observedElementByKey.values()) {\n this.#itemResizeObserver?.unobserve(element);\n }\n this.#observedElementByKey.clear();\n this.#itemResizeObserver?.disconnect();\n }\n\n /**\n * Set up ResizeObserver for measuring individual item heights.\n */\n #setupItemResizeObserver(): void {\n this.#ngZone.runOutsideAngular(() => {\n this.#itemResizeObserver = new ResizeObserver((entries) => {\n const strategy = this.#strategy();\n for (const entry of entries) {\n const element = entry.target as HTMLElement;\n const key = this.#observedElements.get(element);\n if (key === undefined) continue;\n\n const height = entry.borderBoxSize?.[0]?.blockSize ?? element.offsetHeight;\n if (height > 0) {\n strategy.setMeasuredHeight(key, height);\n }\n }\n });\n });\n }\n\n /**\n * Observe currently rendered items' DOM elements for height changes.\n * Called after view init and on each render cycle in dynamic mode.\n */\n #observeRenderedItems(): void {\n if (!this.#itemResizeObserver) return;\n\n // Use an effect to re-observe whenever rendered items change\n effect(\n () => {\n const rendered = this.renderedItems();\n const idFn = this.itemIdFn();\n const observer = this.#itemResizeObserver;\n if (!observer) return;\n\n // Find the content wrapper and observe item elements\n const wrapper = this.#elementRef.nativeElement.querySelector(\n '.vdnd-virtual-scroll-content-wrapper',\n );\n if (!wrapper) return;\n\n const nextObservedByKey = new Map<unknown, HTMLElement>();\n\n for (const entry of rendered) {\n if (entry.type !== 'item' || !entry.data) continue;\n const key = idFn(entry.data);\n\n // Find the DOM element for this item by its data-draggable-id.\n const el = queryByAttribute<HTMLElement>(wrapper, 'data-draggable-id', key);\n if (el) {\n nextObservedByKey.set(key, el);\n }\n }\n\n for (const [key, oldElement] of this.#observedElementByKey) {\n const nextElement = nextObservedByKey.get(key);\n if (nextElement !== oldElement) {\n observer.unobserve(oldElement);\n }\n }\n\n for (const [key, nextElement] of nextObservedByKey) {\n const currentElement = this.#observedElementByKey.get(key);\n if (currentElement !== nextElement) {\n this.#observedElements.set(nextElement, key);\n observer.observe(nextElement);\n }\n }\n\n this.#observedElementByKey.clear();\n for (const [key, element] of nextObservedByKey) {\n this.#observedElementByKey.set(key, element);\n }\n },\n { injector: this.#injector },\n );\n }\n\n /**\n * Scroll to a specific position.\n */\n scrollTo(position: number): void {\n this.#elementRef.nativeElement.scrollTop = position;\n this.#scrollTop.set(position);\n }\n\n /**\n * Scroll to a specific item index.\n */\n scrollToIndex(index: number): void {\n const strategy = this.#strategy();\n const position = strategy.getOffsetForIndex(index);\n this.scrollTo(position);\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#scrollTop();\n }\n\n /**\n * Get the total scrollable height.\n */\n getScrollHeight(): number {\n return this.totalHeight();\n }\n\n /**\n * Scroll by a delta amount.\n */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(this.getScrollTop() + delta, this.getScrollHeight() - this.effectiveHeight()),\n );\n this.scrollTo(newPosition);\n }\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { DragStateService } from '../services/drag-state.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\n\n/**\n * Context provided to the drag preview template.\n */\nexport interface DragPreviewContext<T = unknown> {\n /** The data associated with the dragged item */\n $implicit: T;\n /** The draggable ID */\n draggableId: string;\n /** The source droppable ID */\n droppableId: string;\n}\n\n/**\n * Renders a preview of the dragged item that follows the cursor.\n *\n * The component automatically teleports itself into a body-level overlay container,\n * so it works correctly even inside ancestors with CSS `transform` (e.g. Ionic pages).\n * It can be placed anywhere in the component tree.\n *\n * @example\n * ```html\n * <vdnd-drag-preview>\n * <ng-template let-data let-id=\"draggableId\">\n * <div class=\"drag-preview\">{{ data.name }}</div>\n * </ng-template>\n * </vdnd-drag-preview>\n * ```\n */\n@Component({\n selector: 'vdnd-drag-preview',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n template: `\n @if (isVisible()) {\n <div\n class=\"vdnd-drag-preview\"\n data-testid=\"vdnd-drag-preview\"\n [style.transform]=\"transform()\"\n [style.width.px]=\"dimensions().width\"\n [style.height.px]=\"dimensions().height\"\n >\n @if (previewTemplate()) {\n <ng-container *ngTemplateOutlet=\"previewTemplate()!; context: templateContext()\">\n </ng-container>\n } @else if (clonedElement()) {\n <div class=\"vdnd-drag-preview-clone\" #cloneContainer></div>\n } @else {\n <div class=\"vdnd-drag-preview-default\">\n {{ dragState.draggedItem()?.draggableId }}\n </div>\n }\n </div>\n }\n `,\n styles: `\n .vdnd-drag-preview {\n box-sizing: border-box;\n position: fixed;\n left: 0;\n top: 0;\n will-change: transform;\n pointer-events: none;\n z-index: 1000;\n }\n\n .vdnd-drag-preview-clone {\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n `,\n})\nexport class DragPreviewComponent<T = unknown> implements OnDestroy {\n protected readonly dragState = inject(DragStateService);\n readonly #overlayContainer = inject(OverlayContainerService);\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n\n /** Optional custom template for the preview */\n previewTemplate = input<TemplateRef<DragPreviewContext<T>>>();\n\n /** Offset from cursor to preview (to avoid cursor being on top of preview) */\n cursorOffset = input<{ x: number; y: number }>({ x: 8, y: 8 });\n\n /** Reference to the clone container element (cannot use ES private with viewChild) */\n private readonly cloneContainer = viewChild<ElementRef<HTMLElement>>('cloneContainer');\n\n /** Whether this preview's template registration is currently counted (kept balanced). */\n #templateRegistered = false;\n\n /** The cloned element from drag state (used when no custom template is provided) */\n protected readonly clonedElement = computed(() => {\n if (this.previewTemplate()) {\n return null; // Custom template takes precedence\n }\n return this.dragState.draggedItem()?.clonedElement ?? null;\n });\n\n constructor() {\n // Teleport host element into the body-level overlay container after first render.\n // This escapes any ancestor CSS transforms that would break position: fixed.\n afterNextRender(() => {\n const container = this.#overlayContainer.getContainerElement();\n if (container) {\n container.appendChild(this.#elementRef.nativeElement);\n }\n });\n\n // Publish whether this preview renders via a custom template so the drag\n // directives can skip the drag-start element clone when it won't be shown.\n effect(() => {\n const hasTemplate = !!this.previewTemplate();\n if (hasTemplate && !this.#templateRegistered) {\n this.#overlayContainer.setTemplatePreviewActive(true);\n this.#templateRegistered = true;\n } else if (!hasTemplate && this.#templateRegistered) {\n this.#overlayContainer.setTemplatePreviewActive(false);\n this.#templateRegistered = false;\n }\n });\n\n // Effect to insert the cloned element into the container\n effect(() => {\n const container = this.cloneContainer()?.nativeElement;\n const clone = this.clonedElement();\n\n if (!container) {\n return;\n }\n\n // Clear previous content and append the prepared clone element.\n // Avoid cloning again: ElementCloneService already creates a styled/sanitized clone.\n container.innerHTML = '';\n if (clone) {\n container.appendChild(clone);\n }\n });\n }\n\n ngOnDestroy(): void {\n if (this.#templateRegistered) {\n this.#overlayContainer.setTemplatePreviewActive(false);\n this.#templateRegistered = false;\n }\n this.#elementRef.nativeElement.remove();\n }\n\n /** Whether the preview is visible */\n protected readonly isVisible = computed(() => {\n return this.dragState.isDragging() && this.dragState.cursorPosition() !== null;\n });\n\n /** Position of the preview */\n protected readonly position = computed(() => {\n const cursor = this.dragState.cursorPosition();\n const grabOffset = this.dragState.grabOffset();\n const fallbackOffset = this.cursorOffset();\n const initialPosition = this.dragState.initialPosition();\n const lockAxis = this.dragState.lockAxis();\n\n if (!cursor) {\n return { x: 0, y: 0 };\n }\n\n // Use grab offset if available (preserves grab position), otherwise fall back to cursorOffset input\n const offset = grabOffset ?? fallbackOffset;\n\n let x = cursor.x - offset.x;\n let y = cursor.y - offset.y;\n\n // Apply axis locking if configured\n if (lockAxis && initialPosition) {\n if (lockAxis === 'x') {\n // Lock X axis: x stays at initial position\n x = initialPosition.x - offset.x;\n } else if (lockAxis === 'y') {\n // Lock Y axis: y stays at initial position\n y = initialPosition.y - offset.y;\n }\n }\n\n return { x, y };\n });\n\n /** Transform-based positioning for better performance (avoid layout from left/top). */\n protected readonly transform = computed(() => {\n const { x, y } = this.position();\n return `translate3d(${x}px, ${y}px, 0)`;\n });\n\n /** Dimensions of the preview */\n protected readonly dimensions = computed(() => {\n const item = this.dragState.draggedItem();\n\n if (!item) {\n return { width: 100, height: 50 };\n }\n\n return {\n width: item.width,\n height: item.height,\n };\n });\n\n /** Template context */\n protected readonly templateContext = computed((): DragPreviewContext<T> => {\n const item = this.dragState.draggedItem();\n\n return {\n $implicit: (item?.data ?? null) as T,\n draggableId: item?.draggableId ?? '',\n droppableId: item?.droppableId ?? '',\n };\n });\n}\n","import { ChangeDetectionStrategy, Component, input, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * Context provided to the custom placeholder template.\n */\nexport interface PlaceholderContext {\n /** The height of the placeholder in pixels */\n $implicit: number;\n /** The height of the placeholder in pixels (explicit property) */\n height: number;\n}\n\n/**\n * A placeholder component that indicates where a dropped item will be inserted.\n *\n * By default, renders as empty/transparent space. Pass a custom template\n * to customize the placeholder appearance.\n *\n * @example\n * ```html\n * <!-- Default: transparent/empty space -->\n * <vdnd-placeholder [height]=\"50\"></vdnd-placeholder>\n *\n * <!-- Custom template with dashed border -->\n * <vdnd-placeholder [height]=\"50\" [template]=\"customPlaceholder\">\n * <ng-template #customPlaceholder let-height>\n * <div class=\"my-placeholder\" [style.height.px]=\"height\">\n * Drop here\n * </div>\n * </ng-template>\n * </vdnd-placeholder>\n * ```\n */\n@Component({\n selector: 'vdnd-placeholder',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n host: {\n class: 'vdnd-placeholder',\n '[style.height.px]': 'height()',\n '[attr.data-draggable-id]': '\"placeholder\"',\n },\n template: `\n @if (template()) {\n <ng-container\n *ngTemplateOutlet=\"template()!; context: { $implicit: height(), height: height() }\"\n >\n </ng-container>\n }\n `,\n styles: `\n :host {\n display: block;\n box-sizing: border-box;\n }\n `,\n})\nexport class PlaceholderComponent {\n /** Height of the placeholder in pixels */\n height = input<number>(50);\n\n /** Optional custom template for the placeholder content */\n template = input<TemplateRef<PlaceholderContext>>();\n}\n","import { Directive, InjectionToken, input, Signal } from '@angular/core';\n\n/**\n * Token for injecting the group context from a parent directive.\n * Allows child draggables and droppables to inherit the group name automatically.\n */\nexport const VDND_GROUP_TOKEN = new InjectionToken<VdndGroupContext>('VDND_GROUP_TOKEN');\n\n/**\n * Context provided by the group directive to its children.\n */\nexport interface VdndGroupContext {\n /** The group name signal */\n readonly group: Signal<string>;\n}\n\n/**\n * Provides a group context to child draggable and droppable directives.\n * When applied to a parent element, child directives can inherit the group name\n * automatically without needing to specify it on each element.\n *\n * @example\n * ```html\n * <!-- Without group directive (verbose) -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" vdndDraggableGroup=\"my-group\">Item 1</div>\n * <div vdndDraggable=\"item-2\" vdndDraggableGroup=\"my-group\">Item 2</div>\n * </div>\n *\n * <!-- With group directive (concise) -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\">\n * <div vdndDraggable=\"item-1\">Item 1</div>\n * <div vdndDraggable=\"item-2\">Item 2</div>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndGroup]',\n providers: [\n {\n provide: VDND_GROUP_TOKEN,\n useExisting: DroppableGroupDirective,\n },\n ],\n})\nexport class DroppableGroupDirective implements VdndGroupContext {\n /** The group name that will be inherited by child directives */\n readonly group = input.required<string>({ alias: 'vdndGroup' });\n}\n","import { computed, isDevMode, type Signal } from '@angular/core';\nimport type { VdndGroupContext } from '../directives/droppable-group.directive';\n\n/**\n * Configuration options for creating an effective group signal.\n */\nexport interface GroupResolutionOptions {\n /** The explicit group input signal */\n explicitGroup: Signal<string | undefined>;\n /** The parent group context injected via VDND_GROUP_TOKEN (may be null) */\n parentGroup: VdndGroupContext | null;\n /** The element ID signal for warning messages */\n elementId: Signal<string>;\n /** The type of element ('draggable' or 'droppable') for warning messages */\n elementType: 'draggable' | 'droppable';\n}\n\n/**\n * State tracker for group resolution to avoid repeated warnings.\n */\ninterface GroupResolutionState {\n hasWarnedMissingGroup: boolean;\n}\n\n/**\n * Creates a computed signal that resolves the effective group name for a draggable or droppable.\n *\n * Resolution order:\n * 1. Explicit group input (vdndDraggableGroup or vdndDroppableGroup)\n * 2. Inherited group from parent vdndGroup directive\n * 3. null (with dev-mode warning)\n *\n * @example\n * ```typescript\n * readonly #effectiveGroup = createEffectiveGroupSignal({\n * explicitGroup: this.vdndDraggableGroup,\n * parentGroup: this.#parentGroup,\n * elementId: this.vdndDraggable,\n * elementType: 'draggable',\n * });\n * ```\n */\nexport function createEffectiveGroupSignal(options: GroupResolutionOptions): Signal<string | null> {\n const { explicitGroup, parentGroup, elementId, elementType } = options;\n\n // State object to track whether we've warned (mutable closure state)\n const state: GroupResolutionState = { hasWarnedMissingGroup: false };\n\n return computed((): string | null => {\n const explicit = explicitGroup();\n if (explicit) return explicit;\n\n const inherited = parentGroup?.group();\n if (inherited) return inherited;\n\n if (isDevMode() && !state.hasWarnedMissingGroup) {\n const directive = elementType === 'draggable' ? 'vdndDraggable' : 'vdndDroppable';\n const groupInput = elementType === 'draggable' ? 'vdndDraggableGroup' : 'vdndDroppableGroup';\n const action = elementType === 'draggable' ? 'Drag' : 'Dropping';\n\n console.warn(\n `[ngx-virtual-dnd] [${directive}=\"${elementId()}\"] requires a group. ` +\n `Either set ${groupInput} or wrap in a vdndGroup directive. ` +\n `${action} will be disabled for this element.`,\n );\n state.hasWarnedMissingGroup = true;\n }\n\n return null;\n });\n}\n","/**\n * Normalize a placeholder index into the final same-list insertion index.\n *\n * Same-list drags render a placeholder in a list with the source item hidden, so placeholder\n * indexes after the source include a +1 hidden-source adjustment. Drop consumers receive the\n * post-removal insertion index, which subtracts that adjustment.\n */\nexport function normalizeDropDestinationIndex(args: {\n sourceIndex: number;\n placeholderIndex: number;\n sourceDroppableId: string | null;\n activeDroppableId: string | null;\n}): number;\nexport function normalizeDropDestinationIndex(args: {\n sourceIndex: number;\n placeholderIndex: number | null;\n sourceDroppableId: string | null;\n activeDroppableId: string | null;\n}): number | null;\nexport function normalizeDropDestinationIndex({\n sourceIndex,\n placeholderIndex,\n sourceDroppableId,\n activeDroppableId,\n}: {\n sourceIndex: number;\n placeholderIndex: number | null;\n sourceDroppableId: string | null;\n activeDroppableId: string | null;\n}): number | null {\n if (placeholderIndex === null) {\n return null;\n }\n\n if (\n sourceDroppableId !== null &&\n sourceDroppableId === activeDroppableId &&\n sourceIndex < placeholderIndex\n ) {\n return placeholderIndex - 1;\n }\n\n return placeholderIndex;\n}\n","import {\n afterNextRender,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n untracked,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { DragState, DropEvent, END_OF_LIST } from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\nimport { createEffectiveGroupSignal } from '../utils/group-resolution';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\nimport { queryByAttribute } from '../utils/attribute-selectors';\nimport { normalizeDropDestinationIndex } from '../utils/drop-index-normalization';\n\n/**\n * Marks an element as a valid drop target within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDroppable=\"list-1\"\n * vdndDroppableGroup=\"my-group\"\n * (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDroppable=\"list-1\" (drop)=\"onDrop($event)\">\n * <!-- Draggable items here -->\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDroppable]',\n host: {\n '[attr.data-droppable-id]': 'vdndDroppable()',\n '[attr.data-droppable-group]': 'effectiveGroup()',\n '[attr.data-droppable-disabled]': 'disabled() || null',\n '[attr.data-constrain-to-container]': 'constrainToContainer() || null',\n '[attr.aria-dropeffect]': '\"move\"',\n '[class.vdnd-droppable]': 'true',\n '[class.vdnd-droppable-active]': 'isActive()',\n '[class.vdnd-droppable-disabled]': 'disabled()',\n },\n})\nexport class DroppableDirective implements OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this droppable */\n vdndDroppable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDroppableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables dropping) if neither is available.\n */\n readonly effectiveGroup = createEffectiveGroupSignal({\n explicitGroup: this.vdndDroppableGroup,\n parentGroup: this.#parentGroup,\n elementId: this.vdndDroppable,\n elementType: 'droppable',\n });\n\n /** Optional data associated with this droppable */\n vdndDroppableData = input<unknown>();\n\n /** Whether this droppable is disabled */\n disabled = input<boolean>(false);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Constrain drag preview and placeholder to container boundaries */\n constrainToContainer = input<boolean>(false);\n\n /** Emits when an item is dropped on this droppable */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n\n /** Whether this droppable is currently being targeted */\n readonly isActive = computed(() => {\n const activeId = this.#dragState.activeDroppableId();\n return activeId === this.vdndDroppable() && !this.disabled();\n });\n\n /** The current placeholder ID when this droppable is active */\n readonly placeholderId = computed(() => {\n if (!this.isActive()) {\n return null;\n }\n return this.#dragState.placeholderId();\n });\n\n /** Track previous active state to detect the drag-end transition */\n #wasActive = false;\n\n /**\n * The terminal drag snapshot this droppable has already processed. `endedDragState`\n * persists until the next drag starts, so this guards against replaying the same drop\n * when the effect re-runs (e.g. `disabled()` toggling) after the drag has ended.\n */\n #handledEndedState: DragState | null = null;\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScroll,\n getElement: () => this.#elementRef.nativeElement,\n getId: () => this.vdndDroppable(),\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n // Register whenever a group is resolved; do NOT gate on scrollability. DOM size is\n // not reactive, so a list that becomes scrollable after init (async data, resize)\n // would never register. AutoScrollService filters by live scroll geometry per drag.\n canRegister: () => Boolean(this.effectiveGroup()),\n });\n\n // Notify the calculator once this droppable is rendered (host data attributes applied).\n // Matters when it mounts DURING an active drag — the candidate snapshot was frozen at\n // drag start, so without this a conditionally rendered list would never become a target.\n afterNextRender(() => {\n const group = this.effectiveGroup();\n if (group) {\n this.#positionCalculator.notifyCandidatesChanged(group);\n }\n });\n\n // React to state changes and handle drop events.\n //\n // Keyed only on the low-frequency fields (isActive/isDragging/draggedItem). The final\n // placeholder/index values #handleDrop needs are captured by DragStateService.endDrag()\n // into endedDragState() at the drag-end boundary, so this effect never has to poll the\n // high-frequency cursor/placeholder signals — reading them here would make it re-run and\n // re-allocate a snapshot on every 60fps frame, defeating the service's signal splitting.\n effect(() => {\n const active = this.isActive();\n const draggedItem = this.#dragState.draggedItem();\n const isDragging = this.#dragState.isDragging();\n\n // Handle drag end (drop). This droppable is the release target when it was either\n // observed active during the drag (#wasActive) OR named as the target in the ended\n // drag snapshot. The snapshot path covers the pointer-up flush, where the final\n // position is processed and the state cleared in the same synchronous task, so this\n // effect never observes isActive() === true mid-drag and #wasActive stays false.\n const endedState = untracked(() => this.#dragState.endedDragState());\n const endedTargetedThis = endedState?.activeDroppableId === this.vdndDroppable();\n\n if (!isDragging && draggedItem === null && (this.#wasActive || endedTargetedThis)) {\n // Consume each terminal snapshot exactly once. endedDragState persists until the\n // next drag starts and disabled()/other inputs re-run this effect, so without a\n // per-snapshot guard a later state change would replay the same historical drop.\n if (endedState !== this.#handledEndedState) {\n this.#handledEndedState = endedState;\n // Emit only for an enabled target that ended normally. A target disabled at\n // release still consumes the snapshot (so re-enabling can't resurrect the drop)\n // but emits nothing, keeping dragEnd and drop consistent.\n if (!this.disabled() && !this.#dragState.wasCancelled()) {\n this.#handleDrop();\n }\n }\n }\n\n this.#wasActive = active;\n });\n }\n\n ngOnDestroy(): void {\n // Clean up if this droppable is destroyed while being active\n if (this.isActive()) {\n this.#dragState.setActiveDroppable(null);\n }\n\n // Unregister from auto-scroll\n this.#autoScroll.unregisterContainer(this.vdndDroppable());\n\n // If this droppable unmounts mid-drag, tell the calculator so it drops it from the\n // frozen candidate list (deferred re-query runs once the element has left the DOM).\n const group = untracked(() => this.effectiveGroup());\n if (group) {\n this.#positionCalculator.notifyCandidatesChanged(group);\n }\n }\n\n /**\n * Handle a drop on this droppable.\n */\n #handleDrop(): void {\n // The live state is cleared before this effect fires, so read the terminal snapshot\n // captured by endDrag()/cancelDrag() immediately before the reset.\n const state = untracked(() => this.#dragState.endedDragState());\n\n if (!state?.draggedItem || state.activeDroppableId !== this.vdndDroppable()) {\n return;\n }\n\n const sourceDroppableId = state.sourceDroppableId ?? '';\n const placeholderId = state.placeholderId ?? END_OF_LIST;\n\n // Use the stored source index from drag state\n // This is critical for virtual scrolling where the original element may no longer\n // be in the DOM after autoscroll (it gets virtualized out of view)\n const sourceIndex =\n state.sourceIndex ?? this.#getItemIndex(state.draggedItem.draggableId, sourceDroppableId);\n\n // Use the pre-calculated placeholderIndex if available (more reliable)\n // Fall back to DOM-based calculation if not. Then normalize to the same\n // consumer-facing insertion index emitted by DragEndEvent.\n const placeholderIndex =\n state.placeholderIndex !== null && state.placeholderIndex !== undefined\n ? state.placeholderIndex\n : this.#getDestinationIndex(placeholderId);\n const destinationIndex = normalizeDropDestinationIndex({\n sourceIndex,\n placeholderIndex,\n sourceDroppableId,\n activeDroppableId: this.vdndDroppable(),\n });\n\n this.drop.emit({\n source: {\n draggableId: state.draggedItem.draggableId,\n droppableId: sourceDroppableId,\n index: sourceIndex,\n data: state.draggedItem.data,\n },\n destination: {\n droppableId: this.vdndDroppable(),\n placeholderId,\n index: destinationIndex,\n data: this.vdndDroppableData(),\n },\n });\n }\n\n /**\n * Get the index of an item in a droppable.\n * This is a simplified implementation - in practice, the consumer would track this.\n */\n #getItemIndex(draggableId: string, droppableId: string): number {\n // Find all draggables in the source droppable\n const droppable = queryByAttribute<HTMLElement>(document, 'data-droppable-id', droppableId);\n if (!droppable) {\n return 0;\n }\n\n const draggables = droppable.querySelectorAll('[data-draggable-id]');\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === draggableId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the destination index based on the placeholder.\n */\n #getDestinationIndex(placeholderId: string): number {\n // Exclude placeholder elements from the count\n const draggables = this.#elementRef.nativeElement.querySelectorAll(\n '[data-draggable-id]:not([data-draggable-id=\"placeholder\"])',\n );\n\n if (placeholderId === END_OF_LIST) {\n return draggables.length;\n }\n\n // Find the index of the placeholder item\n for (let i = 0; i < draggables.length; i++) {\n if (draggables[i].getAttribute('data-draggable-id') === placeholderId) {\n return i;\n }\n }\n\n return 0;\n }\n\n /**\n * Get the element reference (for external use).\n */\n getElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Manually scroll this droppable.\n */\n scrollBy(delta: number): void {\n this.#elementRef.nativeElement.scrollTop += delta;\n }\n\n /**\n * Get the current scroll position.\n */\n getScrollTop(): number {\n return this.#elementRef.nativeElement.scrollTop;\n }\n\n /**\n * Get the scroll height.\n */\n getScrollHeight(): number {\n return this.#elementRef.nativeElement.scrollHeight;\n }\n}\n","import { ChangeDetectionStrategy, Component, input, output, TemplateRef } from '@angular/core';\nimport {\n VirtualScrollContainerComponent,\n VirtualScrollItemContext,\n} from './virtual-scroll-container.component';\nimport { DroppableDirective } from '../directives/droppable.directive';\nimport { AutoScrollConfig } from '../services/auto-scroll.service';\nimport { DropEvent } from '../models/drag-drop.models';\n\n/**\n * A high-level component that combines droppable, virtual scroll, and placeholder\n * functionality into a single, easy-to-use component.\n *\n * This component significantly reduces boilerplate by automatically handling:\n * - Placeholder insertion at the correct position\n * - Sticky item management for the dragged item\n * - Virtual scrolling with proper drag-and-drop integration\n * - Droppable container setup\n *\n * @example\n * ```html\n * <!-- Before (verbose): ~45 lines of boilerplate -->\n * <div vdndDroppable=\"list-1\" vdndDroppableGroup=\"demo\" (drop)=\"onDrop($event)\">\n * <vdnd-virtual-scroll\n * [items]=\"itemsWithPlaceholder()\"\n * [itemHeight]=\"50\"\n * [stickyItemIds]=\"stickyIds()\"\n * [itemIdFn]=\"getItemId\"\n * [trackByFn]=\"trackById\"\n * [itemTemplate]=\"itemTpl\">\n * </vdnd-virtual-scroll>\n * </div>\n *\n * <!-- After (concise): ~8 lines -->\n * <div vdndGroup=\"demo\">\n * <vdnd-sortable-list\n * droppableId=\"list-1\"\n * [items]=\"list()\"\n * [itemHeight]=\"50\"\n * [itemIdFn]=\"getItemId\"\n * [itemTemplate]=\"itemTpl\"\n * (drop)=\"onDrop($event)\">\n * </vdnd-sortable-list>\n * </div>\n * ```\n */\n@Component({\n selector: 'vdnd-sortable-list',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [VirtualScrollContainerComponent, DroppableDirective],\n host: {\n class: 'vdnd-sortable-list',\n },\n template: `\n <div\n class=\"vdnd-sortable-list-droppable\"\n [vdndDroppable]=\"droppableId()\"\n [vdndDroppableGroup]=\"group()\"\n [vdndDroppableData]=\"droppableData()\"\n [disabled]=\"disabled()\"\n [constrainToContainer]=\"constrainToContainer()\"\n (drop)=\"drop.emit($event)\"\n >\n <vdnd-virtual-scroll\n [items]=\"items()\"\n [itemHeight]=\"itemHeight()\"\n [dynamicItemHeight]=\"dynamicItemHeight()\"\n [itemIdFn]=\"itemIdFn()\"\n [trackByFn]=\"trackByFn()\"\n [itemTemplate]=\"itemTemplate()\"\n [droppableId]=\"droppableId()\"\n [autoStickyDraggedItem]=\"true\"\n [containerHeight]=\"containerHeight()\"\n [overscan]=\"overscan()\"\n [autoScrollEnabled]=\"autoScrollEnabled()\"\n [autoScrollConfig]=\"autoScrollConfig()\"\n >\n </vdnd-virtual-scroll>\n </div>\n `,\n styles: `\n :host {\n display: block;\n }\n `,\n})\nexport class VirtualSortableListComponent<T> {\n // ========== Required Inputs ==========\n\n /** Unique identifier for this droppable list */\n droppableId = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n group = input<string>();\n\n /** Array of items to render */\n items = input.required<T[]>();\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n /** Function to get a unique ID from an item */\n itemIdFn = input.required<(item: T) => string>();\n\n /** Template for rendering each item */\n itemTemplate = input.required<TemplateRef<VirtualScrollItemContext<T>>>();\n\n // ========== Optional Inputs ==========\n\n /**\n * Track-by function for the @for loop.\n * Optional - if not provided, will be derived from itemIdFn.\n */\n trackByFn = input<(index: number, item: T) => string | number>();\n\n /** Optional data associated with this droppable */\n droppableData = input<unknown>();\n\n /** Whether this sortable list is disabled */\n disabled = input<boolean>(false);\n\n /**\n * Height of the container in pixels.\n * If not provided, uses CSS-based height detection.\n */\n containerHeight = input<number>();\n\n /** Number of items to render above/below the visible area */\n overscan = input<number>(3);\n\n /** Enable auto-scroll when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n /** Constrain drag preview and placeholder to container boundaries */\n constrainToContainer = input<boolean>(false);\n\n // ========== Outputs ==========\n\n /** Emits when an item is dropped on this list */\n // eslint-disable-next-line @angular-eslint/no-output-native\n drop = output<DropEvent>();\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\n\n/**\n * A virtual viewport component that provides efficient wrapper-based positioning\n * for virtual scrolling. This component acts as the scroll container and provides\n * a content wrapper with GPU-accelerated transform positioning.\n *\n * Use this component when you need virtual scrolling with optimal performance.\n * Items rendered inside via `*vdndVirtualFor` will be positioned using a single\n * transform on the wrapper, rather than individual absolute positioning.\n *\n * @example\n * Basic usage:\n * ```html\n * <vdnd-virtual-viewport [itemHeight]=\"50\" style=\"height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n *\n * @example\n * With dynamic item heights:\n * ```html\n * <vdnd-virtual-viewport\n * [itemHeight]=\"50\"\n * [dynamicItemHeight]=\"true\"\n * style=\"height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-viewport',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualViewportComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualViewportComponent },\n ],\n host: {\n class: 'vdnd-virtual-viewport',\n },\n styles: `\n :host {\n display: block;\n overflow: auto;\n position: relative;\n /* Disable browser scroll anchoring to prevent scroll position adjustments\n when DOM changes (e.g., placeholder position updates during drag) */\n overflow-anchor: none;\n }\n\n .vdnd-viewport-spacer {\n position: absolute;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-viewport-content {\n position: absolute;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n template: `\n <!-- Spacer maintains total scroll height -->\n <div\n class=\"vdnd-viewport-spacer\"\n [style.top.px]=\"contentOffset()\"\n [style.height.px]=\"totalHeight()\"\n ></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div\n class=\"vdnd-viewport-content\"\n [style.top.px]=\"contentOffset()\"\n [style.transform]=\"contentTransform()\"\n >\n <ng-content></ng-content>\n </div>\n `,\n})\nexport class VirtualViewportComponent\n implements VdndVirtualViewport, VdndScrollContainer, OnInit, OnDestroy\n{\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-viewport-${Math.random().toString(36).slice(2, 9)}`;\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n /** Offset for content below headers (in pixels) */\n contentOffset = input<number>(0);\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== Strategy ==========\n\n /** The virtual scroll strategy, created based on dynamicItemHeight input */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n const height = this.itemHeight();\n return this.dynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n get strategy(): VirtualScrollStrategy {\n return this.#strategy();\n }\n\n // ========== Computed Values ==========\n\n /** Total height of all items (for scroll height), derived from strategy item count */\n readonly totalHeight = computed(() => {\n const s = this.#strategy();\n s.version();\n return s.getTotalHeight(s.getItemCount());\n });\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const s = this.#strategy();\n s.version();\n const offset = s.getOffsetForIndex(startIndex);\n return `translateY(${offset}px)`;\n });\n\n // ========== VdndVirtualViewport Implementation ==========\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n getOffsetForIndex(index: number): number {\n return this.#strategy().getOffsetForIndex(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScrollService,\n getElement: () => this.nativeElement,\n getId: () => this.scrollContainerId() ?? this.#generatedScrollId,\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n });\n }\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\n/**\n * Marks an element as the header content for a `vdnd-virtual-content` component.\n *\n * Place this directive on a projected element inside `<vdnd-virtual-content>`.\n * The component will automatically measure the header's height via ResizeObserver\n * and use it as the content offset for virtual scroll calculations.\n *\n * This eliminates the need for manual ResizeObserver boilerplate that was\n * previously required with the `[contentOffset]` input.\n *\n * @example\n * ```html\n * <vdnd-virtual-content [itemHeight]=\"50\">\n * <div class=\"page-header\" vdndContentHeader>\n * <h1>My List</h1>\n * </div>\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n * ```\n */\n@Directive({\n selector: '[vdndContentHeader]',\n})\nexport class ContentHeaderDirective {\n readonly elementRef = inject(ElementRef<HTMLElement>);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n inject,\n input,\n NgZone,\n signal,\n} from '@angular/core';\nimport { VDND_VIRTUAL_VIEWPORT, VdndVirtualViewport } from '../tokens/virtual-viewport.token';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\nimport { ContentHeaderDirective } from '../directives/content-header.directive';\n\n/**\n * A virtual content component that provides wrapper-based positioning\n * for virtual scrolling within an EXTERNAL scroll container.\n *\n * Use this component when you need virtual scrolling alongside other content\n * (headers, footers) within a shared scroll container. The component provides\n * a content wrapper with GPU-accelerated transform positioning while delegating\n * scroll handling to the parent `vdndScrollable` container.\n *\n * Headers marked with `vdndContentHeader` are automatically measured via\n * ResizeObserver — no manual offset calculation needed.\n *\n * @example\n * Content projection with auto-measured header:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 100vh;\">\n * <vdnd-virtual-content [itemHeight]=\"50\">\n * <div class=\"header\" vdndContentHeader>Welcome!</div>\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n * </div>\n * ```\n *\n * @example\n * Manual offset (escape hatch):\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 100vh;\">\n * <div class=\"header\" #header>Welcome!</div>\n * <vdnd-virtual-content [itemHeight]=\"50\" [contentOffset]=\"header.offsetHeight\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-content>\n * </div>\n * ```\n */\n@Component({\n selector: 'vdnd-virtual-content',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: VDND_VIRTUAL_VIEWPORT, useExisting: VirtualContentComponent },\n { provide: VDND_SCROLL_CONTAINER, useExisting: VirtualContentComponent },\n ],\n host: {\n class: 'vdnd-virtual-content',\n '[attr.data-content-offset]': 'effectiveContentOffset()',\n '[attr.data-item-height]': 'itemHeight()',\n '[attr.data-total-items]': 'totalItems()',\n },\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n .vdnd-virtual-area {\n position: relative;\n }\n\n .vdnd-content-spacer {\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .vdnd-content-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n will-change: transform;\n }\n `,\n template: `\n <!-- Projected header — in normal document flow, auto-measured via ResizeObserver -->\n <ng-content select=\"[vdndContentHeader]\" />\n\n <!-- Virtual area — sized to totalHeight, contains absolute-positioned spacer + wrapper -->\n <div class=\"vdnd-virtual-area\" [style.height.px]=\"totalHeight()\">\n <!-- Spacer maintains scroll height for the virtual list portion -->\n <div class=\"vdnd-content-spacer\" [style.height.px]=\"totalHeight()\"></div>\n\n <!-- Content wrapper with GPU-accelerated transform -->\n <div class=\"vdnd-content-wrapper\" [style.transform]=\"contentTransform()\">\n <ng-content />\n </div>\n </div>\n `,\n})\nexport class VirtualContentComponent implements VdndVirtualViewport, VdndScrollContainer {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n\n /**\n * The parent scroll container injected via skip-self to get the actual scrollable element.\n * We provide our own VDND_SCROLL_CONTAINER with adjusted values to children.\n */\n readonly #parentScrollContainer = inject(VDND_SCROLL_CONTAINER, { skipSelf: true });\n\n // ========== Content Queries ==========\n\n /** Projected header directive (if any) */\n private readonly headerDirective = contentChild(ContentHeaderDirective);\n\n // ========== Inputs ==========\n\n /** Height of each item in pixels (used as estimate in dynamic mode) */\n itemHeight = input.required<number>();\n\n /**\n * Offset for content above the virtual list (e.g., header height).\n * When a `vdndContentHeader` is projected, this input is ignored —\n * the offset is auto-measured via ResizeObserver.\n * Use this input only when the header lives outside the component.\n */\n contentOffset = input<number>(0);\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n dynamicItemHeight = input<boolean>(false);\n\n // ========== Internal State ==========\n\n /**\n * The actual first rendered item index, set by VirtualForDirective.\n * This accounts for overscan and is used for wrapper positioning.\n */\n readonly #renderStartIndex = signal(0);\n\n /** Auto-measured header height from ResizeObserver */\n readonly #measuredHeaderHeight = signal(0);\n\n // ========== Strategy ==========\n\n /** The virtual scroll strategy, created based on dynamicItemHeight input */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n const height = this.itemHeight();\n return this.dynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n get strategy(): VirtualScrollStrategy {\n return this.#strategy();\n }\n\n // ========== Computed Values ==========\n\n /** Total item count, derived from strategy (populated by VirtualForDirective) */\n readonly totalItems = computed(() => {\n const s = this.#strategy();\n s.version();\n return s.getItemCount();\n });\n\n /** Total height of all items (for scroll height) */\n readonly totalHeight = computed(() => {\n const s = this.#strategy();\n s.version();\n return s.getTotalHeight(s.getItemCount());\n });\n\n /**\n * Effective content offset: when a `vdndContentHeader` directive is projected,\n * returns the auto-measured header height. Otherwise falls back to the\n * `contentOffset` input for backward compatibility.\n */\n readonly effectiveContentOffset = computed(() => {\n const header = this.headerDirective();\n return header ? this.#measuredHeaderHeight() : this.contentOffset();\n });\n\n /**\n * Adjusted scroll position - subtracts the content offset so the virtual scroll\n * calculates visible items correctly relative to where the list starts.\n */\n readonly #adjustedScrollTop = computed(() => {\n return Math.max(0, this.#parentScrollContainer.scrollTop() - this.effectiveContentOffset());\n });\n\n /** Transform for content wrapper positioning */\n readonly contentTransform = computed(() => {\n const startIndex = this.#renderStartIndex();\n const s = this.#strategy();\n s.version();\n const offset = s.getOffsetForIndex(startIndex);\n return `translateY(${offset}px)`;\n });\n\n constructor() {\n this.#setupHeaderMeasurement();\n }\n\n // ========== VdndVirtualViewport Implementation ==========\n\n /** Adjusted scroll position relative to the virtual list start */\n scrollTop(): number {\n return this.#adjustedScrollTop();\n }\n\n containerHeight(): number {\n return this.#parentScrollContainer.containerHeight();\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n /**\n * Called by VirtualForDirective to inform this viewport of the actual\n * first rendered item index. Used for wrapper positioning.\n */\n setRenderStartIndex(index: number): void {\n this.#renderStartIndex.set(index);\n }\n\n getOffsetForIndex(index: number): number {\n return this.#strategy().getOffsetForIndex(index);\n }\n\n // ========== VdndScrollContainer Implementation ==========\n\n /**\n * Scroll to a specific position, adjusting for content offset.\n */\n scrollTo(options: ScrollToOptions): void {\n const adjustedOptions = { ...options };\n if (adjustedOptions.top !== undefined) {\n // Add offset back when scrolling to ensure correct position\n adjustedOptions.top += this.effectiveContentOffset();\n }\n this.#parentScrollContainer.scrollTo(adjustedOptions);\n }\n\n // ========== Private Methods ==========\n\n /**\n * Sets up an effect that observes the projected header directive's element\n * with a ResizeObserver, keeping `#measuredHeaderHeight` in sync.\n */\n #setupHeaderMeasurement(): void {\n effect((onCleanup) => {\n const dir = this.headerDirective();\n if (!dir) {\n this.#measuredHeaderHeight.set(0);\n return;\n }\n\n const el = dir.elementRef.nativeElement;\n this.#measuredHeaderHeight.set(el.offsetHeight);\n\n let observer: ResizeObserver | null = null;\n this.#ngZone.runOutsideAngular(() => {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const height =\n entry.borderBoxSize?.[0]?.blockSize ?? (entry.target as HTMLElement).offsetHeight;\n this.#measuredHeaderHeight.set(height);\n }\n });\n observer.observe(el, { box: 'border-box' });\n });\n\n onCleanup(() => observer?.disconnect());\n });\n }\n}\n","import { afterNextRender, EnvironmentInjector, NgZone } from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { KeyboardDragService } from '../services/keyboard-drag.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { ElementCloneService } from '../services/element-clone.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\nimport { DragEndEvent, DragStartEvent } from '../models/drag-drop.models';\nimport { queryByAttribute } from '../utils/attribute-selectors';\nimport { normalizeDropDestinationIndex } from '../utils/drop-index-normalization';\n\n/**\n * Context from the directive needed for keyboard drag operations.\n */\nexport interface KeyboardDragContext {\n element: HTMLElement;\n draggableId: string;\n groupName: string | null;\n data: unknown;\n}\n\n/**\n * Callbacks from the handler back into the directive for events.\n */\nexport interface KeyboardDragCallbacks {\n onDragStart: (event: DragStartEvent) => void;\n onDragEnd: (event: DragEndEvent) => void;\n getParentDroppableId: () => string | null;\n calculateSourceIndex: (element: HTMLElement, droppableElement: HTMLElement | null) => number;\n}\n\n/**\n * Dependencies injected from the directive (non-injectable handler).\n */\nexport interface KeyboardDragDeps {\n dragState: DragStateService;\n keyboardDrag: KeyboardDragService;\n positionCalculator: PositionCalculatorService;\n dragIndexCalculator: DragIndexCalculatorService;\n elementClone: ElementCloneService;\n overlayContainer: OverlayContainerService;\n ngZone: NgZone;\n envInjector: EnvironmentInjector;\n callbacks: KeyboardDragCallbacks;\n getContext: () => KeyboardDragContext;\n}\n\n/**\n * Handles keyboard-initiated drag operations (Space to start, arrows to move, Space/Enter to drop).\n *\n * Extracted from DraggableDirective to encapsulate:\n * - Starting/completing/cancelling keyboard drags\n * - Document-level keyboard listener during active drag\n * - Focus restoration after drag ends\n * - Cross-list movement via arrow keys\n *\n * Provides a unified `handleKey()` method that eliminates the duplicated\n * key→action dispatch that previously existed in both host bindings and\n * a document-level listener.\n */\nexport class KeyboardDragHandler {\n readonly #deps: KeyboardDragDeps;\n #boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n constructor(deps: KeyboardDragDeps) {\n this.#deps = deps;\n this.#boundKeyDown = this.#onDocumentKeyDown.bind(this);\n }\n\n /**\n * Whether a keyboard drag is currently active.\n */\n isActive(): boolean {\n return this.#deps.keyboardDrag.isActive();\n }\n\n /**\n * Start a keyboard drag operation.\n */\n activate(): void {\n const ctx = this.#deps.getContext();\n if (!ctx.groupName) {\n return;\n }\n\n const element = ctx.element;\n const rect = element.getBoundingClientRect();\n\n // Find the parent droppable\n const droppableElement = this.#deps.positionCalculator.getDroppableParent(\n element,\n ctx.groupName,\n );\n if (!droppableElement) {\n return;\n }\n\n const droppableId = this.#deps.positionCalculator.getDroppableId(droppableElement);\n if (!droppableId) {\n return;\n }\n\n // Calculate source index\n const sourceIndex = this.#deps.callbacks.calculateSourceIndex(element, droppableElement);\n\n // Get total item count from the droppable\n const totalItemCount = this.#deps.dragIndexCalculator.getTotalItemCount({\n droppableElement,\n isSameList: false,\n draggedItemHeight: rect.height,\n });\n\n // Clone element BEFORE updating drag state.\n // Template-first: skip the clone when a template-based preview is mounted.\n const clonedElement = this.#deps.overlayContainer.hasTemplatePreview()\n ? undefined\n : this.#deps.elementClone.cloneElement(element);\n\n // Start keyboard drag\n this.#deps.keyboardDrag.startKeyboardDrag(\n {\n draggableId: ctx.draggableId,\n droppableId,\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: ctx.data,\n },\n sourceIndex,\n totalItemCount,\n droppableId,\n );\n\n // Add document-level keyboard listener (since element is hidden with display:none)\n this.#deps.ngZone.runOutsideAngular(() => {\n document.addEventListener('keydown', this.#boundKeyDown!);\n });\n\n // Emit drag start event\n this.#deps.callbacks.onDragStart({\n draggableId: ctx.draggableId,\n droppableId,\n data: ctx.data,\n position: { x: rect.left, y: rect.top },\n sourceIndex,\n });\n }\n\n /**\n * Unified key dispatch. Returns true if the key was handled.\n * Used by both host bindings and the document-level listener.\n *\n * Handled keys are consumed entirely (preventDefault + stopPropagation): right after pickup\n * the source element can still be focused because Angular has not applied display:none yet,\n * and without stopping propagation the same keydown would be processed by both the element's\n * host binding and the document-level listener — moving the item two positions per press.\n */\n handleKey(event: KeyboardEvent): boolean {\n if (!this.isActive()) {\n return false;\n }\n\n const handled = this.#dispatchKey(event.key);\n\n if (handled) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n return handled;\n }\n\n /**\n * Execute the drag action for a key. Returns true if the key maps to an action.\n */\n #dispatchKey(key: string): boolean {\n switch (key) {\n case ' ': // Space\n case 'Enter':\n this.complete();\n return true;\n case 'Escape':\n case 'Tab':\n this.cancel();\n return true;\n case 'ArrowUp':\n this.#deps.keyboardDrag.moveUp();\n return true;\n case 'ArrowDown':\n this.#deps.keyboardDrag.moveDown();\n return true;\n case 'ArrowLeft':\n this.#moveToAdjacentDroppable('left');\n return true;\n case 'ArrowRight':\n this.#moveToAdjacentDroppable('right');\n return true;\n default:\n return false;\n }\n }\n\n /**\n * Complete a keyboard drag operation (drop the item).\n */\n complete(): void {\n const ctx = this.#deps.getContext();\n const sourceIndex = this.#deps.dragState.sourceIndex() ?? 0;\n const activeDroppableId = this.#deps.dragState.activeDroppableId();\n\n // Revalidate the active target: it may have been disabled after the drag navigated\n // into it. A disabled (or missing) target is not a valid drop — report no destination.\n // The droppable's own disabled guard suppresses the drop event, keeping dragEnd and\n // drop consistent (non-cancelled dragEnd with destinationIndex: null, no drop).\n const hasValidTarget =\n activeDroppableId !== null &&\n !this.#deps.positionCalculator.isDroppableDisabledById(activeDroppableId);\n\n const destinationIndex = hasValidTarget\n ? normalizeDropDestinationIndex({\n sourceIndex,\n placeholderIndex: this.#deps.dragState.placeholderIndex(),\n sourceDroppableId: this.#deps.dragState.sourceDroppableId(),\n activeDroppableId,\n })\n : null;\n\n // Remove document listener\n this.#cleanupDocumentListener();\n\n // Clear droppable metadata cache from this drag session\n this.#deps.dragIndexCalculator.clearCache();\n\n // Emit drag end event\n this.#deps.callbacks.onDragEnd({\n draggableId: ctx.draggableId,\n droppableId: this.#deps.callbacks.getParentDroppableId() ?? '',\n cancelled: false,\n data: ctx.data,\n sourceIndex,\n destinationIndex,\n });\n\n this.#deps.keyboardDrag.completeKeyboardDrag();\n\n // Restore focus to the moved element after state updates\n this.#restoreFocus(ctx.draggableId);\n }\n\n /**\n * Cancel a keyboard drag operation.\n */\n cancel(): void {\n const ctx = this.#deps.getContext();\n const sourceIndex = this.#deps.dragState.sourceIndex() ?? 0;\n\n // Remove document listener\n this.#cleanupDocumentListener();\n\n // Clear droppable metadata cache from this drag session\n this.#deps.dragIndexCalculator.clearCache();\n\n // Emit drag end event\n this.#deps.callbacks.onDragEnd({\n draggableId: ctx.draggableId,\n droppableId: this.#deps.callbacks.getParentDroppableId() ?? '',\n cancelled: true,\n data: ctx.data,\n sourceIndex,\n destinationIndex: null,\n });\n\n this.#deps.keyboardDrag.cancelKeyboardDrag();\n\n // Restore focus to the original element after state updates\n this.#restoreFocus(ctx.draggableId);\n }\n\n /**\n * Teardown — remove any active document listener.\n */\n destroy(): void {\n this.#cleanupDocumentListener();\n }\n\n /**\n * Restore focus to the dragged element after keyboard drag ends.\n * Uses afterNextRender to ensure Angular has finished updating the DOM\n * (element is no longer hidden after isDragging() becomes false).\n *\n * Uses EnvironmentInjector to ensure callback runs even if the directive\n * is destroyed during cross-list moves.\n */\n #restoreFocus(draggableId: string): void {\n // Capture the destination droppable BEFORE scheduling afterNextRender\n // (the directive may be destroyed during cross-list moves)\n const destinationDroppableId = this.#deps.dragState.activeDroppableId();\n\n afterNextRender(\n () => {\n const element = queryByAttribute<HTMLElement>(document, 'data-draggable-id', draggableId);\n\n if (element) {\n element.focus();\n } else if (destinationDroppableId) {\n // Fallback: focus the first draggable in the destination container\n const destination = queryByAttribute<HTMLElement>(\n document,\n 'data-droppable-id',\n destinationDroppableId,\n );\n const firstDraggable = destination?.querySelector<HTMLElement>('[data-draggable-id]');\n firstDraggable?.focus();\n }\n },\n { injector: this.#deps.envInjector },\n );\n }\n\n /**\n * Move to an adjacent droppable in the specified direction.\n */\n #moveToAdjacentDroppable(direction: 'left' | 'right'): void {\n const currentDroppableId = this.#deps.dragState.activeDroppableId();\n if (!currentDroppableId) {\n return;\n }\n\n const groupName = this.#deps.getContext().groupName;\n if (!groupName) {\n return;\n }\n const adjacent = this.#deps.positionCalculator.findAdjacentDroppable(\n currentDroppableId,\n direction,\n groupName,\n );\n\n if (!adjacent) {\n return;\n }\n\n // Derive the destination list's item count from DragIndexCalculatorService — the single\n // source of truth that correctly handles registered strategies, dynamic-height lists, and\n // vdnd-virtual-content (page-scroll) lists. Arrowing back to the origin lands on the source\n // list, so compute isSameList rather than assuming a distinct target.\n const itemCount = this.#deps.dragIndexCalculator.getTotalItemCount({\n droppableElement: adjacent.element,\n isSameList: adjacent.id === this.#deps.dragState.sourceDroppableId(),\n draggedItemHeight: this.#deps.dragState.draggedItem()?.height ?? 0,\n });\n\n // Maintain the current target index (clamped to the new list's size)\n const currentTargetIndex = this.#deps.keyboardDrag.targetIndex() ?? 0;\n const targetIndex = Math.min(currentTargetIndex, itemCount);\n\n this.#deps.keyboardDrag.moveToDroppable(adjacent.id, targetIndex, itemCount);\n }\n\n /**\n * Document-level keydown listener active during keyboard drag.\n */\n #onDocumentKeyDown(event: KeyboardEvent): void {\n this.handleKey(event);\n }\n\n /**\n * Remove the document-level keyboard listener.\n */\n #cleanupDocumentListener(): void {\n if (this.#boundKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyDown);\n }\n }\n}\n","import { NgZone } from '@angular/core';\nimport { CursorPosition } from '../models/drag-drop.models';\n\n/**\n * Callbacks from the handler back into the directive for drag lifecycle.\n */\nexport interface PointerDragCallbacks {\n onDragStart: (position: CursorPosition) => void;\n onDragMove: (position: CursorPosition) => void;\n onDragEnd: (cancelled: boolean) => void;\n onPendingChange: (pending: boolean) => void;\n isDragging: () => boolean;\n}\n\n/**\n * Context from the directive needed for pointer drag operations.\n */\nexport interface PointerDragContext {\n element: HTMLElement;\n groupName: string | null;\n disabled: boolean;\n dragHandle: string | undefined;\n dragThreshold: number;\n dragDelay: number;\n}\n\n/**\n * Dependencies injected from the directive (non-injectable handler).\n */\nexport interface PointerDragDeps {\n ngZone: NgZone;\n callbacks: PointerDragCallbacks;\n getContext: () => PointerDragContext;\n}\n\n/**\n * Handles pointer-based (mouse + touch) drag operations.\n *\n * Extracted from DraggableDirective to encapsulate:\n * - Pointer down / move / up lifecycle\n * - Drag threshold detection\n * - Drag delay timer\n * - RAF throttling for move updates\n * - Document-level listener management\n * - Escape key cancellation during pointer drag\n */\nexport class PointerDragHandler {\n readonly #deps: PointerDragDeps;\n\n /** Starting position of the drag */\n #startPosition: CursorPosition | null = null;\n\n /** Whether we're currently tracking a potential drag */\n #isTracking = false;\n\n /** Bound event handlers for cleanup */\n #boundPointerMove: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundPointerUp: ((e: MouseEvent | TouchEvent) => void) | null = null;\n #boundKeyDown: ((e: KeyboardEvent) => void) | null = null;\n\n /** Timer ID for drag delay */\n #delayTimerId: ReturnType<typeof setTimeout> | null = null;\n\n /** Whether the delay has been satisfied (user held long enough) */\n #delayReady = false;\n\n constructor(deps: PointerDragDeps) {\n this.#deps = deps;\n this.#boundPointerMove = this.#onPointerMove.bind(this);\n this.#boundPointerUp = this.#onPointerUp.bind(this);\n this.#boundKeyDown = this.#onEscapeKeyDown.bind(this);\n }\n\n /**\n * The position where the user initially pressed down.\n * Used by the directive to calculate grab offset when starting drag.\n */\n getStartPosition(): CursorPosition | null {\n return this.#startPosition;\n }\n\n /**\n * Handle pointer down (mouse or touch).\n * Called from the directive's host binding.\n */\n onPointerDown(event: MouseEvent | TouchEvent, isTouch: boolean): void {\n const ctx = this.#deps.getContext();\n\n if (ctx.disabled) {\n return;\n }\n\n // Without a group, this draggable can't participate in DnD (fail gracefully).\n if (!ctx.groupName) {\n return;\n }\n\n // Check for left mouse button only\n if (!isTouch && (event as MouseEvent).button !== 0) {\n return;\n }\n\n // Check if click is on drag handle (if specified)\n if (ctx.dragHandle) {\n const target = event.target as HTMLElement;\n if (!target.closest(ctx.dragHandle)) {\n return;\n }\n }\n\n // Check for elements that should not trigger drag\n const target = event.target as HTMLElement;\n if (\n target.closest('button, input, textarea, select, [contenteditable]') ||\n target.classList.contains('no-drag')\n ) {\n return;\n }\n\n const delay = ctx.dragDelay;\n\n // For touch events with a delay configured, DON'T call preventDefault() on touchstart.\n // This allows native scrolling to work if the user swipes before the delay fires.\n // For mouse events or touch without delay, prevent default immediately to avoid\n // text selection and other default behaviors.\n if (!isTouch || delay === 0) {\n event.preventDefault();\n }\n event.stopPropagation();\n\n this.#isTracking = true;\n this.#startPosition = PointerDragHandler.#getPosition(event);\n\n // Handle drag delay\n if (delay > 0) {\n this.#delayReady = false;\n this.#delayTimerId = setTimeout(() => {\n this.#delayReady = true;\n this.#deps.callbacks.onPendingChange(true); // Emit ready state when delay passes\n this.#delayTimerId = null;\n }, delay);\n } else {\n this.#delayReady = true;\n }\n\n // Add document-level event listeners\n this.#deps.ngZone.runOutsideAngular(() => {\n if (isTouch) {\n document.addEventListener('touchmove', this.#boundPointerMove!, { passive: false });\n document.addEventListener('touchend', this.#boundPointerUp!);\n document.addEventListener('touchcancel', this.#boundPointerUp!);\n } else {\n document.addEventListener('mousemove', this.#boundPointerMove!);\n document.addEventListener('mouseup', this.#boundPointerUp!);\n }\n // Listen for Escape key on document to cancel drag\n document.addEventListener('keydown', this.#boundKeyDown!);\n });\n }\n\n /**\n * Remove listeners + cancel timers.\n * Called after pointer up or when cancelling.\n */\n cleanup(): void {\n this.#isTracking = false;\n this.#startPosition = null;\n this.#deps.callbacks.onPendingChange(false); // Clear pending state on cleanup\n this.#cancelDelayTimer();\n\n // Remove event listeners\n if (this.#boundPointerMove) {\n document.removeEventListener('mousemove', this.#boundPointerMove);\n document.removeEventListener('touchmove', this.#boundPointerMove);\n }\n if (this.#boundPointerUp) {\n document.removeEventListener('mouseup', this.#boundPointerUp);\n document.removeEventListener('touchend', this.#boundPointerUp);\n document.removeEventListener('touchcancel', this.#boundPointerUp);\n }\n if (this.#boundKeyDown) {\n document.removeEventListener('keydown', this.#boundKeyDown);\n }\n }\n\n /**\n * Full teardown — cleanup + null references.\n */\n destroy(): void {\n this.cleanup();\n }\n\n /**\n * Handle pointer move (mouse or touch).\n */\n #onPointerMove(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n const position = PointerDragHandler.#getPosition(event);\n const ctx = this.#deps.getContext();\n\n // Check if we've moved past the threshold\n if (!this.#deps.callbacks.isDragging() && this.#startPosition) {\n const distance = Math.sqrt(\n Math.pow(position.x - this.#startPosition.x, 2) +\n Math.pow(position.y - this.#startPosition.y, 2),\n );\n\n if (distance < ctx.dragThreshold) {\n return;\n }\n\n // If delay is configured and not yet ready, cancel the drag attempt\n // (user moved before the delay was satisfied).\n // DON'T call preventDefault() here - let native scrolling take over.\n if (!this.#delayReady) {\n this.#cancelDelayTimer();\n this.cleanup();\n return;\n }\n\n // Start the drag - now we can prevent default\n event.preventDefault();\n this.#deps.callbacks.onDragStart(position);\n } else if (this.#deps.callbacks.isDragging()) {\n // Already dragging - prevent default to stop scrolling\n event.preventDefault();\n }\n\n // Only update drag if we're actually dragging\n if (!this.#deps.callbacks.isDragging()) {\n return;\n }\n\n // Notify the directive of the new position — it queues this into the scheduler\n // (DragSchedulerService) which coalesces multiple moves per frame into one RAF tick.\n this.#deps.callbacks.onDragMove(position);\n }\n\n /**\n * Handle pointer up (mouse or touch).\n */\n #onPointerUp(event: MouseEvent | TouchEvent): void {\n if (!this.#isTracking) {\n return;\n }\n\n // Only prevent default if we were actually dragging\n // Otherwise, allow native touch behavior (like scroll momentum) to complete\n if (this.#deps.callbacks.isDragging()) {\n event.preventDefault();\n this.#deps.callbacks.onDragEnd(false);\n }\n\n this.cleanup();\n }\n\n /**\n * Cancel the delay timer if active.\n */\n #cancelDelayTimer(): void {\n if (this.#delayTimerId !== null) {\n clearTimeout(this.#delayTimerId);\n this.#delayTimerId = null;\n }\n this.#delayReady = false;\n }\n\n /**\n * Handle keydown events on document to cancel drag with Escape.\n */\n #onEscapeKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.#deps.callbacks.isDragging()) {\n // No ngZone.run() needed - #endDrag uses signals which work outside zone\n this.#deps.callbacks.onDragEnd(true);\n this.cleanup();\n }\n }\n\n /**\n * Get position from mouse or touch event.\n */\n static #getPosition(event: MouseEvent | TouchEvent): CursorPosition {\n if ('touches' in event) {\n const touch = event.touches[0] ?? event.changedTouches[0];\n return { x: touch.clientX, y: touch.clientY };\n }\n return { x: event.clientX, y: event.clientY };\n }\n}\n","import {\n computed,\n Directive,\n ElementRef,\n EnvironmentInjector,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n output,\n signal,\n} from '@angular/core';\nimport { DragStateService } from '../services/drag-state.service';\nimport { PositionCalculatorService } from '../services/position-calculator.service';\nimport { AutoScrollService } from '../services/auto-scroll.service';\nimport { ElementCloneService } from '../services/element-clone.service';\nimport { KeyboardDragService } from '../services/keyboard-drag.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { OverlayContainerService } from '../services/overlay-container.service';\nimport { DragSchedulerService } from '../services/drag-scheduler.service';\nimport {\n CursorPosition,\n DragEndEvent,\n DragStartEvent,\n GrabOffset,\n} from '../models/drag-drop.models';\nimport { VDND_GROUP_TOKEN } from './droppable-group.directive';\nimport { createEffectiveGroupSignal } from '../utils/group-resolution';\nimport { KeyboardDragHandler } from '../handlers/keyboard-drag.handler';\nimport { PointerDragHandler } from '../handlers/pointer-drag.handler';\nimport { normalizeDropDestinationIndex } from '../utils/drop-index-normalization';\n\n/**\n * Makes an element draggable within the virtual scroll drag-and-drop system.\n *\n * @example\n * ```html\n * <!-- With explicit group -->\n * <div\n * vdndDraggable=\"item-1\"\n * vdndDraggableGroup=\"my-group\"\n * [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n *\n * <!-- With inherited group from parent vdndGroup directive -->\n * <div vdndGroup=\"my-group\">\n * <div vdndDraggable=\"item-1\" [vdndDraggableData]=\"item\">\n * Drag me!\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndDraggable]',\n host: {\n '[attr.data-draggable-id]': 'vdndDraggable()',\n '[class.vdnd-draggable]': 'true',\n '[class.vdnd-draggable-dragging]': 'isDragging()',\n '[class.vdnd-draggable-disabled]': 'disabled()',\n '[class.vdnd-drag-pending]': 'isPending()',\n '[style.display]': 'isDragging() ? \"none\" : null',\n '[attr.aria-grabbed]': 'isDragging() ? \"true\" : \"false\"',\n '[tabindex]': 'disabled() ? -1 : 0',\n '(mousedown)': 'onPointerDown($event, false)',\n '(touchstart)': 'onPointerDown($event, true)',\n '(keydown.space)': 'onKeyboardActivate($event)',\n '(keydown.enter)': 'onEnterKey($event)',\n '(keydown.arrowup)': 'onArrowKey($event)',\n '(keydown.arrowdown)': 'onArrowKey($event)',\n '(keydown.arrowleft)': 'onArrowKey($event)',\n '(keydown.arrowright)': 'onArrowKey($event)',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class DraggableDirective implements OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #dragState = inject(DragStateService);\n readonly #positionCalculator = inject(PositionCalculatorService);\n readonly #autoScroll = inject(AutoScrollService);\n readonly #elementClone = inject(ElementCloneService);\n readonly #keyboardDrag = inject(KeyboardDragService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n readonly #overlayContainer = inject(OverlayContainerService);\n readonly #scheduler = inject(DragSchedulerService);\n readonly #ngZone = inject(NgZone);\n readonly #envInjector = inject(EnvironmentInjector);\n readonly #parentGroup = inject(VDND_GROUP_TOKEN, { optional: true });\n\n /** Unique identifier for this draggable */\n vdndDraggable = input.required<string>();\n\n /**\n * Drag-and-drop group name.\n * Optional when a parent `vdndGroup` directive provides the group context.\n */\n vdndDraggableGroup = input<string>();\n\n /**\n * Resolved group name - uses explicit input or falls back to parent group.\n * Returns null (and disables drag) if neither is available.\n */\n readonly #effectiveGroup = createEffectiveGroupSignal({\n explicitGroup: this.vdndDraggableGroup,\n parentGroup: this.#parentGroup,\n elementId: this.vdndDraggable,\n elementType: 'draggable',\n });\n\n /** Optional data associated with this draggable */\n vdndDraggableData = input<unknown>();\n\n /** Whether this draggable is disabled */\n disabled = input<boolean>(false);\n\n /** CSS selector for drag handle (if not provided, entire element is draggable) */\n dragHandle = input<string>();\n\n /** Minimum distance to move before drag starts (prevents accidental drags) */\n dragThreshold = input<number>(5);\n\n /**\n * Delay in milliseconds before drag starts after pointer down.\n * User must hold without moving for this duration.\n * Set to 0 for immediate drag (default behavior).\n */\n dragDelay = input<number>(0);\n\n /**\n * Lock dragging by freezing one axis. The value names the axis that stays\n * fixed: `'x'` freezes the X coordinate (vertical-only movement), `'y'`\n * freezes the Y coordinate (horizontal-only movement). `null` allows free\n * movement. Note: this is the opposite of Angular CDK's `cdkDragLockAxis`.\n */\n lockAxis = input<'x' | 'y' | null>(null);\n\n /** Emits when drag starts */\n dragStart = output<DragStartEvent>();\n\n /** Emits when drag ends */\n dragEnd = output<DragEndEvent>();\n\n /** Whether this element is in the \"ready to drag\" state (delay has passed) */\n #isPending = signal(false);\n readonly isPending = this.#isPending.asReadonly();\n\n /** Whether this element is currently being dragged (based on global drag state) */\n readonly isDragging = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n return draggedItem?.draggableId === this.vdndDraggable();\n });\n\n #keyboardHandler!: KeyboardDragHandler;\n #pointerHandler!: PointerDragHandler;\n\n /** Cached constraint flag from source droppable */\n #constrainToContainer = false;\n\n /** Element whose rect is used for clamping (scroll container or droppable itself) */\n #constraintElement: HTMLElement | null = null;\n\n /** Last raw pointer position from pointer move events (not clamped) */\n #lastRawPosition: CursorPosition | null = null;\n\n /**\n * Update the pending state and emit the change event.\n */\n #setPending(pending: boolean): void {\n if (this.#isPending() !== pending) {\n this.#isPending.set(pending);\n }\n }\n\n /**\n * Find the element to use for container constraint clamping.\n * If the droppable is inside a scrollable container, use that container's rect\n * (which represents the visible viewport) instead of the droppable's rect\n * (which may extend far beyond the viewport in virtual scroll scenarios).\n */\n #findConstraintElement(droppableElement: HTMLElement | null): HTMLElement | null {\n if (!droppableElement) return null;\n const scrollable = droppableElement.closest('.vdnd-scrollable');\n return (scrollable as HTMLElement) ?? droppableElement;\n }\n\n ngOnInit(): void {\n this.#keyboardHandler = new KeyboardDragHandler({\n dragState: this.#dragState,\n keyboardDrag: this.#keyboardDrag,\n positionCalculator: this.#positionCalculator,\n dragIndexCalculator: this.#dragIndexCalculator,\n elementClone: this.#elementClone,\n overlayContainer: this.#overlayContainer,\n ngZone: this.#ngZone,\n envInjector: this.#envInjector,\n callbacks: {\n onDragStart: (event) => this.dragStart.emit(event),\n onDragEnd: (event) => this.dragEnd.emit(event),\n getParentDroppableId: () => this.#getParentDroppableId(),\n calculateSourceIndex: (el, droppable) => this.#calculateSourceIndex(el, droppable),\n },\n getContext: () => ({\n element: this.#elementRef.nativeElement,\n draggableId: this.vdndDraggable(),\n groupName: this.#effectiveGroup(),\n data: this.vdndDraggableData(),\n }),\n });\n\n this.#pointerHandler = new PointerDragHandler({\n ngZone: this.#ngZone,\n callbacks: {\n onDragStart: (position) => this.#startDrag(position),\n onDragMove: (position) => {\n // Record raw position synchronously (needed for autoscroll cursor override)\n // then queue into the scheduler's RAF loop for coalesced frame-rate processing.\n this.#lastRawPosition = position;\n this.#scheduler.queueCursorUpdate(position);\n },\n onDragEnd: (cancelled) => this.#endDrag(cancelled),\n onPendingChange: (pending) => this.#setPending(pending),\n isDragging: () => this.isDragging(),\n },\n getContext: () => ({\n element: this.#elementRef.nativeElement,\n groupName: this.#effectiveGroup(),\n disabled: this.disabled(),\n dragHandle: this.dragHandle(),\n dragThreshold: this.dragThreshold(),\n dragDelay: this.dragDelay(),\n }),\n });\n }\n\n ngOnDestroy(): void {\n // If destroyed mid-drag, cancel to avoid stale global state / ongoing RAF loops.\n if (this.isDragging()) {\n this.#endDrag(true);\n }\n this.#pointerHandler.destroy();\n this.#keyboardHandler.destroy();\n }\n\n /**\n * Handle pointer down (mouse or touch).\n */\n protected onPointerDown(event: MouseEvent | TouchEvent, isTouch: boolean): void {\n this.#pointerHandler.onPointerDown(event, isTouch);\n }\n\n /**\n * Handle keyboard activation (space key).\n * Starts a keyboard drag if not dragging, or drops if already in keyboard drag mode.\n */\n protected onKeyboardActivate(event: Event): void {\n if (this.disabled()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation(); // Prevent document listener from receiving this event\n\n // If we're in a keyboard drag, Space drops the item\n if (this.#keyboardHandler.isActive()) {\n this.#keyboardHandler.complete();\n return;\n }\n\n // If we're in a pointer drag, ignore\n if (this.isDragging()) {\n return;\n }\n\n // Start keyboard drag\n this.#keyboardHandler.activate();\n }\n\n /**\n * Handle Enter key (alternative to Space for dropping during keyboard drag).\n */\n protected onEnterKey(event: Event): void {\n if (this.#keyboardHandler.isActive()) {\n event.preventDefault();\n this.#keyboardHandler.complete();\n }\n }\n\n /**\n * Handle arrow keys during keyboard drag.\n */\n protected onArrowKey(event: Event): void {\n if (this.#keyboardHandler.isActive()) {\n this.#keyboardHandler.handleKey(event as KeyboardEvent);\n }\n }\n\n /**\n * Handle escape key to cancel drag (host binding, fires before element is hidden).\n */\n protected onEscape(): boolean {\n if (this.#keyboardHandler.isActive()) {\n this.#keyboardHandler.cancel();\n return false;\n }\n if (this.isDragging()) {\n this.#endDrag(true);\n this.#pointerHandler.cleanup();\n return false; // Prevents default\n }\n return true;\n }\n\n /**\n * Start the drag operation.\n */\n #startDrag(position: CursorPosition): void {\n // Clear pending state - drag is now active\n this.#setPending(false);\n\n const element = this.#elementRef.nativeElement;\n const rect = element.getBoundingClientRect();\n\n // Calculate grab offset using the START position (where user initially pressed down)\n // NOT the current position (where drag threshold was exceeded)\n // This ensures the preview maintains its position relative to where the user grabbed it\n const startPos = this.#pointerHandler.getStartPosition() ?? position;\n const grabOffset: GrabOffset = {\n x: startPos.x - rect.left,\n y: startPos.y - rect.top,\n };\n\n // Clone element BEFORE updating drag state (which triggers display:none via host binding).\n // Template-first: skip the costly getComputedStyle deep-walk when a template-based\n // preview is mounted, since that clone would never be rendered.\n const clonedElement = this.#overlayContainer.hasTemplatePreview()\n ? undefined\n : this.#elementClone.cloneElement(element);\n\n // Find droppable and calculate initial placeholder position\n // This fixes the UI glitch by ensuring placeholder is set before the element is hidden\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Misconfigured - cancel tracking and don't start drag.\n this.#pointerHandler.cleanup();\n return;\n }\n\n const parentDroppableElement = this.#positionCalculator.getDroppableParent(element, groupName);\n const parentDroppableId = parentDroppableElement\n ? this.#positionCalculator.getDroppableId(parentDroppableElement)\n : null;\n\n // Snapshot droppable rects for this drag session so subsequent hit-testing is\n // pure geometry (no elementFromPoint layout flush per pointermove).\n this.#positionCalculator.beginDragSession(groupName);\n\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n position.x,\n position.y,\n element,\n groupName,\n );\n\n // Cache constraint flag and element for clamping during drag\n this.#constrainToContainer =\n droppableElement?.hasAttribute('data-constrain-to-container') ?? false;\n this.#constraintElement = this.#constrainToContainer\n ? this.#findConstraintElement(droppableElement)\n : null;\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : parentDroppableId;\n\n // Calculate source index BEFORE the element is hidden (display: none)\n // This is critical because getBoundingClientRect() returns all zeros for hidden elements\n const sourceIndex = this.#calculateSourceIndex(element, parentDroppableElement);\n\n let initialPlaceholderId: string | null = null;\n let initialPlaceholderIndex: number | null = null;\n\n if (droppableElement) {\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position,\n previousPosition: null,\n grabOffset,\n draggedItemHeight: rect.height,\n sourceDroppableId: parentDroppableId,\n sourceIndex,\n });\n initialPlaceholderIndex = indexResult.index;\n initialPlaceholderId = indexResult.placeholderId;\n }\n\n const lockAxis = this.lockAxis();\n\n // Register with drag state service - this triggers isDragging computed to become true\n // which will apply display:none via host binding\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.startDrag(\n {\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n element,\n clonedElement,\n height: rect.height,\n width: rect.width,\n data: this.vdndDraggableData(),\n },\n position,\n grabOffset,\n lockAxis,\n activeDroppableId,\n initialPlaceholderId,\n initialPlaceholderIndex,\n sourceIndex,\n undefined,\n lockAxis ? startPos : undefined,\n );\n\n // Start the scheduler RAF loop (drives pointer-move updates + autoscroll participant).\n // onTick is called each frame: when cursor is dirty, run full #updateDrag.\n this.#scheduler.start((cursor, cursorDirty) => {\n if (cursorDirty && cursor && this.isDragging()) {\n this.#updateDrag(cursor);\n }\n });\n\n // Start auto-scroll monitoring — registers as a scheduler participant.\n this.#autoScroll.startMonitoring(() => this.#recalculatePlaceholder());\n\n // Emit drag start event\n this.dragStart.emit({\n draggableId: this.vdndDraggable(),\n droppableId: parentDroppableId ?? '',\n data: this.vdndDraggableData(),\n position,\n sourceIndex,\n });\n }\n\n /**\n * Calculate the source index of the dragged element BEFORE it's hidden.\n * This must be called before startDrag updates the state (which triggers display:none).\n * Uses strategy-based lookup when available for accurate handling of variable heights.\n */\n #calculateSourceIndex(element: HTMLElement, droppableElement: HTMLElement | null): number {\n if (!droppableElement) {\n return 0;\n }\n\n const rect = element.getBoundingClientRect();\n const virtualScroll = droppableElement.querySelector('vdnd-virtual-scroll');\n const virtualContent = droppableElement.matches('vdnd-virtual-content')\n ? droppableElement\n : droppableElement.closest('vdnd-virtual-content');\n\n let containerRect: DOMRect;\n let scrollTop: number;\n\n if (virtualScroll) {\n containerRect = (virtualScroll as HTMLElement).getBoundingClientRect();\n scrollTop = (virtualScroll as HTMLElement).scrollTop;\n } else if (virtualContent) {\n // Page-level scroll: use scrollable parent rect + content offset so that\n // relativeY is measured from the start of the virtual items, not the header.\n const scrollableParent = virtualContent.closest('.vdnd-scrollable') as HTMLElement | null;\n if (scrollableParent) {\n containerRect = scrollableParent.getBoundingClientRect();\n const contentOffsetAttr = (virtualContent as HTMLElement).getAttribute(\n 'data-content-offset',\n );\n const contentOffset = contentOffsetAttr ? parseFloat(contentOffsetAttr) : 0;\n scrollTop =\n scrollableParent.scrollTop - (Number.isFinite(contentOffset) ? contentOffset : 0);\n } else {\n containerRect = (virtualContent as HTMLElement).getBoundingClientRect();\n scrollTop = 0;\n }\n } else {\n containerRect = droppableElement.getBoundingClientRect();\n scrollTop = droppableElement.scrollTop;\n }\n\n // Try to use registered strategy for accurate offset-based lookup\n const droppableId = this.#positionCalculator.getDroppableId(droppableElement);\n if (droppableId) {\n const strategy = this.#dragIndexCalculator.getStrategyForDroppable(droppableId);\n if (strategy) {\n const relativeY = rect.top - containerRect.top + scrollTop;\n return strategy.findIndexAtOffset(relativeY);\n }\n }\n\n // Preserve the geometry fallback for a virtual container whose strategy is unavailable.\n if (virtualScroll || virtualContent) {\n const itemHeight = rect.height || 50;\n const relativeY = rect.top - containerRect.top + scrollTop;\n return Math.round(relativeY / itemHeight);\n }\n\n // Non-virtual fallback: derive the logical index from preceding draggable siblings.\n // Geometry-based division is incorrect when the list has padding, gaps, margins,\n // or variable-height items.\n let sourceIndex = 0;\n let sibling = element.previousElementSibling;\n while (sibling) {\n if (sibling.matches('[data-draggable-id]')) {\n sourceIndex++;\n }\n sibling = sibling.previousElementSibling;\n }\n return sourceIndex;\n }\n\n /**\n * Recalculate placeholder position (called during auto-scroll).\n *\n * Scroll-only fast path: the cursor has not moved — only `scrollTop` changed.\n * When the active droppable is already known, skip hit-testing entirely and\n * recalculate only the placeholder index within that droppable. This avoids the\n * `findDroppableAtPoint` geometry scan + the `invalidateDroppableRects` DOM round-trip\n * on every autoscroll frame while still recomputing the correct insertion index.\n *\n * Falls back to the full `#updateDrag` pipeline when no droppable is active (e.g.\n * cursor drifted outside all droppables before the scroll tick fired).\n */\n #recalculatePlaceholder(): void {\n const cursorPosition = this.#dragState.cursorPosition();\n if (!cursorPosition || !this.isDragging()) {\n return;\n }\n\n const activeDroppableId = this.#dragState.activeDroppableId();\n if (activeDroppableId) {\n const droppableElement = this.#positionCalculator.getDroppableById(activeDroppableId);\n if (droppableElement) {\n const draggedItemHeight = this.#dragState.draggedItem()?.height ?? 50;\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position: cursorPosition,\n previousPosition: cursorPosition,\n grabOffset: this.#dragState.grabOffset(),\n draggedItemHeight,\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n sourceIndex: this.#dragState.sourceIndex(),\n });\n this.#dragState.updateScrollOnlyPlaceholder(indexResult.placeholderId, indexResult.index);\n return;\n }\n }\n\n // Fallback: full recalculation when no active droppable is known.\n // Mark rects dirty first since autoscroll moved the container before the scroll event fires.\n this.#positionCalculator.invalidateDroppableRects();\n this.#updateDrag(cursorPosition);\n }\n\n /**\n * Clamp cursor position to source container boundaries when constrainToContainer is enabled.\n */\n #clampToContainer(position: CursorPosition): CursorPosition {\n if (!this.#constrainToContainer || !this.#constraintElement) {\n return position;\n }\n\n const containerRect = this.#constraintElement.getBoundingClientRect();\n const grabOffset = this.#dragState.grabOffset();\n if (!grabOffset) {\n return position;\n }\n\n const draggedItem = this.#dragState.draggedItem();\n const itemHeight = draggedItem?.height ?? 0;\n const itemWidth = draggedItem?.width ?? 0;\n\n const minY = containerRect.top + grabOffset.y + 1;\n const maxY = containerRect.bottom - (itemHeight - grabOffset.y) - 1;\n const minX = containerRect.left + grabOffset.x + 1;\n const maxX = containerRect.right - (itemWidth - grabOffset.x) - 1;\n\n return {\n x: Math.max(minX, Math.min(position.x, maxX)),\n y: Math.max(minY, Math.min(position.y, maxY)),\n };\n }\n\n /**\n * Update the drag position.\n * @param position Current cursor position\n */\n #updateDrag(position: CursorPosition): void {\n const element = this.#elementRef.nativeElement;\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n // Group became unavailable mid-drag; cancel to avoid inconsistent state.\n this.#endDrag(true);\n this.#pointerHandler.cleanup();\n return;\n }\n\n // Apply axis locking to effective position for droppable detection\n // When axis is locked, use the start position for the locked axis\n const axisLock = this.lockAxis();\n const startPos = this.#pointerHandler.getStartPosition();\n let effectivePosition = position;\n\n if (axisLock && startPos) {\n effectivePosition = {\n x: axisLock === 'x' ? startPos.x : position.x,\n y: axisLock === 'y' ? startPos.y : position.y,\n };\n }\n\n // Apply container clamping after axis locking\n effectivePosition = this.#clampToContainer(effectivePosition);\n\n // Update autoscroll cursor: use raw pointer position clamped to container\n // edges (without grabOffset) so autoscroll threshold is reachable regardless\n // of where the user grabbed the item.\n if (this.#constrainToContainer && this.#constraintElement && this.#lastRawPosition) {\n const rect = this.#constraintElement.getBoundingClientRect();\n let scrollCursor: CursorPosition = this.#lastRawPosition;\n if (axisLock && startPos) {\n scrollCursor = {\n x: axisLock === 'x' ? startPos.x : scrollCursor.x,\n y: axisLock === 'y' ? startPos.y : scrollCursor.y,\n };\n }\n this.#autoScroll.setCursorOverride({\n x: Math.max(rect.left, Math.min(scrollCursor.x, rect.right)),\n y: Math.max(rect.top, Math.min(scrollCursor.y, rect.bottom)),\n });\n }\n\n // Find droppable at effective position (respects axis locking and clamping)\n const droppableElement = this.#positionCalculator.findDroppableAtPoint(\n effectivePosition.x,\n effectivePosition.y,\n element,\n groupName,\n );\n\n const activeDroppableId = droppableElement\n ? this.#positionCalculator.getDroppableId(droppableElement)\n : null;\n\n let placeholderId: string | null = null;\n let placeholderIndex: number | null = null;\n\n if (droppableElement) {\n // Calculate placeholder index based on effective position using mathematical approach\n // This is more stable than DOM-based detection because it doesn't get affected\n // by the placeholder insertion shifting elements around\n const draggedItemHeight = this.#dragState.draggedItem()?.height ?? 50;\n const indexResult = this.#dragIndexCalculator.calculatePlaceholderIndex({\n droppableElement,\n position: effectivePosition,\n previousPosition: this.#dragState.cursorPosition(),\n grabOffset: this.#dragState.grabOffset(),\n draggedItemHeight,\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n sourceIndex: this.#dragState.sourceIndex(),\n });\n placeholderIndex = indexResult.index;\n placeholderId = indexResult.placeholderId;\n }\n\n // Update drag state with effective position (respects axis locking and container clamping)\n // No ngZone.run() needed - signals work outside zone and effects react automatically\n this.#dragState.updateDragPosition({\n cursorPosition: effectivePosition,\n activeDroppableId,\n placeholderId,\n placeholderIndex,\n });\n }\n\n /**\n * End the drag operation.\n */\n #endDrag(cancelled: boolean): void {\n // Flush the final pointer position for a real drop. Pointer moves only QUEUE a cursor\n // for the next RAF tick; on release the scheduler is stopped below and any un-processed\n // cursor is discarded, so without this the drop would resolve against the last\n // RAF-PROCESSED position — a release that just entered a different (e.g. newly disabled)\n // droppable could otherwise land on the previously-targeted one. Guarded on group\n // presence so it never re-enters #endDrag via #updateDrag's group-lost cancel path.\n // Cancels skip this: their destination is intentionally null.\n if (!cancelled && this.#lastRawPosition && this.isDragging() && this.#effectiveGroup()) {\n this.#updateDrag(this.#lastRawPosition);\n }\n\n // Stop the scheduler RAF loop first, then remove the autoscroll participant.\n this.#scheduler.stop();\n this.#autoScroll.stopMonitoring();\n\n // Tear down the geometric hit-testing snapshot + its viewport listeners\n this.#positionCalculator.endDragSession();\n\n // Clear droppable metadata cache from this drag session\n this.#dragIndexCalculator.clearCache();\n\n // Reset cached constraint state\n this.#constrainToContainer = false;\n this.#constraintElement = null;\n this.#lastRawPosition = null;\n\n const sourceIndex = this.#dragState.sourceIndex() ?? 0;\n const destinationIndex = cancelled\n ? null\n : normalizeDropDestinationIndex({\n sourceIndex,\n placeholderIndex: this.#dragState.placeholderIndex(),\n sourceDroppableId: this.#dragState.sourceDroppableId(),\n activeDroppableId: this.#dragState.activeDroppableId(),\n });\n\n // Emit drag end event\n this.dragEnd.emit({\n draggableId: this.vdndDraggable(),\n droppableId: this.#getParentDroppableId() ?? '',\n cancelled,\n data: this.vdndDraggableData(),\n sourceIndex,\n destinationIndex,\n });\n\n // Clear drag state - this triggers isDragging computed to become false\n if (cancelled) {\n this.#dragState.cancelDrag();\n } else {\n this.#dragState.endDrag();\n }\n }\n\n /**\n * Get the parent droppable ID.\n */\n #getParentDroppableId(): string | null {\n const groupName = this.#effectiveGroup();\n if (!groupName) {\n return null;\n }\n\n const droppable = this.#positionCalculator.getDroppableParent(\n this.#elementRef.nativeElement,\n groupName,\n );\n\n return droppable ? this.#positionCalculator.getDroppableId(droppable) : null;\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER, VdndScrollContainer } from '../tokens/scroll-container.token';\nimport { AutoScrollConfig, AutoScrollService } from '../services/auto-scroll.service';\nimport {\n bindRafThrottledScrollTopSignal,\n bindResizeObserverHeightSignal,\n} from '../utils/dom-signal-bindings';\nimport { createAutoScrollRegistration } from '../utils/auto-scroll-registration';\n\n/**\n * Directive that marks an element as a scrollable container for virtual scrolling.\n *\n * Apply this directive to any scrollable element (with `overflow: auto` or `overflow: scroll`)\n * that contains a `*vdndVirtualFor` directive. The virtual scroll will use this element\n * as its scroll container.\n *\n * @example\n * Basic usage with a custom scroll container:\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px;\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n *\n * @example\n * With Ionic ion-content:\n * ```html\n * <ion-content vdndScrollable class=\"ion-content-scroll-host\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div>{{ item.name }}</div>\n * </ng-container>\n * </ion-content>\n * ```\n *\n * @example\n * With auto-scroll configuration:\n * ```html\n * <div vdndScrollable\n * [autoScrollEnabled]=\"true\"\n * [autoScrollConfig]=\"{ threshold: 80, maxSpeed: 20 }\"\n * style=\"overflow: auto; height: 400px;\">\n * ...\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndScrollable]',\n providers: [{ provide: VDND_SCROLL_CONTAINER, useExisting: ScrollableDirective }],\n host: {\n class: 'vdnd-scrollable',\n '[style.overflow-anchor]': '\"none\"',\n },\n})\nexport class ScrollableDirective implements VdndScrollContainer, OnInit, OnDestroy {\n readonly #elementRef = inject(ElementRef<HTMLElement>);\n readonly #ngZone = inject(NgZone);\n readonly #autoScrollService = inject(AutoScrollService);\n\n /** Current scroll position (reactive) */\n readonly #scrollTop = signal(0);\n\n /** Measured container height (reactive) */\n readonly #containerHeight = signal(0);\n\n /** Cleanup function for scroll listener */\n #scrollCleanup: (() => void) | null = null;\n #resizeCleanup: (() => void) | null = null;\n\n /** Generated ID for auto-scroll registration */\n #generatedScrollId = `vdnd-scroll-${Math.random().toString(36).slice(2, 9)}`;\n\n // ========== Inputs ==========\n\n /** Unique ID for this scroll container (used for auto-scroll registration) */\n scrollContainerId = input<string>();\n\n /** Whether auto-scroll is enabled when dragging near edges */\n autoScrollEnabled = input<boolean>(true);\n\n /** Auto-scroll configuration */\n autoScrollConfig = input<Partial<AutoScrollConfig>>({});\n\n // ========== VdndScrollContainer Implementation ==========\n\n constructor() {\n createAutoScrollRegistration({\n autoScrollService: this.#autoScrollService,\n getElement: () => this.nativeElement,\n getId: () => this.scrollContainerId() ?? this.#generatedScrollId,\n enabled: () => this.autoScrollEnabled(),\n config: () => this.autoScrollConfig(),\n });\n }\n\n get nativeElement(): HTMLElement {\n return this.#elementRef.nativeElement;\n }\n\n scrollTop(): number {\n return this.#scrollTop();\n }\n\n scrollTo(options: ScrollToOptions): void {\n this.nativeElement.scrollTo(options);\n }\n\n // ========== Additional API ==========\n\n /** Get the measured container height */\n containerHeight(): number {\n return this.#containerHeight();\n }\n\n /** Scroll by a delta amount */\n scrollBy(delta: number): void {\n const newPosition = Math.max(\n 0,\n Math.min(\n this.scrollTop() + delta,\n this.nativeElement.scrollHeight - this.nativeElement.clientHeight,\n ),\n );\n this.scrollTo({ top: newPosition });\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit(): void {\n this.#setupScrollListener();\n this.#setupResizeObserver();\n }\n\n ngOnDestroy(): void {\n this.#scrollCleanup?.();\n this.#resizeCleanup?.();\n }\n\n // ========== Private Methods ==========\n\n /** Minimum scroll delta (px) to trigger signal update */\n readonly #scrollThreshold = 5;\n\n #setupScrollListener(): void {\n this.#scrollCleanup = bindRafThrottledScrollTopSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n scrollTop: this.#scrollTop,\n thresholdPx: this.#scrollThreshold,\n });\n }\n\n #setupResizeObserver(): void {\n this.#resizeCleanup = bindResizeObserverHeightSignal({\n element: this.nativeElement,\n ngZone: this.#ngZone,\n height: this.#containerHeight,\n minDeltaPx: 1,\n });\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n EmbeddedViewRef,\n inject,\n Injector,\n input,\n isDevMode,\n NgZone,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { VDND_SCROLL_CONTAINER } from '../tokens/scroll-container.token';\nimport { VDND_VIRTUAL_VIEWPORT } from '../tokens/virtual-viewport.token';\nimport { DragStateService } from '../services/drag-state.service';\nimport { DragIndexCalculatorService } from '../services/drag-index-calculator.service';\nimport { DroppableDirective } from './droppable.directive';\nimport type { VirtualScrollStrategy } from '../models/virtual-scroll-strategy';\nimport { FixedHeightStrategy } from '../strategies/fixed-height.strategy';\nimport { DynamicHeightStrategy } from '../strategies/dynamic-height.strategy';\n\n/**\n * Context provided to the template for each virtual item.\n */\nexport interface VirtualForContext<T> {\n /** The item data (also available as implicit context) */\n $implicit: T;\n /** The item's index in the original array */\n index: number;\n /** Whether this is the first visible item */\n first: boolean;\n /** Whether this is the last visible item */\n last: boolean;\n /** Count of total items */\n count: number;\n}\n\n/**\n * Represents an item entry in the render queue for virtual scrolling.\n * @internal\n */\ninterface RenderEntry<T> {\n type: 'item' | 'placeholder';\n key: unknown;\n context: VirtualForContext<T> | null;\n visualIndex: number;\n}\n\n/**\n * A structural directive for virtual scrolling within custom scroll containers.\n * Provides maximum flexibility for advanced use cases where the component wrapper\n * is not suitable.\n *\n * The directive must be placed inside a container marked with the `vdndScrollable`\n * directive, which provides the scroll container context via dependency injection.\n *\n * Placeholders are handled automatically by the parent component (vdnd-virtual-scroll\n * or vdnd-virtual-content) - consumers just render their items normally.\n *\n * @example\n * Inside a viewport component (itemHeight and droppableId inherited automatically):\n * ```html\n * <vdnd-virtual-viewport [itemHeight]=\"50\" style=\"height: 400px\">\n * <ng-container *vdndVirtualFor=\"let item of items(); trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </vdnd-virtual-viewport>\n * ```\n *\n * @example\n * Standalone usage (itemHeight required):\n * ```html\n * <div vdndScrollable style=\"overflow: auto; height: 400px\">\n * <ng-container *vdndVirtualFor=\"let item of items(); itemHeight: 50; trackBy: trackById\">\n * <div class=\"item\">{{ item.name }}</div>\n * </ng-container>\n * </div>\n * ```\n */\n@Directive({\n selector: '[vdndVirtualFor][vdndVirtualForOf]',\n})\nexport class VirtualForDirective<T> implements OnInit, OnDestroy {\n readonly #templateRef = inject(TemplateRef<VirtualForContext<T>>);\n readonly #viewContainer = inject(ViewContainerRef);\n readonly #elementRef = inject(ElementRef<Comment>);\n readonly #scrollContainer = inject(VDND_SCROLL_CONTAINER);\n readonly #injector = inject(Injector);\n readonly #ngZone = inject(NgZone);\n readonly #dragState = inject(DragStateService);\n readonly #dragIndexCalculator = inject(DragIndexCalculatorService);\n\n /**\n * Optional viewport component that provides wrapper-based positioning.\n * When inside a viewport, items are positioned via the wrapper's transform,\n * so we skip individual absolute positioning.\n */\n readonly #viewport = inject(VDND_VIRTUAL_VIEWPORT, { optional: true });\n\n /**\n * Optional parent droppable directive.\n * When present, droppableId is inherited automatically.\n */\n readonly #droppable = inject(DroppableDirective, { optional: true });\n\n /** Whether we're inside a viewport component (use wrapper positioning) */\n readonly #useViewportPositioning = this.#viewport !== null;\n\n /** Pool of views for reuse */\n readonly #viewPool: EmbeddedViewRef<VirtualForContext<T>>[] = [];\n\n /** Currently active views keyed by their track-by value */\n readonly #activeViews = new Map<unknown, EmbeddedViewRef<VirtualForContext<T>>>();\n\n /** Single spacer element for scroll height */\n #spacer: HTMLDivElement | null = null;\n\n /** Placeholder element for drag operations */\n #placeholder: HTMLDivElement | null = null;\n\n /** Whether placeholder is currently in the DOM */\n #placeholderInDom = false;\n\n /** ResizeObserver for dynamic height measurement */\n #resizeObserver: ResizeObserver | null = null;\n\n /** Map from observed HTMLElement to its trackBy key */\n readonly #observedElements = new WeakMap<HTMLElement, unknown>();\n\n // ========== Inputs ==========\n\n /** The array of items to iterate over */\n vdndVirtualForOf = input.required<T[]>();\n\n /**\n * Height of each item in pixels (used as estimate in dynamic mode).\n * Optional when inside a viewport component — inherited from the viewport's strategy.\n */\n vdndVirtualForItemHeight = input<number>();\n\n /** Track-by function for efficient updates */\n vdndVirtualForTrackBy = input.required<(index: number, item: T) => unknown>();\n\n /** Number of items to render outside the visible area */\n vdndVirtualForOverscan = input<number>(3);\n\n /**\n * ID of the droppable this directive belongs to.\n * Required for placeholder positioning during drag operations.\n */\n vdndVirtualForDroppableId = input<string>();\n\n /**\n * Enable dynamic item height mode.\n * When true, items are auto-measured via ResizeObserver and `itemHeight`\n * serves as the initial estimate for unmeasured items.\n */\n vdndVirtualForDynamicItemHeight = input<boolean>(false);\n\n // ========== Resolved Values ==========\n\n /**\n * Effective droppable ID — uses explicit input or inherits from parent DroppableDirective.\n */\n readonly #effectiveDroppableId = computed(() => {\n return this.vdndVirtualForDroppableId() ?? this.#droppable?.vdndDroppable() ?? undefined;\n });\n\n // ========== Strategy ==========\n\n /**\n * The virtual scroll strategy.\n * If inside a viewport that has a strategy, use that. Otherwise create our own.\n */\n readonly #strategy = computed<VirtualScrollStrategy>(() => {\n // If viewport provides a strategy, use it (shared state for drag-drop)\n const viewportStrategy = this.#viewport?.strategy;\n if (viewportStrategy) return viewportStrategy;\n\n // Create our own strategy (standalone mode — itemHeight is required)\n const height = this.vdndVirtualForItemHeight();\n if (height === undefined) {\n if (isDevMode()) {\n console.warn(\n '[ngx-virtual-dnd] vdndVirtualFor requires itemHeight when not inside a viewport component ' +\n '(vdnd-virtual-viewport or vdnd-virtual-content). Falling back to 50px.',\n );\n }\n return new FixedHeightStrategy(50);\n }\n return this.vdndVirtualForDynamicItemHeight()\n ? new DynamicHeightStrategy(height)\n : new FixedHeightStrategy(height);\n });\n\n // ========== Placeholder Computed Values ==========\n\n /** Whether the placeholder should be shown in this container */\n readonly #shouldShowPlaceholder = computed(() => {\n const droppableId = this.#effectiveDroppableId();\n if (!droppableId) return false;\n if (!this.#dragState.isDragging()) return false;\n return this.#dragState.activeDroppableId() === droppableId;\n });\n\n /** The placeholder index when placeholder should be shown */\n readonly #placeholderIndex = computed(() => {\n if (!this.#shouldShowPlaceholder()) return -1;\n return this.#dragState.placeholderIndex() ?? -1;\n });\n\n // ========== Computed Values ==========\n\n /** First visible item index */\n readonly #firstVisibleIndex = computed(() => {\n const strategy = this.#strategy();\n // Read version to subscribe to dynamic height changes\n strategy.version();\n return strategy.getFirstVisibleIndex(this.#scrollContainer.scrollTop());\n });\n\n /** Number of visible items */\n readonly #visibleCount = computed(() => {\n const height = this.#scrollContainer.containerHeight();\n const strategy = this.#strategy();\n strategy.version();\n const startIndex = this.#firstVisibleIndex();\n return strategy.getVisibleCount(startIndex, height);\n });\n\n /** Range of items to render */\n readonly #renderRange = computed(() => {\n const first = this.#firstVisibleIndex();\n const visible = this.#visibleCount();\n const overscan = this.vdndVirtualForOverscan();\n const total = this.vdndVirtualForOf().length;\n\n const start = Math.max(0, first - overscan);\n const end = Math.min(total - 1, first + visible + overscan);\n\n return { start, end };\n });\n\n /** Map of trackBy keys to item indices for quick lookup */\n readonly #itemIndexMap = computed(() => {\n const items = this.vdndVirtualForOf();\n const trackByFn = this.vdndVirtualForTrackBy();\n const map = new Map<unknown, number>();\n for (let i = 0; i < items.length; i++) {\n map.set(trackByFn(i, items[i]), i);\n }\n return map;\n });\n\n /** Index of the dragged item in this list (-1 if not present or not dragging) */\n readonly #draggedItemIndex = computed(() => {\n const draggedItem = this.#dragState.draggedItem();\n if (!draggedItem) return -1;\n\n const byId = this.#itemIndexMap().get(draggedItem.draggableId);\n if (byId !== undefined) {\n return byId;\n }\n\n const data = draggedItem.data as T | null | undefined;\n if (data !== null && data !== undefined) {\n return this.vdndVirtualForOf().indexOf(data);\n }\n\n return -1;\n });\n\n constructor() {\n // Keep strategy item keys in sync\n effect(() => {\n const items = this.vdndVirtualForOf();\n const trackByFn = this.vdndVirtualForTrackBy();\n const keys = items.map((item, i) => trackByFn(i, item));\n this.#strategy().setItemKeys(keys);\n });\n\n // Register strategy with drag index calculator for accurate position lookups\n effect((onCleanup) => {\n const droppableId = this.#effectiveDroppableId();\n const strategy = this.#strategy();\n if (droppableId) {\n this.#dragIndexCalculator.registerStrategy(droppableId, strategy);\n onCleanup(() => this.#dragIndexCalculator.unregisterStrategy(droppableId));\n }\n });\n\n // Set excluded index persistently during same-list drag.\n // This ensures ALL strategy methods (getTotalHeight, getOffsetForIndex, etc.)\n // correctly skip the hidden item — not just findIndexAtOffset.\n effect(() => {\n const strategy = this.#strategy();\n const draggedIndex = this.#draggedItemIndex();\n const droppableId = this.#effectiveDroppableId();\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const isDragging = this.#dragState.isDragging();\n\n const isSourceList =\n isDragging && droppableId !== undefined && droppableId === sourceDroppableId;\n\n if (isSourceList && draggedIndex >= 0) {\n strategy.setExcludedIndex(draggedIndex);\n } else {\n strategy.setExcludedIndex(null);\n }\n });\n\n // React to changes and update views\n effect(() => {\n this.#updateViews();\n });\n }\n\n ngOnInit(): void {\n // Only create spacer when NOT inside a viewport component\n // (viewport provides its own spacer and wrapper positioning)\n if (!this.#useViewportPositioning) {\n this.#updateSpacers();\n }\n\n // Create placeholder element for drag operations\n this.#createPlaceholder();\n\n // Set up ResizeObserver for dynamic height mode.\n // Check both the directive's own input and the viewport's strategy (when inherited).\n if (\n this.vdndVirtualForDynamicItemHeight() ||\n this.#strategy() instanceof DynamicHeightStrategy\n ) {\n this.#setupResizeObserver();\n }\n }\n\n ngOnDestroy(): void {\n this.#viewPool.forEach((view) => view.destroy());\n this.#activeViews.forEach((view) => view.destroy());\n\n // Clean up spacer element (only if we created one)\n this.#spacer?.remove();\n\n // Clean up placeholder element\n this.#placeholder?.remove();\n\n // Clean up ResizeObserver\n this.#resizeObserver?.disconnect();\n }\n\n /**\n * Create the placeholder element for drag operations.\n */\n #createPlaceholder(): void {\n const placeholder = document.createElement('div');\n placeholder.className = 'vdnd-drag-placeholder vdnd-drag-placeholder-visible';\n placeholder.style.cssText = 'display: block; pointer-events: none;';\n this.#placeholder = placeholder;\n }\n\n /**\n * Set up spacer element for scroll height.\n */\n #updateSpacers(): void {\n // Create single spacer that maintains total scroll height\n const spacer = document.createElement('div');\n spacer.className = 'vdnd-virtual-for-spacer';\n spacer.style.cssText =\n 'position: absolute; top: 0; left: 0; width: 1px; visibility: hidden; pointer-events: none;';\n\n // Insert spacer before the directive's anchor comment\n const comment = this.#elementRef.nativeElement;\n comment.parentNode?.insertBefore(spacer, comment);\n\n this.#spacer = spacer;\n\n // Update spacer height reactively\n // Must pass injector since we're outside constructor\n effect(\n () => {\n const total = this.vdndVirtualForOf().length;\n const strategy = this.#strategy();\n strategy.version();\n\n // Single spacer with full content height\n spacer.style.height = `${strategy.getTotalHeight(total)}px`;\n },\n { injector: this.#injector },\n );\n }\n\n /**\n * Set up ResizeObserver for dynamic height measurement.\n */\n #setupResizeObserver(): void {\n this.#ngZone.runOutsideAngular(() => {\n this.#resizeObserver = new ResizeObserver((entries) => {\n const strategy = this.#strategy();\n for (const entry of entries) {\n const element = entry.target as HTMLElement;\n const key = this.#observedElements.get(element);\n if (key === undefined) continue;\n\n const height = entry.borderBoxSize?.[0]?.blockSize ?? element.offsetHeight;\n if (height > 0) {\n strategy.setMeasuredHeight(key, height);\n }\n }\n });\n });\n }\n\n /**\n * Observe an element's root nodes for height changes.\n */\n #observeViewElements(view: EmbeddedViewRef<VirtualForContext<T>>, key: unknown): void {\n if (!this.#resizeObserver) return;\n\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n const existingKey = this.#observedElements.get(node);\n if (Object.is(existingKey, key)) {\n continue;\n }\n if (existingKey !== undefined) {\n this.#resizeObserver.unobserve(node);\n }\n this.#observedElements.set(node, key);\n this.#resizeObserver.observe(node);\n }\n }\n }\n\n /**\n * Stop observing an element's root nodes.\n */\n #unobserveViewElements(view: EmbeddedViewRef<VirtualForContext<T>>): void {\n if (!this.#resizeObserver) return;\n\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n this.#observedElements.delete(node);\n this.#resizeObserver.unobserve(node);\n }\n }\n }\n\n /**\n * Update the rendered views with true view recycling.\n * Views are kept in the DOM and have their context updated in place when possible.\n */\n #updateViews(): void {\n const items = this.vdndVirtualForOf();\n const { start, end } = this.#renderRange();\n const strategy = this.#strategy();\n strategy.version();\n const placeholderIndex = this.#placeholderIndex();\n const showPlaceholder = this.#shouldShowPlaceholder();\n const draggedIndex = this.#draggedItemIndex();\n const droppableId = this.#effectiveDroppableId();\n const sourceDroppableId = this.#dragState.sourceDroppableId();\n const isSourceList = droppableId ? droppableId === sourceDroppableId : true;\n const shouldKeepDragged =\n this.#dragState.isDragging() &&\n draggedIndex >= 0 &&\n isSourceList &&\n draggedIndex < items.length;\n\n // Notify viewport of render start index for wrapper positioning\n this.#notifyViewportRenderStart(start);\n\n // 1. Build the list of items to render\n const itemsToRender = this.#calculateItemsToRender({\n items,\n start,\n end,\n showPlaceholder,\n placeholderIndex,\n shouldKeepDragged,\n draggedIndex,\n });\n\n // 2. Reconcile views with the DOM\n const placeholderDomPosition = this.#reconcileViews(itemsToRender, showPlaceholder, strategy);\n\n // 3. Position placeholder in DOM\n this.#positionPlaceholder(showPlaceholder, placeholderDomPosition, strategy, placeholderIndex);\n\n // 4. Trim view pool to prevent memory bloat\n this.#trimViewPool();\n }\n\n /**\n * Notify viewport of render start index for wrapper positioning.\n * With persistent excluded index, getOffsetForIndex already accounts for hidden items.\n */\n #notifyViewportRenderStart(start: number): void {\n if (!this.#useViewportPositioning) return;\n this.#viewport?.setRenderStartIndex(start);\n }\n\n /**\n * Calculate the list of items to render, including placeholder positioning\n * and keeping the dragged item alive when scrolled out of range.\n */\n #calculateItemsToRender(params: {\n items: T[];\n start: number;\n end: number;\n showPlaceholder: boolean;\n placeholderIndex: number;\n shouldKeepDragged: boolean;\n draggedIndex: number;\n }): RenderEntry<T>[] {\n const {\n items,\n start,\n end,\n showPlaceholder,\n placeholderIndex,\n shouldKeepDragged,\n draggedIndex,\n } = params;\n const trackByFn = this.vdndVirtualForTrackBy();\n const itemsToRender: RenderEntry<T>[] = [];\n\n // Track placeholder insertion with a flag instead of re-scanning itemsToRender\n // with `.some()` on every iteration (which made the build loop O(n²)).\n let placeholderInserted = false;\n\n // Build render list for visible range\n for (let i = start; i <= end && i < items.length; i++) {\n // Insert placeholder before item at placeholderIndex\n if (showPlaceholder && placeholderIndex === i && !placeholderInserted) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n placeholderInserted = true;\n }\n\n const item = items[i];\n itemsToRender.push({\n type: 'item',\n key: trackByFn(i, item),\n context: {\n $implicit: item,\n index: i,\n first: i === start,\n last: i === end || i === items.length - 1,\n count: items.length,\n },\n visualIndex: i,\n });\n }\n\n // Add placeholder at end if needed\n if (showPlaceholder && placeholderIndex >= items.length && !placeholderInserted) {\n itemsToRender.push({\n type: 'placeholder',\n key: '__placeholder__',\n context: null,\n visualIndex: placeholderIndex,\n });\n }\n\n // Keep dragged item view alive when scrolled out of range\n if (shouldKeepDragged && (draggedIndex < start || draggedIndex > end)) {\n const draggedItem = items[draggedIndex];\n const draggedKey = trackByFn(draggedIndex, draggedItem);\n const alreadyRendered = itemsToRender.some(\n (entry) => entry.type === 'item' && entry.key === draggedKey,\n );\n if (!alreadyRendered) {\n itemsToRender.push({\n type: 'item',\n key: draggedKey,\n context: {\n $implicit: draggedItem,\n index: draggedIndex,\n first: draggedIndex === 0,\n last: draggedIndex === items.length - 1,\n count: items.length,\n },\n visualIndex: draggedIndex,\n });\n }\n }\n\n return itemsToRender;\n }\n\n /**\n * Reconcile views with the calculated items to render.\n * Moves unused views to pool, updates existing views, creates new views as needed.\n * Returns the DOM position where placeholder should be inserted.\n */\n #reconcileViews(\n itemsToRender: RenderEntry<T>[],\n showPlaceholder: boolean,\n strategy: VirtualScrollStrategy,\n ): number {\n // Determine which keys we need\n const neededKeys = new Set(\n itemsToRender.filter((r) => r.type === 'item').map((item) => item.key),\n );\n\n // Move unused views to pool\n for (const [key, view] of this.#activeViews) {\n if (!neededKeys.has(key)) {\n const index = this.#viewContainer.indexOf(view);\n if (index >= 0) {\n this.#viewContainer.detach(index);\n }\n this.#unobserveViewElements(view);\n this.#viewPool.push(view);\n this.#activeViews.delete(key);\n }\n }\n\n // Remove placeholder from DOM if not needed\n if (!showPlaceholder && this.#placeholderInDom && this.#placeholder) {\n this.#placeholder.remove();\n this.#placeholderInDom = false;\n }\n\n // Process items and track placeholder position\n let viewContainerIndex = 0;\n let placeholderDomPosition = -1;\n const renderedKeys = new Set<unknown>();\n\n for (const entry of itemsToRender) {\n if (entry.type === 'placeholder') {\n placeholderDomPosition = viewContainerIndex;\n continue;\n }\n\n if (renderedKeys.has(entry.key)) {\n this.#warnDuplicateTrackByKey(entry.key);\n continue;\n }\n renderedKeys.add(entry.key);\n\n const view = this.#getOrCreateView(entry.key, entry.context!);\n\n // Ensure view is at correct position in ViewContainerRef\n const currentIndex = this.#viewContainer.indexOf(view);\n if (currentIndex !== viewContainerIndex) {\n const targetIndex = this.#getSafeViewContainerIndex(currentIndex, viewContainerIndex);\n if (currentIndex >= 0) {\n if (currentIndex !== targetIndex) {\n this.#viewContainer.move(view, targetIndex);\n }\n } else {\n this.#viewContainer.insert(view, targetIndex);\n }\n }\n\n // Apply absolute positioning when not using viewport wrapper\n if (!this.#useViewportPositioning) {\n const offset = strategy.getOffsetForIndex(entry.visualIndex);\n this.#applyAbsolutePositioning(view, offset);\n }\n\n // Observe for dynamic height measurement\n if (this.#resizeObserver) {\n this.#observeViewElements(view, entry.key);\n }\n\n viewContainerIndex++;\n }\n\n return placeholderDomPosition;\n }\n\n /**\n * Clamp target indices for move/insert to avoid out-of-range operations when\n * reconciliation is given invalid duplicate keys or transiently inconsistent view state.\n */\n #getSafeViewContainerIndex(currentIndex: number, requestedIndex: number): number {\n const length = this.#viewContainer.length;\n\n if (currentIndex >= 0) {\n if (length <= 1) return 0;\n return Math.min(requestedIndex, length - 1);\n }\n\n return Math.min(requestedIndex, length);\n }\n\n /**\n * Duplicate trackBy keys cannot be reconciled to distinct views.\n * Warn in dev mode and skip duplicates to prevent container corruption.\n */\n #warnDuplicateTrackByKey(key: unknown): void {\n if (isDevMode()) {\n console.warn(\n `[ngx-virtual-dnd] Duplicate trackBy key detected in vdndVirtualFor: ${String(key)}. ` +\n 'Skipping duplicate item to avoid view reconciliation errors.',\n );\n }\n }\n\n /**\n * Get an existing view or create/recycle one from the pool.\n */\n #getOrCreateView(\n key: unknown,\n context: VirtualForContext<T>,\n ): EmbeddedViewRef<VirtualForContext<T>> {\n let view = this.#activeViews.get(key);\n\n if (view) {\n // Update existing view context\n Object.assign(view.context, context);\n view.markForCheck();\n } else {\n // Try pool first, then create new\n view = this.#viewPool.pop();\n if (view) {\n Object.assign(view.context, context);\n view.markForCheck();\n } else {\n view = this.#templateRef.createEmbeddedView(context);\n }\n this.#activeViews.set(key, view);\n }\n\n return view;\n }\n\n /**\n * Apply absolute positioning styles to a view's root nodes.\n */\n #applyAbsolutePositioning(view: EmbeddedViewRef<VirtualForContext<T>>, topOffset: number): void {\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n node.style.position = 'absolute';\n node.style.top = `${topOffset}px`;\n node.style.left = '0';\n node.style.right = '0';\n }\n }\n }\n\n /**\n * Position the placeholder element in the DOM at the correct index.\n */\n #positionPlaceholder(\n showPlaceholder: boolean,\n placeholderDomPosition: number,\n strategy: VirtualScrollStrategy,\n placeholderIndex: number,\n ): void {\n if (!showPlaceholder || !this.#placeholder || placeholderDomPosition < 0) {\n return;\n }\n\n // Use the dragged item's height if available, otherwise use strategy height\n const draggedItemHeight = this.#dragState.draggedItem()?.height;\n const height = draggedItemHeight ?? strategy.getItemHeight(placeholderIndex);\n this.#placeholder.style.height = `${height}px`;\n\n const container = this.#viewContainer.element.nativeElement.parentElement;\n if (!container) return;\n\n // The placeholder goes immediately before the item view at placeholderDomPosition\n // (the reconcile pass counts item views only, so this index maps directly to a\n // ViewContainerRef view). Reading the reference node from that view avoids\n // re-querying and filtering container.children on every placeholder move.\n const insertBeforeEl = this.#getViewReferenceNode(placeholderDomPosition);\n\n if (!this.#placeholderInDom) {\n // First insertion\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n this.#placeholderInDom = true;\n } else {\n // Move to correct position if needed\n const currentNextSibling = this.#placeholder.nextElementSibling;\n if (insertBeforeEl !== currentNextSibling) {\n if (insertBeforeEl) {\n container.insertBefore(this.#placeholder, insertBeforeEl);\n } else {\n container.appendChild(this.#placeholder);\n }\n }\n }\n }\n\n /**\n * Resolve the DOM node the placeholder should be inserted before, given the\n * item-view index produced by the reconcile pass. Returns null when the index\n * is past the last view (placeholder belongs at the end → append).\n */\n #getViewReferenceNode(viewIndex: number): Element | null {\n if (viewIndex < 0 || viewIndex >= this.#viewContainer.length) {\n return null;\n }\n const view = this.#viewContainer.get(viewIndex) as\n | EmbeddedViewRef<VirtualForContext<T>>\n | null\n | undefined;\n if (!view) {\n return null;\n }\n for (const node of view.rootNodes) {\n if (node instanceof HTMLElement) {\n return node;\n }\n }\n return null;\n }\n\n /**\n * Trim the view pool to prevent memory bloat, keeping a reasonable buffer.\n */\n #trimViewPool(): void {\n const maxPoolSize = 10;\n while (this.#viewPool.length > maxPoolSize) {\n const view = this.#viewPool.pop();\n view?.destroy();\n }\n }\n\n /**\n * Static method for Angular's structural directive microsyntax.\n */\n static ngTemplateContextGuard<T>(\n _dir: VirtualForDirective<T>,\n _ctx: unknown,\n ): _ctx is VirtualForContext<T> {\n return true;\n }\n}\n","import { isDevMode, type WritableSignal } from '@angular/core';\nimport { DropEvent } from '../models/drag-drop.models';\n\n/**\n * Moves an item between signal-based lists based on a drop event.\n * Handles both same-list reordering and cross-list moves.\n *\n * @example\n * ```typescript\n * // In your component:\n * readonly list1 = signal<Item[]>([...]);\n * readonly list2 = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * moveItem(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding WritableSignal arrays\n */\nexport function moveItem<T>(event: DropEvent, lists: Record<string, WritableSignal<T[]>>): void {\n const sourceList = lists[event.source.droppableId];\n const destList = lists[event.destination.droppableId];\n\n if (!sourceList || !destList) {\n if (isDevMode()) {\n console.warn(\n `[ngx-virtual-dnd] [moveItem] Could not find list for droppable \"${event.source.droppableId}\" or \"${event.destination.droppableId}\"`,\n );\n }\n return;\n }\n\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // Same list reorder\n if (event.source.droppableId === event.destination.droppableId) {\n reorderItems(event, sourceList);\n return;\n }\n\n // Cross-list move\n const sourceItems = sourceList();\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n if (isDevMode()) {\n console.warn(`[ngx-virtual-dnd] [moveItem] Could not find item at index ${sourceIndex}`);\n }\n return;\n }\n\n // Remove from source\n sourceList.update((items) => {\n const newItems = [...items];\n newItems.splice(sourceIndex, 1);\n return newItems;\n });\n\n // Insert at destination\n destList.update((items) => {\n const newItems = [...items];\n newItems.splice(destIndex, 0, item);\n return newItems;\n });\n}\n\n/**\n * Reorders items within a single signal-based list.\n *\n * @example\n * ```typescript\n * readonly items = signal<Item[]>([...]);\n *\n * onDrop(event: DropEvent): void {\n * reorderItems(event, this.items);\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param list The WritableSignal array to reorder\n */\nexport function reorderItems<T>(event: DropEvent, list: WritableSignal<T[]>): void {\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n // No-op if same position\n if (sourceIndex === destIndex) {\n return;\n }\n\n list.update((items) => {\n const newItems = [...items];\n const [removed] = newItems.splice(sourceIndex, 1);\n\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n newItems.splice(destIndex, 0, removed);\n return newItems;\n });\n}\n\n/**\n * Applies a move operation immutably, returning new array objects.\n * Useful for state management patterns that require immutable updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * const { list1, list2 } = applyMove(event, {\n * 'list-1': this.list1,\n * 'list-2': this.list2,\n * });\n * // Use the returned arrays with your state management\n * }\n * ```\n *\n * @param event The drop event from the droppable directive\n * @param lists A map of droppable IDs to their corresponding arrays\n * @returns A new object with the same keys but updated arrays\n */\nexport function applyMove<T>(event: DropEvent, lists: Record<string, T[]>): Record<string, T[]> {\n const result = { ...lists };\n const sourceKey = event.source.droppableId;\n const destKey = event.destination.droppableId;\n const sourceIndex = event.source.index;\n const destIndex = event.destination.index;\n\n const sourceItems = [...(lists[sourceKey] ?? [])];\n const item = sourceItems[sourceIndex];\n\n if (item === undefined) {\n return result;\n }\n\n // Same list reorder\n // Note: destination.index from DropEvent is already adjusted for same-list\n // reordering by DroppableDirective.#handleDrop(), so we use it directly.\n if (sourceKey === destKey) {\n const [removed] = sourceItems.splice(sourceIndex, 1);\n sourceItems.splice(destIndex, 0, removed);\n result[sourceKey] = sourceItems;\n return result;\n }\n\n // Cross-list move\n const destItems = [...(lists[destKey] ?? [])];\n sourceItems.splice(sourceIndex, 1);\n destItems.splice(destIndex, 0, item);\n\n result[sourceKey] = sourceItems;\n result[destKey] = destItems;\n\n return result;\n}\n\n/**\n * Checks if a drop event represents a no-op (item dropped in its original position).\n * Useful for skipping unnecessary state updates.\n *\n * @example\n * ```typescript\n * onDrop(event: DropEvent): void {\n * if (isNoOpDrop(event)) {\n * return; // No action needed\n * }\n * moveItem(event, this.lists);\n * }\n * ```\n *\n * @param event The drop event to check\n * @returns true if the drop would result in no change\n */\nexport function isNoOpDrop(event: DropEvent): boolean {\n return (\n event.source.droppableId === event.destination.droppableId &&\n event.source.index === event.destination.index\n );\n}\n\n/**\n * Creates a new list with the item inserted at the specified index.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param item The item to insert\n * @param index The index to insert at\n * @returns A new array with the item inserted\n */\nexport function insertAt<T>(list: T[], item: T, index: number): T[] {\n const result = [...list];\n result.splice(index, 0, item);\n return result;\n}\n\n/**\n * Creates a new list with the item at the specified index removed.\n * Low-level utility for custom implementations.\n *\n * @param list The source array\n * @param index The index to remove\n * @returns A new array with the item removed\n */\nexport function removeAt<T>(list: T[], index: number): T[] {\n const result = [...list];\n result.splice(index, 1);\n return result;\n}\n","// Models\nexport * from './models/drag-drop.models';\nexport type { VirtualScrollStrategy } from './models/virtual-scroll-strategy';\n\n// Strategies\nexport { FixedHeightStrategy } from './strategies/fixed-height.strategy';\nexport { DynamicHeightStrategy } from './strategies/dynamic-height.strategy';\n\n// Tokens\nexport { VDND_SCROLL_CONTAINER } from './tokens/scroll-container.token';\nexport type { VdndScrollContainer } from './tokens/scroll-container.token';\nexport { VDND_VIRTUAL_VIEWPORT } from './tokens/virtual-viewport.token';\nexport type { VdndVirtualViewport } from './tokens/virtual-viewport.token';\n\n// Services\nexport { DragStateService } from './services/drag-state.service';\nexport { PositionCalculatorService } from './services/position-calculator.service';\nexport { AutoScrollService } from './services/auto-scroll.service';\nexport type { AutoScrollConfig } from './services/auto-scroll.service';\nexport { ElementCloneService } from './services/element-clone.service';\nexport { KeyboardDragService } from './services/keyboard-drag.service';\nexport { OverlayContainerService } from './services/overlay-container.service';\n\n// Components\nexport { VirtualScrollContainerComponent } from './components/virtual-scroll-container.component';\nexport type { VirtualScrollItemContext } from './components/virtual-scroll-container.component';\nexport { DragPreviewComponent } from './components/drag-preview.component';\nexport type { DragPreviewContext } from './components/drag-preview.component';\nexport { PlaceholderComponent } from './components/placeholder.component';\nexport type { PlaceholderContext } from './components/placeholder.component';\nexport { DragPlaceholderComponent } from './components/drag-placeholder.component';\nexport { VirtualSortableListComponent } from './components/virtual-sortable-list.component';\nexport { VirtualViewportComponent } from './components/virtual-viewport.component';\nexport { VirtualContentComponent } from './components/virtual-content.component';\n\n// Directives\nexport { DraggableDirective } from './directives/draggable.directive';\nexport { DroppableDirective } from './directives/droppable.directive';\nexport { DroppableGroupDirective, VDND_GROUP_TOKEN } from './directives/droppable-group.directive';\nexport type { VdndGroupContext } from './directives/droppable-group.directive';\nexport { ScrollableDirective } from './directives/scrollable.directive';\nexport { VirtualForDirective } from './directives/virtual-for.directive';\nexport type { VirtualForContext } from './directives/virtual-for.directive';\nexport { ContentHeaderDirective } from './directives/content-header.directive';\n\n// Utilities\nexport {\n moveItem,\n reorderItems,\n applyMove,\n isNoOpDrop,\n insertAt,\n removeAt,\n} from './utils/drop-helpers';\n","/*\n * Public API Surface of ngx-virtual-dnd\n */\n\nexport * from './lib/index';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAsJA;;AAEG;AACI,MAAM,kBAAkB,GAAc;AAC3C,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,aAAa,EAAE,IAAI;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