@seafile/comment-editor 0.0.1-alpha.52 → 0.0.1-alpha.54
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.
|
@@ -146,7 +146,7 @@ const CommentEditor = _ref => {
|
|
|
146
146
|
(0, _react.useEffect)(() => {
|
|
147
147
|
let children = (0, _mdToSlate.default)(content);
|
|
148
148
|
editor.children = children;
|
|
149
|
-
|
|
149
|
+
// Transforms.select(editor, Editor.end(editor, []));
|
|
150
150
|
}, [editor, content]);
|
|
151
151
|
|
|
152
152
|
// useMount: focus editor
|
|
@@ -160,10 +160,10 @@ const CommentEditor = _ref => {
|
|
|
160
160
|
anchor: endOfFirstNode,
|
|
161
161
|
focus: endOfFirstNode
|
|
162
162
|
};
|
|
163
|
-
|
|
163
|
+
// focusEditor(editor, range);
|
|
164
164
|
}
|
|
165
165
|
// Force refresh to fix comment list
|
|
166
|
-
setSlateValue([...editor.children]);
|
|
166
|
+
// setSlateValue([...editor.children]);
|
|
167
167
|
}
|
|
168
168
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
169
169
|
}, []);
|
|
@@ -218,51 +218,9 @@ const CommentEditor = _ref => {
|
|
|
218
218
|
eventProxy.onKeyDown(event);
|
|
219
219
|
}, [eventProxy, editor]);
|
|
220
220
|
console.log('toolMenus', toolMenus);
|
|
221
|
-
return /*#__PURE__*/_react.default.createElement("div",
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
// <div className="comment-editor-user-img">
|
|
226
|
-
// <img src={userInfo.avatar_url} alt="" height="100%" width="100%" />
|
|
227
|
-
// </div>
|
|
228
|
-
// <div className="comment-editor-user-name">{userInfo.name}</div>
|
|
229
|
-
// </div>
|
|
230
|
-
// )}
|
|
231
|
-
// <div className='comment-editor-container'>
|
|
232
|
-
// <div className="comment-editor-content">
|
|
233
|
-
// <div ref={commentEditorContainerRef} className='article comment-editor' onClick={handleFocusEditor} >
|
|
234
|
-
// <ScrollContext.Provider value={{ scrollRef: commentEditorContainerRef }}>
|
|
235
|
-
// <Slate editor={editor} value={slateValue} onChange={setSlateValue}>
|
|
236
|
-
// <Editable
|
|
237
|
-
// id='sdoc-editor'
|
|
238
|
-
// scrollSelectionIntoView={handleScrollIntoView}
|
|
239
|
-
// cursors={cursors}
|
|
240
|
-
// renderElement={(props) => RenderCommentEditorCustomRenderElement({ ...props, commentType: type })}
|
|
241
|
-
// renderLeaf={renderLeaf}
|
|
242
|
-
// onMouseDown={onMouseDown}
|
|
243
|
-
// decorate={decorate}
|
|
244
|
-
// onCut={eventProxy.onCut}
|
|
245
|
-
// onCopy={eventProxy.onCopy}
|
|
246
|
-
// onCompositionStart={eventProxy.onCompositionStart}
|
|
247
|
-
// onCompositionUpdate={eventProxy.onCompositionUpdate}
|
|
248
|
-
// onCompositionEnd={eventProxy.onCompositionEnd}
|
|
249
|
-
// onKeyDown={onKeyDown}
|
|
250
|
-
// onBeforeInput={eventProxy.onBeforeInput}
|
|
251
|
-
// />
|
|
252
|
-
// </Slate>
|
|
253
|
-
// </ScrollContext.Provider>
|
|
254
|
-
// </div>
|
|
255
|
-
// <CommentEditorToolbar
|
|
256
|
-
// editor={editor}
|
|
257
|
-
// toolMenus={toolMenus}
|
|
258
|
-
// onSubmit={onSubmit}
|
|
259
|
-
// submitBtnText={t(submitTip)}
|
|
260
|
-
// onCancel={onCancel}
|
|
261
|
-
// />
|
|
262
|
-
// </div>
|
|
263
|
-
// </div>
|
|
264
|
-
// {toolMenus.includes(IMAGE) && <InsertElementDialog editor={editor} />} */}
|
|
265
|
-
// </div>
|
|
266
|
-
;
|
|
221
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
222
|
+
className: (0, _classnames.default)('comment-editor-wrapper', className),
|
|
223
|
+
ref: commentWrapperRef
|
|
224
|
+
});
|
|
267
225
|
};
|
|
268
226
|
var _default = exports.default = CommentEditor;
|