@seafile/seafile-editor 0.3.92 → 0.3.95

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 (151) 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 +1 -22
  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/toolbar.js +11 -1
  24. package/dist/components/topbar-component/button-group.js +0 -0
  25. package/dist/components/topbar-component/editor-toolbar.js +0 -0
  26. package/dist/components/topbar-component/header-list.js +0 -0
  27. package/dist/components/topbar-component/icon-button.js +0 -0
  28. package/dist/components/topbar-component/insert-file.js +0 -0
  29. package/dist/components/topbar-component/table-toolbar.js +0 -0
  30. package/dist/components/topbar-component/upload-img.js +0 -0
  31. package/dist/components/user-help.js +0 -0
  32. package/dist/css/diff-viewer.css +1 -1
  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 +1 -1
  37. package/dist/css/markdown-viewer.css +1 -1
  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 +1 -1
  41. package/dist/css/richeditor/detail-list-view.css +0 -0
  42. package/dist/css/richeditor/document-info.css +1 -1
  43. package/dist/css/richeditor/formula.css +1 -1
  44. package/dist/css/richeditor/image.css +15 -19
  45. package/dist/css/richeditor/link.css +1 -1
  46. package/dist/css/richeditor/navbar-imgbutton.css +5 -1
  47. package/dist/css/richeditor/participants-list.css +1 -1
  48. package/dist/css/richeditor/rich-editor-main.css +1 -1
  49. package/dist/css/richeditor/right-panel.css +1 -1
  50. package/dist/css/richeditor/side-panel.css +0 -0
  51. package/dist/css/richeditor/table.css +1 -1
  52. package/dist/css/richeditor/textlink-hovermenu.css +0 -0
  53. package/dist/css/richeditor/tree-view.css +1 -1
  54. package/dist/css/topbar.css +1 -1
  55. package/dist/editor/code-highlight-package.js +0 -0
  56. package/dist/editor/controller/block-element-controller.js +1 -1
  57. package/dist/editor/controller/inline-element-controller.js +0 -0
  58. package/dist/editor/controller/shortcut-controller.js +6 -0
  59. package/dist/editor/controller/void-element-controller.js +0 -0
  60. package/dist/editor/custom/get-event-transfer.js +0 -0
  61. package/dist/editor/custom/getNodesByTypeAtRange.js +0 -0
  62. package/dist/editor/custom/insertNodes.js +0 -0
  63. package/dist/editor/custom/is-empty-paragraph.js +0 -0
  64. package/dist/editor/custom/set-event-transfer.js +0 -0
  65. package/dist/editor/custom/split-nodes-at-point.js +0 -0
  66. package/dist/editor/custom/unwrap-node-by-type-at-range.js +0 -0
  67. package/dist/editor/editor-component/check-list-item.js +0 -0
  68. package/dist/editor/editor-component/code-block.js +0 -0
  69. package/dist/editor/editor-component/formula.js +0 -0
  70. package/dist/editor/editor-component/image.js +2 -3
  71. package/dist/editor/editor-component/link.js +0 -0
  72. package/dist/editor/editor-component/table.js +0 -0
  73. package/dist/editor/editor-component/textlink-hovermenu.js +0 -0
  74. package/dist/editor/editor-utils/block-element-utils/blockquote-utils.js +0 -0
  75. package/dist/editor/editor-utils/block-element-utils/code-utils.js +0 -0
  76. package/dist/editor/editor-utils/block-element-utils/formula-utils.js +0 -0
  77. package/dist/editor/editor-utils/block-element-utils/index.js +0 -0
  78. package/dist/editor/editor-utils/block-element-utils/list-utils.js +0 -0
  79. package/dist/editor/editor-utils/block-element-utils/table-utils.js +0 -0
  80. package/dist/editor/editor-utils/clear-format-utils.js +94 -0
  81. package/dist/editor/editor-utils/common-editor-utils.js +9 -1
  82. package/dist/editor/editor-utils/inline-element-utils/index.js +0 -0
  83. package/dist/editor/editor-utils/mark-utils.js +0 -0
  84. package/dist/editor/editor-utils/range-utils.js +0 -0
  85. package/dist/editor/editor-utils/selection-utils.js +0 -0
  86. package/dist/editor/editor-utils/text-utils.js +0 -0
  87. package/dist/editor/editor.js +0 -0
  88. package/dist/editor/element-model/blockquote.js +0 -0
  89. package/dist/editor/element-model/image.js +0 -0
  90. package/dist/editor/element-model/link.js +0 -0
  91. package/dist/editor/element-model/table.js +0 -0
  92. package/dist/editor/element-model/text.js +0 -0
  93. package/dist/editor/load-script.js +0 -0
  94. package/dist/editor/plain-markdown-editor.js +0 -0
  95. package/dist/editor/rich-markdown-editor.js +0 -1
  96. package/dist/editor/seafile-editor.js +0 -1
  97. package/dist/editor/simple-editor.js +0 -0
  98. package/dist/editor-api.js +0 -5
  99. package/dist/index.css +0 -0
  100. package/dist/lib/slate-hyperscript/creators.js +0 -0
  101. package/dist/lib/slate-hyperscript/hyperscript.js +0 -0
  102. package/dist/lib/slate-hyperscript/index.js +0 -0
  103. package/dist/lib/slate-hyperscript/tokens.js +0 -0
  104. package/dist/lib/unified/index.js +0 -0
  105. package/dist/lib/vfile/core.js +0 -0
  106. package/dist/lib/vfile/index.js +0 -0
  107. package/dist/seafile-editor-chooser.js +0 -0
  108. package/dist/seafile-markdown-editor.js +0 -12
  109. package/dist/seafile-markdown-viewer.js +1 -2
  110. package/dist/seafile-simple-editor.js +0 -0
  111. package/dist/utils/copy-to-clipboard.js +0 -0
  112. package/dist/utils/deserialize-html.js +0 -0
  113. package/dist/utils/diff/compare-strings.js +0 -0
  114. package/dist/utils/diff/diff.js +0 -0
  115. package/dist/utils/diff/index.js +0 -0
  116. package/dist/utils/render-slate.js +0 -0
  117. package/dist/utils/seafile-markdown2html.js +0 -0
  118. package/dist/utils/slate2markdown/index.js +0 -0
  119. package/dist/utils/slate2markdown/serialize.js +0 -0
  120. package/dist/utils/utils.js +0 -0
  121. package/dist/viewer/diff-viewer.js +0 -0
  122. package/dist/viewer/markdown-viewer.js +0 -0
  123. package/dist/viewer/slate-viewer.js +0 -0
  124. package/dist/viewer/viewer-formula.js +0 -0
  125. package/dist/viewer/viewer-image.js +0 -0
  126. package/dist/viewer/viewer-outline.js +0 -0
  127. package/package.json +1 -1
  128. package/public/favicon.ico +0 -0
  129. package/public/index.html +0 -0
  130. package/public/locales/cs/seafile-editor.json +0 -0
  131. package/public/locales/de/seafile-editor.json +0 -0
  132. package/public/locales/en/seafile-editor.json +1 -0
  133. package/public/locales/es/seafile-editor.json +0 -0
  134. package/public/locales/es-AR/seafile-editor.json +0 -0
  135. package/public/locales/es-MX/seafile-editor.json +0 -0
  136. package/public/locales/fr/seafile-editor.json +0 -0
  137. package/public/locales/it/seafile-editor.json +0 -0
  138. package/public/locales/ru/seafile-editor.json +0 -0
  139. package/public/locales/zh-CN/seafile-editor.json +1 -0
  140. package/public/manifest.json +0 -0
  141. package/public/media/scripts/mathjax/tex-svg.js +0 -0
  142. package/public/media/seafile-editor-font/iconfont.eot +0 -0
  143. package/public/media/seafile-editor-font/iconfont.svg +6 -4
  144. package/public/media/seafile-editor-font/iconfont.ttf +0 -0
  145. package/public/media/seafile-editor-font/iconfont.woff +0 -0
  146. package/public/media/seafile-editor-font/iconfont.woff2 +0 -0
  147. package/public/media/seafile-editor-font.css +10 -6
  148. package/public/media/seafile-logo.png +0 -0
  149. package/public/media/seafile-ui.css +1 -1
  150. package/dist/components/related-files-list.js +0 -75
  151. package/dist/css/related-files-list.css +0 -56
