1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 02:19:52 +02:00

update walkthroughs, docs and changelog

This commit is contained in:
Ian Storm Taylor
2017-10-16 21:13:07 -07:00
parent a9e037a6a7
commit 54ec11e199
8 changed files with 66 additions and 110 deletions

View File

@@ -50,7 +50,7 @@ class App extends React.Component {
}
// Define a new handler which prints the key that was pressed.
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
console.log(event.key)
}
@@ -84,7 +84,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
// Return with no changes if it's not the "&" key.
if (event.key != '&') return

View File

@@ -27,7 +27,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (event.key != '`' || !event.metaKey) return
event.preventDefault()
const isCode = change.state.blocks.some(block => block.type == 'code')
@@ -68,7 +68,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (!event.metaKey) return
// Decide what to do based on the key code...
@@ -144,7 +144,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (!event.metaKey) return
switch (event.key) {

View File

@@ -22,7 +22,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (event.key != '&') return
event.preventDefault()
change.insertText('and');
@@ -84,7 +84,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (event.key != '&') return
event.preventDefault()
change.insertText('and')
@@ -128,7 +128,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
// Return with no changes if it's not the "`" key with cmd/ctrl pressed.
if (event.key != '`' || !event.metaKey) return
@@ -178,7 +178,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (event.key != '`' || !event.metaKey) return
event.preventDefault()

View File

@@ -29,7 +29,7 @@ class App extends React.Component {
this.setState({ state })
}
onKeyDown = (event, data, change) => {
onKeyDown = (event, change) => {
if (event.key != 'b' || !event.metaKey) return
event.preventDefault()
change.toggleMark('bold')
@@ -71,7 +71,7 @@ function MarkHotkey(options) {
// Return our "plugin" object, containing the `onKeyDown` handler.
return {
onKeyDown(event, data, change) {
onKeyDown(event, change) {
// Check that the key pressed matches our `key` option.
if (!event.metaKey || event.key != key) return