@seafile/sdoc-editor 1.0.182 → 1.0.184-alpha.0
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.
- package/dist/basic-sdk/comment/components/comment-editor.js +12 -18
- package/dist/basic-sdk/comment/components/comment-item-collapse-wrapper.js +1 -1
- package/dist/basic-sdk/comment/components/comment-item-wrapper.js +6 -19
- package/dist/basic-sdk/comment/components/comment-list.css +37 -55
- package/dist/basic-sdk/comment/components/comment-list.js +68 -30
- package/dist/basic-sdk/comment/components/editor-comment.js +2 -13
- package/dist/basic-sdk/comment/components/global-comment/global-comment-editor.js +4 -4
- package/dist/basic-sdk/comment/components/global-comment/index.css +15 -11
- package/dist/basic-sdk/comment/components/global-comment/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/ai/ai-menu/style.css +1 -0
- package/dist/basic-sdk/extension/plugins/ai/ai-module/index.js +37 -28
- package/dist/basic-sdk/extension/plugins/ai/ai-module/style.css +24 -7
- package/dist/basic-sdk/extension/plugins/ai/constants/index.js +1 -1
- package/package.json +2 -2
- package/public/locales/cs/sdoc-editor.json +2 -1
- package/public/locales/de/sdoc-editor.json +2 -1
- package/public/locales/en/sdoc-editor.json +2 -1
- package/public/locales/es/sdoc-editor.json +2 -1
- package/public/locales/es_AR/sdoc-editor.json +2 -1
- package/public/locales/es_MX/sdoc-editor.json +2 -1
- package/public/locales/fr/sdoc-editor.json +2 -1
- package/public/locales/it/sdoc-editor.json +2 -1
- package/public/locales/ru/sdoc-editor.json +18 -17
- package/public/locales/zh_CN/sdoc-editor.json +3 -2
|
@@ -32,15 +32,14 @@ const CommentEditor = _ref => {
|
|
|
32
32
|
type,
|
|
33
33
|
className,
|
|
34
34
|
content,
|
|
35
|
-
|
|
35
|
+
commentContent,
|
|
36
36
|
placeholder,
|
|
37
37
|
insertContent,
|
|
38
38
|
updateContent,
|
|
39
39
|
setIsEditing,
|
|
40
40
|
hiddenComment,
|
|
41
|
-
globalComment,
|
|
42
41
|
hiddenUserInfo,
|
|
43
|
-
|
|
42
|
+
onContentChange
|
|
44
43
|
} = _ref;
|
|
45
44
|
const commentWrapperRef = (0, _react.useRef)();
|
|
46
45
|
const {
|
|
@@ -87,8 +86,8 @@ const CommentEditor = _ref => {
|
|
|
87
86
|
placeholder
|
|
88
87
|
})];
|
|
89
88
|
_slate.Transforms.select(editor, _slate.Editor.start(editor, []));
|
|
90
|
-
|
|
91
|
-
}, [editor, updateValue, addParticipants, userInfo.username, placeholder,
|
|
89
|
+
onContentChange && onContentChange(null);
|
|
90
|
+
}, [editor, updateValue, addParticipants, userInfo.username, placeholder, onContentChange]);
|
|
92
91
|
const onSubmitByEnterKey = (0, _react.useCallback)(event => {
|
|
93
92
|
if (!_slateReact.ReactEditor.isFocused(editor)) return;
|
|
94
93
|
onSubmit(event);
|
|
@@ -111,37 +110,32 @@ const CommentEditor = _ref => {
|
|
|
111
110
|
if (eventType === 'click') {
|
|
112
111
|
const isSdocContentWrapper = target.classList.contains('sdoc-content-wrapper');
|
|
113
112
|
const listContainer = window.document.querySelector('#global-comment-list-container');
|
|
114
|
-
const commentEditorContainer = window.document.querySelector('.sdoc-doc-comment-editor-container');
|
|
115
113
|
const resizeContainer = window.document.querySelector('.sdoc-comment-resize-handler');
|
|
116
|
-
const scrollContainer = window.document.querySelector('.sdoc-scroll-container');
|
|
117
114
|
const isClickOnListContainer = listContainer && listContainer.contains(target);
|
|
118
|
-
const isClickOnCommentEditorContainer =
|
|
115
|
+
const isClickOnCommentEditorContainer = commentWrapperRef.current.contains(target);
|
|
119
116
|
const isClickResizeContainer = resizeContainer && resizeContainer.contains(target);
|
|
120
|
-
const
|
|
121
|
-
const isPreventCancel = isClickOnListContainer || isClickOnCommentEditorContainer || isClickResizeContainer || isClickScrollContainer || isSdocContentWrapper;
|
|
122
|
-
// Global comment could not be canceled by clicking outside
|
|
123
|
-
if (globalComment && !isClickScrollContainer) return;
|
|
117
|
+
const isPreventCancel = isClickOnListContainer || isClickOnCommentEditorContainer || isClickResizeContainer || isSdocContentWrapper;
|
|
124
118
|
if (isPreventCancel) return;
|
|
125
119
|
}
|
|
126
120
|
setIsEditing && setIsEditing(false);
|
|
127
121
|
hiddenComment && hiddenComment(false);
|
|
128
|
-
if (
|
|
122
|
+
if (onContentChange) {
|
|
129
123
|
if (editor.children.find(n => _slate.Node.string(n).trim())) {
|
|
130
|
-
|
|
124
|
+
onContentChange((0, _slateToMd.default)(editor.children));
|
|
131
125
|
} else {
|
|
132
|
-
|
|
126
|
+
onContentChange(null);
|
|
133
127
|
}
|
|
134
128
|
}
|
|
135
129
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
130
|
}, [setIsEditing]);
|
|
137
131
|
(0, _react.useEffect)(() => {
|
|
138
132
|
let children = (0, _mdToSlate.default)(content);
|
|
139
|
-
if (
|
|
140
|
-
children = (0, _mdToSlate.default)(
|
|
133
|
+
if (commentContent) {
|
|
134
|
+
children = (0, _mdToSlate.default)(commentContent);
|
|
141
135
|
}
|
|
142
136
|
editor.children = children;
|
|
143
137
|
_slate.Transforms.select(editor, _slate.Editor.end(editor, []));
|
|
144
|
-
}, [editor, content,
|
|
138
|
+
}, [editor, content, commentContent]);
|
|
145
139
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
146
140
|
className: (0, _classnames.default)('comment-editor-wrapper', className),
|
|
147
141
|
ref: commentWrapperRef
|
|
@@ -77,7 +77,7 @@ const CommentItemCollapseWrapper = _ref => {
|
|
|
77
77
|
}, [setCurrentCommentGroup, topLevelComment.id]);
|
|
78
78
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
79
|
id: `comment-item-wrapper_${topLevelComment.id}`,
|
|
80
|
-
className: (0, _classnames.default)('comment-ui-container', {
|
|
80
|
+
className: (0, _classnames.default)('comment-collapse-wrapper', 'comment-ui-container', {
|
|
81
81
|
'sdoc-resolved': topLevelComment.resolved,
|
|
82
82
|
'd-flex flex-column': element
|
|
83
83
|
}),
|
|
@@ -15,7 +15,6 @@ var _context = _interopRequireDefault(require("../../../context"));
|
|
|
15
15
|
var _useCommentContext = require("../hooks/comment-hooks/use-comment-context");
|
|
16
16
|
var _commentItemContent = _interopRequireDefault(require("./comment-item-content"));
|
|
17
17
|
var _commentItemReply = _interopRequireDefault(require("./comment-item-reply"));
|
|
18
|
-
var _commentEditor = _interopRequireDefault(require("./comment-editor"));
|
|
19
18
|
var _constants = require("../constants");
|
|
20
19
|
var _commentDeletePopover = _interopRequireDefault(require("./comment-delete-popover"));
|
|
21
20
|
const CommentItemWrapper = _ref => {
|
|
@@ -28,11 +27,10 @@ const CommentItemWrapper = _ref => {
|
|
|
28
27
|
isGlobalComment,
|
|
29
28
|
commentDetailRef,
|
|
30
29
|
updateScrollPosition,
|
|
31
|
-
hiddenComment,
|
|
32
30
|
setCurrentCommentGroup,
|
|
33
31
|
onCommentClick,
|
|
34
32
|
isEmptyComment,
|
|
35
|
-
|
|
33
|
+
isCollapseCommentEditor
|
|
36
34
|
} = _ref;
|
|
37
35
|
const listRef = (0, _react.useRef)(null);
|
|
38
36
|
const {
|
|
@@ -41,6 +39,9 @@ const CommentItemWrapper = _ref => {
|
|
|
41
39
|
const scrollRef = (0, _react.useRef)(document.querySelector('.sdoc-scroll-container'));
|
|
42
40
|
const [isShowDeleteDialog, setIsShowDeleteDialog] = (0, _react.useState)(false);
|
|
43
41
|
const commentOpToolsId = `commentOpTools_${comment === null || comment === void 0 ? void 0 : comment.id}`;
|
|
42
|
+
const style = !isGlobalComment && isCollapseCommentEditor ? {
|
|
43
|
+
maxHeight: '341px'
|
|
44
|
+
} : {};
|
|
44
45
|
const deleteComment = (0, _react.useCallback)(async commentId => {
|
|
45
46
|
await _context.default.deleteComment(commentId);
|
|
46
47
|
const {
|
|
@@ -278,7 +279,8 @@ const CommentItemWrapper = _ref => {
|
|
|
278
279
|
className: "comment-item-selected-text"
|
|
279
280
|
}, _slate.Node.string(element))), !isEmptyComment && /*#__PURE__*/_react.default.createElement("div", {
|
|
280
281
|
ref: listRef,
|
|
281
|
-
className: "comment-item-list"
|
|
282
|
+
className: "comment-item-list",
|
|
283
|
+
style: style
|
|
282
284
|
}, /*#__PURE__*/_react.default.createElement(_commentItemContent.default, {
|
|
283
285
|
key: comment.id,
|
|
284
286
|
container: container,
|
|
@@ -298,21 +300,6 @@ const CommentItemWrapper = _ref => {
|
|
|
298
300
|
updateReply
|
|
299
301
|
};
|
|
300
302
|
return /*#__PURE__*/_react.default.createElement(_commentItemReply.default, props);
|
|
301
|
-
})), !isGlobalComment && /*#__PURE__*/_react.default.createElement("div", {
|
|
302
|
-
className: "sdoc-reply-wrapper",
|
|
303
|
-
style: {
|
|
304
|
-
paddingTop: isEmptyComment ? '16px' : ''
|
|
305
|
-
}
|
|
306
|
-
}, isEmptyComment && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
307
|
-
type: "comment",
|
|
308
|
-
placeholder: 'Enter_reply_shift_Enter_for_new_line_Enter_to_send',
|
|
309
|
-
insertContent: addNewComment,
|
|
310
|
-
hiddenComment: hiddenComment
|
|
311
|
-
}), !isEmptyComment && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
312
|
-
type: "reply",
|
|
313
|
-
placeholder: 'Enter_reply_shift_Enter_for_new_line_Enter_to_send',
|
|
314
|
-
insertContent: insertContent,
|
|
315
|
-
hiddenComment: hiddenComment
|
|
316
303
|
})), isShowDeleteDialog && isActive && /*#__PURE__*/_react.default.createElement(_commentDeletePopover.default, {
|
|
317
304
|
type: "comment",
|
|
318
305
|
setIsShowDeleteDialog: setIsShowDeleteDialog,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.sdoc-comment-list-container {
|
|
2
2
|
position: absolute;
|
|
3
|
-
margin-top: 5px;
|
|
4
3
|
right: 0;
|
|
5
4
|
}
|
|
6
5
|
|
|
@@ -8,20 +7,7 @@
|
|
|
8
7
|
font-size: 14px;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
.sdoc-comment-list-container .comment-ui-container {
|
|
12
|
-
background-color: rgba(255, 255, 255);
|
|
13
|
-
margin-bottom: 0px;
|
|
14
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, .15), 0 4px 8px 3px rgba(0, 0, 0, .15);
|
|
15
|
-
padding: 16px;
|
|
16
|
-
border-radius: 5px;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
10
|
/* comment detail list */
|
|
21
|
-
.sdoc-comment-list-container .comment-item-detail-wrapper .comment-item-list {
|
|
22
|
-
margin-bottom: 16px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
11
|
.sdoc-comment-list-container .comment-item-detail-wrapper .comment-item-list .comment-item .comment-content {
|
|
26
12
|
margin-bottom: 0px;
|
|
27
13
|
}
|
|
@@ -30,27 +16,6 @@
|
|
|
30
16
|
padding: 16px 16px 0px;
|
|
31
17
|
}
|
|
32
18
|
|
|
33
|
-
.sdoc-comment-list-container .comment-ui-container.sdoc-resolved {
|
|
34
|
-
background: #f5f5f5;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.sdoc-comment-list-container .comment-ui-container.active {
|
|
38
|
-
position: relative;
|
|
39
|
-
left: -5px;
|
|
40
|
-
background: rgba(255, 255, 255, 1);
|
|
41
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, .15), 0 4px 8px 3px rgba(0, 0, 0, .15);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.sdoc-comment-list-container .comment-item-selected-text-container {
|
|
45
|
-
width: 100%;
|
|
46
|
-
height: 32px;
|
|
47
|
-
display: flex;
|
|
48
|
-
padding: 6px 16px;
|
|
49
|
-
align-items: center;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
border-radius: 3px 3px 0 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
19
|
.sdoc-comment-list-container .comment-item-selected-text-container .sdoc-comment-quote {
|
|
55
20
|
font-size: 12px;
|
|
56
21
|
flex-shrink: 0;
|
|
@@ -73,14 +38,9 @@
|
|
|
73
38
|
padding-bottom: 0px;
|
|
74
39
|
}
|
|
75
40
|
|
|
76
|
-
.sdoc-comment-list-container-popover .comment-item-list {
|
|
77
|
-
max-height: 280px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
41
|
.sdoc-comment-list-container .comment-item {
|
|
81
42
|
position: relative;
|
|
82
43
|
padding: 0px;
|
|
83
|
-
cursor: pointer;
|
|
84
44
|
}
|
|
85
45
|
|
|
86
46
|
.sdoc-comment-list-container .comment-item .comment-item-operation-wrapper {
|
|
@@ -172,7 +132,6 @@
|
|
|
172
132
|
overflow: hidden;
|
|
173
133
|
white-space: nowrap;
|
|
174
134
|
text-overflow: ellipsis;
|
|
175
|
-
cursor: pointer;
|
|
176
135
|
}
|
|
177
136
|
|
|
178
137
|
.sdoc-comment-list-container .comment-header .comment-author__info .name {
|
|
@@ -340,11 +299,6 @@
|
|
|
340
299
|
justify-content: flex-end;
|
|
341
300
|
}
|
|
342
301
|
|
|
343
|
-
.sdoc-doc-comment-editor-container.sdoc-comment-list-container .comment-ui-container {
|
|
344
|
-
padding-left: 10px;
|
|
345
|
-
padding-right: 10px;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
302
|
/* Side comment style */
|
|
349
303
|
.sdoc-article-container .sdoc-comment-list-container .comment-item .comment-header .comment-author__avatar {
|
|
350
304
|
display: flex;
|
|
@@ -380,21 +334,49 @@
|
|
|
380
334
|
padding-left: 8px;
|
|
381
335
|
}
|
|
382
336
|
|
|
383
|
-
.sdoc-article-container .sdoc-comment-list-container .sdoc-reply-wrapper {
|
|
384
|
-
padding: 0 16px 16px;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
337
|
.sdoc-article-container .sdoc-comment-list-container .comment-content div:last-child p {
|
|
388
338
|
margin-bottom: 0;
|
|
389
339
|
}
|
|
390
340
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
341
|
+
.sdoc-comment-list-container-popover {
|
|
342
|
+
background-color: rgba(255, 255, 255);
|
|
343
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, .15), 0 4px 8px 3px rgba(0, 0, 0, .15);
|
|
344
|
+
border-radius: 5px;
|
|
394
345
|
}
|
|
395
346
|
|
|
396
|
-
.sdoc-
|
|
397
|
-
|
|
347
|
+
.sdoc-comment-list-container-popover .comment-item-list {
|
|
348
|
+
max-height: 260px;
|
|
349
|
+
margin-bottom: 16px;
|
|
350
|
+
padding-bottom: 16px;
|
|
351
|
+
border-bottom: 1px solid #ececec;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper {
|
|
355
|
+
padding: 0px 16px 16px 16px;
|
|
356
|
+
width: 100%;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control[readonly] {
|
|
360
|
+
background-color: #fff;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control {
|
|
364
|
+
font-size: 14px;
|
|
365
|
+
font-weight: unset;
|
|
366
|
+
border: 1px solid #ececec;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper.active .form-control {
|
|
370
|
+
padding-top: 14px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control:focus {
|
|
374
|
+
box-shadow: none;
|
|
375
|
+
border-color: #e1e2e5;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.sdoc-comment-list-container-popover .non-global-comment-input-wrapper .form-control::placeholder {
|
|
379
|
+
color: rgb(191, 191, 191);
|
|
398
380
|
}
|
|
399
381
|
|
|
400
382
|
/* Override seafile ui */
|
|
@@ -8,26 +8,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
+
var _reactstrap = require("reactstrap");
|
|
12
|
+
var _reactI18next = require("react-i18next");
|
|
11
13
|
var _context = _interopRequireDefault(require("../../../context"));
|
|
12
14
|
var _useSelectionPosition = require("../../hooks/use-selection-position");
|
|
13
15
|
var _useCommentContext = require("../hooks/comment-hooks/use-comment-context");
|
|
14
16
|
var _commentItemWrapper = _interopRequireDefault(require("./comment-item-wrapper"));
|
|
15
|
-
var
|
|
17
|
+
var _commentEditor = _interopRequireDefault(require("./comment-editor"));
|
|
16
18
|
require("./comment-list.css");
|
|
17
19
|
const CommentList = _ref => {
|
|
18
20
|
let {
|
|
19
|
-
editor,
|
|
20
|
-
comments = [],
|
|
21
|
-
commentDetail = {},
|
|
22
21
|
activeElement,
|
|
23
|
-
|
|
22
|
+
commentDetail = {},
|
|
24
23
|
onSetCommentDetail,
|
|
25
|
-
|
|
24
|
+
t
|
|
26
25
|
} = _ref;
|
|
26
|
+
const commentPopover = (0, _react.useRef)(null);
|
|
27
|
+
const commentDetailRef = (0, _react.useRef)(null);
|
|
27
28
|
const position = (0, _useSelectionPosition.useCommentListPosition)(activeElement);
|
|
28
29
|
const {
|
|
29
30
|
dispatch
|
|
30
31
|
} = (0, _useCommentContext.useCommentContext)();
|
|
32
|
+
const [showEditor, setShowEditor] = (0, _react.useState)(false);
|
|
33
|
+
const [inputContent, setInputContent] = (0, _react.useState)(null);
|
|
34
|
+
const [top, setTop] = (0, _react.useState)('-999px');
|
|
35
|
+
const isEmptyComment = Object.keys(commentDetail).length ? false : true;
|
|
36
|
+
const isCollapseCommentEditor = !isEmptyComment && !showEditor;
|
|
31
37
|
const insertComment = (0, _react.useCallback)(async (elementId, comment) => {
|
|
32
38
|
const res = await _context.default.insertComment(comment);
|
|
33
39
|
const {
|
|
@@ -48,8 +54,9 @@ const CommentList = _ref => {
|
|
|
48
54
|
}
|
|
49
55
|
});
|
|
50
56
|
onSetCommentDetail(newComment);
|
|
57
|
+
setShowEditor(true);
|
|
51
58
|
}, [dispatch, onSetCommentDetail]);
|
|
52
|
-
const
|
|
59
|
+
const addNewComment = (0, _react.useCallback)(content => {
|
|
53
60
|
const user = _context.default.getUserInfo();
|
|
54
61
|
const elementId = activeElement === null || activeElement === void 0 ? void 0 : activeElement.id;
|
|
55
62
|
const time = (0, _dayjs.default)().format('YYYY-MM-DD HH:mm:ss');
|
|
@@ -64,36 +71,67 @@ const CommentList = _ref => {
|
|
|
64
71
|
};
|
|
65
72
|
insertComment(elementId, comment);
|
|
66
73
|
}, [insertComment, activeElement === null || activeElement === void 0 ? void 0 : activeElement.id]);
|
|
74
|
+
const replyComment = (0, _react.useCallback)(content => {
|
|
75
|
+
if (commentDetailRef !== null && commentDetailRef !== void 0 && commentDetailRef.current) {
|
|
76
|
+
commentDetailRef.current.insertContent(content);
|
|
77
|
+
}
|
|
78
|
+
}, []);
|
|
79
|
+
const hiddenComment = (0, _react.useCallback)(() => {
|
|
80
|
+
setShowEditor(false);
|
|
81
|
+
}, []);
|
|
82
|
+
(0, _react.useEffect)(() => {
|
|
83
|
+
console.log('position.y', position.y);
|
|
84
|
+
setTop(`${position.y}px`);
|
|
85
|
+
if (commentPopover !== null && commentPopover !== void 0 && commentPopover.current) {
|
|
86
|
+
const {
|
|
87
|
+
height
|
|
88
|
+
} = commentPopover.current.getBoundingClientRect();
|
|
89
|
+
const popoverBottomY = position.y + height;
|
|
90
|
+
const viewportHeight = window.innerHeight;
|
|
91
|
+
if (popoverBottomY > viewportHeight) {
|
|
92
|
+
console.log('超出');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}, [position.y]);
|
|
67
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
ref: commentPopover,
|
|
68
98
|
id: "sdoc-comment-list-container",
|
|
69
99
|
className: "sdoc-comment-list-container sdoc-comment-list-container-popover",
|
|
70
100
|
style: {
|
|
71
|
-
top
|
|
101
|
+
top,
|
|
72
102
|
width: '300px'
|
|
73
103
|
}
|
|
74
|
-
}, !isShowCommentDetail && comments.map(comment => {
|
|
75
|
-
var _topLevelComment$repl, _topLevelComment$repl2;
|
|
76
|
-
const topLevelComment = comment || {};
|
|
77
|
-
const replyCount = topLevelComment === null || topLevelComment === void 0 ? void 0 : (_topLevelComment$repl = topLevelComment.replies) === null || _topLevelComment$repl === void 0 ? void 0 : _topLevelComment$repl.length;
|
|
78
|
-
const latestReply = ((_topLevelComment$repl2 = topLevelComment.replies) === null || _topLevelComment$repl2 === void 0 ? void 0 : _topLevelComment$repl2.length) > 0 ? topLevelComment.replies[topLevelComment.replies.length - 1] : null;
|
|
79
|
-
return /*#__PURE__*/_react.default.createElement(_commentItemCollapseWrapper.default, {
|
|
80
|
-
key: topLevelComment.id,
|
|
81
|
-
editor: editor,
|
|
82
|
-
topLevelComment: topLevelComment,
|
|
83
|
-
replyCount: replyCount,
|
|
84
|
-
latestReply: latestReply,
|
|
85
|
-
setCurrentCommentGroup: () => {
|
|
86
|
-
deleteUnseenNotifications && deleteUnseenNotifications(topLevelComment);
|
|
87
|
-
onSetCommentDetail(topLevelComment);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}), isShowCommentDetail && /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
-
className: "comment-list"
|
|
92
104
|
}, /*#__PURE__*/_react.default.createElement(_commentItemWrapper.default, {
|
|
105
|
+
commentDetailRef: commentDetailRef,
|
|
93
106
|
comment: commentDetail,
|
|
94
107
|
isActive: true,
|
|
95
|
-
isEmptyComment:
|
|
96
|
-
|
|
97
|
-
})
|
|
108
|
+
isEmptyComment: isEmptyComment,
|
|
109
|
+
isCollapseCommentEditor: isCollapseCommentEditor
|
|
110
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: "non-global-comment-input-wrapper",
|
|
112
|
+
style: {
|
|
113
|
+
paddingTop: isEmptyComment ? '16px' : ''
|
|
114
|
+
}
|
|
115
|
+
}, isEmptyComment && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
116
|
+
type: "comment",
|
|
117
|
+
insertContent: addNewComment,
|
|
118
|
+
hiddenComment: hiddenComment
|
|
119
|
+
}), !isEmptyComment && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !showEditor && /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
120
|
+
value: inputContent !== null && inputContent !== void 0 && inputContent.trim() ? '.....' : '',
|
|
121
|
+
readOnly: true,
|
|
122
|
+
placeholder: t('Enter_reply'),
|
|
123
|
+
onFocus: () => {
|
|
124
|
+
setShowEditor(true);
|
|
125
|
+
}
|
|
126
|
+
}), showEditor && /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
127
|
+
type: "reply",
|
|
128
|
+
placeholder: 'Enter_reply_shift_Enter_for_new_line_Enter_to_send',
|
|
129
|
+
commentContent: inputContent,
|
|
130
|
+
insertContent: replyComment,
|
|
131
|
+
onContentChange: content => {
|
|
132
|
+
setInputContent(content);
|
|
133
|
+
},
|
|
134
|
+
hiddenComment: hiddenComment
|
|
135
|
+
}))));
|
|
98
136
|
};
|
|
99
|
-
var _default = exports.default = CommentList;
|
|
137
|
+
var _default = exports.default = (0, _reactI18next.withTranslation)('sdoc-editor')(CommentList);
|
|
@@ -30,9 +30,7 @@ const EditorComment = _ref => {
|
|
|
30
30
|
editor
|
|
31
31
|
}); // The slate node of the current cursor line
|
|
32
32
|
const [activeElement, setActiveElement] = (0, _react.useState)(null); // The slate node currently activated by clicking
|
|
33
|
-
const [comments, setComments] = (0, _react.useState)([]);
|
|
34
33
|
const [isShowComments, setIsShowComments] = (0, _react.useState)(false);
|
|
35
|
-
const [isShowCommentDetail, setIsShowCommentDetail] = (0, _react.useState)(true);
|
|
36
34
|
const [commentDetail, setCommentDetail] = (0, _react.useState)({});
|
|
37
35
|
const onAddCommentToggle = (0, _react.useCallback)(event => {
|
|
38
36
|
event.stopPropagation();
|
|
@@ -43,23 +41,19 @@ const EditorComment = _ref => {
|
|
|
43
41
|
}
|
|
44
42
|
setActiveElement(activeElement);
|
|
45
43
|
setIsShowComments(true);
|
|
46
|
-
setIsShowCommentDetail(true);
|
|
47
44
|
setCommentDetail({});
|
|
48
45
|
}, [currentSelectionElement]);
|
|
49
46
|
const onSelectElement = (0, _react.useCallback)(elementId => {
|
|
50
47
|
const activeElement = (0, _index.getCommentElementById)(elementId, editor);
|
|
51
48
|
setActiveElement(activeElement);
|
|
52
49
|
const unresolvedComments = element_comments_map[elementId].filter(item => !item.resolved);
|
|
53
|
-
|
|
50
|
+
setCommentDetail(unresolvedComments[0]);
|
|
54
51
|
setIsShowComments(true);
|
|
55
|
-
setIsShowCommentDetail(false);
|
|
56
52
|
}, [editor, element_comments_map]);
|
|
57
53
|
const onSetCommentDetail = (0, _react.useCallback)(comment => {
|
|
58
54
|
setCommentDetail(comment);
|
|
59
|
-
setIsShowCommentDetail(true);
|
|
60
55
|
}, []);
|
|
61
56
|
const hiddenComment = (0, _react.useCallback)(() => {
|
|
62
|
-
setComments([]);
|
|
63
57
|
setCommentDetail({});
|
|
64
58
|
setIsShowComments(false);
|
|
65
59
|
}, []);
|
|
@@ -68,7 +62,6 @@ const EditorComment = _ref => {
|
|
|
68
62
|
(0, _react.useEffect)(() => {
|
|
69
63
|
if (activeElement) {
|
|
70
64
|
const unresolvedComments = element_comments_map[activeElement.id].filter(item => !item.resolved);
|
|
71
|
-
setComments(unresolvedComments);
|
|
72
65
|
if (unresolvedComments.length === 0) {
|
|
73
66
|
setIsShowComments(false);
|
|
74
67
|
}
|
|
@@ -124,13 +117,9 @@ const EditorComment = _ref => {
|
|
|
124
117
|
editor: editor,
|
|
125
118
|
onSelectElement: onSelectElement
|
|
126
119
|
}), isShowComments && /*#__PURE__*/_react.default.createElement(_commentList.default, {
|
|
127
|
-
editor: editor,
|
|
128
|
-
comments: comments,
|
|
129
120
|
activeElement: activeElement,
|
|
130
|
-
isShowCommentDetail: isShowCommentDetail,
|
|
131
121
|
commentDetail: commentDetail,
|
|
132
|
-
onSetCommentDetail: onSetCommentDetail
|
|
133
|
-
deleteUnseenNotifications: deleteUnseenNotifications
|
|
122
|
+
onSetCommentDetail: onSetCommentDetail
|
|
134
123
|
})));
|
|
135
124
|
};
|
|
136
125
|
var _default = exports.default = EditorComment;
|
|
@@ -15,22 +15,22 @@ const GlobalCommentEditor = _ref => {
|
|
|
15
15
|
type,
|
|
16
16
|
insertDocComment,
|
|
17
17
|
hiddenCommentEditor,
|
|
18
|
-
|
|
18
|
+
onContentChange
|
|
19
19
|
} = _ref;
|
|
20
20
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
21
|
className: (0, _classnames.default)('sdoc-doc-comment-editor-container', 'sdoc-comment-list-container', {
|
|
22
22
|
'scrolled': isScrollDisplayed
|
|
23
23
|
})
|
|
24
24
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
25
|
-
className: "comment-
|
|
25
|
+
className: "sdoc-doc-comment-editor-content"
|
|
26
26
|
}, /*#__PURE__*/_react.default.createElement(_commentEditor.default, {
|
|
27
27
|
type: type,
|
|
28
28
|
className: "sdoc-doc-comment-editor",
|
|
29
|
-
|
|
29
|
+
commentContent: globalCommentContent,
|
|
30
30
|
hiddenUserInfo: true,
|
|
31
31
|
insertContent: insertDocComment,
|
|
32
32
|
hiddenComment: hiddenCommentEditor,
|
|
33
|
-
|
|
33
|
+
onContentChange: onContentChange
|
|
34
34
|
})));
|
|
35
35
|
};
|
|
36
36
|
var _default = exports.default = GlobalCommentEditor;
|
|
@@ -178,16 +178,15 @@
|
|
|
178
178
|
width: 100%;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.sdoc-comment-drawer .sdoc-doc-comment-editor-container .comment-
|
|
181
|
+
.sdoc-comment-drawer .sdoc-doc-comment-editor-container .sdoc-doc-comment-editor-content {
|
|
182
|
+
position: relative;
|
|
182
183
|
margin-bottom: 0;
|
|
183
184
|
padding: 0px;
|
|
184
185
|
left: 0;
|
|
185
186
|
border: 0px;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
.sdoc-comment-drawer .sdoc-doc-comment-editor-container .comment-ui-container:hover {
|
|
189
|
-
background-color: #FFF !important;
|
|
187
|
+
background-color: #FFF;
|
|
190
188
|
box-shadow: none;
|
|
189
|
+
border-radius: 0px;
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
/* custom */
|
|
@@ -196,23 +195,22 @@
|
|
|
196
195
|
left: 0;
|
|
197
196
|
}
|
|
198
197
|
|
|
198
|
+
.sdoc-comment-drawer .sdoc-comment-list-container .comment-collapse-wrapper {
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
}
|
|
201
|
+
|
|
199
202
|
.sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container {
|
|
200
203
|
background-color: #FFF;
|
|
201
204
|
margin-bottom: 0px;
|
|
202
205
|
box-shadow: none;
|
|
203
206
|
padding: 16px;
|
|
204
207
|
border-radius: 0px;
|
|
205
|
-
cursor: pointer;
|
|
206
208
|
}
|
|
207
209
|
|
|
208
210
|
.sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container:hover {
|
|
209
211
|
background-color: #f5f5f5;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
|
-
.sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container .comment-item-list {
|
|
213
|
-
padding-bottom: 0px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
214
|
.sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container.active .comment-item:hover {
|
|
217
215
|
background-color: unset;
|
|
218
216
|
}
|
|
@@ -277,9 +275,15 @@
|
|
|
277
275
|
}
|
|
278
276
|
|
|
279
277
|
.sdoc-comment-drawer .sdoc-comment-list-container .comment-item-selected-text-container {
|
|
278
|
+
width: 100%;
|
|
279
|
+
height: auto;
|
|
280
280
|
color: #666666;
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
281
283
|
padding: 0px 0px 16px 0px;
|
|
282
|
-
|
|
284
|
+
border-radius: 3px 3px 0 0;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
overflow: hidden;
|
|
283
287
|
}
|
|
284
288
|
|
|
285
289
|
.comments-panel-body__header .sdoc-comment-filter-dropdown.sdoc-dropdown-menu {
|
|
@@ -208,7 +208,7 @@ const GlobalComment = _ref => {
|
|
|
208
208
|
type: activeCommentGroup ? 'replay' : 'comment',
|
|
209
209
|
hiddenCommentEditor: hiddenCommentEditor,
|
|
210
210
|
insertDocComment: insertDocComment,
|
|
211
|
-
|
|
211
|
+
onContentChange: content => {
|
|
212
212
|
setGlobalCommentContent(content);
|
|
213
213
|
}
|
|
214
214
|
})))));
|
|
@@ -44,6 +44,7 @@ function AIModule(_ref) {
|
|
|
44
44
|
const [searchResult, setSearchResult] = (0, _react.useState)(null);
|
|
45
45
|
const [currentLang, setCurrentLang] = (0, _react.useState)('en');
|
|
46
46
|
const [isShowTipDialog, setIsShowTipDialog] = (0, _react.useState)(false);
|
|
47
|
+
const [selectDom, setSelectDom] = (0, _react.useState)(null);
|
|
47
48
|
const toggleAskAI = (0, _react.useCallback)(() => {
|
|
48
49
|
scrollRef.current = document.querySelector('.sdoc-scroll-container');
|
|
49
50
|
const {
|
|
@@ -57,6 +58,7 @@ function AIModule(_ref) {
|
|
|
57
58
|
}
|
|
58
59
|
const domSelection = window.getSelection();
|
|
59
60
|
const domRange = domSelection.getRangeAt(0);
|
|
61
|
+
setSelectDom(domRange);
|
|
60
62
|
const rect = domRange.getBoundingClientRect();
|
|
61
63
|
const needPaddingBottomHeight = scrollTop + rect.bottom + _constants.AI_MIN_HEIGHT - scrollHeight;
|
|
62
64
|
if (needPaddingBottomHeight > 0) {
|
|
@@ -66,7 +68,7 @@ function AIModule(_ref) {
|
|
|
66
68
|
const heightDiff = rect.bottom + _constants.AI_MIN_HEIGHT - window.innerHeight;
|
|
67
69
|
if (heightDiff > 0) {
|
|
68
70
|
scrollRef.current.scrollTo({
|
|
69
|
-
top: scrollRef.current.scrollTop + heightDiff +
|
|
71
|
+
top: scrollRef.current.scrollTop + heightDiff + 32,
|
|
70
72
|
behavior: 'smooth'
|
|
71
73
|
});
|
|
72
74
|
}
|
|
@@ -99,7 +101,7 @@ function AIModule(_ref) {
|
|
|
99
101
|
const heightDiff = slateRect.bottom + _constants.AI_MIN_HEIGHT - window.innerHeight;
|
|
100
102
|
if (heightDiff > 0) {
|
|
101
103
|
scrollRef.current.scrollTo({
|
|
102
|
-
top: scrollRef.current.scrollTop + heightDiff +
|
|
104
|
+
top: scrollRef.current.scrollTop + heightDiff + 32,
|
|
103
105
|
behavior: 'smooth'
|
|
104
106
|
});
|
|
105
107
|
}
|
|
@@ -156,33 +158,55 @@ function AIModule(_ref) {
|
|
|
156
158
|
window.removeEventListener('click', onDocumentClick);
|
|
157
159
|
};
|
|
158
160
|
}, [onDocumentClick]);
|
|
161
|
+
const onScroll = (0, _react.useCallback)(event => {
|
|
162
|
+
if (!element) {
|
|
163
|
+
console.log(selectDom);
|
|
164
|
+
const newRect = selectDom.getBoundingClientRect();
|
|
165
|
+
const aboveNode = (0, _core.getAboveBlockNode)(editor);
|
|
166
|
+
const slateDom = _slateReact.ReactEditor.toDOMNode(editor, aboveNode[0]);
|
|
167
|
+
const slateRect = slateDom.getBoundingClientRect();
|
|
168
|
+
console.log(newRect);
|
|
169
|
+
console.log(slateRect);
|
|
170
|
+
const el = aiRef.current;
|
|
171
|
+
el.style.top = `${newRect.bottom + 8}px`; // top = Current top + Element height
|
|
172
|
+
el.style.left = `${slateRect.left}px`;
|
|
173
|
+
el.style.display = 'block';
|
|
174
|
+
} else {
|
|
175
|
+
const slateDom = _slateReact.ReactEditor.toDOMNode(editor, element);
|
|
176
|
+
const slateRect = slateDom.getBoundingClientRect();
|
|
177
|
+
const el = aiRef.current;
|
|
178
|
+
el.style.top = `${slateRect.bottom + 8}px`; // top = Current top + Element height
|
|
179
|
+
el.style.left = `${slateRect.left}px`;
|
|
180
|
+
el.style.display = 'block';
|
|
181
|
+
}
|
|
182
|
+
}, [editor, element, selectDom]);
|
|
159
183
|
(0, _react.useEffect)(() => {
|
|
160
184
|
let observerRefValue = null;
|
|
161
185
|
if (isShowAIPopover) {
|
|
162
|
-
scrollRef.current && scrollRef.current.addEventListener('scroll',
|
|
186
|
+
scrollRef.current && scrollRef.current.addEventListener('scroll', onScroll);
|
|
163
187
|
observerRefValue = scrollRef.current;
|
|
164
188
|
} else {
|
|
165
|
-
scrollRef.current && scrollRef.current.removeEventListener('scroll',
|
|
189
|
+
scrollRef.current && scrollRef.current.removeEventListener('scroll', onScroll);
|
|
166
190
|
}
|
|
167
191
|
return () => {
|
|
168
192
|
if (observerRefValue) {
|
|
169
|
-
observerRefValue.removeEventListener('scroll',
|
|
193
|
+
observerRefValue.removeEventListener('scroll', onScroll);
|
|
170
194
|
}
|
|
171
195
|
};
|
|
172
|
-
}, [isShowAIPopover,
|
|
196
|
+
}, [isShowAIPopover, onScroll]);
|
|
173
197
|
const onSearchValueChanged = (0, _react.useCallback)(event => {
|
|
174
198
|
const value = event.target.value;
|
|
175
199
|
if (value === searchValue) return;
|
|
176
200
|
setSearchValue(value);
|
|
177
201
|
}, [searchValue]);
|
|
178
|
-
const onEnter = (0, _react.useCallback)(
|
|
202
|
+
const onEnter = (0, _react.useCallback)(event => {
|
|
179
203
|
if (!searchValue) return;
|
|
180
204
|
setOpType(_constants.OPERATION_TYPES.DEFAULT);
|
|
181
205
|
setIsGenerating(true);
|
|
182
206
|
setTimeout(() => {
|
|
183
207
|
setIsGenerating(false);
|
|
184
208
|
setSearchResult('[Feature is under development...]Thank you, the world becomes more beautiful because of you!');
|
|
185
|
-
});
|
|
209
|
+
}, 2000);
|
|
186
210
|
}, [searchValue]);
|
|
187
211
|
const onKeyDown = (0, _react.useCallback)(event => {
|
|
188
212
|
if ((0, _isHotkey.default)('enter', event)) {
|
|
@@ -335,20 +359,14 @@ function AIModule(_ref) {
|
|
|
335
359
|
const isShowReplace = (0, _react.useMemo)(() => {
|
|
336
360
|
return opType !== _constants.OPERATION_TYPES.DEFAULT;
|
|
337
361
|
}, [opType]);
|
|
338
|
-
const resultMenu = (0, _react.useMemo)(() => {
|
|
339
|
-
const type = opType && opType.toUpperCase();
|
|
340
|
-
if (opType === _constants.OPERATION_TYPES.TRANSLATE) {
|
|
341
|
-
return _constants.LANG_MENU_CONFIG[currentLang.toUpperCase()];
|
|
342
|
-
}
|
|
343
|
-
return _constants.OPERATION_MENUS_CONFIG[type];
|
|
344
|
-
}, [currentLang, opType]);
|
|
345
362
|
const closeTipDialog = (0, _react.useCallback)(() => {
|
|
346
363
|
setIsShowTipDialog(false);
|
|
347
364
|
}, []);
|
|
348
365
|
const discardCurrentContent = (0, _react.useCallback)(() => {
|
|
349
366
|
onCloseClick();
|
|
350
367
|
setIsShowTipDialog(false);
|
|
351
|
-
|
|
368
|
+
(0, _core.focusEditor)(editor);
|
|
369
|
+
}, [editor, onCloseClick]);
|
|
352
370
|
return /*#__PURE__*/_react.default.createElement(_commons.ElementPopover, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
353
371
|
className: "sdoc-ai-module-container",
|
|
354
372
|
ref: aiRef
|
|
@@ -402,18 +420,9 @@ function AIModule(_ref) {
|
|
|
402
420
|
className: "sdoc-ai-content has-result"
|
|
403
421
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
404
422
|
className: "sdoc-ai-result"
|
|
405
|
-
},
|
|
406
|
-
className: "sdoc-ai-result-header"
|
|
407
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_aiIcon.default, null), /*#__PURE__*/_react.default.createElement("span", null, t(resultMenu.text))), /*#__PURE__*/_react.default.createElement("span", {
|
|
408
|
-
className: "sdocfont sdoc-close",
|
|
409
|
-
onClick: onDeprecationClick
|
|
410
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
423
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
411
424
|
className: "sdoc-ai-result-content"
|
|
412
|
-
}, isGenerating ? t('Processing_message') : searchResult), /*#__PURE__*/_react.default.createElement("div", {
|
|
413
|
-
className: "sdoc-ai-statistic"
|
|
414
|
-
}, t('Generated_content_x_words', {
|
|
415
|
-
count: searchResult.length
|
|
416
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
425
|
+
}, isGenerating ? t('Processing_message') : searchResult)), /*#__PURE__*/_react.default.createElement("div", {
|
|
417
426
|
className: "sdoc-ai-search"
|
|
418
427
|
}, /*#__PURE__*/_react.default.createElement(_aiIcon.default, null), /*#__PURE__*/_react.default.createElement("input", {
|
|
419
428
|
placeholder: t('Ask_AI_anything'),
|
|
@@ -421,7 +430,7 @@ function AIModule(_ref) {
|
|
|
421
430
|
onKeyDown: onKeyDown,
|
|
422
431
|
onChange: onSearchValueChanged
|
|
423
432
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
424
|
-
className:
|
|
433
|
+
className: `sdocfont sdoc-send-arrow ${!searchValue ? 'disable' : ''}`,
|
|
425
434
|
onClick: onEnter
|
|
426
435
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
427
436
|
className: "sdoc-ai-operations sdoc-dropdown-menu"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.sdoc-ai-module-container {
|
|
2
2
|
position: absolute;
|
|
3
|
-
z-index:
|
|
3
|
+
z-index: 101;
|
|
4
4
|
width: 100%;
|
|
5
5
|
max-width: 672px;
|
|
6
6
|
display: none;
|
|
@@ -40,13 +40,17 @@
|
|
|
40
40
|
position: absolute;
|
|
41
41
|
right: 16px;
|
|
42
42
|
color: #ff9800;
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.sdoc-ai-content .sdoc-ai-search .sdoc-send-arrow.disable {
|
|
47
47
|
color: #BDBDBD;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
.sdoc-ai-content .sdoc-ai-search .sdoc-send-arrow:not(.disable) {
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
.sdoc-ai-content .sdoc-ai-result {
|
|
51
55
|
position: relative;
|
|
52
56
|
height: 50px;
|
|
@@ -56,9 +60,9 @@
|
|
|
56
60
|
width: 200px;
|
|
57
61
|
margin-top: 8px;
|
|
58
62
|
padding: 8px 0;
|
|
59
|
-
border: 1px solid #
|
|
60
|
-
border-radius:
|
|
61
|
-
box-shadow: 0
|
|
63
|
+
border: 1px solid #e5e6e8;
|
|
64
|
+
border-radius: 2px;
|
|
65
|
+
box-shadow: 0 0 10px #ccc;
|
|
62
66
|
background-color: #fff;
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -83,6 +87,10 @@
|
|
|
83
87
|
align-items: center;
|
|
84
88
|
}
|
|
85
89
|
|
|
90
|
+
.sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-result-header span {
|
|
91
|
+
color: #666;
|
|
92
|
+
}
|
|
93
|
+
|
|
86
94
|
.sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-result-header .sdocfont {
|
|
87
95
|
font-size: 14px;
|
|
88
96
|
}
|
|
@@ -99,6 +107,15 @@
|
|
|
99
107
|
color: #555;
|
|
100
108
|
}
|
|
101
109
|
|
|
102
|
-
.sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-
|
|
103
|
-
|
|
110
|
+
.sdoc-ai-module-container .sdoc-ai-result .sdoc-ai-statistic {
|
|
111
|
+
color: #666;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ai-lang-sub-menu .popover,
|
|
115
|
+
.ai-adjust-sub-menu .popover {
|
|
116
|
+
padding: 8px 0;
|
|
117
|
+
border: 1px solid #e5e6e8;
|
|
118
|
+
border-radius: 2px;
|
|
119
|
+
box-shadow: 0 0 10px #ccc;
|
|
120
|
+
background-color: #fff;
|
|
104
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.184-alpha.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This is a sdoc editor",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"copy-to-clipboard": "^3.3.3",
|
|
17
17
|
"dayjs": "1.10.7",
|
|
18
18
|
"deep-copy": "1.4.2",
|
|
19
|
-
"dtable-ui-component": "^5.
|
|
19
|
+
"dtable-ui-component": "^5.1.9",
|
|
20
20
|
"is-hotkey": "0.2.0",
|
|
21
21
|
"is-url": "^1.2.4",
|
|
22
22
|
"lodash.isequal": "4.5.0",
|
|
@@ -585,23 +585,24 @@
|
|
|
585
585
|
"Link_to_file": "Ссылка на файл",
|
|
586
586
|
"Create_a_new_file": "Создать новый файл",
|
|
587
587
|
"Suggestion": "Предложение",
|
|
588
|
-
"Continuation": "
|
|
589
|
-
"More_details": "
|
|
590
|
-
"More_concise": "
|
|
591
|
-
"More_vivid": "
|
|
592
|
-
"Translate": "
|
|
593
|
-
"Adjustment": "
|
|
594
|
-
"Try_again": "
|
|
595
|
-
"Deprecation": "
|
|
596
|
-
"Generated_content_x_words": "
|
|
597
|
-
"Ask_AI_anything": "
|
|
598
|
-
"Thinking": "
|
|
599
|
-
"Translation_error_message": "
|
|
600
|
-
"The_translation_content_cannot_be_empty": "
|
|
601
|
-
"Processing_message": "
|
|
602
|
-
"AI_tip_content": "
|
|
588
|
+
"Continuation": "Продолжение",
|
|
589
|
+
"More_details": "Более подробный",
|
|
590
|
+
"More_concise": "Более краткий",
|
|
591
|
+
"More_vivid": "Более яркий",
|
|
592
|
+
"Translate": "Перевести",
|
|
593
|
+
"Adjustment": "Регулировка",
|
|
594
|
+
"Try_again": "Попробовать еще раз",
|
|
595
|
+
"Deprecation": "Устаревание",
|
|
596
|
+
"Generated_content_x_words": "Сгенерированный контент {{count}} слов",
|
|
597
|
+
"Ask_AI_anything": "Спросите ИИ о чем угодно...",
|
|
598
|
+
"Thinking": "Думаю...",
|
|
599
|
+
"Translation_error_message": "Ошибка перевода, попробуйте еще раз.",
|
|
600
|
+
"The_translation_content_cannot_be_empty": "Содержание перевода не может быть пустым",
|
|
601
|
+
"Processing_message": "Обработка, подождите...",
|
|
602
|
+
"AI_tip_content": "Удалить текущий контент?",
|
|
603
603
|
"Discard": "Отменить",
|
|
604
604
|
"English": "English",
|
|
605
|
-
"Chinese": "
|
|
606
|
-
"Ask_AI": "Спросить ИИ"
|
|
605
|
+
"Chinese": "Китайский",
|
|
606
|
+
"Ask_AI": "Спросить ИИ",
|
|
607
|
+
"Enter_reply": "Enter reply"
|
|
607
608
|
}
|
|
@@ -594,7 +594,7 @@
|
|
|
594
594
|
"Try_again": "再试一次",
|
|
595
595
|
"Deprecation": "弃用",
|
|
596
596
|
"Generated_content_x_words": "已生成内容 {{count}} 字",
|
|
597
|
-
"Ask_AI_anything": "
|
|
597
|
+
"Ask_AI_anything": "询问 AI 任何事情...",
|
|
598
598
|
"Thinking": "思考...",
|
|
599
599
|
"Translation_error_message": "翻译出错,请重试",
|
|
600
600
|
"The_translation_content_cannot_be_empty": "翻译内容不能为空",
|
|
@@ -603,5 +603,6 @@
|
|
|
603
603
|
"Discard": "丢弃",
|
|
604
604
|
"English": "英语",
|
|
605
605
|
"Chinese": "中文",
|
|
606
|
-
"Ask_AI": "询问 AI"
|
|
606
|
+
"Ask_AI": "询问 AI",
|
|
607
|
+
"Enter_reply": "输入回复"
|
|
607
608
|
}
|