@seafile/comment-editor 0.0.1-alpha.34 → 0.0.1-alpha.36

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.
@@ -222,6 +222,59 @@ const CommentEditor = _ref => {
222
222
  return /*#__PURE__*/_react.default.createElement("div", {
223
223
  className: (0, _classnames.default)('comment-editor-wrapper', className),
224
224
  ref: commentWrapperRef
225
- }, /*#__PURE__*/_react.default.createElement("div", null, "123"));
225
+ }, type === 'comment' && !hiddenUserInfo && /*#__PURE__*/_react.default.createElement("div", {
226
+ className: "comment-editor-user-info"
227
+ }, /*#__PURE__*/_react.default.createElement("div", {
228
+ className: "comment-editor-user-img"
229
+ }, /*#__PURE__*/_react.default.createElement("img", {
230
+ src: userInfo.avatar_url,
231
+ alt: "",
232
+ height: "100%",
233
+ width: "100%"
234
+ })), /*#__PURE__*/_react.default.createElement("div", {
235
+ className: "comment-editor-user-name"
236
+ }, userInfo.name)), /*#__PURE__*/_react.default.createElement("div", {
237
+ className: "comment-editor-container"
238
+ }, /*#__PURE__*/_react.default.createElement("div", {
239
+ className: "comment-editor-content"
240
+ }, /*#__PURE__*/_react.default.createElement("div", {
241
+ ref: commentEditorContainerRef,
242
+ className: "article comment-editor",
243
+ onClick: handleFocusEditor
244
+ }, /*#__PURE__*/_react.default.createElement(_useScrollContext.ScrollContext.Provider, {
245
+ value: {
246
+ scrollRef: commentEditorContainerRef
247
+ }
248
+ }, /*#__PURE__*/_react.default.createElement(_slateReact.Slate, {
249
+ editor: editor,
250
+ value: slateValue,
251
+ onChange: setSlateValue
252
+ }, /*#__PURE__*/_react.default.createElement(_slateReact.Editable, {
253
+ id: "sdoc-editor",
254
+ scrollSelectionIntoView: handleScrollIntoView,
255
+ cursors: cursors,
256
+ renderElement: props => (0, _renderCommentEditorElement.default)({
257
+ ...props,
258
+ commentType: type
259
+ }),
260
+ renderLeaf: _extension.renderLeaf,
261
+ onMouseDown: onMouseDown,
262
+ decorate: decorate,
263
+ onCut: eventProxy.onCut,
264
+ onCopy: eventProxy.onCopy,
265
+ onCompositionStart: eventProxy.onCompositionStart,
266
+ onCompositionUpdate: eventProxy.onCompositionUpdate,
267
+ onCompositionEnd: eventProxy.onCompositionEnd,
268
+ onKeyDown: onKeyDown,
269
+ onBeforeInput: eventProxy.onBeforeInput
270
+ })))), /*#__PURE__*/_react.default.createElement(_commentEditorToolbar.default, {
271
+ editor: editor,
272
+ toolMenus: toolMenus,
273
+ onSubmit: onSubmit,
274
+ submitBtnText: t(submitTip),
275
+ onCancel: onCancel
276
+ }))), toolMenus.includes(_constants2.IMAGE) && /*#__PURE__*/_react.default.createElement(_insertElementDialog.default, {
277
+ editor: editor
278
+ }));
226
279
  };
227
280
  var _default = exports.default = CommentEditor;
@@ -35,24 +35,31 @@ const SeafileCommentEditor = _ref => {
35
35
  api
36
36
  } = _ref;
37
37
  _basicSdk.context.init(settings, api);
38
- return /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentProvider, {
39
- type: type,
40
- className: className,
41
- pluginName: pluginName,
42
- pluginEventBus: pluginEventBus,
43
- pluginEvent: pluginEvent,
44
- collaborators: collaborators,
45
- participants: participants,
46
- addParticipants: addParticipants
47
- }, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentEditor, {
48
- content: content,
49
- insertContent: insertContent,
50
- onContentChange: onContentChange,
51
- hiddenUserInfo: hiddenUserInfo,
52
- hiddenComment: hiddenComment,
53
- toolMenus: toolMenus,
54
- closePanel: closePanel,
55
- addParticipants: addParticipants
56
- })));
38
+ return /*#__PURE__*/_react.default.createElement("div", null, "123")
39
+ // <ErrorBoundary>
40
+ // <CommentProvider
41
+ // type={type}
42
+ // className={className}
43
+ // pluginName={pluginName}
44
+ // pluginEventBus={pluginEventBus}
45
+ // pluginEvent={pluginEvent}
46
+ // collaborators={collaborators}
47
+ // participants={participants}
48
+ // addParticipants={addParticipants}
49
+ // >
50
+ // <CommentEditor
51
+ // content={content}
52
+ // insertContent={insertContent}
53
+ // onContentChange={onContentChange}
54
+
55
+ // hiddenUserInfo={hiddenUserInfo}
56
+ // hiddenComment={hiddenComment}
57
+ // toolMenus={toolMenus}
58
+ // closePanel={closePanel}
59
+ // addParticipants={addParticipants}
60
+ // />
61
+ // </CommentProvider>
62
+ // </ErrorBoundary>
63
+ ;
57
64
  };
58
65
  var _default = exports.default = (0, _reactI18next.withTranslation)('sdoc-editor')(SeafileCommentEditor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/comment-editor",
3
- "version": "0.0.1-alpha.34",
3
+ "version": "0.0.1-alpha.36",
4
4
  "private": false,
5
5
  "description": "This is a comment editor",
6
6
  "main": "dist/index.js",