@seafile/comment-editor 0.0.1-alpha.60 → 0.0.1-alpha.62
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.
|
@@ -147,7 +147,7 @@ const CommentEditor = _ref => {
|
|
|
147
147
|
(0, _react.useEffect)(() => {
|
|
148
148
|
let children = (0, _mdToSlate.default)(content);
|
|
149
149
|
editor.children = children;
|
|
150
|
-
|
|
150
|
+
// Transforms.select(editor, Editor.end(editor, []));
|
|
151
151
|
}, [editor, content]);
|
|
152
152
|
|
|
153
153
|
// useMount: focus editor
|
|
@@ -161,10 +161,10 @@ const CommentEditor = _ref => {
|
|
|
161
161
|
anchor: endOfFirstNode,
|
|
162
162
|
focus: endOfFirstNode
|
|
163
163
|
};
|
|
164
|
-
|
|
164
|
+
// focusEditor(editor, range);
|
|
165
165
|
}
|
|
166
166
|
// Force refresh to fix comment list
|
|
167
|
-
setSlateValue([...editor.children]);
|
|
167
|
+
// setSlateValue([...editor.children]);
|
|
168
168
|
}
|
|
169
169
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
170
170
|
}, []);
|
|
@@ -237,42 +237,14 @@ const CommentEditor = _ref => {
|
|
|
237
237
|
className: "comment-editor-container"
|
|
238
238
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
239
239
|
className: "comment-editor-content"
|
|
240
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
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, {
|
|
240
|
+
}, /*#__PURE__*/_react.default.createElement(_commentEditorToolbar.default, {
|
|
271
241
|
editor: editor,
|
|
272
242
|
toolMenus: toolMenus,
|
|
273
243
|
onSubmit: onSubmit,
|
|
274
244
|
submitBtnText: t(submitTip),
|
|
275
245
|
onCancel: onCancel
|
|
276
|
-
}))))
|
|
246
|
+
}))), toolMenus.includes(_constants2.IMAGE) && /*#__PURE__*/_react.default.createElement(_insertElementDialog.default, {
|
|
247
|
+
editor: editor
|
|
248
|
+
}));
|
|
277
249
|
};
|
|
278
250
|
var _default = exports.default = CommentEditor;
|