@seafile/seafile-editor 0.3.91 → 0.3.94

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.
Files changed (140) hide show
  1. package/dist/components/add-formula-dialog.js +0 -0
  2. package/dist/components/add-image-dialog.js +0 -0
  3. package/dist/components/add-link-dialog.js +0 -0
  4. package/dist/components/click-outside.js +0 -0
  5. package/dist/components/comment-dialog.js +0 -0
  6. package/dist/components/context-menu.js +0 -0
  7. package/dist/components/detail-list-view.js +0 -19
  8. package/dist/components/generate-share-link.js +0 -0
  9. package/dist/components/internal-link-dialog.js +0 -0
  10. package/dist/components/loading.js +0 -0
  11. package/dist/components/markdown-lint.js +0 -0
  12. package/dist/components/modal-portal.js +0 -0
  13. package/dist/components/outline.js +0 -0
  14. package/dist/components/participants-list.js +0 -0
  15. package/dist/components/shortcut-dialog.js +0 -0
  16. package/dist/components/side-panel.js +0 -1
  17. package/dist/components/table-button.js +0 -0
  18. package/dist/components/toast/alert.js +0 -0
  19. package/dist/components/toast/index.js +0 -0
  20. package/dist/components/toast/toast.js +0 -0
  21. package/dist/components/toast/toastManager.js +0 -0
  22. package/dist/components/toast/toaster.js +0 -0
  23. package/dist/components/topbar-component/button-group.js +0 -0
  24. package/dist/components/topbar-component/editor-toolbar.js +0 -0
  25. package/dist/components/topbar-component/header-list.js +0 -0
  26. package/dist/components/topbar-component/icon-button.js +0 -0
  27. package/dist/components/topbar-component/insert-file.js +0 -0
  28. package/dist/components/topbar-component/table-toolbar.js +0 -0
  29. package/dist/components/topbar-component/upload-img.js +0 -0
  30. package/dist/components/user-help.js +0 -0
  31. package/dist/config-0.js +15 -0
  32. package/dist/css/diff-viewer.css +0 -0
  33. package/dist/css/history-viewer.css +0 -0
  34. package/dist/css/keyboard-shortcuts.css +2 -2
  35. package/dist/css/layout.css +0 -0
  36. package/dist/css/markdown-viewer-slate/file-tags-list.css +0 -0
  37. package/dist/css/markdown-viewer.css +0 -0
  38. package/dist/css/plaineditor/markdown-editor.css +0 -0
  39. package/dist/css/react-mentions-default-style.js +0 -0
  40. package/dist/css/richeditor/comments-list.css +0 -0
  41. package/dist/css/richeditor/detail-list-view.css +0 -0
  42. package/dist/css/richeditor/document-info.css +0 -0
  43. package/dist/css/richeditor/formula.css +0 -0
  44. package/dist/css/richeditor/image.css +0 -0
  45. package/dist/css/richeditor/link.css +0 -0
  46. package/dist/css/richeditor/participants-list.css +0 -0
  47. package/dist/css/richeditor/rich-editor-main.css +0 -0
  48. package/dist/css/richeditor/right-panel.css +0 -0
  49. package/dist/css/richeditor/side-panel.css +0 -0
  50. package/dist/css/richeditor/table.css +0 -0
  51. package/dist/css/richeditor/textlink-hovermenu.css +0 -0
  52. package/dist/css/richeditor/tree-view.css +0 -0
  53. package/dist/css/topbar.css +0 -0
  54. package/dist/editor/code-highlight-package.js +0 -0
  55. package/dist/editor/controller/block-element-controller.js +0 -0
  56. package/dist/editor/controller/inline-element-controller.js +0 -0
  57. package/dist/editor/controller/shortcut-controller.js +3 -10
  58. package/dist/editor/controller/void-element-controller.js +0 -0
  59. package/dist/editor/custom/get-event-transfer.js +0 -0
  60. package/dist/editor/custom/getNodesByTypeAtRange.js +0 -0
  61. package/dist/editor/custom/insertNodes.js +0 -0
  62. package/dist/editor/custom/is-empty-paragraph.js +0 -0
  63. package/dist/editor/custom/set-event-transfer.js +0 -0
  64. package/dist/editor/custom/split-nodes-at-point.js +0 -0
  65. package/dist/editor/custom/unwrap-node-by-type-at-range.js +0 -0
  66. package/dist/editor/editor-component/check-list-item.js +0 -0
  67. package/dist/editor/editor-component/code-block.js +0 -0
  68. package/dist/editor/editor-component/formula.js +0 -0
  69. package/dist/editor/editor-component/image.js +0 -0
  70. package/dist/editor/editor-component/link.js +0 -0
  71. package/dist/editor/editor-component/table.js +0 -0
  72. package/dist/editor/editor-component/textlink-hovermenu.js +0 -0
  73. package/dist/editor/editor-utils/block-element-utils/blockquote-utils.js +0 -0
  74. package/dist/editor/editor-utils/block-element-utils/code-utils.js +0 -0
  75. package/dist/editor/editor-utils/block-element-utils/formula-utils.js +0 -0
  76. package/dist/editor/editor-utils/block-element-utils/index.js +0 -0
  77. package/dist/editor/editor-utils/block-element-utils/list-utils.js +0 -0
  78. package/dist/editor/editor-utils/block-element-utils/table-utils.js +0 -0
  79. package/dist/editor/editor-utils/inline-element-utils/index.js +0 -0
  80. package/dist/editor/editor-utils/mark-utils.js +0 -0
  81. package/dist/editor/editor-utils/range-utils.js +0 -0
  82. package/dist/editor/editor-utils/selection-utils.js +0 -0
  83. package/dist/editor/editor-utils/text-utils.js +0 -0
  84. package/dist/editor/editor.js +0 -0
  85. package/dist/editor/element-model/blockquote.js +0 -0
  86. package/dist/editor/element-model/image.js +0 -0
  87. package/dist/editor/element-model/link.js +0 -0
  88. package/dist/editor/element-model/table.js +0 -0
  89. package/dist/editor/element-model/text.js +0 -0
  90. package/dist/editor/load-script.js +0 -0
  91. package/dist/editor/plain-markdown-editor.js +0 -0
  92. package/dist/editor/rich-markdown-editor.js +0 -1
  93. package/dist/editor/seafile-editor.js +0 -1
  94. package/dist/editor/simple-editor.js +0 -0
  95. package/dist/editor-api.js +0 -5
  96. package/dist/index.css +0 -0
  97. package/dist/lib/slate-hyperscript/creators.js +0 -0
  98. package/dist/lib/slate-hyperscript/hyperscript.js +0 -0
  99. package/dist/lib/slate-hyperscript/index.js +0 -0
  100. package/dist/lib/slate-hyperscript/tokens.js +0 -0
  101. package/dist/lib/unified/index.js +0 -0
  102. package/dist/lib/vfile/core.js +0 -0
  103. package/dist/lib/vfile/index.js +0 -0
  104. package/dist/seafile-editor-chooser.js +0 -0
  105. package/dist/seafile-markdown-editor.js +0 -12
  106. package/dist/seafile-markdown-viewer.js +1 -2
  107. package/dist/seafile-simple-editor.js +0 -0
  108. package/dist/utils/copy-to-clipboard.js +0 -0
  109. package/dist/utils/deserialize-html.js +0 -0
  110. package/dist/utils/diff/compare-strings.js +0 -0
  111. package/dist/utils/diff/diff.js +0 -0
  112. package/dist/utils/diff/index.js +0 -0
  113. package/dist/utils/render-slate.js +0 -0
  114. package/dist/utils/seafile-markdown2html.js +0 -0
  115. package/dist/utils/slate2markdown/index.js +0 -0
  116. package/dist/utils/slate2markdown/serialize.js +0 -0
  117. package/dist/utils/utils.js +0 -0
  118. package/dist/viewer/diff-viewer.js +0 -0
  119. package/dist/viewer/markdown-viewer.js +0 -0
  120. package/dist/viewer/slate-viewer.js +0 -0
  121. package/dist/viewer/viewer-formula.js +0 -0
  122. package/dist/viewer/viewer-image.js +0 -0
  123. package/dist/viewer/viewer-outline.js +0 -0
  124. package/package.json +1 -1
  125. package/public/favicon.ico +0 -0
  126. package/public/index.html +0 -0
  127. package/public/locales/cs/seafile-editor.json +0 -0
  128. package/public/locales/de/seafile-editor.json +0 -0
  129. package/public/locales/es/seafile-editor.json +0 -0
  130. package/public/locales/es-AR/seafile-editor.json +0 -0
  131. package/public/locales/es-MX/seafile-editor.json +0 -0
  132. package/public/locales/fr/seafile-editor.json +0 -0
  133. package/public/locales/it/seafile-editor.json +0 -0
  134. package/public/locales/ru/seafile-editor.json +0 -0
  135. package/public/manifest.json +0 -0
  136. package/public/media/scripts/mathjax/tex-svg.js +0 -0
  137. package/public/media/seafile-logo.png +0 -0
  138. package/public/media/seafile-ui.css +0 -0
  139. package/dist/components/related-files-list.js +0 -75
  140. package/dist/css/related-files-list.css +0 -56
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -28,10 +28,6 @@ var DetailListView = /*#__PURE__*/function (_React$Component) {
28
28
  _this.props.openDialogs && _this.props.openDialogs('file_tags');
29
29
  };
30
30
 
31
- _this.onListRelatedFileToggle = function () {
32
- _this.props.openDialogs && _this.props.openDialogs('related_files');
33
- };
34
-
35
31
  _this.bytesToSize = function (bytes) {
36
32
  if (bytes < 0) return '--';
37
33
  var sizes = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
@@ -62,7 +58,6 @@ var DetailListView = /*#__PURE__*/function (_React$Component) {
62
58
  value: function render() {
63
59
  var _this$props = this.props,
64
60
  fileTagList = _this$props.fileTagList,
65
- relatedFiles = _this$props.relatedFiles,
66
61
  fileInfo = _this$props.fileInfo;
67
62
  var _this$props$editorApi = this.props.editorApi,
68
63
  filePath = _this$props$editorApi.filePath,
@@ -95,20 +90,6 @@ var DetailListView = /*#__PURE__*/function (_React$Component) {
95
90
  })), /*#__PURE__*/React.createElement("i", {
96
91
  className: "iconfont icon-pencil attr-action-icon",
97
92
  onClick: this.onEditFileTagToggle
98
- }))), /*#__PURE__*/React.createElement("tr", {
99
- className: "file-related-files"
100
- }, /*#__PURE__*/React.createElement("th", null, this.props.t('Related_Files')), /*#__PURE__*/React.createElement("td", null, relatedFiles.length > 0 && /*#__PURE__*/React.createElement("ul", null, relatedFiles.map(function (relatedFile, index) {
101
- var href = serviceUrl + '/lib/' + relatedFile.repo_id + '/file' + encodeURIComponent(relatedFile.path);
102
- return /*#__PURE__*/React.createElement("li", {
103
- key: index
104
- }, /*#__PURE__*/React.createElement("a", {
105
- href: href,
106
- rel: "noopener noreferrer",
107
- target: "_blank"
108
- }, relatedFile.name));
109
- })), /*#__PURE__*/React.createElement("i", {
110
- className: "iconfont icon-pencil attr-action-icon",
111
- onClick: this.onListRelatedFileToggle
112
93
  }))), this.props.participants && window.showParticipants && /*#__PURE__*/React.createElement("tr", {
113
94
  className: "file-participants"
114
95
  }, /*#__PURE__*/React.createElement("th", null, this.props.t('Participants')), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(ParticipantsList, {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -159,7 +159,6 @@ var SidePanel = /*#__PURE__*/function (_React$PureComponent) {
159
159
  onParticipantsChange: this.props.onParticipantsChange
160
160
  }), this.state.navItem === 'detail' && /*#__PURE__*/React.createElement(DetailListView, {
161
161
  t: this.props.t,
162
- relatedFiles: this.props.relatedFiles,
163
162
  fileTagList: this.props.fileTagList,
164
163
  editorApi: this.props.editorApi,
165
164
  openDialogs: this.props.openDialogs,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ var serverConfig = {
2
+ serviceUrl: "https://download.seafile.top",
3
+ username: "xxx",
4
+ password: "xxx",
5
+ repoID: "xxxxxxx-xxxx-xxx-xxx-xxxx",
6
+ userInfo: {
7
+ username: 'xxx',
8
+ name: 'xxx',
9
+ contact_email: 'xxxx'
10
+ },
11
+ filePath: '/demo.md',
12
+ fileName: 'demo.md',
13
+ dirPath: '/'
14
+ };
15
+ export { serverConfig };
File without changes
File without changes
@@ -1,9 +1,9 @@
1
1
  .keyboard-shortcut-dialog {
2
- max-width: 600px;
2
+ max-width: 560px;
3
3
  }
4
4
 
5
5
  .keyboard-shortcut-dialog .modal-body {
6
- max-height: 500px;
6
+ max-height: 390px;
7
7
  overflow: auto;
8
8
  }
9
9
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -334,19 +334,12 @@ var withMarkdownShortcut = function withMarkdownShortcut(editor) {
334
334
  _Editor$nodes10 = _slicedToArray(_Editor$nodes9, 1),
335
335
  _node3 = _Editor$nodes10[0];
336
336
 
337
- var listItemPath = _node3[1];
338
- var listNode = Node.parent(editor, listItemPath); // Unwrap the list item when the selection is at the first list item of the first node of document
337
+ var listItemPath = _node3[1]; // Unwrap the list item when the selection is at the first list item
339
338
 
340
- if (anchor.path[0] === 0 && anchor.path[1] === 0 && anchor.path[listItemPath.length] === 0) {
339
+ if (listItemPath.at(-1) === 0 && anchor.path[listItemPath.length] === 0) {
341
340
  listUtils.unwrapList();
342
341
  return;
343
- } // unwrap an empty list
344
-
345
-
346
- if (listNode.children.length === 1 && Node.text(listNode).length === 0) {
347
- listUtils.unwrapList();
348
- return;
349
- } // list items with mutiple chidren
342
+ } // List items with mutiple chidren
350
343
 
351
344
 
352
345
  var currentChildBlockIndex = anchor.path[anchor.path.length - 2];
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -551,7 +551,6 @@ var SimpleEditor = /*#__PURE__*/function (_React$Component) {
551
551
  editorApi: editorApi,
552
552
  toggleCommentBtn: this.toggleCommentBtn,
553
553
  relistComment: this.state.relistComment,
554
- relatedFiles: this.props.relatedFiles,
555
554
  fileTagList: this.props.fileTagList,
556
555
  openDialogs: this.props.openDialogs,
557
556
  fileInfo: this.props.fileInfo,
@@ -289,7 +289,6 @@ var SeafileEditor = /*#__PURE__*/function (_React$Component) {
289
289
  isDraft: this.props.isDraft,
290
290
  openDialogs: this.props.openDialogs,
291
291
  readOnly: this.props.readOnly,
292
- relatedFiles: this.props.relatedFiles,
293
292
  fileTagList: this.props.fileTagList,
294
293
  participants: this.props.participants,
295
294
  onParticipantsChange: this.props.onParticipantsChange
File without changes
@@ -226,11 +226,6 @@ var EditorApi = /*#__PURE__*/function () {
226
226
  value: function listFileTags() {
227
227
  return this.seafileAPI.listFileTags(this.repoID, this.filePath);
228
228
  }
229
- }, {
230
- key: "listRelatedFiles",
231
- value: function listRelatedFiles() {
232
- return this.seafileAPI.listRelatedFiles(this.repoID, this.filePath);
233
- }
234
229
  }, {
235
230
  key: "markdownLint",
236
231
  value: function markdownLint(slateValue) {
package/dist/index.css CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -53,7 +53,6 @@ var SFRichMdEditor = /*#__PURE__*/function (_React$Component) {
53
53
  }] : [],
54
54
  contentChanged: false,
55
55
  saving: false,
56
- relatedFiles: [],
57
56
  fileTagList: []
58
57
  };
59
58
 
@@ -195,14 +194,6 @@ var SFRichMdEditor = /*#__PURE__*/function (_React$Component) {
195
194
  });
196
195
  };
197
196
 
198
- _this.listRelatedFiles = function () {
199
- editorApi.listRelatedFiles().then(function (res) {
200
- _this.setState({
201
- relatedFiles: res.data.related_files
202
- });
203
- });
204
- };
205
-
206
197
  _this.listFileTags = function () {
207
198
  editorApi.listFileTags(repoID, filePath).then(function (res) {
208
199
  var fileTagList = res.data.file_tags;
@@ -252,8 +243,6 @@ var SFRichMdEditor = /*#__PURE__*/function (_React$Component) {
252
243
  });
253
244
  });
254
245
 
255
- _this2.listRelatedFiles();
256
-
257
246
  _this2.listFileTags();
258
247
  });
259
248
  });
@@ -288,7 +277,6 @@ var SFRichMdEditor = /*#__PURE__*/function (_React$Component) {
288
277
  onSaving: this.onSaving,
289
278
  markdownLint: true,
290
279
  saving: this.state.saving,
291
- relatedFiles: this.state.relatedFiles,
292
280
  fileTagList: this.state.fileTagList
293
281
  });
294
282
  }
@@ -57,8 +57,7 @@ var SFMarkdownViwer = /*#__PURE__*/function (_React$Component) {
57
57
  value: markdownContent,
58
58
  loading: false
59
59
  });
60
- }); // this.listRelatedFiles();
61
- // this.listFileTags();
60
+ }); // this.listFileTags();
62
61
  });
63
62
  });
64
63
  });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "0.3.91",
3
+ "version": "0.3.94",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^0.0.9",
File without changes
package/public/index.html CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,75 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
6
- import { Card, CardTitle, CardText } from 'reactstrap';
7
- import { withTranslation } from 'react-i18next';
8
-
9
- require('../css/related-files-list.css');
10
-
11
- var RelatedFilesList = /*#__PURE__*/function (_React$Component) {
12
- _inherits(RelatedFilesList, _React$Component);
13
-
14
- var _super = _createSuper(RelatedFilesList);
15
-
16
- function RelatedFilesList(props) {
17
- var _this;
18
-
19
- _classCallCheck(this, RelatedFilesList);
20
-
21
- _this = _super.call(this, props);
22
-
23
- _this.encodePath = function (path) {
24
- if (!path) {
25
- return '';
26
- }
27
-
28
- var path_arr = path.split('/');
29
- var path_arr_ = [];
30
-
31
- for (var i = 0, len = path_arr.length; i < len; i++) {
32
- path_arr_.push(encodeURIComponent(path_arr[i]));
33
- }
34
-
35
- return path_arr_.join('/');
36
- };
37
-
38
- return _this;
39
- }
40
-
41
- _createClass(RelatedFilesList, [{
42
- key: "render",
43
- value: function render() {
44
- var _this2 = this;
45
-
46
- var siteRoot = this.props.siteRoot;
47
- return /*#__PURE__*/React.createElement("div", {
48
- className: "sf-releted-files",
49
- id: "sf-releted-files"
50
- }, /*#__PURE__*/React.createElement("div", {
51
- className: "sf-releted-files-header"
52
- }, /*#__PURE__*/React.createElement("h4", null, this.props.t('related_files'))), this.props.relatedFiles.map(function (relatedFile, index) {
53
- var href = siteRoot + 'lib/' + relatedFile.repo_id + '/file' + _this2.encodePath(relatedFile.path);
54
-
55
- return /*#__PURE__*/React.createElement("div", {
56
- className: "sf-releted-file",
57
- key: index
58
- }, /*#__PURE__*/React.createElement("a", {
59
- href: href,
60
- rel: "noopener noreferrer",
61
- target: "_blank"
62
- }, /*#__PURE__*/React.createElement(Card, {
63
- body: true,
64
- size: "sm"
65
- }, /*#__PURE__*/React.createElement(CardTitle, null, relatedFile.name), /*#__PURE__*/React.createElement(CardText, null, relatedFile.repo_name), /*#__PURE__*/React.createElement("span", {
66
- className: "sf-releted-file-arrow"
67
- }))));
68
- }));
69
- }
70
- }]);
71
-
72
- return RelatedFilesList;
73
- }(React.Component);
74
-
75
- export default withTranslation('seafile-editor')(RelatedFilesList);
@@ -1,56 +0,0 @@
1
- .sf-releted-files {
2
- margin-top: 80px;
3
- }
4
-
5
- .sf-releted-files-header {
6
- border-top: 2px dashed #E6E6EB;
7
- }
8
-
9
- .sf-releted-files-header h4 {
10
- font-weight: 400;
11
- margin-top: 40px;
12
- }
13
-
14
- .sf-releted-files .sf-releted-file {
15
- margin: 20px 0;
16
- }
17
-
18
- .sf-releted-files .sf-releted-files h4,
19
- .sf-releted-files .sf-releted-files p {
20
- margin: 0;
21
- }
22
-
23
- .sf-releted-files .sf-releted-file a {
24
- text-decoration: none;
25
- }
26
-
27
- .sf-releted-files .sf-releted-file .card-body {
28
- padding: 0.5rem 1.5rem;
29
- }
30
-
31
- .sf-releted-files .sf-releted-file .card {
32
- border-radius: 10px;
33
- background-color: #e5e5ea;
34
- border-color: #e5e5ea;
35
- }
36
-
37
- .sf-releted-files .sf-releted-file .card-title {
38
- margin: 0 0 2px;
39
- color: #333;
40
- }
41
-
42
- .sf-releted-files .sf-releted-file .card-text {
43
- color: #888;
44
- }
45
-
46
- .sf-releted-file-arrow {
47
- position: absolute;
48
- right: 30px;
49
- top: 50%;
50
- margin-top: -8px;
51
- border-top: 2px solid #aaa;
52
- border-right: 2px solid #aaa;
53
- transform: rotate(45deg);
54
- width: 16px;
55
- height: 16px;
56
- }