ngx-virtual-dnd 3.2.0-alpha.0 → 3.2.0-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-virtual-dnd",
3
- "version": "3.2.0-alpha.0",
3
+ "version": "3.2.0-alpha.2",
4
4
  "description": "A performant drag-and-drop library for Angular that works seamlessly with virtual scrolling",
5
5
  "keywords": [
6
6
  "angular",
@@ -21,7 +21,7 @@
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/gultyayev/ngx-virtual-dnd.git"
23
23
  },
24
- "homepage": "https://github.com/gultyayev/ngx-virtual-dnd#readme",
24
+ "homepage": "https://gultyayev.github.io/ngx-virtual-dnd/",
25
25
  "bugs": {
26
26
  "url": "https://github.com/gultyayev/ngx-virtual-dnd/issues"
27
27
  },
@@ -351,13 +351,25 @@ interface VdndAnimationConfig {
351
351
  * @default 'cubic-bezier(0.2, 0, 0, 1)'
352
352
  */
353
353
  shiftEasing?: string;
354
+ /**
355
+ * Duration (ms) of the drop animation: on drop or cancel, the drag preview glides into
356
+ * the dropped item's final position instead of disappearing. `0` disables it.
357
+ * @default 200
358
+ */
359
+ dropDuration?: number;
360
+ /**
361
+ * CSS easing function for the drop animation.
362
+ * @default 'cubic-bezier(0.2, 0, 0, 1)'
363
+ */
364
+ dropEasing?: string;
354
365
  }
355
366
  /**
356
367
  * Opt-in animation configuration. When provided, items displaced by the placeholder
357
- * slide into their new position instead of jumping. Resolved through the element
368
+ * slide into their new position instead of jumping, and on drop the drag preview glides
369
+ * into the item's final position. Resolved through the element
358
370
  * injector, so it can be provided app-wide or per component subtree.
359
371
  *
360
- * The animation is skipped when the user prefers reduced motion. Values are read each
372
+ * Animations are skipped when the user prefers reduced motion. Values are read each
361
373
  * time an animation starts, so getters can toggle the animation at runtime.
362
374
  *
363
375
  * @example
@@ -748,6 +760,17 @@ declare class KeyboardDragService {
748
760
  * The droppable registry is managed externally.
749
761
  */
750
762
  moveToDroppable(droppableId: string, targetIndex: number, totalItemCount: number): void;
763
+ /**
764
+ * Register the callback that scrolls a droppable's placeholder into view. It runs
765
+ * synchronously on every keyboard move into or within that droppable, so a drop that
766
+ * follows before the next render still lands inside the rendered range.
767
+ */
768
+ registerRevealer(droppableId: string, reveal: () => void): void;
769
+ /**
770
+ * Unregister a droppable's reveal callback. Ignored if another callback has since been
771
+ * registered under the same ID.
772
+ */
773
+ unregisterRevealer(droppableId: string, reveal: () => void): void;
751
774
  /**
752
775
  * Complete the keyboard drag (Space or Enter to drop).
753
776
  */
@@ -983,6 +1006,9 @@ interface DragPreviewContext<T = unknown> {
983
1006
  * so it works correctly even inside ancestors with CSS `transform` (e.g. Ionic pages).
984
1007
  * It can be placed anywhere in the component tree.
985
1008
  *
1009
+ * When `VDND_ANIMATION_CONFIG` is provided, the preview stays up briefly after a drop or
1010
+ * cancel and glides into the item's final position.
1011
+ *
986
1012
  * @example
987
1013
  * ```html
988
1014
  * <vdnd-drag-preview>
@@ -1004,6 +1030,12 @@ declare class DragPreviewComponent<T = unknown> implements OnDestroy {
1004
1030
  }>;
1005
1031
  /** Reference to the clone container element (cannot use ES private with viewChild) */
1006
1032
  private readonly cloneContainer;
1033
+ /** The rendered preview box (cannot use ES private with viewChild) */
1034
+ private readonly previewElement;
1035
+ /** Whether the preview is playing the drop animation */
1036
+ protected readonly isSettling: _angular_core.Signal<boolean>;
1037
+ /** The item shown: the live dragged item, or the dropped one while it settles */
1038
+ protected readonly displayedItem: _angular_core.Signal<DraggedItem | null>;
1007
1039
  /** The cloned element from drag state (used when no custom template is provided) */
1008
1040
  protected readonly clonedElement: _angular_core.Signal<HTMLElement | null>;
1009
1041
  constructor();
@@ -1011,10 +1043,7 @@ declare class DragPreviewComponent<T = unknown> implements OnDestroy {
1011
1043
  /** Whether the preview is visible */
1012
1044
  protected readonly isVisible: _angular_core.Signal<boolean>;
1013
1045
  /** Position of the preview */
1014
- protected readonly position: _angular_core.Signal<{
1015
- x: number;
1016
- y: number;
1017
- }>;
1046
+ protected readonly position: _angular_core.Signal<CursorPosition>;
1018
1047
  /** Transform-based positioning for better performance (avoid layout from left/top). */
1019
1048
  protected readonly transform: _angular_core.Signal<string>;
1020
1049
  /** Dimensions of the preview */