@seafile/sdoc-editor 0.1.23 → 0.1.25
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/basic-sdk/editor.js
CHANGED
|
@@ -63,7 +63,6 @@ var SDocEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
63
63
|
value: function render() {
|
|
64
64
|
var _this2 = this;
|
|
65
65
|
var slateValue = this.state.slateValue;
|
|
66
|
-
var doc = this.props.document;
|
|
67
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
68
67
|
className: "sdoc-editor-container"
|
|
69
68
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
@@ -71,7 +70,7 @@ var SDocEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
71
70
|
}), /*#__PURE__*/React.createElement("div", {
|
|
72
71
|
className: "sdoc-editor-content"
|
|
73
72
|
}, /*#__PURE__*/React.createElement(SDocOutline, {
|
|
74
|
-
doc:
|
|
73
|
+
doc: slateValue
|
|
75
74
|
}), /*#__PURE__*/React.createElement("div", {
|
|
76
75
|
className: "flex-fill o-auto"
|
|
77
76
|
}, /*#__PURE__*/React.createElement(Slate, {
|
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
|
6
6
|
import { withTranslation } from 'react-i18next';
|
|
7
7
|
import { UncontrolledTooltip } from 'reactstrap';
|
|
8
8
|
import './assets/css/outline.css';
|
|
9
|
-
var SDocOutline = /*#__PURE__*/function (_React$
|
|
10
|
-
_inherits(SDocOutline, _React$
|
|
9
|
+
var SDocOutline = /*#__PURE__*/function (_React$PureComponent) {
|
|
10
|
+
_inherits(SDocOutline, _React$PureComponent);
|
|
11
11
|
var _super = _createSuper(SDocOutline);
|
|
12
12
|
function SDocOutline(props) {
|
|
13
13
|
var _this;
|
|
@@ -30,7 +30,7 @@ var SDocOutline = /*#__PURE__*/function (_React$Component) {
|
|
|
30
30
|
doc = _this$props.doc,
|
|
31
31
|
t = _this$props.t;
|
|
32
32
|
var isShown = this.state.isShown;
|
|
33
|
-
var list = doc.
|
|
33
|
+
var list = doc.filter(function (item) {
|
|
34
34
|
return item.type == 'header2' || item.type == 'header3';
|
|
35
35
|
});
|
|
36
36
|
return isShown ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -65,9 +65,9 @@ var SDocOutline = /*#__PURE__*/function (_React$Component) {
|
|
|
65
65
|
}
|
|
66
66
|
}]);
|
|
67
67
|
return SDocOutline;
|
|
68
|
-
}(React.
|
|
69
|
-
var OutlineItem = /*#__PURE__*/function (_React$
|
|
70
|
-
_inherits(OutlineItem, _React$
|
|
68
|
+
}(React.PureComponent);
|
|
69
|
+
var OutlineItem = /*#__PURE__*/function (_React$PureComponent2) {
|
|
70
|
+
_inherits(OutlineItem, _React$PureComponent2);
|
|
71
71
|
var _super2 = _createSuper(OutlineItem);
|
|
72
72
|
function OutlineItem(props) {
|
|
73
73
|
var _this2;
|
|
@@ -98,8 +98,7 @@ var OutlineItem = /*#__PURE__*/function (_React$Component2) {
|
|
|
98
98
|
value: function render() {
|
|
99
99
|
var isHighlighted = this.state.isHighlighted;
|
|
100
100
|
var item = this.props.item;
|
|
101
|
-
var
|
|
102
|
-
type = item.type,
|
|
101
|
+
var type = item.type,
|
|
103
102
|
children = item.children;
|
|
104
103
|
return /*#__PURE__*/React.createElement("li", {
|
|
105
104
|
className: "outline-item ".concat(type == 'header3' ? 'pl-5' : '', " ").concat(isHighlighted ? 'active' : ''),
|
|
@@ -110,5 +109,5 @@ var OutlineItem = /*#__PURE__*/function (_React$Component2) {
|
|
|
110
109
|
}
|
|
111
110
|
}]);
|
|
112
111
|
return OutlineItem;
|
|
113
|
-
}(React.
|
|
112
|
+
}(React.PureComponent);
|
|
114
113
|
export default withTranslation('sdoc-editor')(SDocOutline);
|
|
@@ -3,32 +3,49 @@ 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, { Fragment } from 'react';
|
|
6
|
+
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
6
7
|
import CollaboratorsOperation from './collaborators-operation';
|
|
7
8
|
import context from '../../context';
|
|
9
|
+
import { withTranslation } from 'react-i18next';
|
|
8
10
|
import './style.css';
|
|
9
11
|
var DocOperations = /*#__PURE__*/function (_React$Component) {
|
|
10
12
|
_inherits(DocOperations, _React$Component);
|
|
11
13
|
var _super = _createSuper(DocOperations);
|
|
12
|
-
function DocOperations() {
|
|
14
|
+
function DocOperations(props) {
|
|
13
15
|
var _this;
|
|
14
16
|
_classCallCheck(this, DocOperations);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
_this = _super.call(this, props);
|
|
18
|
+
_this.toggleDropdown = function () {
|
|
19
|
+
_this.setState({
|
|
20
|
+
isDropdownOpen: !_this.state.isDropdownOpen
|
|
21
|
+
});
|
|
22
|
+
};
|
|
19
23
|
_this.toggleHistory = function (event) {
|
|
20
24
|
event.stopPropagation();
|
|
21
25
|
event.nativeEvent.stopImmediatePropagation();
|
|
22
26
|
var historyURL = context.getSetting('historyURL');
|
|
23
27
|
window.location.href = historyURL;
|
|
24
28
|
};
|
|
29
|
+
_this.state = {
|
|
30
|
+
isDropdownOpen: false
|
|
31
|
+
};
|
|
25
32
|
return _this;
|
|
26
33
|
}
|
|
27
34
|
_createClass(DocOperations, [{
|
|
28
35
|
key: "render",
|
|
29
36
|
value: function render() {
|
|
37
|
+
var t = this.props.t;
|
|
38
|
+
var isDropdownOpen = this.state.isDropdownOpen;
|
|
30
39
|
var docPerm = context.getSetting('docPerm');
|
|
31
40
|
var historyURL = context.getSetting('historyURL');
|
|
41
|
+
var parentFolderURL = context.getSetting('parentFolderURL');
|
|
42
|
+
var dropdownItems = [];
|
|
43
|
+
if (parentFolderURL) {
|
|
44
|
+
dropdownItems.push({
|
|
45
|
+
text: t('Open_parent_folder'),
|
|
46
|
+
URL: parentFolderURL
|
|
47
|
+
});
|
|
48
|
+
}
|
|
32
49
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
33
50
|
className: "doc-ops"
|
|
34
51
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -40,13 +57,25 @@ var DocOperations = /*#__PURE__*/function (_React$Component) {
|
|
|
40
57
|
onClick: this.toggleHistory
|
|
41
58
|
}, /*#__PURE__*/React.createElement("i", {
|
|
42
59
|
className: "iconfont icon-history"
|
|
43
|
-
})), /*#__PURE__*/React.createElement(CollaboratorsOperation, null), /*#__PURE__*/React.createElement(
|
|
44
|
-
|
|
60
|
+
})), /*#__PURE__*/React.createElement(CollaboratorsOperation, null), dropdownItems.length > 0 && /*#__PURE__*/React.createElement(Dropdown, {
|
|
61
|
+
isOpen: isDropdownOpen,
|
|
62
|
+
toggle: this.toggleDropdown
|
|
63
|
+
}, /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
64
|
+
className: "op-item",
|
|
65
|
+
tag: "span"
|
|
45
66
|
}, /*#__PURE__*/React.createElement("i", {
|
|
46
67
|
className: "iconfont icon-menu"
|
|
47
|
-
}))
|
|
68
|
+
})), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
69
|
+
right: true
|
|
70
|
+
}, dropdownItems.map(function (item, index) {
|
|
71
|
+
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
72
|
+
tag: "a",
|
|
73
|
+
href: item.URL,
|
|
74
|
+
key: index
|
|
75
|
+
}, item.text);
|
|
76
|
+
})))));
|
|
48
77
|
}
|
|
49
78
|
}]);
|
|
50
79
|
return DocOperations;
|
|
51
80
|
}(React.Component);
|
|
52
|
-
export default DocOperations;
|
|
81
|
+
export default withTranslation('sdoc-editor')(DocOperations);
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var serverConfig = {
|
|
2
|
+
//serviceUrl: "http://127.0.0.1:8000",
|
|
3
|
+
serviceUrl: "http://192.168.1.100:8000",
|
|
4
|
+
username: "lj@11.com",
|
|
5
|
+
password: "11",
|
|
6
|
+
repoID: "79d1fa93-4b5f-4d6c-8fb5-ad3958e1fa47",
|
|
7
|
+
userInfo: {
|
|
8
|
+
username: 'lj@11.com',
|
|
9
|
+
name: 'lj-',
|
|
10
|
+
contact_email: 'lj@11.com'
|
|
11
|
+
},
|
|
12
|
+
filePath: '/xxx.md',
|
|
13
|
+
fileName: 'xxx.md',
|
|
14
|
+
dirPath: '/'
|
|
15
|
+
};
|
|
16
|
+
export { serverConfig };
|
package/package.json
CHANGED
|
@@ -235,5 +235,6 @@
|
|
|
235
235
|
"Server_is_disconnected_Reconnecting": "Server is disconnected. Reconnecting...",
|
|
236
236
|
"Server_is_reconnected": "Server is reconnected.",
|
|
237
237
|
"Outline": "Outline",
|
|
238
|
-
"Headings_you_add_to_the_document_will_appear_here": "Headings you add to the document will appear here"
|
|
238
|
+
"Headings_you_add_to_the_document_will_appear_here": "Headings you add to the document will appear here",
|
|
239
|
+
"Open_parent_folder": "Open parent folder"
|
|
239
240
|
}
|