@seafile/seafile-editor 0.3.133 → 0.3.135
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 +22 -0
- package/dist/components/add-image-dialog.js +12 -0
- package/dist/components/add-link-dialog.js +18 -0
- package/dist/components/click-outside.js +12 -0
- package/dist/components/comment-dialog.js +18 -2
- package/dist/components/context-menu.js +17 -2
- package/dist/components/error-boundary.js +7 -0
- package/dist/components/loading.js +7 -0
- package/dist/components/markdown-lint.js +16 -0
- package/dist/components/menu/item.js +15 -4
- package/dist/components/menu/menu.js +11 -0
- package/dist/components/modal-portal.js +8 -0
- package/dist/components/outline/index.js +20 -2
- package/dist/components/outline/outline-item.js +20 -6
- package/dist/components/select/_option.js +15 -3
- package/dist/components/select/field-setting.js +29 -6
- package/dist/components/select/index.js +32 -9
- package/dist/components/shortcut-dialog.js +15 -3
- package/dist/components/svg-icons/check-mark-icon.js +2 -0
- package/dist/components/svg-icons/column-icon.js +2 -0
- package/dist/components/svg-icons/text-icon.js +2 -0
- package/dist/components/toast/alert.js +12 -0
- package/dist/components/toast/toast.js +21 -1
- package/dist/components/toast/toastManager.js +27 -4
- package/dist/components/toast/toaster.js +15 -4
- package/dist/components/toolbar/header-list.js +14 -0
- package/dist/components/toolbar/help-group.js +7 -0
- package/dist/components/toolbar/insert-image.js +19 -0
- package/dist/components/toolbar/insert-table.js +34 -11
- package/dist/components/toolbar/table-group.js +8 -0
- package/dist/components/toolbar/toolbar.js +37 -18
- package/dist/components/toolbar/widgets/button-group.js +7 -0
- package/dist/components/toolbar/widgets/button-item.js +35 -16
- package/dist/components/toolbar/widgets/drop-list.js +13 -0
- package/dist/components/user-help.js +34 -2
- package/dist/constants/cell-types.js +1 -2
- package/dist/constants/column.js +2 -0
- package/dist/editor/code-highlight-package.js +13 -0
- package/dist/editor/controller/block-element-controller.js +85 -21
- package/dist/editor/controller/inline-element-controller.js +23 -4
- package/dist/editor/controller/normalize-controller.js +24 -11
- package/dist/editor/controller/shortcut-controller.js +136 -74
- package/dist/editor/controller/void-element-controller.js +3 -0
- package/dist/editor/custom/custom.js +2 -3
- package/dist/editor/custom/get-event-transfer.js +4 -3
- package/dist/editor/custom/getNodesByTypeAtRange.js +21 -9
- package/dist/editor/custom/insertNodes.js +35 -15
- package/dist/editor/custom/is-empty-paragraph.js +4 -0
- package/dist/editor/custom/set-event-transfer.js +3 -2
- package/dist/editor/custom/split-nodes-at-point.js +133 -107
- package/dist/editor/custom/unwrap-node-by-type-at-range.js +25 -14
- package/dist/editor/editor-builder.js +12 -0
- package/dist/editor/editor-component/check-list-item.js +14 -3
- package/dist/editor/editor-component/code-block.js +27 -5
- package/dist/editor/editor-component/column.js +34 -10
- package/dist/editor/editor-component/formula.js +17 -3
- package/dist/editor/editor-component/image.js +52 -7
- package/dist/editor/editor-component/link.js +2 -0
- package/dist/editor/editor-component/table.js +41 -13
- package/dist/editor/editor-component/textlink-hovermenu.js +23 -0
- package/dist/editor/editor-plugin.js +61 -19
- package/dist/editor/editor-utils/block-element-utils/blockquote-utils.js +23 -7
- package/dist/editor/editor-utils/block-element-utils/code-utils.js +28 -5
- package/dist/editor/editor-utils/block-element-utils/formula-utils.js +8 -1
- package/dist/editor/editor-utils/block-element-utils/index.js +16 -9
- package/dist/editor/editor-utils/block-element-utils/list-utils.js +105 -58
- package/dist/editor/editor-utils/block-element-utils/table-utils.js +104 -39
- package/dist/editor/editor-utils/clear-format-utils.js +19 -9
- package/dist/editor/editor-utils/common-editor-utils.js +120 -15
- package/dist/editor/editor-utils/inline-element-utils/index.js +37 -18
- package/dist/editor/editor-utils/mark-utils.js +8 -3
- package/dist/editor/editor-utils/range-utils.js +2 -0
- package/dist/editor/editor-utils/selection-utils.js +10 -7
- package/dist/editor/editor-utils/text-utils.js +27 -17
- package/dist/editor/editor.js +7 -0
- package/dist/editor/element-model/blockquote.js +6 -3
- package/dist/editor/element-model/column.js +6 -3
- package/dist/editor/element-model/image.js +6 -3
- package/dist/editor/element-model/link.js +6 -3
- package/dist/editor/element-model/table.js +24 -8
- package/dist/editor/element-model/text.js +6 -3
- package/dist/editor/index.js +19 -0
- package/dist/editor/load-script.js +17 -4
- package/dist/editor/markdown-editor.js +62 -10
- package/dist/editor/plain-markdown-editor.js +48 -4
- package/dist/editor/seatable-editor.js +32 -8
- package/dist/editor/simple-editor.js +29 -6
- package/dist/lib/slate-hyperscript/creators.js +47 -27
- package/dist/lib/slate-hyperscript/hyperscript.js +18 -4
- package/dist/lib/slate-hyperscript/tokens.js +19 -16
- package/dist/lib/unified/index.js +101 -29
- package/dist/lib/vfile/core.js +31 -13
- package/dist/lib/vfile/index.js +10 -4
- package/dist/utils/copy-to-clipboard.js +12 -4
- package/dist/utils/deserialize-html.js +26 -4
- package/dist/utils/diff/compare-strings.js +9 -0
- package/dist/utils/diff/diff.js +122 -40
- package/dist/utils/render-slate.js +43 -4
- package/dist/utils/seafile-markdown2html.js +19 -5
- package/dist/utils/slate2markdown/deserialize.js +137 -29
- package/dist/utils/slate2markdown/serialize.js +71 -6
- package/dist/utils/utils.js +18 -8
- package/dist/viewer/diff-viewer.js +13 -0
- package/dist/viewer/markdown-viewer.js +25 -4
- package/dist/viewer/seatable-viewer.js +11 -0
- package/dist/viewer/slate-viewer.js +18 -5
- package/dist/viewer/viewer-formula.js +15 -2
- package/dist/viewer/viewer-image.js +16 -2
- package/dist/viewer/viewer-outline.js +28 -1
- package/package.json +4 -3
- package/dist/viewer/viewer-image.css +0 -7
|
@@ -7,40 +7,55 @@ import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Input } from 'react
|
|
|
7
7
|
import { withTranslation } from 'react-i18next';
|
|
8
8
|
import { Editor } from 'slate';
|
|
9
9
|
import EditorBuilder from '../editor/editor-builder';
|
|
10
|
+
|
|
10
11
|
var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
11
12
|
_inherits(AddFormulaDialog, _React$PureComponent);
|
|
13
|
+
|
|
12
14
|
var _super = _createSuper(AddFormulaDialog);
|
|
15
|
+
|
|
13
16
|
function AddFormulaDialog(props) {
|
|
14
17
|
var _this;
|
|
18
|
+
|
|
15
19
|
_classCallCheck(this, AddFormulaDialog);
|
|
20
|
+
|
|
16
21
|
_this = _super.call(this, props);
|
|
22
|
+
|
|
17
23
|
_this.setInitialValue = function () {
|
|
18
24
|
var editor = EditorBuilder.getEditor();
|
|
19
25
|
var nodes = Editor.match(editor, editor.selection, {
|
|
20
26
|
type: 'formula'
|
|
21
27
|
});
|
|
28
|
+
|
|
22
29
|
if (nodes) {
|
|
23
30
|
var data = nodes[0].data;
|
|
31
|
+
|
|
24
32
|
_this.setState({
|
|
25
33
|
formula: data.formula
|
|
26
34
|
});
|
|
35
|
+
|
|
27
36
|
_this.formulaNode = nodes;
|
|
28
37
|
}
|
|
29
38
|
};
|
|
39
|
+
|
|
30
40
|
_this.handleFormulaChange = function (event) {
|
|
31
41
|
_this.renderFormula(event.target.value);
|
|
42
|
+
|
|
32
43
|
_this.setState({
|
|
33
44
|
formula: event.target.value
|
|
34
45
|
});
|
|
35
46
|
};
|
|
47
|
+
|
|
36
48
|
_this.renderFormula = function (formula) {
|
|
37
49
|
_this.formulaPreviewer.innerHTML = '';
|
|
38
50
|
var dom = window.MathJax.tex2svg(formula);
|
|
51
|
+
|
|
39
52
|
_this.formulaPreviewer.appendChild(dom);
|
|
40
53
|
};
|
|
54
|
+
|
|
41
55
|
_this.handleSubmit = function (event) {
|
|
42
56
|
event.preventDefault();
|
|
43
57
|
var formula = _this.state.formula;
|
|
58
|
+
|
|
44
59
|
if (_this.formulaNode) {
|
|
45
60
|
_this.editorUtils.setFormula({
|
|
46
61
|
formula: formula,
|
|
@@ -52,8 +67,10 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
52
67
|
at: _this.editorSelection
|
|
53
68
|
});
|
|
54
69
|
}
|
|
70
|
+
|
|
55
71
|
_this.props.toggleFormulaDialog();
|
|
56
72
|
};
|
|
73
|
+
|
|
57
74
|
_this.editorUtils = EditorBuilder.getEditorUtils();
|
|
58
75
|
_this.state = {
|
|
59
76
|
formula: ''
|
|
@@ -62,11 +79,13 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
62
79
|
_this.editorSelection = null;
|
|
63
80
|
return _this;
|
|
64
81
|
}
|
|
82
|
+
|
|
65
83
|
_createClass(AddFormulaDialog, [{
|
|
66
84
|
key: "componentDidMount",
|
|
67
85
|
value: function componentDidMount() {
|
|
68
86
|
var editor = EditorBuilder.getEditor();
|
|
69
87
|
this.editorSelection = editor.selection;
|
|
88
|
+
|
|
70
89
|
if (this.formulaNode) {
|
|
71
90
|
this.renderFormula(this.state.formula);
|
|
72
91
|
}
|
|
@@ -80,6 +99,7 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
80
99
|
key: "render",
|
|
81
100
|
value: function render() {
|
|
82
101
|
var _this2 = this;
|
|
102
|
+
|
|
83
103
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
84
104
|
isOpen: true,
|
|
85
105
|
toggle: this.props.toggleFormulaDialog,
|
|
@@ -110,6 +130,8 @@ var AddFormulaDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
110
130
|
}, this.props.t('insert_formula'))));
|
|
111
131
|
}
|
|
112
132
|
}]);
|
|
133
|
+
|
|
113
134
|
return AddFormulaDialog;
|
|
114
135
|
}(React.PureComponent);
|
|
136
|
+
|
|
115
137
|
export default withTranslation('seafile-editor')(AddFormulaDialog);
|
|
@@ -6,31 +6,41 @@ 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
8
|
import EditorBuilder from '../editor/editor-builder';
|
|
9
|
+
|
|
9
10
|
var AddImageDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
10
11
|
_inherits(AddImageDialog, _React$PureComponent);
|
|
12
|
+
|
|
11
13
|
var _super = _createSuper(AddImageDialog);
|
|
14
|
+
|
|
12
15
|
function AddImageDialog(props) {
|
|
13
16
|
var _this;
|
|
17
|
+
|
|
14
18
|
_classCallCheck(this, AddImageDialog);
|
|
19
|
+
|
|
15
20
|
_this = _super.call(this, props);
|
|
21
|
+
|
|
16
22
|
_this.handleUrlChange = function (event) {
|
|
17
23
|
_this.setState({
|
|
18
24
|
url: event.target.value
|
|
19
25
|
});
|
|
20
26
|
};
|
|
27
|
+
|
|
21
28
|
_this.handleSubmit = function (event) {
|
|
22
29
|
_this.props.insertImage({
|
|
23
30
|
url: _this.state.url,
|
|
24
31
|
selection: _this.editorSelection
|
|
25
32
|
});
|
|
33
|
+
|
|
26
34
|
_this.props.onToggleImageDialog();
|
|
27
35
|
};
|
|
36
|
+
|
|
28
37
|
_this.state = {
|
|
29
38
|
url: ''
|
|
30
39
|
};
|
|
31
40
|
_this.editorSelection = null;
|
|
32
41
|
return _this;
|
|
33
42
|
}
|
|
43
|
+
|
|
34
44
|
_createClass(AddImageDialog, [{
|
|
35
45
|
key: "componentDidMount",
|
|
36
46
|
value: function componentDidMount() {
|
|
@@ -64,6 +74,8 @@ var AddImageDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
74
|
}, this.props.t('submit')), ' '));
|
|
65
75
|
}
|
|
66
76
|
}]);
|
|
77
|
+
|
|
67
78
|
return AddImageDialog;
|
|
68
79
|
}(React.PureComponent);
|
|
80
|
+
|
|
69
81
|
export default withTranslation('seafile-editor')(AddImageDialog);
|
|
@@ -6,17 +6,25 @@ import React, { Fragment } from 'react';
|
|
|
6
6
|
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
|
7
7
|
import { withTranslation } from 'react-i18next';
|
|
8
8
|
import EditorBuilder from '../editor/editor-builder';
|
|
9
|
+
|
|
9
10
|
var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
10
11
|
_inherits(AddLinkDialog, _React$PureComponent);
|
|
12
|
+
|
|
11
13
|
var _super = _createSuper(AddLinkDialog);
|
|
14
|
+
|
|
12
15
|
function AddLinkDialog(props) {
|
|
13
16
|
var _this;
|
|
17
|
+
|
|
14
18
|
_classCallCheck(this, AddLinkDialog);
|
|
19
|
+
|
|
15
20
|
_this = _super.call(this, props);
|
|
21
|
+
|
|
16
22
|
_this.setInitialValue = function () {
|
|
17
23
|
var text = _this.editorUtils.getSelectedText();
|
|
24
|
+
|
|
18
25
|
if (_this.isLinkActive) {
|
|
19
26
|
var linkNode = _this.editorUtils.getCurrentLinkNode();
|
|
27
|
+
|
|
20
28
|
_this.setState({
|
|
21
29
|
title: _this.editorUtils.getLinkText(linkNode),
|
|
22
30
|
url: linkNode.data.href
|
|
@@ -28,19 +36,23 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
28
36
|
});
|
|
29
37
|
}
|
|
30
38
|
};
|
|
39
|
+
|
|
31
40
|
_this.handleUrlChange = function (event) {
|
|
32
41
|
_this.setState({
|
|
33
42
|
url: event.target.value
|
|
34
43
|
});
|
|
35
44
|
};
|
|
45
|
+
|
|
36
46
|
_this.handleTitleChange = function (event) {
|
|
37
47
|
_this.setState({
|
|
38
48
|
title: event.target.value
|
|
39
49
|
});
|
|
40
50
|
};
|
|
51
|
+
|
|
41
52
|
_this.handleSubmit = function (event) {
|
|
42
53
|
event.preventDefault();
|
|
43
54
|
if (_this.state.title.length === 0 || _this.state.url.length === 0) return;
|
|
55
|
+
|
|
44
56
|
if (!_this.isLinkActive) {
|
|
45
57
|
_this.editorUtils.insertLink({
|
|
46
58
|
text: _this.state.title,
|
|
@@ -54,13 +66,16 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
54
66
|
selection: _this.editorSelection
|
|
55
67
|
});
|
|
56
68
|
}
|
|
69
|
+
|
|
57
70
|
_this.props.toggleLinkDialog();
|
|
58
71
|
};
|
|
72
|
+
|
|
59
73
|
_this.onKeyDown = function (e) {
|
|
60
74
|
if (e.keyCode === 13) {
|
|
61
75
|
_this.handleSubmit(e);
|
|
62
76
|
}
|
|
63
77
|
};
|
|
78
|
+
|
|
64
79
|
_this.editorUtils = EditorBuilder.getEditorUtils();
|
|
65
80
|
_this.isLinkActive = _this.editorUtils.isLinkActive();
|
|
66
81
|
_this.editorSelection = null;
|
|
@@ -70,6 +85,7 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
85
|
};
|
|
71
86
|
return _this;
|
|
72
87
|
}
|
|
88
|
+
|
|
73
89
|
_createClass(AddLinkDialog, [{
|
|
74
90
|
key: "componentDidMount",
|
|
75
91
|
value: function componentDidMount() {
|
|
@@ -127,6 +143,8 @@ var AddLinkDialog = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
127
143
|
}, this.props.t('add_link'))));
|
|
128
144
|
}
|
|
129
145
|
}]);
|
|
146
|
+
|
|
130
147
|
return AddLinkDialog;
|
|
131
148
|
}(React.PureComponent);
|
|
149
|
+
|
|
132
150
|
export default withTranslation('seafile-editor')(AddLinkDialog);
|
|
@@ -3,26 +3,36 @@ 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
|
+
|
|
6
7
|
var ClickOutside = /*#__PURE__*/function (_React$Component) {
|
|
7
8
|
_inherits(ClickOutside, _React$Component);
|
|
9
|
+
|
|
8
10
|
var _super = _createSuper(ClickOutside);
|
|
11
|
+
|
|
9
12
|
function ClickOutside(props) {
|
|
10
13
|
var _this;
|
|
14
|
+
|
|
11
15
|
_classCallCheck(this, ClickOutside);
|
|
16
|
+
|
|
12
17
|
_this = _super.call(this, props);
|
|
18
|
+
|
|
13
19
|
_this.handleDocumentMouseDown = function () {
|
|
14
20
|
if (_this.isClickedInside) {
|
|
15
21
|
_this.isClickedInside = false;
|
|
16
22
|
return;
|
|
17
23
|
}
|
|
24
|
+
|
|
18
25
|
_this.props.clickOutside();
|
|
19
26
|
};
|
|
27
|
+
|
|
20
28
|
_this.handleMouseDown = function (e) {
|
|
21
29
|
_this.isClickedInside = true;
|
|
22
30
|
};
|
|
31
|
+
|
|
23
32
|
_this.isClickedInside = false;
|
|
24
33
|
return _this;
|
|
25
34
|
}
|
|
35
|
+
|
|
26
36
|
_createClass(ClickOutside, [{
|
|
27
37
|
key: "componentDidMount",
|
|
28
38
|
value: function componentDidMount() {
|
|
@@ -41,6 +51,8 @@ var ClickOutside = /*#__PURE__*/function (_React$Component) {
|
|
|
41
51
|
});
|
|
42
52
|
}
|
|
43
53
|
}]);
|
|
54
|
+
|
|
44
55
|
return ClickOutside;
|
|
45
56
|
}(React.Component);
|
|
57
|
+
|
|
46
58
|
export default ClickOutside;
|
|
@@ -7,46 +7,60 @@ import { withTranslation } from 'react-i18next';
|
|
|
7
7
|
import { Button } from 'reactstrap';
|
|
8
8
|
import { processor } from '../utils/seafile-markdown2html';
|
|
9
9
|
import '../assets/css/comment-dialog.css';
|
|
10
|
+
|
|
10
11
|
var CommentDialog = /*#__PURE__*/function (_React$Component) {
|
|
11
12
|
_inherits(CommentDialog, _React$Component);
|
|
13
|
+
|
|
12
14
|
var _super = _createSuper(CommentDialog);
|
|
15
|
+
|
|
13
16
|
function CommentDialog(props) {
|
|
14
17
|
var _this;
|
|
18
|
+
|
|
15
19
|
_classCallCheck(this, CommentDialog);
|
|
20
|
+
|
|
16
21
|
_this = _super.call(this, props);
|
|
22
|
+
|
|
17
23
|
_this.handleCommentChange = function (event) {
|
|
18
24
|
var comment = event.target.value;
|
|
25
|
+
|
|
19
26
|
_this.setState({
|
|
20
27
|
comment: comment
|
|
21
28
|
});
|
|
22
29
|
};
|
|
30
|
+
|
|
23
31
|
_this.submitComment = function () {
|
|
24
32
|
var comment = _this.state.comment.trim();
|
|
33
|
+
|
|
25
34
|
if (comment.length > 0 && _this.props.quote.length > 0) {
|
|
26
35
|
var detail = {
|
|
27
36
|
quote: _this.props.quote,
|
|
28
37
|
position: _this.props.commentPosition
|
|
29
38
|
};
|
|
30
39
|
var detailJSON = JSON.stringify(detail);
|
|
40
|
+
|
|
31
41
|
_this.props.editorApi.postComment(comment, detailJSON).then(function (res) {
|
|
32
42
|
_this.props.onCommentAdded();
|
|
33
43
|
});
|
|
34
44
|
}
|
|
35
45
|
};
|
|
46
|
+
|
|
36
47
|
_this.setQuoteText = function (mdQuote) {
|
|
37
48
|
processor.process(mdQuote).then(function (result) {
|
|
38
49
|
var quote = String(result);
|
|
50
|
+
|
|
39
51
|
_this.setState({
|
|
40
52
|
quote: quote
|
|
41
53
|
});
|
|
42
54
|
});
|
|
43
55
|
};
|
|
56
|
+
|
|
44
57
|
_this.state = {
|
|
45
58
|
comment: '',
|
|
46
59
|
quote: ''
|
|
47
60
|
};
|
|
48
61
|
return _this;
|
|
49
62
|
}
|
|
63
|
+
|
|
50
64
|
_createClass(CommentDialog, [{
|
|
51
65
|
key: "componentDidMount",
|
|
52
66
|
value: function componentDidMount() {
|
|
@@ -64,8 +78,8 @@ var CommentDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
64
78
|
value: function render() {
|
|
65
79
|
var t = this.props.t;
|
|
66
80
|
var _this$state = this.state,
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
comment = _this$state.comment,
|
|
82
|
+
quote = _this$state.quote;
|
|
69
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
70
84
|
className: "seafile-editor-comment comment-dialog"
|
|
71
85
|
}, /*#__PURE__*/React.createElement("div", null, this.props.editorApi.name), /*#__PURE__*/React.createElement("blockquote", {
|
|
@@ -92,6 +106,8 @@ var CommentDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
92
106
|
}));
|
|
93
107
|
}
|
|
94
108
|
}]);
|
|
109
|
+
|
|
95
110
|
return CommentDialog;
|
|
96
111
|
}(React.Component);
|
|
112
|
+
|
|
97
113
|
export default withTranslation('seafile-editor')(CommentDialog);
|
|
@@ -4,26 +4,36 @@ 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 { withTranslation } from 'react-i18next';
|
|
7
|
+
|
|
7
8
|
var ContextMenu = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inherits(ContextMenu, _React$Component);
|
|
10
|
+
|
|
9
11
|
var _super = _createSuper(ContextMenu);
|
|
12
|
+
|
|
10
13
|
function ContextMenu(props) {
|
|
11
14
|
var _this;
|
|
15
|
+
|
|
12
16
|
_classCallCheck(this, ContextMenu);
|
|
17
|
+
|
|
13
18
|
_this = _super.call(this, props);
|
|
19
|
+
|
|
14
20
|
_this.setMenuPosition = function () {
|
|
15
|
-
var menuHeight = _this.menu.offsetHeight;
|
|
16
|
-
|
|
21
|
+
var menuHeight = _this.menu.offsetHeight; // get height of context menu when the menu is drawing completed in this page
|
|
22
|
+
|
|
17
23
|
if (menuHeight === 0) {
|
|
18
24
|
requestAnimationFrame(_this.setMenuPosition);
|
|
19
25
|
}
|
|
26
|
+
|
|
20
27
|
var top = 0;
|
|
28
|
+
|
|
21
29
|
if (_this.position.top + menuHeight > document.body.clientHeight) {
|
|
22
30
|
top = document.body.clientHeight - menuHeight - 5;
|
|
23
31
|
} else {
|
|
24
32
|
top = _this.position.top;
|
|
25
33
|
}
|
|
34
|
+
|
|
26
35
|
var left = _this.position.left + 3;
|
|
36
|
+
|
|
27
37
|
_this.setState({
|
|
28
38
|
contextStyle: {
|
|
29
39
|
top: top,
|
|
@@ -33,12 +43,14 @@ var ContextMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
45
|
};
|
|
46
|
+
|
|
36
47
|
_this.tableUtils = props.tableUtils;
|
|
37
48
|
_this.state = {
|
|
38
49
|
contextStyle: {}
|
|
39
50
|
};
|
|
40
51
|
return _this;
|
|
41
52
|
}
|
|
53
|
+
|
|
42
54
|
_createClass(ContextMenu, [{
|
|
43
55
|
key: "componentDidMount",
|
|
44
56
|
value: function componentDidMount() {
|
|
@@ -54,6 +66,7 @@ var ContextMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
54
66
|
key: "render",
|
|
55
67
|
value: function render() {
|
|
56
68
|
var _this2 = this;
|
|
69
|
+
|
|
57
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
71
|
role: 'menu',
|
|
59
72
|
style: this.state.contextStyle,
|
|
@@ -92,6 +105,8 @@ var ContextMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
92
105
|
}, this.props.t('Remove_Column')));
|
|
93
106
|
}
|
|
94
107
|
}]);
|
|
108
|
+
|
|
95
109
|
return ContextMenu;
|
|
96
110
|
}(React.Component);
|
|
111
|
+
|
|
97
112
|
export default withTranslation('seafile-editor')(ContextMenu);
|
|
@@ -3,13 +3,18 @@ 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, { Children } from 'react';
|
|
6
|
+
|
|
6
7
|
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
7
8
|
_inherits(ErrorBoundary, _React$Component);
|
|
9
|
+
|
|
8
10
|
var _super = _createSuper(ErrorBoundary);
|
|
11
|
+
|
|
9
12
|
function ErrorBoundary() {
|
|
10
13
|
_classCallCheck(this, ErrorBoundary);
|
|
14
|
+
|
|
11
15
|
return _super.apply(this, arguments);
|
|
12
16
|
}
|
|
17
|
+
|
|
13
18
|
_createClass(ErrorBoundary, [{
|
|
14
19
|
key: "componentDidCatch",
|
|
15
20
|
value: function componentDidCatch(error) {
|
|
@@ -23,6 +28,8 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
23
28
|
return children;
|
|
24
29
|
}
|
|
25
30
|
}]);
|
|
31
|
+
|
|
26
32
|
return ErrorBoundary;
|
|
27
33
|
}(React.Component);
|
|
34
|
+
|
|
28
35
|
export default ErrorBoundary;
|
|
@@ -3,13 +3,18 @@ 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
|
+
|
|
6
7
|
var Loading = /*#__PURE__*/function (_React$Component) {
|
|
7
8
|
_inherits(Loading, _React$Component);
|
|
9
|
+
|
|
8
10
|
var _super = _createSuper(Loading);
|
|
11
|
+
|
|
9
12
|
function Loading() {
|
|
10
13
|
_classCallCheck(this, Loading);
|
|
14
|
+
|
|
11
15
|
return _super.apply(this, arguments);
|
|
12
16
|
}
|
|
17
|
+
|
|
13
18
|
_createClass(Loading, [{
|
|
14
19
|
key: "render",
|
|
15
20
|
value: function render() {
|
|
@@ -20,6 +25,8 @@ var Loading = /*#__PURE__*/function (_React$Component) {
|
|
|
20
25
|
}, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null)));
|
|
21
26
|
}
|
|
22
27
|
}]);
|
|
28
|
+
|
|
23
29
|
return Loading;
|
|
24
30
|
}(React.Component);
|
|
31
|
+
|
|
25
32
|
export default Loading;
|
|
@@ -4,30 +4,42 @@ 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 '../assets/css/issue-card.css';
|
|
7
|
+
|
|
7
8
|
var MarkdownLint = /*#__PURE__*/function (_React$PureComponent) {
|
|
8
9
|
_inherits(MarkdownLint, _React$PureComponent);
|
|
10
|
+
|
|
9
11
|
var _super = _createSuper(MarkdownLint);
|
|
12
|
+
|
|
10
13
|
function MarkdownLint() {
|
|
11
14
|
var _this;
|
|
15
|
+
|
|
12
16
|
_classCallCheck(this, MarkdownLint);
|
|
17
|
+
|
|
13
18
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
19
|
args[_key] = arguments[_key];
|
|
15
20
|
}
|
|
21
|
+
|
|
16
22
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
23
|
+
|
|
17
24
|
_this.onClickCard = function (event, key) {
|
|
18
25
|
if (_this.props.document[key]) {
|
|
19
26
|
var node = _this.props.document[key];
|
|
20
27
|
node.key = key;
|
|
28
|
+
|
|
21
29
|
_this.props.scrollToNode(node);
|
|
22
30
|
}
|
|
23
31
|
};
|
|
32
|
+
|
|
24
33
|
return _this;
|
|
25
34
|
}
|
|
35
|
+
|
|
26
36
|
_createClass(MarkdownLint, [{
|
|
27
37
|
key: "render",
|
|
28
38
|
value: function render() {
|
|
29
39
|
var _this2 = this;
|
|
40
|
+
|
|
30
41
|
var issueCards = [];
|
|
42
|
+
|
|
31
43
|
if (this.props.issues.issue_list.length > 0) {
|
|
32
44
|
this.props.issues.issue_list.map(function (issue, index) {
|
|
33
45
|
if (issue.detail) {
|
|
@@ -57,9 +69,11 @@ var MarkdownLint = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
57
69
|
}, _this2.props.markdownLint[issue.issue_code].description));
|
|
58
70
|
issueCards.push(card);
|
|
59
71
|
}
|
|
72
|
+
|
|
60
73
|
return true;
|
|
61
74
|
});
|
|
62
75
|
}
|
|
76
|
+
|
|
63
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
64
78
|
className: 'issue-container'
|
|
65
79
|
}, issueCards.length > 0 ? issueCards : /*#__PURE__*/React.createElement("div", {
|
|
@@ -67,6 +81,8 @@ var MarkdownLint = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
67
81
|
}, this.props.t('no_document_improvement_suggestion')));
|
|
68
82
|
}
|
|
69
83
|
}]);
|
|
84
|
+
|
|
70
85
|
return MarkdownLint;
|
|
71
86
|
}(React.PureComponent);
|
|
87
|
+
|
|
72
88
|
export default MarkdownLint;
|
|
@@ -5,29 +5,38 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import CheckMarkIcon from '../svg-icons/check-mark-icon';
|
|
7
7
|
import './style.css';
|
|
8
|
+
|
|
8
9
|
var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
9
10
|
_inherits(MenuItem, _React$Component);
|
|
11
|
+
|
|
10
12
|
var _super = _createSuper(MenuItem);
|
|
13
|
+
|
|
11
14
|
function MenuItem() {
|
|
12
15
|
var _this;
|
|
16
|
+
|
|
13
17
|
_classCallCheck(this, MenuItem);
|
|
18
|
+
|
|
14
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
20
|
args[_key] = arguments[_key];
|
|
16
21
|
}
|
|
22
|
+
|
|
17
23
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
24
|
+
|
|
18
25
|
_this.onClick = function (e) {
|
|
19
26
|
_this.props.onClick(e);
|
|
20
27
|
};
|
|
28
|
+
|
|
21
29
|
return _this;
|
|
22
30
|
}
|
|
31
|
+
|
|
23
32
|
_createClass(MenuItem, [{
|
|
24
33
|
key: "render",
|
|
25
34
|
value: function render() {
|
|
26
35
|
var _this$props = this.props,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
children = _this$props.children,
|
|
37
|
+
itemClass = _this$props.itemClass,
|
|
38
|
+
iconClass = _this$props.iconClass,
|
|
39
|
+
isChecked = _this$props.isChecked;
|
|
31
40
|
var containerClass = "seafile-menu-item ".concat(itemClass || '');
|
|
32
41
|
var itemIconClass = "menu-item-icon ".concat(iconClass || '');
|
|
33
42
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -44,6 +53,8 @@ var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
|
44
53
|
}));
|
|
45
54
|
}
|
|
46
55
|
}]);
|
|
56
|
+
|
|
47
57
|
return MenuItem;
|
|
48
58
|
}(React.Component);
|
|
59
|
+
|
|
49
60
|
export default MenuItem;
|
|
@@ -3,16 +3,23 @@ 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
|
+
|
|
6
7
|
var Menu = /*#__PURE__*/function (_React$Component) {
|
|
7
8
|
_inherits(Menu, _React$Component);
|
|
9
|
+
|
|
8
10
|
var _super = _createSuper(Menu);
|
|
11
|
+
|
|
9
12
|
function Menu() {
|
|
10
13
|
var _this;
|
|
14
|
+
|
|
11
15
|
_classCallCheck(this, Menu);
|
|
16
|
+
|
|
12
17
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
18
|
args[_key] = arguments[_key];
|
|
14
19
|
}
|
|
20
|
+
|
|
15
21
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
22
|
+
|
|
16
23
|
_this.getStyle = function () {
|
|
17
24
|
var position = _this.props.position;
|
|
18
25
|
var width = position.width;
|
|
@@ -21,8 +28,10 @@ var Menu = /*#__PURE__*/function (_React$Component) {
|
|
|
21
28
|
marginTop: '30px'
|
|
22
29
|
};
|
|
23
30
|
};
|
|
31
|
+
|
|
24
32
|
return _this;
|
|
25
33
|
}
|
|
34
|
+
|
|
26
35
|
_createClass(Menu, [{
|
|
27
36
|
key: "render",
|
|
28
37
|
value: function render() {
|
|
@@ -33,6 +42,8 @@ var Menu = /*#__PURE__*/function (_React$Component) {
|
|
|
33
42
|
}, this.props.children);
|
|
34
43
|
}
|
|
35
44
|
}]);
|
|
45
|
+
|
|
36
46
|
return Menu;
|
|
37
47
|
}(React.Component);
|
|
48
|
+
|
|
38
49
|
export default Menu;
|
|
@@ -4,12 +4,17 @@ 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
|
+
|
|
7
8
|
var ModalPortal = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inherits(ModalPortal, _React$Component);
|
|
10
|
+
|
|
9
11
|
var _super = _createSuper(ModalPortal);
|
|
12
|
+
|
|
10
13
|
function ModalPortal(props) {
|
|
11
14
|
var _this;
|
|
15
|
+
|
|
12
16
|
_classCallCheck(this, ModalPortal);
|
|
17
|
+
|
|
13
18
|
_this = _super.call(this, props);
|
|
14
19
|
_this.state = {
|
|
15
20
|
isMounted: false
|
|
@@ -17,6 +22,7 @@ var ModalPortal = /*#__PURE__*/function (_React$Component) {
|
|
|
17
22
|
_this.el = document.createElement('div');
|
|
18
23
|
return _this;
|
|
19
24
|
}
|
|
25
|
+
|
|
20
26
|
_createClass(ModalPortal, [{
|
|
21
27
|
key: "componentDidMount",
|
|
22
28
|
value: function componentDidMount() {
|
|
@@ -33,6 +39,8 @@ var ModalPortal = /*#__PURE__*/function (_React$Component) {
|
|
|
33
39
|
return ReactDOM.createPortal(this.props.children, this.el);
|
|
34
40
|
}
|
|
35
41
|
}]);
|
|
42
|
+
|
|
36
43
|
return ModalPortal;
|
|
37
44
|
}(React.Component);
|
|
45
|
+
|
|
38
46
|
export { ModalPortal as default };
|