@@ -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.92",
3
+ "version": "0.3.95",
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
@@ -135,6 +135,7 @@
135
135
  "Tags": "Tags",
136
136
  "Related_Files": "Related Files",
137
137
  "Add_participants": "Add participants",
138
+ "Clear_format": "Clear format",
138
139
  "markdownLint": {
139
140
  "missing_h1": {
140
141
  "description": "There is no h1 in the document",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -132,6 +132,7 @@
132
132
  "Tags": "标签",
133
133
  "Related_Files": "相关文档",
134
134
  "Add_participants": "增加文件参与人",
135
+ "Clear_format": "清除格式",
135
136
  "markdownLint": {
136
137
  "missing_h1": {
137
138
  "description": "文档缺少一级标题",
File without changes
File without changes
@@ -14,13 +14,15 @@
14
14
  />
15
15
  <missing-glyph />
16
16
 
17
- <glyph glyph-name="enlarge" unicode="&#59223;" d="M432 860.8C211.2 860.8 32 681.6 32 460.8s179.2-400 400-400c99.2 0 188.8 35.2 256 92.8l217.6-217.6c19.2-19.2 48-19.2 67.2 0s19.2 48 0 67.2L755.2 224c48 67.2 76.8 147.2 76.8 236.8 0 220.8-179.2 400-400 400z m0-99.2c166.4 0 300.8-134.4 300.8-300.8S598.4 160 432 160s-300.8 134.4-300.8 300.8 134.4 300.8 300.8 300.8z m-3.2-124.8c-25.6 0-48-22.4-48-48v-80H300.8c-25.6 0-48-22.4-48-48s22.4-48 48-48h80v-80c0-25.6 22.4-48 48-48s48 22.4 48 48v80h80c25.6 0 48 22.4 48 48s-22.4 48-48 48h-80V588.8c0 25.6-22.4 48-48 48z" horiz-adv-x="1024" />
17
+ <glyph glyph-name="-clear-format" unicode="&#59232;" d="M918.4 579.2L640 816c-25.6 22.4-64 22.4-83.2-6.4L112 310.4c-9.6-9.6-16-25.6-16-41.6s9.6-32 22.4-41.6L256 112h326.4l342.4 384c19.2 25.6 19.2 60.8-6.4 83.2z m-384-380.8H300.8L224 268.79999999999995c-6.4 6.4-9.6 9.6-9.6 16s0 16 6.4 22.4l185.6 211.2 233.6-201.6-105.6-118.4zM147.2 41.60000000000002h739.2c32 0 51.2-22.4 51.2-51.2 0-32-22.4-51.2-51.2-51.2H147.2c-32 0-51.2 22.4-51.2 51.2 0 28.8 22.4 51.2 51.2 51.2z" horiz-adv-x="1024" />
18
18
 
19
- <glyph glyph-name="shrink" unicode="&#59224;" d="M432 860.8C211.2 860.8 32 681.6 32 460.8s179.2-400 400-400c99.2 0 188.8 35.2 256 92.8l217.6-217.6c19.2-19.2 48-19.2 67.2 0s19.2 48 0 67.2L755.2 224c48 67.2 76.8 147.2 76.8 236.8 0 220.8-179.2 400-400 400z m0-99.2c166.4 0 300.8-134.4 300.8-300.8S598.4 160 432 160s-300.8 134.4-300.8 300.8 134.4 300.8 300.8 300.8z m-131.2-252.8c-25.6 0-48-22.4-48-48s22.4-48 48-48h256c25.6 0 48 22.4 48 48s-22.4 48-48 48h-256z" horiz-adv-x="1024" />
19
+ <glyph glyph-name="-enlarge" unicode="&#59223;" d="M432 860.8C211.2 860.8 32 681.6 32 460.8s179.2-400 400-400c99.2 0 188.8 35.2 256 92.8l217.6-217.6c19.2-19.2 48-19.2 67.2 0s19.2 48 0 67.2L755.2 224c48 67.2 76.8 147.2 76.8 236.8 0 220.8-179.2 400-400 400z m0-99.2c166.4 0 300.8-134.4 300.8-300.8S598.4 160 432 160s-300.8 134.4-300.8 300.8 134.4 300.8 300.8 300.8z m-3.2-124.8c-25.6 0-48-22.4-48-48v-80H300.8c-25.6 0-48-22.4-48-48s22.4-48 48-48h80v-80c0-25.6 22.4-48 48-48s48 22.4 48 48v80h80c25.6 0 48 22.4 48 48s-22.4 48-48 48h-80V588.8c0 25.6-22.4 48-48 48z" horiz-adv-x="1024" />
20
20
 
21
- <glyph glyph-name="right" unicode="&#59221;" d="M640 380.8L278.4 742.4c-22.4 19.2-22.4 54.4 0 76.8s57.6 22.4 76.8 0l406.4-400c22.4-22.4 22.4-57.6 0-76.8L355.2-60.8c-22.4-22.4-57.6-22.4-76.8 0s-22.4 57.6 0 76.8L640 380.8z" horiz-adv-x="1024" />
21
+ <glyph glyph-name="-shrink" unicode="&#59224;" d="M432 860.8C211.2 860.8 32 681.6 32 460.8s179.2-400 400-400c99.2 0 188.8 35.2 256 92.8l217.6-217.6c19.2-19.2 48-19.2 67.2 0s19.2 48 0 67.2L755.2 224c48 67.2 76.8 147.2 76.8 236.8 0 220.8-179.2 400-400 400z m0-99.2c166.4 0 300.8-134.4 300.8-300.8S598.4 160 432 160s-300.8 134.4-300.8 300.8 134.4 300.8 300.8 300.8z m-131.2-252.8c-25.6 0-48-22.4-48-48s22.4-48 48-48h256c25.6 0 48 22.4 48 48s-22.4 48-48 48h-256z" horiz-adv-x="1024" />
22
22
 
23
- <glyph glyph-name="left" unicode="&#59222;" d="M412.8 380.8L774.4 742.4c22.4 19.2 22.4 54.4 0 76.8s-57.6 22.4-76.8 0L291.2 419.2c-22.4-22.4-22.4-57.6 0-76.8l406.4-403.2c22.4-22.4 57.6-22.4 76.8 0s22.4 57.6 0 76.8L412.8 380.8z" horiz-adv-x="1024" />
23
+ <glyph glyph-name="-right" unicode="&#59221;" d="M640 380.79999999999995L278.4 742.4c-22.4 19.2-22.4 54.4 0 76.8s57.6 22.4 76.8 0l406.4-400c22.4-22.4 22.4-57.6 0-76.8L355.2-60.799999999999955c-22.4-22.4-57.6-22.4-76.8 0s-22.4 57.6 0 76.8L640 380.79999999999995z" horiz-adv-x="1024" />
24
+
25
+ <glyph glyph-name="-left" unicode="&#59222;" d="M412.8 380.79999999999995L774.4 742.4c22.4 19.2 22.4 54.4 0 76.8s-57.6 22.4-76.8 0L291.2 419.2c-22.4-22.4-22.4-57.6 0-76.8l406.4-403.2c22.4-22.4 57.6-22.4 76.8 0s22.4 57.6 0 76.8L412.8 380.79999999999995z" horiz-adv-x="1024" />
24
26
 
25
27
  <glyph glyph-name="-formula" unicode="&#59152;" d="M393.6 576.384h89.6v-128h-118.4l-12.8-54.4c-38.4-166.4-54.4-243.2-73.6-307.2-25.6-105.6-105.6-179.2-217.6-179.2h-16c-6.4 0-12.8 6.4-12.8 12.8v92.8c0 9.6 3.2 12.8 12.8 12.8h16c41.6 9.6 67.2 35.2 80 92.8 19.2 64 35.2 140.8 70.4 304l6.4 25.6-172.8-3.2c-6.4 0-12.8 6.4-12.8 12.8v102.4c0 6.4 6.4 12.8 12.8 12.8l198.4 3.2c16 60.8 22.4 89.6 32 128 35.2 137.6 153.6 182.4 326.4 150.4 3.2 0 9.6 0 12.8-3.2 6.4 0 12.8-9.6 9.6-16l-19.2-115.2c0-6.4-9.6-12.8-16-9.6-6.4 0-12.8 3.2-16 3.2-115.2 22.4-137.6 22.4-153.6-41.6-6.4-35.2-16-54.4-25.6-96zM758.4 448.384l140.8 128h83.2c6.4 0 12.8-6.4 12.8-12.8v-105.6c0-6.4-6.4-12.8-12.8-12.8h-25.6l-128-115.2 86.4-124.8h12.8c6.4 0 12.8-6.4 12.8-12.8v-96c0-6.4-6.4-12.8-12.8-12.8h-96l-99.2 144-131.2-144h-92.8c-6.4 0-12.8 6.4-12.8 12.8v96c0 6.4 6.4 12.8 12.8 12.8h19.2l140.8 137.6-70.4 105.6h-124.8v128h204.8l80-128z" horiz-adv-x="1024" />
26
28
 
@@ -1,11 +1,11 @@
1
1
  @font-face {
2
2
  font-family: "iconfont"; /* Project id 1206766 */
3
- src: url('./seafile-editor-font/iconfont.eot?t=1640940881453'); /* IE9 */
4
- src: url('./seafile-editor-font/iconfont.eot?t=1640940881453#iefix') format('embedded-opentype'), /* IE6-IE8 */
5
- url('./seafile-editor-font/iconfont.woff2?t=1640940881453') format('woff2'),
6
- url('./seafile-editor-font/iconfont.woff?t=1640940881453') format('woff'),
7
- url('./seafile-editor-font/iconfont.ttf?t=1640940881453') format('truetype'),
8
- url('./seafile-editor-font/iconfont.svg?t=1640940881453#iconfont') format('svg');
3
+ src: url('./seafile-editor-font/iconfont.eot?t=1645422890587'); /* IE9 */
4
+ src: url('./seafile-editor-font/iconfont.eot?t=1645422890587#iefix') format('embedded-opentype'), /* IE6-IE8 */
5
+ url('./seafile-editor-font/iconfont.woff2?t=1645422890587') format('woff2'),
6
+ url('./seafile-editor-font/iconfont.woff?t=1645422890587') format('woff'),
7
+ url('./seafile-editor-font/iconfont.ttf?t=1645422890587') format('truetype'),
8
+ url('./seafile-editor-font/iconfont.svg?t=1645422890587#iconfont') format('svg');
9
9
  }
10
10
 
11
11
  .iconfont {
@@ -16,6 +16,10 @@
16
16
  -moz-osx-font-smoothing: grayscale;
17
17
  }
18
18
 
19
+ .icon-clear-format:before {
20
+ content: "\e760";
21
+ }
22
+
19
23
  .iconenlarge:before {
20
24
  content: "\e757";
21
25
  }
File without changes
@@ -11166,4 +11166,4 @@ Icon input
11166
11166
  box-shadow: 0 0 0 2px rgba(241, 150, 69, 0.25); }
11167
11167
 
11168
11168
 
11169
- /*# sourceMappingURL=seafile-ui.map*/
11169
+ /*# sourceMappingURL=seafile-ui.map*/
@@ -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
- }