@seafile/seafile-editor 0.3.97 → 0.3.100

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 (92) hide show
  1. package/dist/_i18n/index.js +20 -0
  2. package/dist/assets/css/comment-dialog.css +50 -0
  3. package/dist/{css → assets/css}/diff-viewer.css +0 -0
  4. package/dist/{css/richeditor → assets/css}/formula.css +0 -0
  5. package/dist/{css → assets/css}/history-viewer.css +0 -0
  6. package/dist/{css/richeditor → assets/css}/image.css +0 -0
  7. package/dist/{index.css → assets/css/index.css} +0 -0
  8. package/dist/assets/css/issue-card.css +43 -0
  9. package/dist/{css → assets/css}/keyboard-shortcuts.css +0 -0
  10. package/dist/{css/richeditor → assets/css}/link.css +0 -0
  11. package/dist/{css/plaineditor → assets/css}/markdown-editor.css +0 -0
  12. package/dist/{css → assets/css}/markdown-viewer.css +0 -0
  13. package/dist/{css/richeditor → assets/css}/navbar-imgbutton.css +0 -0
  14. package/dist/assets/css/outline.css +29 -0
  15. package/dist/{css/richeditor → assets/css}/table.css +0 -0
  16. package/dist/{css/richeditor → assets/css}/textlink-hovermenu.css +0 -0
  17. package/dist/{css → assets/css}/topbar.css +19 -33
  18. package/dist/{css/richeditor → assets/css}/tree-view.css +0 -0
  19. package/dist/{css/richeditor/right-panel.css → assets/css/user-help.css} +9 -9
  20. package/dist/assets/editor/plain-editor.css +30 -0
  21. package/dist/assets/editor/rich-editor.css +104 -0
  22. package/dist/assets/editor/simple-editor.css +77 -0
  23. package/dist/{css/richeditor → assets/rich-editor}/document-info.css +0 -0
  24. package/dist/components/add-formula-dialog.js +6 -4
  25. package/dist/components/add-image-dialog.js +3 -1
  26. package/dist/components/add-link-dialog.js +4 -3
  27. package/dist/components/comment-dialog.js +12 -6
  28. package/dist/components/markdown-lint.js +1 -0
  29. package/dist/components/outline/index.js +97 -0
  30. package/dist/components/outline/outline-item.js +70 -0
  31. package/dist/components/shortcut-dialog.js +26 -51
  32. package/dist/components/{topbar-component → toolbar}/header-list.js +0 -0
  33. package/dist/components/toolbar/help-group.js +40 -0
  34. package/dist/components/toolbar/index.js +4 -0
  35. package/dist/components/{topbar-component/upload-img.js → toolbar/insert-image.js} +18 -15
  36. package/dist/components/toolbar/insert-table.js +155 -0
  37. package/dist/components/toolbar/table-group.js +82 -0
  38. package/dist/components/{toolbar.js → toolbar/toolbar.js} +102 -64
  39. package/dist/components/{topbar-component → toolbar/widgets}/button-group.js +0 -0
  40. package/dist/components/toolbar/widgets/button-item.js +144 -0
  41. package/dist/components/toolbar/widgets/drop-list.js +101 -0
  42. package/dist/components/user-help.js +16 -10
  43. package/dist/editor/controller/block-element-controller.js +6 -2
  44. package/dist/editor/controller/inline-element-controller.js +6 -2
  45. package/dist/editor/editor-builder.js +107 -0
  46. package/dist/editor/editor-component/formula.js +4 -2
  47. package/dist/editor/editor-component/image.js +10 -6
  48. package/dist/editor/editor-component/table.js +1 -1
  49. package/dist/editor/editor-plugin.js +3 -1
  50. package/dist/editor/editor.js +1 -32
  51. package/dist/editor/index.js +97 -0
  52. package/dist/editor/markdown-editor.js +323 -0
  53. package/dist/editor/plain-markdown-editor.js +5 -4
  54. package/dist/editor/rich-markdown-editor.js +70 -149
  55. package/dist/editor/simple-editor.js +44 -78
  56. package/dist/{css/richeditor → example/assets/css}/comments-list.css +0 -45
  57. package/dist/{css/richeditor → example/assets/css}/detail-list-view.css +0 -0
  58. package/dist/{css/richeditor → example/assets/css}/participants-list.css +0 -0
  59. package/dist/{css → example/assets/css}/react-mentions-default-style.js +0 -0
  60. package/dist/example/assets/css/seafile-editor-main.css +125 -0
  61. package/dist/example/assets/css/seafile-editor-side.css +89 -0
  62. package/dist/example/assets/css/side-panel.css +81 -0
  63. package/dist/{components → example/components}/comment-panel.js +12 -6
  64. package/dist/{components → example/components}/detail-list-view.js +1 -1
  65. package/dist/{components → example/components}/participants-list.js +1 -1
  66. package/dist/{components → example/components}/side-panel.js +5 -7
  67. package/dist/example/seafile-editor.js +137 -0
  68. package/dist/index.js +9 -0
  69. package/dist/index.local.js +58 -0
  70. package/dist/pages/seafile-editor/index.js +38 -0
  71. package/dist/{editor → pages/seafile-editor}/seafile-editor.js +19 -35
  72. package/dist/{seafile-editor-chooser.js → pages/seafile-editor-chooser.js} +0 -0
  73. package/dist/{seafile-markdown-editor.js → pages/seafile-markdown-editor.js} +5 -5
  74. package/dist/{seafile-markdown-viewer.js → pages/seafile-markdown-viewer.js} +3 -3
  75. package/dist/{seafile-simple-editor.js → pages/seafile-simple-editor.js} +5 -2
  76. package/dist/viewer/diff-viewer.js +1 -1
  77. package/dist/viewer/markdown-viewer.js +14 -15
  78. package/dist/viewer/slate-viewer.js +9 -24
  79. package/dist/viewer/viewer-formula.js +1 -1
  80. package/package.json +6 -14
  81. package/public/locales/zh-CN/seafile-editor.json +15 -13
  82. package/dist/components/generate-share-link.js +0 -412
  83. package/dist/components/internal-link-dialog.js +0 -96
  84. package/dist/components/outline.js +0 -130
  85. package/dist/components/topbar-component/icon-button.js +0 -99
  86. package/dist/components/topbar-component/insert-file.js +0 -67
  87. package/dist/components/topbar-component/table-toolbar.js +0 -175
  88. package/dist/config-0.js +0 -15
  89. package/dist/css/layout.css +0 -111
  90. package/dist/css/markdown-viewer-slate/file-tags-list.css +0 -76
  91. package/dist/css/richeditor/rich-editor-main.css +0 -32
  92. package/dist/css/richeditor/side-panel.css +0 -183
