react-codemirror2
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -189,6 +189,6 @@ 'use strict'; | ||
this.hydrated = false; | ||
} | ||
if (!this.props.resetCursorOnSet) { | ||
this.cursorPos = this.editor.getCursor(); | ||
} | ||
if (!this.props.resetCursorOnSet) { | ||
this.cursorPos = this.editor.getCursor(); | ||
} | ||
@@ -195,0 +195,0 @@ |
{ | ||
"name": "react-codemirror2", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "a tiny react codemirror component wrapper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,35 +52,6 @@ [](https://travis-ci.org/scniro/react-codemirror2) | ||
- `resetCursorOnSet` | ||
> `boolean` reset the internal codemirror cursor position should a new `value` prob be set. Default: `false` | ||
> `boolean` reset the internal codemirror cursor position should a new `value` prop be set. Default: `false` | ||
## component specific events | ||
## props cont. (wrapped codemirror [programming api](https://codemirror.net/doc/manual.html#api)) | ||
- `editorWillMount()` | ||
- `editorDidMount(editor, next)` | ||
> calling optional `next()` will trigger `editorDidConfigure` | ||
- `editorDidConfigure(editor)` | ||
- `onValueSet(editor, value)` | ||
> returns the initial value via `value` | ||
- `editorWillUnmount(editor)` | ||
## codemirror wrapped [events](https://codemirror.net/doc/manual.html#events) | ||
- `onValueChange(editor, metadata, value)` | ||
> returns the internal value of the editor | ||
- `onCursorActivity(editor)` | ||
- `onViewportChange(editor, viewportStart, viewportEnd)` | ||
- `onGutterClick(editor, lineNumber, event)` | ||
- `onFocus(editor, event)` | ||
- `onBlur(editor, event)` | ||
- `onUpdate(editor, event)` | ||
- `onKeyDown(editor, event)` | ||
- `onKeyUp(editor, event)` | ||
- `onKeyPress(editor, event)` | ||
- `onDragEnter(editor, event)` | ||
- `onDragOver(editor, event)` | ||
- `onDrop(editor, event)` | ||
- `onSelection(editor, ranges)` | ||
- `onScroll(editor, position)` | ||
- `onCursor(editor, position)` | ||
## prop wrapped codemirror [programming api](https://codemirror.net/doc/manual.html#api) | ||
- `selection={array<{anchor, head}>}` - *[setSelections](https://codemirror.net/doc/manual.html#setSelections)* | ||
@@ -123,8 +94,32 @@ > will programmatically select the ranges specified | ||
## events | ||
- `editorWillMount()` | ||
- `editorDidMount(editor, next)` | ||
> calling optional `next()` will trigger `editorDidConfigure` | ||
- `editorDidConfigure(editor)` | ||
- `onValueSet(editor, value)` | ||
> returns the initial value via `value` | ||
- `editorWillUnmount(editor)` | ||
## events cont. [wrapped codemirror events](https://codemirror.net/doc/manual.html#events) | ||
- `onValueChange(editor, metadata, value)` - *[change](https://codemirror.net/doc/manual.html#event_change)* | ||
> returns the internal value of the editor | ||
- `onCursorActivity(editor)` - *[cursorActivity](https://codemirror.net/doc/manual.html#event_cursorActivity)* | ||
- `onViewportChange(editor, viewportStart, viewportEnd)` - *[viewportChange](https://codemirror.net/doc/manual.html#event_viewportChange)* | ||
- `onGutterClick(editor, lineNumber, event)` - *[gutterClick](https://codemirror.net/doc/manual.html#event_gutterClick)* | ||
- `onFocus(editor, event)` - *[focus](https://codemirror.net/doc/manual.html#event_focus)* | ||
- `onBlur(editor, event)` - *[blur](https://codemirror.net/doc/manual.html#event_blur)* | ||
- `onUpdate(editor, event)` - *[update](https://codemirror.net/doc/manual.html#event_update)* | ||
- `onKeyDown(editor, event)` - *[keydown](https://codemirror.net/doc/manual.html#event_dom)* | ||
- `onKeyUp(editor, event)` - *[keyup](https://codemirror.net/doc/manual.html#event_dom)* | ||
- `onKeyPress(editor, event)` - *[keypress](https://codemirror.net/doc/manual.html#event_dom)* | ||
- `onDragEnter(editor, event)` - *[dragenter](https://codemirror.net/doc/manual.html#event_dom)* | ||
- `onDragOver(editor, event)` - *[dragover](https://codemirror.net/doc/manual.html#event_dom)* | ||
- `onDrop(editor, event)` - *[drop](https://codemirror.net/doc/manual.html#event_dom)* | ||
- `onSelection(editor, ranges)` - *[beforeSelectionChange](https://codemirror.net/doc/manual.html#event_doc_beforeSelectionChange)* | ||
- `onScroll(editor, position)` - *[scroll](https://codemirror.net/doc/manual.html#event_scroll)* | ||
- `onCursor(editor, position)`- *[cursorActivity](https://codemirror.net/doc/manual.html#event_doc_cursorActivity)* | ||
[MIT](./LICENSE) © 2017 [scniro](https://github.com/scniro) |
15850
123