{"name":"for-editor","version":"0.3.5","description":"react markdown editor","main":"dist/index.js","scripts":{"start":"npm run dev","dev":"webpack-dev-server --config webpack/webpack.dev.config.js","build":"webpack --config webpack/webpack.prod.config.js","dist":"webpack --config webpack/webpack.dist.config.js","lint":"eslint --ext .js,.jsx --ignore-path .gitignore ."},"repository":{"type":"git","url":"git+https://github.com/kkfor/for-editor.git"},"keywords":["javascript","react","markdown","editor"],"author":{"name":"kkfor"},"license":"MIT","bugs":{"url":"https://github.com/kkfor/for-editor/issues"},"homepage":"https://github.com/kkfor/for-editor#readme","devDependencies":{"@babel/core":"^7.2.2","@babel/plugin-proposal-class-properties":"^7.2.3","@babel/preset-env":"^7.2.3","@babel/preset-react":"^7.0.0","@types/classnames":"^2.2.9","@types/marked":"^0.6.5","@types/react":"^16.8.16","@types/react-dom":"^16.8.4","@typescript-eslint/eslint-plugin":"^1.13.0","@typescript-eslint/parser":"^1.13.0","autoprefixer":"^9.5.1","babel-core":"^7.0.0-bridge.0","babel-eslint":"^10.0.2","babel-loader":"^8.0.4","classnames":"^2.2.6","clean-webpack-plugin":"^3.0.0","css-loader":"^2.0.2","css-modules-typescript-loader":"^2.0.4","eslint":"^6.1.0","eslint-config-for":"^0.0.1","eslint-plugin-react":"^7.14.3","file-loader":"^4.0.0","html-webpack-plugin":"^3.2.0","node-sass":"^4.11.0","postcss-loader":"^3.0.0","prettier":"^1.15.3","raw-loader":"^3.0.0","react":"^16.7.0","react-dom":"^16.7.0","sass-loader":"^7.1.0","style-loader":"^0.23.1","ts-loader":"^6.0.0","typescript":"^3.5.3","uglifyjs-webpack-plugin":"^2.1.0","webpack":"^4.28.1","webpack-cli":"^3.1.2","webpack-dev-server":"^3.1.10","webpack-merge":"^4.1.5"},"dependencies":{"highlight.js":"^9.13.1","marked":"^0.6.2"},"gitHead":"881399ddfd11609eab7a436085749f5b6e6d5394","_id":"for-editor@0.3.5","_nodeVersion":"10.15.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-yqhn+5do4+i0rgVt87GXnBEJRsC0vJjovQMnT1TsBwz6FUKhECEZdL+QUSGvxc4q71ajGc2zhIpe1YAHFjwegw==","shasum":"f2b91026cc920b2d3d631b4db1a491b6f4fa25ff","tarball":"http://registry-npm.ywwl.com/for-editor/download/for-editor-0.3.5.tgz","fileCount":10,"unpackedSize":128260,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8ItPCRA9TVsSAnZWagAAo7MP/24jVnNLvTo+Bw/q855W\nr2KiyDSGIVDvpjmiBFrINLkguIfSj548DraQkE+amqwJu0xDLH3c1G3HzeR+\noP2RCisRxedQjq9VtStUbfHlt9PWkOI+VYPwTPQRGNo1MLgCAJsqEIP5litx\ne0hju3W+ZjboS03Ug6bb6cVUsAn6yB9IwNXzdE2runDCwvGUOvSbv5UITpgR\nWBD2Sa++0Tmqs6ib72opQiADdqKywU8zgVky9CYlgiM1u0ouDWbUj3NtTvC9\nKOXyS72Wv5FGuOvYhoZrwqVb1gLAud2xNUCZvn5bTlXeIZN46T5eoTHY0sa3\nuf+otBNptmmHw5k7OGx7rWBcYNYE/nvi0DvE6+k/09r1iqSZp180xt+GD1td\n56Dr/mbAtG993VLK5ZTt8YWyW8J7i3H76ll3tWGf7/RB2gHwk0iHkG8xROBw\nrmLkABVbd9FzYeQwT8TXdO36UxgVc2mCWgaKe7BfF4/e5Fpk/C+Jh8Y40bLT\nqVzkv/HMxzA0H8neEjmWP5xy3fpyXXNLEUH6jckt2IzJg48GhVTTc69Nd47o\nUDNbAGMFIR/MfjLvufjrG3k3lJFgiwhFBFwSZjwXxgWM7fngNSHMbsDoVDOA\nxwPjOhhxHh3kwa0Gtbtz5ToX8WLv/mGVs1Tj92cV5naUAyJBwTmLK/UcjcFv\nRXXh\r\n=ooIq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMiU1MRie8erDKA3lE8aH8RqNNWwnz2pZf8GUY93QjlgIgB3L96aOtddypUicczVQLxWfVNlJDuRUemX4jAXP3+jc="}],"size":44827,"noattachment":false,"key":"/for-editor/-/for-editor-0.3.5.tgz"},"maintainers":[{"name":"kkfor","email":"kkfor@foxmail.com"}],"_npmUser":{"name":"kkfor","email":"kkfor@foxmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/for-editor_0.3.5_1576045391524_0.5189624155151573"},"_hasShrinkwrap":false,"readme":"# for-editor\n\n> for-editor-A markdown editor based on React\n\n- [demo](https://md.kkfor.com)\n- [github](https://github.com/kkfor/for-editor)\n\n### Install\n\n```js\nnpm install for-editor -S\n```\n\n### Use\n\n```js\nimport React, { Component } from 'react'\nimport ReactDOM from 'react-dom'\nimport Editor from 'for-editor'\n\nclass App extends Component {\n  constructor() {\n    super()\n    this.state = {\n      value: ''\n    }\n  }\n\n  handleChange(value) {\n    this.setState({\n      value\n    })\n  }\n\n  render() {\n    const { value } = this.state\n    return <Editor value={value} onChange={() => this.handleChange()} />\n  }\n}\n\nReactDOM.render(<App />, document.getElementById('root'))\n```\n\n### Api\n\n#### props\n\n| name        | type    | default                     | description                                                                                            |\n| ----------- | ------- | --------------------------- | ------------------------------------------------------------------------------------------------------ |\n| value       | String  | -                           | value                                                                                                  |\n| language    | String  | zh-CN                       | Language switch, zh-CN: Simplified Chinese, en: English                                                |\n| placeholder | String  | Begin editing...            | The default prompt text when the textarea is empty                                                     |\n| lineNum     | Boolean | true                        | Show lineNum                                                                                           |\n| style       | Object  | -                           | editor styles                                                                                          |\n| height      | String  | 600px                       | editor height                                                                                          |\n| preview     | Boolean | false                       | preview switch                                                                                         |\n| expand      | Boolean | false                       | fullscreen switch                                                                                      |\n| subfield    | Boolean | false                       | true: Double columns - Edit preview same screen(notice: preview: true), Single Columns - otherwise not |\n| toolbar     | Object  | As in the following example | toolbars                                                                                               |\n\n```js\n/*\n  The default toolbar properties are all true,\n  You can customize the object to cover them.\n  eg: {\n    h1: true,\n    code: true,\n    preview: true,\n  }\n  At this point, the toolbar only displays the three function keys.\n  notice: Toolbar will be hidden when empty object.\n */\n\ntoolbar: {\n  h1: true,\n  h2: true,\n  h3: true,\n  h4: true,\n  img: true,\n  link: true,\n  code: true,\n  preview: true,\n  expand: true,\n  /* v0.0.9 */\n  undo: true,\n  redo: true,\n  save: true,\n  /* v0.2.3 */\n  subfield: true\n}\n```\n\n#### events\n\n| name     | params        | default | description                                 |\n| -------- | ------------- | ------- | ------------------------------------------- |\n| onChange | String: value | -       | Edit area change callback event             |\n| onSave   | String: value | -       | Ctrl+s and click save button callback event |\n| addImg   | File: file    | -       | upload image callback event                 |\n\n##### upload image\n\n```js\nclass App extends Component {\n  constructor() {\n    super()\n    this.state = {\n      value: ''\n    }\n    this.$vm = React.createRef()\n  }\n\n  handleChange(value) {\n    this.setState({\n      value\n    })\n  }\n\n  addImg($file) {\n    this.$vm.current.$img2Url($file.name, 'file_url')\n    console.log($file)\n  }\n\n  render() {\n    const { value } = this.state\n\n    return (\n      <Editor\n        ref={this.$vm}\n        value={value}\n        addImg={($file) => this.addImg($file)}\n        onChange={(value) => this.handleChange(value)}\n      />\n    )\n  }\n}\n```\n\n#### hot key\n\n| name   | description |\n| ------ | ----------- |\n| tab    | two space   |\n| ctrl+s | save        |\n| ctrl+z | undo        |\n| ctrl+y | redo        |\n\n### Update\n\n- [Update Log](./doc/UPDATELOG.md)\n\n# Licence\n\nfor-editor is [MIT Licence](./LICENSE).\n","publish_time":1576045391662,"_cnpm_publish_time":1576045391662,"dist-tags":{"latest":"0.3.5"}}