Socket
Socket
Sign inDemoInstall

@tiptap/pm

Package Overview
Dependencies
Maintainers
4
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/pm

prosemirror wrapper package for tiptap


Version published
Weekly downloads
884K
decreased by-4.46%
Maintainers
4
Weekly downloads
 
Install size
Created

Package description

What is @tiptap/pm?

@tiptap/pm is a package that provides a set of tools and utilities for building rich text editors. It is part of the Tiptap ecosystem, which is built on top of ProseMirror, a toolkit for building rich text editors. @tiptap/pm offers a range of functionalities including schema creation, commands, input rules, and more.

What are @tiptap/pm's main functionalities?

Schema Creation

This feature allows you to define the structure of your document. The schema defines the nodes and marks that can be used in the editor.

const { Schema } = require('@tiptap/pm');

const mySchema = new Schema({
  nodes: {
    doc: { content: 'block+' },
    paragraph: { content: 'text*', toDOM: () => ['p', 0], parseDOM: [{ tag: 'p' }] },
    text: { inline: true }
  },
  marks: {}
});

Commands

Commands are functions that perform actions on the editor state. This example shows how to create a command to toggle a bold mark.

const { toggleMark } = require('@tiptap/pm');

const boldCommand = toggleMark(mySchema.marks.bold);

// Usage in an editor instance
editor.commands.bold = () => boldCommand(editor.state, editor.dispatch);

Input Rules

Input rules are used to automatically transform text as the user types. This example shows how to create an input rule that transforms text starting with '>' into a blockquote.

const { inputRules, wrappingInputRule } = require('@tiptap/pm');

const blockquoteRule = wrappingInputRule(/^
*>
$/, mySchema.nodes.blockquote);

const myInputRules = inputRules({ rules: [blockquoteRule] });

Other packages similar to @tiptap/pm

Changelog

Source

2.1.13 (2023-11-30)

Bug Fixes

  • react: fix performance regression because of select/deselect (#4661) (ad7f659)

Readme

Source

@tiptap/pm

Version Downloads License Sponsor

Introduction

Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.

What is this pm package?

The pm package is a wrapper package for ProseMirror. This includes all ProseMirror packages that are required to run Tiptap.

Official Documentation

Documentation can be found on the Tiptap website.

License

Tiptap is open sourced software licensed under the MIT license.

Keywords

FAQs

Package last updated on 30 Nov 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc