@seafile/sdoc-editor 2.0.147 → 2.0.149

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.
@@ -94,9 +94,10 @@ var EditorComment = function EditorComment(_ref) {
94
94
  }, [editor, element_comments_map, hiddenComment]);
95
95
  (0, _react.useEffect)(function () {
96
96
  var handleHoverContextComment = function handleHoverContextComment(event) {
97
- var _parentDom$className;
98
97
  var parentDom = event.target.parentElement;
99
- if (parentDom !== null && parentDom !== void 0 && (_parentDom$className = parentDom.className) !== null && _parentDom$className !== void 0 && _parentDom$className.includes('sdoc_comment_')) {
98
+ var clazzNames = parentDom === null || parentDom === void 0 ? void 0 : parentDom.className;
99
+ if (typeof _classnames["default"] !== 'string') return;
100
+ if (clazzNames.includes('sdoc_comment_')) {
100
101
  var isHover = event.type === 'mouseover';
101
102
  var matchedAttributes = parentDom.className.split(' ').filter(function (cls) {
102
103
  return cls.startsWith('sdoc_comment_');
@@ -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 clickedCommmentIdArray = matchedAttributes.map(function (item) {
179
+ var clickedCommentIdArray = matchedAttributes.map(function (item) {
178
180
  return item.replace('sdoc_comment_', '');
179
181
  });
180
- onSelectElement(clickedCommmentIdArray, true);
182
+ onSelectElement(clickedCommentIdArray, true);
181
183
  }
182
184
  };
183
185
  var eventBus = _eventBus["default"].getInstance();
@@ -16,8 +16,7 @@ var notify = function notify($title, $options) {
16
16
  // auto clear notifications
17
17
  var timer = setTimeout(notification.close.bind(notification), 5000);
18
18
  notification.onshow = function (event) {
19
- var _context$getSetting = _context["default"].getSetting('mediaUrl'),
20
- mediaUrl = _context$getSetting.mediaUrl;
19
+ var mediaUrl = _context["default"].getSetting('mediaUrl');
21
20
  var newAudioElement = document.createElement('audio');
22
21
  newAudioElement.setAttribute('src', "".concat(mediaUrl, "audio/classic.mp3"));
23
22
  newAudioElement.setAttribute('autoplay', 'autoplay');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.147",
3
+ "version": "2.0.149",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -17,7 +17,7 @@
17
17
  "license": "ISC",
18
18
  "description": "",
19
19
  "dependencies": {
20
- "@seafile/comment-editor": "^0.0.12",
20
+ "@seafile/comment-editor": "0.0.13",
21
21
  "@seafile/print-js": "1.6.6",
22
22
  "@seafile/react-image-lightbox": "4.0.2",
23
23
  "@seafile/slate": "0.91.8",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "c3c26480c7f0959a1425e0f6f7048154f5aa87f4"
74
+ "gitHead": "7953cc897a50d55212b2d48715c0feba82963c1a"
75
75
  }