@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.
- package/dist/_i18n/index.js +20 -0
- package/dist/assets/css/comment-dialog.css +50 -0
- package/dist/{css → assets/css}/diff-viewer.css +0 -0
- package/dist/{css/richeditor → assets/css}/formula.css +0 -0
- package/dist/{css → assets/css}/history-viewer.css +0 -0
- package/dist/{css/richeditor → assets/css}/image.css +0 -0
- package/dist/{index.css → assets/css/index.css} +0 -0
- package/dist/assets/css/issue-card.css +43 -0
- package/dist/{css → assets/css}/keyboard-shortcuts.css +0 -0
- package/dist/{css/richeditor → assets/css}/link.css +0 -0
- package/dist/{css/plaineditor → assets/css}/markdown-editor.css +0 -0
- package/dist/{css → assets/css}/markdown-viewer.css +0 -0
- package/dist/{css/richeditor → assets/css}/navbar-imgbutton.css +0 -0
- package/dist/assets/css/outline.css +29 -0
- package/dist/{css/richeditor → assets/css}/table.css +0 -0
- package/dist/{css/richeditor → assets/css}/textlink-hovermenu.css +0 -0
- package/dist/{css → assets/css}/topbar.css +19 -33
- package/dist/{css/richeditor → assets/css}/tree-view.css +0 -0
- package/dist/{css/richeditor/right-panel.css → assets/css/user-help.css} +9 -9
- package/dist/assets/editor/plain-editor.css +30 -0
- package/dist/assets/editor/rich-editor.css +104 -0
- package/dist/assets/editor/simple-editor.css +77 -0
- package/dist/{css/richeditor → assets/rich-editor}/document-info.css +0 -0
- package/dist/components/add-formula-dialog.js +6 -4
- package/dist/components/add-image-dialog.js +3 -1
- package/dist/components/add-link-dialog.js +4 -3
- package/dist/components/comment-dialog.js +12 -6
- package/dist/components/markdown-lint.js +1 -0
- package/dist/components/outline/index.js +97 -0
- package/dist/components/outline/outline-item.js +70 -0
- package/dist/components/shortcut-dialog.js +26 -51
- package/dist/components/{topbar-component → toolbar}/header-list.js +0 -0
- package/dist/components/toolbar/help-group.js +40 -0
- package/dist/components/toolbar/index.js +4 -0
- package/dist/components/{topbar-component/upload-img.js → toolbar/insert-image.js} +18 -15
- package/dist/components/toolbar/insert-table.js +155 -0
- package/dist/components/toolbar/table-group.js +82 -0
- package/dist/components/{toolbar.js → toolbar/toolbar.js} +102 -64
- package/dist/components/{topbar-component → toolbar/widgets}/button-group.js +0 -0
- package/dist/components/toolbar/widgets/button-item.js +144 -0
- package/dist/components/toolbar/widgets/drop-list.js +101 -0
- package/dist/components/user-help.js +16 -10
- package/dist/editor/controller/block-element-controller.js +6 -2
- package/dist/editor/controller/inline-element-controller.js +6 -2
- package/dist/editor/editor-builder.js +107 -0
- package/dist/editor/editor-component/formula.js +4 -2
- package/dist/editor/editor-component/image.js +10 -6
- package/dist/editor/editor-component/table.js +1 -1
- package/dist/editor/editor-plugin.js +3 -1
- package/dist/editor/editor.js +1 -32
- package/dist/editor/index.js +97 -0
- package/dist/editor/markdown-editor.js +323 -0
- package/dist/editor/plain-markdown-editor.js +5 -4
- package/dist/editor/rich-markdown-editor.js +70 -149
- package/dist/editor/simple-editor.js +44 -78
- package/dist/{css/richeditor → example/assets/css}/comments-list.css +0 -45
- package/dist/{css/richeditor → example/assets/css}/detail-list-view.css +0 -0
- package/dist/{css/richeditor → example/assets/css}/participants-list.css +0 -0
- package/dist/{css → example/assets/css}/react-mentions-default-style.js +0 -0
- package/dist/example/assets/css/seafile-editor-main.css +125 -0
- package/dist/example/assets/css/seafile-editor-side.css +89 -0
- package/dist/example/assets/css/side-panel.css +81 -0
- package/dist/{components → example/components}/comment-panel.js +12 -6
- package/dist/{components → example/components}/detail-list-view.js +1 -1
- package/dist/{components → example/components}/participants-list.js +1 -1
- package/dist/{components → example/components}/side-panel.js +5 -7
- package/dist/example/seafile-editor.js +137 -0
- package/dist/index.js +9 -0
- package/dist/index.local.js +58 -0
- package/dist/pages/seafile-editor/index.js +38 -0
- package/dist/{editor → pages/seafile-editor}/seafile-editor.js +19 -35
- package/dist/{seafile-editor-chooser.js → pages/seafile-editor-chooser.js} +0 -0
- package/dist/{seafile-markdown-editor.js → pages/seafile-markdown-editor.js} +5 -5
- package/dist/{seafile-markdown-viewer.js → pages/seafile-markdown-viewer.js} +3 -3
- package/dist/{seafile-simple-editor.js → pages/seafile-simple-editor.js} +5 -2
- package/dist/viewer/diff-viewer.js +1 -1
- package/dist/viewer/markdown-viewer.js +14 -15
- package/dist/viewer/slate-viewer.js +9 -24
- package/dist/viewer/viewer-formula.js +1 -1
- package/package.json +6 -14
- package/public/locales/zh-CN/seafile-editor.json +15 -13
- package/dist/components/generate-share-link.js +0 -412
- package/dist/components/internal-link-dialog.js +0 -96
- package/dist/components/outline.js +0 -130
- package/dist/components/topbar-component/icon-button.js +0 -99
- package/dist/components/topbar-component/insert-file.js +0 -67
- package/dist/components/topbar-component/table-toolbar.js +0 -175
- package/dist/config-0.js +0 -15
- package/dist/css/layout.css +0 -111
- package/dist/css/markdown-viewer-slate/file-tags-list.css +0 -76
- package/dist/css/richeditor/rich-editor-main.css +0 -32
- package/dist/css/richeditor/side-panel.css +0 -183
|
@@ -3,6 +3,8 @@ 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';
|
|
7
|
+
import '../assets/css/user-help.css';
|
|
6
8
|
|
|
7
9
|
var ShortCut = /*#__PURE__*/function (_React$Component) {
|
|
8
10
|
_inherits(ShortCut, _React$Component);
|
|
@@ -162,34 +164,38 @@ var HelpShortcutList = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
162
164
|
return HelpShortcutList;
|
|
163
165
|
}(React.PureComponent);
|
|
164
166
|
|
|
165
|
-
var
|
|
166
|
-
_inherits(
|
|
167
|
+
var UserHelp = /*#__PURE__*/function (_React$PureComponent3) {
|
|
168
|
+
_inherits(UserHelp, _React$PureComponent3);
|
|
167
169
|
|
|
168
|
-
var _super4 = _createSuper(
|
|
170
|
+
var _super4 = _createSuper(UserHelp);
|
|
169
171
|
|
|
170
|
-
function
|
|
171
|
-
_classCallCheck(this,
|
|
172
|
+
function UserHelp() {
|
|
173
|
+
_classCallCheck(this, UserHelp);
|
|
172
174
|
|
|
173
175
|
return _super4.apply(this, arguments);
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
_createClass(
|
|
178
|
+
_createClass(UserHelp, [{
|
|
177
179
|
key: "render",
|
|
178
180
|
value: function render() {
|
|
181
|
+
var t = this.props.t;
|
|
182
|
+
var userHelp = t('userHelp', {
|
|
183
|
+
returnObjects: true
|
|
184
|
+
});
|
|
179
185
|
return /*#__PURE__*/React.createElement("div", {
|
|
180
186
|
className: 'seafile-editor-help align-self-end'
|
|
181
187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
182
188
|
className: 'help-header d-flex'
|
|
183
189
|
}, /*#__PURE__*/React.createElement("div", {
|
|
184
190
|
className: 'help-title'
|
|
185
|
-
},
|
|
191
|
+
}, userHelp.title), /*#__PURE__*/React.createElement("div", {
|
|
186
192
|
className: 'help-close',
|
|
187
193
|
onClick: this.props.hideHelpDialog
|
|
188
194
|
}, /*#__PURE__*/React.createElement("i", {
|
|
189
195
|
className: 'iconfont icon-times-circle'
|
|
190
196
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
191
197
|
className: 'help-content'
|
|
192
|
-
},
|
|
198
|
+
}, userHelp.userHelpData.map(function (item, index) {
|
|
193
199
|
return /*#__PURE__*/React.createElement(HelpShortcutList, {
|
|
194
200
|
key: 'help-list' + index,
|
|
195
201
|
index: index,
|
|
@@ -199,7 +205,7 @@ var UserHelpDialog = /*#__PURE__*/function (_React$PureComponent3) {
|
|
|
199
205
|
}
|
|
200
206
|
}]);
|
|
201
207
|
|
|
202
|
-
return
|
|
208
|
+
return UserHelp;
|
|
203
209
|
}(React.PureComponent);
|
|
204
210
|
|
|
205
|
-
export default
|
|
211
|
+
export default withTranslation('seafile-editor')(UserHelp);
|
|
@@ -14,6 +14,7 @@ import generateLinkElement from '../element-model/link';
|
|
|
14
14
|
import generateImageElement from '../element-model/image';
|
|
15
15
|
import isUrl from 'is-url';
|
|
16
16
|
import { SfEditor } from '../custom/custom';
|
|
17
|
+
import EditorBuilder from '../editor-builder';
|
|
17
18
|
|
|
18
19
|
var withBlock = function withBlock(editor) {
|
|
19
20
|
var exec = editor.exec;
|
|
@@ -58,7 +59,10 @@ var withBlock = function withBlock(editor) {
|
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
var _EditorBuilder$getEdi = EditorBuilder.getEditor(),
|
|
63
|
+
editorApi = _EditorBuilder$getEdi.editorApi;
|
|
64
|
+
|
|
65
|
+
if (editorApi.isInternalFileLink(text)) {
|
|
62
66
|
var index = text.lastIndexOf('/');
|
|
63
67
|
|
|
64
68
|
if (index > 0) {
|
|
@@ -78,7 +82,7 @@ var withBlock = function withBlock(editor) {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
if (
|
|
85
|
+
if (editorApi.isInternalDirLink(text)) {
|
|
82
86
|
var _index = text.lastIndexOf('/');
|
|
83
87
|
|
|
84
88
|
if (_index > 0) {
|
|
@@ -2,6 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
import { Editor, Range } from 'slate';
|
|
3
3
|
import generateLinkElement from '../element-model/link';
|
|
4
4
|
import generateImageElement from '../element-model/image';
|
|
5
|
+
import EditorBuilder from '../editor-builder';
|
|
5
6
|
|
|
6
7
|
var withInline = function withInline(editor) {
|
|
7
8
|
var exec = editor.exec,
|
|
@@ -102,8 +103,11 @@ var withInline = function withInline(editor) {
|
|
|
102
103
|
break;
|
|
103
104
|
|
|
104
105
|
case 'insert_data':
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
var _EditorBuilder$getEdi = EditorBuilder.getEditor(),
|
|
107
|
+
editorApi = _EditorBuilder$getEdi.editorApi;
|
|
108
|
+
|
|
109
|
+
if (data.types.includes('Files') && data.files[0].type.includes('image') && editorApi.uploadLocalImage) {
|
|
110
|
+
editorApi.uploadLocalImage(command.data.files[0]).then(function (res) {
|
|
107
111
|
var img = generateImageElement({
|
|
108
112
|
data: {
|
|
109
113
|
src: res
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import { createEditor } from 'slate';
|
|
4
|
+
import { withHistory } from 'slate-history';
|
|
5
|
+
import { withReact } from '@seafile/slate-react';
|
|
6
|
+
import withInline from './controller/inline-element-controller';
|
|
7
|
+
import withBlock from './controller/block-element-controller';
|
|
8
|
+
import withVoid from './controller/void-element-controller';
|
|
9
|
+
import withMarkdownShortcut from './controller/shortcut-controller';
|
|
10
|
+
import normalizeNode from './controller/normalize-controller';
|
|
11
|
+
import { EditorUtils } from './editor-utils/common-editor-utils';
|
|
12
|
+
import TableUtils from './editor-utils/block-element-utils/table-utils';
|
|
13
|
+
import Plugin from './editor-plugin';
|
|
14
|
+
|
|
15
|
+
var EditorBuilder = /*#__PURE__*/function () {
|
|
16
|
+
function EditorBuilder() {
|
|
17
|
+
_classCallCheck(this, EditorBuilder);
|
|
18
|
+
|
|
19
|
+
this.editor = null;
|
|
20
|
+
this.plugin = null;
|
|
21
|
+
this.tableUtils = null;
|
|
22
|
+
this.editorUtils = null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_createClass(EditorBuilder, null, [{
|
|
26
|
+
key: "getEditor",
|
|
27
|
+
value: function getEditor(options) {
|
|
28
|
+
if (this.editor && options) {
|
|
29
|
+
if (options && options.onSave) {
|
|
30
|
+
this.editor.onSave = options.onSave;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (options && options.editorApi) {
|
|
34
|
+
this.editor.editorApi = options.editorApi;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (this.editor) return this.editor;
|
|
39
|
+
this.editor = normalizeNode(withMarkdownShortcut(withVoid(withBlock(withInline(withHistory(withReact(createEditor())))))));
|
|
40
|
+
|
|
41
|
+
if (options && options.onSave) {
|
|
42
|
+
this.editor.onSave = options.onSave;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (options && options.editorApi) {
|
|
46
|
+
this.editor.editorApi = options.editorApi;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return this.editor;
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "getSlateEditor",
|
|
53
|
+
value: function getSlateEditor() {
|
|
54
|
+
if (this.editor) this.editor = null;
|
|
55
|
+
this.editor = withInline(withVoid(withReact(createEditor())));
|
|
56
|
+
return this.editor;
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "resetEditor",
|
|
60
|
+
value: function resetEditor() {
|
|
61
|
+
this.editor = null;
|
|
62
|
+
this.plugin = null;
|
|
63
|
+
this.editorUtils = null;
|
|
64
|
+
this.tableUtils = null;
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "getEditorRef",
|
|
68
|
+
value: function getEditorRef() {
|
|
69
|
+
var editorRef = window.abcdef_editor;
|
|
70
|
+
return editorRef;
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "getToolbarRef",
|
|
74
|
+
value: function getToolbarRef() {
|
|
75
|
+
var toolbarRef = window.abcdef_editorToolbar;
|
|
76
|
+
return toolbarRef;
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "getEditorUtils",
|
|
80
|
+
value: function getEditorUtils() {
|
|
81
|
+
if (this.editorUtils) return this.editorUtils;
|
|
82
|
+
if (!this.editor) this.getEditor();
|
|
83
|
+
this.editorUtils = new EditorUtils(this.editor);
|
|
84
|
+
return this.editorUtils;
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "getTableUtils",
|
|
88
|
+
value: function getTableUtils() {
|
|
89
|
+
if (this.tableUtils) return this.tableUtils;
|
|
90
|
+
if (!this.editor) this.getEditor();
|
|
91
|
+
this.tableUtils = new TableUtils(this.editor);
|
|
92
|
+
return this.tableUtils;
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "getPlugin",
|
|
96
|
+
value: function getPlugin() {
|
|
97
|
+
if (this.plugin) return this.plugin;
|
|
98
|
+
if (!this.editor) this.getEditor();
|
|
99
|
+
this.plugin = new Plugin(this.editor);
|
|
100
|
+
return this.plugin;
|
|
101
|
+
}
|
|
102
|
+
}]);
|
|
103
|
+
|
|
104
|
+
return EditorBuilder;
|
|
105
|
+
}();
|
|
106
|
+
|
|
107
|
+
export default EditorBuilder;
|
|
@@ -3,7 +3,8 @@ 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 '../../css/
|
|
6
|
+
import '../../assets/css/formula.css';
|
|
7
|
+
import EditorBuilder from '../editor-builder';
|
|
7
8
|
|
|
8
9
|
var Formula = /*#__PURE__*/function (_React$Component) {
|
|
9
10
|
_inherits(Formula, _React$Component);
|
|
@@ -22,7 +23,8 @@ var Formula = /*#__PURE__*/function (_React$Component) {
|
|
|
22
23
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
23
24
|
|
|
24
25
|
_this.toggleFormulaEditor = function () {
|
|
25
|
-
|
|
26
|
+
var toolbarRef = EditorBuilder.getToolbarRef();
|
|
27
|
+
toolbarRef.onToggleFormulaDialog();
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
_this.renderFormula = function () {
|
|
@@ -8,6 +8,7 @@ import { withTranslation } from 'react-i18next';
|
|
|
8
8
|
import Lightbox from '@seafile/react-image-lightbox';
|
|
9
9
|
import { Utils } from '../../utils/utils';
|
|
10
10
|
import InlineElementUtils from '../editor-utils/inline-element-utils';
|
|
11
|
+
import EditorBuilder from '../editor-builder';
|
|
11
12
|
import '@seafile/react-image-lightbox/style.css';
|
|
12
13
|
|
|
13
14
|
var Image = /*#__PURE__*/function (_React$Component) {
|
|
@@ -100,7 +101,8 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
100
101
|
isResizing: false,
|
|
101
102
|
isShowBigImage: false
|
|
102
103
|
};
|
|
103
|
-
|
|
104
|
+
var editor = EditorBuilder.getEditor();
|
|
105
|
+
_this.inlineElementUtils = new InlineElementUtils(editor);
|
|
104
106
|
return _this;
|
|
105
107
|
}
|
|
106
108
|
|
|
@@ -128,10 +130,11 @@ var Image = /*#__PURE__*/function (_React$Component) {
|
|
|
128
130
|
var src = data.src;
|
|
129
131
|
|
|
130
132
|
if (/^\.\.\/*/.test(src) || /^\.\/*/.test(src)) {
|
|
131
|
-
var
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
var editor = EditorBuilder.getEditor();
|
|
134
|
+
var _editor$editorApi = editor.editorApi,
|
|
135
|
+
filePath = _editor$editorApi.filePath,
|
|
136
|
+
serviceUrl = _editor$editorApi.serviceUrl,
|
|
137
|
+
repoID = _editor$editorApi.repoID;
|
|
135
138
|
var originalPath = filePath.slice(0, filePath.lastIndexOf('/')) + '/' + src;
|
|
136
139
|
src = serviceUrl + '/lib/' + repoID + '/file/' + Utils.pathNormalize(originalPath) + '?raw=1';
|
|
137
140
|
}
|
|
@@ -221,7 +224,8 @@ var ImagePreviewer = /*#__PURE__*/function (_React$Component2) {
|
|
|
221
224
|
});
|
|
222
225
|
};
|
|
223
226
|
|
|
224
|
-
|
|
227
|
+
var editor = EditorBuilder.getEditor();
|
|
228
|
+
_this2.images = _this2.getImageNodes(editor.children);
|
|
225
229
|
_this2.state = {
|
|
226
230
|
imageIndex: _this2.images.findIndex(function (item) {
|
|
227
231
|
return item === props.imageUrl;
|
|
@@ -4,7 +4,7 @@ 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
6
|
import ReactDOM from 'react-dom';
|
|
7
|
-
import '../../css/
|
|
7
|
+
import '../../assets/css/table.css';
|
|
8
8
|
|
|
9
9
|
var TableContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
10
10
|
_inherits(TableContainer, _React$PureComponent);
|
|
@@ -7,6 +7,7 @@ import CodeUtils from './editor-utils/block-element-utils/code-utils';
|
|
|
7
7
|
import TableUtils from './editor-utils/block-element-utils/table-utils';
|
|
8
8
|
import setEventTransfer from './custom/set-event-transfer';
|
|
9
9
|
import { SfEditor } from '../editor/custom/custom';
|
|
10
|
+
import EditorBuilder from './editor-builder';
|
|
10
11
|
|
|
11
12
|
var Plugin = function Plugin(_editor) {
|
|
12
13
|
var _this = this;
|
|
@@ -143,7 +144,8 @@ var Plugin = function Plugin(_editor) {
|
|
|
143
144
|
byKey: true
|
|
144
145
|
})(event)) {
|
|
145
146
|
event.preventDefault();
|
|
146
|
-
|
|
147
|
+
var toolbarRef = EditorBuilder.getToolbarRef();
|
|
148
|
+
toolbarRef.onToggleFormulaDialog();
|
|
147
149
|
return;
|
|
148
150
|
} // compate chrome: in chrome press backspace would not exec delete_backward command
|
|
149
151
|
|
package/dist/editor/editor.js
CHANGED
|
@@ -4,8 +4,6 @@ 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
6
|
import SimpleEditor from './simple-editor';
|
|
7
|
-
import SeafileEditor from './seafile-editor';
|
|
8
|
-
import LoadScript from './load-script';
|
|
9
7
|
|
|
10
8
|
var SimpleEditorWithErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
11
9
|
_inherits(SimpleEditorWithErrorBoundary, _React$Component);
|
|
@@ -34,33 +32,4 @@ var SimpleEditorWithErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
34
32
|
return SimpleEditorWithErrorBoundary;
|
|
35
33
|
}(React.Component);
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
_inherits(SeafileEditorWithErrorBundary, _React$Component2);
|
|
39
|
-
|
|
40
|
-
var _super2 = _createSuper(SeafileEditorWithErrorBundary);
|
|
41
|
-
|
|
42
|
-
function SeafileEditorWithErrorBundary() {
|
|
43
|
-
_classCallCheck(this, SeafileEditorWithErrorBundary);
|
|
44
|
-
|
|
45
|
-
return _super2.apply(this, arguments);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
_createClass(SeafileEditorWithErrorBundary, [{
|
|
49
|
-
key: "componentDidCatch",
|
|
50
|
-
value: function componentDidCatch(error) {
|
|
51
|
-
console.error(error);
|
|
52
|
-
this.forceUpdate();
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "render",
|
|
56
|
-
value: function render() {
|
|
57
|
-
return /*#__PURE__*/React.createElement(LoadScript, {
|
|
58
|
-
scriptSource: this.props.scriptSource
|
|
59
|
-
}, /*#__PURE__*/React.createElement(SeafileEditor, this.props));
|
|
60
|
-
}
|
|
61
|
-
}]);
|
|
62
|
-
|
|
63
|
-
return SeafileEditorWithErrorBundary;
|
|
64
|
-
}(React.Component);
|
|
65
|
-
|
|
66
|
-
export { SimpleEditorWithErrorBoundary as SimpleEditor, SeafileEditorWithErrorBundary as SeafileEditor };
|
|
35
|
+
export { SimpleEditorWithErrorBoundary as SimpleEditor };
|
|
@@ -0,0 +1,97 @@
|
|
|
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 MarkdownEditor from "./markdown-editor";
|
|
7
|
+
import SimpleEditor from "./simple-editor";
|
|
8
|
+
import PlainMarkdownEditor from "./plain-markdown-editor";
|
|
9
|
+
import LoadScript from './load-script';
|
|
10
|
+
import EditorBuilder from "./editor-builder";
|
|
11
|
+
|
|
12
|
+
var SimpleEditorWithErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
13
|
+
_inherits(SimpleEditorWithErrorBoundary, _React$Component);
|
|
14
|
+
|
|
15
|
+
var _super = _createSuper(SimpleEditorWithErrorBoundary);
|
|
16
|
+
|
|
17
|
+
function SimpleEditorWithErrorBoundary() {
|
|
18
|
+
_classCallCheck(this, SimpleEditorWithErrorBoundary);
|
|
19
|
+
|
|
20
|
+
return _super.apply(this, arguments);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_createClass(SimpleEditorWithErrorBoundary, [{
|
|
24
|
+
key: "componentDidCatch",
|
|
25
|
+
value: function componentDidCatch(error) {
|
|
26
|
+
console.error(error);
|
|
27
|
+
this.forceUpdate();
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
key: "render",
|
|
31
|
+
value: function render() {
|
|
32
|
+
return /*#__PURE__*/React.createElement(SimpleEditor, this.props);
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
|
|
36
|
+
return SimpleEditorWithErrorBoundary;
|
|
37
|
+
}(React.Component);
|
|
38
|
+
|
|
39
|
+
var MarkdownEditorWithErrorBoundary = /*#__PURE__*/function (_React$Component2) {
|
|
40
|
+
_inherits(MarkdownEditorWithErrorBoundary, _React$Component2);
|
|
41
|
+
|
|
42
|
+
var _super2 = _createSuper(MarkdownEditorWithErrorBoundary);
|
|
43
|
+
|
|
44
|
+
function MarkdownEditorWithErrorBoundary() {
|
|
45
|
+
_classCallCheck(this, MarkdownEditorWithErrorBoundary);
|
|
46
|
+
|
|
47
|
+
return _super2.apply(this, arguments);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_createClass(MarkdownEditorWithErrorBoundary, [{
|
|
51
|
+
key: "componentDidCatch",
|
|
52
|
+
value: function componentDidCatch(error) {
|
|
53
|
+
console.error(error);
|
|
54
|
+
this.forceUpdate();
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
key: "render",
|
|
58
|
+
value: function render() {
|
|
59
|
+
return /*#__PURE__*/React.createElement(LoadScript, {
|
|
60
|
+
scriptSource: this.props.scriptSource
|
|
61
|
+
}, /*#__PURE__*/React.createElement(MarkdownEditor, this.props));
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
|
|
65
|
+
return MarkdownEditorWithErrorBoundary;
|
|
66
|
+
}(React.Component);
|
|
67
|
+
|
|
68
|
+
var PlainMarkdownEditorWithErrorBoundary = /*#__PURE__*/function (_React$Component3) {
|
|
69
|
+
_inherits(PlainMarkdownEditorWithErrorBoundary, _React$Component3);
|
|
70
|
+
|
|
71
|
+
var _super3 = _createSuper(PlainMarkdownEditorWithErrorBoundary);
|
|
72
|
+
|
|
73
|
+
function PlainMarkdownEditorWithErrorBoundary() {
|
|
74
|
+
_classCallCheck(this, PlainMarkdownEditorWithErrorBoundary);
|
|
75
|
+
|
|
76
|
+
return _super3.apply(this, arguments);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
_createClass(PlainMarkdownEditorWithErrorBoundary, [{
|
|
80
|
+
key: "componentDidCatch",
|
|
81
|
+
value: function componentDidCatch(error) {
|
|
82
|
+
console.error(error);
|
|
83
|
+
this.forceUpdate();
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "render",
|
|
87
|
+
value: function render() {
|
|
88
|
+
return /*#__PURE__*/React.createElement(LoadScript, {
|
|
89
|
+
scriptSource: this.props.scriptSource
|
|
90
|
+
}, /*#__PURE__*/React.createElement(PlainMarkdownEditor, this.props));
|
|
91
|
+
}
|
|
92
|
+
}]);
|
|
93
|
+
|
|
94
|
+
return PlainMarkdownEditorWithErrorBoundary;
|
|
95
|
+
}(React.Component);
|
|
96
|
+
|
|
97
|
+
export { EditorBuilder, MarkdownEditorWithErrorBoundary as MarkdownEditor, SimpleEditorWithErrorBoundary as SimpleEditor, PlainMarkdownEditorWithErrorBoundary as PlainMarkdownEditor };
|