Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@slate-editor/grid-plugin

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-editor/grid-plugin

SlateJS grid block node content editable plugin.

  • 5.0.0-alpha.f7181996
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
917
decreased by-21.02%
Maintainers
2
Weekly downloads
 
Created
Source
Nossas Cidades logo Nossas Cidades logo

SlateJS - Grid Plugin

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

Usage

SlateJS Grid Plugin
import React, { Component } from 'react'
import GridPlugin from 'slate-grid-plugin'

const plugins = [
  GridPlugin()
]

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

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

Keyboard Shortcut

PlatformActionShortcut
Apple LogoAdd Grid + ^ + g
Apple LogoSplit Row + ^ + r
Windows LogoAdd Grid^ + alt + g
Windows LogoSplit Row^ + alt + r

API

TargetDescription
GridNodeComponent that holds the html that will render the content with grid style.
GridRowNodeComponent that holds the html that will render the grid row.
GridCellNodeComponent that holds the html that will render the grid cell.
GridKeyboardShortcutKeyboard shortcut file that manipulates onKeyDown event inside SlateJS.
GridUtilsGeneric file that holds the util common functions.
GridButtonBarComponent that holds all action buttons to handle the grid behaviour.
GridButtonComponent that handle behaviour to wrap content with grid style.
GridSplitRowButtonComponent that handle behaviour to split rows into the grid.

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