@seafile/comment-editor 0.0.2 → 0.0.3

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.
@@ -34,11 +34,10 @@ const getSubmitTip = (type, content) => {
34
34
  if (content) return 'Save';
35
35
  return type === 'comment' ? 'Comment' : 'Reply';
36
36
  };
37
- const DEFAULT_PLACEHOLDER = 'Enter_comment_shift_enter_for_new_line_Enter_to_send';
38
37
  const CommentEditor = _ref => {
39
38
  let {
40
39
  content,
41
- placeholder = DEFAULT_PLACEHOLDER,
40
+ placeholder = '',
42
41
  toolMenus = ['text_style', _constants2.BLOCKQUOTE, _constants2.UNORDERED_LIST, _constants2.ORDERED_LIST, _constants2.LINK, _constants2.IMAGE],
43
42
  insertContent,
44
43
  onContentChange,
@@ -252,7 +251,8 @@ const CommentEditor = _ref => {
252
251
  cursors: cursors,
253
252
  renderElement: props => (0, _renderCommentEditorElement.default)({
254
253
  ...props,
255
- commentType: type
254
+ commentType: type,
255
+ placeholder
256
256
  }),
257
257
  renderLeaf: _extension.renderLeaf,
258
258
  onMouseDown: onMouseDown,
@@ -13,7 +13,8 @@ const RenderCommentEditorCustomRenderElement = props => {
13
13
  const readonly = (0, _slateReact.useReadOnly)();
14
14
  const {
15
15
  element,
16
- commentType
16
+ commentType,
17
+ placeholder: propsPlaceholder
17
18
  } = props;
18
19
  switch (element.type) {
19
20
  case _constants.PARAGRAPH:
@@ -27,7 +28,7 @@ const RenderCommentEditorCustomRenderElement = props => {
27
28
  const [renderParagraph] = _plugins.ParagraphPlugin.renderElements;
28
29
  return renderParagraph(_props);
29
30
  }
30
- const placeholder = commentType === 'comment' ? 'Enter_comment_shift_enter_for_new_line_Enter_to_send' : 'Enter_reply_shift_Enter_for_new_line_Enter_to_send';
31
+ const placeholder = propsPlaceholder ? propsPlaceholder : commentType === 'comment' ? 'Enter_comment_shift_enter_for_new_line_Enter_to_send' : 'Enter_reply_shift_Enter_for_new_line_Enter_to_send';
31
32
  const [renderParagraph] = _plugins.ParagraphPlugin.renderElements;
32
33
  return renderParagraph({
33
34
  ..._props,
@@ -12,6 +12,7 @@ const SeafileCommentEditor = _ref => {
12
12
  // Provider
13
13
  type,
14
14
  // comment or replay
15
+ placeholder,
15
16
  className = '',
16
17
  pluginName = '',
17
18
  // sdoc or dtable or txt or py ...
@@ -44,13 +45,13 @@ const SeafileCommentEditor = _ref => {
44
45
  addParticipants: addParticipants
45
46
  }, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentEditor, {
46
47
  content: content,
48
+ placeholder: placeholder,
49
+ toolMenus: toolMenus,
47
50
  insertContent: insertContent,
48
51
  onContentChange: onContentChange,
49
- hiddenUserInfo: hiddenUserInfo,
50
52
  hiddenComment: hiddenComment,
51
- toolMenus: toolMenus,
52
- closePanel: closePanel,
53
- addParticipants: addParticipants
53
+ hiddenUserInfo: hiddenUserInfo,
54
+ closePanel: closePanel
54
55
  })));
55
56
  };
56
57
  var _default = exports.default = SeafileCommentEditor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/comment-editor",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "description": "This is a comment editor",
6
6
  "main": "dist/index.js",