@seafile/sdoc-editor 0.1.21 → 0.1.22
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/assets/css/sdoc-editor-toolbar.css +5 -0
- package/dist/basic-sdk/extension/constants/index.js +4 -4
- package/dist/basic-sdk/extension/menu/menu-item.js +6 -4
- package/dist/basic-sdk/extension/plugins/header/menu/index.js +12 -8
- package/package.json +1 -1
- package/public/locales/zh-CN/sdoc-editor.json +3 -1
- package/dist/config.js +0 -16
|
@@ -33,7 +33,7 @@ export var BOLD_ITALIC = 'bold-italic';
|
|
|
33
33
|
|
|
34
34
|
// menus config
|
|
35
35
|
export var MENUS_CONFIG_MAP = (_MENUS_CONFIG_MAP = {}, _defineProperty(_MENUS_CONFIG_MAP, BLOCKQUOTE, {
|
|
36
|
-
id:
|
|
36
|
+
id: "sdoc_".concat(BLOCKQUOTE),
|
|
37
37
|
iconClass: 'iconfont icon-quote-left',
|
|
38
38
|
text: 'quote'
|
|
39
39
|
}), _defineProperty(_MENUS_CONFIG_MAP, ORDERED_LIST, {
|
|
@@ -53,9 +53,9 @@ export var MENUS_CONFIG_MAP = (_MENUS_CONFIG_MAP = {}, _defineProperty(_MENUS_CO
|
|
|
53
53
|
iconClass: 'iconfont icon-code-block',
|
|
54
54
|
text: 'code-block'
|
|
55
55
|
}), _defineProperty(_MENUS_CONFIG_MAP, LINK, {
|
|
56
|
-
id: LINK,
|
|
56
|
+
id: "sdoc_".concat(LINK),
|
|
57
57
|
iconClass: 'iconfont icon-link',
|
|
58
|
-
text: '
|
|
58
|
+
text: 'insert_link'
|
|
59
59
|
}), _defineProperty(_MENUS_CONFIG_MAP, TEXTSTYLE, [{
|
|
60
60
|
id: ITALIC,
|
|
61
61
|
iconClass: 'iconfont icon-italic',
|
|
@@ -67,4 +67,4 @@ export var MENUS_CONFIG_MAP = (_MENUS_CONFIG_MAP = {}, _defineProperty(_MENUS_CO
|
|
|
67
67
|
text: 'bold',
|
|
68
68
|
type: 'BOLD'
|
|
69
69
|
}]), _MENUS_CONFIG_MAP);
|
|
70
|
-
export var HEADER_TITLE_MAP = (_HEADER_TITLE_MAP = {}, _defineProperty(_HEADER_TITLE_MAP, HEADER1, '
|
|
70
|
+
export var HEADER_TITLE_MAP = (_HEADER_TITLE_MAP = {}, _defineProperty(_HEADER_TITLE_MAP, HEADER1, 'header_one'), _defineProperty(_HEADER_TITLE_MAP, HEADER2, 'header_two'), _defineProperty(_HEADER_TITLE_MAP, HEADER3, 'header_three'), _defineProperty(_HEADER_TITLE_MAP, HEADER4, 'header_four'), _defineProperty(_HEADER_TITLE_MAP, HEADER5, 'header_five'), _defineProperty(_HEADER_TITLE_MAP, HEADER6, 'header_six'), _defineProperty(_HEADER_TITLE_MAP, PARAGRAPH, 'paragraph'), _HEADER_TITLE_MAP);
|
|
@@ -4,6 +4,7 @@ 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 { Tooltip } from 'reactstrap';
|
|
7
|
+
import { withTranslation } from 'react-i18next';
|
|
7
8
|
var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
8
9
|
_inherits(MenuItem, _React$Component);
|
|
9
10
|
var _super = _createSuper(MenuItem);
|
|
@@ -20,7 +21,7 @@ var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
|
20
21
|
};
|
|
21
22
|
_this.toggle = function () {
|
|
22
23
|
_this.setState({
|
|
23
|
-
isShowToolTip:
|
|
24
|
+
isShowToolTip: !_this.state.isShowToolTip
|
|
24
25
|
});
|
|
25
26
|
};
|
|
26
27
|
_this.getClassName = function () {
|
|
@@ -46,7 +47,8 @@ var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
|
46
47
|
isActive = _this$props2.isActive,
|
|
47
48
|
id = _this$props2.id,
|
|
48
49
|
iconClass = _this$props2.iconClass,
|
|
49
|
-
text = _this$props2.text
|
|
50
|
+
text = _this$props2.text,
|
|
51
|
+
t = _this$props2.t;
|
|
50
52
|
var isShowToolTip = this.state.isShowToolTip;
|
|
51
53
|
var className = this.getClassName();
|
|
52
54
|
var delay = {
|
|
@@ -69,7 +71,7 @@ var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
|
69
71
|
delay: delay,
|
|
70
72
|
placement: "bottom",
|
|
71
73
|
toggle: this.toggle
|
|
72
|
-
}, text));
|
|
74
|
+
}, t(text)));
|
|
73
75
|
}
|
|
74
76
|
}]);
|
|
75
77
|
return MenuItem;
|
|
@@ -78,4 +80,4 @@ MenuItem.defaultProps = {
|
|
|
78
80
|
isRichEditor: true,
|
|
79
81
|
className: 'menu-group-item'
|
|
80
82
|
};
|
|
81
|
-
export default MenuItem;
|
|
83
|
+
export default withTranslation('sdoc-editor')(MenuItem);
|
|
@@ -3,6 +3,7 @@ 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
|
+
import { withTranslation } from 'react-i18next';
|
|
6
7
|
import { getHeaderType, isMenuDisabled, setHeaderType } from '../helpers';
|
|
7
8
|
import { HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, HEADER_TITLE_MAP, PARAGRAPH } from '../../../constants';
|
|
8
9
|
var HeaderMenu = /*#__PURE__*/function (_React$Component) {
|
|
@@ -72,6 +73,7 @@ var HeaderMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
72
73
|
_createClass(HeaderMenu, [{
|
|
73
74
|
key: "render",
|
|
74
75
|
value: function render() {
|
|
76
|
+
var t = this.props.t;
|
|
75
77
|
var isShowHeaderPopover = this.state.isShowHeaderPopover;
|
|
76
78
|
var headerIconClass = "iconfont icon-".concat(isShowHeaderPopover ? 'caret-up' : 'drop-down');
|
|
77
79
|
var headerType = this.getValue();
|
|
@@ -89,27 +91,29 @@ var HeaderMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
89
91
|
}, /*#__PURE__*/React.createElement("div", {
|
|
90
92
|
className: "header-menu-item",
|
|
91
93
|
onClick: this.onMouseDown(PARAGRAPH)
|
|
92
|
-
}, HEADER_TITLE_MAP.paragraph), /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
}, t(HEADER_TITLE_MAP.paragraph)), /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "header-divider"
|
|
96
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
93
97
|
className: "header-menu-item",
|
|
94
98
|
onClick: this.onMouseDown(HEADER1)
|
|
95
|
-
}, HEADER_TITLE_MAP.header1), /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
}, t(HEADER_TITLE_MAP.header1)), /*#__PURE__*/React.createElement("div", {
|
|
96
100
|
className: "header-menu-item",
|
|
97
101
|
onClick: this.onMouseDown(HEADER2)
|
|
98
|
-
}, HEADER_TITLE_MAP.header2), /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
}, t(HEADER_TITLE_MAP.header2)), /*#__PURE__*/React.createElement("div", {
|
|
99
103
|
className: "header-menu-item",
|
|
100
104
|
onClick: this.onMouseDown(HEADER3)
|
|
101
|
-
}, HEADER_TITLE_MAP.header3), /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
}, t(HEADER_TITLE_MAP.header3)), /*#__PURE__*/React.createElement("div", {
|
|
102
106
|
className: "header-menu-item",
|
|
103
107
|
onClick: this.onMouseDown(HEADER4)
|
|
104
|
-
}, HEADER_TITLE_MAP.header4), /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
}, t(HEADER_TITLE_MAP.header4)), /*#__PURE__*/React.createElement("div", {
|
|
105
109
|
className: "header-menu-item",
|
|
106
110
|
onClick: this.onMouseDown(HEADER5)
|
|
107
|
-
}, HEADER_TITLE_MAP.header5), /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
}, t(HEADER_TITLE_MAP.header5)), /*#__PURE__*/React.createElement("div", {
|
|
108
112
|
className: "header-menu-item",
|
|
109
113
|
onClick: this.onMouseDown(HEADER6)
|
|
110
|
-
}, HEADER_TITLE_MAP.header6)));
|
|
114
|
+
}, t(HEADER_TITLE_MAP.header6))));
|
|
111
115
|
}
|
|
112
116
|
}]);
|
|
113
117
|
return HeaderMenu;
|
|
114
118
|
}(React.Component);
|
|
115
|
-
export default HeaderMenu;
|
|
119
|
+
export default withTranslation('sdoc-editor')(HeaderMenu);
|
package/package.json
CHANGED
|
@@ -228,5 +228,7 @@
|
|
|
228
228
|
"me": "我",
|
|
229
229
|
"Server_is_not_connected_Operation_will_be_sent_to_server_later": "服务器未连接。 操作稍后将发送到服务器。",
|
|
230
230
|
"Server_is_disconnected_Reconnecting": "服务器断开连接。正在重新连接...",
|
|
231
|
-
"Server_is_reconnected": "服务器已重新连接。"
|
|
231
|
+
"Server_is_reconnected": "服务器已重新连接。",
|
|
232
|
+
"Outline": "目录",
|
|
233
|
+
"Headings_you_add_to_the_document_will_appear_here": "您添加到文档中的标题将显示在此处"
|
|
232
234
|
}
|
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 };
|