@seafile/sdoc-editor 2.0.122-test-0.0.1 → 2.0.122-test-0.0.2
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.
|
@@ -65,9 +65,12 @@ var SdocCommentEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
65
65
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
66
|
}, []);
|
|
67
67
|
(0, _react.useEffect)(function () {
|
|
68
|
+
console.log(1111, commentEditorContainerRef === null || commentEditorContainerRef === void 0 ? void 0 : commentEditorContainerRef.current, notificationsInfo);
|
|
69
|
+
console.log(22, commentEditorContainerRef.current.closest('.global-comment-input-wrapper'));
|
|
68
70
|
if (!(commentEditorContainerRef !== null && commentEditorContainerRef !== void 0 && commentEditorContainerRef.current)) return;
|
|
69
|
-
if (notificationsInfo.notifications_map.length === 0) return;
|
|
71
|
+
if (Object.keys(notificationsInfo.notifications_map || {}).length === 0) return;
|
|
70
72
|
if (!commentEditorContainerRef.current.closest('.global-comment-input-wrapper')) return;
|
|
73
|
+
console.log(333);
|
|
71
74
|
var clearAllNotification = /*#__PURE__*/function () {
|
|
72
75
|
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
73
76
|
var res, notifications, eventBus, errorMessage;
|
|
@@ -107,22 +110,23 @@ var SdocCommentEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
107
110
|
var el = commentEditorContainerRef && commentEditorContainerRef.current;
|
|
108
111
|
|
|
109
112
|
// Mark comment read if focusing commentEditorContainerRef over 3s
|
|
110
|
-
var
|
|
113
|
+
var handleFocusIn = function handleFocusIn() {
|
|
111
114
|
timeoutRef.current = setTimeout(function () {
|
|
115
|
+
console.log(1, 'clear');
|
|
112
116
|
clearAllNotification();
|
|
113
117
|
}, 3000);
|
|
114
118
|
};
|
|
115
119
|
var handleBlur = function handleBlur() {
|
|
116
120
|
clearTimeout(timeoutRef.current);
|
|
117
121
|
};
|
|
118
|
-
el.addEventListener('
|
|
119
|
-
el.addEventListener('
|
|
122
|
+
el.addEventListener('focusin', handleFocusIn);
|
|
123
|
+
el.addEventListener('focusout', handleBlur);
|
|
120
124
|
return function () {
|
|
121
|
-
el.removeEventListener('
|
|
122
|
-
el.removeEventListener('
|
|
125
|
+
el.removeEventListener('focusin', handleFocusIn);
|
|
126
|
+
el.removeEventListener('focusout', handleBlur);
|
|
123
127
|
clearTimeout(timeoutRef.current);
|
|
124
128
|
};
|
|
125
|
-
}, [notificationsInfo
|
|
129
|
+
}, [notificationsInfo, t]);
|
|
126
130
|
|
|
127
131
|
// useMount: focus editor
|
|
128
132
|
(0, _react.useEffect)(function () {
|
|
@@ -16,6 +16,7 @@ var RenderCommentEditorCustomRenderElement = function RenderCommentEditorCustomR
|
|
|
16
16
|
var readonly = (0, _slateReact.useReadOnly)();
|
|
17
17
|
var element = props.element,
|
|
18
18
|
commentType = props.commentType;
|
|
19
|
+
console.log(1, element);
|
|
19
20
|
switch (element.type) {
|
|
20
21
|
case _constants.PARAGRAPH:
|
|
21
22
|
{
|