{"name":"for-editor","version":"0.2.9","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/react":"^16.8.16","@types/react-dom":"^16.8.4","autoprefixer":"^9.5.1","babel-core":"^7.0.0-bridge.0","babel-eslint":"^10.0.1","babel-loader":"^8.0.4","classnames":"^2.2.6","clean-webpack-plugin":"^3.0.0","css-loader":"^2.0.2","eslint":"^5.12.0","eslint-config-prettier":"^3.3.0","eslint-plugin-prettier":"^3.0.0","eslint-plugin-react":"^7.12.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.4.5","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":"45352d01f89995a1720330a47ed33cfa33703948","_id":"for-editor@0.2.9","_nodeVersion":"10.15.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-xD4syLKckNIoN2Fagasv6SKCsYGVBNqZeEsD8yNxRFfLc+w1RZLPe8P5LTB6bQflDXrvC3p1MdqWswBQ7mvdcg==","shasum":"35b3d2980e0a7b006ee2431ecca4a898ab0e0129","tarball":"http://registry-npm.ywwl.com/for-editor/download/for-editor-0.2.9.tgz","fileCount":9,"unpackedSize":122965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHZWJCRA9TVsSAnZWagAAui8P/3jgcD3/sP050tGclrdp\n4rXMq9vz+S9K7A7HvJsI0uIy7xxiC+WjoRAM/4N11SLp6PxMoaHVDqhXfaAh\nXknQKO/ghd2smpOA1w9e7xciRGVXKZ/IrsogU9RShQLXMiero1ZmZGOG0oIF\nPO6leGrRI8WlMYOMpb0LE+mOY4v9gP32wzlf5bPWXMyzu+b6dgsb1Cy3AtiL\nBhzO94+ZxGcadofPmxBLhqn4tyalUDAbOArPtDjyqFVomgAGUOU6zErvK1s1\n/lP7bKnSJyBj+4A6jPV9VpjluTO5OsCE7VOqdZheDbh5Kz0o4fN01cUfldSr\ntI4DeVj5QEJcs2WTI0LurOaUxu5jaRRYqMa7acrnoQUDeM1xiPK+HX3c0n25\n8tj+vbO4ptF62VInBrz2nCrj76WJVprYXapNc022OOlwot/eVEzRfwIBk2uw\nxYMLNXUdYF3FcE4uY517N1/FKhFUNDzDbw6Tp9r0ROMJNwyWwXa3ZKMGHYpc\nYB49BmN1ZE3seFSKHmgZBmQ8tjELubNhRIMvf1D6Ba1fa6VI6k1tdzHnk49F\nWfrLYvxCOuzCI9oVxfIQxTsaXNWO9QBPF3DzYAgz04UTvQ1q04yn7GenOCDQ\nfn5+hGj5T0xcBbbAaHYKp3XUrp4Drs5MrQRTSMPCBxR3mMPJFwCLjq0g9XR5\ni/e3\r\n=8RmU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDex1jFLh6HG2hOb/exG31OYEfVPCcXSZ3YmrLJnFVCfwIhAM3q3g7Nm13Ie+Me7Bf5qlJUzy0cqTWzFbR31HK1vrQB"}],"size":43629,"noattachment":false,"key":"/for-editor/-/for-editor-0.2.9.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.2.9_1562219908346_0.8548216986057191"},"_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":1562219908516,"_cnpm_publish_time":1562219908516,"dist-tags":{"latest":"0.3.5"}}