Socket
Socket
Sign inDemoInstall

prosemirror-gapcursor

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-gapcursor

ProseMirror plugin for cursors at normally impossible-to-reach positions


Version published
Weekly downloads
1.2M
decreased by-2.01%
Maintainers
1
Weekly downloads
 
Created

What is prosemirror-gapcursor?

The prosemirror-gapcursor package provides a way to handle cursor behavior in ProseMirror editors when the cursor is positioned in places where a regular text cursor would not normally be able to go, such as between block nodes.

What are prosemirror-gapcursor's main functionalities?

Gap Cursor Plugin

This feature provides a plugin that can be added to a ProseMirror editor to enable gap cursor functionality. The code sample demonstrates how to create an editor state with the gap cursor plugin and initialize an editor view with that state.

const { gapCursor } = require('prosemirror-gapcursor');
const { EditorState } = require('prosemirror-state');
const { EditorView } = require('prosemirror-view');
const { schema } = require('prosemirror-schema-basic');

const state = EditorState.create({
  schema,
  plugins: [gapCursor()]
});

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

Custom Gap Cursor Behavior

This feature allows customization of the gap cursor behavior. The code sample shows how to create a custom gap cursor plugin with a specific class name and an event handler for when the gap cursor is entered.

const { gapCursor } = require('prosemirror-gapcursor');
const { Plugin } = require('prosemirror-state');

const customGapCursor = gapCursor({
  className: 'my-gap-cursor',
  onGapCursorEnter: (state, dispatch) => {
    console.log('Gap cursor entered');
  }
});

const state = EditorState.create({
  schema,
  plugins: [customGapCursor]
});

Other packages similar to prosemirror-gapcursor

FAQs

Package last updated on 05 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc