@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.
- package/dist/components/add-formula-dialog.js +0 -0
- package/dist/components/add-image-dialog.js +0 -0
- package/dist/components/add-link-dialog.js +0 -0
- package/dist/components/click-outside.js +0 -0
- package/dist/components/comment-dialog.js +0 -0
- package/dist/components/context-menu.js +0 -0
- package/dist/components/detail-list-view.js +1 -22
- package/dist/components/generate-share-link.js +0 -0
- package/dist/components/internal-link-dialog.js +0 -0
- package/dist/components/loading.js +0 -0
- package/dist/components/markdown-lint.js +0 -0
- package/dist/components/modal-portal.js +0 -0
- package/dist/components/outline.js +0 -0
- package/dist/components/participants-list.js +0 -0
- package/dist/components/shortcut-dialog.js +0 -0
- package/dist/components/side-panel.js +0 -1
- package/dist/components/table-button.js +0 -0
- package/dist/components/toast/alert.js +0 -0
- package/dist/components/toast/index.js +0 -0
- package/dist/components/toast/toast.js +0 -0
- package/dist/components/toast/toastManager.js +0 -0
- package/dist/components/toast/toaster.js +0 -0
- package/dist/components/toolbar.js +11 -1
- package/dist/components/topbar-component/button-group.js +0 -0
- package/dist/components/topbar-component/editor-toolbar.js +0 -0
- package/dist/components/topbar-component/header-list.js +0 -0
- package/dist/components/topbar-component/icon-button.js +0 -0
- package/dist/components/topbar-component/insert-file.js +0 -0
- package/dist/components/topbar-component/table-toolbar.js +0 -0
- package/dist/components/topbar-component/upload-img.js +0 -0
- package/dist/components/user-help.js +0 -0
- package/dist/css/diff-viewer.css +1 -1
- package/dist/css/history-viewer.css +0 -0
- package/dist/css/keyboard-shortcuts.css +2 -2
- package/dist/css/layout.css +0 -0
- package/dist/css/markdown-viewer-slate/file-tags-list.css +1 -1
- package/dist/css/markdown-viewer.css +1 -1
- package/dist/css/plaineditor/markdown-editor.css +0 -0
- package/dist/css/react-mentions-default-style.js +0 -0
- package/dist/css/richeditor/comments-list.css +1 -1
- package/dist/css/richeditor/detail-list-view.css +0 -0
- package/dist/css/richeditor/document-info.css +1 -1
- package/dist/css/richeditor/formula.css +1 -1
- package/dist/css/richeditor/image.css +15 -19
- package/dist/css/richeditor/link.css +1 -1
- package/dist/css/richeditor/navbar-imgbutton.css +5 -1
- package/dist/css/richeditor/participants-list.css +1 -1
- package/dist/css/richeditor/rich-editor-main.css +1 -1
- package/dist/css/richeditor/right-panel.css +1 -1
- package/dist/css/richeditor/side-panel.css +0 -0
- package/dist/css/richeditor/table.css +1 -1
- package/dist/css/richeditor/textlink-hovermenu.css +0 -0
- package/dist/css/richeditor/tree-view.css +1 -1
- package/dist/css/topbar.css +1 -1
- package/dist/editor/code-highlight-package.js +0 -0
- package/dist/editor/controller/block-element-controller.js +1 -1
- package/dist/editor/controller/inline-element-controller.js +0 -0
- package/dist/editor/controller/shortcut-controller.js +6 -0
- package/dist/editor/controller/void-element-controller.js +0 -0
- package/dist/editor/custom/get-event-transfer.js +0 -0
- package/dist/editor/custom/getNodesByTypeAtRange.js +0 -0
- package/dist/editor/custom/insertNodes.js +0 -0
- package/dist/editor/custom/is-empty-paragraph.js +0 -0
- package/dist/editor/custom/set-event-transfer.js +0 -0
- package/dist/editor/custom/split-nodes-at-point.js +0 -0
- package/dist/editor/custom/unwrap-node-by-type-at-range.js +0 -0
- package/dist/editor/editor-component/check-list-item.js +0 -0
- package/dist/editor/editor-component/code-block.js +0 -0
- package/dist/editor/editor-component/formula.js +0 -0
- package/dist/editor/editor-component/image.js +2 -3
- package/dist/editor/editor-component/link.js +0 -0
- package/dist/editor/editor-component/table.js +0 -0
- package/dist/editor/editor-component/textlink-hovermenu.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/blockquote-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/code-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/formula-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/index.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/list-utils.js +0 -0
- package/dist/editor/editor-utils/block-element-utils/table-utils.js +0 -0
- package/dist/editor/editor-utils/clear-format-utils.js +94 -0
- package/dist/editor/editor-utils/common-editor-utils.js +9 -1
- package/dist/editor/editor-utils/inline-element-utils/index.js +0 -0
- package/dist/editor/editor-utils/mark-utils.js +0 -0
- package/dist/editor/editor-utils/range-utils.js +0 -0
- package/dist/editor/editor-utils/selection-utils.js +0 -0
- package/dist/editor/editor-utils/text-utils.js +0 -0
- package/dist/editor/editor.js +0 -0
- package/dist/editor/element-model/blockquote.js +0 -0
- package/dist/editor/element-model/image.js +0 -0
- package/dist/editor/element-model/link.js +0 -0
- package/dist/editor/element-model/table.js +0 -0
- package/dist/editor/element-model/text.js +0 -0
- package/dist/editor/load-script.js +0 -0
- package/dist/editor/plain-markdown-editor.js +0 -0
- package/dist/editor/rich-markdown-editor.js +0 -1
- package/dist/editor/seafile-editor.js +0 -1
- package/dist/editor/simple-editor.js +0 -0
- package/dist/editor-api.js +0 -5
- package/dist/index.css +0 -0
- package/dist/lib/slate-hyperscript/creators.js +0 -0
- package/dist/lib/slate-hyperscript/hyperscript.js +0 -0
- package/dist/lib/slate-hyperscript/index.js +0 -0
- package/dist/lib/slate-hyperscript/tokens.js +0 -0
- package/dist/lib/unified/index.js +0 -0
- package/dist/lib/vfile/core.js +0 -0
- package/dist/lib/vfile/index.js +0 -0
- package/dist/seafile-editor-chooser.js +0 -0
- package/dist/seafile-markdown-editor.js +0 -12
- package/dist/seafile-markdown-viewer.js +1 -2
- package/dist/seafile-simple-editor.js +0 -0
- package/dist/utils/copy-to-clipboard.js +0 -0
- package/dist/utils/deserialize-html.js +0 -0
- package/dist/utils/diff/compare-strings.js +0 -0
- package/dist/utils/diff/diff.js +0 -0
- package/dist/utils/diff/index.js +0 -0
- package/dist/utils/render-slate.js +0 -0
- package/dist/utils/seafile-markdown2html.js +0 -0
- package/dist/utils/slate2markdown/index.js +0 -0
- package/dist/utils/slate2markdown/serialize.js +0 -0
- package/dist/utils/utils.js +0 -0
- package/dist/viewer/diff-viewer.js +0 -0
- package/dist/viewer/markdown-viewer.js +0 -0
- package/dist/viewer/slate-viewer.js +0 -0
- package/dist/viewer/viewer-formula.js +0 -0
- package/dist/viewer/viewer-image.js +0 -0
- package/dist/viewer/viewer-outline.js +0 -0
- package/package.json +1 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -0
- package/public/locales/cs/seafile-editor.json +0 -0
- package/public/locales/de/seafile-editor.json +0 -0
- package/public/locales/en/seafile-editor.json +1 -0
- package/public/locales/es/seafile-editor.json +0 -0
- package/public/locales/es-AR/seafile-editor.json +0 -0
- package/public/locales/es-MX/seafile-editor.json +0 -0
- package/public/locales/fr/seafile-editor.json +0 -0
- package/public/locales/it/seafile-editor.json +0 -0
- package/public/locales/ru/seafile-editor.json +0 -0
- package/public/locales/zh-CN/seafile-editor.json +1 -0
- package/public/manifest.json +0 -0
- package/public/media/scripts/mathjax/tex-svg.js +0 -0
- package/public/media/seafile-editor-font/iconfont.eot +0 -0
- package/public/media/seafile-editor-font/iconfont.svg +6 -4
- package/public/media/seafile-editor-font/iconfont.ttf +0 -0
- package/public/media/seafile-editor-font/iconfont.woff +0 -0
- package/public/media/seafile-editor-font/iconfont.woff2 +0 -0
- package/public/media/seafile-editor-font.css +10 -6
- package/public/media/seafile-logo.png +0 -0
- package/public/media/seafile-ui.css +1 -1
- package/dist/components/related-files-list.js +0 -75
- 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
|
|
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
|
-
})
|
|
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
|
|
File without changes
|
package/dist/css/diff-viewer.css
CHANGED
|
File without changes
|
package/dist/css/layout.css
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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-
|
|
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-
|
|
124
|
-
content: "\
|
|
119
|
+
.sf-editor-image-previewer .dtable-icon-left:before {
|
|
120
|
+
content: "\e756";
|
|
125
121
|
}
|
|
126
122
|
|
|
127
|
-
.sf-editor-image-previewer
|
|
128
|
-
|
|
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
|
+
}
|
|
@@ -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
|
+
}
|
|
File without changes
|
|
File without changes
|
package/dist/css/topbar.css
CHANGED
|
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
|
|
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';
|
|
File without changes
|
|
@@ -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
|
|
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 =
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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:
|
|
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
|
package/dist/editor/editor.js
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
|
|
@@ -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,
|