Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
prosemirror-commands
Advanced tools
The prosemirror-commands package provides a set of predefined commands for manipulating the content of a ProseMirror editor. These commands cover a wide range of common editing actions, such as formatting text, inserting nodes, and manipulating the document structure.
Text Formatting
This feature allows you to toggle text formatting such as bold, italic, and underline. The code sample demonstrates how to create a command to toggle bold formatting using the ProseMirror schema.
const { toggleMark } = require('prosemirror-commands');
const { schema } = require('prosemirror-schema-basic');
// Example command to toggle bold formatting
const toggleBold = toggleMark(schema.marks.strong);
Node Insertion
This feature allows you to insert or change the type of nodes in the document. The code sample shows how to create a command to set a block type to a paragraph.
const { setBlockType } = require('prosemirror-commands');
const { schema } = require('prosemirror-schema-basic');
// Example command to set a paragraph block type
const setParagraph = setBlockType(schema.nodes.paragraph);
Document Manipulation
This feature provides commands for manipulating the document structure, such as joining blocks or splitting nodes. The code sample demonstrates how to create a command to join the current block with the one above it.
const { joinUp } = require('prosemirror-commands');
// Example command to join the current block with the one above it
const joinWithAbove = joinUp;
Tiptap is a headless, framework-agnostic text editor built on top of ProseMirror. It provides a more modern and flexible API for creating rich text editors. Compared to prosemirror-commands, Tiptap offers a higher-level abstraction and additional features like collaborative editing and real-time collaboration.
Slate is a completely customizable framework for building rich text editors. It provides a more flexible and extensible API compared to prosemirror-commands, allowing developers to define their own commands and behaviors. Slate is known for its ease of use and powerful plugin system.
Draft.js is a rich text editor framework developed by Facebook. It provides a set of immutable models and helper functions for building rich text editors. While it offers similar functionalities to prosemirror-commands, Draft.js is more opinionated and tightly integrated with React.
[ WEBSITE | ISSUES | FORUM | GITTER | CHANGELOG ]
This is a core module of 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 number of editing commands, which are functions that abstract editing actions which can be bound to keys.
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.
1.1.12 (2021-10-29)
Fix issue where the default PC keymap was used on recent versions of iPhone or iPad operating systems.
FAQs
Editing commands for ProseMirror
The npm package prosemirror-commands receives a total of 1,318,980 weekly downloads. As such, prosemirror-commands popularity was classified as popular.
We found that prosemirror-commands demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.