Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@mmstack/dnd

Latest version: v21.8.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: mmstack
37 Stars
4 Forks
16 Versions
118 Downloads
TypeScript Repo language

Scan summary

@mmstack/dnd was last scanned on 29 Nov 2026 at version 21.8.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 16 versions; the latest 2 were published on 29 Nov 2026.
  • Findings: No rules fired in version 21.8.0.
  • Downloads: 118 downloads.

Versions

16 versions published
Versions and the rules that fired in each
VersionPublishedStatus
21.8.0 LATEST 29 Nov 2026 No rules fired
22.8.0 29 Nov 2026 No rules fired
22.7.0 18 Oct 2026 No rules fired
21.7.0 18 Oct 2026 Not shown
22.6.2 7 Oct 2026 Not shown

No rules fired in 21.8.0

Findings

Findings for v21.8.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 21.8.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@mmstack/dnd

Signals-first drag & drop for Angular. Make any element draggable or a drop target with a typed payload, read every bit of drag state as a Signal, and build reorderable lists — single or cross-list — on the same primitives. Choose the engine per element: native HTML5 (files, cross-window, a drop-indicator line) or a first-party pointer / FLIP engine (siblings glide to open a gap, no browser drag image). Accessible by default, tree-shakeable, and it works with zero configuration.

License

Built on @atlaskit/pragmatic-drag-and-drop (v4) for the native engine; the pointer engine, sortable/FLIP, keyboard a11y, and the optional plugins are all first-party.

