@seafile/sdoc-editor 1.0.113 → 1.0.115
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 +2 -0
- package/dist/basic-sdk/comment/components/comment-item-collapse-wrapper.js +1 -1
- package/dist/basic-sdk/comment/components/global-comment/global-comment-header.js +1 -1
- package/dist/basic-sdk/comment/components/global-comment/index.css +5 -7
- package/dist/basic-sdk/comment/components/global-comment/index.js +8 -7
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _reactI18next = require("react-i18next");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _slate = require("@seafile/slate");
|
|
13
|
+
var _slateReact = require("@seafile/slate-react");
|
|
13
14
|
var _context = _interopRequireDefault(require("../../../context"));
|
|
14
15
|
var _useParticipants = require("../hooks/use-participants");
|
|
15
16
|
var _sdocCommentEditor = _interopRequireDefault(require("../../editor/sdoc-comment-editor"));
|
|
@@ -90,6 +91,7 @@ const CommentEditor = _ref => {
|
|
|
90
91
|
updateContent && updateContent(value);
|
|
91
92
|
}, [content, insertContent, updateContent]);
|
|
92
93
|
const onSubmit = (0, _react.useCallback)(event => {
|
|
94
|
+
if (!_slateReact.ReactEditor.isFocused(editor)) return;
|
|
93
95
|
event && event.stopPropagation();
|
|
94
96
|
const mdString = (0, _slateToMd.default)(editor.children);
|
|
95
97
|
updateValue(mdString);
|
|
@@ -110,7 +110,7 @@ const CommentItemCollapseWrapper = _ref => {
|
|
|
110
110
|
className: "comments-count"
|
|
111
111
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
112
112
|
className: "sdocfont sdoc-comments"
|
|
113
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
113
|
+
}), commentCount !== 0 && /*#__PURE__*/_react.default.createElement("span", {
|
|
114
114
|
className: "comments-count-number"
|
|
115
115
|
}, commentCount)), /*#__PURE__*/_react.default.createElement("div", {
|
|
116
116
|
className: "comment-author"
|
|
@@ -65,7 +65,7 @@ const GlobalCommentHeader = _ref => {
|
|
|
65
65
|
}, activeCommentGroup ? t('Comment_details') : t('Comments'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
66
66
|
ref: panelHeaderRef,
|
|
67
67
|
className: "comments-panel-header-right"
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
}, !activeCommentGroup && /*#__PURE__*/_react.default.createElement("div", {
|
|
69
69
|
id: "sdoc-read-all-btn",
|
|
70
70
|
className: "sdoc-icon-btn",
|
|
71
71
|
onClick: toggleReadAll
|
|
@@ -117,13 +117,14 @@
|
|
|
117
117
|
display: flex;
|
|
118
118
|
flex-direction: column;
|
|
119
119
|
padding-top: 0px;
|
|
120
|
-
margin-bottom:
|
|
120
|
+
margin-bottom: 11px;
|
|
121
121
|
overflow: auto;
|
|
122
|
+
border-bottom: 1px solid #e1e2e5;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
.sdoc-comment-drawer .comments-panel-body__content .sdoc-comment-list-container {
|
|
125
126
|
position: relative;
|
|
126
|
-
margin-top: 0px
|
|
127
|
+
margin-top: 0px;
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
.sdoc-comment-drawer .comments-panel-body__content .comment-ui-container.sdoc-resolved {
|
|
@@ -176,9 +177,7 @@
|
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
.sdoc-comment-drawer .comments-panel-body .sdoc-doc-comment-editor-container {
|
|
179
|
-
|
|
180
|
-
position: absolute;
|
|
181
|
-
bottom: 16px;
|
|
180
|
+
position: relative;
|
|
182
181
|
width: 100%;
|
|
183
182
|
}
|
|
184
183
|
|
|
@@ -197,7 +196,6 @@
|
|
|
197
196
|
/* custom */
|
|
198
197
|
.sdoc-comment-drawer .sdoc-comment-list-container .comment-ui-container {
|
|
199
198
|
background-color: #FFF;
|
|
200
|
-
border-bottom: 1px solid #e1e2e5;
|
|
201
199
|
margin-bottom: 0px;
|
|
202
200
|
box-shadow: none;
|
|
203
201
|
padding: 16px;
|
|
@@ -298,6 +296,6 @@
|
|
|
298
296
|
}
|
|
299
297
|
|
|
300
298
|
.sdoc-comment-drawer .sdoc-comment-list-container .comment-item-detail-wrapper .comment-operation .sdoc-confirm {
|
|
301
|
-
color: rgb(70, 77, 90)
|
|
299
|
+
color: rgb(70, 77, 90);
|
|
302
300
|
font-weight: unset;
|
|
303
301
|
}
|
|
@@ -124,6 +124,7 @@ const GlobalComment = _ref => {
|
|
|
124
124
|
setActiveCommentGroup(null);
|
|
125
125
|
}
|
|
126
126
|
}, [commentList]);
|
|
127
|
+
const commentEditorPlaceholder = !activeCommentGroup ? t('Enter_comment_shift_enter_for_new_line_Enter_to_send') : t('Enter_reply_shift_Enter_for_new_line_Enter_to_send');
|
|
127
128
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
128
129
|
className: "sdoc-comment-drawer"
|
|
129
130
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -135,7 +136,7 @@ const GlobalComment = _ref => {
|
|
|
135
136
|
setCurrentCommentGroup: setCurrentCommentGroup
|
|
136
137
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
137
138
|
className: "comments-panel-body"
|
|
138
|
-
}, /*#__PURE__*/_react.default.createElement(_globalCommentBodyHeader.default, {
|
|
139
|
+
}, !activeCommentGroup && /*#__PURE__*/_react.default.createElement(_globalCommentBodyHeader.default, {
|
|
139
140
|
commentList: commentList,
|
|
140
141
|
commentType: commentType,
|
|
141
142
|
setCommentType: setCommentType
|
|
@@ -148,7 +149,7 @@ const GlobalComment = _ref => {
|
|
|
148
149
|
}, !activeCommentGroup && Array.isArray(commentList) && commentList.map(comment => {
|
|
149
150
|
var _comment$replies, _comment$replies2;
|
|
150
151
|
const latestComment = ((_comment$replies = comment.replies) === null || _comment$replies === void 0 ? void 0 : _comment$replies.length) > 0 ? comment.replies[comment.replies.length - 1] : comment;
|
|
151
|
-
const commentCount = (
|
|
152
|
+
const commentCount = (_comment$replies2 = comment.replies) === null || _comment$replies2 === void 0 ? void 0 : _comment$replies2.length;
|
|
152
153
|
const elementId = comment.detail.element_id;
|
|
153
154
|
const element = getNodeByElementId(elementId);
|
|
154
155
|
return /*#__PURE__*/_react.default.createElement(_commentItemCollapseWrapper.default, {
|
|
@@ -172,18 +173,18 @@ const GlobalComment = _ref => {
|
|
|
172
173
|
updateScrollPosition: updateScrollPosition,
|
|
173
174
|
isClickCommentPanelBody: isClickCommentPanelBody,
|
|
174
175
|
setCurrentCommentGroup: setCurrentCommentGroup
|
|
175
|
-
}))),
|
|
176
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
176
177
|
className: (0, _classnames.default)('global-comment-input-wrapper', {
|
|
177
178
|
'active': globalCommentContent === null || globalCommentContent === void 0 ? void 0 : globalCommentContent.trim()
|
|
178
179
|
})
|
|
179
|
-
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
180
|
+
}, !showEditor && /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
180
181
|
value: globalCommentContent !== null && globalCommentContent !== void 0 && globalCommentContent.trim() ? '.....' : '',
|
|
181
182
|
readOnly: true,
|
|
182
|
-
placeholder:
|
|
183
|
+
placeholder: commentEditorPlaceholder,
|
|
183
184
|
onFocus: () => {
|
|
184
185
|
setShowEditor(true);
|
|
185
186
|
}
|
|
186
|
-
})
|
|
187
|
+
}), showEditor && /*#__PURE__*/_react.default.createElement(_globalCommentEditor.default, {
|
|
187
188
|
globalCommentContent: globalCommentContent,
|
|
188
189
|
isScrollDisplayed: isScrollDisplayed,
|
|
189
190
|
hiddenCommentEditor: hiddenCommentEditor,
|
|
@@ -191,6 +192,6 @@ const GlobalComment = _ref => {
|
|
|
191
192
|
updateGlobalCommentContent: content => {
|
|
192
193
|
setGlobalCommentContent(content);
|
|
193
194
|
}
|
|
194
|
-
}))));
|
|
195
|
+
})))));
|
|
195
196
|
};
|
|
196
197
|
var _default = exports.default = (0, _reactI18next.withTranslation)('sdoc-editor')(GlobalComment);
|