@seafile/sdoc-editor 0.1.26 → 0.1.27-beta
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/pages/diff-viewer.js/diff-viewer.js +21 -0
- package/dist/pages/diff-viewer.js/history-version-viewer.js +10 -0
- package/dist/pages/diff-viewer.js/index.js +32 -0
- package/dist/pages/simple-editor.js +2 -1
- package/package.json +1 -1
- package/public/locales/en/sdoc-editor.json +3 -1
- package/public/locales/zh-CN/sdoc-editor.json +3 -1
- package/dist/config.js +0 -16
|
@@ -0,0 +1,21 @@
|
|
|
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, { Component } from 'react';
|
|
6
|
+
var DiffViewer = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inherits(DiffViewer, _Component);
|
|
8
|
+
var _super = _createSuper(DiffViewer);
|
|
9
|
+
function DiffViewer() {
|
|
10
|
+
_classCallCheck(this, DiffViewer);
|
|
11
|
+
return _super.apply(this, arguments);
|
|
12
|
+
}
|
|
13
|
+
_createClass(DiffViewer, [{
|
|
14
|
+
key: "render",
|
|
15
|
+
value: function render() {
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", null, "diff-viewer");
|
|
17
|
+
}
|
|
18
|
+
}]);
|
|
19
|
+
return DiffViewer;
|
|
20
|
+
}(Component);
|
|
21
|
+
export default DiffViewer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SDocViewer } from '../../basic-sdk';
|
|
3
|
+
import { generateDefaultDocContent } from '../../utils';
|
|
4
|
+
function HistoryVersionViewer(props) {
|
|
5
|
+
var document = props.document;
|
|
6
|
+
return /*#__PURE__*/React.createElement(SDocViewer, {
|
|
7
|
+
document: document || generateDefaultDocContent()
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export default HistoryVersionViewer;
|
|
@@ -0,0 +1,32 @@
|
|
|
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, { Component } from 'react';
|
|
6
|
+
import HistoryVersionViewer from './history-version-viewer';
|
|
7
|
+
import DiffViewer from './diff-viewer';
|
|
8
|
+
var Index = /*#__PURE__*/function (_Component) {
|
|
9
|
+
_inherits(Index, _Component);
|
|
10
|
+
var _super = _createSuper(Index);
|
|
11
|
+
function Index() {
|
|
12
|
+
_classCallCheck(this, Index);
|
|
13
|
+
return _super.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
_createClass(Index, [{
|
|
16
|
+
key: "render",
|
|
17
|
+
value: function render() {
|
|
18
|
+
var _this$props = this.props,
|
|
19
|
+
currentContent = _this$props.currentContent,
|
|
20
|
+
lastContent = _this$props.lastContent;
|
|
21
|
+
if (!currentContent) return null;
|
|
22
|
+
if (!lastContent) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(HistoryVersionViewer, {
|
|
24
|
+
document: currentContent
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/React.createElement(DiffViewer, this.props);
|
|
28
|
+
}
|
|
29
|
+
}]);
|
|
30
|
+
return Index;
|
|
31
|
+
}(Component);
|
|
32
|
+
export default Index;
|
|
@@ -117,11 +117,12 @@ var SimpleEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
117
117
|
}
|
|
118
118
|
var docName = context.getSetting('docName');
|
|
119
119
|
var isOpenSocket = context.getSetting('isOpenSocket');
|
|
120
|
+
var internalLink = context.getSetting('internalLink');
|
|
120
121
|
return /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
|
|
121
122
|
className: "doc-info"
|
|
122
123
|
}, /*#__PURE__*/React.createElement("div", {
|
|
123
124
|
className: "doc-name"
|
|
124
|
-
}, docName), /*#__PURE__*/React.createElement(TipMessage, null)), /*#__PURE__*/React.createElement(DocOperations, null)), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(SDocEditor, {
|
|
125
|
+
}, docName), internalLink, /*#__PURE__*/React.createElement(TipMessage, null)), /*#__PURE__*/React.createElement(DocOperations, null)), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(SDocEditor, {
|
|
125
126
|
ref: this.setEditorRef,
|
|
126
127
|
config: context.getEditorConfig(),
|
|
127
128
|
document: document,
|
package/package.json
CHANGED
|
@@ -236,5 +236,7 @@
|
|
|
236
236
|
"Server_is_reconnected": "Server is reconnected.",
|
|
237
237
|
"Outline": "Outline",
|
|
238
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
|
+
"Open_parent_folder": "Open parent folder",
|
|
240
|
+
"redo": "redo",
|
|
241
|
+
"undo": "undo"
|
|
240
242
|
}
|
|
@@ -230,5 +230,7 @@
|
|
|
230
230
|
"Server_is_disconnected_Reconnecting": "服务器断开连接。正在重新连接...",
|
|
231
231
|
"Server_is_reconnected": "服务器已重新连接。",
|
|
232
232
|
"Outline": "目录",
|
|
233
|
-
"Headings_you_add_to_the_document_will_appear_here": "您添加到文档中的标题将显示在此处"
|
|
233
|
+
"Headings_you_add_to_the_document_will_appear_here": "您添加到文档中的标题将显示在此处",
|
|
234
|
+
"redo": "重做",
|
|
235
|
+
"undo": "撤销"
|
|
234
236
|
}
|
package/dist/config.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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 };
|