Socket
Socket
Sign inDemoInstall

@slate-editor/bold-plugin

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-editor/bold-plugin

SlateJS framework bold plugin


Version published
Weekly downloads
1.2K
increased by15.62%
Maintainers
2
Weekly downloads
 
Created
Source
Nossas Cidades logo Nossas Cidades logo

SlateJS - Bold Plugin

The goal of this plugin is to offers an easy handling of SlateJS bold mark node content editable. Providing a simple API and easy usage, basing on concept of plugin-centric by SlateJS framework.

Usage

SlateJS Bold Plugin
import React, { Component } from 'react'
import BoldPlugin from 'slate-bold-plugin'

const plugins = [
  BoldPlugin()
]

class SlateEditor extends Component {
  onChange(state) {
    this.setState({ state })
  }
  render() {
    return (
      <Editor
        plugins={plugins}
        state={this.state.state}
        onChange={this.onChange.bind(this)}
      />
    )
  }
}
SlateJS Bold Plugin Button
import React, { Component } from 'react'
import { BoldButton } from 'slate-bold-plugin'

class SlateEditor extends Component {
  onChange(state) {
    this.setState({ state })
  }
  render() {
    return (
      <div className="editor--toolbar">
        <BoldButton
          state={this.state.state}
          onChange={this.onChange.bind(this)}
        />
      </div>
    )
  }
}

Keyboard Shortcut

PlatformShortcut
Apple Logo+b
Windows Logo^+b

API

TargetDescription
BoldMarkComponent that holds the html that will wrap the content with bold style.
BoldUtilsGeneric file that holds the util common functions.
BoldButtonButton component that have behaviour to wrap content with bold style.
BoldKeyboardShortcutKeyboard shortcut file that manipulates onKeyDown event inside SlateJS.

TODO

  • Make keyboard shortcut accepts customization

FAQs

Package last updated on 20 Apr 2018

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