@@ -0,0 +1,20 @@
1
+ import i18n from 'i18next';
2
+ import Backend from 'i18next-xhr-backend';
3
+ import LanguageDetector from 'i18next-browser-languagedetector';
4
+ import { initReactI18next } from 'react-i18next';
5
+ i18n.use(Backend).use(LanguageDetector).use(initReactI18next).init({
6
+ lng: 'zh-CN',
7
+ fallbackLng: 'en',
8
+ ns: ['seafile-editor'],
9
+ defaultNS: 'seafile-editor',
10
+ debug: false,
11
+ // console log if debug: true
12
+ interpolation: {
13
+ escapeValue: false // not needed for react!!
14
+
15
+ },
16
+ react: {
17
+ wait: true
18
+ }
19
+ });
20
+ export default i18n;
@@ -0,0 +1,50 @@
1
+ .seafile-editor-comment.comment-dialog {
2
+ width: 500px;
3
+ position: absolute;
4
+ top: 30%;
5
+ right: 0;
6
+ padding: 15px;
7
+ background-color: #fafafa;
8
+ border: 1px solid rgba(0,0,0,.2);
9
+ border-radius: .3rem;
10
+ box-shadow: 0 0 3px #ccc;
11
+ z-index: 1000;
12
+ }
13
+
14
+ .seafile-editor-comment.comment-dialog .comment-dialog-triangle {
15
+ position: absolute;
16
+ left: -5px;
17
+ top: 50%;
18
+ transform: rotate(45deg);
19
+ border: 1px solid rgba(0,0,0,.2);
20
+ border-top: none;
21
+ border-right: none;
22
+ width: 10px;
23
+ height: 10px;
24
+ background-color: #fafafa;
25
+ box-shadow: -1px 1px #ccc;
26
+ }
27
+
28
+ .seafile-editor-comment.comment-dialog textarea {
29
+ width: 100%;
30
+ min-height: 100px;
31
+ max-height: 300px;
32
+ padding: 5px;
33
+ background-color: #fff;
34
+ }
35
+
36
+ .seafile-editor-comment.comment-dialog .button-group .btn {
37
+ margin-right: 10px;
38
+ }
39
+
40
+ .seafile-editor-comment.comment-dialog .comment-dialog-quote {
41
+ margin-top: 10px;
42
+ max-height: 6rem;
43
+ overflow: auto;
44
+ padding-left: 1rem;
45
+ }
46
+
47
+ .seafile-editor-comment.comment-dialog .comment-dialog-quote ul,
48
+ .seafile-editor-comment.comment-dialog .comment-dialog-quote ol {
49
+ padding-left: 1rem;
50
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,43 @@
1
+ .issue-container {
2
+ width: 100%;
3
+ padding: 0 10px 10px 10px;
4
+ margin-top: -10px;
5
+ }
6
+
7
+ .issue-card {
8
+ background-color: #fff;
9
+ border: 1px solid rgba(0, 40, 100, 0.12);
10
+ border-radius: 5px;
11
+ padding-left: 5px;
12
+ margin-top: 10px;
13
+ position: relative;
14
+ word-break: break-word;
15
+ box-shadow: 0 5px 5px -2px rgba(200,200,200, 0.5);
16
+ }
17
+
18
+ .issue-card:before {
19
+ position: absolute;
20
+ left: 0;
21
+ top: 0;
22
+ bottom: 0;
23
+ width: 3px;
24
+ content: '';
25
+ background-color: rgb(217, 130, 43);
26
+ border-radius: 3px 0 0 3px;
27
+ }
28
+ .issue-card-title {
29
+ font-size: 16px;
30
+ padding: 5px 10px 3px 10px;
31
+ }
32
+
33
+ .issue-card-description {
34
+ padding: 0 10px 5px 10px;
35
+ color: #aaa;
36
+ }
37
+
38
+ .size-panel-no-content {
39
+ width: 100%;
40
+ text-align: center;
41
+ color: #9a9a9a;
42
+ padding-top: 10px;
43
+ }
File without changes
File without changes
File without changes
@@ -0,0 +1,29 @@
1
+ .seafile-editor-outline .outline-h2, .outline-h3 {
2
+ white-space: nowrap;
3
+ overflow: hidden;
4
+ text-overflow: ellipsis;
5
+ }
6
+
7
+ .seafile-editor-outline .outline-h2 {
8
+ margin-left: 20px;
9
+ line-height: 2.5;
10
+ color:#364149;
11
+ white-space: nowrap;
12
+ cursor:pointer;
13
+ }
14
+
15
+ .seafile-editor-outline .outline-h2:hover {
16
+ color: #eb8205;
17
+ }
18
+
19
+ .seafile-editor-outline .outline-h3 {
20
+ margin-left: 40px;
21
+ line-height: 2.5;
22
+ color:#364149;
23
+ white-space: nowrap;
24
+ cursor:pointer;
25
+ }
26
+
27
+ .seafile-editor-outline .outline-h3:hover {
28
+ color: #eb8205;
29
+ }
File without changes
@@ -24,6 +24,25 @@
24
24
  margin-right: 6px;
25
25
  }
