@seafile/sdoc-editor 2.0.148 → 2.0.150
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.
|
@@ -95,7 +95,8 @@ var EditorComment = function EditorComment(_ref) {
|
|
|
95
95
|
(0, _react.useEffect)(function () {
|
|
96
96
|
var handleHoverContextComment = function handleHoverContextComment(event) {
|
|
97
97
|
var parentDom = event.target.parentElement;
|
|
98
|
-
var clazzNames =
|
|
98
|
+
var clazzNames = parentDom === null || parentDom === void 0 ? void 0 : parentDom.className;
|
|
99
|
+
if (typeof _classnames["default"] !== 'string') return;
|
|
99
100
|
if (clazzNames.includes('sdoc_comment_')) {
|
|
100
101
|
var isHover = event.type === 'mouseover';
|
|
101
102
|
var matchedAttributes = parentDom.className.split(' ').filter(function (cls) {
|
|
@@ -167,6 +168,7 @@ var EditorComment = function EditorComment(_ref) {
|
|
|
167
168
|
};
|
|
168
169
|
var handleClickCommentedText = function handleClickCommentedText(event) {
|
|
169
170
|
var parentDom = event.target.parentElement;
|
|
171
|
+
if (typeof parentDom.className !== 'string') return;
|
|
170
172
|
if (parentDom !== null && parentDom !== void 0 && parentDom.className.split(/\s+/).some(function (cls) {
|
|
171
173
|
return cls.startsWith('sdoc_comment');
|
|
172
174
|
})) {
|
|
@@ -174,10 +176,10 @@ var EditorComment = function EditorComment(_ref) {
|
|
|
174
176
|
var matchedAttributes = parentDom.className.split(' ').filter(function (cls) {
|
|
175
177
|
return cls.startsWith('sdoc_comment_');
|
|
176
178
|
});
|
|
177
|
-
var
|
|
179
|
+
var clickedCommentIdArray = matchedAttributes.map(function (item) {
|
|
178
180
|
return item.replace('sdoc_comment_', '');
|
|
179
181
|
});
|
|
180
|
-
onSelectElement(
|
|
182
|
+
onSelectElement(clickedCommentIdArray, true);
|
|
181
183
|
}
|
|
182
184
|
};
|
|
183
185
|
var eventBus = _eventBus["default"].getInstance();
|
|
@@ -26,6 +26,7 @@ var SocketClient = /*#__PURE__*/(0, _createClass2["default"])(function SocketCli
|
|
|
26
26
|
}, params);
|
|
27
27
|
});
|
|
28
28
|
(0, _defineProperty2["default"])(this, "onConnected", function () {
|
|
29
|
+
(0, _debug.clientDebug)('socket is connected: %s', _this.socket.connected);
|
|
29
30
|
// join room
|
|
30
31
|
_this.socket.emit('join-room', function (result) {
|
|
31
32
|
var socketManager = _socketManager["default"].getInstance();
|
|
@@ -72,7 +73,7 @@ var SocketClient = /*#__PURE__*/(0, _createClass2["default"])(function SocketCli
|
|
|
72
73
|
socketManager.dispatchConnectState('disconnect');
|
|
73
74
|
});
|
|
74
75
|
(0, _defineProperty2["default"])(this, "onConnectError", function (e) {
|
|
75
|
-
(0, _debug.clientDebug)('connect_error.');
|
|
76
|
+
(0, _debug.clientDebug)('connect_error. %o', e.message);
|
|
76
77
|
var socketManager = _socketManager["default"].getInstance();
|
|
77
78
|
socketManager.dispatchConnectState('connect_error');
|
|
78
79
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.150",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "0cd4d243db9e4125e1bf15ac8d83586ea016afaf"
|
|
75
75
|
}
|