Browse Source

fix:表情弹框可配置位置、头像变形、图片多选等 (#39)

Hepper 4 years ago
parent
commit
57c7e6a6e5

+ 7
- 2
lib/App.js View File

@@ -27,6 +27,10 @@ var _axios = require("axios");
27 27
 
28 28
 var _axios2 = _interopRequireDefault(_axios);
29 29
 
30
+var _jsCookie = require("js-cookie");
31
+
32
+var _jsCookie2 = _interopRequireDefault(_jsCookie);
33
+
30 34
 var _reactIntlUniversal = require("react-intl-universal");
31 35
 
32 36
 var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
@@ -132,15 +136,16 @@ var App = function (_Component) {
132 136
 
133 137
       var currentLocale = this.props.locales;
134 138
 
139
+      var cookieLang = _jsCookie2.default.get("lnk_lang");
135 140
       if (!currentLocale) {
136
-        currentLocale = _reactIntlUniversal2.default.determineLocale({
141
+        currentLocale = cookieLang || _reactIntlUniversal2.default.determineLocale({
137 142
           urlLocaleKey: "lang"
138 143
         });
139 144
       }
140 145
       currentLocale = _lang.SUPPORT_LOCALES.find(function (item) {
141 146
         return item.value === currentLocale;
142 147
       }) ? currentLocale : "zh-CN";
143
-      var version = require('./version.json').hash;
148
+      var version = require("./version.json").hash;
144 149
       // 使用绝对路径
145 150
       var languageURL = _constant.LANGUAGE_LINK + "/" + currentLocale + ".json?v=" + version;
146 151
       return fetch(languageURL).then(function (response) {

+ 1
- 1
lib/App.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/Comment.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/Comment.js"],"names":["Comment","CommentContext","React","createContext","Component","props","app"],"mappings":";;;;;;;;;QAKgBA,O,GAAAA,O;;AALhB;;;;;;AAEA,IAAMC,iBAAiBC,gBAAMC,aAAN,EAAvB;;AAEA;AACO,SAASH,OAAT,CAAiBI,SAAjB,EAA4B;AACjC;AACA,SAAO,UAASC,KAAT,EAAgB;AACrB;AACA;AACA,WACE;AAAC,oBAAD,CAAgB,QAAhB;AAAA;AACG;AAAA,eAAO,8BAAC,SAAD,eAAeA,KAAf,IAAsB,KAAKC,GAA3B,IAAP;AAAA;AADH,KADF;AAKD,GARD;AASD;;QAEQL,c,GAAAA,c;kBAEMD,O","file":"Comment.js","sourcesContent":["import React from \"react\";\r\n\r\nconst CommentContext = React.createContext();\r\n\r\n// This function takes a component...\r\nexport function Comment(Component) {\r\n  // ...and returns another component...\r\n  return function(props) {\r\n    // ... and renders the wrapped component with the context theme!\r\n    // Notice that we pass through any additional props as well\r\n    return (\r\n      <CommentContext.Consumer>\r\n        {app => <Component {...props} app={app} />}\r\n      </CommentContext.Consumer>\r\n    );\r\n  };\r\n}\r\n\r\nexport { CommentContext };\r\n\r\nexport default Comment;\r\n"]}
1
+{"version":3,"sources":["../src/Comment.js"],"names":["Comment","CommentContext","React","createContext","Component","props","app"],"mappings":";;;;;;;;;QAKgBA,O,GAAAA,O;;AALhB;;;;;;AAEA,IAAMC,iBAAiBC,gBAAMC,aAAN,EAAvB;;AAEA;AACO,SAASH,OAAT,CAAiBI,SAAjB,EAA4B;AACjC;AACA,SAAO,UAASC,KAAT,EAAgB;AACrB;AACA;AACA,WACE;AAAC,oBAAD,CAAgB,QAAhB;AAAA;AACG;AAAA,eAAO,8BAAC,SAAD,eAAeA,KAAf,IAAsB,KAAKC,GAA3B,IAAP;AAAA;AADH,KADF;AAKD,GARD;AASD;;QAEQL,c,GAAAA,c;kBAEMD,O","file":"Comment.js","sourcesContent":["import React from \"react\";\n\nconst CommentContext = React.createContext();\n\n// This function takes a component...\nexport function Comment(Component) {\n  // ...and returns another component...\n  return function(props) {\n    // ... and renders the wrapped component with the context theme!\n    // Notice that we pass through any additional props as well\n    return (\n      <CommentContext.Consumer>\n        {app => <Component {...props} app={app} />}\n      </CommentContext.Consumer>\n    );\n  };\n}\n\nexport { CommentContext };\n\nexport default Comment;\n"]}

+ 1
- 1
lib/avatar.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/axios.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/axios.js"],"names":["axios","defaults","withCredentials","headers","common"],"mappings":";;;;;;AAAA;;;;;;AAEAA,gBAAMC,QAAN,CAAeC,eAAf,GAAiC,IAAjC;AACAF,gBAAMC,QAAN,CAAeE,OAAf,CAAuBC,MAAvB,CAA8B,eAA9B,IAAiD,SAAjD;;kBAEeJ,e","file":"axios.js","sourcesContent":["import axios from \"axios\";\r\n\r\naxios.defaults.withCredentials = true;\r\naxios.defaults.headers.common[\"Authorization\"] = \"Bearer \";\r\n\r\nexport default axios;\r\n"]}
1
+{"version":3,"sources":["../src/axios.js"],"names":["axios","defaults","withCredentials","headers","common"],"mappings":";;;;;;AAAA;;;;;;AAEAA,gBAAMC,QAAN,CAAeC,eAAf,GAAiC,IAAjC;AACAF,gBAAMC,QAAN,CAAeE,OAAf,CAAuBC,MAAvB,CAA8B,eAA9B,IAAiD,SAAjD;;kBAEeJ,e","file":"axios.js","sourcesContent":["import axios from \"axios\";\n\naxios.defaults.withCredentials = true;\naxios.defaults.headers.common[\"Authorization\"] = \"Bearer \";\n\nexport default axios;\n"]}

+ 1
- 1
lib/components/CommentBox/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/CommentInput/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/CommentList/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../../src/components/CommentList/index.js"],"names":["CommentList","props","state","app","sGetComment","page","list","total","pageType","limit","isNoMoreComment","onPageChange","onGetMoreBtnClick","length","intl","get","p","loading","spinning","Boolean","sCommentFavor","sReplyFavor","map","item","id","renderPagination","Component","propTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa,EAAb;AAFiB;AAGlB;;;;yCAEoB;AACnB,WAAKD,KAAL,CAAWE,GAAX,CAAeC,WAAf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AAL,CAAWE,GADrC;AAAA,UACCG,IADD,eACCA,IADD;AAAA,UACOC,KADP,eACOA,KADP;AAAA,UACcU,OADd,eACcA,OADd;;;AAGP,UAAMC,WAAWC,QACfF,QAAQb,WAAR,IAAuBa,QAAQG,aAA/B,IAAgDH,QAAQI,WADzC,CAAjB;AAGA,aACE;AAAA;AAAA;AACE;AAAA;AAAA,YAAM,UAAUH,QAAhB;AAEE;AAAA;AAAA;AAAMJ,yCAAKC,GAAL,CAAS,sBAAT,EAAiC,EAAER,YAAF,EAAjC;AAAN,WAFF;AAGGD,eAAKgB,GAAL,CAAS;AAAA,mBACR,8BAAC,oBAAD,IAAY,SAASC,IAArB,EAA2B,KAAKA,KAAKC,EAArC,EAAyC,WAAWD,KAAKC,EAAzD,GADQ;AAAA,WAAT,CAHH;AAMG,eAAKC,gBAAL;AANH;AADF,OADF;AAYD;;;;EAhFuBC,gB;;AAmF1B1B,YAAY2B,SAAZ,GAAwB,EAAxB;;kBAEe,uBAAQ3B,WAAR,C","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\r\nimport { Spin, Pagination } from \"antd\";\r\nimport intl from \"react-intl-universal\";\r\nimport Comment from \"../../Comment\";\r\nimport CommentBox from \"../CommentBox\";\r\nimport \"./index.css\";\r\n\r\nclass CommentList extends Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = {};\r\n  }\r\n\r\n  componentWillMount() {\r\n    this.props.app.sGetComment({ page: this.props.app.page });\r\n  }\r\n\r\n  renderPagination() {\r\n    const {\r\n      list,\r\n      total,\r\n      page,\r\n      pageType,\r\n      limit,\r\n      isNoMoreComment,\r\n      sGetComment,\r\n      onPageChange,\r\n      onGetMoreBtnClick\r\n    } = this.props.app;\r\n    if (pageType === \"slice\") {\r\n      // 截断多余评论,通过点击查看更多跳转\r\n      return (\r\n        <div className=\"comment-list-show-more\" onClick={onGetMoreBtnClick}>\r\n          <span>查看更多</span>\r\n        </div>\r\n      );\r\n    } else if (pageType === \"more\") {\r\n      if (!isNoMoreComment && list.length !== total) {\r\n        return (\r\n          <div\r\n            className=\"comment-list-show-more\"\r\n            onClick={() => {\r\n              sGetComment({ page: page + 1 });\r\n              onPageChange(page + 1);\r\n            }}\r\n          >\r\n            <span>{intl.get(\"comment.moreComment\")}</span>\r\n          </div>\r\n        );\r\n      } else {\r\n        return null;\r\n      }\r\n    } else if (pageType === \"pagination\") {\r\n      return (\r\n        <div className=\"comment-list-pagination\">\r\n          <Pagination\r\n            pageSize={limit}\r\n            current={page}\r\n            total={total}\r\n            onChange={p => {\r\n              sGetComment({ page: p });\r\n              onPageChange(p);\r\n            }}\r\n          />\r\n        </div>\r\n      );\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { list, total, loading } = this.props.app;\r\n\r\n    const spinning = Boolean(\r\n      loading.sGetComment || loading.sCommentFavor || loading.sReplyFavor\r\n    );\r\n    return (\r\n      <div>\r\n        <Spin spinning={spinning}>\r\n          {/* <div>共 {total} 条评论</div> */}\r\n          <div>{intl.get(\"comment.totalComment\", { total })}</div>\r\n          {list.map(item => (\r\n            <CommentBox content={item} key={item.id} commentId={item.id} />\r\n          ))}\r\n          {this.renderPagination()}\r\n        </Spin>\r\n      </div>\r\n    );\r\n  }\r\n}\r\n\r\nCommentList.propTypes = {};\r\n\r\nexport default Comment(CommentList);\r\n"]}
1
+{"version":3,"sources":["../../../src/components/CommentList/index.js"],"names":["CommentList","props","state","app","sGetComment","page","list","total","pageType","limit","isNoMoreComment","onPageChange","onGetMoreBtnClick","length","intl","get","p","loading","spinning","Boolean","sCommentFavor","sReplyFavor","map","item","id","renderPagination","Component","propTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;IAEMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa,EAAb;AAFiB;AAGlB;;;;yCAEoB;AACnB,WAAKD,KAAL,CAAWE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A,wBAC0B,KAAKf,KAAL,CAAWE,GADrC;AAAA,UACCG,IADD,eACCA,IADD;AAAA,UACOC,KADP,eACOA,KADP;AAAA,UACcU,OADd,eACcA,OADd;;;AAGP,UAAMC,WAAWC,QACfF,QAAQb,WAAR,IAAuBa,QAAQG,aAA/B,IAAgDH,QAAQI,WADzC,CAAjB;AAGA,aACE;AAAA;AAAA;AACE;AAAA;AAAA,YAAM,UAAUH,QAAhB;AAEE;AAAA;AAAA;AAAMJ,yCAAKC,GAAL,CAAS,sBAAT,EAAiC,EAAER,YAAF,EAAjC;AAAN,WAFF;AAGGD,eAAKgB,GAAL,CAAS;AAAA,mBACR,8BAAC,oBAAD,IAAY,SAASC,IAArB,EAA2B,KAAKA,KAAKC,EAArC,EAAyC,WAAWD,KAAKC,EAAzD,GADQ;AAAA,WAAT,CAHH;AAMG,eAAKC,gBAAL;AANH;AADF,OADF;AAYD;;;;EAhFuBC,gB;;AAmF1B1B,YAAY2B,SAAZ,GAAwB,EAAxB;;kBAEe,uBAAQ3B,WAAR,C","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\nimport { Spin, Pagination } from \"antd\";\nimport intl from \"react-intl-universal\";\nimport Comment from \"../../Comment\";\nimport CommentBox from \"../CommentBox\";\nimport \"./index.css\";\n\nclass CommentList extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {};\n  }\n\n  componentWillMount() {\n    this.props.app.sGetComment({ page: this.props.app.page });\n  }\n\n  renderPagination() {\n    const {\n      list,\n      total,\n      page,\n      pageType,\n      limit,\n      isNoMoreComment,\n      sGetComment,\n      onPageChange,\n      onGetMoreBtnClick\n    } = this.props.app;\n    if (pageType === \"slice\") {\n      // 截断多余评论,通过点击查看更多跳转\n      return (\n        <div className=\"comment-list-show-more\" onClick={onGetMoreBtnClick}>\n          <span>查看更多</span>\n        </div>\n      );\n    } else if (pageType === \"more\") {\n      if (!isNoMoreComment && list.length !== total) {\n        return (\n          <div\n            className=\"comment-list-show-more\"\n            onClick={() => {\n              sGetComment({ page: page + 1 });\n              onPageChange(page + 1);\n            }}\n          >\n            <span>{intl.get(\"comment.moreComment\")}</span>\n          </div>\n        );\n      } else {\n        return null;\n      }\n    } else if (pageType === \"pagination\") {\n      return (\n        <div className=\"comment-list-pagination\">\n          <Pagination\n            pageSize={limit}\n            current={page}\n            total={total}\n            onChange={p => {\n              sGetComment({ page: p });\n              onPageChange(p);\n            }}\n          />\n        </div>\n      );\n    }\n  }\n\n  render() {\n    const { list, total, loading } = this.props.app;\n\n    const spinning = Boolean(\n      loading.sGetComment || loading.sCommentFavor || loading.sReplyFavor\n    );\n    return (\n      <div>\n        <Spin spinning={spinning}>\n          {/* <div>共 {total} 条评论</div> */}\n          <div>{intl.get(\"comment.totalComment\", { total })}</div>\n          {list.map(item => (\n            <CommentBox content={item} key={item.id} commentId={item.id} />\n          ))}\n          {this.renderPagination()}\n        </Spin>\n      </div>\n    );\n  }\n}\n\nCommentList.propTypes = {};\n\nexport default Comment(CommentList);\n"]}

