@seafile/sdoc-editor 0.1.82 → 0.1.84
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/layout.css +33 -7
- package/dist/basic-sdk/comment/color-menu/color-item.js +22 -0
- package/dist/basic-sdk/comment/color-menu/index.css +109 -0
- package/dist/basic-sdk/comment/color-menu/index.js +199 -0
- package/dist/basic-sdk/comment/style.css +1 -0
- package/dist/basic-sdk/constants/index.js +1 -0
- package/dist/basic-sdk/editor.js +45 -4
- package/dist/basic-sdk/extension/constants/color.js +265 -0
- package/dist/basic-sdk/extension/constants/index.js +9 -2
- package/dist/basic-sdk/extension/plugins/header/menu/style.css +1 -1
- package/dist/basic-sdk/extension/plugins/header/plugin.js +2 -1
- package/dist/basic-sdk/extension/plugins/image/helpers.js +1 -3
- package/dist/basic-sdk/extension/plugins/image/menu/style.css +2 -2
- package/dist/basic-sdk/extension/plugins/image/plugin.js +21 -0
- package/dist/basic-sdk/extension/plugins/table/helpers.js +386 -49
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/common-menu.js +4 -0
- package/dist/basic-sdk/extension/plugins/table/menu/active-table-menu/index.js +40 -13
- package/dist/basic-sdk/extension/plugins/table/plugin.js +138 -214
- package/dist/basic-sdk/extension/plugins/table/render/index.js +38 -8
- package/dist/basic-sdk/extension/plugins/table/render/render-cell.js +16 -7
- package/dist/basic-sdk/extension/plugins/table/render/table-header/rows-header/row-header.js +2 -2
- package/dist/basic-sdk/extension/plugins/text-align/menu/style.css +1 -1
- package/dist/basic-sdk/node-id/helpers.js +18 -0
- package/dist/basic-sdk/node-id/index.js +3 -3
- package/dist/basic-sdk/outline/index.js +75 -0
- package/dist/basic-sdk/outline/outline-item.js +52 -0
- package/dist/basic-sdk/outline/style.css +83 -0
- package/dist/basic-sdk/utils/event-handler.js +9 -1
- package/dist/basic-sdk/utils/object-utils.js +3 -0
- package/dist/basic-sdk/views/viewer.js +6 -4
- package/dist/components/code-block-hover-menu/index.css +1 -1
- package/dist/components/doc-info/index.js +3 -1
- package/dist/components/draft-dropdown/index.js +77 -0
- package/dist/components/draft-dropdown/style.css +43 -0
- package/dist/components/more-dropdown/index.js +10 -3
- package/dist/components/more-dropdown/style.css +1 -1
- package/dist/constants/index.js +3 -1
- package/dist/pages/simple-editor.js +2 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/local-storage-utils.js +49 -0
- package/package.json +2 -1
- package/public/locales/en/sdoc-editor.json +46 -1
- package/public/locales/zh-CN/sdoc-editor.json +46 -1
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +4 -0
- package/public/media/sdoc-editor-font/iconfont.ttf +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff2 +0 -0
- package/public/media/sdoc-editor-font.css +14 -6
- package/dist/basic-sdk/assets/css/outline.css +0 -52
- package/dist/basic-sdk/outline.js +0 -125
|
@@ -260,5 +260,50 @@
|
|
|
260
260
|
"Start_revise": "开始修订",
|
|
261
261
|
"Failed_to_execute_operation_on_server": "无法在服务器上执行操作",
|
|
262
262
|
"Start_revise_tip": "创建一个临时文档并对其进行修订,检查更改后将其合并回来",
|
|
263
|
-
"Load_doc_content_error": "加载文档内容错误"
|
|
263
|
+
"Load_doc_content_error": "加载文档内容错误",
|
|
264
|
+
"Draft": "草稿",
|
|
265
|
+
"Unmark_as_draft": "取消草稿标记",
|
|
266
|
+
"Background_color": "背景色",
|
|
267
|
+
"No_color": "无颜色",
|
|
268
|
+
"Standard_color": "标准色",
|
|
269
|
+
"Recently_used": "最近使用",
|
|
270
|
+
"More_color": "更多颜色",
|
|
271
|
+
"White": "白",
|
|
272
|
+
"Black": "黑",
|
|
273
|
+
"Blue_grey": "蓝灰",
|
|
274
|
+
"Blue": "蓝",
|
|
275
|
+
"Sky_blue": "天蓝",
|
|
276
|
+
"Green": "绿",
|
|
277
|
+
"Red": "红",
|
|
278
|
+
"Orange": "橙",
|
|
279
|
+
"Yellow": "黄",
|
|
280
|
+
"Purple": "紫",
|
|
281
|
+
"Light_grey_x": "浅灰 {{value}}",
|
|
282
|
+
"Dark_grey_x": "深灰 {{value}}",
|
|
283
|
+
"Light_blue_grey_x": "浅蓝灰 {{value}}",
|
|
284
|
+
"Light_blue_x": "浅蓝 {{value}}",
|
|
285
|
+
"Light_sky_blue_x": "浅天蓝 {{value}}",
|
|
286
|
+
"Light_green_x": "浅绿 {{value}}",
|
|
287
|
+
"Light_red_x": "浅红 {{value}}",
|
|
288
|
+
"Light_orange_x": "浅橙 {{value}}",
|
|
289
|
+
"Light_yellow_x": "浅黄 {{value}}",
|
|
290
|
+
"Light_purple_x": "浅紫 {{value}}",
|
|
291
|
+
"Dark_blue_grey_x": "深蓝灰 {{value}}",
|
|
292
|
+
"Dark_blue_x": "深蓝 {{value}}",
|
|
293
|
+
"Dark_sky_blue_x": "深天蓝 {{value}}",
|
|
294
|
+
"Dark_green_x": "深绿 {{value}}",
|
|
295
|
+
"Dark_red_x": "深红 {{value}}",
|
|
296
|
+
"Dark_orange_x": "深橙 {{value}}",
|
|
297
|
+
"Dark_yellow_x": "深黄 {{value}}",
|
|
298
|
+
"Dark_purple_x": "深紫 {{value}}",
|
|
299
|
+
"Standard_dark_red": "标准深红",
|
|
300
|
+
"Standard_red": "标准红",
|
|
301
|
+
"Standard_orange": "标准橙",
|
|
302
|
+
"Standard_yellow": "标准黄",
|
|
303
|
+
"Standard_light_green": "标准浅绿",
|
|
304
|
+
"Standard_green": "标准绿",
|
|
305
|
+
"Standard_light_blue": "标准浅蓝",
|
|
306
|
+
"Standard_blue": "标准蓝",
|
|
307
|
+
"Standard_dark_blue": "标准深蓝",
|
|
308
|
+
"Standard_purple": "标准紫"
|
|
264
309
|
}
|
|
Binary file
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<missing-glyph />
|
|
16
16
|
|
|
17
|
+
<glyph glyph-name="sdoc-bg-color" unicode="" d="M906.4-64c60.8 0 105.6 48 105.6 105.6 0 38.4-35.2 124.8-105.6 246.4C836 160 800.8 80 800.8 41.6c0-60.8 48-105.6 105.6-105.6zM512.8 761.6l358.4-352c35.2-35.2 35.2-92.8 0-128l-358.4-352c-35.2-35.2-92.8-35.2-131.2 0l-355.2 352c-35.2 35.2-35.2 92.8 0 128L356 736l-19.2 19.2c-25.6 22.4-25.6 64 0 89.6s64 22.4 89.6 0l86.4-83.2z m-368-400h614.4L452 649.6c0-3.2-307.2-288-307.2-288z" horiz-adv-x="1024" />
|
|
18
|
+
|
|
19
|
+
<glyph glyph-name="sdoc-right-slide" unicode="" d="M806.4 438.4L336 812.8c-54.4 44.8-144 9.6-144-54.4v-748.8c0-64 86.4-99.2 144-54.4l470.4 374.4c35.2 28.8 35.2 80 0 108.8z" horiz-adv-x="1024" />
|
|
20
|
+
|
|
17
21
|
<glyph glyph-name="sdoc-superscript" unicode="" d="M659.62016 812.8c22.4 22.4 57.6 25.6 83.2 6.4l6.4-6.4 3.2-3.2c22.4-22.4 25.6-57.6 9.6-83.2l-6.4-6.4L474.02016 384l281.6-336c22.4-25.6 22.4-67.2-3.2-92.8l-3.2-3.2c-12.8-9.6-28.8-16-44.8-16-16 0-32 6.4-44.8 19.2l-3.2 3.2L384.42016 281.6 112.42016-44.8l-3.2-3.2c-22.4-22.4-57.6-25.6-80-6.4l-6.4 6.4-3.2 3.2c-22.4 22.4-25.6 57.6-9.6 83.2l6.4 6.4L298.02016 384 16.42016 720c-22.4 25.6-22.4 67.2 3.2 92.8l3.2 3.2c12.8 9.6 28.8 16 44.8 16s32-6.4 44.8-19.2l3.2-3.2 272-320 272 323.2z m259.2 19.2c28.8 0 54.4-9.6 73.6-25.6 22.4-19.2 32-41.6 32-70.4 0-28.8-9.6-51.2-32-73.6-9.6-12.8-28.8-25.6-54.4-41.6l-9.6-9.6c-32-22.4-51.2-38.4-57.6-54.4H1024.42016V512h-217.6c0 32 9.6 60.8 32 83.2 9.6 12.8 28.8 28.8 57.6 51.2l12.8 9.6c19.2 12.8 35.2 25.6 41.6 35.2 12.8 16 19.2 32 19.2 51.2 0 16-6.4 28.8-12.8 38.4-9.6 9.6-22.4 12.8-41.6 12.8-19.2 0-35.2-6.4-44.8-19.2-9.6-12.8-16-32-16-54.4h-51.2c0 35.2 9.6 64 32 86.4 22.4 12.8 51.2 25.6 83.2 25.6z" horiz-adv-x="1024" />
|
|
18
22
|
|
|
19
23
|
<glyph glyph-name="sdoc-subscript" unicode="" d="M659.62016 812.8c22.4 22.4 57.6 25.6 83.2 6.4l6.4-6.4 3.2-3.2c22.4-22.4 25.6-57.6 9.6-83.2l-6.4-6.4L474.02016 384l281.6-336c22.4-25.6 22.4-67.2-3.2-92.8l-3.2-3.2c-12.8-9.6-28.8-16-44.8-16-16 0-32 6.4-44.8 19.2l-3.2 3.2L384.42016 281.6 112.42016-44.8l-3.2-3.2c-22.4-22.4-57.6-25.6-80-6.4l-6.4 6.4-3.2 3.2c-22.4 22.4-25.6 57.6-9.6 83.2l6.4 6.4L298.02016 384 16.42016 720c-22.4 25.6-22.4 67.2 3.2 92.8l3.2 3.2c12.8 9.6 28.8 16 44.8 16s32-6.4 44.8-19.2l3.2-3.2 272-320 272 323.2zM918.82016 288c28.8 0 54.4-9.6 73.6-25.6 19.2-16 28.8-38.4 28.8-67.2 0-28.8-9.6-51.2-32-73.6-9.6-12.8-28.8-25.6-54.4-41.6l-6.4-12.8c-32-22.4-51.2-38.4-57.6-54.4H1024.42016V-32h-217.6c0 32 9.6 60.8 32 83.2 9.6 12.8 28.8 28.8 60.8 48l12.8 9.6c19.2 12.8 35.2 25.6 41.6 35.2 12.8 16 19.2 32 19.2 51.2 0 16-6.4 28.8-12.8 38.4-9.6 9.6-22.4 12.8-41.6 12.8-19.2 0-35.2-6.4-44.8-19.2-9.6-12.8-16-32-16-54.4h-51.2c0 35.2 9.6 64 32 86.4 19.2 16 48 28.8 80 28.8z" horiz-adv-x="1024" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "sdocfont"; /* Project id 4097705 */
|
|
3
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
4
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
5
|
-
url('./sdoc-editor-font/iconfont.woff2?t=
|
|
6
|
-
url('./sdoc-editor-font/iconfont.woff?t=
|
|
7
|
-
url('iconfont.ttf?t=
|
|
8
|
-
url('./sdoc-editor-font/iconfont.svg?t=
|
|
3
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1689838000925'); /* IE9 */
|
|
4
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1689838000925#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
|
5
|
+
url('./sdoc-editor-font/iconfont.woff2?t=1689838000925') format('woff2'),
|
|
6
|
+
url('./sdoc-editor-font/iconfont.woff?t=1689838000925') format('woff'),
|
|
7
|
+
url('./sdoc-editor-font/iconfont.ttf?t=1689838000925') format('truetype'),
|
|
8
|
+
url('./sdoc-editor-font/iconfont.svg?t=1689838000925#sdocfont') format('svg');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.sdocfont {
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
-moz-osx-font-smoothing: grayscale;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
.sdoc-bg-color:before {
|
|
20
|
+
content: "\e604";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.sdoc-right-slide:before {
|
|
24
|
+
content: "\e602";
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
.sdoc-superscript:before {
|
|
20
28
|
content: "\e638";
|
|
21
29
|
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
.display-outline-icon {
|
|
2
|
-
line-height: 1;
|
|
3
|
-
font-size: 14px;
|
|
4
|
-
color: #888;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
width: 28px;
|
|
7
|
-
height: 28px;
|
|
8
|
-
background: #fff;
|
|
9
|
-
border-radius: 0 50% 50% 0;
|
|
10
|
-
box-shadow: 0 0 6px rgba(0,0,0, 0.12);
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
margin: 20px 230px 0 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.display-outline-icon:hover {
|
|
18
|
-
color: #333;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.sdoc-outline {
|
|
22
|
-
font-size: 14px;
|
|
23
|
-
width: 220px;
|
|
24
|
-
margin: 20px 30px 20px 16px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.sdoc-outline-header {
|
|
28
|
-
color: #999;
|
|
29
|
-
border-bottom: 1px solid #dbdbdb;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.font-size-inherit {
|
|
33
|
-
font-size: inherit;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.sdoc-outline-header .close-icon {
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
font-size: 14px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sdoc-outline-header .close-icon:hover {
|
|
42
|
-
color: #555;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.outline-item {
|
|
46
|
-
padding: 4px 0;
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.outline-item.active {
|
|
51
|
-
color: #ff8000;
|
|
52
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
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 { withTranslation } from 'react-i18next';
|
|
7
|
-
import { UncontrolledTooltip } from 'reactstrap';
|
|
8
|
-
import './assets/css/outline.css';
|
|
9
|
-
var SDocOutline = /*#__PURE__*/function (_React$PureComponent) {
|
|
10
|
-
_inherits(SDocOutline, _React$PureComponent);
|
|
11
|
-
var _super = _createSuper(SDocOutline);
|
|
12
|
-
function SDocOutline(props) {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, SDocOutline);
|
|
15
|
-
_this = _super.call(this, props);
|
|
16
|
-
_this.toggleShow = function () {
|
|
17
|
-
var docUuid = _this.props.docUuid;
|
|
18
|
-
_this.setState({
|
|
19
|
-
isShown: !_this.state.isShown
|
|
20
|
-
}, function () {
|
|
21
|
-
var currentValue = localStorage.getItem(docUuid);
|
|
22
|
-
var options = currentValue ? JSON.parse(currentValue) : {};
|
|
23
|
-
options['outlineOpen'] = _this.state.isShown;
|
|
24
|
-
localStorage.setItem(docUuid, JSON.stringify(options));
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
var _currentValue = localStorage.getItem(props.docUuid);
|
|
28
|
-
var _options = _currentValue ? JSON.parse(_currentValue) : {};
|
|
29
|
-
var _options$outlineOpen = _options.outlineOpen,
|
|
30
|
-
outlineOpen = _options$outlineOpen === void 0 ? false : _options$outlineOpen;
|
|
31
|
-
_this.state = {
|
|
32
|
-
isShown: outlineOpen
|
|
33
|
-
};
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
_createClass(SDocOutline, [{
|
|
37
|
-
key: "render",
|
|
38
|
-
value: function render() {
|
|
39
|
-
var _this$props = this.props,
|
|
40
|
-
doc = _this$props.doc,
|
|
41
|
-
t = _this$props.t;
|
|
42
|
-
var isShown = this.state.isShown;
|
|
43
|
-
var list = doc.filter(function (item) {
|
|
44
|
-
return item.type == 'header2' || item.type == 'header3';
|
|
45
|
-
});
|
|
46
|
-
return isShown ? /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: "sdoc-outline d-flex flex-column"
|
|
48
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: "sdoc-outline-header d-flex align-items-center justify-content-between py-1"
|
|
50
|
-
}, /*#__PURE__*/React.createElement("h2", {
|
|
51
|
-
className: "font-weight-normal m-0 font-size-inherit"
|
|
52
|
-
}, t('Outline')), /*#__PURE__*/React.createElement("span", {
|
|
53
|
-
onClick: this.toggleShow,
|
|
54
|
-
className: "close-icon sdocfont sdoc-cancel"
|
|
55
|
-
})), list.length ? /*#__PURE__*/React.createElement("ol", {
|
|
56
|
-
className: "list-unstyled py-2 flex-fill o-auto"
|
|
57
|
-
}, list.map(function (item, index) {
|
|
58
|
-
return /*#__PURE__*/React.createElement(OutlineItem, {
|
|
59
|
-
key: index,
|
|
60
|
-
item: item
|
|
61
|
-
});
|
|
62
|
-
})) : /*#__PURE__*/React.createElement("p", {
|
|
63
|
-
className: "mt-4 text-secondary"
|
|
64
|
-
}, t('Headings_you_add_to_the_document_will_appear_here'))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
65
|
-
onClick: this.toggleShow,
|
|
66
|
-
id: "display-outline-icon",
|
|
67
|
-
className: "display-outline-icon sdocfont sdoc-table-of-content",
|
|
68
|
-
style: {
|
|
69
|
-
'marginRight': (window.innerWidth - 794) / 2 - 36
|
|
70
|
-
}
|
|
71
|
-
}), /*#__PURE__*/React.createElement(UncontrolledTooltip, {
|
|
72
|
-
placement: "right",
|
|
73
|
-
target: "display-outline-icon"
|
|
74
|
-
}, t('Outline')));
|
|
75
|
-
}
|
|
76
|
-
}]);
|
|
77
|
-
return SDocOutline;
|
|
78
|
-
}(React.PureComponent);
|
|
79
|
-
var OutlineItem = /*#__PURE__*/function (_React$PureComponent2) {
|
|
80
|
-
_inherits(OutlineItem, _React$PureComponent2);
|
|
81
|
-
var _super2 = _createSuper(OutlineItem);
|
|
82
|
-
function OutlineItem(props) {
|
|
83
|
-
var _this2;
|
|
84
|
-
_classCallCheck(this, OutlineItem);
|
|
85
|
-
_this2 = _super2.call(this, props);
|
|
86
|
-
_this2.onItemClick = function () {
|
|
87
|
-
var item = _this2.props.item;
|
|
88
|
-
var id = item.id;
|
|
89
|
-
document.getElementById(id).scrollIntoView();
|
|
90
|
-
};
|
|
91
|
-
_this2.onMouseOver = function () {
|
|
92
|
-
_this2.setState({
|
|
93
|
-
isHighlighted: true
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
_this2.onMouseOut = function () {
|
|
97
|
-
_this2.setState({
|
|
98
|
-
isHighlighted: false
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
_this2.state = {
|
|
102
|
-
isHighlighted: false
|
|
103
|
-
};
|
|
104
|
-
return _this2;
|
|
105
|
-
}
|
|
106
|
-
_createClass(OutlineItem, [{
|
|
107
|
-
key: "render",
|
|
108
|
-
value: function render() {
|
|
109
|
-
var isHighlighted = this.state.isHighlighted;
|
|
110
|
-
var item = this.props.item;
|
|
111
|
-
var type = item.type,
|
|
112
|
-
children = item.children;
|
|
113
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
114
|
-
className: "outline-item ".concat(type == 'header3' ? 'pl-5' : '', " ").concat(isHighlighted ? 'active' : ''),
|
|
115
|
-
onClick: this.onItemClick,
|
|
116
|
-
onMouseOver: this.onMouseOver,
|
|
117
|
-
onMouseOut: this.onMouseOut
|
|
118
|
-
}, children.map(function (child) {
|
|
119
|
-
return child.text;
|
|
120
|
-
}).join(''));
|
|
121
|
-
}
|
|
122
|
-
}]);
|
|
123
|
-
return OutlineItem;
|
|
124
|
-
}(React.PureComponent);
|
|
125
|
-
export default withTranslation('sdoc-editor')(SDocOutline);
|