{"version":3,"sources":["../src/index.js"],"names":["Index","props","state","value","handleChangeValue","bind","handleChangeSubmit","setState","console","log","text","files","loading","setTimeout","msg","response","status","Promise","resolve","Component","ReactDOM","render","document","getElementById"],"mappings":";;;;AAAA;;;;AACA;;;;AAIA;;;;AACA;;;;;;;;;;;AAJA;AACA;AACA;;;IAIMA,K;;;AACJ,iBAAYC,KAAZ,EAAmB;AAAA;;AAAA,8GACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,aAAO;AADI,KAAb;AAGA,UAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBC,IAAvB,OAAzB;AACA,UAAKC,kBAAL,GAA0B,MAAKA,kBAAL,CAAwBD,IAAxB,OAA1B;AANiB;AAOlB;;;;sCAEiBF,K,EAAO;AACvB,WAAKI,QAAL,CAAc,EAAEJ,YAAF,EAAd;AACAK,cAAQC,GAAR,CAAY,2BAAZ,EAAyCN,KAAzC;AACD;;;6CAEmC;AAAA;;AAAA,UAAfO,IAAe,QAAfA,IAAe;AAAA,UAATC,KAAS,QAATA,KAAS;;AAClC,WAAKJ,QAAL,CAAc,EAAEK,SAAS,IAAX,EAAd,EAAiC,YAAM;AACrCC,mBAAW,YAAM;AACf,iBAAKN,QAAL,CAAc,EAAEK,SAAS,KAAX,EAAd;AACD,SAFD,EAEG,IAFH;AAGD,OAJD;AAKAJ,cAAQC,GAAR,CAAY,eAAZ,EAA6BC,IAA7B;AACAF,cAAQC,GAAR,CAAY,gBAAZ,EAA8BE,KAA9B;AACD;;;6BAEQ;AACP;AACA,aACE;AAAC,qBAAD;AAAA;AACE,gBAAM,CADR;AAEE,sBAAW,MAFb;AAGE,gCAHF;AAIE,8BAJF;AAKE,8BALF;AAME,qBAAW,KANb;AAOE,kBAAQ,KAPV;AAQE,oBAAS,YARX;AASE,mBAAS,iBAACG,GAAD,SAAuB;AAAA,gBAAfC,QAAe,SAAfA,QAAe;;AAC9B,gBAAIA,SAASC,MAAT,KAAoB,GAAxB,EAA6B;AAC3BR,sBAAQC,GAAR,CAAY,WAAZ;AACD;AACDD,oBAAQC,GAAR,iBAA0BK,GAA1B;AACD;AAdH;AAgBE,sCAAC,WAAD;AACE,qBAAW,CADb;AAEE,yBAFF;AAGE,wBAAc,wBAAM;AAClB,mBAAO,IAAIG,OAAJ,CAAY,mBAAW;AAC5BC,sBAAQ,IAAR;AACD,aAFM,CAAP;AAGD,WAPH;AAQE,4BAAkB,4BAAM;AACtBV,oBAAQC,GAAR,CAAY,MAAZ;AACD,WAVH;AAWE,qBAAW,KAXb;AAYE,mBAAS,iBAACK,GAAD,SAAuB;AAAA,gBAAfC,QAAe,SAAfA,QAAe;;AAC9B,gBAAIA,SAASC,MAAT,KAAoB,GAAxB,EAA6B;AAC3BR,sBAAQC,GAAR,CAAY,WAAZ;AACD;AACDD,oBAAQC,GAAR,iBAA0BK,GAA1B;AACD;AAjBH;AAhBF,OADF;;AAuCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACD;;;;EAzGiBK,gB;;AA4GpBC,mBAASC,MAAT,CAAgB,8BAAC,KAAD,OAAhB,EAA2BC,SAASC,cAAT,CAAwB,cAAxB,CAA3B;AACA","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\n// e.g.\r\n// import { Button, Icon } from \"antd\";\r\n// import App, { Editor, RenderText } from \"./App\";\r\nimport App, { Editor } from \"./App\";\r\nimport registerServiceWorker from \"./registerServiceWorker\";\r\n\r\nclass Index extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n value: \"\"\r\n };\r\n this.handleChangeValue = this.handleChangeValue.bind(this);\r\n this.handleChangeSubmit = this.handleChangeSubmit.bind(this);\r\n }\r\n\r\n handleChangeValue(value) {\r\n this.setState({ value });\r\n console.log(\"handleChangeValue value: \", value);\r\n }\r\n\r\n handleChangeSubmit({ text, files }) {\r\n this.setState({ loading: true }, () => {\r\n setTimeout(() => {\r\n this.setState({ loading: false });\r\n }, 2000);\r\n });\r\n console.log(\"submit text: \", text);\r\n console.log(\"submit files: \", files);\r\n }\r\n\r\n render() {\r\n // 最简单的用法\r\n return (\r\n {\r\n if (response.status === 401) {\r\n console.log(\"unlogined\");\r\n }\r\n console.log(`-----------${msg}`);\r\n }}\r\n >\r\n {\r\n return new Promise(resolve => {\r\n resolve(true);\r\n });\r\n }}\r\n onCommentSuccess={() => {\r\n console.log(\"succ\");\r\n }}\r\n showError={false}\r\n onError={(msg, { response }) => {\r\n if (response.status === 401) {\r\n console.log(\"unlogined\");\r\n }\r\n console.log(`-----------${msg}`);\r\n }}\r\n />\r\n \r\n );\r\n\r\n // e.g.\r\n // 复杂的用户法\r\n // const props = {\r\n // type: 1,\r\n // businessId: \"1\",\r\n // API: \"http://api.links123.net/comment/v1\",\r\n // showList: true\r\n // };\r\n\r\n // const editorProps = {\r\n // showEmoji: true,\r\n // placeholder: \"说点什么吧\",\r\n // rows: 5,\r\n // btnLoading: this.state.loading,\r\n // btnDisable: this.state.loading,\r\n // btnSubmitText: \"提交\",\r\n // value: this.state.value,\r\n // onChange: v => this.handleChangeValue(v),\r\n // onSubmit: v => this.handleChangeSubmit(v),\r\n // button: (\r\n // \r\n // ),\r\n // emojiToolIcon: ,\r\n // imageToolIcon: (\r\n // \r\n // )\r\n // };\r\n\r\n // return (\r\n // \r\n // \r\n // \r\n // );\r\n }\r\n}\r\n\r\nReactDOM.render(, document.getElementById(\"root-comment\"));\r\nregisterServiceWorker();\r\n"]}