@seafile/seafile-editor 0.3.136 → 0.3.139

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