npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@type-editor/dropcursor

v0.0.3

Published

This is a refactored version of the ProseMirror's 'dropcursor' module. Original: https://github.com/ProseMirror/prosemirror-dropcursor

Readme

@type-editor/dropcursor

This is a refactored version of the prosemirror-dropcursor module.

This module implements a plugin that displays a visual drop cursor indicator when content is dragged over the editor. The drop cursor helps users see where dragged content will be inserted, appearing as a colored line or block at the potential drop position during drag-and-drop operations.

Installation

npm install @type-editor/dropcursor

Usage

import { EditorState } from '@type-editor/state';
import { EditorView } from '@type-editor/view';
import { dropCursor } from '@type-editor/dropcursor';

const state = EditorState.create({
  schema: mySchema,
  plugins: [
    dropCursor({ color: 'blue', width: 2 })
  ]
});

const view = new EditorView(document.querySelector('#editor'), { state });

API

dropCursor

Creates a plugin that displays a visual drop cursor indicator when content is dragged over the editor.

function dropCursor(options?: DropCursorOptions): Plugin

Parameters:

  • options - Optional configuration for the drop cursor appearance

Returns: A ProseMirror plugin instance

DropCursorOptions

Configuration options for the drop cursor plugin.

interface DropCursorOptions {
  color?: string | false;
  width?: number;
  class?: string;
}

| Option | Type | Default | Description | |---------|-------------------|-----------|-------------------------------------------------------------------------------------------| | color | string \| false | "black" | The color of the cursor. Set to false to apply no color and rely only on the CSS class. | | width | number | 1 | The precise width of the cursor in pixels. | | class | string | — | A CSS class name to add to the cursor element for custom styling. |

Node Spec Integration

Nodes may add a disableDropCursor property to their spec to control whether the drop cursor can appear inside them. This can be:

  • Boolean: true to disable the drop cursor, false to enable it
  • Function: (view: EditorView, pos: number, event: DragEvent) => boolean for dynamic control

Example

const imageNode = {
  // ...other spec properties...
  disableDropCursor: true  // Never show drop cursor inside this node
};

const customNode = {
  // ...other spec properties...
  disableDropCursor: (view, pos, event) => {
    // Dynamically decide based on context
    return event.dataTransfer?.types.includes('text/plain') ?? false;
  }
};

Styling

The drop cursor element can be styled via CSS using the class option:

dropCursor({ class: 'my-drop-cursor', color: false })
.my-drop-cursor {
  background-color: #3b82f6;
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

License

MIT