@seafile/sdoc-editor 0.2.15 → 0.2.17

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.
@@ -29,6 +29,7 @@
29
29
  padding: 0 5px;
30
30
  border-radius: 2px;
31
31
  line-height: 20px;
32
+ cursor: pointer;
32
33
  }
33
34
 
34
35
  .link-op-menu-link:hover {
@@ -42,7 +42,8 @@ var GlobalComment = function GlobalComment(_ref) {
42
42
  useEffect(function () {
43
43
  var eventBus = EventBus.getInstance();
44
44
  var unsubscribe = eventBus.subscribe('COMMENT_LIST_CLICK', function () {
45
- return setShowCommentList(!isShowCommentList);
45
+ setActiveComment(null);
46
+ setShowCommentList(!isShowCommentList);
46
47
  });
47
48
  return function () {
48
49
  unsubscribe();
@@ -61,7 +62,7 @@ var GlobalComment = function GlobalComment(_ref) {
61
62
  }, []);
62
63
  if (!isShowCommentList) return null;
63
64
  return /*#__PURE__*/React.createElement(ElementPopover, {
64
- className: 'global-comments-popover'
65
+ className: "global-comments-popover"
65
66
  }, /*#__PURE__*/React.createElement("div", {
66
67
  ref: commentRef,
67
68
  className: "comments-panel-wrapper"
@@ -25,6 +25,8 @@ var ImageHoverMenu = function ImageHoverMenu(_ref) {
25
25
  align = element.align,
26
26
  _element$border_type = element.border_type,
27
27
  border_type = _element$border_type === void 0 ? IMAGE_BORDER_TYPE[0].type : _element$border_type;
28
+ var _data$caption = data.caption,
29
+ caption = _data$caption === void 0 ? '' : _data$caption;
28
30
  var _useState = useState({
29
31
  displayPopover: false,
30
32
  alignPopover: false,
@@ -121,7 +123,7 @@ var ImageHoverMenu = function ImageHoverMenu(_ref) {
121
123
  id: "sdoc_image_caption",
122
124
  role: "button",
123
125
  className: classnames('op-item', 'ml-1', {
124
- 'active': (data === null || data === void 0 ? void 0 : data.caption.length) !== 0
126
+ 'active': (caption === null || caption === void 0 ? void 0 : caption.length) !== 0
125
127
  }),
126
128
  onClick: function onClick() {
127
129
  onShowCaption();
@@ -23,12 +23,12 @@ var LinkHover = function LinkHover(_ref) {
23
23
  return /*#__PURE__*/React.createElement(React.Fragment, null, createPortal( /*#__PURE__*/React.createElement("div", {
24
24
  id: "link-op-menu",
25
25
  className: "link-op-menu",
26
- style: menuPosition,
27
- onMouseDown: onMouseDown
26
+ style: menuPosition
28
27
  }, /*#__PURE__*/React.createElement("span", {
29
28
  target: "_blank",
30
29
  rel: "noopener noreferrer",
31
- className: "link-op-menu-link"
30
+ className: "link-op-menu-link",
31
+ onMouseDown: onMouseDown
32
32
  }, t('Open_link')), /*#__PURE__*/React.createElement("div", {
33
33
  className: "link-op-icons d-flex"
34
34
  }, /*#__PURE__*/React.createElement("span", {
@@ -19,7 +19,8 @@ var MoreRevisionOperations = function MoreRevisionOperations(_ref) {
19
19
  context.startRevise().then(function (res) {
20
20
  var repoID = context.getSetting('repoID');
21
21
  var siteRoot = context.getSetting('siteRoot');
22
- window.location.href = "".concat(siteRoot, "lib/").concat(repoID, "/revisions/").concat(res.data.revision_id, "/?").concat(REVISION_FIRST_LOAD_KEY, "=").concat(REVISION_FIRST_LOAD_VALUE);
22
+ var revisionURL = "".concat(siteRoot, "lib/").concat(repoID, "/revisions/").concat(res.data.revision_id, "/?").concat(REVISION_FIRST_LOAD_KEY, "=").concat(REVISION_FIRST_LOAD_VALUE);
23
+ window.open(revisionURL, '_blank');
23
24
  }).catch(function (error) {
24
25
  toaster.danger(t('Error'));
25
26
  });
@@ -8,6 +8,10 @@
8
8
  border-bottom-color: #303133;
9
9
  }
10
10
 
11
+ .sdoc-tooltip.bs-tooltip-auto[x-placement^="top"] {
12
+ margin-bottom: -2px;
13
+ }
14
+
11
15
  .sdoc-tooltip.bs-tooltip-auto[x-placement^="top"] .arrow::before {
12
16
  border-top-color: #303133;
13
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",