通用评论

index.js 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _button = require("antd/es/button");
  6. var _button2 = _interopRequireDefault(_button);
  7. var _popover = require("antd/es/popover");
  8. var _popover2 = _interopRequireDefault(_popover);
  9. var _icon = require("antd/es/icon");
  10. var _icon2 = _interopRequireDefault(_icon);
  11. var _message2 = require("antd/es/message");
  12. var _message3 = _interopRequireDefault(_message2);
  13. var _input = require("antd/es/input");
  14. var _input2 = _interopRequireDefault(_input);
  15. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16. require("antd/es/button/style");
  17. require("antd/es/popover/style");
  18. require("antd/es/icon/style");
  19. require("antd/es/message/style");
  20. require("antd/es/input/style");
  21. var _dayjs = require("dayjs");
  22. var _dayjs2 = _interopRequireDefault(_dayjs);
  23. var _shortid = require("shortid");
  24. var _shortid2 = _interopRequireDefault(_shortid);
  25. var _propTypes = require("prop-types");
  26. var _propTypes2 = _interopRequireDefault(_propTypes);
  27. var _classnames = require("classnames");
  28. var _classnames2 = _interopRequireDefault(_classnames);
  29. var _react = require("react");
  30. var _react2 = _interopRequireDefault(_react);
  31. var _reactIntlUniversal = require("react-intl-universal");
  32. var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
  33. var _Emoji = require("./Emoji");
  34. var _Emoji2 = _interopRequireDefault(_Emoji);
  35. var _Upload = require("./Upload");
  36. var _Upload2 = _interopRequireDefault(_Upload);
  37. var _Comment = require("../../Comment");
  38. var _Comment2 = _interopRequireDefault(_Comment);
  39. var _utils = require("./../../utils");
  40. var _constant = require("../../constant");
  41. var _helper = require("../../helper");
  42. require("./index.css");
  43. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  44. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  46. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  47. var TextArea = _input2.default.TextArea;
  48. var client = function client(oss) {
  49. return new window.OSS.Wrapper({
  50. accessKeyId: oss.access_key_id,
  51. accessKeySecret: oss.access_key_secret,
  52. stsToken: oss.security_token,
  53. endpoint: _constant.OSS_ENDPOINT, //常量,你可以自己定义
  54. bucket: _constant.OSS_BUCKET
  55. });
  56. };
  57. var uploadPath = function uploadPath(path, file) {
  58. return path + "/" + (0, _dayjs2.default)().format("YYYYMMDD") + "/" + _shortid2.default.generate() + "." + file.type.split("/")[1];
  59. };
  60. var UploadToOss = function UploadToOss(oss, path, file) {
  61. var url = uploadPath(path, file);
  62. return new Promise(function (resolve, reject) {
  63. client(oss).multipartUpload(url, file).then(function (data) {
  64. resolve(data);
  65. }).catch(function (error) {
  66. reject(error);
  67. });
  68. });
  69. };
  70. var Editor = function (_React$Component) {
  71. _inherits(Editor, _React$Component);
  72. function Editor(props) {
  73. _classCallCheck(this, Editor);
  74. var _this = _possibleConstructorReturn(this, (Editor.__proto__ || Object.getPrototypeOf(Editor)).call(this, props));
  75. _this.state = {
  76. showUpload: false,
  77. value: props.value || "", // 编辑器里面的值
  78. fileList: props.fileList || [], // 图片列表
  79. fileMap: {}, // 已经上传的图片路径和 uid 的映射 { uid: path }
  80. uploadVisible: false
  81. };
  82. _this.handleChange = _this.handleChange.bind(_this);
  83. _this.handleClickEmoji = _this.handleClickEmoji.bind(_this);
  84. _this.handleChangeFileList = _this.handleChangeFileList.bind(_this);
  85. _this.handleShowUpload = _this.handleShowUpload.bind(_this);
  86. _this.handleUpload = _this.handleUpload.bind(_this);
  87. _this.handleSubmit = _this.handleSubmit.bind(_this);
  88. _this.handlePaste = _this.handlePaste.bind(_this);
  89. _this.resetState = _this.resetState.bind(_this);
  90. _this.handleEmojiScroll = _this.handleEmojiScroll.bind(_this);
  91. _this.handlePressEnter = _this.handlePressEnter.bind(_this);
  92. _this.invokeFileListChange = _this.invokeFileListChange.bind(_this);
  93. return _this;
  94. }
  95. _createClass(Editor, [{
  96. key: "componentDidMount",
  97. value: function componentDidMount() {
  98. var _props = this.props,
  99. app = _props.app,
  100. onRef = _props.onRef;
  101. if (app.currentUser && (app.currentUser.user_id > 0 || app.currentUser.id > 0)) {
  102. app.sOssSts();
  103. }
  104. if ((0, _helper.isFunction)(onRef)) {
  105. onRef(this);
  106. }
  107. }
  108. }, {
  109. key: "handleEmojiScroll",
  110. value: function handleEmojiScroll(e) {
  111. if (!this.emoji) {
  112. return;
  113. }
  114. e.preventDefault();
  115. if (e.deltaY > 0) {
  116. this.emoji.next();
  117. } else if (e.deltaY < 0) {
  118. this.emoji.prev();
  119. }
  120. }
  121. /**
  122. * 编辑器的值改变事件
  123. * 将最新的值存储到 state 中
  124. * @param {string} value 输入的值
  125. */
  126. }, {
  127. key: "handleChange",
  128. value: function handleChange(value) {
  129. this.setState({ value: value });
  130. if (this.props.onChange) {
  131. this.props.onChange(value);
  132. }
  133. }
  134. /**
  135. * 点击 emoji 的事件
  136. * 点击后,需要将改 emoji 插入到编辑器中
  137. * 插入的值为 [emoji chinese name]
  138. * 参数 emoji 即为 emoji chinese name
  139. * @param {string}} emoji emoji 的中文,如 微笑
  140. */
  141. }, {
  142. key: "handleClickEmoji",
  143. value: function handleClickEmoji(emoji) {
  144. var value = this.props.value || this.state.value;
  145. value += "[" + emoji + "]";
  146. this.handleChange(value);
  147. }
  148. /**
  149. * 监听文件列表改变事件
  150. * @param {Array} fileList 文件列表
  151. */
  152. }, {
  153. key: "handleChangeFileList",
  154. value: function handleChangeFileList(fileList) {
  155. var list = fileList;
  156. if (fileList.length > this.props.maxUpload) {
  157. list = fileList.slice(0, this.props.maxUpload);
  158. }
  159. this.invokeFileListChange(list);
  160. }
  161. /**
  162. * 控制上传 Popover 的显示和隐藏
  163. * @param {boolean} showUpload 是否显示上传的 Popover
  164. */
  165. }, {
  166. key: "handleShowUpload",
  167. value: function handleShowUpload(showUpload) {
  168. if (typeof showUpload === "boolean") {
  169. this.setState({ showUpload: showUpload });
  170. } else {
  171. this.setState({ showUpload: !this.state.showUpload });
  172. }
  173. }
  174. /**
  175. * 上传文件
  176. * @param {object} param 文件对象
  177. */
  178. }, {
  179. key: "handleUpload",
  180. value: function handleUpload(_ref) {
  181. var uid = _ref.uid,
  182. path = _ref.path;
  183. var fileMap = this.state.fileMap;
  184. var fileList = this.state.fileList;
  185. fileMap[uid] = path;
  186. fileList = fileList.map(function (item) {
  187. if (item.uid === uid) {
  188. item.thumbUrl = _constant.OSS_LINK + path;
  189. }
  190. return item;
  191. });
  192. this.setState({ fileMap: fileMap });
  193. this.invokeFileListChange(fileList);
  194. }
  195. /**
  196. * **统一处理fileList的修改**
  197. * 1. upload
  198. * 2. paste
  199. * PS: 移动端需要做额外操作
  200. * -- evo 20200223
  201. */
  202. }, {
  203. key: "invokeFileListChange",
  204. value: function invokeFileListChange(fileList) {
  205. this.props.handleChangeFileList(fileList);
  206. this.setState({ fileList: fileList });
  207. if (_utils.isMobile) {
  208. var file = fileList[0];
  209. if (file && file.status === 'done' && !file.thumbUrl.includes('data:image')) {
  210. this.setState({ uploadVisible: false });
  211. }
  212. }
  213. }
  214. }, {
  215. key: "handlePaste",
  216. /**
  217. * 粘贴回调
  218. */
  219. value: function handlePaste(e) {
  220. var _this2 = this;
  221. if (this.state.fileList.length >= this.props.maxUpload) {
  222. return;
  223. }
  224. var items = e.clipboardData && e.clipboardData.items;
  225. var file = null;
  226. if (items && items.length) {
  227. for (var i = 0; i < items.length; i++) {
  228. if (items[i].type.indexOf("image") !== -1) {
  229. file = items[i].getAsFile();
  230. break;
  231. }
  232. }
  233. if (file === null) return;
  234. }
  235. this.setState({
  236. uploadVisible: true
  237. });
  238. var reader = new FileReader();
  239. reader.readAsDataURL(file);
  240. reader.onloadend = function () {
  241. // DRIVER_LICENSE_PATH oss 的存储路径位置
  242. UploadToOss(_this2.props.app.oss, _constant.DRIVER_LICENSE_PATH, file).then(function (data) {
  243. var fileList = _this2.state.fileList.concat({
  244. url: _constant.OSS_LINK + data.name,
  245. thumbUrl: _constant.OSS_LINK + data.name,
  246. type: file.type,
  247. uid: new Date().valueOf()
  248. });
  249. _this2.invokeFileListChange(fileList);
  250. }).catch(function (e) {
  251. var msg = e.message || _constant.ERROR_DEFAULT;
  252. if (_this2.props.showError) {
  253. _message3.default.error(msg);
  254. }
  255. if (_this2.props.onError) {
  256. _this2.props.onError(msg, { response: e.response });
  257. }
  258. });
  259. };
  260. }
  261. /**
  262. * 提交编辑器内容
  263. * 提交功能,交给父组件来实现
  264. * 需要父组件传入 onSubmit
  265. */
  266. }, {
  267. key: "handleSubmit",
  268. value: function handleSubmit() {
  269. var _this3 = this;
  270. var maxLength = this.props.maxLength;
  271. var _state = this.state,
  272. value = _state.value,
  273. fileMap = _state.fileMap,
  274. fileList = _state.fileList;
  275. if (value.length > maxLength) {
  276. // message.error(`字数不得超过${maxLength}字`);
  277. _message3.default.error(_reactIntlUniversal2.default.get("editor.maxLength", { maxLength: maxLength }));
  278. return;
  279. }
  280. var files = [];
  281. if (fileList.length) {
  282. fileList.forEach(function (item) {
  283. if (item.url) {
  284. files.push(item.url);
  285. return;
  286. }
  287. if (!fileMap[item.uid]) {
  288. return;
  289. }
  290. files.push("" + _constant.OSS_LINK + fileMap[item.uid]);
  291. });
  292. }
  293. if (this.props.beforeSubmit) {
  294. Promise.resolve(this.props.beforeSubmit({ text: value, files: files })).then(function (res) {
  295. if (!(res === false)) {
  296. _this3.props.onSubmit({ text: value, files: files }, function (res, action) {
  297. _this3.resetState();
  298. if (action === "comment" && _this3.props.onCommentSuccess) {
  299. _this3.props.onCommentSuccess(res);
  300. }
  301. });
  302. }
  303. });
  304. } else {
  305. this.props.onSubmit({ text: value, files: files }, function (res, action) {
  306. _this3.resetState();
  307. if (action === "comment" && _this3.props.onCommentSuccess) {
  308. _this3.props.onCommentSuccess(res);
  309. }
  310. });
  311. }
  312. }
  313. }, {
  314. key: "resetState",
  315. value: function resetState() {
  316. this.handleChange("");
  317. this.handleChangeFileList([]);
  318. this.setState({
  319. showUpload: false,
  320. value: "",
  321. fileList: [],
  322. fileMap: {}
  323. });
  324. }
  325. }, {
  326. key: "checkDisabledSubmit",
  327. value: function checkDisabledSubmit() {
  328. var _props2 = this.props,
  329. btnDisabled = _props2.btnDisabled,
  330. value = _props2.value,
  331. fileList = _props2.fileList;
  332. if (btnDisabled) {
  333. return true;
  334. }
  335. if (value && value !== "") {
  336. return false;
  337. }
  338. if (this.state.value && this.state.value !== "") {
  339. return false;
  340. }
  341. if (fileList && fileList.length > 0) {
  342. return false;
  343. }
  344. if (this.state.fileList.length > 0) {
  345. return false;
  346. }
  347. return true;
  348. }
  349. /**
  350. * **处理Enter事件**
  351. * 1. `allowEnterSubmit`为true时enter触发submit事件
  352. * 2. `e.preventDefault`为了防止enter事件后仍触发换行
  353. * 3. enter事件开启后,仍可以用`shift + enter`触发换行
  354. * -- evo 20200222
  355. */
  356. }, {
  357. key: "handlePressEnter",
  358. value: function handlePressEnter(e) {
  359. if (this.props.allowEnterSubmit) {
  360. if (!e.shiftKey) {
  361. e.preventDefault();
  362. this.handleSubmit();
  363. }
  364. }
  365. }
  366. }, {
  367. key: "render",
  368. value: function render() {
  369. var _this4 = this;
  370. var _props3 = this.props,
  371. value = _props3.value,
  372. rows = _props3.rows,
  373. showEmoji = _props3.showEmoji,
  374. showUpload = _props3.showUpload,
  375. multiple = _props3.multiple,
  376. emojiPopoverPlacement = _props3.emojiPopoverPlacement,
  377. uploadPopoverPlacement = _props3.uploadPopoverPlacement,
  378. uploadOverlayClassName = _props3.uploadOverlayClassName,
  379. fileList = _props3.fileList,
  380. maxUpload = _props3.maxUpload,
  381. btnLoading = _props3.btnLoading,
  382. button = _props3.button,
  383. emojiToolIcon = _props3.emojiToolIcon,
  384. imageToolIcon = _props3.imageToolIcon,
  385. maxLength = _props3.maxLength,
  386. autoFocus = _props3.autoFocus,
  387. app = _props3.app;
  388. var placeholder = this.props.placeholder || _reactIntlUniversal2.default.get("editor.placeholder");
  389. var btnSubmitText = this.props.btnSubmitText || _reactIntlUniversal2.default.get("editor.SubmitBtn");
  390. var handleSubmit = this.handleSubmit;
  391. var disabledSubmit = this.checkDisabledSubmit();
  392. var inputValue = value || this.state.value;
  393. var uploadFileList = fileList || this.state.fileList;
  394. var isLogin = app.currentUser && (app.currentUser.user_id > 0 || app.currentUser.id > 0);
  395. return _react2.default.createElement(
  396. "div",
  397. { className: "comment-editor-container", onPaste: this.handlePaste },
  398. isLogin ? _react2.default.createElement(
  399. _react.Fragment,
  400. null,
  401. _react2.default.createElement("div", {
  402. className: (0, _classnames2.default)({
  403. "comment-editor-toolbar": true,
  404. "comment-editor-toolbar-error": inputValue.length > maxLength
  405. })
  406. }),
  407. _react2.default.createElement(
  408. "div",
  409. { className: "comment-editor" },
  410. _react2.default.createElement(TextArea, {
  411. value: inputValue,
  412. onChange: function onChange(e) {
  413. _this4.handleChange(e.target.value);
  414. },
  415. rows: rows,
  416. placeholder: placeholder,
  417. autoFocus: autoFocus,
  418. onPressEnter: this.handlePressEnter
  419. }),
  420. _react2.default.createElement(
  421. "div",
  422. { className: "comment-toolbar" },
  423. _react2.default.createElement(
  424. "div",
  425. { className: "comment-toolbar-left" },
  426. showEmoji && _react2.default.createElement(
  427. _popover2.default,
  428. {
  429. trigger: "click",
  430. placement: emojiPopoverPlacement,
  431. autoAdjustOverflow: false,
  432. overlayStyle: { zIndex: 9999 },
  433. content: _react2.default.createElement(
  434. "div",
  435. {
  436. style: { width: 240, height: 205 },
  437. onWheel: this.handleEmojiScroll
  438. },
  439. _react2.default.createElement(_Emoji2.default, {
  440. onClick: this.handleClickEmoji,
  441. ref: function ref(node) {
  442. _this4.emoji = node;
  443. },
  444. emojiList: this.props.app.emojiList
  445. })
  446. ),
  447. overlayClassName: "comment-emoji-popover"
  448. },
  449. emojiToolIcon || _react2.default.createElement(_icon2.default, { type: "smile-o", className: "comment-toolbar-icon" })
  450. ),
  451. showUpload ? _react2.default.createElement(
  452. _popover2.default,
  453. {
  454. trigger: "click"
  455. // TODO: 针对非 react.js,直接使用 click 事件来控制展开或关闭
  456. , visible: this.state.uploadVisible,
  457. placement: uploadPopoverPlacement,
  458. overlayClassName: uploadOverlayClassName,
  459. autoAdjustOverflow: false,
  460. overlayStyle: { zIndex: 9999 },
  461. onVisibleChange: function onVisibleChange(visible) {
  462. _this4.setState({
  463. uploadVisible: visible
  464. });
  465. },
  466. content: _react2.default.createElement(
  467. "div",
  468. { className: "comment-img-popover" },
  469. _react2.default.createElement(_Upload2.default, {
  470. onRef: function onRef(node) {
  471. return _this4.uploadRef = node;
  472. },
  473. multiple: multiple,
  474. onChangeFileList: this.handleChangeFileList,
  475. onUpload: this.handleUpload,
  476. maxUpload: maxUpload,
  477. fileList: uploadFileList,
  478. showError: this.props.showError,
  479. onError: this.props.onError
  480. }),
  481. _react2.default.createElement("div", { className: "clearfix" })
  482. ),
  483. title: _react2.default.createElement(
  484. "div",
  485. { className: "comment-img-title" },
  486. _react2.default.createElement(
  487. "span",
  488. null,
  489. _reactIntlUniversal2.default.get("editor.uploadTip"),
  490. maxUpload >= 2 ? _react2.default.createElement(
  491. "span",
  492. { className: "comment-img-title-counter" },
  493. _reactIntlUniversal2.default.get("editor.uploadCount", {
  494. count: maxUpload - uploadFileList.length
  495. })
  496. ) : null
  497. )
  498. )
  499. },
  500. imageToolIcon ? _react2.default.cloneElement(imageToolIcon, {
  501. onClick: function onClick() {
  502. return _this4.handleShowUpload(true);
  503. }
  504. }) : _react2.default.createElement(_icon2.default, {
  505. type: "picture",
  506. className: "comment-toolbar-icon",
  507. style: { marginLeft: 20 },
  508. onClick: function onClick() {
  509. return _this4.handleShowUpload(true);
  510. }
  511. })
  512. ) : null
  513. ),
  514. _react2.default.createElement(
  515. "div",
  516. { className: "comment-toolbar-right" },
  517. button ? _react2.default.cloneElement(button, {
  518. onClick: button.props.onClick || handleSubmit
  519. }) : _react2.default.createElement(
  520. _button2.default,
  521. {
  522. onClick: function onClick() {
  523. return _this4.handleSubmit();
  524. },
  525. type: "primary",
  526. loading: btnLoading,
  527. disabled: disabledSubmit
  528. },
  529. btnSubmitText
  530. )
  531. )
  532. )
  533. )
  534. ) : _react2.default.createElement(
  535. _react.Fragment,
  536. null,
  537. _react2.default.createElement(
  538. "div",
  539. { className: "comment-unlogin-tip" },
  540. _reactIntlUniversal2.default.get("comment.unlogin")
  541. ),
  542. _react2.default.createElement(
  543. "div",
  544. { className: "comment-unlogin-button" },
  545. _react2.default.createElement(
  546. _button2.default,
  547. {
  548. type: "primary",
  549. onClick: function onClick() {
  550. window.location.href = app.LOGINLINK + "?f=" + window.location.href;
  551. }
  552. },
  553. _reactIntlUniversal2.default.get("account.login")
  554. )
  555. )
  556. )
  557. );
  558. }
  559. }]);
  560. return Editor;
  561. }(_react2.default.Component);
  562. Editor.propTypes = {
  563. rows: _propTypes2.default.number,
  564. placeholder: _propTypes2.default.string,
  565. showEmoji: _propTypes2.default.bool,
  566. emojiPopoverPlacement: _propTypes2.default.string,
  567. showUpload: _propTypes2.default.bool,
  568. uploadPopoverPlacement: _propTypes2.default.string,
  569. uploadOverlayClassName: _propTypes2.default.string,
  570. multiple: _propTypes2.default.bool,
  571. closeUploadWhenBlur: _propTypes2.default.bool,
  572. maxUpload: _propTypes2.default.number,
  573. value: _propTypes2.default.string,
  574. onChange: _propTypes2.default.func,
  575. onSubmit: _propTypes2.default.func,
  576. beforeSubmit: _propTypes2.default.func,
  577. btnSubmitText: _propTypes2.default.string,
  578. btnLoading: _propTypes2.default.bool,
  579. btnDisabled: _propTypes2.default.bool,
  580. button: _propTypes2.default.node,
  581. emojiToolIcon: _propTypes2.default.node,
  582. imageToolIcon: _propTypes2.default.node,
  583. showError: _propTypes2.default.bool,
  584. onError: _propTypes2.default.func,
  585. maxLength: _propTypes2.default.number,
  586. // Enter事件相关
  587. allowEnterSubmit: _propTypes2.default.bool
  588. };
  589. Editor.defaultProps = {
  590. rows: 5,
  591. // placeholder: "说点什么吧",
  592. showEmoji: true,
  593. showUpload: true,
  594. multiple: true,
  595. emojiPopoverPlacement: "bottomLeft",
  596. closeUploadWhenBlur: false,
  597. uploadPopoverPlacement: "bottomLeft",
  598. uploadOverlayClassName: "",
  599. maxUpload: 1,
  600. // btnSubmitText: "发表",
  601. btnLoading: false,
  602. btnDisabled: false,
  603. showError: true,
  604. maxLength: 5000,
  605. app: {},
  606. handleChangeFileList: function handleChangeFileList() {},
  607. // Enter事件相关
  608. allowEnterSubmit: false
  609. };
  610. exports.default = (0, _Comment2.default)(Editor);
  611. //# sourceMappingURL=index.js.map