@seafile/comment-editor 0.0.1-alpha.50 → 0.0.1-alpha.52
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.
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactI18next = require("react-i18next");
|
|
11
10
|
var _slate = require("@seafile/slate");
|
|
12
11
|
var _slateReact = require("@seafile/slate-react");
|
|
13
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -30,6 +29,8 @@ var _slateToMd = _interopRequireDefault(require("../slate-convert/slate-to-md"))
|
|
|
30
29
|
var _eventBus = _interopRequireDefault(require("../utils/event-bus"));
|
|
31
30
|
var _eventHandler = _interopRequireDefault(require("../utils/event-handler"));
|
|
32
31
|
require("./comment-editor.css");
|
|
32
|
+
// import { useTranslation } from 'react-i18next';
|
|
33
|
+
|
|
33
34
|
const getSubmitTip = (type, content) => {
|
|
34
35
|
if (content) return 'Save';
|
|
35
36
|
return type === 'comment' ? 'Comment' : 'Reply';
|
|
@@ -47,9 +48,7 @@ const CommentEditor = _ref => {
|
|
|
47
48
|
closePanel
|
|
48
49
|
} = _ref;
|
|
49
50
|
const commentWrapperRef = (0, _react.useRef)();
|
|
50
|
-
const {
|
|
51
|
-
t
|
|
52
|
-
} = (0, _reactI18next.useTranslation)('sdoc-editor');
|
|
51
|
+
// const { t } = useTranslation('sdoc-editor');
|
|
53
52
|
const {
|
|
54
53
|
className,
|
|
55
54
|
userInfo,
|
|
@@ -219,28 +218,51 @@ const CommentEditor = _ref => {
|
|
|
219
218
|
eventProxy.onKeyDown(event);
|
|
220
219
|
}, [eventProxy, editor]);
|
|
221
220
|
console.log('toolMenus', toolMenus);
|
|
222
|
-
return /*#__PURE__*/_react.default.createElement("div",
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
221
|
+
return /*#__PURE__*/_react.default.createElement("div", null, "123")
|
|
222
|
+
// <div className={classNames('comment-editor-wrapper', className)} ref={commentWrapperRef}>
|
|
223
|
+
// {/* {type === 'comment' && !hiddenUserInfo && (
|
|
224
|
+
// <div className="comment-editor-user-info">
|
|
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
|
+
;
|
|
245
267
|
};
|
|
246
268
|
var _default = exports.default = CommentEditor;
|