@seafile/sdoc-editor 2.0.190 → 2.0.191

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.
@@ -221,6 +221,7 @@
221
221
  background-color: rgb(153 153 153 / 15%);
222
222
  padding: 3px 0;
223
223
  border-radius: 3px;
224
+ cursor: pointer;
224
225
  }
225
226
 
226
227
  /* code_block */
@@ -13,7 +13,7 @@
13
13
 
14
14
  .sdoc-file-preview-drawer .file-preview-panel-header {
15
15
  padding: 0 16px;
16
- height: 46px;
16
+ height: 44px;
17
17
  display: flex;
18
18
  align-items: center;
19
19
  justify-content: space-between;
@@ -47,7 +47,7 @@ var ListView = function ListView(_ref) {
47
47
  (0, _react.useEffect)(function () {
48
48
  var getFileMetadata = /*#__PURE__*/function () {
49
49
  var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee() {
50
- var res, sortedRecords, firstFile, filePath;
50
+ var res, sortedRecords;
51
51
  return (0, _regenerator2["default"])().w(function (_context) {
52
52
  while (1) switch (_context.n) {
53
53
  case 0:
@@ -61,15 +61,6 @@ var ListView = function ListView(_ref) {
61
61
  });
62
62
  setAllFileList(sortedRecords);
63
63
  setFileList(sortedRecords);
64
- firstFile = sortedRecords[0];
65
- if (firstFile) {
66
- filePath = (firstFile._parent_dir === '/' ? '' : firstFile._parent_dir) + '/' + firstFile._name;
67
- onSelectFile(null, {
68
- id: firstFile._id,
69
- name: firstFile._name,
70
- path: filePath
71
- });
72
- }
73
64
  case 2:
74
65
  return _context.a(2);
75
66
  }
@@ -5,6 +5,10 @@
5
5
  border-radius: 3px;
6
6
  }
7
7
 
8
+ .sdoc-file-link-render:hover {
9
+ cursor: pointer;
10
+ }
11
+
8
12
  .sdoc-file-link-render:hover .sdoc-file-text-link a {
9
13
  text-decoration: underline;
10
14
  text-underline-position: under;
@@ -44,7 +48,7 @@
44
48
 
45
49
  .sdoc-file-link-render .sdoc-file-link-icon {
46
50
  padding-right: 5px;
47
- color: #ff9800;
51
+ color: #9aa0ac;
48
52
  }
49
53
 
50
54
  .sdoc-file-card-link .sdoc-file-link-icon :first-child {
@@ -75,18 +75,22 @@ var SdocLinkHoverMenu = function SdocLinkHoverMenu(_ref) {
75
75
  var doc_uuid = element.doc_uuid,
76
76
  title = element.title,
77
77
  type = element.type;
78
- var eventBus = _eventBus["default"].getInstance();
79
- eventBus.dispatch(_constants.INTERNAL_EVENT.TRANSFER_PREVIEW_FILE_ID, {
78
+ var data = {
80
79
  doc_uuid: doc_uuid,
81
80
  title: title,
82
81
  type: type
83
- });
82
+ };
83
+ if (editor.editorType === _constants.WIKI_EDITOR) {
84
+ data = element;
85
+ }
86
+ var eventBus = _eventBus["default"].getInstance();
87
+ eventBus.dispatch(_constants.INTERNAL_EVENT.TRANSFER_PREVIEW_FILE_ID, data);
84
88
  setTimeout(function () {
85
89
  onHideInsertHoverMenu();
86
90
  }, 0);
91
+ // eslint-disable-next-line react-hooks/exhaustive-deps
87
92
  }, [updateDisplayPlugin]);
88
93
  var selectedType = element.display_type || _constants2.SDOC_LINK_TYPE.TEXT_LINK;
89
- var id = "sdoc-link-display-type-".concat(element.id);
90
94
  var newSdocFileTypes = _constants2.SDOC_LINK_TYPES.filter(function (sdocLinkType) {
91
95
  return (0, _helpers.isInTable)(editor, element) ? sdocLinkType !== _constants2.SDOC_LINK_TYPE.CARD_LINK : true;
92
96
  });
@@ -154,7 +158,7 @@ var SdocLinkHoverMenu = function SdocLinkHoverMenu(_ref) {
154
158
  return handleOpenLinkPreview('sdoc-file-preview');
155
159
  }
156
160
  }, /*#__PURE__*/_react["default"].createElement("i", {
157
- className: "sdocfont sodc-eye icon-font"
161
+ className: "sdocfont sdoc-eye icon-font"
158
162
  })), isShowTooltip && /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
159
163
  target: "sdoc_link_preview",
160
164
  placement: "top",
@@ -5,6 +5,10 @@
5
5
  border-radius: 3px;
6
6
  }
7
7
 
8
+ .sdoc-file-render:hover {
9
+ cursor: pointer;
10
+ }
11
+
8
12
  .sdoc-file-render:hover .sdoc-file-text-link a {
9
13
  text-decoration: underline;
10
14
  text-underline-position: under;
@@ -27,7 +31,7 @@
27
31
 
28
32
  .sdoc-file-render .sdoc-file-link-icon {
29
33
  padding-right: 5px;
30
- color: #ff9800;
34
+ color: #666;
31
35
  }
32
36
 
33
37
  .sdoc-file-card-link .sdoc-file-link-icon :first-child {
@@ -125,18 +125,22 @@ var SdocFileLink = function SdocFileLink(_ref) {
125
125
  return;
126
126
  }
127
127
  }
128
- if (isShowInsertHoverMenu && element.type === _elementType.SDOC_LINK) {
128
+ if (isShowInsertHoverMenu && [_elementType.SDOC_LINK, _elementType.WIKI_LINK].includes(element.type)) {
129
129
  e.stopPropagation();
130
- updateDisplayPlugin('sdoc-file-preview', true);
130
+ element.type === _elementType.SDOC_LINK && updateDisplayPlugin('sdoc-file-preview', true);
131
131
  var doc_uuid = element.doc_uuid,
132
132
  title = element.title,
133
133
  type = element.type;
134
- var eventBus = _eventBus["default"].getInstance();
135
- eventBus.dispatch(_constants.INTERNAL_EVENT.TRANSFER_PREVIEW_FILE_ID, {
134
+ var data = {
136
135
  doc_uuid: doc_uuid,
137
136
  title: title,
138
137
  type: type
139
- });
138
+ };
139
+ if (element.type === _elementType.WIKI_LINK) {
140
+ data = element;
141
+ }
142
+ var eventBus = _eventBus["default"].getInstance();
143
+ eventBus.dispatch(_constants.INTERNAL_EVENT.TRANSFER_PREVIEW_FILE_ID, data);
140
144
  setTimeout(function () {
141
145
  onHideInsertHoverMenu();
142
146
  }, 0);
@@ -17,8 +17,7 @@ var _fullWidthMode = require("../utils/full-width-mode");
17
17
  var _localStorageUtils = _interopRequireDefault(require("../utils/local-storage-utils"));
18
18
  function ArticleContainer(_ref) {
19
19
  var editor = _ref.editor,
20
- children = _ref.children,
21
- isShowCommentPanelInWiki = _ref.isShowCommentPanelInWiki;
20
+ children = _ref.children;
22
21
  var scrollRef = (0, _useScrollContext.useScrollContext)();
23
22
  var articleRef = (0, _react.useRef)(null);
24
23
  var _useState = (0, _react.useState)({}),
@@ -111,6 +111,7 @@ var RightPanel = function RightPanel(_ref) {
111
111
  return function () {
112
112
  unsubscribeTransferFileId();
113
113
  };
114
+ // eslint-disable-next-line react-hooks/exhaustive-deps
114
115
  }, []);
115
116
  if (!displayPluginName) return null;
116
117
  var plugin = plugins.find(function (p) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.190",
3
+ "version": "2.0.191",
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": "759cb457e2ad7e89ef7c4bcb94a539b7fc387136"
74
+ "gitHead": "c558ebae65cc4325ebc6ad0d4989ae889d4f420d"
75
75
  }