@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
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,11 +58,8 @@ 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
- var _this$props$editorApi = this.props.editorApi,
68
- filePath = _this$props$editorApi.filePath,
69
- serviceUrl = _this$props$editorApi.serviceUrl;
62
+ var filePath = this.props.editorApi.filePath;
70
63
  return /*#__PURE__*/React.createElement("div", {
71
64
  className: "dirent-table-container"
72
65
  }, /*#__PURE__*/React.createElement("table", {
@@ -95,20 +88,6 @@ var DetailListView = /*#__PURE__*/function (_React$Component) {
95
88
  })), /*#__PURE__*/React.createElement("i", {
96
89
  className: "iconfont icon-pencil attr-action-icon",
97
90
  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
91
  }))), this.props.participants && window.showParticipants && /*#__PURE__*/React.createElement("tr", {
113
92
  className: "file-participants"
114
93
  }, /*#__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
@@ -199,7 +199,17 @@ var ToolBar = /*#__PURE__*/function (_React$Component) {
199
199
  onInsertRow: this.editorUtils.onInsertRow,
200
200
  onRemoveRow: this.editorUtils.onRemoveRow,
201
201
  onSetAlign: this.editorUtils.onSetAlign
202
- })), this.props.hasSidePanel && /*#__PURE__*/React.createElement("div", {
202
+ }), /*#__PURE__*/React.createElement(ButtonGroup, {
203
+ className: 'editor-btn-group'
204
+ }, /*#__PURE__*/React.createElement(IconButton, {
205
+ className: 'editor-clear-format',
206
+ isRichEditor: true,
207
+ text: t('Clear_format'),
208
+ id: 'clearButton',
209
+ icon: 'iconfont icon-clear-format',
210
+ onMouseDown: this.editorUtils.clearFormat,
211
+ isActive: readOnly
212
+ }))), this.props.hasSidePanel && /*#__PURE__*/React.createElement("div", {
203
213
  className: "button-container"
204
214
  }, !this.props.isShowSidePanel && /*#__PURE__*/React.createElement(ButtonGroup, {
205
215
  className: "editor-btn-group position-absolute dropdown-menu-right"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -102,4 +102,4 @@
102
102
  .article .diff-replaced .new-paragraph {
103
103
  background-color: #e6ffed;
104
104
  margin-top: 0;
105
- }
105
+ }
File without changes
@@ -1,9 +1,9 @@
1
1
  .keyboard-shortcut-dialog {
2
- max-width: 600px;
2
+ max-width: 500px;
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
@@ -73,4 +73,4 @@
73
73
  .sf-files-tag .file-tag-name {
74
74
  margin-left: 5px;
75
75
  white-space: nowrap;
76
- }
76
+ }
@@ -66,4 +66,4 @@
66
66
  .seafile-md-viewer-content {
67
67
  padding: 20px;
68
68
  }
69
- }
69
+ }
File without changes
File without changes
@@ -181,4 +181,4 @@
181
181
  .comment-dialog .comment-dialog-quote ul,
182
182
  .comment-dialog .comment-dialog-quote ol {
183
183
  padding-left: 1rem;
184
- }
184
+ }
File without changes
@@ -54,4 +54,4 @@
54
54
 
55
55
  .seafile-editor-module .rc-calendar-table tr {
56
56
  height: 1.75rem;
57
- }
57
+ }
@@ -16,4 +16,4 @@
16
16
  border: 2px dashed #ebebeb;
17
17
  min-height: 40px;
18
18
  overflow-x: auto;
19
- }
19
+ }
@@ -3,9 +3,11 @@
3
3
  display: inline-block;
4
4
  max-width: 100%;
5
5
  }
6
+
6
7
  .seafile-ed-image .seafile-ed-image-inResizing {
7
8
  box-shadow: 0 0 0 2px #007bff;
8
9
  }
10
+
9
11
  .seafile-ed-image .image-resizer {
10
12
  width: 10px;
11
13
  height: 10px;
@@ -17,6 +19,7 @@
17
19
  border: 1px solid #fff;
18
20
  cursor: se-resize;
19
21
  }
22
+
20
23
  .image-size {
21
24
  display: inline-block;
22
25
  padding: 5px;
@@ -99,40 +102,33 @@
99
102
  }
100
103
 
101
104
  /* set button font style in image previewer */
105
+ .sf-editor-image-previewer button.dtable-icon-fork-number,
106
+ .sf-editor-image-previewer .dtable-icon-right,
102
107
  .sf-editor-image-previewer .dtable-icon-left {
103
108
  font-family: "iconfont" !important;
104
- font-size: 16px;
105
109
  font-style: normal;
106
110
  -webkit-font-smoothing: antialiased;
107
111
  -moz-osx-font-smoothing: grayscale;
108
112
  }
109
113
 
110
- .sf-editor-image-previewer .dtable-icon-left:before {
111
- content: "\e756";
112
- }
113
-
114
- .sf-editor-image-previewer .dtable-icon-right {
115
- font-family: "iconfont" !important;
114
+ .sf-editor-image-previewer button.dtable-icon-fork-number {
116
115
  font-size: 16px;
117
- font-style: normal;
118
- -webkit-font-smoothing: antialiased;
119
- -moz-osx-font-smoothing: grayscale;
120
116
  line-height: normal;
121
117
  }
122
118
 
123
- .sf-editor-image-previewer .dtable-icon-right:before {
124
- content: "\e755";
119
+ .sf-editor-image-previewer .dtable-icon-left:before {
120
+ content: "\e756";
125
121
  }
126
122
 
127
- .sf-editor-image-previewer button.dtable-icon-fork-number {
128
- font-family: "iconfont" !important;
129
- font-size: 16px;
130
- font-style: normal;
131
- -webkit-font-smoothing: antialiased;
132
- -moz-osx-font-smoothing: grayscale;
133
- line-height: normal;
123
+ .sf-editor-image-previewer .dtable-icon-right:before {
124
+ content: "\e755";
134
125
  }
135
126
 
136
127
  .sf-editor-image-previewer .dtable-icon-fork-number:before {
137
128
  content: "\e6ce";
138
129
  }
130
+
131
+ .sf-editor-image-previewer.ril__outer .ril__navButtonPrev.dtable-font,
132
+ .sf-editor-image-previewer.ril__outer .ril__navButtonNext.dtable-font {
133
+ padding: 40px 30px 80px;
134
+ }
@@ -4,4 +4,4 @@
4
4
 
5
5
  .article .virtual-link:hover {
6
6
  text-decoration: underline;
7
- }
7
+ }
@@ -36,6 +36,10 @@
36
36
  padding: 0;
37
37
  }
38
38
 
39
+ .editor-btn-group .editor-clear-format {
40
+ margin-right: 5px;
41
+ }
42
+
39
43
  .insert-file {
40
44
  position: relative;
41
45
  display: inline-block;
@@ -76,4 +80,4 @@
76
80
  .rich-menu .side-panel-btn {
77
81
  display: block;
78
82
  }
79
- }
83
+ }
@@ -19,4 +19,4 @@
19
19
  }
20
20
  .participants .participant-avatar, .participants .add-participants {
21
21
  margin-right: -0.5rem;
22
- }
22
+ }
@@ -39,4 +39,4 @@
39
39
  flex: 1, 1, auto;
40
40
  height: 100%;
41
41
  margin: 0 auto;
42
- }
42
+ }
@@ -81,4 +81,4 @@
81
81
 
82
82
  .help-shortcut-right-container:not(:first-child) {
83
83
  margin-top: 10px;
84
- }
84
+ }
File without changes
@@ -54,4 +54,4 @@
54
54
  margin: -1px;
55
55
  border-right: 1px double #ffa94d;
56
56
  z-index: 2;
57
- }
57
+ }
File without changes
@@ -64,4 +64,4 @@
64
64
 
65
65
  .seafile-editor-module .folder-toggle-icon.folder-caret-right {
66
66
  left: -2.5px;
67
- }
67
+ }
@@ -449,4 +449,4 @@ p.tip {
449
449
 
450
450
  .seafile-simple-editor .header-list-container {
451
451
  border-left: 0;
452
- }
452
+ }
File without changes
@@ -1,7 +1,7 @@
1
1
  import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
- import { Editor, Path, Node } from 'slate';
4
+ import { Editor, Path } from 'slate';
5
5
  import ListUtils from '../editor-utils/block-element-utils/list-utils';
6
6
  import CodeUtils from '../editor-utils/block-element-utils/code-utils';
7
7
  import { isRangeCollapsed } from '../editor-utils/range-utils';
@@ -8,6 +8,7 @@ import CodeUtils from '../editor-utils/block-element-utils/code-utils';
8
8
  import TextUtils from '../editor-utils/text-utils';
9
9
  import TableUtils from '../editor-utils/block-element-utils/table-utils';
10
10
  import BlockquoteUtils from '../editor-utils/block-element-utils/blockquote-utils';
11
+ import { clearBlockFormat, clearMarkerFormat } from '../editor-utils/clear-format-utils';
11
12
  var SHORTCUTS = {
12
13
  '1.': 'ordered_list',
13
14
  '*': 'unordered_list',
@@ -409,6 +410,11 @@ var withMarkdownShortcut = function withMarkdownShortcut(editor) {
409
410
  });
410
411
  return;
411
412
 
413
+ case 'clear_format':
414
+ clearBlockFormat(editor);
415
+ clearMarkerFormat(editor);
416
+ return;
417
+
412
418
  default:
413
419
  exec(command);
