@seafile/sdoc-editor 1.0.135 → 1.0.137-ljtest
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/global-comment/index.js +7 -0
- package/dist/basic-sdk/comment/reducer/notification-reducer.js +5 -0
- package/dist/basic-sdk/editor/wiki-editor.js +3 -1
- package/dist/basic-sdk/extension/constants/menus-config.js +0 -5
- package/dist/basic-sdk/extension/plugins/callout/plugin.js +15 -22
- package/package.json +1 -1
|
@@ -58,6 +58,13 @@ const GlobalComment = _ref => {
|
|
|
58
58
|
}, [contentRef]);
|
|
59
59
|
(0, _react.useEffect)(() => {
|
|
60
60
|
detectScroll();
|
|
61
|
+
// When a comment is updated, update the comment details page
|
|
62
|
+
if (activeCommentGroup) {
|
|
63
|
+
const newActiveCommentGroup = commentList.find(item => item.id === activeCommentGroup.id);
|
|
64
|
+
setActiveCommentGroup(newActiveCommentGroup);
|
|
65
|
+
deleteUnseenNotifications && deleteUnseenNotifications(newActiveCommentGroup);
|
|
66
|
+
}
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
68
|
}, [commentList, detectScroll]);
|
|
62
69
|
const updateScrollPosition = (0, _react.useCallback)(() => {
|
|
63
70
|
var _contentRef$current3;
|
|
@@ -8,6 +8,7 @@ var _constants = require("../constants");
|
|
|
8
8
|
var _model = require("../../../model");
|
|
9
9
|
var _ = require("../../");
|
|
10
10
|
var _constants2 = require("../../constants");
|
|
11
|
+
var _constants3 = require("../../../constants");
|
|
11
12
|
const initNotificationsInfo = exports.initNotificationsInfo = {
|
|
12
13
|
isFetching: true,
|
|
13
14
|
notifications_map: {},
|
|
@@ -70,6 +71,10 @@ const notificationReducer = (state, action) => {
|
|
|
70
71
|
}
|
|
71
72
|
const eventBus = _.EventBus.getInstance();
|
|
72
73
|
eventBus.dispatch(_constants2.INTERNAL_EVENT.UNSEEN_NOTIFICATIONS_COUNT, Object.keys(notifications_map).length);
|
|
74
|
+
// No unread messages, clearly marked
|
|
75
|
+
if (Object.keys(notifications_map).length === 0) {
|
|
76
|
+
eventBus.dispatch(_constants3.EXTERNAL_EVENT.CLEAR_NOTIFICATION);
|
|
77
|
+
}
|
|
73
78
|
return {
|
|
74
79
|
...state,
|
|
75
80
|
notifications_map
|
|
@@ -159,7 +159,9 @@ const WikiEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
159
159
|
editor: validEditor,
|
|
160
160
|
slateValue: slateValue,
|
|
161
161
|
showComment: false
|
|
162
|
-
}))
|
|
162
|
+
})), !_utils.isMobile && isWikiReadOnly && /*#__PURE__*/_react.default.createElement(_wikiOutline.default, {
|
|
163
|
+
doc: slateValue
|
|
164
|
+
})))));
|
|
163
165
|
}
|
|
164
166
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_layout.EditorContainer, {
|
|
165
167
|
editor: validEditor
|
|
@@ -391,11 +391,6 @@ const SIDE_INSERT_MENUS_CONFIG = exports.SIDE_INSERT_MENUS_CONFIG = {
|
|
|
391
391
|
iconClass: 'sdocfont sdoc-multi-column',
|
|
392
392
|
type: _elementType.FOUR_COLUMN,
|
|
393
393
|
text: 'Four_column'
|
|
394
|
-
}, {
|
|
395
|
-
id: _elementType.FIVE_COLUMN,
|
|
396
|
-
iconClass: 'sdocfont sdoc-multi-column',
|
|
397
|
-
type: _elementType.FIVE_COLUMN,
|
|
398
|
-
text: 'Five_column'
|
|
399
394
|
}],
|
|
400
395
|
[_elementType.BLOCKQUOTE]: {
|
|
401
396
|
id: _elementType.BLOCKQUOTE,
|
|
@@ -54,30 +54,23 @@ const withCallout = editor => {
|
|
|
54
54
|
newEditor.insertFragment = data => {
|
|
55
55
|
if ((0, _helper.getCalloutEntry)(editor)) {
|
|
56
56
|
var _data$find;
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (parentNodeEntry && parentNodeEntry[0].type === _constants.CALL_OUT) {
|
|
63
|
-
if (!_slate.Node.string(paragraphEntry[0]).length) {
|
|
64
|
-
insertFragment(data);
|
|
65
|
-
if ([_constants.ORDERED_LIST, _constants.UNORDERED_LIST].includes(data[0].type)) {
|
|
66
|
-
_slate.Transforms.removeNodes(newEditor, {
|
|
67
|
-
at: paragraphEntry[1]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const eventBus = _eventBus.default.getInstance();
|
|
76
|
-
const unsupportType = (_data$find = data.find(node => !_constant.CALLOUT_ALLOWED_INSIDE_TYPES.includes(node.type))) === null || _data$find === void 0 ? void 0 : _data$find.type;
|
|
77
|
-
if (unsupportType) {
|
|
78
|
-
eventBus.dispatch(_constants2.INTERNAL_EVENT.DISPLAY_CALLOUT_UNSUPPORT_ALERT, unsupportType);
|
|
57
|
+
// No paste any unsupportedType content into callout
|
|
58
|
+
const unsupportedType = (_data$find = data.find(node => !_constant.CALLOUT_ALLOWED_INSIDE_TYPES.includes(node.type))) === null || _data$find === void 0 ? void 0 : _data$find.type;
|
|
59
|
+
if (unsupportedType) {
|
|
60
|
+
const eventBus = _eventBus.default.getInstance();
|
|
61
|
+
eventBus.dispatch(_constants2.INTERNAL_EVENT.DISPLAY_CALLOUT_UNSUPPORT_ALERT, unsupportedType);
|
|
79
62
|
return;
|
|
80
63
|
}
|
|
64
|
+
|
|
65
|
+
// Unwrap the callout nodes if nested within another callout
|
|
66
|
+
const hasCalloutNode = data.some(node => node.type === _constants.CALL_OUT);
|
|
67
|
+
if (hasCalloutNode) {
|
|
68
|
+
const newData = data.flatMap(node => node.type === _constants.CALL_OUT ? node.children : [node]);
|
|
69
|
+
insertFragment(newData);
|
|
70
|
+
} else {
|
|
71
|
+
insertFragment(data);
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
81
74
|
}
|
|
82
75
|
return insertFragment(data);
|
|
83
76
|
};
|