26
26
 
27
+ .sf-editor-toolbar {
28
+ height: 39px;
29
+ background-color: #fcfcfc;
30
+ }
31
+
32
+ .sf-editor-toolbar .iconfont {
33
+ font-size: 13px;
34
+ }
35
+
36
+ .sf-editor-toolbar .icon-drop-down {
37
+ display: inline-block;
38
+ transform: scale(0.8);
39
+ }
40
+
41
+ .sf-editor-toolbar .icon-caret-up {
42
+ display: inline-block;
43
+ transform: scale(0.8);
44
+ }
45
+
27
46
  .seafile-btn-group div button {
28
47
  border: none;
29
48
  }
@@ -205,14 +224,6 @@
205
224
  font-weight: 900;
206
225
  }
207
226
 
208
- .seafile-rich-editor-topbar .editor-btn-group {
209
- height: 100%;
210
- padding: 5px 0 5px 5px;
211
- font-size: 0.75rem;
212
- border-right: 1px solid #e5e5e5;
213
- color: #555555;
214
- }
215
-
216
227
  .header-list-container {
217
228
  height: 39px;
218
229
  border-right: 1px solid #e5e5e5;
@@ -425,28 +436,3 @@ p.tip {
425
436
  margin-left: 10px;
426
437
  }
427
438
  }