414
420
  }
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
@@ -233,13 +233,13 @@ var ImagePreviewer = /*#__PURE__*/function (_React$Component2) {
233
233
  _createClass(ImagePreviewer, [{
234
234
  key: "render",
235
235
  value: function render() {
236
- var imageUrl = this.props.imageUrl;
237
236
  var imageIndex = this.state.imageIndex;
238
237
  var imageItemsLength = this.images.length;
238
+ var mainSrc = this.images[imageIndex];
239
239
  var imageTitle = '';
240
240
 
241
241
  try {
242
- imageTitle = imageUrl ? decodeURI(imageUrl.slice(imageUrl.lastIndexOf('/') + 1)) : '';
242
+ imageTitle = mainSrc ? decodeURI(mainSrc.slice(mainSrc.lastIndexOf('/') + 1)) : '';
243
243
  } catch (error) {
244
244
  // eslint-disable-next-line no-console
245
245
  console.log(error);
@@ -252,7 +252,6 @@ var ImagePreviewer = /*#__PURE__*/function (_React$Component2) {
252
252
  }, imageTitle), /*#__PURE__*/React.createElement("span", {
253
253
  className: "flex-shrink-0"
254
254
  }, "(", imageIndex + 1, "/", this.images.length, ")"));
255
- var mainSrc = this.images[imageIndex];
256
255
  return /*#__PURE__*/React.createElement(Lightbox, {
257
256
  wrapperClassName: "sf-editor-image-previewer",
258
257
  imageTitle: imageTitleEl,
File without changes
File without changes
@@ -0,0 +1,94 @@
1
+ import { Editor, Path, Node } from 'slate';
2
+
3
+ var removeEmptyParentNode = function removeEmptyParentNode(editor, pathRef) {
4
+ var path = pathRef.current;
5
+ var currentNode = Node.get(editor, path);
6
+ var children = currentNode.children;
7
+
8
+ while ((children.length === 0 || children.length === 1 && children[0].text === '') && currentNode.type) {
9
+ Editor.removeNodes(editor, {
10
+ at: path
11
+ });
12
+ path = Path.parent(path);
13
+ currentNode = Node.get(editor, path);
14
+ children = currentNode.children;
15
+ }
16
+
17
+ pathRef.unref();
18
+ };
19
+
20
+ var clearBlockFormat = function clearBlockFormat(editor) {
21
+ // get selected block node, like the paragraphs in the blockquote;
22
+ var nodes = Editor.nodes(editor, {
23
+ match: 'block',
24
+ voids: false
25
+ });
26
+ var nodesList = [];
27
+ var pathRefs = Array.from(nodes, function (item) {
28
+ nodesList.push(item);
29
+ return Editor.pathRef(editor, item[1]);
30
+ });
31
+ var firstNode = nodesList[0],
32
+ firstNodeRef = pathRefs[0];
33
+ nodesList.shift();
34
+ pathRefs.shift(); // move first block to outest and set the block to paragraph
35
+
36
+ while (firstNodeRef.current.length > 1) {
37
+ Editor.liftNodes(editor, {
38
+ at: firstNodeRef.current
39
+ });
40
+ }
41
+
42
+ if (firstNode[0].type !== 'paragraph') {
43
+ Editor.setNodes(editor, {
44
+ type: 'paragraph',
45
+ at: firstNodeRef.current,
46
+ split: true
47
+ });
48
+ }
49
+
50
+ nodesList.forEach(function (item, index) {
51
+ var toPath = index === 0 ? Path.next(firstNodeRef.current) : Path.next(pathRefs[index - 1].current);
52
+ var currentPath = pathRefs[index].current;
53
+
54
+ if (currentPath.length > 1) {
55
+ var parentPath = Path.parent(currentPath);
56
+ var parentRef = Editor.pathRef(editor, parentPath); // move current node to outest
57
+
58
+ Editor.moveNodes(editor, {
59
+ at: currentPath,
60
+ to: toPath
61
+ }); // remove empty parent node
62
+
63
+ removeEmptyParentNode(editor, parentRef);
64
+ } // set current block node to paragraph
65
+
66
+
67
+ if (item[0].type !== 'paragraph') {
68
+ Editor.setNodes(editor, {
69
+ type: 'paragraph',
70
+ at: currentPath,
71
+ split: true
72
+ });
73
+ }
74
+ });
75
+ firstNodeRef.unref();
76
+ pathRefs.forEach(function (ref) {
77
+ return ref.unref();
78
+ });
79
+ };
80
+
81
+ var clearMarkerFormat = function clearMarkerFormat(editor) {
82
+ // clear all markers of selected texts;
83
+ var textProperties = {
84
+ BOLD: false,
85
+ ITALIC: false,
86
+ CODE: false
87
+ };
88
+ editor.exec({
89
+ type: 'format_text',
90
+ properties: textProperties
91
+ });
92
+ };
93
+
94
+ export { clearBlockFormat, clearMarkerFormat };
@@ -343,7 +343,7 @@ var EditorUtils = /*#__PURE__*/function () {
343
343
 
344
344
  if (listAncesstor.type && listAncesstor.type.includes('list')) {
345
345
  _this.editor.exec({
346
- type: "modify_sublist_type",
346
+ type: 'modify_sublist_type',
347
347
  target_list_type: type
348
348
  });
349
349
 
@@ -366,6 +366,14 @@ var EditorUtils = /*#__PURE__*/function () {
366
366
  }
367
367
  };
368
368
 
369
+ this.clearFormat = function (event) {
370
+ event.preventDefault();
371
+
372
+ _this.editor.exec({
373
+ type: 'clear_format'
374
+ });
375
+ };
376
+
369
377
  this.unwrapLink = function () {
370
378
  _this.inlineElementUtils.unwrapLink();
371
379
  };
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,