+ 7
- 1
lib/components/ContentItem/index.css View File

@@ -16,7 +16,13 @@
16 16
   margin-left: 10px;
17 17
   margin-bottom: 20px;
18 18
 }
19
-
19
+.comment-item-avatar {
20
+  width: 40px;
21
+  height: 40px;
22
+  border-radius: 20px;
23
+  background-position: center;
24
+  background-size: cover;
25
+}
20 26
 .comment-item-content {
21 27
   margin: 10px 0;
22 28
   word-break: break-all;

+ 13
- 11
lib/components/ContentItem/index.js View File

@@ -16,10 +16,6 @@ var _tooltip = require("antd/es/tooltip");
16 16
 
17 17
 var _tooltip2 = _interopRequireDefault(_tooltip);
18 18
 
19
-var _avatar = require("antd/es/avatar");
20
-
21
-var _avatar2 = _interopRequireDefault(_avatar);
22
-
23 19
 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; }; }();
24 20
 
25 21
 require("antd/es/popconfirm/style/css");
@@ -28,8 +24,6 @@ require("antd/es/icon/style/css");
28 24
 
29 25
 require("antd/es/tooltip/style/css");
30 26
 
31
-require("antd/es/avatar/style/css");
32
-
33 27
 var _react = require("react");
34 28
 
35 29
 var _react2 = _interopRequireDefault(_react);
@@ -60,9 +54,9 @@ var _CommentInput = require("../CommentInput");
60 54
 
61 55
 var _CommentInput2 = _interopRequireDefault(_CommentInput);
62 56
 
63
-var _avatar3 = require("../../avatar");
57
+var _avatar = require("../../avatar");
64 58
 
65
-var _avatar4 = _interopRequireDefault(_avatar3);
59
+var _avatar2 = _interopRequireDefault(_avatar);
66 60
 
67 61
 var _helper = require("../../helper");
68 62
 
@@ -194,6 +188,7 @@ var CommentItem = function (_Component) {
194 188
           imgs.splice(3, 0, { type: "divider" });
195 189
         }
196 190
       }
191
+      var IconColor = content.favor_count > 0 ? "#71C135" : "#4a90e2";
197 192
 
198 193
       return _react2.default.createElement(
199 194
         "div",
@@ -201,7 +196,12 @@ var CommentItem = function (_Component) {
201 196
         _react2.default.createElement(
202 197
           "div",
203 198
           { className: "comment-item-left" },
204
-          _react2.default.createElement(_avatar2.default, { src: content.user_avatar || _avatar4.default, size: "large" })
199
+          _react2.default.createElement("div", {
200
+            className: "comment-item-avatar",
201
+            style: {
202
+              backgroundImage: "url(" + (content.user_avatar || _avatar2.default) + ")"
203
+            }
204
+          })
205 205
         ),
206 206
         _react2.default.createElement(
207 207
           "div",
@@ -331,11 +331,13 @@ var CommentItem = function (_Component) {
331 331
                     return;
332 332
                   }
333 333
                   app.sCommentFavor(content.id, content.favored);
334
-                }
334
+                },
335
+                style: { color: "" + IconColor }
335 336
               },