428
-
429
- .sf-editor-rich-menu {
430
- height: 39px;
431
- background-color: #fcfcfc;
432
- }
433
-
434
- .seafile-simple-editor {
435
- height: 100%;
436
- min-width: 768px;
437
- display: flex;
438
- flex-direction: column;
439
- overflow: hidden;
440
- border: 1px solid #e5e5e5;
441
- }
442
-
443
- .seafile-simple-editor .editor {
444
- margin: 0;
445
- padding: 10px;
446
- height: 100%;
447
- border: none;
448
- }
449
-
450
- .seafile-simple-editor .header-list-container {
451
- border-left: 0;
452
- }
@@ -25,16 +25,16 @@
25
25
  margin-bottom: 0;
26
26
  }
27
27
 
28
- .help-close {
28
+ .seafile-editor-help .help-close {
29
29
  font-weight: normal;
30
30
  color: #b9b9b9;
31
31
  }
32
32
 
33
- .help-close:hover {
33
+ .seafile-editor-help .help-close:hover {
34
34
  color: #888;
35
35
  }
36
36
 
37
- .help-content {
37
+ .seafile-editor-help .help-content {
38
38
  height: calc(100% - 50px);
39
39
  overflow-y: auto;
40
40
  padding: 0 15px;
@@ -42,7 +42,7 @@
42
42
  font-size: 0.8rem;
43
43
  }
44
44
 
45
- .help-shortcut {
45
+ .seafile-editor-help .help-shortcut {
46
46
  display: flex;
47
47
  border-bottom: 1px solid #eee;
48
48
  justify-content: space-between;
@@ -50,12 +50,12 @@
50
50
  padding: 10px 0;
51
51
  }
52
52
 
53
- .help-shortcut-left {
53
+ .seafile-editor-help .help-shortcut-left {
54
54
  word-break: break-all;
55
55
  line-height: 30px;
56
56
  }
57
57
 
58
- .help-content .help-shortcut-type {
58
+ .seafile-editor-help .help-content .help-shortcut-type {
59
59
  border-bottom: 1px solid #eee;
60
60
  /*height: 50px;*/
61
61
  line-height: 2;
@@ -63,7 +63,7 @@
63
63
  margin: 10px 0 0 0;
64
64
  }
65
65
 
66
- .help-shortcut .key {
66
+ .seafile-editor-help .help-shortcut .key {
67
67
  display: inline-block;
68
68
  border-radius: 3px;
69
69
  background-color: #e8e8e8;
@@ -75,10 +75,10 @@
75
75
  line-height: 20px;
76
76
  }
77
77
 
78
- .help-shortcut-right {
78
+ .seafile-editor-help .help-shortcut-right {
79
79
  min-width: max-content;
80
80
  }
81
81
 
82
- .help-shortcut-right-container:not(:first-child) {
82
+ .seafile-editor-help .help-shortcut-right-container:not(:first-child) {
83
83
  margin-top: 10px;
84
84
  }
@@ -0,0 +1,30 @@
1
+ .plain-editor {
2
+ flex: 1;
3
+ display: flex;
4
+ min-height: 0;
5
+ min-width: 0;
6
+ position: relative;
7
+ }
8
+
9
+ /* fix plain editor main height */
10
+ .plain-editor-main {
11
+ position: absolute;
12
+ inset: 0;
13
+ }
14
+
15
+ .plain-editor-left-panel {
16
+ height: 100%;
17
+ width: 50%;
18
+ background-color: #fff;
19
+ border-right: 1px solid rgb(230,230,221);
20
+ overflow-y: scroll;
21
+ overflow-x: hidden;
22
+ }
23
+
24
+ .plain-editor-right-panel {
25
+ height: 100%;
26
+ width: 50%;
27
+ background-color: rgb(250,250,249);
28
+ overflow-y: scroll;
29
+ overflow-x: hidden;
30
+ }
@@ -0,0 +1,104 @@
1
+ .seafile-editor {
2
+ position: fixed;
3
+ width: 100%;
4
+ height: 100%;
5
+ min-width: 960px;
6
+ }
7
+
8
+ .seafile-editor-topbar {
9
+ width: 100%;
10
+ background-color: #fff;
11
+ border-bottom: 1px solid #e5e5e5;
12
+ box-shadow: 0 3px 2px -2px rgba(200,200,200,.15);
13
+ user-select: none;
14
+ position: relative;
15
+ z-index: 3;
16
+ display: flex;
17
+ justify-content: space-between;
18
+ }
19
+
20
+ .seafile-editor-topbar .use-help-icon {
21
+ background-color: #fff;
22
+ box-sizing: border-box;
23
+ }
24
+
25
+ .seafile-editor-topbar .editor-btn-group {
26
+ height: 100%;
27
+ padding: 5px 0 5px 5px;
28
+ font-size: 0.75rem;
29
+ border-right: 1px solid #e5e5e5;
30
+ color: #555555;
31
+ }
32
+
33
+ .seafile-editor-main {
34
+ height: calc(100% - 96px);
35
+ width: 100%;
36
+ }
37
+
38
+ .seafile-editor-main-panel {
39
+ height: 100%;
40
+ background-color: rgb(250,250,249);
41
+ overflow-x: hidden;
42
+ display: flex;
43
+ flex: 0 0 1;
44
+ position: relative;
45
+ }
46
+
47
+ .seafile-editor-side-panel {
48
+ width: 300px;
49
+ height: 100%;
50
+ background-color: #fff;
51
+ border-left: 1px solid rgb(230,230,221);
52
+ position: relative;
53
+ }
54
+
55
+ /*set scroll bar*/
56
+ .seafile-rich-editor ::-webkit-scrollbar{
57
+ width: 8px;
58
+ height: 8px;
59
+ }
60
+
61
+ .seafile-rich-editor ::-webkit-scrollbar-button {
62
+ display: none;
63
+ }
64
+
65
+ .seafile-rich-editor ::-webkit-scrollbar-thumb {
66
+ background-color: rgb(206, 206, 212);
67
+ border-radius: 10px;
68
+ }
69
+
70
+ .seafile-editor-all-panel .editor-container .article {
71
+ margin: 20px auto;
72
+ max-width: 950px;
73
+ }
74
+
75
+ @media (max-width: 991.8px) {
76
+ .seafile-editor {
77
+ min-width: calc(100% - 40px);
78
+ }
79
+
80
+ .seafile-editor-main-panel {
81
+ width: calc(100% - 200px);
82
+ }
83
+
84
+ .seafile-editor-side-panel {
85
+ min-width: 200px;
86
+ }
87
+
88
+ .editor-container {
89
+ width: 100%;
90
+ }
91
+
92
+ .editor-container .editor {
93
+ margin: 20px !important;
94
+ padding: 20px 30px;
95
+ }
96
+ }
97
+
98
+ @media (max-width: 768px) {
99
+ .editor-container .editor {
100
+ margin: 0 !important;
101
+ padding: 10px 15px;
102
+ border: 0;
103
+ }
104
+ }
@@ -0,0 +1,77 @@
1
+ .seafile-simple-editor {
2
+ flex: 1;
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ min-width: 768px;
7
+ overflow: hidden;
8
+ border: 1px solid #e5e5e5;
9
+ }
10
+
11
+ .seafile-simple-editor .seafile-editor-topbar {
12
+ width: 100%;
13
+ background-color: #fff;
14
+ border-bottom: 1px solid #e5e5e5;
15
+ box-shadow: 0 3px 2px -2px rgba(200,200,200,.15);
16
+ user-select: none;
17
+ position: relative;
18
+ z-index: 3;
19
+ display: flex;
20
+ justify-content: space-between;
21
+ }
22
+
23
+ .seafile-simple-editor .seafile-editor-topbar .use-help-icon {
24
+ background-color: #fff;
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ .seafile-simple-editor .seafile-editor-topbar .editor-btn-group {
29
+ height: 100%;
30
+ padding: 5px 0 5px 5px;
31
+ font-size: 0.75rem;
32
+ border-right: 1px solid #e5e5e5;
33
+ color: #555555;
34
+ }
35
+
36
+ .seafile-simple-editor .header-list-container {
37
+ border-left: 0;
38
+ }
39
+
40
+ .seafile-simple-editor .editor {
41
+ margin: 0;
42
+ padding: 10px;
43
+ height: 100%;
44
+ border: none;
45
+ }
46
+
47
+ /*set scroll bar*/
48
+ .seafile-simple-editor ::-webkit-scrollbar{
49
+ width: 8px;
50
+ height: 8px;
51
+ }
52
+
53
+ .seafile-simple-editor ::-webkit-scrollbar-button {
54
+ display: none;
55
+ }
56
+
57
+ .seafile-simple-editor ::-webkit-scrollbar-thumb {
58
+ background-color: rgb(206, 206, 212);
59
+ border-radius: 10px;
60
+ }
61
+
62
+ .editor-container {
63
+ /* this container is needed to show the scroll bar */
64
+ height: 100%;
65
+ overflow-y: auto;
66
+ flex: 1 1 auto;
67
+ position: relative;
68
+ }
69
+
70
+ .editor {
71
+ min-height: calc(100% - 40px);
72
+ background: #fff;
73
+ padding: 40px 60px;
74
+ margin: 20px 40px;
75
+ border: 1px solid rgb(230,230,221);
76
+ overflow-x: hidden;
77
+ }
@@ -6,7 +6,7 @@ import React, { Fragment } from 'react';
6
6
  import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Input } from 'reactstrap';
7
7
  import { withTranslation } from 'react-i18next';
8
8
  import { Editor } from 'slate';
9
- import { EditorUtils } from '../editor/editor-utils/common-editor-utils';
9
+ import EditorBuilder from '../editor/editor-builder';
10
10
 
11
11
  var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
12
12
  _inherits(AddFormulaDialog, _React$PureComponent);
@@ -21,7 +21,8 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
21
21
  _this = _super.call(this, props);
22
22
 
23
23
  _this.setInitialValue = function () {
24
- var nodes = Editor.match(window.editor, window.editor.selection, {
24
+ var editor = EditorBuilder.getEditor();
25
+ var nodes = Editor.match(editor, editor.selection, {
25
26
  type: 'formula'
26
27
  });
27
28
 
@@ -70,7 +71,7 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
70
71
  _this.props.toggleFormulaDialog();
71
72
  };
72
73
 
73
- _this.editorUtils = new EditorUtils(window.editor);
74
+ _this.editorUtils = EditorBuilder.getEditorUtils();
74
75
  _this.state = {
75
76
  formula: ''
76
77
  };
@@ -82,7 +83,8 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
82
83
  _createClass(AddFormulaDialog, [{
83
84
  key: "componentDidMount",
84
85
  value: function componentDidMount() {
85
- this.editorSelection = window.editor.selection;
86
+ var editor = EditorBuilder.getEditor();
87
+ this.editorSelection = editor.selection;
86
88
 
87
89
  if (this.formulaNode) {
88
90
  this.renderFormula(this.state.formula);
@@ -5,6 +5,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input } from 'reactstrap';
7
7
  import { withTranslation } from 'react-i18next';
8
+ import EditorBuilder from '../editor/editor-builder';
8
9
 
9
10
  var AddImageDialog = /*#__PURE__*/function (_React$PureComponent) {
10
11
  _inherits(AddImageDialog, _React$PureComponent);
@@ -43,7 +44,8 @@ var AddImageDialog = /*#__PURE__*/function (_React$PureComponent) {
43
44
  _createClass(AddImageDialog, [{
44
45
  key: "componentDidMount",
45
46
  value: function componentDidMount() {
46
- this.editorSelection = window.editor.selection;
47
+ var editor = EditorBuilder.getEditor();
48
+ this.editorSelection = editor.selection;
47
49
  }
48
50
  }, {
49
51
  key: "render",
@@ -5,7 +5,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React, { Fragment } from 'react';
6
6
  import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
7
7
  import { withTranslation } from 'react-i18next';
8
- import { EditorUtils } from '../editor/editor-utils/common-editor-utils';
8
+ import EditorBuilder from '../editor/editor-builder';
9
9
 
10
10
  var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
11
11
  _inherits(AddLinkDialog, _React$PureComponent);
@@ -76,7 +76,7 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
76
76
  }
77
77
  };
78
78
 
79
- _this.editorUtils = new EditorUtils(window.editor);
79
+ _this.editorUtils = EditorBuilder.getEditorUtils();
80
80
  _this.isLinkActive = _this.editorUtils.isLinkActive();
81
81
  _this.editorSelection = null;
82
82
  _this.state = {
@@ -89,7 +89,8 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
89
89
  _createClass(AddLinkDialog, [{
90
90
  key: "componentDidMount",
91
91
  value: function componentDidMount() {
92
- this.editorSelection = window.editor.selection;
92
+ var editor = EditorBuilder.getEditor();
93
+ this.editorSelection = editor.selection;
93
94
  }
94
95
  }, {
95
96
  key: "componentWillMount",
@@ -3,8 +3,10 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
+ import { withTranslation } from 'react-i18next';
6
7
  import { Button } from 'reactstrap';
7
8
  import { processor } from '../utils/seafile-markdown2html';
9
+ import '../assets/css/comment-dialog.css';
8
10
 
9
11
  var CommentDialog = /*#__PURE__*/function (_React$Component) {
10
12
  _inherits(CommentDialog, _React$Component);
@@ -74,16 +76,20 @@ var CommentDialog = /*#__PURE__*/function (_React$Component) {
74
76
  }, {
75
77
  key: "render",
76
78
  value: function render() {
79
+ var t = this.props.t;
80
+ var _this$state = this.state,
81
+ comment = _this$state.comment,
82
+ quote = _this$state.quote;
77
83
  return /*#__PURE__*/React.createElement("div", {
78
- className: "comment-dialog"
84
+ className: "seafile-editor-comment comment-dialog"
79
85
  }, /*#__PURE__*/React.createElement("div", null, this.props.editorApi.name), /*#__PURE__*/React.createElement("blockquote", {
80
86
  className: "comment-dialog-quote"
81
87
  }, /*#__PURE__*/React.createElement("div", {
82
88
  dangerouslySetInnerHTML: {
83
- __html: this.state.quote
89
+ __html: quote
84
90
  }
85
91
  })), /*#__PURE__*/React.createElement("textarea", {
86
- value: this.state.comment,
92
+ value: comment,
87
93
  onChange: this.handleCommentChange
88
94
  }), /*#__PURE__*/React.createElement("div", {
89
95
  className: "button-group"
@@ -91,11 +97,11 @@ var CommentDialog = /*#__PURE__*/function (_React$Component) {
91
97
  size: "sm",
92
98
  color: "primary",
93
99
  onClick: this.submitComment
94
- }, this.props.t('submit')), /*#__PURE__*/React.createElement(Button, {
100
+ }, t('submit')), /*#__PURE__*/React.createElement(Button, {
95
101
  size: "sm",
96
102
  color: "secondary",
97
103
  onClick: this.props.toggleCommentDialog
98
- }, this.props.t('cancel'))), /*#__PURE__*/React.createElement("span", {
104
+ }, t('cancel'))), /*#__PURE__*/React.createElement("span", {
99
105
  className: "comment-dialog-triangle"
100
106
  }));
101
107
  }
@@ -104,4 +110,4 @@ var CommentDialog = /*#__PURE__*/function (_React$Component) {
104
110
  return CommentDialog;
105
111
  }(React.Component);
106
112
 
107
- export default CommentDialog;
113
+ export default withTranslation('seafile-editor')(CommentDialog);
@@ -3,6 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
+ import '../assets/css/issue-card.css';
6
7
 
7
8
  var MarkdownLint = /*#__PURE__*/function (_React$PureComponent) {
8
9
  _inherits(MarkdownLint, _React$PureComponent);