@seafile/comment-editor 0.0.1-alpha.13 → 0.0.1-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,7 +38,6 @@ const DEFAULT_PLACEHOLDER = 'Enter_comment_shift_enter_for_new_line_Enter_to_sen
38
38
  const CommentEditor = _ref => {
39
39
  let {
40
40
  content,
41
- commentContent,
42
41
  placeholder = DEFAULT_PLACEHOLDER,
43
42
  insertContent,
44
43
  updateContent,
@@ -105,7 +104,6 @@ const CommentEditor = _ref => {
105
104
  })];
106
105
  _slate.Transforms.select(editor, _slate.Editor.start(editor, []));
107
106
  onContentChange && onContentChange(null);
108
- console.log('closeComment', closeComment);
109
107
  closeComment && closeComment();
110
108
  }, [editor, updateValue, addParticipants, userInfo.username, placeholder, onContentChange, closeComment]);
111
109
  const onSubmitByEnterKey = (0, _react.useCallback)(event => {
@@ -154,12 +152,9 @@ const CommentEditor = _ref => {
154
152
  // set editor children
155
153
  (0, _react.useEffect)(() => {
156
154
  let children = (0, _mdToSlate.default)(content);
157
- if (commentContent) {
158
- children = (0, _mdToSlate.default)(commentContent);
159
- }
160
155
  editor.children = children;
161
156
  _slate.Transforms.select(editor, _slate.Editor.end(editor, []));
162
- }, [editor, content, commentContent]);
157
+ }, [editor, content]);
163
158
 
164
159
  // useMount: focus editor
165
160
  (0, _react.useEffect)(() => {
@@ -19,8 +19,9 @@ const CommentProvider = _ref => {
19
19
  type,
20
20
  // comment or replay
21
21
  userInfo,
22
- pluginName = '',
23
22
  className = '',
23
+ pluginName = '',
24
+ // sdoc or wiki or txt ...
24
25
  pluginEventBus,
25
26
  pluginEvent
26
27
  } = _ref;
@@ -29,8 +30,8 @@ const CommentProvider = _ref => {
29
30
  value: {
30
31
  type,
31
32
  userInfo,
32
- pluginName,
33
33
  className,
34
+ pluginName,
34
35
  pluginEventBus,
35
36
  pluginEvent,
36
37
  collaborators
@@ -11,39 +11,44 @@ var _basicSdk = require("../basic-sdk");
11
11
  var _errorBoundary = _interopRequireDefault(require("../components/error-boundary"));
12
12
  const SeafileCommentEditor = _ref => {
13
13
  let {
14
+ // Provider
14
15
  type,
16
+ // comment or replay
15
17
  userInfo,
16
- pluginName = '',
17
18
  className = '',
19
+ pluginName = '',
20
+ // sdoc or wiki or txt ...
21
+ pluginEventBus,
22
+ pluginEvent,
23
+ // Comment editor
18
24
  content,
19
25
  updateContent,
20
26
  insertContent,
21
27
  onContentChange,
22
- commentContent,
23
28
  hiddenUserInfo,
24
29
  hiddenComment,
30
+ closeComment,
25
31
  setIsEditing,
26
32
  addParticipants,
27
- pluginEventBus,
28
- pluginEvent,
33
+ // api
29
34
  api
30
35
  } = _ref;
31
36
  _basicSdk.context.init(api);
32
37
  return /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentProvider, {
33
38
  type: type,
34
39
  userInfo: userInfo,
35
- pluginName: pluginName,
36
40
  className: className,
41
+ pluginName: pluginName,
37
42
  pluginEventBus: pluginEventBus,
38
43
  pluginEvent: pluginEvent
39
44
  }, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentEditor, {
40
45
  content: content,
41
- commentContent: commentContent,
42
46
  updateContent: updateContent,
43
47
  insertContent: insertContent,
44
48
  onContentChange: onContentChange,
45
49
  hiddenUserInfo: hiddenUserInfo,
46
50
  hiddenComment: hiddenComment,
51
+ closeComment: closeComment,
47
52
  setIsEditing: setIsEditing,
48
53
  addParticipants: addParticipants
49
54
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/comment-editor",
3
- "version": "0.0.1-alpha.13",
3
+ "version": "0.0.1-alpha.15",
4
4
  "private": false,
5
5
  "description": "This is a comment editor",
6
6
  "main": "dist/index.js",