Socket
Socket
Sign inDemoInstall

@b9g/revise

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @b9g/revise

Revise is a JavaScript library for creating [`contenteditable`-based](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable) rich-text editors in the browser. It provides a low-level, web-component based API for translating t


Version published
Maintainers
1
Created

Readme

Source

Revise.js

Revise is a JavaScript library for creating contenteditable-based rich-text editors in the browser. It provides a low-level, web-component based API for translating the DOM into string documents. The library also ships with a compact data structure for representing edits to strings. Revise is intended to be framework-agnostic, though currently it is only being tested with Crank.

Status

At present, this library is in an early beta. It is recommended for developers who aren’t afraid of stepping through DOM code in a debugger.

Usage

TKTKTKT

API

ContentAreaElement

A custom element class with an API similar to that of the JavaScript API for the <textarea> element. This class provides special properties and methods for reading the current value of the element’s contents and manipulating its selection.

  • value

  • selectionStart

  • selectionEnd

  • selectionDirection

  • setSelectionRange(selectionStart: number, selectionEnd: number, selectionDirection?: SelectionDirection): void;

  • indexAt(node: Node | null, offset: number): number

  • `nodeOffsetAt(index: number): [Node | null, number]

  • source(name: string): boolean

  • ContentEvent

Edit

  • operations(): Array<Operation>

  • apply(text: string): string

  • compose(that: Edit): Edit

  • invert(): Edit

  • normalize(): Edit

  • hasChangesBetween(start: number, end: number): boolean

  • Edit.createBuilder(value: string): EditBuilder

  • Edit.diff(text1: string, text2: string, hint?: number): Edit

EditBuilder

EditHistory

Keyer

FAQs

Last updated on 11 Mar 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc