node 6 years ago
parent
commit
60fce8a319

+ 11
- 0
lib/App.css View File

@@ -2,6 +2,8 @@
2 2
   width: 100%;
3 3
   padding: 10px;
4 4
   margin-bottom: 100px;
5
+  background: rgba(0, 0, 0, 1);
6
+  color: white;
5 7
 }
6 8
 
7 9
 .comment .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
@@ -28,3 +30,12 @@
28 30
 .comment-img {
29 31
   max-width: 100%;
30 32
 }
33
+.app-comment {
34
+  position: fixed;
35
+  bottom: 0;
36
+  width: 100%;
37
+  margin: 0;
38
+  padding: 0;
39
+  right: 0;
40
+  left: 0;
41
+}

+ 6
- 2
lib/App.js View File

@@ -595,11 +595,15 @@ var App = function (_Component) {
595 595
         _react2.default.createElement(
596 596
           "div",
597 597
           { className: "comment" },
598
-          this.props.showEditor && _react2.default.createElement(_CommentInput2.default, { content: this.props.children }),
599 598
           this.props.showList && _react2.default.createElement(
600 599
             "div",
601
-            { style: { marginTop: 20 } },
600
+            null,
602 601
             _react2.default.createElement(_CommentList2.default, null)
602
+          ),
603
+          this.props.showEditor && _react2.default.createElement(
604
+            "div",
605
+            { className: "app-comment" },
606
+            _react2.default.createElement(_CommentInput2.default, { content: this.props.children })
603 607
           )
604 608
         )
605 609
       );

+ 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"]}

BIN
lib/assets/img.png View File


+ 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"]}

+ 4
- 4
lib/components/CommentBox/index.css View File

@@ -1,15 +1,15 @@
1 1
 .comment-show-more {
2
-  color: #4a90e2;
2
+  color: #d5d5d5;
3 3
   text-align: center;
4 4
   width: 100px;
5
-  background-color: #f8f8f8;
5
+  /* background-color: #f8f8f8; */
6 6
   cursor: pointer;
7
-  padding: 10px;
7
+  /* padding: 10px; */
8 8
   margin: 0 auto;
9 9
   transition: all 0.3s;
10 10
 }
11 11
 .comment-show-more:hover {
12
-  background-color: #f5f5f5;
12
+  /* background-color: #f5f5f5; */
13 13
   color: #1890ff;
14 14
 }
15 15
 .comment-more-box {

+ 89
- 21
lib/components/CommentBox/index.js View File

@@ -20,10 +20,6 @@ var _propTypes = require("prop-types");
20 20
 
21 21
 var _propTypes2 = _interopRequireDefault(_propTypes);
22 22
 
23
-var _reactIntlUniversal = require("react-intl-universal");
24
-
25
-var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
26
-
27 23
 var _Comment = require("../../Comment");
28 24
 
29 25
 var _Comment2 = _interopRequireDefault(_Comment);
@@ -32,6 +28,10 @@ var _ContentItem = require("./../ContentItem");
32 28
 
33 29
 var _ContentItem2 = _interopRequireDefault(_ContentItem);
34 30
 
31
+var _ReplyItem = require("./../ReplyItem");
32
+
33
+var _ReplyItem2 = _interopRequireDefault(_ReplyItem);
34
+
35 35
 require("./index.css");
36 36
 
37 37
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -41,6 +41,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
41 41
 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; }
42 42
 
43 43
 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; }
44
+// import intl from "react-intl-universal";
45
+
44 46
 
45 47
 var CommentBox = function (_Component) {
46 48
   _inherits(CommentBox, _Component);
@@ -93,6 +95,67 @@ var CommentBox = function (_Component) {
93 95
      * @param {number} replies 回复的数量
94 96
      * @param {boolean} isNoMoreReply 是否没有更多回复
95 97
      */
98
+    // renderReplies(replies, replyCount, isNoMoreReply) {
99
+    //   console.log('replies', replies);
100
+    //   console.log('replyCount', replyCount);
101
+    //   console.log('isNoMoreReply', isNoMoreReply);
102
+    //   const { commentId } = this.props;
103
+    //   const { showReply } = this.state;
104
+    //   if (showReply && replies && replies.length) {
105
+    //     const len = replies.length;
106
+    //     return (
107
+    //       <div style={{ marginLeft: 50 }}>
108
+    //         {replies.map((item, index) => {
109
+    //           if (index === len - 1) {
110
+    //             return [
111
+    //               <ContentItem
112
+    //                 commentId={commentId}
113
+    //                 replyId={item.id}
114
+    //                 key={item.id}
115
+    //                 content={item}
116
+    //                 action="replyToReply" // 回复的回复
117
+    //               />,
118
+    //               <div className="comment-more-box" key="show_more_button">
119
+    //                 {!isNoMoreReply && replyCount !== len && (
120
+    //                   <span
121
+    //                     className="comment-show-more"
122
+    //                     onClick={() => this.handleGetMoreReply(commentId)}
123
+    //                   >
124
+    //                     {intl.get("reply.moreReply")}
125
+    //                   </span>
126
+    //                 )}
127
+
128
+    //                 <a
129
+    //                   style={{ float: "right" }}
130
+    //                   onClick={this.handleToggleReply}
131
+    //                 >
132
+    //                   <Icon type="up" /> {intl.get("reply.collapse")}
133
+    //                 </a>
134
+    //               </div>
135
+    //             ];
136
+    //           }
137
+    //           return (
138
+    //             <ContentItem
139
+    //               commentId={commentId}
140
+    //               replyId={item.id}
141
+    //               key={item.id}
142
+    //               content={item}
143
+    //               action="replyToReply" // 评论的回复
144
+    //             />
145
+    //           );
146
+    //         })}
147
+    //       </div>
148
+    //     );
149
+    //   }
150
+    //   return null;
151
+    // }
152
+
153
+    /**
154
+     * 渲染回复 DOM
155
+     * @param {array} replies 回复列表
156
+     * @param {number} replyCount 回复的数量
157
+     * @param {boolean} isNoMoreReply 是否没有更多回复
158
+     */
96 159
 
97 160
   }, {
98 161
     key: "renderReplies",
@@ -106,18 +169,25 @@ var CommentBox = function (_Component) {
106 169
         var len = replies.length;
107 170
         return _react2.default.createElement(
108 171
           "div",
109
-          { style: { marginLeft: 50 } },
172
+          {
173
+            style: {
174
+              marginLeft: 50,
175
+              borderTop: "1px solid #929292",
176
+              paddingTop: 15,
177
+              marginTop: 10,
178
+              overflow: "auto"
179
+            }
180
+          },
110 181
           replies.map(function (item, index) {
111 182
             if (index === len - 1) {
112
-              return [_react2.default.createElement(_ContentItem2.default, {
113
-                commentId: commentId,
114
-                replyId: item.id,
183
+              return [_react2.default.createElement(_ReplyItem2.default, {
184
+                replyItem: item,
115 185
                 key: item.id,
116
-                content: item,
117
-                action: "replyToReply" // 回复的回复
186
+                commentId: commentId,
187
+                action: "replyToReply"
118 188
               }), _react2.default.createElement(
119 189
                 "div",
120
-                { className: "comment-more-box", key: "show_more_button" },
190
+                { key: "show_more_button" },
121 191
                 !isNoMoreReply && replyCount !== len && _react2.default.createElement(
122 192
                   "span",
123 193
                   {
@@ -126,31 +196,29 @@ var CommentBox = function (_Component) {
126 196
                       return _this2.handleGetMoreReply(commentId);
127 197
                     }
128 198
                   },
129
-                  _reactIntlUniversal2.default.get("reply.moreReply")
199
+                  "\u5C55\u5F00\u66F4\u591A\u8BC4\u8BBA",
200
+                  _react2.default.createElement(_icon2.default, { type: "down" })
130 201
                 ),
131 202
                 _react2.default.createElement(
132 203
                   "a",
133 204
                   {
134
-                    style: { float: "right" },
205
+                    style: { float: "right", color: "#d5d5d5" },
135 206
                     onClick: _this2.handleToggleReply
136 207
                   },
137 208
                   _react2.default.createElement(_icon2.default, { type: "up" }),
138
-                  " ",
139
-                  _reactIntlUniversal2.default.get("reply.collapse")
209
+                  " \u6536\u8D77"
140 210
                 )
141 211
               )];
142 212
             }
143
-            return _react2.default.createElement(_ContentItem2.default, {
144
-              commentId: commentId,
145
-              replyId: item.id,
213
+            return _react2.default.createElement(_ReplyItem2.default, {
214
+              replyItem: item,
146 215
               key: item.id,
147
-              content: item,
148
-              action: "replyToReply" // 评论的回复
216
+              commentId: commentId,
217
+              action: "replyToReply"
149 218
             });
150 219
           })
151 220
         );
152 221
       }
153
-      return null;
154 222
     }
155 223
   }, {
156 224
     key: "render",

+ 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


+ 3
- 10
lib/components/CommentList/index.js View File

@@ -22,10 +22,6 @@ var _react = require("react");
22 22
 
23 23
 var _react2 = _interopRequireDefault(_react);
24 24
 
25
-var _reactIntlUniversal = require("react-intl-universal");
26
-
27
-var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
28
-
29 25
 var _Comment = require("../../Comment");
30 26
 
31 27
 var _Comment2 = _interopRequireDefault(_Comment);
@@ -43,6 +39,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
43 39
 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; }
44 40
 
45 41
 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; }
42
+// import intl from "react-intl-universal";
43
+
46 44
 
47 45
 var CommentList = function (_Component) {
48 46
   _inherits(CommentList, _Component);
@@ -100,7 +98,7 @@ var CommentList = function (_Component) {
100 98
             _react2.default.createElement(
101 99
               "span",
102 100
               null,
103
-              _reactIntlUniversal2.default.get("comment.moreComment")
101
+              "\u66F4\u591A\u8BC4\u8BBA"
104 102
             )
105 103
           );
106 104
         } else {
@@ -138,11 +136,6 @@ var CommentList = function (_Component) {
138 136
         _react2.default.createElement(
139 137
           _spin2.default,
140 138
           { spinning: spinning },
141
-          _react2.default.createElement(
142
-            "div",
143
-            null,
144
-            _reactIntlUniversal2.default.get("comment.totalComment", { total: total })
145
-          ),
146 139
           list.map(function (item) {
147 140
             return _react2.default.createElement(_CommentBox2.default, { content: item, key: item.id, commentId: item.id });
148 141
           }),

+ 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,CAA2B,EAAEC,MAAM,KAAKJ,KAAL,CAAWE,GAAX,CAAeE,IAAvB,EAA3B;AACD;;;uCAEkB;AAAA,uBAWb,KAAKJ,KAAL,CAAWE,GAXE;AAAA,UAEfG,IAFe,cAEfA,IAFe;AAAA,UAGfC,KAHe,cAGfA,KAHe;AAAA,UAIfF,IAJe,cAIfA,IAJe;AAAA,UAKfG,QALe,cAKfA,QALe;AAAA,UAMfC,KANe,cAMfA,KANe;AAAA,UAOfC,eAPe,cAOfA,eAPe;AAAA,UAQfN,WARe,cAQfA,WARe;AAAA,UASfO,YATe,cASfA,YATe;AAAA,UAUfC,iBAVe,cAUfA,iBAVe;;AAYjB,UAAIJ,aAAa,OAAjB,EAA0B;AACxB;AACA,eACE;AAAA;AAAA,YAAK,WAAU,wBAAf,EAAwC,SAASI,iBAAjD;AACE;AAAA;AAAA;AAAA;AAAA;AADF,SADF;AAKD,OAPD,MAOO,IAAIJ,aAAa,MAAjB,EAAyB;AAC9B,YAAI,CAACE,eAAD,IAAoBJ,KAAKO,MAAL,KAAgBN,KAAxC,EAA+C;AAC7C,iBACE;AAAA;AAAA;AACE,yBAAU,wBADZ;AAEE,uBAAS,mBAAM;AACbH,4BAAY,EAAEC,MAAMA,OAAO,CAAf,EAAZ;AACAM,6BAAaN,OAAO,CAApB;AACD;AALH;AAOE;AAAA;AAAA;AAAOS,2CAAKC,GAAL,CAAS,qBAAT;AAAP;AAPF,WADF;AAWD,SAZD,MAYO;AACL,iBAAO,IAAP;AACD;AACF,OAhBM,MAgBA,IAAIP,aAAa,YAAjB,EAA+B;AACpC,eACE;AAAA;AAAA,YAAK,WAAU,yBAAf;AACE;AACE,sBAAUC,KADZ;AAEE,qBAASJ,IAFX;AAGE,mBAAOE,KAHT;AAIE,sBAAU,qBAAK;AACbH,0BAAY,EAAEC,MAAMW,CAAR,EAAZ;AACAL,2BAAaK,CAAb;AACD;AAPH;AADF,SADF;AAaD;AACF;;;6BAEQ;AAAA,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\";\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","p","loading","spinning","Boolean","sCommentFavor","sReplyFavor","map","item","id","renderPagination","Component","propTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;AAGA;;;;AACA;;;;AACA;;;;;;;;;AAHA;;;IAKMA,W;;;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;;AAAA,0HACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa,EAAb;AAFiB;AAGlB;;;;yCAEoB;AACnB,WAAKD,KAAL,CAAWE,GAAX,CAAeC,WAAf,CAA2B,EAAEC,MAAM,KAAKJ,KAAL,CAAWE,GAAX,CAAeE,IAAvB,EAA3B;AACD;;;uCAEkB;AAAA,uBAWb,KAAKJ,KAAL,CAAWE,GAXE;AAAA,UAEfG,IAFe,cAEfA,IAFe;AAAA,UAGfC,KAHe,cAGfA,KAHe;AAAA,UAIfF,IAJe,cAIfA,IAJe;AAAA,UAKfG,QALe,cAKfA,QALe;AAAA,UAMfC,KANe,cAMfA,KANe;AAAA,UAOfC,eAPe,cAOfA,eAPe;AAAA,UAQfN,WARe,cAQfA,WARe;AAAA,UASfO,YATe,cASfA,YATe;AAAA,UAUfC,iBAVe,cAUfA,iBAVe;;AAYjB,UAAIJ,aAAa,OAAjB,EAA0B;AACxB;AACA,eACE;AAAA;AAAA,YAAK,WAAU,wBAAf,EAAwC,SAASI,iBAAjD;AACE;AAAA;AAAA;AAAA;AAAA;AADF,SADF;AAKD,OAPD,MAOO,IAAIJ,aAAa,MAAjB,EAAyB;AAC9B,YAAI,CAACE,eAAD,IAAoBJ,KAAKO,MAAL,KAAgBN,KAAxC,EAA+C;AAC7C,iBACE;AAAA;AAAA;AACE,yBAAU,wBADZ;AAEE,uBAAS,mBAAM;AACbH,4BAAY,EAAEC,MAAMA,OAAO,CAAf,EAAZ;AACAM,6BAAaN,OAAO,CAApB;AACD;AALH;AAQE;AAAA;AAAA;AAAA;AAAA;AARF,WADF;AAYD,SAbD,MAaO;AACL,iBAAO,IAAP;AACD;AACF,OAjBM,MAiBA,IAAIG,aAAa,YAAjB,EAA+B;AACpC,eACE;AAAA;AAAA,YAAK,WAAU,yBAAf;AACE;AACE,sBAAUC,KADZ;AAEE,qBAASJ,IAFX;AAGE,mBAAOE,KAHT;AAIE,sBAAU,qBAAK;AACbH,0BAAY,EAAEC,MAAMS,CAAR,EAAZ;AACAH,2BAAaG,CAAb;AACD;AAPH;AADF,SADF;AAaD;AACF;;;6BAEQ;AAAA,wBAC0B,KAAKb,KAAL,CAAWE,GADrC;AAAA,UACCG,IADD,eACCA,IADD;AAAA,UACOC,KADP,eACOA,KADP;AAAA,UACcQ,OADd,eACcA,OADd;;;AAGP,UAAMC,WAAWC,QACfF,QAAQX,WAAR,IAAuBW,QAAQG,aAA/B,IAAgDH,QAAQI,WADzC,CAAjB;AAGA,aACE;AAAA;AAAA;AACE;AAAA;AAAA,YAAM,UAAUH,QAAhB;AAGGV,eAAKc,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;;;;EAjFuBC,gB;;AAoF1BxB,YAAYyB,SAAZ,GAAwB,EAAxB;;kBAEe,uBAAQzB,WAAR,C","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\nimport { Spin, Pagination } from \"antd\";\n// import 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            <span>更多评论</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"]}

+ 12
- 5
lib/components/ContentItem/index.css View File

@@ -1,7 +1,7 @@
1 1
 .comment-item-box {
2 2
   margin: 10px 0 0 0;
3 3
   padding: 15px 5px 0 5px;
4
-  border-top: 1px solid #eee;
4
+  border-top: 1px solid #929292;
5 5
 }
6 6
 
7 7
 .comment-item-left {
@@ -14,21 +14,23 @@
14 14
   display: inline-block;
15 15
   width: 90%;
16 16
   margin-left: 10px;
17
-  margin-bottom: 20px;
17
+  /* margin-bottom: 20px; */
18 18
 }
19 19
 
20 20
 .comment-item-content {
21
-  margin: 10px 0;
21
+  margin: 10px 0 20px 0;
22 22
   word-break: break-all;
23
+  margin-bottom: 10px;
23 24
 }
24 25
 
25 26
 .comment-item-bottom {
26
-  margin: 20px auto;
27
+  margin: 0px auto;
27 28
 }
28 29
 
29 30
 .comment-item-bottom-left {
30 31
   float: left;
31 32
   user-select: none;
33
+  color: #d5d5d5;
32 34
 }
33 35
 
34 36
 .comment-item-bottom-right {
@@ -38,7 +40,7 @@
38 40
 }
39 41
 
40 42
 .comment-favor {
41
-  font-size: 20px;
43
+  /* font-size: 20px; */
42 44
 }
43 45
 
44 46
 .comment-favored {
@@ -81,6 +83,11 @@
81 83
   margin-right: 10px;
82 84
 }
83 85
 
86
+.comment-item-icon {
87
+  float: right;
88
+  margin-left: 10px;
89
+}
90
+
84 91
 @media screen and (max-width: 616px) and (min-width: 449px) {
85 92
   .comment-item-right {
86 93
     display: inline-block;

+ 47
- 84
lib/components/ContentItem/index.js View File

@@ -4,30 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4 4
   value: true
5 5
 });
6 6
 
7
-var _popconfirm = require("antd/es/popconfirm");
8
-
9
-var _popconfirm2 = _interopRequireDefault(_popconfirm);
10
-
11 7
 var _icon = require("antd/es/icon");
12 8
 
13 9
 var _icon2 = _interopRequireDefault(_icon);
14 10
 
15
-var _tooltip = require("antd/es/tooltip");
16
-
17
-var _tooltip2 = _interopRequireDefault(_tooltip);
18
-
19 11
 var _avatar = require("antd/es/avatar");
20 12
 
21 13
 var _avatar2 = _interopRequireDefault(_avatar);
22 14
 
23 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; }; }();
24 16
 
25
-require("antd/es/popconfirm/style/css");
26
-
27 17
 require("antd/es/icon/style/css");
28 18
 
29
-require("antd/es/tooltip/style/css");
30
-
31 19
 require("antd/es/avatar/style/css");
32 20
 
33 21
 var _react = require("react");
@@ -48,10 +36,6 @@ var _relativeTime = require("dayjs/plugin/relativeTime");
48 36
 
49 37
 var _relativeTime2 = _interopRequireDefault(_relativeTime);
50 38
 
51
-var _reactIntlUniversal = require("react-intl-universal");
52
-
53
-var _reactIntlUniversal2 = _interopRequireDefault(_reactIntlUniversal);
54
-
55 39
 var _Comment = require("../../Comment");
56 40
 
57 41
 var _Comment2 = _interopRequireDefault(_Comment);
@@ -85,13 +69,15 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
85 69
 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; }
86 70
 // import 'dayjs/locale/es';
87 71
 
72
+// import intl from "react-intl-universal";
73
+
88 74
 
89
-// dayjs.locale("zh-cn");
75
+_dayjs2.default.locale("zh-cn");
90 76
 _dayjs2.default.extend(_relativeTime2.default);
91 77
 
92
-var LOCALES = {
93
-  "zh-CN": "zh-cn"
94
-};
78
+// const LOCALES = {
79
+//   "zh-CN": "zh-cn"
80
+// };
95 81
 
96 82
 var CommentItem = function (_Component) {
97 83
   _inherits(CommentItem, _Component);
@@ -169,7 +155,9 @@ var CommentItem = function (_Component) {
169 155
           showReply = _props.showReply,
170 156
           onShowReply = _props.onShowReply,
171 157
           app = _props.app;
172
-      var locale = this.props.app.locale;
158
+
159
+      // const { locale } = this.props.app;
160
+
173 161
       var showInput = this.state.showInput;
174 162
 
175 163
 
@@ -211,22 +199,47 @@ var CommentItem = function (_Component) {
211 199
             null,
212 200
             _react2.default.createElement(
213 201
               "strong",
214
-              null,
215
-              content.user_name || _reactIntlUniversal2.default.get("comment.tourist")
202
+              { style: { color: "#75ACFF" } },
203
+              content.user_name || "游客"
216 204
             ),
217 205
             _react2.default.createElement(
218 206
               "span",
219
-              { style: { marginLeft: 10 } },
220
-              _react2.default.createElement(
221
-                _tooltip2.default,
222
-                {
223
-                  placement: "top",
224
-                  title: (0, _dayjs2.default)(content.created * 1000).format("YYYY-MM-DD HH:mm:ss")
207
+              {
208
+                className: "comment-item-icon",
209
+                onClick: this.handleToggleInput
210
+              },
211
+              _react2.default.createElement(_icon2.default, { type: "message" }),
212
+              "\xA0 ",
213
+              content.reply_count
214
+            ),
215
+            _react2.default.createElement(
216
+              "span",
217
+              { className: "comment-item-icon" },
218
+              _react2.default.createElement(_icon2.default, {
219
+                type: "heart",
220
+                onClick: function onClick() {
221
+                  if (replyId) {
222
+                    // 如果有 replyId,则说明是评论的回复
223
+                    app.sReplyFavor(content.id, commentId, content.favored);
224
+                    return;
225
+                  }
226
+                  app.sCommentFavor(content.id, content.favored);
225 227
                 },
226
-                LOCALES[locale] ? (0, _dayjs2.default)(content.created * 1000).locale(LOCALES[locale]).fromNow() : (0, _dayjs2.default)(content.created * 1000).fromNow()
227
-              )
228
+                className: content.favored ? "comment-favor comment-favored" : "comment-favor"
229
+              }),
230
+              "\xA0 ",
231
+              content.favor_count
228 232
             )
229 233
           ),
234
+          _react2.default.createElement(
235
+            "div",
236
+            { style: { color: "#D5D5D5" } },
237
+            (0, _dayjs2.default)(content.created * 1000).format("MM-DD HH:mm:ss")
238
+          )
239
+        ),
240
+        _react2.default.createElement(
241
+          "div",
242
+          { style: { overflow: "auto" } },
230 243
           _react2.default.createElement("div", {
231 244
             className: "comment-item-content",
232 245
             dangerouslySetInnerHTML: {
@@ -285,61 +298,11 @@ var CommentItem = function (_Component) {
285 298
               _react2.default.createElement(
286 299
                 "a",
287 300
                 { className: "comment-item-bottom-left", onClick: onShowReply },
288
-                _reactIntlUniversal2.default.get("reply.totalReply", { total: content.reply_count }),
301
+                content.reply_count,
302
+                " \u6761\u56DE\u590D",
289 303
                 showReply ? _react2.default.createElement(_icon2.default, { type: "up" }) : _react2.default.createElement(_icon2.default, { type: "down" })
290 304
               )
291
-            ) : null,
292
-            app.userId === content.user_id && _react2.default.createElement(
293
-              _popconfirm2.default,
294
-              {
295
-                // title="确定要删除吗?"
296
-                title: _reactIntlUniversal2.default.get("popConfirm.title"),
297
-                onConfirm: function onConfirm() {
298
-                  if (replyId) {
299
-                    app.sDeleteReply(content.id, commentId);
300
-                    return;
301
-                  }
302
-                  app.sDeleteComment(content.id);
303
-                },
304
-                okText: _reactIntlUniversal2.default.get("popConfirm.ok"),
305
-                cancelText: _reactIntlUniversal2.default.get("popConfirm.cancel")
306
-              },
307
-              _react2.default.createElement(
308
-                "a",
309
-                { className: "comment-item-bottom-right" },
310
-                "\xA0 ",
311
-                _reactIntlUniversal2.default.get("popConfirm.delete")
312
-              )
313
-            ),
314
-            _react2.default.createElement(
315
-              "a",
316
-              {
317
-                onClick: this.handleToggleInput,
318
-                className: "comment-item-bottom-right"
319
-              },
320
-              "\xA0 ",
321
-              _reactIntlUniversal2.default.get("comment.reply")
322
-            ),
323
-            _react2.default.createElement(
324
-              "div",
325
-              {
326
-                className: "comment-item-bottom-right",
327
-                onClick: function onClick() {
328
-                  if (replyId) {
329
-                    // 如果有 replyId,则说明是评论的回复
330
-                    app.sReplyFavor(content.id, commentId, content.favored);
331
-                    return;
332
-                  }
333
-                  app.sCommentFavor(content.id, content.favored);
334
-                }
335
-              },
336
-              _react2.default.createElement(_icon2.default, {
337
-                type: "like-o",
338
-                className: content.favored ? "comment-favor comment-favored" : "comment-favor"
339
-              }),
340
-              "\xA0",
341
-              content.favor_count
342
-            )
305
+            ) : null
343 306
           )
344 307
         ),
345 308
         showInput && _react2.default.createElement(_CommentInput2.default, {

+ 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"]}

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


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

@@ -100,3 +100,11 @@
100 100
 .clearfix {
101 101
   clear: both;
102 102
 }
103
+
104
+.submitBtn {
105
+  width: 88px;
106
+  height: 30px;
107
+  background: rgba(252, 71, 71, 1);
108
+  border-radius: 15px;
109
+  color: #fff;
110
+}

+ 16
- 20
lib/components/Editor/index.js View File

@@ -222,8 +222,8 @@ var Editor = function (_React$Component) {
222 222
           fileList = _state.fileList;
223 223
 
224 224
       if (value.length > maxLength) {
225
-        // message.error(`字数不得超过${maxLength}字`);
226
-        _message3.default.error(_reactIntlUniversal2.default.get("editor.maxLength", { maxLength: maxLength }));
225
+        _message3.default.error("\u5B57\u6570\u4E0D\u5F97\u8D85\u8FC7" + maxLength + "\u5B57");
226
+        // message.error(intl.get("editor.maxLength", { maxLength }));
227 227
         return;
228 228
       }
229 229
       var files = [];
@@ -274,7 +274,6 @@ var Editor = function (_React$Component) {
274 274
           value = _props.value,
275 275
           rows = _props.rows,
276 276
           showEmoji = _props.showEmoji,
277
-          showUpload = _props.showUpload,
278 277
           closeUploadWhenBlur = _props.closeUploadWhenBlur,
279 278
           maxUpload = _props.maxUpload,
280 279
           btnLoading = _props.btnLoading,
@@ -285,27 +284,16 @@ var Editor = function (_React$Component) {
285 284
           maxLength = _props.maxLength,
286 285
           autoFocus = _props.autoFocus;
287 286
 
288
-      var placeholder = this.props.placeholder || _reactIntlUniversal2.default.get("editor.placeholder");
289
-      var btnSubmitText = this.props.placeholder || _reactIntlUniversal2.default.get("editor.SubmitBtn");
287
+
288
+      var showUpload = false;
289
+      var placeholder = this.props.placeholder || "快发表评论吧!";
290
+      var btnSubmitText = this.props.placeholder || "发表评论";
290 291
       var handleSubmit = this.handleSubmit;
291 292
       var disabledSubmit = btnDisabled || !this.props.value && !this.state.value && !this.state.fileList.length;
292 293
       var inputValue = value || this.state.value;
293 294
       return _react2.default.createElement(
294 295
         "div",
295 296
         { 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
-          _reactIntlUniversal2.default.get("editor.alreadyEntered", {
305
-            count: inputValue.length,
306
-            maxLength: maxLength
307
-          })
308
-        ),
309 297
         _react2.default.createElement(
310 298
           "div",
311 299
           { className: "comment-editor" },
@@ -411,6 +399,13 @@ var Editor = function (_React$Component) {
411 399
             _react2.default.createElement(
412 400
               "div",
413 401
               { className: "comment-toolbar-right" },
402
+              _react2.default.createElement(
403
+                "span",
404
+                { style: { marginRight: 10 } },
405
+                inputValue.length,
406
+                " / ",
407
+                maxLength
408
+              ),
414 409
               button ? _react2.default.cloneElement(button, {
415 410
                 onClick: button.props.onClick || handleSubmit
416 411
               }) : _react2.default.createElement(
@@ -418,8 +413,9 @@ var Editor = function (_React$Component) {
418 413
                 {
419 414
                   onClick: function onClick() {
420 415
                     return _this3.handleSubmit();
421
-                  },
422
-                  type: "primary",
416
+                  }
417
+                  // type="primary"
418
+                  , className: "submitBtn",
423 419
                   loading: btnLoading,
424 420
                   disabled: disabledSubmit
425 421
                 },

+ 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"]}

+ 13
- 0
lib/components/ReplyItem/index.css View File

@@ -0,0 +1,13 @@
1
+.reply-item {
2
+  margin-bottom: 20px;
3
+  /* margin-top: 5px; */
4
+  color: #d5d5d5;
5
+}
6
+
7
+.reply-item-content {
8
+  margin-bottom: 10px;
9
+}
10
+
11
+.reply-item-span {
12
+  margin-right: 25px;
13
+}

+ 135
- 0
lib/components/ReplyItem/index.js View File

@@ -0,0 +1,135 @@
1
+"use strict";
2
+
3
+Object.defineProperty(exports, "__esModule", {
4
+  value: true
5
+});
6
+
7
+var _icon = require("antd/es/icon");
8
+
9
+var _icon2 = _interopRequireDefault(_icon);
10
+
11
+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; }; }();
12
+
13
+require("antd/es/icon/style/css");
14
+
15
+var _react = require("react");
16
+
17
+var _react2 = _interopRequireDefault(_react);
18
+
19
+var _Comment = require("../../Comment");
20
+
21
+var _Comment2 = _interopRequireDefault(_Comment);
22
+
23
+var _CommentInput = require("../CommentInput");
24
+
25
+var _CommentInput2 = _interopRequireDefault(_CommentInput);
26
+
27
+require("./index.css");
28
+
29
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
+
31
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
32
+
33
+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; }
34
+
35
+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; }
36
+// import PropTypes from 'prop-type';
37
+
38
+
39
+var ReplyItem = function (_Component) {
40
+  _inherits(ReplyItem, _Component);
41
+
42
+  function ReplyItem(props) {
43
+    _classCallCheck(this, ReplyItem);
44
+
45
+    var _this = _possibleConstructorReturn(this, (ReplyItem.__proto__ || Object.getPrototypeOf(ReplyItem)).call(this, props));
46
+
47
+    _this.state = {
48
+      showInput: false
49
+    };
50
+    _this.handleToggleInput = _this.handleToggleInput.bind(_this);
51
+    return _this;
52
+  }
53
+
54
+  _createClass(ReplyItem, [{
55
+    key: "handleToggleInput",
56
+    value: function handleToggleInput() {
57
+      this.setState({ showInput: !this.state.showInput });
58
+    }
59
+  }, {
60
+    key: "render",
61
+    value: function render() {
62
+      var _props = this.props,
63
+          commentId = _props.commentId,
64
+          replyItem = _props.replyItem,
65
+          action = _props.action,
66
+          app = _props.app;
67
+
68
+      var replyId = replyItem.id;
69
+      // console.log('replyId', replyId);
70
+
71
+      var showInput = this.state.showInput;
72
+
73
+
74
+      return _react2.default.createElement(
75
+        "div",
76
+        { className: "reply-item" },
77
+        _react2.default.createElement(
78
+          "div",
79
+          { className: "reply-item-content" },
80
+          "@",
81
+          _react2.default.createElement(
82
+            "strong",
83
+            null,
84
+            replyItem.user_name
85
+          ),
86
+          replyItem.reply ? " \u56DE\u590D @" + replyItem.reply.user_name : null,
87
+          ": \xA0",
88
+          replyItem.content
89
+        ),
90
+        _react2.default.createElement(
91
+          "div",
92
+          { className: "reply-item-icon" },
93
+          _react2.default.createElement(
94
+            "span",
95
+            { className: "reply-item-span" },
96
+            _react2.default.createElement(_icon2.default, {
97
+              type: "heart",
98
+              onClick: function onClick() {
99
+                // if (replyId) {
100
+                // 如果有 replyId,则说明是评论的回复
101
+                app.sReplyFavor(replyItem.id, commentId, replyItem.favored);
102
+                // return;
103
+                // }
104
+                // app.sCommentFavor(replyItem.id, replyItem.favored);
105
+              },
106
+              className: replyItem.favored ? "comment-favor comment-favored" : "comment-favor"
107
+            }),
108
+            "\xA0 ",
109
+            replyItem.favor_count
110
+          ),
111
+          _react2.default.createElement(
112
+            "span",
113
+            { className: "reply-item-span" },
114
+            _react2.default.createElement(_icon2.default, { type: "message", onClick: this.handleToggleInput }),
115
+            " \xA0",
116
+            " ",
117
+            replyItem.reply_count || 0
118
+          )
119
+        ),
120
+        showInput && _react2.default.createElement(_CommentInput2.default, {
121
+          content: app.children,
122
+          action: action,
123
+          replyId: replyId,
124
+          commentId: commentId,
125
+          callback: this.handleToggleInput
126
+        })
127
+      );
128
+    }
129
+  }]);
130
+
131
+  return ReplyItem;
132
+}(_react.Component);
133
+
134
+exports.default = (0, _Comment2.default)(ReplyItem);
135
+//# sourceMappingURL=index.js.map

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

@@ -0,0 +1 @@
1
+{"version":3,"sources":["../../../src/components/ReplyItem/index.js"],"names":["ReplyItem","props","state","showInput","handleToggleInput","bind","setState","commentId","replyItem","action","app","replyId","id","user_name","reply","content","sReplyFavor","favored","favor_count","reply_count","children","Component"],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAGA;;;;AACA;;;;AACA;;;;;;;;;AAJA;;;IAMMA,S;;;AACJ,qBAAYC,KAAZ,EAAmB;AAAA;;AAAA,sHACXA,KADW;;AAEjB,UAAKC,KAAL,GAAa;AACXC,iBAAW;AADA,KAAb;AAGA,UAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBC,IAAvB,OAAzB;AALiB;AAMlB;;;;wCAEmB;AAClB,WAAKC,QAAL,CAAc,EAAEH,WAAW,CAAC,KAAKD,KAAL,CAAWC,SAAzB,EAAd;AACD;;;6BAEQ;AAAA,mBACuC,KAAKF,KAD5C;AAAA,UACCM,SADD,UACCA,SADD;AAAA,UACYC,SADZ,UACYA,SADZ;AAAA,UACuBC,MADvB,UACuBA,MADvB;AAAA,UAC+BC,GAD/B,UAC+BA,GAD/B;;AAEP,UAAMC,UAAUH,UAAUI,EAA1B;AACA;;AAHO,UAKCT,SALD,GAKe,KAAKD,KALpB,CAKCC,SALD;;;AAOP,aACE;AAAA;AAAA,UAAK,WAAU,YAAf;AACE;AAAA;AAAA,YAAK,WAAU,oBAAf;AAAA;AACG;AAAA;AAAA;AAASK,sBAAUK;AAAnB,WADH;AAEGL,oBAAUM,KAAV,uBAA0BN,UAAUM,KAAV,CAAgBD,SAA1C,GAAwD,IAF3D;AAAA;AAIGL,oBAAUO;AAJb,SADF;AAOE;AAAA;AAAA,YAAK,WAAU,iBAAf;AACE;AAAA;AAAA,cAAM,WAAU,iBAAhB;AACE;AACE,oBAAK,OADP;AAEE,uBAAS,mBAAM;AACb;AACA;AACAL,oBAAIM,WAAJ,CAAgBR,UAAUI,EAA1B,EAA8BL,SAA9B,EAAyCC,UAAUS,OAAnD;AACA;AACA;AACA;AACD,eATH;AAUE,yBACET,UAAUS,OAAV,GACI,+BADJ,GAEI;AAbR,cADF;AAAA;AAiBUT,sBAAUU;AAjBpB,WADF;AAoBE;AAAA;AAAA,cAAM,WAAU,iBAAhB;AACE,4DAAM,MAAK,SAAX,EAAqB,SAAS,KAAKd,iBAAnC,GADF;AAAA;AACkE,eADlE;AAEGI,sBAAUW,WAAV,IAAyB;AAF5B;AApBF,SAPF;AAgCGhB,qBACC,8BAAC,sBAAD;AACE,mBAASO,IAAIU,QADf;AAEE,kBAAQX,MAFV;AAGE,mBAASE,OAHX;AAIE,qBAAWJ,SAJb;AAKE,oBAAU,KAAKH;AALjB;AAjCJ,OADF;AA4CD;;;;EAhEqBiB,gB;;kBAmET,uBAAQrB,SAAR,C","file":"index.js","sourcesContent":["import React, { Component } from \"react\";\n// import PropTypes from 'prop-type';\nimport { Icon } from \"antd\";\nimport Comment from \"../../Comment\";\nimport CommentInput from \"../CommentInput\";\nimport \"./index.css\";\n\nclass ReplyItem extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      showInput: false\n    };\n    this.handleToggleInput = this.handleToggleInput.bind(this);\n  }\n\n  handleToggleInput() {\n    this.setState({ showInput: !this.state.showInput });\n  }\n\n  render() {\n    const { commentId, replyItem, action, app } = this.props;\n    const replyId = replyItem.id;\n    // console.log('replyId', replyId);\n\n    const { showInput } = this.state;\n\n    return (\n      <div className=\"reply-item\">\n        <div className=\"reply-item-content\">\n          @<strong>{replyItem.user_name}</strong>\n          {replyItem.reply ? ` 回复 @${replyItem.reply.user_name}` : null}:\n          &nbsp;\n          {replyItem.content}\n        </div>\n        <div className=\"reply-item-icon\">\n          <span className=\"reply-item-span\">\n            <Icon\n              type=\"heart\"\n              onClick={() => {\n                // if (replyId) {\n                // 如果有 replyId,则说明是评论的回复\n                app.sReplyFavor(replyItem.id, commentId, replyItem.favored);\n                // return;\n                // }\n                // app.sCommentFavor(replyItem.id, replyItem.favored);\n              }}\n              className={\n                replyItem.favored\n                  ? \"comment-favor comment-favored\"\n                  : \"comment-favor\"\n              }\n            />\n            &nbsp; {replyItem.favor_count}\n          </span>\n          <span className=\"reply-item-span\">\n            <Icon type=\"message\" onClick={this.handleToggleInput} /> &nbsp;{\" \"}\n            {replyItem.reply_count || 0}\n          </span>\n        </div>\n        {showInput && (\n          <CommentInput\n            content={app.children}\n            action={action}\n            replyId={replyId}\n            commentId={commentId}\n            callback={this.handleToggleInput}\n          />\n        )}\n      </div>\n    );\n  }\n}\n\nexport default Comment(ReplyItem);\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"],"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","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"]}
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"],"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","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"]}

+ 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


+ 5
- 5
lib/index.js View File

@@ -65,11 +65,11 @@ function renderComment(config) {
65 65
 
66 66
 window.renderComment = renderComment;
67 67
 
68
-renderComment({
69
-  id: "root-comment",
70
-  type: 1,
71
-  businessId: "test"
72
-});
68
+// renderComment({
69
+//   id: "root-comment",
70
+//   type: 1,
71
+//   businessId: "test"
72
+// });
73 73
 
74 74
 // renderComment({
75 75
 //   id: "root-comment",

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

@@ -1 +1 @@
1
-{"version":3,"sources":["../src/index.js"],"names":["Index","props","renderComment","config","id","Error","type","businessId","console","warn","API","userId","ReactDOM","render","document","getElementById","window"],"mappings":";;;;AAAA;;;;AACA;;;;AACA;;;;;;AACA;;AAEA,IAAMA,QAAQ,SAARA,KAAQ;AAAA,SACZ;AAAC,iBAAD;AAAA,eAAK,sBAAL,EAAsB,oBAAtB,EAAqC,oBAArC,EAAoD,eAApD,IAAkEC,KAAlE;AACE,kCAAC,WAAD,IAAQ,WAAW,CAAnB,EAAsB,eAAtB;AADF,GADY;AAAA,CAAd;;AAMA;;;;;;;;AAQA,SAASC,aAAT,CAAuBC,MAAvB,EAA+B;AAC7B,MAAI,CAACA,OAAOC,EAAZ,EAAgB;AACd,UAAM,IAAIC,KAAJ,CAAU,gBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOG,IAAZ,EAAkB;AAChB,UAAM,IAAID,KAAJ,CAAU,kBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOI,UAAZ,EAAwB;AACtB;AACAC,YAAQC,IAAR,CAAa,+BAAb;AACD;AACD,MAAI,CAACN,OAAOO,GAAZ,EAAiB;AACf;AACAF,YAAQC,IAAR,CACE,sDADF;AAGD;AAhB4B,MAkB3BL,EAlB2B,GAuBzBD,MAvByB,CAkB3BC,EAlB2B;AAAA,qBAuBzBD,MAvByB,CAmB3BG,IAnB2B;AAAA,MAmB3BA,IAnB2B,gCAmBpB,CAnBoB;AAAA,2BAuBzBH,MAvByB,CAoB3BI,UApB2B;AAAA,MAoB3BA,UApB2B,sCAoBd,MApBc;AAAA,oBAuBzBJ,MAvByB,CAqB3BO,GArB2B;AAAA,MAqB3BA,GArB2B,+BAqBrB,oCArBqB;AAAA,MAsB3BC,MAtB2B,GAuBzBR,MAvByB,CAsB3BQ,MAtB2B;;;AAyB7BC,qBAASC,MAAT,CACE,8BAAC,KAAD,IAAO,MAAMP,IAAb,EAAmB,YAAYC,UAA/B,EAA2C,KAAKG,GAAhD,EAAqD,QAAQC,MAA7D,GADF,EAEEG,SAASC,cAAT,CAAwBX,EAAxB,CAFF;AAIA;AACD;;AAEDY,OAAOd,aAAP,GAAuBA,aAAvB;;AAEAA,cAAc;AACZE,MAAI,cADQ;AAEZE,QAAM,CAFM;AAGZC,cAAY;AAHA,CAAd;;AAMA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["import React from \"react\";\r\nimport ReactDOM from \"react-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 />\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    console.warn(\"没有传入 businessId 参数,默认使用: test\");\r\n  }\r\n  if (!config.API) {\r\n    // throw new Error(\"API is required\");\r\n    console.warn(\r\n      \"没有传入 API 参数,默认使用: http://api.links123.net/comment/v1\"\r\n    );\r\n  }\r\n  const {\r\n    id,\r\n    type = 1,\r\n    businessId = \"test\",\r\n    API = \"http://api.links123.net/comment/v1\",\r\n    userId\r\n  } = config;\r\n\r\n  ReactDOM.render(\r\n    <Index type={type} businessId={businessId} API={API} userId={userId} />,\r\n    document.getElementById(id)\r\n  );\r\n  // registerServiceWorker();\r\n}\r\n\r\nwindow.renderComment = renderComment;\r\n\r\nrenderComment({\r\n  id: \"root-comment\",\r\n  type: 1,\r\n  businessId: \"test\"\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","renderComment","config","id","Error","type","businessId","console","warn","API","userId","ReactDOM","render","document","getElementById","window"],"mappings":";;;;AAAA;;;;AACA;;;;AACA;;;;;;AACA;;AAEA,IAAMA,QAAQ,SAARA,KAAQ;AAAA,SACZ;AAAC,iBAAD;AAAA,eAAK,sBAAL,EAAsB,oBAAtB,EAAqC,oBAArC,EAAoD,eAApD,IAAkEC,KAAlE;AACE,kCAAC,WAAD,IAAQ,WAAW,CAAnB,EAAsB,eAAtB;AADF,GADY;AAAA,CAAd;;AAMA;;;;;;;;AAQA,SAASC,aAAT,CAAuBC,MAAvB,EAA+B;AAC7B,MAAI,CAACA,OAAOC,EAAZ,EAAgB;AACd,UAAM,IAAIC,KAAJ,CAAU,gBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOG,IAAZ,EAAkB;AAChB,UAAM,IAAID,KAAJ,CAAU,kBAAV,CAAN;AACD;AACD,MAAI,CAACF,OAAOI,UAAZ,EAAwB;AACtB;AACAC,YAAQC,IAAR,CAAa,+BAAb;AACD;AACD,MAAI,CAACN,OAAOO,GAAZ,EAAiB;AACf;AACAF,YAAQC,IAAR,CACE,sDADF;AAGD;AAhB4B,MAkB3BL,EAlB2B,GAuBzBD,MAvByB,CAkB3BC,EAlB2B;AAAA,qBAuBzBD,MAvByB,CAmB3BG,IAnB2B;AAAA,MAmB3BA,IAnB2B,gCAmBpB,CAnBoB;AAAA,2BAuBzBH,MAvByB,CAoB3BI,UApB2B;AAAA,MAoB3BA,UApB2B,sCAoBd,MApBc;AAAA,oBAuBzBJ,MAvByB,CAqB3BO,GArB2B;AAAA,MAqB3BA,GArB2B,+BAqBrB,oCArBqB;AAAA,MAsB3BC,MAtB2B,GAuBzBR,MAvByB,CAsB3BQ,MAtB2B;;;AAyB7BC,qBAASC,MAAT,CACE,8BAAC,KAAD,IAAO,MAAMP,IAAb,EAAmB,YAAYC,UAA/B,EAA2C,KAAKG,GAAhD,EAAqD,QAAQC,MAA7D,GADF,EAEEG,SAASC,cAAT,CAAwBX,EAAxB,CAFF;AAIA;AACD;;AAEDY,OAAOd,aAAP,GAAuBA,aAAvB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["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 />\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    console.warn(\"没有传入 businessId 参数,默认使用: test\");\n  }\n  if (!config.API) {\n    // throw new Error(\"API is required\");\n    console.warn(\n      \"没有传入 API 参数,默认使用: http://api.links123.net/comment/v1\"\n    );\n  }\n  const {\n    id,\n    type = 1,\n    businessId = \"test\",\n    API = \"http://api.links123.net/comment/v1\",\n    userId\n  } = config;\n\n  ReactDOM.render(\n    <Index type={type} businessId={businessId} API={API} userId={userId} />,\n    document.getElementById(id)\n  );\n  // registerServiceWorker();\n}\n\nwindow.renderComment = renderComment;\n\n// renderComment({\n//   id: \"root-comment\",\n//   type: 1,\n//   businessId: \"test\"\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,0BAAwB,4DAVX;AAWb,mBAAiB,OAXJ;AAYb,yBAAuB,eAZV;;AAcb,sBAAoB,yDAdP;AAeb,qBAAmB,cAfN;AAgBb,oBAAkB,cAhBL;;AAkBb,sBAAoB,MAlBP;AAmBb,0BAAwB,kBAnBX;;AAqBb,sBAAoB,SArBP;AAsBb,mBAAiB,SAtBJ;AAuBb,uBAAqB,QAvBR;AAwBb,uBAAqB,QAxBR;;AA0Bb,2BAAyB,kBA1BZ;AA2Bb,wBAAsB,cA3BT;AA4Bb,qBAAmB,kBA5BN;AA6Bb,qBAAmB,eA7BN;AA8Bb,yBAAuB,kBA9BV;AA+Bb,0BAAwB,YA/BX;AAgCb,+BAA6B,SAhChB;AAiCb,yBAAuB;AAjCV,CAAf;;kBAoCeA,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\": \"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,iBADZ;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}/140字\",\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,iBADZ;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}/140字\",\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


+ 5
- 5
src/index.js View File

@@ -51,11 +51,11 @@ function renderComment(config) {
51 51
 
52 52
 window.renderComment = renderComment;
53 53
 
54
-renderComment({
55
-  id: "root-comment",
56
-  type: 1,
57
-  businessId: "test"
58
-});
54
+// renderComment({
55
+//   id: "root-comment",
56
+//   type: 1,
57
+//   businessId: "test"
58
+// });
59 59
 
60 60
 // renderComment({
61 61
 //   id: "root-comment",