Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
prosemirror-dropcursor
Advanced tools
The prosemirror-dropcursor package is a plugin for ProseMirror, a toolkit for building rich-text editors. This plugin adds a drop cursor to the editor, which is a visual indicator that shows where content will be inserted when it is dragged and dropped.
Adding a Drop Cursor
This code sample demonstrates how to add a drop cursor to a ProseMirror editor. The DropCursor plugin is instantiated and added to the editor's state plugins. When content is dragged and dropped into the editor, the drop cursor will indicate the insertion point.
const { DropCursor } = require('prosemirror-dropcursor');
const { EditorState } = require('prosemirror-state');
const { EditorView } = require('prosemirror-view');
const { schema } = require('prosemirror-schema-basic');
const { DOMParser } = require('prosemirror-model');
const dropCursor = new DropCursor();
const state = EditorState.create({
doc: DOMParser.fromSchema(schema).parse(document.querySelector('#content')),
plugins: [dropCursor]
});
const view = new EditorView(document.querySelector('#editor'), {
state
});
The prosemirror-gapcursor package provides a similar visual indicator for gaps between blocks in a ProseMirror editor. Unlike prosemirror-dropcursor, which shows where content will be inserted during a drag-and-drop operation, prosemirror-gapcursor shows a cursor in places where the regular text cursor cannot go, such as between two block elements.
The prosemirror-menu package offers a set of UI components for building menus in a ProseMirror editor. While it does not provide a drop cursor, it enhances the editor's functionality by adding menu items for various editing actions. This package complements prosemirror-dropcursor by providing additional user interface elements.
[ WEBSITE | ISSUES | FORUM | GITTER ]
This is a non-core example module for ProseMirror. ProseMirror is a well-behaved rich semantic content editor based on contentEditable, with support for collaborative editing and custom document schemas.
This module implements a plugin that shows a drop cursor for ProseMirror.
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license. There's a forum for general discussion and support requests, and the Github bug tracker is the place to report issues.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
dropCursor
(options: ?Object) → Plugin
Create a plugin that, when added to a ProseMirror instance, causes a decoration to show up at the drop position when something is dragged over the editor.
Supports two options: color
to set the color of the cursor (defaults
to black) and width
to set its with in pixels (defaults to 1).
1.1.1 (2018-10-23)
Fix crash when destroying the plugin, due to a misspelled method name.
FAQs
Drop cursor plugin for ProseMirror
The npm package prosemirror-dropcursor receives a total of 1,058,530 weekly downloads. As such, prosemirror-dropcursor popularity was classified as popular.
We found that prosemirror-dropcursor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.