@seafile/sdoc-editor 0.1.28 → 0.1.29
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.
|
@@ -7,3 +7,14 @@
|
|
|
7
7
|
font-size: 18px;
|
|
8
8
|
color: #212529;
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
.sdoc-editor-page-header .doc-info .doc-icon {
|
|
12
|
+
margin-left: 0.5rem;
|
|
13
|
+
color: #999;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sdoc-editor-page-header .doc-info .doc-icon:hover {
|
|
18
|
+
margin-left: 0.5rem;
|
|
19
|
+
color: #333;
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 TipMessage from '../tip-message';
|
|
7
|
+
import { withTranslation } from 'react-i18next';
|
|
8
|
+
import context from '../../context';
|
|
9
|
+
import { EventBus } from '../../basic-sdk';
|
|
10
|
+
import { EXTERNAL_EVENT } from '../../constants';
|
|
11
|
+
var DocInfo = /*#__PURE__*/function (_React$Component) {
|
|
12
|
+
_inherits(DocInfo, _React$Component);
|
|
13
|
+
var _super = _createSuper(DocInfo);
|
|
14
|
+
function DocInfo() {
|
|
15
|
+
var _this;
|
|
16
|
+
_classCallCheck(this, DocInfo);
|
|
17
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
|
+
args[_key] = arguments[_key];
|
|
19
|
+
}
|
|
20
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
21
|
+
_this.onInternalLinkClick = function () {
|
|
22
|
+
var eventBus = EventBus.getInstance();
|
|
23
|
+
eventBus.dispatch(EXTERNAL_EVENT.INTERNAL_LINK_CLICK);
|
|
24
|
+
};
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
_createClass(DocInfo, [{
|
|
28
|
+
key: "render",
|
|
29
|
+
value: function render() {
|
|
30
|
+
var t = this.props.t;
|
|
31
|
+
var docName = context.getSetting('docName');
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "doc-info"
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "doc-name"
|
|
36
|
+
}, docName), /*#__PURE__*/React.createElement("span", {
|
|
37
|
+
className: "doc-icon"
|
|
38
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
39
|
+
className: "internal-link iconfont icon-link",
|
|
40
|
+
title: t('internal_link'),
|
|
41
|
+
onClick: this.onInternalLinkClick
|
|
42
|
+
})), /*#__PURE__*/React.createElement(TipMessage, null));
|
|
43
|
+
}
|
|
44
|
+
}]);
|
|
45
|
+
return DocInfo;
|
|
46
|
+
}(React.Component);
|
|
47
|
+
export default withTranslation('sdoc-editor')(DocInfo);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SDocViewer } from './basic-sdk';
|
|
1
|
+
import { SDocViewer, EventBus } from './basic-sdk';
|
|
2
|
+
import { EXTERNAL_EVENT } from './constants';
|
|
2
3
|
import SimpleEditor from './pages/simple-editor';
|
|
3
4
|
import SimpleViewer from './pages/simple-viewer';
|
|
4
|
-
export { SDocViewer, SimpleEditor, SimpleViewer };
|
|
5
|
+
export { SDocViewer, SimpleEditor, SimpleViewer, EventBus, EXTERNAL_EVENT };
|
|
@@ -7,7 +7,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { SDocEditor } from '../basic-sdk';
|
|
9
9
|
import Loading from '../components/loading';
|
|
10
|
-
import
|
|
10
|
+
import DocInfo from '../components/doc-info';
|
|
11
11
|
import DocOperations from '../components/doc-operations';
|
|
12
12
|
import Layout, { Header, Content } from '../layout';
|
|
13
13
|
import { generateDefaultDocContent } from '../utils';
|
|
@@ -115,14 +115,8 @@ var SimpleEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
115
115
|
className: "d-flex justify-content-center"
|
|
116
116
|
}, errorMessage);
|
|
117
117
|
}
|
|
118
|
-
var docName = context.getSetting('docName');
|
|
119
118
|
var isOpenSocket = context.getSetting('isOpenSocket');
|
|
120
|
-
|
|
121
|
-
return /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
|
|
122
|
-
className: "doc-info"
|
|
123
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: "doc-name"
|
|
125
|
-
}, docName), internalLink, /*#__PURE__*/React.createElement(TipMessage, null)), /*#__PURE__*/React.createElement(DocOperations, null)), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(SDocEditor, {
|
|
119
|
+
return /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(DocInfo, null), /*#__PURE__*/React.createElement(DocOperations, null)), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(SDocEditor, {
|
|
126
120
|
ref: this.setEditorRef,
|
|
127
121
|
config: context.getEditorConfig(),
|
|
128
122
|
document: document,
|
package/package.json
CHANGED
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 };
|