Highlights

  • One reactive session. Every per-element signal (dragging, isDragOver, closestEdge, …) is a computed off a single ambient session — no per-element writable signals, no callbacks writing into state, no effects copying signals. The core path has no recurring effects.
  • Two engines, one API. native uses HTML5 DnD (files, cross-window, the browser's drag image); pointer uses pointer events with FLIP (buttery same-page sorting, custom followers). Both feed the same session, so monitor, dragging, and isDragOver behave identically. Pick per element or set a default once.
  • Sorting that doesn't fight Angular. Reordering is a single splice on your WritableSignal<T[]> at drop — no parallel order state, the array untouched mid-drag. The pointer engine animates from derived state (FLIP) instead of mutating the DOM.
  • Cross-list & nested. Share one sortableGroup<T>() and items drag between lists; innermost wins for nested lists, with a canReceive guard.
  • Accessible out of the box. Focus + arrow-key reordering and screen-reader announcements are on by default for sortable lists (opt-out or fully replaceable). Canvas keyboard moves are announced once you pass announceTransform.
  • Zero required plugins. Edge detection and auto-scroll are opt-in — use the first-party zero-dependency plugins from the secondary entry point @mmstack/dnd/plugins, or plug in pragmatic's sub-libraries. Missing a plugin degrades gracefully (dev warning + no-op), never a throw.
  • Typed everywhere. accepts narrows payloads with no casting; a symbol-keyed meta channel never collides with your data; engine-only options are compile-time-guarded per engine.
  • Composable or declarative. Every primitive is a plain function; every directive is a thin wrapper over it. And every option is DI-defaultable.
  • Grids and canvases (preview). A wrapping 2D sortable (axis: 'wrap'), a controlled spanning grid (placementGrid, the dashboard / form-builder model) and a free-form canvas (canvas: move, resize, rotate, marquee, snaplines, pan/zoom, containment). All of them write your state signal exactly once per gesture, which makes them a natural fit for op-log stores and undo history; grid and canvas moves commit as per-property ops, the collaboration-friendly shape.
  • Open core. When a shipped primitive doesn't fit, you don't fall back to writing drag-and-drop from scratch. The barrel also exposes the pieces the primitives are built from: the gesture chassis (driveGesture), the geometry hit-testing helpers, & more, so you can assemble a bespoke interaction on the same reactive session. These stay out of the docs to keep the surface small, but they are typed and discoverable from the barrel.

Installation

npm install @mmstack/dnd @atlaskit/pragmatic-drag-and-drop

@atlaskit/pragmatic-drag-and-drop is a peer dependency (it powers the native engine and the shared global monitor). The sub-libraries below are optional peers (marked optional in peerDependenciesMeta, so nothing installs them for you) — reach for them only if you prefer them over the first-party plugins (see Plugins):

npm install @atlaskit/pragmatic-drag-and-drop-hitbox       # edge detection
npm install @atlaskit/pragmatic-drag-and-drop-auto-scroll  # auto-scroll
npm install @atlaskit/pragmatic-drag-and-drop-flourish     # post-move flash

The sub-libraries list the core package as a regular dependency rather than a peer. If the versions you install disagree on a core major, your package manager nests a second copy of the core under the sub-library. The two copies share no state, so auto-scroll registered through the nested copy never sees your drags. Install the core and the sub-libraries within the ranges this package declares as peers and you get a single copy.

Quick start

Drag cards between two columns. draggable carries the typed payload, dropTarget narrows it with accepts and exposes isDragOver, and the drop updates your own signal. No plugins required.

import { Component, signal } from '@angular/core';
import { Draggable, DropTarget } from '@mmstack/dnd';

type Column = 'todo' | 'done';
type Card = { id: number; title: string };

const isCard = (d: unknown): d is Card =>
  !!d && typeof d === 'object' && 'id' in d;

@Component({
  selector: 'app-board',
  imports: [Draggable, DropTarget],
  template: `
    @for (col of columns; track col) {
      <section
        mmDropTarget
        #zone="mmDropTarget"
        [accepts]="isCard"
        [class.over]="zone.isDragOver()"
        (dropped)="move(col, $event.data)"
      >
        <h3>{{ col }}</h3>
        @for (card of board()[col]; track card.id) {
          <article
            mmDraggable
            #d="mmDraggable"
            [data]="card"
            [class.dragging]="d.dragging()"
          >
            {{ card.title }}
          </article>
        }
      </section>
    }
  `,
  styles: `
    :host {
      display: flex;
      gap: 1rem;
      font-family: system-ui, sans-serif;
    }
    section {
      flex: 1;
      min-height: 120px;
      padding: 0.75rem;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
    }
    section.over {
      border-color: #2563eb;
      background: #eff6ff;
    }
    h3 {
      margin: 0 0 0.5rem;
      text-transform: capitalize;
    }
    article {
      margin-bottom: 0.5rem;
      padding: 0.5rem 0.75rem;
      background: #fff;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      cursor: grab;
      user-select: none;
    }
    article.dragging {
      opacity: 0.4;
    }
  `,
})
export class BoardComponent {
  protected readonly isCard = isCard;
  protected readonly columns: Column[] = ['todo', 'done'];

  protected readonly board = signal<Record<Column, Card[]>>({
    todo: [
      { id: 1, title: 'Design' },
      { id: 2, title: 'Build' },
    ],
    done: [{ id: 3, title: 'Kickoff' }],
  });

  protected move(to: Column, card: Card): void {
    this.board.update((b) => {
      const next: Record<Column, Card[]> = {
        todo: b.todo.filter((c) => c.id !== card.id),
        done: b.done.filter((c) => c.id !== card.id),
      };
      next[to] = [...next[to], card];
      return next;
    });
  }
}

$event.data is typed Card because accepts narrows it. Add the hitbox plugin when you want edge-aware drops (insert before or after a target).

Primitives

  • draggable<TData, TMeta>(opts) / Draggable: make an element draggable with a typed payload and optional metadata.
  • dropTarget<TAccept, TSelf, TMeta>(opts) / DropTarget: make an element a drop target with a type-narrowing accepts, optional edge detection, and derived state.
  • monitor<TAccept, TMeta>(opts): global drag-state observer (derived; callbacks optional).
  • fileDropTarget(opts) / monitorExternal(opts): accept files dragged in from the OS (the external adapter).
  • reorderable(signal, opts) / injectReorderable(signal, opts) + Reorderable / ReorderableItem (/ ReorderableHandle): a sortable list over your own WritableSignal<T[]>. See Sortable lists.
  • sortableGroup<T>(): share one group object across lists so items drag between them; DropIndicator: the native engine's insertion line.
  • DragHandle (mmDragHandle): restrict drag initiation to a child element.
  • autoScroll(opts) / mmAutoScroll: edge auto-scroll (needs an auto-scroll plugin).
  • provideDnd(config): register optional plugins and scope a session.
  • provideDndDefaults / provideDraggableDefaults / provideDropTargetDefaults / provideReorderableDefaults: set option defaults via DI. See Defaults.
  • Custom drag previews via the preview option on draggable().

Both draggable and dropTarget take an engine?: 'native' | 'pointer' (default 'native'). Native uses HTML5 drag-and-drop (files, cross-window, the browser's drag image); pointer uses pointer events (continuous position, no native drag image — you move the element, e.g. FLIP). Both feed the same session, so dragging / isDragOver / monitor work identically regardless of engine.

Every composable is a function. Every directive is a thin wrapper that forwards inputs into the composable and exposes its signal state.

The reactive model

monitorForElements already broadcasts the full drag world on every move. A root DndSession captures it once into a signal, and everything per-element is a computed:

// inside dropTarget()
const isDragOver = computed(() => hitIndex() >= 0);
const closestEdge = computed(() => /* read from the session via the hitbox plugin */);

There are no per-element writable signals, no callbacks writing into signals, and no effects copying one signal into another. Pragmatic's config hooks (getInitialData, canDrop, getData) are read lazily, so registration happens once. A reactive dragHandle is the only thing that re-registers, and only when the handle element changes.

draggable

import { Component, signal } from '@angular/core';
import { draggable } from '@mmstack/dnd';

type Card = { id: string; title: string };

@Component({
  selector: 'app-card',
  template: `{{ card().title }}`,
  host: { '[class.dragging]': 'dnd.dragging()' },
})
export class CardComponent {
  readonly card = signal<Card>({ id: '1', title: 'Hello' });

  protected readonly dnd = draggable<Card>({
    data: this.card,
    onDrop: ({ data, edge, location }) => {
      console.log('dropped', data, 'edge', edge, 'onto', location.current);
    },
  });
}

Or the directive:

<div
  mmDraggable
  [data]="card()"
  #d="mmDraggable"
  [class.dragging]="d.dragging()"
  (dropped)="onDrop($event)"
>
  {{ card().title }}
</div>

dropTarget

accepts is a typeguard that narrows incoming payloads, so all events and signals are typed against TAccept with no casting.

import { dropTarget } from '@mmstack/dnd';

type Card = { id: string };
const isCard = (d: unknown): d is Card =>
  !!d && typeof d === 'object' && 'id' in d;

protected readonly zone = dropTarget<Card>({
  accepts: isCard,
  onDrop: ({ data }) => this.cards.update((cs) => [...cs, data]),
});
// zone.isDragOver(), zone.isInnermost(), zone.dragOverData(), zone.closestEdge()

closestEdge and edges need the hitbox plugin (see Plugins); without it, drops still work — you just get no edge (closestEdge() stays null), plus a one-time dev warning. dropTarget also supports sticky (stay the active target after the pointer leaves) and dropEffect ('move' | 'copy' | 'link'), both pragmatic element-adapter features.

Both draggable and dropTarget accept engine: 'pointer' to drive via pointer events instead of native HTML5 DnD (see Sortable lists for the engine trade-offs). In pointer mode draggable moves the element itself (there's no browser drag image), so preview renders a floating follower; native preview uses the browser's custom drag preview. The engine is resolved at creation. Edge detection (edges / hitbox) works on either engine, since the hitbox is pure geometry over the pointer position; sticky / dropEffect are native-only and compile-time-forbidden when engine: 'pointer', and conversely activationThreshold (px before the drag activates, default 5) and touchActivation (see Touch) are pointer-only.

fileDropTarget (external / files)

Accept files dragged from outside the browser (pragmatic's external adapter):

import { fileDropTarget } from '@mmstack/dnd';

protected readonly drop = fileDropTarget({
  onDrop: ({ files }) => this.upload(files), // files: File[]
  // canDrop: ({ types }) => ...,  disabled, sticky, dropEffect
});
// drop.isDragOver(), drop.isInnermost()

monitorExternal({ onDrop }) observes external drags globally. An element can be both an element target and a file target: apply both composables.

monitor

protected readonly monitor = monitor<Card>({ accepts: isCard });
// monitor.isDragging(), monitor.source()

isDragging and source are pure derivations of the ambient session. Pass onDragStart or onDrop to also attach a thin subscription for side effects.

Sortable lists (reorderable)

reorderable turns your own WritableSignal<T[]> into a sortable list. Reordering is a single splice on your signal at drop — there's no parallel order state, and the array is untouched mid-drag. Bind the returned controller to the mmReorderable container + mmReorderableItem directives:

import { Component, signal } from '@angular/core';
import { Reorderable, ReorderableItem, reorderable } from '@mmstack/dnd';

type Task = { id: number; label: string };

@Component({
  selector: 'app-list',
  imports: [Reorderable, ReorderableItem],
  template: `
    <ul [mmReorderable]="list">
      @for (task of list.items(); track task.id) {
        <li [mmReorderableItem]="task">{{ task.label }}</li>
      }
    </ul>
  `,
})
export class ListComponent {
  private readonly tasks = signal<Task[]>([
    { id: 1, label: 'One' },
    { id: 2, label: 'Two' },
    { id: 3, label: 'Three' },
  ]);
  protected readonly list = reorderable(this.tasks, { key: (t) => t.id });
}

reorderable vs injectReorderable. reorderable is a pure factory (no DI — great for tests). Use injectReorderable (same signature, called from an injection context) when you want the list to pick up DI option defaults — it captures the current Injector and hands it to reorderable for you.

Keyboard reordering is on by default: focus a row, then arrow keys move it one step (axis-aware), and Cmd/Ctrl + arrow jumps to an end — announced via injectAnnounce, and the moved row is kept focused and scrolled into view. Every piece is opt-out or replaceable:

reorderable(this.items, {
  key: (t) => t.id,
  keyboard: false, // ← disable keys entirely (no tabindex, no handler)
  announceMove: false, // ← silence announcements (no live region is created)
  jumpModifier: (e) => e.shiftKey, // ← Shift instead of Cmd/Ctrl for the built-in jump

  // …or take over keydown completely (custom keys / behaviour). `api.move(to)`
  // reuses the built-in commit + announce + focus-restore; ignore it to do your own thing.
  onKeyboardKeydown: (e, { index, total, move }) => {
    if (e.key === 'j') {
      e.preventDefault();
      move(Math.min(index + 1, total - 1));
    }
    if (e.key === 'k') {
      e.preventDefault();
      move(Math.max(index - 1, 0));
    }
  },
});
Engines: native (indicator) vs pointer (FLIP)

Same API, two render/drag models, chosen with engine (default 'native'):

  • 'native' — HTML5 drag-and-drop. Items stay put and a DropIndicator line shows where the drop will land. Composes with file / cross-window drags.
  • 'pointer' — pointer events. Siblings glide (FLIP) to open a gap and the dragged element follows the pointer; the "gap" placeholder feel. In-page only.
reorderable(this.tasks, { key: (t) => t.id }); // native indicator (default)
reorderable(this.tasks, { key: (t) => t.id, engine: 'pointer' }); // FLIP glide

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @mmstack/dnd

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229