2.0.2 • Published 9 years ago

apeman-react-editor v2.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

apeman-react-editor

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for WYSIWYG editors

Installation

$ npm install apeman-react-editor --save

Demo

Live demo is hosted on GitHub Pages.

Usage

'use strict'

import React from 'react'
import {ApEditor, ApEditorStyle} from 'apeman-react-editor'

const ExampleComponent = React.createClass({
  getInitialState () {
    return {
      value: `
/** This is a comment */
function hoge() { return "This is hoge" }

let h = hoge ()
`
    }
  },
  render () {
    return (
      <div>
        <ApEditorStyle highlightColor="#b35600"/>
        <ApEditor value={ state.value }
                  mode="javascript"
                  onChange={ (e) => s.setState({value: e.value}) }
        />
      </div>
    )
  }
})

Components

ApEditorStyle

Props

NameTypeDefaultDescription
styleobject{}
highlightColorstringApStyle.DEFAULT_HIGHLIGHT_COLOR
errorColorstringApStyle.ERROR_COLOR
backgroundColorApStyle.DEFAULT_BACKGROUND_COLOR

ApEditor

Props

NameTypeDefaultDescription
modestring'javascript'Editor mode
codemirrorobjectnullCode mirror class
valuestringEditting value
onChangefuncnullCallback for text change
editorReffuncnullCallback for code mirror instance
lineNumbersboolfalseShow line numbers
errorstringobjectError message
onErrorTapfuncHandler for error tap
spinningboolfalseShow spinner

License

This software is released under the MIT License.

Links

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago