@seafile/sdoc-editor 0.3.2 → 0.3.3

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.
@@ -72,5 +72,3 @@
72
72
  text-overflow: ellipsis;
73
73
  color: #212529;
74
74
  }
75
-
76
-
@@ -22,6 +22,7 @@ export var commentDecorate = function commentDecorate(editor) {
22
22
  offset: Node.string(node).length
23
23
  }
24
24
  };
25
+
25
26
  // rgba prevents occlusion of the cursor
26
27
  decoration['computed_background_color'] = 'rgba(129, 237, 247, 0.5)';
27
28
  decoration['comment_count'] = unresolvedComments === null || unresolvedComments === void 0 ? void 0 : unresolvedComments.length;
@@ -219,6 +219,7 @@ export default function CommentItemWrapper(_ref) {
219
219
  var insertContent = useCallback(function (content) {
220
220
  var user = context.getUserInfo();
221
221
  var replies = [];
222
+
222
223
  // The comment has already been resolved, when adding a new reply, resubmit the comment
223
224
  if (comment.resolved) {
224
225
  var _time = dayjs().format('YYYY-MM-DD HH:mm:ss');
@@ -343,6 +344,7 @@ export default function CommentItemWrapper(_ref) {
343
344
  onDeleteComment: onDeleteComment
344
345
  }), comment.replies && comment.replies.length > 0 && comment.replies.map(function (reply) {
345
346
  var type = reply.type;
347
+
346
348
  // type is reply | comment
347
349
  if (type === 'reply') {
348
350
  var props = {
@@ -6,7 +6,7 @@ var PERMISSION_GRANTED = 'granted';
6
6
  var notify = function notify($title, $options) {
7
7
  var notification = new Notification($title, $options);
8
8
 
9
- //auto clear notifications
9
+ // auto clear notifications
10
10
  var timer = setTimeout(notification.close.bind(notification), 5000);
11
11
  notification.onshow = function (event) {
12
12
  var _context$getSetting = context.getSetting('mediaUrl'),
@@ -83,7 +83,7 @@ var HeaderMenu = /*#__PURE__*/function (_React$Component) {
83
83
  _this.menu = ref;
84
84
  };
85
85
  _this.getToolTip = function (type) {
86
- //chrome in Mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
86
+ // chrome in Mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
87
87
  var isMac = window.navigator.userAgent.indexOf('Macintosh') !== -1;
88
88
  return isMac ? MAC_HOTKEYS[type] : WIN_HOTKEYS[type];
89
89
  };
@@ -51,3 +51,48 @@
51
51
  display: flex;
52
52
  flex-direction: column;
53
53
  }
54
+
55
+ .sdoc-editor-page-header .sdoc-revision-info .sdoc-revision-order {
56
+ display: inline-block;
57
+ font-size: 14px;
58
+ color: #888;
59
+ background: #eee;
60
+ padding: 0 8px;
61
+ height: 20px;
62
+ line-height: 20px;
63
+ border-radius: 10px;
64
+ margin-left: 0.5rem;
65
+ cursor: default;
66
+ }
67
+
68
+ .sdoc-editor-page-header .sdoc-revision-info .sdoc-revision-published-tip {
69
+ display: inline-block;
70
+ font-size: 14px;
71
+ color: #fff;
72
+ background: #5EBA00;
73
+ padding: 0 8px;
74
+ height: 20px;
75
+ line-height: 20px;
76
+ border-radius: 10px;
77
+ margin-left: 0.5rem;
78
+ cursor: default;
79
+ }
80
+
81
+ .sdoc-editor-page-header .sdoc-revision-info .sdoc-revision-source-doc {
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ height: 20px;
86
+ width: 20px;
87
+ margin-left: 0.5rem;
88
+ cursor: pointer;
89
+ }
90
+
91
+ .sdoc-editor-page-header .sdoc-revision-info .sdoc-revision-source-doc .sdoc-jump-to {
92
+ font-size: 14px;
93
+ color: #999;
94
+ }
95
+
96
+ .sdoc-editor-page-header .sdoc-revision-info .sdoc-revision-source-doc:hover .sdoc-jump-to {
97
+ color: #333;
98
+ }
@@ -24,6 +24,10 @@ var DocInfo = function DocInfo(_ref) {
24
24
  var eventBus = EventBus.getInstance();
25
25
  eventBus.dispatch(EXTERNAL_EVENT.TOGGLE_STAR);
26
26
  }, []);
27
+ var jumpToSourceDoc = useCallback(function () {
28
+ var originFileURL = context.getSetting('originFileURL');
29
+ window.open(originFileURL, '_blank');
30
+ }, []);
27
31
  var isSdocRevision = context.getSetting('isSdocRevision');
28
32
  var docName = context.getSetting('docName');
29
33
  var _context$getSettings = context.getSettings(),
@@ -68,9 +72,15 @@ var DocInfo = function DocInfo(_ref) {
68
72
  className: "doc-name"
69
73
  }, oldDocName), /*#__PURE__*/React.createElement("div", {
70
74
  className: "sdoc-revision-order"
71
- }, t('Revision') + ' ' + revisionId), isPublished && /*#__PURE__*/React.createElement("div", {
75
+ }, t('Revision') + ' ' + revisionId), isPublished && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
72
76
  className: "sdoc-revision-published-tip"
73
- }, t('Published')), !isPublished && /*#__PURE__*/React.createElement(TipMessage, {
77
+ }, t('Published')), /*#__PURE__*/React.createElement("div", {
78
+ className: "sdoc-revision-source-doc",
79
+ title: t('Jump_to_original_doc'),
80
+ onClick: jumpToSourceDoc
81
+ }, /*#__PURE__*/React.createElement("i", {
82
+ className: "sdocfont sdoc-jump-to"
83
+ }))), !isPublished && /*#__PURE__*/React.createElement(TipMessage, {
74
84
  isEditMode: isEditMode
75
85
  })), /*#__PURE__*/React.createElement("div", {
76
86
  className: "doc-state"
@@ -25,29 +25,3 @@
25
25
  .doc-ops .popover-wrapper {
26
26
  width: 300px;
27
27
  }
28
-
29
- .doc-info .sdoc-revision-order {
30
- display: inline-block;
31
- font-size: 14px;
32
- color: #888;
33
- background: #eee;
34
- padding: 0 8px;
35
- height: 20px;
36
- line-height: 20px;
37
- border-radius: 10px;
38
- margin-left: 0.5rem;
39
- cursor: default;
40
- }
41
-
42
- .doc-info .sdoc-revision-published-tip {
43
- display: inline-block;
44
- font-size: 14px;
45
- color: #55A900;
46
- background: #E6F4D6;
47
- padding: 0 8px;
48
- height: 20px;
49
- line-height: 20px;
50
- border-radius: 3px;
51
- margin-left: 0.5rem;
52
- cursor: default;
53
- }
@@ -103,6 +103,14 @@ var Alert = /*#__PURE__*/function (_React$PureComponent) {
103
103
  }),
104
104
  iconClass: 'sdocfont sdoc-exclamation-circle'
105
105
  };
106
+ default:
107
+ return {
108
+ borderStyle: this.containerBorderSuccess,
109
+ iconColor: css({
110
+ color: 'rgb(71, 184, 129)'
111
+ }),
112
+ iconClass: 'sdocfont sdoc-check-circle'
113
+ };
106
114
  }
107
115
  }
108
116
  }, {
@@ -75,7 +75,7 @@ var DateUtils = /*#__PURE__*/function () {
75
75
  if (this.isValidDateObject(dateObject)) return dateObject;
76
76
  if (!isDateTypeString) return null;
77
77
 
78
- //ios phone and safari browser not support use '2021-09-10 12:30', support '2021/09/10 12:30'
78
+ // ios phone and safari browser not support use '2021-09-10 12:30', support '2021/09/10 12:30'
79
79
  dateObject = new Date(dateString.replace(/-/g, '/'));
80
80
  if (this.isValidDateObject(dateObject)) return dateObject;
81
81
  return null;
@@ -34,7 +34,7 @@ var LocalStorage = /*#__PURE__*/function () {
34
34
  return window.localStorage.removeItem(key);
35
35
  }
36
36
 
37
- //The setExpire and getExpire methods used to satisfy some cases that need to be updated regularly
37
+ // The setExpire and getExpire methods used to satisfy some cases that need to be updated regularly
38
38
  }, {
39
39
  key: "setExpire",
40
40
  value: function setExpire(key, value, expire) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -410,5 +410,7 @@
410
410
  "revision": "revision",
411
411
  "xxx_added_a_new_comment": "{{author}} added a new comment",
412
412
  "xxx_added_a_reply": "{{author}} added a reply",
413
- "New": "Nový"
413
+ "New": "Nový",
414
+ "Table_template": "Table template",
415
+ "Jump_to_original_doc": "Jump to the original document"
414
416
  }
@@ -410,5 +410,7 @@
410
410
  "revision": "revision",
411
411
  "xxx_added_a_new_comment": "{{author}} added a new comment",
412
412
  "xxx_added_a_reply": "{{author}} added a reply",
413
- "New": "Erstellen"
413
+ "New": "Erstellen",
414
+ "Table_template": "Table template",
415
+ "Jump_to_original_doc": "Jump to the original document"
414
416
  }
@@ -411,5 +411,6 @@
411
411
  "xxx_added_a_new_comment": "{{author}} added a new comment",
412
412
  "xxx_added_a_reply": "{{author}} added a reply",
413
413
  "New": "New",
414
- "Table_template": "Table template"
414
+ "Table_template": "Table template",
415
+ "Jump_to_original_doc": "Jump to the original document"
415
416
  }
@@ -410,5 +410,7 @@
410
410
  "revision": "revision",
411
411
  "xxx_added_a_new_comment": "{{author}} added a new comment",
412
412
  "xxx_added_a_reply": "{{author}} added a reply",
413
- "New": "Nuevo"
413
+ "New": "Nuevo",
414
+ "Table_template": "Table template",
415
+ "Jump_to_original_doc": "Jump to the original document"
414
416
  }
@@ -410,5 +410,7 @@
410
410
  "revision": "revision",
411
411
  "xxx_added_a_new_comment": "{{author}} added a new comment",
412
412
  "xxx_added_a_reply": "{{author}} added a reply",
413
- "New": "Créer"
413
+ "New": "Créer",
414
+ "Table_template": "Table template",
415
+ "Jump_to_original_doc": "Jump to the original document"
414
416
  }
@@ -410,5 +410,7 @@
410
410
  "revision": "revision",
411
411
  "xxx_added_a_new_comment": "{{author}} added a new comment",
412
412
  "xxx_added_a_reply": "{{author}} added a reply",
413
- "New": "Nuovo"
413
+ "New": "Nuovo",
414
+ "Table_template": "Table template",
415
+ "Jump_to_original_doc": "Jump to the original document"
414
416
  }
@@ -410,5 +410,7 @@
410
410
  "revision": "версия",
411
411
  "xxx_added_a_new_comment": "{{author}} добавил новый комментарий",
412
412
  "xxx_added_a_reply": "{{author}} добавил ответ",
413
- "New": "Новый"
413
+ "New": "Новый",
414
+ "Table_template": "Шаблон таблицы",
415
+ "Jump_to_original_doc": "Jump to the original document"
414
416
  }
@@ -411,5 +411,6 @@
411
411
  "xxx_added_a_new_comment": "{{author}} 添加了一条新评论",
412
412
  "xxx_added_a_reply": "{{author}} 添加了一条回复",
413
413
  "New": "新",
414
- "Table_template": "表格模板"
414
+ "Table_template": "表格模版",
415
+ "Jump_to_original_doc": "跳转到源文档"
415
416
  }
@@ -14,6 +14,12 @@
14
14
  />
15
15
  <missing-glyph />
16
16
 
17
+ <glyph glyph-name="sdoc-jump-to" unicode="&#58970;" d="M361.6 896c32 0 54.4-16 54.4-48S393.6 800 361.6 800H96v-832h832v262.4c0 32 16 57.6 48 57.6s48-25.6 48-57.6v-300.8c0-32-28.8-57.6-60.8-57.6H60.8c-32 0-60.8 25.6-60.8 57.6V835.2C0 870.4 25.6 896 60.8 896h300.8zM992 896c19.2 0 32-12.8 32-32v-332.8c0-28.8-19.2-51.2-48-51.2s-48 22.4-48 51.2V729.6L531.2 336c-6.4-9.6-19.2-16-35.2-16-12.8 0-25.6 6.4-35.2 16-19.2 19.2-19.2 51.2 0 70.4L857.6 800h-198.4c-28.8 0-51.2 19.2-51.2 48S630.4 896 656 896H992z" horiz-adv-x="1024" />
18
+
19
+ <glyph glyph-name="sdoc-callout" unicode="&#58972;" d="M992 352H32c-19.2 0-32 12.8-32 32V832c0 19.2 12.8 32 32 32h960c19.2 0 32-12.8 32-32v-448c0-19.2-12.8-32-32-32zM96 448h832V768H96v-320z m-96-224v-96h1024v96H0z m0-224v-96h576v96H0z" horiz-adv-x="1024" />
20
+
21
+ <glyph glyph-name="sdoc-chart" unicode="&#58971;" d="M992-128H32c-19.2 0-32 12.8-32 32V864c0 19.2 12.8 32 32 32h960c19.2 0 32-12.8 32-32v-960c0-19.2-12.8-32-32-32zM96-32h832V800H96v-832z m0 464v-96h832v96H96zM560 800h-96v-832h96V800z" horiz-adv-x="1024" />
22
+
17
23
  <glyph glyph-name="sdoc-add" unicode="&#58968;" d="M512-128C227.2-128 0 99.2 0 384S227.2 896 512 896s512-227.2 512-512-227.2-512-512-512z m-51.2 563.2H291.2c-19.2 0-35.2-12.8-35.2-35.2v-35.2c0-19.2 12.8-35.2 35.2-35.2h169.6V160c0-19.2 12.8-35.2 35.2-35.2h35.2c19.2 0 35.2 12.8 35.2 35.2v169.6H736c19.2 0 35.2 12.8 35.2 35.2v35.2c0 19.2-12.8 35.2-35.2 35.2h-169.6V604.8c0 19.2-12.8 35.2-35.2 35.2h-35.2c-19.2 0-35.2-12.8-35.2-35.2v-169.6z" horiz-adv-x="1024" />
