5.0.0-alpha.19a19572 ⢠Published 8 years ago
@slate-editor/strikethrough-plugin v5.0.0-alpha.19a19572
SlateJS - Strikethrough Plugin
The goal of this plugin is to offers an easy handling of SlateJS strikethrough mark content editable. Providing a simple API and easy usage, basing on concept of plugin-centric by SlateJS framework.
Usage
SlateJS Strikethrough Plugin
import React, { Component } from 'react'
import StrikethroughPlugin from 'slate-strikethrough-plugin'
const plugins = [
StrikethroughPlugin()
]
class SlateEditor extends Component {
onChange(state) {
this.setState({ state })
}
render() {
return (
<Editor
plugins={plugins}
state={this.state.state}
onChange={this.onChange.bind(this)}
/>
)
}
}SlateJS Strikethrough Plugin Button
import React, { Component } from 'react'
import { StrikethroughButton } from 'slate-strikethrough-plugin'
class SlateEditor extends Component {
onChange(state) {
this.setState({ state })
}
render() {
return (
<div className="editor--toolbar">
<StrikethroughButton
state={this.state.state}
onChange={this.onChange.bind(this)}
/>
</div>
)
}
}Keyboard Shortcut
| Platform | Shortcut |
|---|---|
| ā + ^ + s | |
| ^ + alt + s |
API
| Target | Description |
|---|---|
| StrikethroughMark | Component that holds the html that will wrap the content with strikethrough style. |
| StrikethroughKeyboardShortcut | Keyboard shortcut file that manipulates onKeyDown event inside SlateJS. |
| StrikethroughUtils | Generic file that holds the util common functions. |
| StrikethroughButton | Button component that have behaviour to wrap content with strikethrough style. |
TODO
- Make keyboard shortcut accepts customization
5.1.0
7 years ago
5.0.0
8 years ago
5.0.0-alpha.9e6f4feb
8 years ago
5.0.0-alpha.f4219f70
8 years ago
5.0.0-alpha.03550d1c
8 years ago
5.0.0-alpha.c75189d0
8 years ago
5.0.0-alpha.19a19572
8 years ago
5.0.0-alpha.f2d763f7
8 years ago
5.0.0-alpha.f7181996
8 years ago