@seafile/comment-editor 0.0.1-alpha.63 → 0.0.1-alpha.65
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
|
-
}
|
|
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;
|
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactI18next = require("react-i18next");
|
|
10
9
|
var _basicSdk = require("../basic-sdk");
|
|
11
|
-
var _i18n = require("../_i18n");
|
|
12
10
|
var _errorBoundary = _interopRequireDefault(require("../components/error-boundary"));
|
|
11
|
+
// import { I18nextProvider } from 'react-i18next';
|
|
12
|
+
|
|
13
|
+
// import { getI18n } from '../_i18n';
|
|
14
|
+
|
|
13
15
|
const SeafileCommentEditor = _ref => {
|
|
14
16
|
let {
|
|
15
17
|
// Provider
|
|
@@ -39,26 +41,29 @@ const SeafileCommentEditor = _ref => {
|
|
|
39
41
|
lang
|
|
40
42
|
} = settings || {};
|
|
41
43
|
_basicSdk.context.init(settings, api);
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
return (
|
|
45
|
+
/*#__PURE__*/
|
|
46
|
+
// <I18nextProvider i18n={ getI18n(lang || 'en') }>
|
|
47
|
+
_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentProvider, {
|
|
48
|
+
type: type,
|
|
49
|
+
className: className,
|
|
50
|
+
pluginName: pluginName,
|
|
51
|
+
pluginEventBus: pluginEventBus,
|
|
52
|
+
pluginEvent: pluginEvent,
|
|
53
|
+
collaborators: collaborators,
|
|
54
|
+
participants: participants,
|
|
55
|
+
addParticipants: addParticipants
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_basicSdk.CommentEditor, {
|
|
57
|
+
content: content,
|
|
58
|
+
insertContent: insertContent,
|
|
59
|
+
onContentChange: onContentChange,
|
|
60
|
+
hiddenUserInfo: hiddenUserInfo,
|
|
61
|
+
hiddenComment: hiddenComment,
|
|
62
|
+
toolMenus: toolMenus,
|
|
63
|
+
closePanel: closePanel,
|
|
64
|
+
addParticipants: addParticipants
|
|
65
|
+
})))
|
|
66
|
+
// </I18nextProvider>
|
|
67
|
+
);
|
|
63
68
|
};
|
|
64
69
|
var _default = exports.default = SeafileCommentEditor;
|