18
24
 
19
25
  <glyph glyph-name="sdoc-tag" unicode="&#58969;" d="M521.353986 860.33363l466.979644-466.979644c22.389435-22.389435 35.183398-51.175851 35.183398-83.160758s-12.793963-60.771324-35.183398-83.160759l-323.047562-319.849071c-22.389435-22.389435-51.175851-35.183398-79.962268-35.183398-31.984907 0-60.771324 12.793963-83.160758 35.183398L35.183398 374.163042c-25.587926 25.587926-38.381889 60.771324-31.984907 95.954721l31.984907 291.062655c6.396981 54.374342 47.977361 95.954721 102.351703 102.351703l291.062654 31.984907c31.984907 3.198491 67.168305-9.595472 92.756231-35.183398zM444.590209 767.577399L159.924536 735.592492l-31.984908-281.467182L578.926819-0.060372l316.65058 313.45209L444.590209 767.577399z m12.793963-127.939628c57.572833-57.572833 57.572833-147.130573 0-204.703406-25.587926-25.587926-63.969814-41.580379-102.351703-41.580379-38.381889 0-73.565286 12.793963-102.351703 41.580379-57.572833 57.572833-57.572833 147.130573 0 204.703406 57.572833 57.572833 150.329063 57.572833 204.703406 0z m-102.351703-70.366796c-6.396981 0-15.992454-3.198491-22.389435-9.595472-12.793963-12.793963-12.793963-31.984907 0-44.77887 12.793963-12.793963 31.984907-12.793963 44.77887 0 12.793963 12.793963 12.793963 31.984907 0 44.77887-6.396981 6.396981-12.793963 9.595472-22.389435 9.595472z" horiz-adv-x="1024" />
@@ -1,11 +1,11 @@
1
1
  @font-face {
2
2
  font-family: "sdocfont"; /* Project id 4097705 */
3
- src: url('./sdoc-editor-font/iconfont.eot?t=1699007792511'); /* IE9 */
4
- src: url('./sdoc-editor-font/iconfont.eot?t=1699007792511#iefix') format('embedded-opentype'), /* IE6-IE8 */
5
- url('./sdoc-editor-font/iconfont.woff2?t=1699007792511') format('woff2'),
6
- url('./sdoc-editor-font/iconfont.woff?t=1699007792511') format('woff'),
7
- url('./sdoc-editor-font/iconfont.ttf?t=1699007792511') format('truetype'),
8
- url('./sdoc-editor-font/iconfont.svg?t=1699007792511#sdocfont') format('svg');
3
+ src: url('./sdoc-editor-font/iconfont.eot?t=1700460885427'); /* IE9 */
4
+ src: url('./sdoc-editor-font/iconfont.eot?t=1700460885427#iefix') format('embedded-opentype'), /* IE6-IE8 */
5
+ url('./sdoc-editor-font/iconfont.woff2?t=1700460885427') format('woff2'),
6
+ url('./sdoc-editor-font/iconfont.woff?t=1700460885427') format('woff'),
7
+ url('./sdoc-editor-font/iconfont.ttf?t=1700460885427') format('truetype'),
8
+ url('./sdoc-editor-font/iconfont.svg?t=1700460885427#sdocfont') format('svg');
9
9
  }
10
10
 
11
11
  .sdocfont {
@@ -16,6 +16,18 @@
16
16
  -moz-osx-font-smoothing: grayscale;
17
17
  }
18
18
 
19
+ .sdoc-jump-to:before {
20
+ content: "\e65a";
21
+ }
22
+
23
+ .sdoc-callout:before {
24
+ content: "\e65c";
25
+ }
26
+
27
+ .sdoc-chart:before {
28
+ content: "\e65b";
29
+ }
30
+
19
31
  .sdoc-add:before {
20
32
  content: "\e658";
21
33
  }