336 337
               _react2.default.createElement(_icon2.default, {
337 338
                 type: "like-o",
338
-                className: content.favored ? "comment-favor comment-favored" : "comment-favor"
339
+                className: content.favored ? "comment-favor comment-favored" : "comment-favor",
340
+                style: { color: "" + IconColor }
339 341
               }),
340 342
               "\xA0",
341 343
               content.favor_count

+ 1
- 1
lib/components/ContentItem/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/Editor/Emoji.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../../src/components/Editor/Emoji.js"],"names":["Emoji","carousel","next","prev","onClick","props","content","curPage","i","length","push","emoji","node","map","page","index","item","value","prefixUrl","ext","title","display","React","Component"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;;;;;;;AACA;AACA;;AAEA;;IAEMA,K;;;;;;;;;;;2BACG;AACL,UAAI,KAAKC,QAAT,EAAmB;AACjB,aAAKA,QAAL,CAAcC,IAAd;AACD;AACF;;;2BAEM;AACL,UAAI,KAAKD,QAAT,EAAmB;AACjB,aAAKA,QAAL,CAAcE,IAAd;AACD;AACF;;;6BAEQ;AAAA;;AAAA,UACCC,QADD,GACa,KAAKC,KADlB,CACCD,OADD;;AAEP,UAAME,UAAU,EAAhB;AACA,UAAIC,UAAU,EAAd;AACA,WAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAI,GAApB,EAAyBA,GAAzB,EAA8B;AAC5B,YAAID,QAAQE,MAAR,GAAiB,EAArB,EAAyB;AACvBF,kBAAQG,IAAR,CAAaC,gBAAMH,CAAN,CAAb;AACD,SAFD,MAEO;AACLF,kBAAQI,IAAR,CAAaH,OAAb;AACAA,oBAAU,EAAV;AACD;AACF;AACD,UAAIA,QAAQE,MAAR,GAAiB,CAArB,EAAwB;AACtBH,gBAAQI,IAAR,CAAaH,OAAb;AACD;AACD,aACE;AAAA;AAAA;AACE,eAAK,mBAAQ;AACX,mBAAKN,QAAL,GAAgBW,IAAhB;AACD;AAHH;AAKGN,gBAAQO,GAAR,CAAY,UAACC,IAAD,EAAOC,KAAP;AAAA,iBACX;AAAA;AAAA,cAAK,KAAKA,KAAV,EAAiB,WAAU,OAA3B;AACGD,iBAAKD,GAAL,CAAS,UAACG,IAAD,EAAOD,KAAP;AAAA,qBACR;AAAA;AAAA,kBAAK,WAAU,MAAf,EAAsB,KAAKC,KAAKC,KAAhC;AACE,wDAAM,WAAU,QAAhB,GADF;AAEE;AACE,4BAAQC,gBAAR,GAAoBF,KAAKC,KAAzB,SAAkCD,KAAKG,GADzC;AAEE,uBAAKH,KAAKI,KAFZ;AAGE,yBAAO,EAAEC,SAAS,cAAX,EAHT;AAIE,2BAAS;AAAA,2BAAMjB,SAAQY,KAAKI,KAAb,CAAN;AAAA;AAJX;AAFF,eADQ;AAAA,aAAT;AADH,WADW;AAAA,SAAZ;AALH,OADF;AAuBD;;;;EAnDiBE,gBAAMC,S;;kBAsDXvB,K","file":"Emoji.js","sourcesContent":["import React from \"react\";\r\nimport { Carousel } from \"antd\";\r\nimport emoji, { prefixUrl } from \"../../emoji\";\r\nimport \"./Emoji.css\";\r\n// 每页 20  5*4\r\n// 共 20 * 3 = 60 (实际是 54)\r\n\r\n// class Emoji\r\n\r\nclass Emoji extends React.Component {\r\n  next() {\r\n    if (this.carousel) {\r\n      this.carousel.next();\r\n    }\r\n  }\r\n\r\n  prev() {\r\n    if (this.carousel) {\r\n      this.carousel.prev();\r\n    }\r\n  }\r\n\r\n  render() {\r\n    const { onClick } = this.props;\r\n    const content = [];\r\n    let curPage = [];\r\n    for (let i = 0; i < 115; i++) {\r\n      if (curPage.length < 30) {\r\n        curPage.push(emoji[i]);\r\n      } else {\r\n        content.push(curPage);\r\n        curPage = [];\r\n      }\r\n    }\r\n    if (curPage.length > 0) {\r\n      content.push(curPage);\r\n    }\r\n    return (\r\n      <Carousel\r\n        ref={node => {\r\n          this.carousel = node;\r\n        }}\r\n      >\r\n        {content.map((page, index) => (\r\n          <div key={index} className=\"emoji\">\r\n            {page.map((item, index) => (\r\n              <div className=\"item\" key={item.value}>\r\n                <span className=\"helper\" />\r\n                <img\r\n                  src={`${prefixUrl}${item.value}.${item.ext}`}\r\n                  alt={item.title}\r\n                  style={{ display: \"inline-block\" }}\r\n                  onClick={() => onClick(item.title)}\r\n                />\r\n              </div>\r\n            ))}\r\n          </div>\r\n        ))}\r\n      </Carousel>\r\n    );\r\n  }\r\n}\r\n\r\nexport default Emoji;\r\n"]}
1
+{"version":3,"sources":["../../../src/components/Editor/Emoji.js"],"names":["Emoji","carousel","next","prev","onClick","props","content","curPage","i","length","push","emoji","node","map","page","index","item","value","prefixUrl","ext","title","display","React","Component"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAEA;;;;AACA;;;;;;;;;;AACA;AACA;;AAEA;;IAEMA,K;;;;;;;;;;;2BACG;AACL,UAAI,KAAKC,QAAT,EAAmB;AACjB,aAAKA,QAAL,CAAcC,IAAd;AACD;AACF;;;2BAEM;AACL,UAAI,KAAKD,QAAT,EAAmB;AACjB,aAAKA,QAAL,CAAcE,IAAd;AACD;AACF;;;6BAEQ;AAAA;;AAAA,UACCC,QADD,GACa,KAAKC,KADlB,CACCD,OADD;;AAEP,UAAME,UAAU,EAAhB;AACA,UAAIC,UAAU,EAAd;AACA,WAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAI,GAApB,EAAyBA,GAAzB,EAA8B;AAC5B,YAAID,QAAQE,MAAR,GAAiB,EAArB,EAAyB;AACvBF,kBAAQG,IAAR,CAAaC,gBAAMH,CAAN,CAAb;AACD,SAFD,MAEO;AACLF,kBAAQI,IAAR,CAAaH,OAAb;AACAA,oBAAU,EAAV;AACD;AACF;AACD,UAAIA,QAAQE,MAAR,GAAiB,CAArB,EAAwB;AACtBH,gBAAQI,IAAR,CAAaH,OAAb;AACD;AACD,aACE;AAAA;AAAA;AACE,eAAK,mBAAQ;AACX,mBAAKN,QAAL,GAAgBW,IAAhB;AACD;AAHH;AAKGN,gBAAQO,GAAR,CAAY,UAACC,IAAD,EAAOC,KAAP;AAAA,iBACX;AAAA;AAAA,cAAK,KAAKA,KAAV,EAAiB,WAAU,OAA3B;AACGD,iBAAKD,GAAL,CAAS,UAACG,IAAD,EAAOD,KAAP;AAAA,qBACR;AAAA;AAAA,kBAAK,WAAU,MAAf,EAAsB,KAAKC,KAAKC,KAAhC;AACE,wDAAM,WAAU,QAAhB,GADF;AAEE;AACE,4BAAQC,gBAAR,GAAoBF,KAAKC,KAAzB,SAAkCD,KAAKG,GADzC;AAEE,uBAAKH,KAAKI,KAFZ;AAGE,yBAAO,EAAEC,SAAS,cAAX,EAHT;AAIE,2BAAS;AAAA,2BAAMjB,SAAQY,KAAKI,KAAb,CAAN;AAAA;AAJX;AAFF,eADQ;AAAA,aAAT;AADH,WADW;AAAA,SAAZ;AALH,OADF;AAuBD;;;;EAnDiBE,gBAAMC,S;;kBAsDXvB,K","file":"Emoji.js","sourcesContent":["import React from \"react\";\nimport { Carousel } from \"antd\";\nimport emoji, { prefixUrl } from \"../../emoji\";\nimport \"./Emoji.css\";\n// 每页 20  5*4\n// 共 20 * 3 = 60 (实际是 54)\n\n// class Emoji\n\nclass Emoji extends React.Component {\n  next() {\n    if (this.carousel) {\n      this.carousel.next();\n    }\n  }\n\n  prev() {\n    if (this.carousel) {\n      this.carousel.prev();\n    }\n  }\n\n  render() {\n    const { onClick } = this.props;\n    const content = [];\n    let curPage = [];\n    for (let i = 0; i < 115; i++) {\n      if (curPage.length < 30) {\n        curPage.push(emoji[i]);\n      } else {\n        content.push(curPage);\n        curPage = [];\n      }\n    }\n    if (curPage.length > 0) {\n      content.push(curPage);\n    }\n    return (\n      <Carousel\n        ref={node => {\n          this.carousel = node;\n        }}\n      >\n        {content.map((page, index) => (\n          <div key={index} className=\"emoji\">\n            {page.map((item, index) => (\n              <div className=\"item\" key={item.value}>\n                <span className=\"helper\" />\n                <img\n                  src={`${prefixUrl}${item.value}.${item.ext}`}\n                  alt={item.title}\n                  style={{ display: \"inline-block\" }}\n                  onClick={() => onClick(item.title)}\n                />\n              </div>\n            ))}\n          </div>\n        ))}\n      </Carousel>\n    );\n  }\n}\n\nexport default Emoji;\n"]}

+ 3
- 1
lib/components/Editor/Upload.js View File

@@ -168,7 +168,8 @@ var App = function (_React$Component) {
168 168
           previewImage = _state.previewImage;
169 169
       var _props = this.props,
170 170
           fileList = _props.fileList,
171
-          maxUpload = _props.maxUpload;
171
+          maxUpload = _props.maxUpload,
172
+          multiple = _props.multiple;
172 173
 
173 174
       var uploadButton = _react2.default.createElement(
174 175
         "div",
@@ -187,6 +188,7 @@ var App = function (_React$Component) {
187 188
           _upload2.default,
188 189
           {
189 190
             accept: "image/jpg,image/jpeg,image/png,image/bmp",
191
+            multiple: multiple,
190 192
             listType: "picture-card",
191 193
             fileList: fileList,
192 194
             customRequest: this.customRequest,

+ 1
- 1
lib/components/Editor/Upload.js.map
File diff suppressed because it is too large
View File


+ 1
- 0
lib/components/Editor/index.css View File

@@ -62,6 +62,7 @@
62 62
 }
63 63
 
64 64
 .comment-toolbar .comment-toolbar-icon {
65
+  width: 25px;
65 66
   font-size: 23px;
66 67
   cursor: pointer;
67 68
   transition: color 0.3s;

+ 17
- 14
lib/components/Editor/index.js View File

@@ -275,6 +275,8 @@ var Editor = function (_React$Component) {
275 275
           rows = _props.rows,
276 276
           showEmoji = _props.showEmoji,
277 277
           showUpload = _props.showUpload,
278
+          multiple = _props.multiple,
279
+          emojiPopoverPlacement = _props.emojiPopoverPlacement,
278 280
           closeUploadWhenBlur = _props.closeUploadWhenBlur,
279 281
           maxUpload = _props.maxUpload,
280 282
           btnLoading = _props.btnLoading,
@@ -293,16 +295,12 @@ var Editor = function (_React$Component) {
293 295
       return _react2.default.createElement(
294 296
         "div",
295 297
         { className: "comment-editor-container" },
296
-        _react2.default.createElement(
297
-          "div",
298
-          {
299
-            className: (0, _classnames2.default)({
300
-              "comment-editor-toolbar": true,
301
-              "comment-editor-toolbar-error": inputValue.length > maxLength
302
-            })
303
-          },
304
-          "\u3000"
305
-        ),
298
+        _react2.default.createElement("div", {
299
+          className: (0, _classnames2.default)({
300
+            "comment-editor-toolbar": true,
301
+            "comment-editor-toolbar-error": inputValue.length > maxLength
302
+          })
303
+        }),
306 304
         _react2.default.createElement(
307 305
           "div",
308 306
           { className: "comment-editor" },
@@ -325,7 +323,7 @@ var Editor = function (_React$Component) {
325 323
                 _popover2.default,
326 324
                 {
327 325
                   trigger: "click",
328
-                  placement: "bottomLeft",
326
+                  placement: emojiPopoverPlacement,
329 327
                   autoAdjustOverflow: false,
330 328
                   content: _react2.default.createElement(
331 329
                     "div",
@@ -364,6 +362,7 @@ var Editor = function (_React$Component) {
364 362
                       }
365 363
                     },
366 364
                     _react2.default.createElement(_Upload2.default, {
365
+                      multiple: multiple,
367 366
                       onChangeFileList: this.handleChangeFileList,
368 367
                       onUpload: this.handleUpload,
369 368
                       maxUpload: maxUpload,
@@ -384,9 +383,9 @@ var Editor = function (_React$Component) {
384 383
                       maxUpload >= 2 ? _react2.default.createElement(
385 384
                         "span",
386 385
                         { style: { color: "#666", fontWeight: 400 } },
387
-                        "(\u60A8\u8FD8\u80FD\u4E0A\u4F20",
388
-                        maxUpload - this.state.fileList.length,
389
-                        "\u5F20\u56FE\u7247)"
386
+                        _reactIntlUniversal2.default.get("editor.uploadCount", {
387
+                          count: maxUpload - this.state.fileList.length
388
+                        })
390 389
                       ) : null
391 390
                     )
392 391
                   )
@@ -436,7 +435,9 @@ Editor.propTypes = {
436 435
   rows: _propTypes2.default.number,
437 436
   placeholder: _propTypes2.default.string,
438 437
   showEmoji: _propTypes2.default.bool,
438
+  emojiPopoverPlacement: _propTypes2.default.string,
439 439
   showUpload: _propTypes2.default.bool,
440
+  multiple: _propTypes2.default.bool,
440 441
   closeUploadWhenBlur: _propTypes2.default.bool,
441 442
   maxUpload: _propTypes2.default.number,
442 443
   value: _propTypes2.default.string,
@@ -459,6 +460,8 @@ Editor.defaultProps = {
459 460
   // placeholder: "说点什么吧",
460 461
   showEmoji: true,
461 462
   showUpload: true,
463
+  multiple: true,
464
+  emojiPopoverPlacement: "bottomLeft",
462 465
   closeUploadWhenBlur: false,
463 466
   maxUpload: 1,
464 467
   // btnSubmitText: "发表",

+ 1
- 1
lib/components/Editor/index.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/ImagePreviewer/ImagePreviewer.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/components/RenderText/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../../src/components/RenderText/index.js"],"names":["App","__html","text"],"mappings":";;;;;;AAAA;;;;AACA;;;;AAEA,IAAMA,MAAM,SAANA,GAAM;AAAA,SACV;AACE,eAAU,sBADZ;AAEE,6BAAyB;AACvBC,cAAQ,2BAAcC,IAAd;AADe;AAF3B,IADU;AAAA,CAAZ;;kBASeF,G","file":"index.js","sourcesContent":["import React from \"react\";\r\nimport { renderContent } from \"../../helper\";\r\n\r\nconst App = text => (\r\n  <div\r\n    className=\"comment-item-content\"\r\n    dangerouslySetInnerHTML={{\r\n      __html: renderContent(text)\r\n    }}\r\n  />\r\n);\r\n\r\nexport default App;\r\n"]}
1
+{"version":3,"sources":["../../../src/components/RenderText/index.js"],"names":["App","__html","text"],"mappings":";;;;;;AAAA;;;;AACA;;;;AAEA,IAAMA,MAAM,SAANA,GAAM;AAAA,SACV;AACE,eAAU,sBADZ;AAEE,6BAAyB;AACvBC,cAAQ,2BAAcC,IAAd;AADe;AAF3B,IADU;AAAA,CAAZ;;kBASeF,G","file":"index.js","sourcesContent":["import React from \"react\";\nimport { renderContent } from \"../../helper\";\n\nconst App = text => (\n  <div\n    className=\"comment-item-content\"\n    dangerouslySetInnerHTML={{\n      __html: renderContent(text)\n    }}\n  />\n);\n\nexport default App;\n"]}

+ 1
- 1
lib/constant.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/constant.js"],"names":["ERROR_DEFAULT","LIMIT","OSS_ENDPOINT","OSS_BUCKET","DRIVER_LICENSE_PATH","OSS_LINK","MAX_UPLOAD_NUMBER","URL_REGEXP","REGEXP","AVATAR","IMAGE_SPLIT","IMAGE_PROCESS","IMAGE_PROCESS_SMALL","IMAGE_PROCESS_LARGE","COMMENT_TYPE","COMMENT","REPLY","LANGUAGE_LINK","process","env","NODE_ENV"],"mappings":";;;;;AAAO,IAAMA,wCAAgB,MAAtB;;AAEA,IAAMC,wBAAQ,EAAd,C,CAAkB;;AAElB,IAAMC,sCAAe,6BAArB;AACA,IAAMC,kCAAa,eAAnB;AACA,IAAMC,oDAAsB,UAA5B;;AAEA,IAAMC,8BAAW,6CAAjB;;AAEA,IAAMC,gDAAoB,CAA1B;;AAEA,IAAMC,kCAAa,oGAAnB;;AAEA,IAAMC,0BAAS,eAAf;;AAEA,IAAMC,0BAAS,EAAf;;AAEA,IAAMC,oCAAc,aAApB;;AAEA,IAAMC,wCAAgB,mCAAtB;AACA,IAAMC,oDAAsB,mCAA5B;AACA,IAAMC,oDAAsB,mCAA5B;;AAEA,IAAMC,sCAAe;AAC1BC,WAAS,SADiB;AAE1BC,SAAO;AAFmB,CAArB;;AAKP;AACO,IAAMC,wCACXC,QAAQC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GACI,sBADJ,GAEI,uBAHC","file":"constant.js","sourcesContent":["export const ERROR_DEFAULT = \"出错了!\";\r\n\r\nexport const LIMIT = 10; // 默认 limit\r\n\r\nexport const OSS_ENDPOINT = \"oss-cn-beijing.aliyuncs.com\";\r\nexport const OSS_BUCKET = \"links-comment\";\r\nexport const DRIVER_LICENSE_PATH = \"/comment\";\r\n\r\nexport const OSS_LINK = \"//links-comment.oss-cn-beijing.aliyuncs.com\";\r\n\r\nexport const MAX_UPLOAD_NUMBER = 4;\r\n\r\nexport const URL_REGEXP = /((http(s)?:)?\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;\r\n\r\nexport const REGEXP = /\\[[^[\\]]+?\\]/g;\r\n\r\nexport const AVATAR = \"\";\r\n\r\nexport const IMAGE_SPLIT = \"IMAGE_SPLIT\";\r\n\r\nexport const IMAGE_PROCESS = \"?x-oss-process=image/resize,h_350\";\r\nexport const IMAGE_PROCESS_SMALL = \"?x-oss-process=image/resize,h_100\";\r\nexport const IMAGE_PROCESS_LARGE = \"?x-oss-process=image/resize,h_500\";\r\n\r\nexport const COMMENT_TYPE = {\r\n  COMMENT: \"comment\",\r\n  REPLY: \"reply\"\r\n};\r\n\r\n// 线上静态库地址\r\nexport const LANGUAGE_LINK =\r\n  process.env.NODE_ENV === \"production\"\r\n    ? \"//a.links123.cn/lang\"\r\n    : \"//a.links123.net/lang\";\r\n"]}
1
+{"version":3,"sources":["../src/constant.js"],"names":["ERROR_DEFAULT","LIMIT","OSS_ENDPOINT","OSS_BUCKET","DRIVER_LICENSE_PATH","OSS_LINK","MAX_UPLOAD_NUMBER","URL_REGEXP","REGEXP","AVATAR","IMAGE_SPLIT","IMAGE_PROCESS","IMAGE_PROCESS_SMALL","IMAGE_PROCESS_LARGE","COMMENT_TYPE","COMMENT","REPLY","LANGUAGE_LINK","process","env","NODE_ENV"],"mappings":";;;;;AAAO,IAAMA,wCAAgB,MAAtB;;AAEA,IAAMC,wBAAQ,EAAd,C,CAAkB;;AAElB,IAAMC,sCAAe,6BAArB;AACA,IAAMC,kCAAa,eAAnB;AACA,IAAMC,oDAAsB,UAA5B;;AAEA,IAAMC,8BAAW,6CAAjB;;AAEA,IAAMC,gDAAoB,CAA1B;;AAEA,IAAMC,kCAAa,oGAAnB;;AAEA,IAAMC,0BAAS,eAAf;;AAEA,IAAMC,0BAAS,EAAf;;AAEA,IAAMC,oCAAc,aAApB;;AAEA,IAAMC,wCAAgB,mCAAtB;AACA,IAAMC,oDAAsB,mCAA5B;AACA,IAAMC,oDAAsB,mCAA5B;;AAEA,IAAMC,sCAAe;AAC1BC,WAAS,SADiB;AAE1BC,SAAO;AAFmB,CAArB;;AAKP;AACO,IAAMC,wCACXC,QAAQC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GACI,sBADJ,GAEI,uBAHC","file":"constant.js","sourcesContent":["export const ERROR_DEFAULT = \"出错了!\";\n\nexport const LIMIT = 10; // 默认 limit\n\nexport const OSS_ENDPOINT = \"oss-cn-beijing.aliyuncs.com\";\nexport const OSS_BUCKET = \"links-comment\";\nexport const DRIVER_LICENSE_PATH = \"/comment\";\n\nexport const OSS_LINK = \"//links-comment.oss-cn-beijing.aliyuncs.com\";\n\nexport const MAX_UPLOAD_NUMBER = 4;\n\nexport const URL_REGEXP = /((http(s)?:)?\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;\n\nexport const REGEXP = /\\[[^[\\]]+?\\]/g;\n\nexport const AVATAR = \"\";\n\nexport const IMAGE_SPLIT = \"IMAGE_SPLIT\";\n\nexport const IMAGE_PROCESS = \"?x-oss-process=image/resize,h_350\";\nexport const IMAGE_PROCESS_SMALL = \"?x-oss-process=image/resize,h_100\";\nexport const IMAGE_PROCESS_LARGE = \"?x-oss-process=image/resize,h_500\";\n\nexport const COMMENT_TYPE = {\n  COMMENT: \"comment\",\n  REPLY: \"reply\"\n};\n\n// 线上静态库地址\nexport const LANGUAGE_LINK =\n  process.env.NODE_ENV === \"production\"\n    ? \"//a.links123.cn/lang\"\n    : \"//a.links123.net/lang\";\n"]}

+ 1
- 1
lib/helper.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
lib/index.example.js.map
File diff suppressed because it is too large
View File


+ 3
- 0
lib/index.js View File

@@ -67,6 +67,9 @@ if (process.env.NODE_ENV !== "production") {
67 67
     userId: 71299,
68 68
     onCountChange: function onCountChange(c) {
69 69
       console.log(c);
70
+    },
71
+    editorProps: {
72
+      // emojiPopoverPlacement: "bottom"
70 73
     }
71 74
   });
72 75
 }

+ 1
- 1
lib/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/index.js"],"names":["Index","props","editorProps","renderComment","config","id","Error","type","businessId","console","warn","API","ReactDOM","render","document","getElementById","window","process","env","NODE_ENV","businessUserId","userId","onCountChange","log","c"],"mappings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dom\";\r\nimport App, { Editor } from \"./App\";\r\n// import registerServiceWorker from \"./registerServiceWorker\";\r\n\r\nconst Index = props => (\r\n  <App showAlertComment showAlertReply showAlertFavor showError {...props}>\r\n    <Editor maxUpload={9} autoFocus {...props.editorProps} />\r\n  </App>\r\n);\r\n\r\n/**\r\n * 渲染评论组件\r\n * @param {object} config 编辑器配置\r\n *  - {string} id 渲染评论的DOM的 ID\r\n *  - {number} type 评论的 type\r\n *  - {string} businessId 评论的 businessId\r\n *  - {string} API, API 前缀, 默认 http://api.links123.net/comment/v1\r\n */\r\nfunction renderComment(config) {\r\n  if (!config.id) {\r\n    throw new Error(\"id is required\");\r\n  }\r\n  if (!config.type) {\r\n    throw new Error(\"type is required\");\r\n  }\r\n  if (!config.businessId) {\r\n    // throw new Error(\"businessId is required\");\r\n    config.businessId = \"test\";\r\n    console.warn(\"没有传入 businessId 参数,默认使用: test\");\r\n  }\r\n  if (!config.API) {\r\n    // throw new Error(\"API is required\");\r\n    config.API = \"http://api.links123.net/comment/v1\";\r\n    console.warn(\r\n      \"没有传入 API 参数,默认使用: http://api.links123.net/comment/v1\"\r\n    );\r\n  }\r\n\r\n  ReactDOM.render(<Index {...config} />, document.getElementById(config.id));\r\n  // registerServiceWorker();\r\n}\r\n\r\nwindow.renderComment = renderComment;\r\n\r\nif (process.env.NODE_ENV !== \"production\") {\r\n  renderComment({\r\n    id: \"root-comment\",\r\n    type: 1,\r\n    businessId: \"test\",\r\n    businessUserId: 4,\r\n    userId: 71299,\r\n    onCountChange: c => {\r\n      console.log(c);\r\n    }\r\n  });\r\n}\r\n\r\n// renderComment({\r\n//   id: \"root-comment\",\r\n//   type: 1,\r\n//   businessId: \"test\",\r\n//   API: 'http://api.links123.net/comment/v1',\r\n// });\r\n"]}
1
+{"version":3,"sources":["../src/index.js"],"names":["Index","props","editorProps","renderComment","config","id","Error","type","businessId","console","warn","API","ReactDOM","render","document","getElementById","window","process","env","NODE_ENV","businessUserId","userId","onCountChange","log","c"],"mapp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import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport App, { Editor } from \"./App\";\n// import registerServiceWorker from \"./registerServiceWorker\";\n\nconst Index = props => (\n  <App showAlertComment showAlertReply showAlertFavor showError {...props}>\n    <Editor maxUpload={9} autoFocus {...props.editorProps} />\n  </App>\n);\n\n/**\n * 渲染评论组件\n * @param {object} config 编辑器配置\n *  - {string} id 渲染评论的DOM的 ID\n *  - {number} type 评论的 type\n *  - {string} businessId 评论的 businessId\n *  - {string} API, API 前缀, 默认 http://api.links123.net/comment/v1\n */\nfunction renderComment(config) {\n  if (!config.id) {\n    throw new Error(\"id is required\");\n  }\n  if (!config.type) {\n    throw new Error(\"type is required\");\n  }\n  if (!config.businessId) {\n    // throw new Error(\"businessId is required\");\n    config.businessId = \"test\";\n    console.warn(\"没有传入 businessId 参数,默认使用: test\");\n  }\n  if (!config.API) {\n    // throw new Error(\"API is required\");\n    config.API = \"http://api.links123.net/comment/v1\";\n    console.warn(\n      \"没有传入 API 参数,默认使用: http://api.links123.net/comment/v1\"\n    );\n  }\n\n  ReactDOM.render(<Index {...config} />, document.getElementById(config.id));\n  // registerServiceWorker();\n}\n\nwindow.renderComment = renderComment;\n\nif (process.env.NODE_ENV !== \"production\") {\n  renderComment({\n    id: \"root-comment\",\n    type: 1,\n    businessId: \"test\",\n    businessUserId: 4,\n    userId: 71299,\n    onCountChange: c => {\n      console.log(c);\n    },\n    editorProps: {\n      // emojiPopoverPlacement: \"bottom\"\n    }\n  });\n}\n\n// renderComment({\n//   id: \"root-comment\",\n//   type: 1,\n//   businessId: \"test\",\n//   API: 'http://api.links123.net/comment/v1',\n// });\n"]}

+ 1
- 1
lib/lang/en-US.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../src/lang/en-US.js"],"names":["USdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,uBADZ;AAEb,wBAAsB,eAFT;AAGb,sBAAoB,2BAHP;AAIb,sBAAoB,MAJP;AAKb,sBAAoB,iBALP;AAMb,wBAAsB,iCANT;AAOb,sBAAoB,QAPP;;AASb,qBAAmB,SATN;AAUb,0BACE,4DAXW;AAYb,mBAAiB,OAZJ;AAab,yBAAuB,eAbV;;AAeb,sBAAoB,yDAfP;AAgBb,qBAAmB,cAhBN;AAiBb,oBAAkB,cAjBL;;AAmBb,sBAAoB,MAnBP;AAoBb,0BAAwB,kBApBX;;AAsBb,sBAAoB,SAtBP;AAuBb,mBAAiB,SAvBJ;AAwBb,uBAAqB,QAxBR;AAyBb,uBAAqB,QAzBR;;AA2Bb,2BAAyB,kBA3BZ;AA4Bb,wBAAsB,cA5BT;AA6Bb,qBAAmB,kBA7BN;AA8Bb,qBAAmB,eA9BN;AA+Bb,yBAAuB,kBA/BV;AAgCb,0BAAwB,YAhCX;AAiCb,+BAA6B,SAjChB;AAkCb,yBAAuB;AAlCV,CAAf;;kBAqCeA,M","file":"en-US.js","sourcesContent":["const USdata = {\r\n  \"editor.alreadyEntered\": \"{count} words entered\",\r\n  \"editor.placeholder\": \"Say something\",\r\n  \"editor.maxLength\": \"Maximum {maxLength} words\",\r\n  \"editor.SubmitBtn\": \"Send\",\r\n  \"editor.uploadTip\": \"Upload pictures\",\r\n  \"editor.uploadCount\": \"(You could upload {count} more)\",\r\n  \"editor.uploadBtn\": \"Upload\",\r\n\r\n  \"comment.tourist\": \"Visitor\",\r\n  \"comment.totalComment\":\r\n    \"Total {total, plural, =1 {one comment} other {# comments}}\",\r\n  \"comment.reply\": \"Reply\",\r\n  \"comment.moreComment\": \"More comments\",\r\n\r\n  \"reply.totalReply\": \"Total {total, plural, =1 {one reply} other {# replies}}\",\r\n  \"reply.moreReply\": \"More replies\",\r\n  \"reply.collapse\": \"Fold replies\",\r\n\r\n  \"picture.collapse\": \"Fold\",\r\n  \"picture.viewOriginal\": \"See the original\",\r\n\r\n  \"popConfirm.title\": \"Delete?\",\r\n  \"popConfirm.ok\": \"Confirm\",\r\n  \"popConfirm.cancel\": \"Cancel\",\r\n  \"popConfirm.delete\": \"Delete\",\r\n\r\n  \"message.noMoreComment\": \"No more comments\",\r\n  \"message.noMoreData\": \"No more data\",\r\n  \"message.notNull\": \"It's still empty\",\r\n  \"message.success\": \"Comments sent\",\r\n  \"message.replyNoNull\": \"It's still empty\",\r\n  \"message.replySuccess\": \"Reply sent\",\r\n  \"message.cancelLickSuccess\": \"Unliked\",\r\n  \"message.likeSuccess\": \"Liked\"\r\n};\r\n\r\nexport default USdata;\r\n"]}
1
+{"version":3,"sources":["../../src/lang/en-US.js"],"names":["USdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,uBADZ;AAEb,wBAAsB,eAFT;AAGb,sBAAoB,2BAHP;AAIb,sBAAoB,MAJP;AAKb,sBAAoB,iBALP;AAMb,wBAAsB,iCANT;AAOb,sBAAoB,QAPP;;AASb,qBAAmB,SATN;AAUb,0BACE,4DAXW;AAYb,mBAAiB,OAZJ;AAab,yBAAuB,eAbV;;AAeb,sBAAoB,yDAfP;AAgBb,qBAAmB,cAhBN;AAiBb,oBAAkB,cAjBL;;AAmBb,sBAAoB,MAnBP;AAoBb,0BAAwB,kBApBX;;AAsBb,sBAAoB,SAtBP;AAuBb,mBAAiB,SAvBJ;AAwBb,uBAAqB,QAxBR;AAyBb,uBAAqB,QAzBR;;AA2Bb,2BAAyB,kBA3BZ;AA4Bb,wBAAsB,cA5BT;AA6Bb,qBAAmB,kBA7BN;AA8Bb,qBAAmB,eA9BN;AA+Bb,yBAAuB,kBA/BV;AAgCb,0BAAwB,YAhCX;AAiCb,+BAA6B,SAjChB;AAkCb,yBAAuB;AAlCV,CAAf;;kBAqCeA,M","file":"en-US.js","sourcesContent":["const USdata = {\n  \"editor.alreadyEntered\": \"{count} words entered\",\n  \"editor.placeholder\": \"Say something\",\n  \"editor.maxLength\": \"Maximum {maxLength} words\",\n  \"editor.SubmitBtn\": \"Send\",\n  \"editor.uploadTip\": \"Upload pictures\",\n  \"editor.uploadCount\": \"(You could upload {count} more)\",\n  \"editor.uploadBtn\": \"Upload\",\n\n  \"comment.tourist\": \"Visitor\",\n  \"comment.totalComment\":\n    \"Total {total, plural, =1 {one comment} other {# comments}}\",\n  \"comment.reply\": \"Reply\",\n  \"comment.moreComment\": \"More comments\",\n\n  \"reply.totalReply\": \"Total {total, plural, =1 {one reply} other {# replies}}\",\n  \"reply.moreReply\": \"More replies\",\n  \"reply.collapse\": \"Fold replies\",\n\n  \"picture.collapse\": \"Fold\",\n  \"picture.viewOriginal\": \"See the original\",\n\n  \"popConfirm.title\": \"Delete?\",\n  \"popConfirm.ok\": \"Confirm\",\n  \"popConfirm.cancel\": \"Cancel\",\n  \"popConfirm.delete\": \"Delete\",\n\n  \"message.noMoreComment\": \"No more comments\",\n  \"message.noMoreData\": \"No more data\",\n  \"message.notNull\": \"It's still empty\",\n  \"message.success\": \"Comments sent\",\n  \"message.replyNoNull\": \"It's still empty\",\n  \"message.replySuccess\": \"Reply sent\",\n  \"message.cancelLickSuccess\": \"Unliked\",\n  \"message.likeSuccess\": \"Liked\"\n};\n\nexport default USdata;\n"]}

+ 1
- 1
lib/lang/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../src/lang/index.js"],"names":["SUPPORT_LOCALES","name","value","LOCALES_RESPONSE"],"mappings":";;;;;AAAA;;;AAGO,IAAMA,4CAAkB,CAC7B;AACEC,QAAM,SADR;AAEEC,SAAO;AAFT,CAD6B,EAK7B;AACED,QAAM,MADR;AAEEC,SAAO;AAFT,CAL6B,CAAxB;;AAWP;AACO,IAAMC,8CAAmB;AAC9B,WAAS;AACP,iBAAa,MADN;AAEP,mBAAe,MAFR;AAGP,6BAAyB,OAHlB;AAIP,4BAAwB,MAJjB;AAKP,mCAA+B,QALxB;AAMP,2BAAuB,QANhB;AAOP,2BAAuB,MAPhB;AAQP,0BAAsB,MARf;AASP,iCAA6B,QATtB;AAUP,0BAAsB;AAVf,GADqB;AAa9B,WAAS;AACP,iBAAa,SADN;AAEP,mBAAe,cAFR;AAGP,6BAAyB,mBAHlB;AAIP,4BAAwB,eAJjB;AAKP,mCAA+B,iBALxB;AAMP,2BAAuB,yBANhB;AAOP,2BAAuB,iBAPhB;AAQP,0BAAsB,eARf;AASP,iCAA6B,iBATtB;AAUP,0BAAsB;AAVf;AAbqB,CAAzB","file":"index.js","sourcesContent":["/**\r\n * 当前支持的语言\r\n */\r\nexport const SUPPORT_LOCALES = [\r\n  {\r\n    name: \"English\",\r\n    value: \"en-US\"\r\n  },\r\n  {\r\n    name: \"简体中文\",\r\n    value: \"zh-CN\"\r\n  }\r\n];\r\n\r\n// 服务端返回的英文短语和中文提示的对应\r\nexport const LOCALES_RESPONSE = {\r\n  \"zh-CN\": {\r\n    \"not found\": \"没有数据\",\r\n    \"auth failed\": \"请先登录\",\r\n    \"create comment failed\": \"评论未发送\",\r\n    \"comment favor failed\": \"点赞失败\",\r\n    \"delete comment favor failed\": \"取消点赞失败\",\r\n    \"get comments failed\": \"评论加载失败\",\r\n    \"create reply failed\": \"回复失败\",\r\n    \"reply favor failed\": \"点赞失败\",\r\n    \"delete reply favor failed\": \"取消点赞失败\",\r\n    \"get replies failed\": \"回复加载失败\"\r\n  },\r\n  \"en-US\": {\r\n    \"not found\": \"No data\",\r\n    \"auth failed\": \"Please Login\",\r\n    \"create comment failed\": \"Comments not sent\",\r\n    \"comment favor failed\": \"Liking failed\",\r\n    \"delete comment favor failed\": \"Unliking failed\",\r\n    \"get comments failed\": \"Comments loading failed\",\r\n    \"create reply failed\": \"Replying failed\",\r\n    \"reply favor failed\": \"Liking failed\",\r\n    \"delete reply favor failed\": \"Unliking failed\",\r\n    \"get replies failed\": \"Loading of replies failed\"\r\n  }\r\n};\r\n"]}
1
+{"version":3,"sources":["../../src/lang/index.js"],"names":["SUPPORT_LOCALES","name","value","LOCALES_RESPONSE"],"mappings":";;;;;AAAA;;;AAGO,IAAMA,4CAAkB,CAC7B;AACEC,QAAM,SADR;AAEEC,SAAO;AAFT,CAD6B,EAK7B;AACED,QAAM,MADR;AAEEC,SAAO;AAFT,CAL6B,CAAxB;;AAWP;AACO,IAAMC,8CAAmB;AAC9B,WAAS;AACP,iBAAa,MADN;AAEP,mBAAe,MAFR;AAGP,6BAAyB,OAHlB;AAIP,4BAAwB,MAJjB;AAKP,mCAA+B,QALxB;AAMP,2BAAuB,QANhB;AAOP,2BAAuB,MAPhB;AAQP,0BAAsB,MARf;AASP,iCAA6B,QATtB;AAUP,0BAAsB;AAVf,GADqB;AAa9B,WAAS;AACP,iBAAa,SADN;AAEP,mBAAe,cAFR;AAGP,6BAAyB,mBAHlB;AAIP,4BAAwB,eAJjB;AAKP,mCAA+B,iBALxB;AAMP,2BAAuB,yBANhB;AAOP,2BAAuB,iBAPhB;AAQP,0BAAsB,eARf;AASP,iCAA6B,iBATtB;AAUP,0BAAsB;AAVf;AAbqB,CAAzB","file":"index.js","sourcesContent":["/**\n * 当前支持的语言\n */\nexport const SUPPORT_LOCALES = [\n  {\n    name: \"English\",\n    value: \"en-US\"\n  },\n  {\n    name: \"简体中文\",\n    value: \"zh-CN\"\n  }\n];\n\n// 服务端返回的英文短语和中文提示的对应\nexport const LOCALES_RESPONSE = {\n  \"zh-CN\": {\n    \"not found\": \"没有数据\",\n    \"auth failed\": \"请先登录\",\n    \"create comment failed\": \"评论未发送\",\n    \"comment favor failed\": \"点赞失败\",\n    \"delete comment favor failed\": \"取消点赞失败\",\n    \"get comments failed\": \"评论加载失败\",\n    \"create reply failed\": \"回复失败\",\n    \"reply favor failed\": \"点赞失败\",\n    \"delete reply favor failed\": \"取消点赞失败\",\n    \"get replies failed\": \"回复加载失败\"\n  },\n  \"en-US\": {\n    \"not found\": \"No data\",\n    \"auth failed\": \"Please Login\",\n    \"create comment failed\": \"Comments not sent\",\n    \"comment favor failed\": \"Liking failed\",\n    \"delete comment favor failed\": \"Unliking failed\",\n    \"get comments failed\": \"Comments loading failed\",\n    \"create reply failed\": \"Replying failed\",\n    \"reply favor failed\": \"Liking failed\",\n    \"delete reply favor failed\": \"Unliking failed\",\n    \"get replies failed\": \"Loading of replies failed\"\n  }\n};\n"]}

+ 1
- 1
lib/lang/zh-CN.js.map View File

@@ -1 +1 @@
1
-{"version":3,"sources":["../../src/lang/zh-CN.js"],"names":["CNdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,yBADZ;AAEb,wBAAsB,UAFT;AAGb,sBAAoB,iBAHP;AAIb,sBAAoB,IAJP;AAKb,sBAAoB,MALP;AAMb,wBAAsB,mBANT;AAOb,sBAAoB,IAPP;;AASb,qBAAmB,IATN;AAUb,0BAAwB,aAVX;AAWb,mBAAiB,IAXJ;AAYb,yBAAuB,MAZV;;AAcb,sBAAoB,aAdP;AAeb,qBAAmB,MAfN;AAgBb,oBAAkB,MAhBL;;AAkBb,sBAAoB,IAlBP;AAmBb,0BAAwB,MAnBX;;AAqBb,sBAAoB,QArBP;AAsBb,mBAAiB,IAtBJ;AAuBb,uBAAqB,IAvBR;AAwBb,uBAAqB,IAxBR;;AA0Bb,2BAAyB,SA1BZ;AA2Bb,wBAAsB,UA3BT;AA4Bb,qBAAmB,OA5BN;AA6Bb,qBAAmB,QA7BN;AA8Bb,yBAAuB,OA9BV;AA+Bb,0BAAwB,QA/BX;AAgCb,+BAA6B,QAhChB;AAiCb,yBAAuB;AAjCV,CAAf;;kBAoCeA,M","file":"zh-CN.js","sourcesContent":["const CNdata = {\r\n  \"editor.alreadyEntered\": \"已输入{count}/{maxLength}字\",\r\n  \"editor.placeholder\": \"说点什么吧...\",\r\n  \"editor.maxLength\": \"字数上限{maxLength}\",\r\n  \"editor.SubmitBtn\": \"发送\",\r\n  \"editor.uploadTip\": \"上传图片\",\r\n  \"editor.uploadCount\": \"(您还能上传{count}张图片)\",\r\n  \"editor.uploadBtn\": \"上传\",\r\n\r\n  \"comment.tourist\": \"游客\",\r\n  \"comment.totalComment\": \"共{total}条评论\",\r\n  \"comment.reply\": \"回复\",\r\n  \"comment.moreComment\": \"更多评论\",\r\n\r\n  \"reply.totalReply\": \"共{total}条回复\",\r\n  \"reply.moreReply\": \"更多回复\",\r\n  \"reply.collapse\": \"收起回复\",\r\n\r\n  \"picture.collapse\": \"收起\",\r\n  \"picture.viewOriginal\": \"查看原图\",\r\n\r\n  \"popConfirm.title\": \"确定要删除吗\",\r\n  \"popConfirm.ok\": \"确定\",\r\n  \"popConfirm.cancel\": \"取消\",\r\n  \"popConfirm.delete\": \"删除\",\r\n\r\n  \"message.noMoreComment\": \"没有更多评论了\",\r\n  \"message.noMoreData\": \"没有更多数据了!\",\r\n  \"message.notNull\": \"没写内容呢\",\r\n  \"message.success\": \"评论已发送!\",\r\n  \"message.replyNoNull\": \"没写内容呢\",\r\n  \"message.replySuccess\": \"回复已发送!\",\r\n  \"message.cancelLickSuccess\": \"已取消点赞!\",\r\n  \"message.likeSuccess\": \"已赞!\"\r\n};\r\n\r\nexport default CNdata;\r\n"]}
1
+{"version":3,"sources":["../../src/lang/zh-CN.js"],"names":["CNdata"],"mappings":";;;;;AAAA,IAAMA,SAAS;AACb,2BAAyB,yBADZ;AAEb,wBAAsB,UAFT;AAGb,sBAAoB,iBAHP;AAIb,sBAAoB,IAJP;AAKb,sBAAoB,MALP;AAMb,wBAAsB,mBANT;AAOb,sBAAoB,IAPP;;AASb,qBAAmB,IATN;AAUb,0BAAwB,aAVX;AAWb,mBAAiB,IAXJ;AAYb,yBAAuB,MAZV;;AAcb,sBAAoB,aAdP;AAeb,qBAAmB,MAfN;AAgBb,oBAAkB,MAhBL;;AAkBb,sBAAoB,IAlBP;AAmBb,0BAAwB,MAnBX;;AAqBb,sBAAoB,QArBP;AAsBb,mBAAiB,IAtBJ;AAuBb,uBAAqB,IAvBR;AAwBb,uBAAqB,IAxBR;;AA0Bb,2BAAyB,SA1BZ;AA2Bb,wBAAsB,UA3BT;AA4Bb,qBAAmB,OA5BN;AA6Bb,qBAAmB,QA7BN;AA8Bb,yBAAuB,OA9BV;AA+Bb,0BAAwB,QA/BX;AAgCb,+BAA6B,QAhChB;AAiCb,yBAAuB;AAjCV,CAAf;;kBAoCeA,M","file":"zh-CN.js","sourcesContent":["const CNdata = {\n  \"editor.alreadyEntered\": \"已输入{count}/{maxLength}字\",\n  \"editor.placeholder\": \"说点什么吧...\",\n  \"editor.maxLength\": \"字数上限{maxLength}\",\n  \"editor.SubmitBtn\": \"发送\",\n  \"editor.uploadTip\": \"上传图片\",\n  \"editor.uploadCount\": \"(您还能上传{count}张图片)\",\n  \"editor.uploadBtn\": \"上传\",\n\n  \"comment.tourist\": \"游客\",\n  \"comment.totalComment\": \"共{total}条评论\",\n  \"comment.reply\": \"回复\",\n  \"comment.moreComment\": \"更多评论\",\n\n  \"reply.totalReply\": \"共{total}条回复\",\n  \"reply.moreReply\": \"更多回复\",\n  \"reply.collapse\": \"收起回复\",\n\n  \"picture.collapse\": \"收起\",\n  \"picture.viewOriginal\": \"查看原图\",\n\n  \"popConfirm.title\": \"确定要删除吗\",\n  \"popConfirm.ok\": \"确定\",\n  \"popConfirm.cancel\": \"取消\",\n  \"popConfirm.delete\": \"删除\",\n\n  \"message.noMoreComment\": \"没有更多评论了\",\n  \"message.noMoreData\": \"没有更多数据了!\",\n  \"message.notNull\": \"没写内容呢\",\n  \"message.success\": \"评论已发送!\",\n  \"message.replyNoNull\": \"没写内容呢\",\n  \"message.replySuccess\": \"回复已发送!\",\n  \"message.cancelLickSuccess\": \"已取消点赞!\",\n  \"message.likeSuccess\": \"已赞!\"\n};\n\nexport default CNdata;\n"]}

+ 1
- 1
lib/registerServiceWorker.js.map
File diff suppressed because it is too large
View File


+ 4
- 4
lib/version.json View File

@@ -1,8 +1,8 @@
1 1
 {
2 2
     "name":       "comment",
3
-    "buildDate":  1550239468846,
4
-    "version":    "1.0.3",
5
-    "numCommits": 129,
6
-    "hash":       "486ece3",
3
+    "buildDate":  1559795177962,
4
+    "version":    "1.0.4",
5
+    "numCommits": 137,
6
+    "hash":       "c861eb3",
7 7
     "dirty":      true
8 8
 }

+ 7
- 1
src/components/ContentItem/index.css View File

@@ -16,7 +16,13 @@
16 16
   margin-left: 10px;
17 17
   margin-bottom: 20px;
18 18
 }
19
-
19
+.comment-item-avatar {
20
+  width: 40px;
21
+  height: 40px;
22
+  border-radius: 20px;
23
+  background-position: center;
24
+  background-size: cover;
25
+}
20 26
 .comment-item-content {
21 27
   margin: 10px 0;
22 28
   word-break: break-all;

+ 7
- 1
src/components/ContentItem/index.js View File

@@ -116,7 +116,13 @@ class CommentItem extends Component {
116 116
     return (
117 117
       <div className="comment-item-box">
118 118
         <div className="comment-item-left">
119
-          <Avatar src={content.user_avatar || avatar} size="large" />
119
+          {/* <Avatar src={content.user_avatar || avatar} size="large" /> */}
120
+          <div
121
+            className="comment-item-avatar"
122
+            style={{
123
+              backgroundImage: `url(${content.user_avatar || avatar})`
124
+            }}
125
+          />
120 126
         </div>
121 127
         <div className="comment-item-right">
122 128
           <div>

+ 2
- 1
src/components/Editor/Upload.js View File

@@ -103,7 +103,7 @@ class App extends React.Component {
103 103
 
104 104
   render() {
105 105
     const { previewVisible, previewImage } = this.state;
106
-    const { fileList, maxUpload } = this.props;
106
+    const { fileList, maxUpload, multiple } = this.props;
107 107
     const uploadButton = (
108 108
       <div>
109 109
         <Icon type="plus" />
@@ -114,6 +114,7 @@ class App extends React.Component {
114 114
       <div>
115 115
         <Upload
116 116
           accept="image/jpg,image/jpeg,image/png,image/bmp"
117
+          multiple={multiple}
117 118
           listType="picture-card"
118 119
           fileList={fileList}
119 120
           customRequest={this.customRequest}

+ 8
- 2
src/components/Editor/index.js View File

@@ -172,6 +172,8 @@ class Editor extends React.Component {
172 172
       rows,
173 173
       showEmoji,
174 174
       showUpload,
175
+      multiple,
176
+      emojiPopoverPlacement,
175 177
       closeUploadWhenBlur,
176 178
       maxUpload,
177 179
       // btnSubmitText,
@@ -199,7 +201,6 @@ class Editor extends React.Component {
199 201
             "comment-editor-toolbar-error": inputValue.length > maxLength
200 202
           })}
201 203
         >
202
-
203 204
           {/* {intl.get("editor.alreadyEntered", {
204 205
             count: inputValue.length,
205 206
             maxLength
@@ -219,7 +220,7 @@ class Editor extends React.Component {
219 220
               {showEmoji && (
220 221
                 <Popover
221 222
                   trigger="click"
222
-                  placement="bottomLeft"
223
+                  placement={emojiPopoverPlacement}
223 224
                   autoAdjustOverflow={false}
224 225
                   content={
225 226
                     <div
@@ -264,6 +265,7 @@ class Editor extends React.Component {
264 265
                       }}
265 266
                     >
266 267
                       <Upload
268
+                        multiple={multiple}
267 269
                         onChangeFileList={this.handleChangeFileList}
268 270
                         onUpload={this.handleUpload}
269 271
                         maxUpload={maxUpload}
@@ -343,7 +345,9 @@ Editor.propTypes = {
343 345
   rows: PropTypes.number,
344 346
   placeholder: PropTypes.string,
345 347
   showEmoji: PropTypes.bool,
348
+  emojiPopoverPlacement: PropTypes.string,
346 349
   showUpload: PropTypes.bool,
350
+  multiple: PropTypes.bool,
347 351
   closeUploadWhenBlur: PropTypes.bool,
348 352
   maxUpload: PropTypes.number,
349 353
   value: PropTypes.string,
@@ -366,6 +370,8 @@ Editor.defaultProps = {
366 370
   // placeholder: "说点什么吧",
367 371
   showEmoji: true,
368 372
   showUpload: true,
373
+  multiple: true,
374
+  emojiPopoverPlacement: "bottomLeft",
369 375
   closeUploadWhenBlur: false,
370 376
   maxUpload: 1,
371 377
   // btnSubmitText: "发表",

+ 3
- 0
src/index.js View File

@@ -52,6 +52,9 @@ if (process.env.NODE_ENV !== "production") {
52 52
     userId: 71299,
53 53
     onCountChange: c => {
54 54
       console.log(c);
55
+    },
56
+    editorProps: {
57
+      // emojiPopoverPlacement: "bottom"
55 58
     }
56 59
   });
57 60
 }